method
stringlengths 13
441k
| clean_method
stringlengths 7
313k
| doc
stringlengths 17
17.3k
| comment
stringlengths 3
1.42k
| method_name
stringlengths 1
273
| extra
dict | imports
sequence | imports_info
stringlengths 19
34.8k
| cluster_imports_info
stringlengths 15
3.66k
| libraries
sequence | libraries_info
stringlengths 6
661
| id
int64 0
2.92M
|
---|---|---|---|---|---|---|---|---|---|---|---|
public void setProblem(Problem p) {
this.problem = p;
}
| void function(Problem p) { this.problem = p; } | /**
* Sets the problem to the given problem
*
* @param p
* the problem
*/ | Sets the problem to the given problem | setProblem | {
"repo_name": "burks-pub/gecco2015",
"path": "src/main/java/ec/research/gp/simple/util/Config.java",
"license": "bsd-2-clause",
"size": 34172
} | [
"ec.research.gp.simple.problem.Problem"
] | import ec.research.gp.simple.problem.Problem; | import ec.research.gp.simple.problem.*; | [
"ec.research.gp"
] | ec.research.gp; | 1,054,427 |
AbstractFile userHome = LocalFile.getUserHome();
AbstractFile trashDir = userHome.getChildSilently(".local/share/Trash/");
if(isTrashFolder(trashDir)) {
return trashDir;
}
// No existing user trash was found: create the folder, only if it doesn't already exist.
if(!trashDir.exists()) {
try {
trashDir.mkdirs();
trashDir.getChild("info").mkdir();
trashDir.getChild("files").mkdir();
return trashDir;
}
catch(IOException e) {
// Will return null
}
}
return null;
} | AbstractFile userHome = LocalFile.getUserHome(); AbstractFile trashDir = userHome.getChildSilently(STR); if(isTrashFolder(trashDir)) { return trashDir; } if(!trashDir.exists()) { try { trashDir.mkdirs(); trashDir.getChild("info").mkdir(); trashDir.getChild("files").mkdir(); return trashDir; } catch(IOException e) { } } return null; } | /**
* Tries to find an existing user Trash folder and returns it. If no existing
* Trash folder was found, creates the standard Xfce user Trash folder and returns it.
*
* @return the user Trash folder, <code>null</code> if no user trash folder could be found or created
*/ | Tries to find an existing user Trash folder and returns it. If no existing Trash folder was found, creates the standard Xfce user Trash folder and returns it | getTrashFolder | {
"repo_name": "Keltek/mucommander",
"path": "src/main/com/mucommander/desktop/xfce/XfceTrash.java",
"license": "gpl-3.0",
"size": 12042
} | [
"com.mucommander.commons.file.AbstractFile",
"com.mucommander.commons.file.impl.local.LocalFile",
"java.io.IOException"
] | import com.mucommander.commons.file.AbstractFile; import com.mucommander.commons.file.impl.local.LocalFile; import java.io.IOException; | import com.mucommander.commons.file.*; import com.mucommander.commons.file.impl.local.*; import java.io.*; | [
"com.mucommander.commons",
"java.io"
] | com.mucommander.commons; java.io; | 2,160,086 |
protected Color getSelectionBackground()
{
return selectionBackground;
} | Color function() { return selectionBackground; } | /**
* This method returns the Color that the text is shown in when the bar is
* not over the text.
*
* @return The color of the text when the bar is not over it.
*/ | This method returns the Color that the text is shown in when the bar is not over the text | getSelectionBackground | {
"repo_name": "taciano-perez/JamVM-PH",
"path": "src/classpath/javax/swing/plaf/basic/BasicProgressBarUI.java",
"license": "gpl-2.0",
"size": 28432
} | [
"java.awt.Color"
] | import java.awt.Color; | import java.awt.*; | [
"java.awt"
] | java.awt; | 190,017 |
@Nullable
private static Object convertPrimitiveField(Group g, int fieldIndex, int index, boolean binaryAsString)
{
PrimitiveType pt = (PrimitiveType) g.getType().getFields().get(fieldIndex);
OriginalType ot = pt.getOriginalType();
try {
if (ot != null) {
// convert logical types
switch (ot) {
case DATE:
long ts = g.getInteger(fieldIndex, index) * MILLIS_IN_DAY;
return ts;
case TIME_MICROS:
return g.getLong(fieldIndex, index);
case TIME_MILLIS:
return g.getInteger(fieldIndex, index);
case TIMESTAMP_MICROS:
return TimeUnit.MILLISECONDS.convert(g.getLong(fieldIndex, index), TimeUnit.MICROSECONDS);
case TIMESTAMP_MILLIS:
return g.getLong(fieldIndex, index);
case INTERVAL:
Binary intervalVal = g.getBinary(fieldIndex, index);
IntBuffer intBuf = intervalVal.toByteBuffer().order(ByteOrder.LITTLE_ENDIAN).asIntBuffer();
int months = intBuf.get(0);
int days = intBuf.get(1);
int millis = intBuf.get(2);
StringBuilder periodBuilder = new StringBuilder("P");
if (months > 0) {
periodBuilder.append(months).append("M");
}
if (days > 0) {
periodBuilder.append(days).append("D");
}
if (periodBuilder.length() > 1) {
Period p = Period.parse(periodBuilder.toString());
Duration d = p.toStandardDuration().plus(millis);
return d;
} else {
return new Duration(millis);
}
case INT_8:
case INT_16:
case INT_32:
return g.getInteger(fieldIndex, index);
case INT_64:
return g.getLong(fieldIndex, index);
// todo: idk wtd about unsigned
case UINT_8:
case UINT_16:
case UINT_32:
return g.getInteger(fieldIndex, index);
case UINT_64:
return g.getLong(fieldIndex, index);
case DECIMAL:
int precision = pt.asPrimitiveType().getDecimalMetadata().getPrecision();
int scale = pt.asPrimitiveType().getDecimalMetadata().getScale();
switch (pt.getPrimitiveTypeName()) {
case INT32:
return new BigDecimal(g.getInteger(fieldIndex, index));
case INT64:
return new BigDecimal(g.getLong(fieldIndex, index));
case FIXED_LEN_BYTE_ARRAY:
case BINARY:
Binary value = g.getBinary(fieldIndex, index);
return convertBinaryToDecimal(value, precision, scale);
default:
throw new RE(
"Unknown 'DECIMAL' type supplied to primitive conversion: %s (this should never happen)",
pt.getPrimitiveTypeName()
);
}
case UTF8:
case ENUM:
case JSON:
return g.getString(fieldIndex, index);
case LIST:
case MAP:
case MAP_KEY_VALUE:
case BSON:
default:
throw new RE(
"Non-primitive supplied to primitive conversion: %s (this should never happen)",
ot.name()
);
}
} else {
// fallback to handling the raw primitive type if no logical type mapping
switch (pt.getPrimitiveTypeName()) {
case BOOLEAN:
return g.getBoolean(fieldIndex, index);
case INT32:
return g.getInteger(fieldIndex, index);
case INT64:
return g.getLong(fieldIndex, index);
case FLOAT:
return g.getFloat(fieldIndex, index);
case DOUBLE:
return g.getDouble(fieldIndex, index);
case INT96:
Binary tsBin = g.getInt96(fieldIndex, index);
return convertInt96BinaryToTimestamp(tsBin);
case FIXED_LEN_BYTE_ARRAY:
case BINARY:
Binary bin = g.getBinary(fieldIndex, index);
byte[] bytes = bin.getBytes();
if (binaryAsString) {
return StringUtils.fromUtf8(bytes);
} else {
return bytes;
}
default:
throw new RE("Unknown primitive conversion: %s", ot.name());
}
}
}
catch (Exception ex) {
return null;
}
} | static Object function(Group g, int fieldIndex, int index, boolean binaryAsString) { PrimitiveType pt = (PrimitiveType) g.getType().getFields().get(fieldIndex); OriginalType ot = pt.getOriginalType(); try { if (ot != null) { switch (ot) { case DATE: long ts = g.getInteger(fieldIndex, index) * MILLIS_IN_DAY; return ts; case TIME_MICROS: return g.getLong(fieldIndex, index); case TIME_MILLIS: return g.getInteger(fieldIndex, index); case TIMESTAMP_MICROS: return TimeUnit.MILLISECONDS.convert(g.getLong(fieldIndex, index), TimeUnit.MICROSECONDS); case TIMESTAMP_MILLIS: return g.getLong(fieldIndex, index); case INTERVAL: Binary intervalVal = g.getBinary(fieldIndex, index); IntBuffer intBuf = intervalVal.toByteBuffer().order(ByteOrder.LITTLE_ENDIAN).asIntBuffer(); int months = intBuf.get(0); int days = intBuf.get(1); int millis = intBuf.get(2); StringBuilder periodBuilder = new StringBuilder("P"); if (months > 0) { periodBuilder.append(months).append("M"); } if (days > 0) { periodBuilder.append(days).append("D"); } if (periodBuilder.length() > 1) { Period p = Period.parse(periodBuilder.toString()); Duration d = p.toStandardDuration().plus(millis); return d; } else { return new Duration(millis); } case INT_8: case INT_16: case INT_32: return g.getInteger(fieldIndex, index); case INT_64: return g.getLong(fieldIndex, index); case UINT_8: case UINT_16: case UINT_32: return g.getInteger(fieldIndex, index); case UINT_64: return g.getLong(fieldIndex, index); case DECIMAL: int precision = pt.asPrimitiveType().getDecimalMetadata().getPrecision(); int scale = pt.asPrimitiveType().getDecimalMetadata().getScale(); switch (pt.getPrimitiveTypeName()) { case INT32: return new BigDecimal(g.getInteger(fieldIndex, index)); case INT64: return new BigDecimal(g.getLong(fieldIndex, index)); case FIXED_LEN_BYTE_ARRAY: case BINARY: Binary value = g.getBinary(fieldIndex, index); return convertBinaryToDecimal(value, precision, scale); default: throw new RE( STR, pt.getPrimitiveTypeName() ); } case UTF8: case ENUM: case JSON: return g.getString(fieldIndex, index); case LIST: case MAP: case MAP_KEY_VALUE: case BSON: default: throw new RE( STR, ot.name() ); } } else { switch (pt.getPrimitiveTypeName()) { case BOOLEAN: return g.getBoolean(fieldIndex, index); case INT32: return g.getInteger(fieldIndex, index); case INT64: return g.getLong(fieldIndex, index); case FLOAT: return g.getFloat(fieldIndex, index); case DOUBLE: return g.getDouble(fieldIndex, index); case INT96: Binary tsBin = g.getInt96(fieldIndex, index); return convertInt96BinaryToTimestamp(tsBin); case FIXED_LEN_BYTE_ARRAY: case BINARY: Binary bin = g.getBinary(fieldIndex, index); byte[] bytes = bin.getBytes(); if (binaryAsString) { return StringUtils.fromUtf8(bytes); } else { return bytes; } default: throw new RE(STR, ot.name()); } } } catch (Exception ex) { return null; } } | /**
* Convert a primitive group field to a "ingestion friendly" java object
*
* @return "ingestion ready" java object, or null
*/ | Convert a primitive group field to a "ingestion friendly" java object | convertPrimitiveField | {
"repo_name": "knoguchi/druid",
"path": "extensions-core/parquet-extensions/src/main/java/org/apache/druid/data/input/parquet/simple/ParquetGroupConverter.java",
"license": "apache-2.0",
"size": 18640
} | [
"java.math.BigDecimal",
"java.nio.ByteOrder",
"java.nio.IntBuffer",
"java.util.concurrent.TimeUnit",
"org.apache.druid.java.util.common.StringUtils",
"org.apache.parquet.example.data.Group",
"org.apache.parquet.io.api.Binary",
"org.apache.parquet.schema.OriginalType",
"org.apache.parquet.schema.PrimitiveType",
"org.joda.time.Duration",
"org.joda.time.Period"
] | import java.math.BigDecimal; import java.nio.ByteOrder; import java.nio.IntBuffer; import java.util.concurrent.TimeUnit; import org.apache.druid.java.util.common.StringUtils; import org.apache.parquet.example.data.Group; import org.apache.parquet.io.api.Binary; import org.apache.parquet.schema.OriginalType; import org.apache.parquet.schema.PrimitiveType; import org.joda.time.Duration; import org.joda.time.Period; | import java.math.*; import java.nio.*; import java.util.concurrent.*; import org.apache.druid.java.util.common.*; import org.apache.parquet.example.data.*; import org.apache.parquet.io.api.*; import org.apache.parquet.schema.*; import org.joda.time.*; | [
"java.math",
"java.nio",
"java.util",
"org.apache.druid",
"org.apache.parquet",
"org.joda.time"
] | java.math; java.nio; java.util; org.apache.druid; org.apache.parquet; org.joda.time; | 387,400 |
private ObjectName mxBean = null;
void registerMXBean(Configuration conf) {
// We wrap to bypass standard mbean naming convention.
// This wraping can be removed in java 6 as it is more flexible in
// package naming for mbeans and their impl.
mxBean = MBeans.register("DataNode", "DataNodeInfo", this);
} | ObjectName mxBean = null; void function(Configuration conf) { mxBean = MBeans.register(STR, STR, this); } | /**
* Register the DataNode MXBean using the name
* "hadoop:service=DataNode,name=DataNodeInfo"
*/ | Register the DataNode MXBean using the name "hadoop:service=DataNode,name=DataNodeInfo" | registerMXBean | {
"repo_name": "williamsentosa/hadoop-modified",
"path": "src/hdfs/org/apache/hadoop/hdfs/server/datanode/DataNode.java",
"license": "apache-2.0",
"size": 85969
} | [
"javax.management.ObjectName",
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.metrics2.util.MBeans"
] | import javax.management.ObjectName; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.metrics2.util.MBeans; | import javax.management.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.metrics2.util.*; | [
"javax.management",
"org.apache.hadoop"
] | javax.management; org.apache.hadoop; | 1,016,703 |
@Override
protected boolean verifySelection()
{
// Assume the dialog input is valid
boolean validFlag = true;
// Get the input values as strings
String newMinX = minXTextField.getText().trim();
String newMaxX = maxXTextField.getText().trim();
// Regular expression for a decimal number in the form #.#, #., .#, -#,
// -#., -.#, or -#.#
String pattern = "(-?\\d*\\.?\\d+)|(-?\\d+\\.?\\d*)";
// Ensure that the x-axis minimum and maximum fields contain numbers
// (not blank and no alphabetical characters)
if (!newMinX.matches(pattern) || !newMaxX.matches(pattern))
{
// Inform the user that the x-value is invalid
new CPMDialogHandler().showMessageDialog(this,
"<html><b>X-axis values cannot be blank<br>or contain non-numeric characters",
"Invalid Value",
JOptionPane.ERROR_MESSAGE,
OK_OPTION);
// Set the flag to indicate an invalid input
validFlag = false;
}
// Ensure that the x-axis minimum is less than the maximum. Y-axis
// labels don't require checking since the combo box' contents limits
// the selection to legal values
else if (Double.valueOf(newMinX) >= Double.valueOf(newMaxX))
{
// Inform the user that the minimum x-value must be less
// than the maximum x-value
new CPMDialogHandler().showMessageDialog(this,
"<html><b>Minimum x-value must be<br>less than the maximum x-value",
"Invalid Value",
JOptionPane.ERROR_MESSAGE,
OK_OPTION);
// Set the flag to indicate an invalid input
validFlag = false;
}
return validFlag;
} | boolean function() { boolean validFlag = true; String newMinX = minXTextField.getText().trim(); String newMaxX = maxXTextField.getText().trim(); String pattern = STR; if (!newMinX.matches(pattern) !newMaxX.matches(pattern)) { new CPMDialogHandler().showMessageDialog(this, STR, STR, JOptionPane.ERROR_MESSAGE, OK_OPTION); validFlag = false; } else if (Double.valueOf(newMinX) >= Double.valueOf(newMaxX)) { new CPMDialogHandler().showMessageDialog(this, STR, STR, JOptionPane.ERROR_MESSAGE, OK_OPTION); validFlag = false; } return validFlag; } | /**************************************************************************
* Verify that the bounds are valid
*
* @return true if the x-axis values are valid
*************************************************************************/ | Verify that the bounds are valid | verifySelection | {
"repo_name": "CACTUS-Mission/TRAPSat",
"path": "TRAPSat_cFS/cfs/cfe/tools/perfutils-java/src/CFSPerformanceMonitor/CPMSetBoundsDialog.java",
"license": "mit",
"size": 21180
} | [
"javax.swing.JOptionPane"
] | import javax.swing.JOptionPane; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 587,503 |
public static ComparatorProtos.Comparator toComparator(ByteArrayComparable comparator) {
ComparatorProtos.Comparator.Builder builder = ComparatorProtos.Comparator.newBuilder();
builder.setName(comparator.getClass().getName());
builder.setSerializedComparator(ByteStringer.wrap(comparator.toByteArray()));
return builder.build();
} | static ComparatorProtos.Comparator function(ByteArrayComparable comparator) { ComparatorProtos.Comparator.Builder builder = ComparatorProtos.Comparator.newBuilder(); builder.setName(comparator.getClass().getName()); builder.setSerializedComparator(ByteStringer.wrap(comparator.toByteArray())); return builder.build(); } | /**
* Convert a ByteArrayComparable to a protocol buffer Comparator
*
* @param comparator the ByteArrayComparable to convert
* @return the converted protocol buffer Comparator
*/ | Convert a ByteArrayComparable to a protocol buffer Comparator | toComparator | {
"repo_name": "JingchengDu/hbase",
"path": "hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java",
"license": "apache-2.0",
"size": 69138
} | [
"org.apache.hadoop.hbase.filter.ByteArrayComparable",
"org.apache.hadoop.hbase.protobuf.generated.ComparatorProtos",
"org.apache.hadoop.hbase.util.ByteStringer"
] | import org.apache.hadoop.hbase.filter.ByteArrayComparable; import org.apache.hadoop.hbase.protobuf.generated.ComparatorProtos; import org.apache.hadoop.hbase.util.ByteStringer; | import org.apache.hadoop.hbase.filter.*; import org.apache.hadoop.hbase.protobuf.generated.*; import org.apache.hadoop.hbase.util.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 858,063 |
@Test
public void signLikePauloGonçalvesOriginal() throws Exception {
String basePath = RESULT_FOLDER.getPath() + '/';
try ( InputStream pdfResource = getClass().getResourceAsStream("/mkl/testarea/itext5/extract/test.pdf");
InputStream img1Resource = getClass().getResourceAsStream("/mkl/testarea/itext5/content/2x2colored.png");
InputStream img2Resource = getClass().getResourceAsStream("/mkl/testarea/itext5/stamp/Signature.png")) {
Files.copy(pdfResource, Paths.get(basePath, "nonsigned.pdf"), StandardCopyOption.REPLACE_EXISTING);
Files.copy(img1Resource, Paths.get(basePath, "signing1.png"), StandardCopyOption.REPLACE_EXISTING);
Files.copy(img2Resource, Paths.get(basePath, "signing2.png"), StandardCopyOption.REPLACE_EXISTING);
}
signLikePauloGonçalves(new FileInputStream(basePath+"nonsigned.pdf"), new FileOutputStream(basePath+"nonsigned.pdf"), null, "mycert3".toCharArray(), "something", "something", basePath + "signing1.png");
signLikePauloGonçalves(new FileInputStream(basePath+"nonsigned.pdf"), new FileOutputStream(basePath+"signed.pdf"), null, "mycert4".toCharArray(), "something", "something", basePath + "signing2.png");
} | void function() throws Exception { String basePath = RESULT_FOLDER.getPath() + '/'; try ( InputStream pdfResource = getClass().getResourceAsStream(STR); InputStream img1Resource = getClass().getResourceAsStream(STR); InputStream img2Resource = getClass().getResourceAsStream(STR)) { Files.copy(pdfResource, Paths.get(basePath, STR), StandardCopyOption.REPLACE_EXISTING); Files.copy(img1Resource, Paths.get(basePath, STR), StandardCopyOption.REPLACE_EXISTING); Files.copy(img2Resource, Paths.get(basePath, STR), StandardCopyOption.REPLACE_EXISTING); } signLikePauloGonçalves(new FileInputStream(basePath+STR), new FileOutputStream(basePath+STR), null, STR.toCharArray(), STR, STR, basePath + STR); signLikePauloGonçalves(new FileInputStream(basePath+STR), new FileOutputStream(basePath+STR), null, STR.toCharArray(), STR, STR, basePath + STR); } | /**
* <a href="https://stackoverflow.com/questions/62271473/multiple-signings-in-pdf-file-using-itext">
* Multiple Signings in pdf File using IText
* </a>
* <p>
* This is like the OP's original code. Already the first <code>sign</code>
* call truncates the original file before iText could read it. Thus, iText
* throws an exception.
* </p>
* @see #signLikePauloGonçalves(InputStream, OutputStream, InputStream, char[], String, String, String)
*/ | Multiple Signings in pdf File using IText This is like the OP's original code. Already the first <code>sign</code> call truncates the original file before iText could read it. Thus, iText throws an exception. | signLikePauloGonçalvesOriginal | {
"repo_name": "mkl-public/testarea-itext5",
"path": "src/test/java/mkl/testarea/itext5/signature/CreateSignature.java",
"license": "agpl-3.0",
"size": 47208
} | [
"java.io.FileInputStream",
"java.io.FileOutputStream",
"java.io.InputStream",
"java.nio.file.Files",
"java.nio.file.Paths",
"java.nio.file.StandardCopyOption"
] | import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.InputStream; import java.nio.file.Files; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; | import java.io.*; import java.nio.file.*; | [
"java.io",
"java.nio"
] | java.io; java.nio; | 2,867,308 |
public Builder addStringSequenceVariable(String name, ImmutableSet<String> values) {
checkVariableNotPresentAlready(name);
Preconditions.checkNotNull(values, "Cannot set null as a value for variable '%s'", name);
ImmutableList.Builder<String> builder = ImmutableList.builder();
builder.addAll(values);
variablesMap.put(name, new StringSequence(builder.build()));
return this;
} | Builder function(String name, ImmutableSet<String> values) { checkVariableNotPresentAlready(name); Preconditions.checkNotNull(values, STR, name); ImmutableList.Builder<String> builder = ImmutableList.builder(); builder.addAll(values); variablesMap.put(name, new StringSequence(builder.build())); return this; } | /**
* Add a sequence variable that expands {@code name} to {@code values}.
*
* <p>Accepts values as ImmutableSet. As ImmutableList has smaller memory footprint, we copy
* the values into a new list.
*/ | Add a sequence variable that expands name to values. Accepts values as ImmutableSet. As ImmutableList has smaller memory footprint, we copy the values into a new list | addStringSequenceVariable | {
"repo_name": "damienmg/bazel",
"path": "src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainFeatures.java",
"license": "apache-2.0",
"size": 85726
} | [
"com.google.common.base.Preconditions",
"com.google.common.collect.ImmutableList",
"com.google.common.collect.ImmutableSet"
] | import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; | import com.google.common.base.*; import com.google.common.collect.*; | [
"com.google.common"
] | com.google.common; | 793,031 |
public Observable<ServiceResponse<Page<ResourceMetricDefinitionInner>>> listMetricDefintionsNextSinglePageAsync(final String nextPageLink) {
if (nextPageLink == null) {
throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
} | Observable<ServiceResponse<Page<ResourceMetricDefinitionInner>>> function(final String nextPageLink) { if (nextPageLink == null) { throw new IllegalArgumentException(STR); } | /**
* Get metrics that can be queried for an App Service plan, and their definitions.
* Get metrics that can be queried for an App Service plan, and their definitions.
*
ServiceResponse<PageImpl<ResourceMetricDefinitionInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<ResourceMetricDefinitionInner> object wrapped in {@link ServiceResponse} if successful.
*/ | Get metrics that can be queried for an App Service plan, and their definitions. Get metrics that can be queried for an App Service plan, and their definitions | listMetricDefintionsNextSinglePageAsync | {
"repo_name": "jianghaolu/azure-sdk-for-java",
"path": "azure-mgmt-appservice/src/main/java/com/microsoft/azure/management/appservice/implementation/AppServicePlansInner.java",
"license": "mit",
"size": 260114
} | [
"com.microsoft.azure.Page",
"com.microsoft.rest.ServiceResponse"
] | import com.microsoft.azure.Page; import com.microsoft.rest.ServiceResponse; | import com.microsoft.azure.*; import com.microsoft.rest.*; | [
"com.microsoft.azure",
"com.microsoft.rest"
] | com.microsoft.azure; com.microsoft.rest; | 130,201 |
private int getParamMaxLength() throws UnsupportedEncodingException {
int length = 0;
length += 25 * 2; // tagId + tagLength
length += 27; // fixed sizes
length += getFilterPeriodBegin() == INVALID_VALUE_PARAMETER ? 0 : 15;
length += getFilterPeriodEnd() == INVALID_VALUE_PARAMETER ? 0 : 15;
if (getFilterRecipient() != null)
length += getFilterRecipient().getBytes("UTF-8").length;
if (getFilterOriginator() != null)
length += getFilterOriginator().getBytes("UTF-8").length;
length += getMseTime() == INVALID_VALUE_PARAMETER ? 0 : 20;
return length;
} | int function() throws UnsupportedEncodingException { int length = 0; length += 25 * 2; length += 27; length += getFilterPeriodBegin() == INVALID_VALUE_PARAMETER ? 0 : 15; length += getFilterPeriodEnd() == INVALID_VALUE_PARAMETER ? 0 : 15; if (getFilterRecipient() != null) length += getFilterRecipient().getBytes("UTF-8").length; if (getFilterOriginator() != null) length += getFilterOriginator().getBytes("UTF-8").length; length += getMseTime() == INVALID_VALUE_PARAMETER ? 0 : 20; return length; } | /**
* Get the approximate length needed to store the appParameters in a byte
* array.
*
* @return the length in bytes
* @throws UnsupportedEncodingException
* if the platform does not support UTF-8 encoding.
*/ | Get the approximate length needed to store the appParameters in a byte array | getParamMaxLength | {
"repo_name": "s20121035/rk3288_android5.1_repo",
"path": "packages/apps/Bluetooth/src/com/android/bluetooth/map/BluetoothMapAppParams.java",
"license": "gpl-3.0",
"size": 35382
} | [
"java.io.UnsupportedEncodingException"
] | import java.io.UnsupportedEncodingException; | import java.io.*; | [
"java.io"
] | java.io; | 1,072,200 |
public synchronized void setReader(Reader newReader) {
reader = newReader;
buffer.setLength(0);
} | synchronized void function(Reader newReader) { reader = newReader; buffer.setLength(0); } | /**
* Sets the reader object.
*
* @param newReader new reader object.
*/ | Sets the reader object | setReader | {
"repo_name": "rrobek/JapanMapTranslate",
"path": "src/kanaconv/KanjiInput.java",
"license": "gpl-2.0",
"size": 5687
} | [
"java.io.Reader"
] | import java.io.Reader; | import java.io.*; | [
"java.io"
] | java.io; | 23,179 |
void setTypeface(@Nullable Typeface typeface); | void setTypeface(@Nullable Typeface typeface); | /**
* Sets a typeface in which the text of this view should be displayed.
* <p>
* <b>Note</b>, that not all Typeface families actually have bold and italic variants, so you
* may need to use {@link #setTypeface(Typeface, int)} to get the appearance that you actually
* want.
*
* @param typeface The desired typeface. May be {@code null} to use a default one.
*/ | Sets a typeface in which the text of this view should be displayed. Note, that not all Typeface families actually have bold and italic variants, so you may need to use <code>#setTypeface(Typeface, int)</code> to get the appearance that you actually want | setTypeface | {
"repo_name": "android-libraries/android_ui",
"path": "library/src/base/java/com/albedinsky/android/ui/widget/FontWidget.java",
"license": "apache-2.0",
"size": 2958
} | [
"android.graphics.Typeface",
"android.support.annotation.Nullable"
] | import android.graphics.Typeface; import android.support.annotation.Nullable; | import android.graphics.*; import android.support.annotation.*; | [
"android.graphics",
"android.support"
] | android.graphics; android.support; | 1,888,367 |
public interface IndexSearcherWrapperFactory {
IndexSearcherWrapper newWrapper(IndexService indexService);
} | interface IndexSearcherWrapperFactory { IndexSearcherWrapper function(IndexService indexService); } | /**
* Returns a new IndexSearcherWrapper. This method is called once per index per node
*/ | Returns a new IndexSearcherWrapper. This method is called once per index per node | newWrapper | {
"repo_name": "jprante/elasticsearch-server",
"path": "server/src/main/java/org/elasticsearch/index/IndexModule.java",
"license": "apache-2.0",
"size": 18362
} | [
"org.elasticsearch.index.shard.IndexSearcherWrapper"
] | import org.elasticsearch.index.shard.IndexSearcherWrapper; | import org.elasticsearch.index.shard.*; | [
"org.elasticsearch.index"
] | org.elasticsearch.index; | 157,853 |
@Override
public void addCollisionBoxesToList(final World world, final BlockPos coord, final IBlockState bs, final AxisAlignedBB box, final List collisionBoxList, final Entity entity) {
final boolean connectNorth = this.canConnectTo(world,coord,EnumFacing.NORTH, coord.north());
final boolean connectSouth = this.canConnectTo(world,coord,EnumFacing.SOUTH, coord.south());
final boolean connectWest = this.canConnectTo(world,coord,EnumFacing.WEST, coord.west());
final boolean connectEast = this.canConnectTo(world,coord,EnumFacing.EAST, coord.east());
final boolean connectUp = this.canConnectTo(world,coord,EnumFacing.UP, coord.up());
final boolean connectDown = this.canConnectTo(world,coord,EnumFacing.DOWN, coord.down());
float rminus = 0.5f - 0.25f;
float rplus = 0.5f + 0.25f;
this.setBlockBounds(rminus, rminus, rminus, rplus, rplus, rplus);
super.addCollisionBoxesToList(world, coord, bs, box, collisionBoxList, entity);
if(connectUp){
this.setBlockBounds(rminus, rminus, rminus, rplus, 1f, rplus);
super.addCollisionBoxesToList(world, coord, bs, box, collisionBoxList, entity);
}
if(connectDown){
this.setBlockBounds(rminus, 0f, rminus, rplus, rplus, rplus);
super.addCollisionBoxesToList(world, coord, bs, box, collisionBoxList, entity);
}
if(connectEast){
this.setBlockBounds(rminus, rminus, rminus, 1f, rplus, rplus);
super.addCollisionBoxesToList(world, coord, bs, box, collisionBoxList, entity);
}
if(connectWest){
this.setBlockBounds(0f, rminus, rminus, rplus, rplus, rplus);
super.addCollisionBoxesToList(world, coord, bs, box, collisionBoxList, entity);
}
if(connectSouth){
this.setBlockBounds(rminus, rminus, rminus, rplus, rplus, 1f);
super.addCollisionBoxesToList(world, coord, bs, box, collisionBoxList, entity);
}
if(connectNorth){
this.setBlockBounds(rminus, rminus, 0f, rplus, rplus, rplus);
super.addCollisionBoxesToList(world, coord, bs, box, collisionBoxList, entity);
}
}
| void function(final World world, final BlockPos coord, final IBlockState bs, final AxisAlignedBB box, final List collisionBoxList, final Entity entity) { final boolean connectNorth = this.canConnectTo(world,coord,EnumFacing.NORTH, coord.north()); final boolean connectSouth = this.canConnectTo(world,coord,EnumFacing.SOUTH, coord.south()); final boolean connectWest = this.canConnectTo(world,coord,EnumFacing.WEST, coord.west()); final boolean connectEast = this.canConnectTo(world,coord,EnumFacing.EAST, coord.east()); final boolean connectUp = this.canConnectTo(world,coord,EnumFacing.UP, coord.up()); final boolean connectDown = this.canConnectTo(world,coord,EnumFacing.DOWN, coord.down()); float rminus = 0.5f - 0.25f; float rplus = 0.5f + 0.25f; this.setBlockBounds(rminus, rminus, rminus, rplus, rplus, rplus); super.addCollisionBoxesToList(world, coord, bs, box, collisionBoxList, entity); if(connectUp){ this.setBlockBounds(rminus, rminus, rminus, rplus, 1f, rplus); super.addCollisionBoxesToList(world, coord, bs, box, collisionBoxList, entity); } if(connectDown){ this.setBlockBounds(rminus, 0f, rminus, rplus, rplus, rplus); super.addCollisionBoxesToList(world, coord, bs, box, collisionBoxList, entity); } if(connectEast){ this.setBlockBounds(rminus, rminus, rminus, 1f, rplus, rplus); super.addCollisionBoxesToList(world, coord, bs, box, collisionBoxList, entity); } if(connectWest){ this.setBlockBounds(0f, rminus, rminus, rplus, rplus, rplus); super.addCollisionBoxesToList(world, coord, bs, box, collisionBoxList, entity); } if(connectSouth){ this.setBlockBounds(rminus, rminus, rminus, rplus, rplus, 1f); super.addCollisionBoxesToList(world, coord, bs, box, collisionBoxList, entity); } if(connectNorth){ this.setBlockBounds(rminus, rminus, 0f, rplus, rplus, rplus); super.addCollisionBoxesToList(world, coord, bs, box, collisionBoxList, entity); } } | /**
* Calculates the collision boxes for this block.
*/ | Calculates the collision boxes for this block | addCollisionBoxesToList | {
"repo_name": "28Smiles/E-Craft",
"path": "main/java/de/ecraft/blocks/SteamPipe.java",
"license": "gpl-3.0",
"size": 10366
} | [
"java.util.List",
"net.minecraft.block.state.IBlockState",
"net.minecraft.entity.Entity",
"net.minecraft.util.AxisAlignedBB",
"net.minecraft.util.BlockPos",
"net.minecraft.util.EnumFacing",
"net.minecraft.world.World"
] | import java.util.List; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.Entity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; | import java.util.*; import net.minecraft.block.state.*; import net.minecraft.entity.*; import net.minecraft.util.*; import net.minecraft.world.*; | [
"java.util",
"net.minecraft.block",
"net.minecraft.entity",
"net.minecraft.util",
"net.minecraft.world"
] | java.util; net.minecraft.block; net.minecraft.entity; net.minecraft.util; net.minecraft.world; | 1,698,747 |
public Set<ImmutableBitSet> getUniqueKeys(Minus rel,
RelMetadataQuery mq, boolean ignoreNulls) {
Set<ImmutableBitSet> uniqueKeys = mq.getUniqueKeys(rel.getInput(0), ignoreNulls);
if (uniqueKeys != null) {
return uniqueKeys;
}
if (!rel.all) {
return ImmutableSet.of(
ImmutableBitSet.range(rel.getRowType().getFieldCount()));
}
return ImmutableSet.of();
} | Set<ImmutableBitSet> function(Minus rel, RelMetadataQuery mq, boolean ignoreNulls) { Set<ImmutableBitSet> uniqueKeys = mq.getUniqueKeys(rel.getInput(0), ignoreNulls); if (uniqueKeys != null) { return uniqueKeys; } if (!rel.all) { return ImmutableSet.of( ImmutableBitSet.range(rel.getRowType().getFieldCount())); } return ImmutableSet.of(); } | /**
* The unique keys of Minus are precisely the unique keys of its first input.
*/ | The unique keys of Minus are precisely the unique keys of its first input | getUniqueKeys | {
"repo_name": "apache/calcite",
"path": "core/src/main/java/org/apache/calcite/rel/metadata/RelMdUniqueKeys.java",
"license": "apache-2.0",
"size": 12093
} | [
"com.google.common.collect.ImmutableSet",
"java.util.Set",
"org.apache.calcite.rel.core.Minus",
"org.apache.calcite.util.ImmutableBitSet"
] | import com.google.common.collect.ImmutableSet; import java.util.Set; import org.apache.calcite.rel.core.Minus; import org.apache.calcite.util.ImmutableBitSet; | import com.google.common.collect.*; import java.util.*; import org.apache.calcite.rel.core.*; import org.apache.calcite.util.*; | [
"com.google.common",
"java.util",
"org.apache.calcite"
] | com.google.common; java.util; org.apache.calcite; | 1,229,865 |
@Nullable RenderObject commit(@NonNull Class<?> clazz, @Router.Direction int how, long identifier); | @Nullable RenderObject commit(@NonNull Class<?> clazz, @Router.Direction int how, long identifier); | /**
* Commit the class into the parent.
* The class should be an instance of RenderObject. You should validate that previously
* (else it will throw a bad cast when returning the instance)
*
* @param clazz to render
* @param how to commit it (animations?)
* @param identifier of the transaction that is being done
* @return rendered instance (view/fragment/etc)
*/ | Commit the class into the parent. The class should be an instance of RenderObject. You should validate that previously (else it will throw a bad cast when returning the instance) | commit | {
"repo_name": "saantiaguilera/android-api-graph_flow",
"path": "core/src/main/java/com/u/core/node/NodeSwitcher.java",
"license": "gpl-3.0",
"size": 973
} | [
"android.support.annotation.NonNull",
"android.support.annotation.Nullable",
"com.u.core.Router"
] | import android.support.annotation.NonNull; import android.support.annotation.Nullable; import com.u.core.Router; | import android.support.annotation.*; import com.u.core.*; | [
"android.support",
"com.u.core"
] | android.support; com.u.core; | 1,387,819 |
public static String getAutoToggleModeOnNewWifi(final Context context) {
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
return sp.getString(PREF_AUTO_TOGGLE_DEFAULT_VALUE_FOR_NEW_WIFI, Config
.DEFAULT_AUTO_TOGGLE_VALUE);
} | static String function(final Context context) { SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context); return sp.getString(PREF_AUTO_TOGGLE_DEFAULT_VALUE_FOR_NEW_WIFI, Config .DEFAULT_AUTO_TOGGLE_VALUE); } | /**
* Gets wifi auto toggle value for wifis the user connects to for the first time.
*
* @param context
* @return String
*/ | Gets wifi auto toggle value for wifis the user connects to for the first time | getAutoToggleModeOnNewWifi | {
"repo_name": "chris-carneiro/Wi-Fi-Toggler",
"path": "app/src/main/java/net/opencurlybraces/android/projects/wifitoggler/util/PrefUtils.java",
"license": "apache-2.0",
"size": 9009
} | [
"android.content.Context",
"android.content.SharedPreferences",
"android.preference.PreferenceManager",
"net.opencurlybraces.android.projects.wifitoggler.Config"
] | import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager; import net.opencurlybraces.android.projects.wifitoggler.Config; | import android.content.*; import android.preference.*; import net.opencurlybraces.android.projects.wifitoggler.*; | [
"android.content",
"android.preference",
"net.opencurlybraces.android"
] | android.content; android.preference; net.opencurlybraces.android; | 322,603 |
public void init() {
try {
reloadProperties();
} catch (ProvidedConfigurationException pce) {
LogService.getRoot().log(Level.SEVERE, pce.getDialogMessage(), pce);
// Show error message and wait
StartupFailedDialogProvider.showErrorMessage(pce);
throw pce;
}
restartTimer();
} | void function() { try { reloadProperties(); } catch (ProvidedConfigurationException pce) { LogService.getRoot().log(Level.SEVERE, pce.getDialogMessage(), pce); StartupFailedDialogProvider.showErrorMessage(pce); throw pce; } restartTimer(); } | /**
* Loads the data and starts the timer
*/ | Loads the data and starts the timer | init | {
"repo_name": "rapidminer/rapidminer-studio",
"path": "src/main/java/com/rapidminer/tools/parameter/admin/ParameterEnforcer.java",
"license": "agpl-3.0",
"size": 7719
} | [
"com.rapidminer.tools.LogService",
"java.util.logging.Level"
] | import com.rapidminer.tools.LogService; import java.util.logging.Level; | import com.rapidminer.tools.*; import java.util.logging.*; | [
"com.rapidminer.tools",
"java.util"
] | com.rapidminer.tools; java.util; | 798,165 |
private void loadNotes() {
List<Note> noteList = mModel.getNotes();
//if the list is empty - display the placeholder, otherwise show the recyclerview
if (!noteList.isEmpty()) {
mView.hidePlaceholder();
mView.showNotes(noteList);
} else {
mView.showPlaceholder();
}
} | void function() { List<Note> noteList = mModel.getNotes(); if (!noteList.isEmpty()) { mView.hidePlaceholder(); mView.showNotes(noteList); } else { mView.showPlaceholder(); } } | /**
* load a list of notes from the model
*/ | load a list of notes from the model | loadNotes | {
"repo_name": "bioelectromecha/CryptoBox",
"path": "app/src/main/java/cryptobox/presenters/NotesFragmentPresenter.java",
"license": "mit",
"size": 5766
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,352,955 |
public static void spawnAsEntity(World worldIn, BlockPos pos, ItemStack stack)
{
if (!worldIn.isRemote && worldIn.getGameRules().getBoolean("doTileDrops"))
{
float f = 0.5F;
double d0 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
double d1 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
double d2 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D;
EntityItem entityitem = new EntityItem(worldIn, (double)pos.getX() + d0, (double)pos.getY() + d1, (double)pos.getZ() + d2, stack);
entityitem.setDefaultPickupDelay();
worldIn.spawnEntityInWorld(entityitem);
}
} | static void function(World worldIn, BlockPos pos, ItemStack stack) { if (!worldIn.isRemote && worldIn.getGameRules().getBoolean(STR)) { float f = 0.5F; double d0 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; double d1 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; double d2 = (double)(worldIn.rand.nextFloat() * f) + (double)(1.0F - f) * 0.5D; EntityItem entityitem = new EntityItem(worldIn, (double)pos.getX() + d0, (double)pos.getY() + d1, (double)pos.getZ() + d2, stack); entityitem.setDefaultPickupDelay(); worldIn.spawnEntityInWorld(entityitem); } } | /**
* Spawns the given ItemStack as an EntityItem into the World at the given position
*/ | Spawns the given ItemStack as an EntityItem into the World at the given position | spawnAsEntity | {
"repo_name": "SkidJava/BaseClient",
"path": "new_1.8.8/net/minecraft/block/Block.java",
"license": "gpl-2.0",
"size": 70456
} | [
"net.minecraft.entity.item.EntityItem",
"net.minecraft.item.ItemStack",
"net.minecraft.util.BlockPos",
"net.minecraft.world.World"
] | import net.minecraft.entity.item.EntityItem; import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.world.World; | import net.minecraft.entity.item.*; import net.minecraft.item.*; import net.minecraft.util.*; import net.minecraft.world.*; | [
"net.minecraft.entity",
"net.minecraft.item",
"net.minecraft.util",
"net.minecraft.world"
] | net.minecraft.entity; net.minecraft.item; net.minecraft.util; net.minecraft.world; | 828,932 |
public final StringBuilder appendTo(
StringBuilder builder, @Nullable Object first, @Nullable Object second, Object... rest) {
return appendTo(builder, iterable(first, second, rest));
} | final StringBuilder function( StringBuilder builder, @Nullable Object first, @Nullable Object second, Object... rest) { return appendTo(builder, iterable(first, second, rest)); } | /**
* Appends to {@code builder} the string representation of each of the remaining arguments.
* Identical to {@link #appendTo(Appendable, Object, Object, Object...)}, except that it does not
* throw {@link IOException}.
*/ | Appends to builder the string representation of each of the remaining arguments. Identical to <code>#appendTo(Appendable, Object, Object, Object...)</code>, except that it does not throw <code>IOException</code> | appendTo | {
"repo_name": "caskdata/cdap",
"path": "cdap-api/src/main/java/co/cask/cdap/internal/guava/reflect/Joiner.java",
"license": "apache-2.0",
"size": 15052
} | [
"javax.annotation.Nullable"
] | import javax.annotation.Nullable; | import javax.annotation.*; | [
"javax.annotation"
] | javax.annotation; | 2,648,937 |
@Test
public void testIsLocationDefinedFalse() {
final FileHandler handler = new FileHandler();
assertFalse("Location defined", handler.isLocationDefined());
} | void function() { final FileHandler handler = new FileHandler(); assertFalse(STR, handler.isLocationDefined()); } | /**
* Tests whether an undefined location can be queried.
*/ | Tests whether an undefined location can be queried | testIsLocationDefinedFalse | {
"repo_name": "apache/commons-configuration",
"path": "src/test/java/org/apache/commons/configuration2/io/TestFileHandler.java",
"license": "apache-2.0",
"size": 52995
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 2,062,776 |
public void setFinalReceiptSumTotal(KualiDecimal finalSumTotal) {
this.finalReceiptSumTotal = finalSumTotal;
} | void function(KualiDecimal finalSumTotal) { this.finalReceiptSumTotal = finalSumTotal; } | /**
* Sets the finalReceiptSumTotal attribute value.
*
* @param finalReceiptSumTotal The finalReceiptSumTotal to set.
*/ | Sets the finalReceiptSumTotal attribute value | setFinalReceiptSumTotal | {
"repo_name": "bhutchinson/kfs",
"path": "kfs-core/src/main/java/org/kuali/kfs/fp/document/web/struts/CashManagementForm.java",
"license": "agpl-3.0",
"size": 42584
} | [
"org.kuali.rice.core.api.util.type.KualiDecimal"
] | import org.kuali.rice.core.api.util.type.KualiDecimal; | import org.kuali.rice.core.api.util.type.*; | [
"org.kuali.rice"
] | org.kuali.rice; | 2,393,907 |
public static MozuClient updateTreeDocumentContentClient(java.io.InputStream stream, String documentListName, String documentName, String contentType) throws Exception
{
MozuUrl url = com.mozu.api.urls.content.documentlists.DocumentTreeUrl.updateTreeDocumentContentUrl(documentListName, documentName);
String verb = "PUT";
MozuClient mozuClient = (MozuClient) MozuClientFactory.getInstance();
mozuClient.setVerb(verb);
mozuClient.setResourceUrl(url);
mozuClient.setBody(stream);
if (!StringUtils.isEmpty(contentType))
mozuClient.addHeader(Headers.CONTENT_TYPE, contentType);
return mozuClient;
} | static MozuClient function(java.io.InputStream stream, String documentListName, String documentName, String contentType) throws Exception { MozuUrl url = com.mozu.api.urls.content.documentlists.DocumentTreeUrl.updateTreeDocumentContentUrl(documentListName, documentName); String verb = "PUT"; MozuClient mozuClient = (MozuClient) MozuClientFactory.getInstance(); mozuClient.setVerb(verb); mozuClient.setResourceUrl(url); mozuClient.setBody(stream); if (!StringUtils.isEmpty(contentType)) mozuClient.addHeader(Headers.CONTENT_TYPE, contentType); return mozuClient; } | /**
* Updates the binary data or content associated with a document, such as a product image or PDF specifications file, by supplying the document name.
* <p><pre><code>
* MozuClient mozuClient=UpdateTreeDocumentContentClient( stream, documentListName, documentName, contentType);
* client.setBaseAddress(url);
* client.executeRequest();
* </code></pre></p>
* @param documentListName Name of content documentListName to delete
* @param documentName The name of the document in the site.
* @param stream Data stream that delivers information. Used to input and output data.
* @return Mozu.Api.MozuClient
* @see Stream
*/ | Updates the binary data or content associated with a document, such as a product image or PDF specifications file, by supplying the document name. <code><code> MozuClient mozuClient=UpdateTreeDocumentContentClient( stream, documentListName, documentName, contentType); client.setBaseAddress(url); client.executeRequest(); </code></code> | updateTreeDocumentContentClient | {
"repo_name": "bhewett/mozu-java",
"path": "mozu-java-core/src/main/java/com/mozu/api/clients/content/documentlists/DocumentTreeClient.java",
"license": "mit",
"size": 10144
} | [
"com.mozu.api.Headers",
"com.mozu.api.MozuClient",
"com.mozu.api.MozuClientFactory",
"com.mozu.api.MozuUrl",
"org.apache.commons.lang.StringUtils"
] | import com.mozu.api.Headers; import com.mozu.api.MozuClient; import com.mozu.api.MozuClientFactory; import com.mozu.api.MozuUrl; import org.apache.commons.lang.StringUtils; | import com.mozu.api.*; import org.apache.commons.lang.*; | [
"com.mozu.api",
"org.apache.commons"
] | com.mozu.api; org.apache.commons; | 1,244,678 |
public static PrivateKey decodePrivateKey(File key, char[] password) throws KeyException {
if (!key.exists()) {
throw new KeyException("Key file " + key.getAbsolutePath() + " does not exist");
}
if (!key.canRead()) {
throw new KeyException("Key file " + key.getAbsolutePath() + " is not readable");
}
try {
return decodePrivateKey(DatatypeHelper.fileToByteArray(key), password);
} catch (IOException e) {
throw new KeyException("Error reading Key file " + key.getAbsolutePath(), e);
}
} | static PrivateKey function(File key, char[] password) throws KeyException { if (!key.exists()) { throw new KeyException(STR + key.getAbsolutePath() + STR); } if (!key.canRead()) { throw new KeyException(STR + key.getAbsolutePath() + STR); } try { return decodePrivateKey(DatatypeHelper.fileToByteArray(key), password); } catch (IOException e) { throw new KeyException(STR + key.getAbsolutePath(), e); } } | /**
* Decodes RSA/DSA private keys in DER, PEM, or PKCS#8 (encrypted or unencrypted) formats.
*
* @param key encoded key
* @param password decryption password or null if the key is not encrypted
*
* @return deocded private key
*
* @throws KeyException thrown if the key can not be decoded
*/ | Decodes RSA/DSA private keys in DER, PEM, or PKCS#8 (encrypted or unencrypted) formats | decodePrivateKey | {
"repo_name": "Safewhere/kombit-service-java",
"path": "XmlTooling/src/org/opensaml/xml/security/SecurityHelper.java",
"license": "mit",
"size": 47541
} | [
"java.io.File",
"java.io.IOException",
"java.security.KeyException",
"java.security.PrivateKey",
"org.opensaml.xml.util.DatatypeHelper"
] | import java.io.File; import java.io.IOException; import java.security.KeyException; import java.security.PrivateKey; import org.opensaml.xml.util.DatatypeHelper; | import java.io.*; import java.security.*; import org.opensaml.xml.util.*; | [
"java.io",
"java.security",
"org.opensaml.xml"
] | java.io; java.security; org.opensaml.xml; | 2,790,334 |
public static void exportAPIDocumentation(List<Documentation> docList, APIIdentifier apiIdentifier,
Registry registry) throws APIExportException {
Gson gson = new GsonBuilder().setPrettyPrinting().create();
String archivePath = archiveBasePath.concat(File.separator + apiIdentifier.getApiName() + "-" +
apiIdentifier.getVersion());
createDirectory(archivePath + File.separator + "Docs");
InputStream fileInputStream = null;
OutputStream outputStream = null;
try {
for (Documentation doc : docList) {
String sourceType = doc.getSourceType().name();
if (Documentation.DocumentSourceType.FILE.toString().equalsIgnoreCase(sourceType)) {
String fileName = doc.getFilePath().substring(doc.getFilePath().
lastIndexOf(RegistryConstants.PATH_SEPARATOR) + 1);
String filePath = APIUtil.getDocumentationFilePath(apiIdentifier, fileName);
//check whether resource exists in the registry
Resource docFile = registry.get(filePath);
String localDirectoryPath = File.separator + APIImportExportConstants.DOCUMENT_DIRECTORY +
File.separator + APIImportExportConstants.FILE_DOCUMENT_DIRECTORY;
createDirectory(archivePath + File.separator + localDirectoryPath);
String localFilePath = localDirectoryPath+ File.separator + fileName;
outputStream = new FileOutputStream(archivePath + localFilePath);
fileInputStream = docFile.getContentStream();
IOUtils.copy(fileInputStream, outputStream);
doc.setFilePath(fileName);
if (log.isDebugEnabled()) {
log.debug(fileName + " retrieved successfully");
}
} else if (Documentation.DocumentSourceType.INLINE.toString().equalsIgnoreCase
(sourceType)) {
createDirectory(archivePath + File.separator + APIImportExportConstants.DOCUMENT_DIRECTORY
+ File.separator + APIImportExportConstants.INLINE_DOCUMENT_DIRECTORY);
String contentPath = APIUtil.getAPIDocPath(apiIdentifier) + RegistryConstants.PATH_SEPARATOR
+ APIImportExportConstants.INLINE_DOC_CONTENT_REGISTRY_DIRECTORY
+ RegistryConstants.PATH_SEPARATOR + doc.getName();
Resource docFile = registry.get(contentPath);
String localFilePath = File.separator + APIImportExportConstants.DOCUMENT_DIRECTORY
+ File.separator + APIImportExportConstants.INLINE_DOCUMENT_DIRECTORY
+ File.separator + doc.getName();
outputStream = new FileOutputStream(archivePath + localFilePath);
fileInputStream = docFile.getContentStream();
IOUtils.copy(fileInputStream, outputStream);
}
}
String json = gson.toJson(docList);
writeFile(archivePath + APIImportExportConstants.DOCUMENT_FILE_LOCATION, json);
if (log.isDebugEnabled()) {
log.debug("API Documentation retrieved successfully");
}
} catch (IOException e) {
String errorMessage = "I/O error while writing API documentation to file";
log.error(errorMessage, e);
throw new APIExportException(errorMessage, e);
} catch (RegistryException e) {
String errorMessage = "Error while retrieving documentation ";
log.error(errorMessage, e);
throw new APIExportException(errorMessage, e);
} finally {
IOUtils.closeQuietly(fileInputStream);
IOUtils.closeQuietly(outputStream);
}
} | static void function(List<Documentation> docList, APIIdentifier apiIdentifier, Registry registry) throws APIExportException { Gson gson = new GsonBuilder().setPrettyPrinting().create(); String archivePath = archiveBasePath.concat(File.separator + apiIdentifier.getApiName() + "-" + apiIdentifier.getVersion()); createDirectory(archivePath + File.separator + "Docs"); InputStream fileInputStream = null; OutputStream outputStream = null; try { for (Documentation doc : docList) { String sourceType = doc.getSourceType().name(); if (Documentation.DocumentSourceType.FILE.toString().equalsIgnoreCase(sourceType)) { String fileName = doc.getFilePath().substring(doc.getFilePath(). lastIndexOf(RegistryConstants.PATH_SEPARATOR) + 1); String filePath = APIUtil.getDocumentationFilePath(apiIdentifier, fileName); Resource docFile = registry.get(filePath); String localDirectoryPath = File.separator + APIImportExportConstants.DOCUMENT_DIRECTORY + File.separator + APIImportExportConstants.FILE_DOCUMENT_DIRECTORY; createDirectory(archivePath + File.separator + localDirectoryPath); String localFilePath = localDirectoryPath+ File.separator + fileName; outputStream = new FileOutputStream(archivePath + localFilePath); fileInputStream = docFile.getContentStream(); IOUtils.copy(fileInputStream, outputStream); doc.setFilePath(fileName); if (log.isDebugEnabled()) { log.debug(fileName + STR); } } else if (Documentation.DocumentSourceType.INLINE.toString().equalsIgnoreCase (sourceType)) { createDirectory(archivePath + File.separator + APIImportExportConstants.DOCUMENT_DIRECTORY + File.separator + APIImportExportConstants.INLINE_DOCUMENT_DIRECTORY); String contentPath = APIUtil.getAPIDocPath(apiIdentifier) + RegistryConstants.PATH_SEPARATOR + APIImportExportConstants.INLINE_DOC_CONTENT_REGISTRY_DIRECTORY + RegistryConstants.PATH_SEPARATOR + doc.getName(); Resource docFile = registry.get(contentPath); String localFilePath = File.separator + APIImportExportConstants.DOCUMENT_DIRECTORY + File.separator + APIImportExportConstants.INLINE_DOCUMENT_DIRECTORY + File.separator + doc.getName(); outputStream = new FileOutputStream(archivePath + localFilePath); fileInputStream = docFile.getContentStream(); IOUtils.copy(fileInputStream, outputStream); } } String json = gson.toJson(docList); writeFile(archivePath + APIImportExportConstants.DOCUMENT_FILE_LOCATION, json); if (log.isDebugEnabled()) { log.debug(STR); } } catch (IOException e) { String errorMessage = STR; log.error(errorMessage, e); throw new APIExportException(errorMessage, e); } catch (RegistryException e) { String errorMessage = STR; log.error(errorMessage, e); throw new APIExportException(errorMessage, e); } finally { IOUtils.closeQuietly(fileInputStream); IOUtils.closeQuietly(outputStream); } } | /**
* Retrieve documentation for the exporting API and store it in the archive directory
* FILE, INLINE and URL documentations are handled
*
* @param apiIdentifier ID of the requesting API
* @param registry Current tenant registry
* @param docList documentation list of the exporting API
* @throws APIExportException If an error occurs while retrieving documents from the
* registry or storing in the archive directory
*/ | Retrieve documentation for the exporting API and store it in the archive directory FILE, INLINE and URL documentations are handled | exportAPIDocumentation | {
"repo_name": "dhanuka84/product-apim",
"path": "modules/api-import-export/src/main/java/org.wso2.carbon.apimgt/importexport/utils/APIExportUtil.java",
"license": "apache-2.0",
"size": 36281
} | [
"com.google.gson.Gson",
"com.google.gson.GsonBuilder",
"java.io.File",
"java.io.FileOutputStream",
"java.io.IOException",
"java.io.InputStream",
"java.io.OutputStream",
"java.util.List",
"org.apache.commons.io.IOUtils",
"org.wso2.carbon.apimgt.api.model.APIIdentifier",
"org.wso2.carbon.apimgt.api.model.Documentation",
"org.wso2.carbon.apimgt.impl.utils.APIUtil",
"org.wso2.carbon.apimgt.importexport.APIExportException",
"org.wso2.carbon.apimgt.importexport.APIImportExportConstants",
"org.wso2.carbon.registry.api.Registry",
"org.wso2.carbon.registry.api.RegistryException",
"org.wso2.carbon.registry.api.Resource",
"org.wso2.carbon.registry.core.RegistryConstants"
] | import com.google.gson.Gson; import com.google.gson.GsonBuilder; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.List; import org.apache.commons.io.IOUtils; import org.wso2.carbon.apimgt.api.model.APIIdentifier; import org.wso2.carbon.apimgt.api.model.Documentation; import org.wso2.carbon.apimgt.impl.utils.APIUtil; import org.wso2.carbon.apimgt.importexport.APIExportException; import org.wso2.carbon.apimgt.importexport.APIImportExportConstants; import org.wso2.carbon.registry.api.Registry; import org.wso2.carbon.registry.api.RegistryException; import org.wso2.carbon.registry.api.Resource; import org.wso2.carbon.registry.core.RegistryConstants; | import com.google.gson.*; import java.io.*; import java.util.*; import org.apache.commons.io.*; import org.wso2.carbon.apimgt.api.model.*; import org.wso2.carbon.apimgt.impl.utils.*; import org.wso2.carbon.apimgt.importexport.*; import org.wso2.carbon.registry.api.*; import org.wso2.carbon.registry.core.*; | [
"com.google.gson",
"java.io",
"java.util",
"org.apache.commons",
"org.wso2.carbon"
] | com.google.gson; java.io; java.util; org.apache.commons; org.wso2.carbon; | 749,544 |
public void resize(long size, AccessCondition accessCondition, FileRequestOptions options,
OperationContext opContext) throws StorageException {
if (opContext == null) {
opContext = new OperationContext();
}
opContext.initialize();
options = FileRequestOptions.applyDefaults(options, this.fileServiceClient);
ExecutionEngine.executeWithRetry(this.fileServiceClient, this, this.resizeImpl(size, accessCondition, options),
options.getRetryPolicyFactory(), opContext);
} | void function(long size, AccessCondition accessCondition, FileRequestOptions options, OperationContext opContext) throws StorageException { if (opContext == null) { opContext = new OperationContext(); } opContext.initialize(); options = FileRequestOptions.applyDefaults(options, this.fileServiceClient); ExecutionEngine.executeWithRetry(this.fileServiceClient, this, this.resizeImpl(size, accessCondition, options), options.getRetryPolicyFactory(), opContext); } | /**
* Resizes the file to the specified size.
*
* @param size
* A <code>long</code> which represents the size of the file, in bytes.
* @param accessCondition
* An {@link AccessCondition} object which represents the access conditions for the file.
* @param options
* A {@link FileRequestOptions} object that specifies any additional options for the request. Specifying
* <code>null</code> will use the default request options from the associated service client (
* {@link CloudFileClient}).
* @param opContext
* An {@link OperationContext} object which represents the context for the current operation. This object
* is used to track requests to the storage service, and to provide additional runtime information about
* the operation.
*
* @throws StorageException
* If a storage service error occurred.
*/ | Resizes the file to the specified size | resize | {
"repo_name": "peterhoeltschi/AzureStorage",
"path": "microsoft-azure-storage/src/com/microsoft/azure/storage/file/CloudFile.java",
"license": "apache-2.0",
"size": 119971
} | [
"com.microsoft.azure.storage.AccessCondition",
"com.microsoft.azure.storage.OperationContext",
"com.microsoft.azure.storage.StorageException",
"com.microsoft.azure.storage.core.ExecutionEngine"
] | import com.microsoft.azure.storage.AccessCondition; import com.microsoft.azure.storage.OperationContext; import com.microsoft.azure.storage.StorageException; import com.microsoft.azure.storage.core.ExecutionEngine; | import com.microsoft.azure.storage.*; import com.microsoft.azure.storage.core.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 2,774,556 |
public static void addNewActionType( final Map<Integer, ActionType> actionTypeMap,
final String value,
final int column,
final int row ) {
final String ucValue = value.toUpperCase();
Code code = tag2code.get( ucValue );
if ( code == null ) {
code = tag2code.get( ucValue.substring( 0, 1 ) );
}
if ( code != null ) {
int count = 0;
for ( ActionType at : actionTypeMap.values() ) {
if ( at.getCode() == code ) {
count++;
}
}
if ( count >= code.getMaxCount() ) {
throw new DecisionTableParseException( "Maximum number of " +
code.getColHeader() + "/" + code.getColShort() + " columns is " +
code.getMaxCount() + ", in cell " + RuleSheetParserUtil.rc2name( row, column ) );
}
actionTypeMap.put( new Integer( column ), new ActionType( code ) );
} else {
throw new DecisionTableParseException(
"Invalid column header: " + value + ", should be CONDITION, ACTION or attribute, " +
"in cell " + RuleSheetParserUtil.rc2name( row, column ) );
}
} | static void function( final Map<Integer, ActionType> actionTypeMap, final String value, final int column, final int row ) { final String ucValue = value.toUpperCase(); Code code = tag2code.get( ucValue ); if ( code == null ) { code = tag2code.get( ucValue.substring( 0, 1 ) ); } if ( code != null ) { int count = 0; for ( ActionType at : actionTypeMap.values() ) { if ( at.getCode() == code ) { count++; } } if ( count >= code.getMaxCount() ) { throw new DecisionTableParseException( STR + code.getColHeader() + "/" + code.getColShort() + STR + code.getMaxCount() + STR + RuleSheetParserUtil.rc2name( row, column ) ); } actionTypeMap.put( new Integer( column ), new ActionType( code ) ); } else { throw new DecisionTableParseException( STR + value + STR + STR + RuleSheetParserUtil.rc2name( row, column ) ); } } | /**
* Create a new action type that matches this cell, and add it to the map,
* keyed on that column.
*/ | Create a new action type that matches this cell, and add it to the map, keyed on that column | addNewActionType | {
"repo_name": "droolsjbpm/drools",
"path": "drools-decisiontables/src/main/java/org/drools/decisiontable/parser/ActionType.java",
"license": "apache-2.0",
"size": 7379
} | [
"java.util.Map",
"org.drools.template.parser.DecisionTableParseException"
] | import java.util.Map; import org.drools.template.parser.DecisionTableParseException; | import java.util.*; import org.drools.template.parser.*; | [
"java.util",
"org.drools.template"
] | java.util; org.drools.template; | 943,801 |
protected Itinerary parseItinerary(JsonNode it) throws JsonParseException,
JsonMappingException, IOException {
Itinerary newIt = new Itinerary();
newIt.startTime = it.get("startTime").asLong();
newIt.endTime = it.get("endTime").asLong();
newIt.walkTime = it.get("walkTime").asLong();
newIt.transitTime = it.get("transitTime").asLong();
newIt.waitingTime = it.get("waitingTime").asLong();
newIt.walkDistance = it.get("walkDistance").asDouble();
newIt.transfers = it.get("transfers").asInt();
newIt.duration = it.get("duration").asLong();
JsonNode legNode = it.get("legs");
for (Iterator<JsonNode> jt = legNode.elements(); jt.hasNext();) {
Leg newLeg = parseLeg(jt.next());
newIt.legs.add(newLeg);
newIt.costs += newLeg.costs;
}
newIt.itineraryType = Itinerary.getItineraryType(newIt);
if (newIt.itineraryType == TType.BUS) {
newIt.costs = 1.2;
}
return newIt;
} | Itinerary function(JsonNode it) throws JsonParseException, JsonMappingException, IOException { Itinerary newIt = new Itinerary(); newIt.startTime = it.get(STR).asLong(); newIt.endTime = it.get(STR).asLong(); newIt.walkTime = it.get(STR).asLong(); newIt.transitTime = it.get(STR).asLong(); newIt.waitingTime = it.get(STR).asLong(); newIt.walkDistance = it.get(STR).asDouble(); newIt.transfers = it.get(STR).asInt(); newIt.duration = it.get(STR).asLong(); JsonNode legNode = it.get("legs"); for (Iterator<JsonNode> jt = legNode.elements(); jt.hasNext();) { Leg newLeg = parseLeg(jt.next()); newIt.legs.add(newLeg); newIt.costs += newLeg.costs; } newIt.itineraryType = Itinerary.getItineraryType(newIt); if (newIt.itineraryType == TType.BUS) { newIt.costs = 1.2; } return newIt; } | /**
* Parses an itinerary from a Json node.
*
* @param it Json node.
* @return Itinerary parsed from given node.
*
* @throws JsonParseException
* @throws JsonMappingException
* @throws IOException
*/ | Parses an itinerary from a Json node | parseItinerary | {
"repo_name": "poxrucker/collaborative-learning-simulation",
"path": "Simulator/src/allow/simulator/mobility/planner/AbstractOTPPlanner.java",
"license": "apache-2.0",
"size": 6035
} | [
"com.fasterxml.jackson.core.JsonParseException",
"com.fasterxml.jackson.databind.JsonMappingException",
"com.fasterxml.jackson.databind.JsonNode",
"java.io.IOException",
"java.util.Iterator"
] | import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.JsonNode; import java.io.IOException; import java.util.Iterator; | import com.fasterxml.jackson.core.*; import com.fasterxml.jackson.databind.*; import java.io.*; import java.util.*; | [
"com.fasterxml.jackson",
"java.io",
"java.util"
] | com.fasterxml.jackson; java.io; java.util; | 2,035,591 |
public RequestMatcher exists() {
return (XpathRequestMatcher) request ->
this.xpathHelper.exists(request.getBodyAsBytes(), DEFAULT_ENCODING);
} | RequestMatcher function() { return (XpathRequestMatcher) request -> this.xpathHelper.exists(request.getBodyAsBytes(), DEFAULT_ENCODING); } | /**
* Assert that content exists at the given XPath.
*/ | Assert that content exists at the given XPath | exists | {
"repo_name": "spring-projects/spring-framework",
"path": "spring-test/src/main/java/org/springframework/test/web/client/match/XpathRequestMatchers.java",
"license": "apache-2.0",
"size": 5521
} | [
"org.springframework.test.web.client.RequestMatcher"
] | import org.springframework.test.web.client.RequestMatcher; | import org.springframework.test.web.client.*; | [
"org.springframework.test"
] | org.springframework.test; | 872,952 |
public synchronized void removeEvents(final Collection<Event> eventsToRemove) {
if (eventsToRemove != null && eventsToRemove.size() > 0) {
final List<Event> events = eventsList();
if (events.removeAll(eventsToRemove)) {
preferences_.edit().putString(EVENTS_PREFERENCE, joinEvents(events, DELIMITER)).commit();
}
}
} | synchronized void function(final Collection<Event> eventsToRemove) { if (eventsToRemove != null && eventsToRemove.size() > 0) { final List<Event> events = eventsList(); if (events.removeAll(eventsToRemove)) { preferences_.edit().putString(EVENTS_PREFERENCE, joinEvents(events, DELIMITER)).commit(); } } } | /**
* Removes the specified events from the local store. Does nothing if the event collection
* is null or empty.
* @param eventsToRemove collection containing the events to remove from the local store
*/ | Removes the specified events from the local store. Does nothing if the event collection is null or empty | removeEvents | {
"repo_name": "nicolsondsouza/countly-sdk-js",
"path": "src/android/CountlyStore.java",
"license": "mit",
"size": 10639
} | [
"java.util.Collection",
"java.util.List"
] | import java.util.Collection; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,607,074 |
public List findAll() throws DataAccessLayerException{
return super.findAll(Role.class);
} | List function() throws DataAccessLayerException{ return super.findAll(Role.class); } | /**
* Finds all users in the database.
* @return
*/ | Finds all users in the database | findAll | {
"repo_name": "Creedzy/MotionLayer",
"path": "src/main/java/org/cg/service/DAOS/RoleDAO.java",
"license": "mit",
"size": 1238
} | [
"java.util.List",
"org.cg.Model",
"org.cg.service.Exception"
] | import java.util.List; import org.cg.Model; import org.cg.service.Exception; | import java.util.*; import org.cg.*; import org.cg.service.*; | [
"java.util",
"org.cg",
"org.cg.service"
] | java.util; org.cg; org.cg.service; | 456,009 |
private boolean containsCompositeKey(TableInfo tableInfo)
{
return tableInfo.getTableIdType() != null && tableInfo.getTableIdType().isAnnotationPresent(Embeddable.class);
} | boolean function(TableInfo tableInfo) { return tableInfo.getTableIdType() != null && tableInfo.getTableIdType().isAnnotationPresent(Embeddable.class); } | /**
* Contains composite key.
*
* @param tableInfo
* the table info
* @return true, if successful
*/ | Contains composite key | containsCompositeKey | {
"repo_name": "impetus-opensource/Kundera",
"path": "src/kundera-cassandra/cassandra-core/src/main/java/com/impetus/client/cassandra/schemamanager/CassandraSchemaManager.java",
"license": "apache-2.0",
"size": 123023
} | [
"com.impetus.kundera.configure.schema.TableInfo",
"javax.persistence.Embeddable"
] | import com.impetus.kundera.configure.schema.TableInfo; import javax.persistence.Embeddable; | import com.impetus.kundera.configure.schema.*; import javax.persistence.*; | [
"com.impetus.kundera",
"javax.persistence"
] | com.impetus.kundera; javax.persistence; | 28,653 |
public TweetDao composeNewTweet( String msg ) throws TwitterActionException {
try {
Status stat = twitter.updateStatus(msg);
return tweetConverter.toTweet(stat);
}
catch ( TwitterException e ) {
LOGGER.error(e.getMessage());
throw new TwitterActionException(e.getMessage());
}
}
| TweetDao function( String msg ) throws TwitterActionException { try { Status stat = twitter.updateStatus(msg); return tweetConverter.toTweet(stat); } catch ( TwitterException e ) { LOGGER.error(e.getMessage()); throw new TwitterActionException(e.getMessage()); } } | /**
* Method which compose new tweet in Tweeter account
*
* @param msg
* textual representation of tweet
* @throws TwitterActionException
*/ | Method which compose new tweet in Tweeter account | composeNewTweet | {
"repo_name": "voncuver/cwierkacz",
"path": "src/main/java/com/pk/cwierkacz/twitter/TwitterAccount.java",
"license": "agpl-3.0",
"size": 20730
} | [
"com.pk.cwierkacz.model.dao.TweetDao"
] | import com.pk.cwierkacz.model.dao.TweetDao; | import com.pk.cwierkacz.model.dao.*; | [
"com.pk.cwierkacz"
] | com.pk.cwierkacz; | 225,481 |
public T photos_upload(File photo, Long albumId)
throws FacebookException, IOException; | T function(File photo, Long albumId) throws FacebookException, IOException; | /**
* Uploads a photo to Facebook.
* @param photo an image file
* @param albumId the album into which the photo should be uploaded
* @return a T with the standard Facebook photo information
* @see <a href="http://wiki.developers.facebook.com/index.php/Photos.upload">
* Developers wiki: Photos.upload</a>
*/ | Uploads a photo to Facebook | photos_upload | {
"repo_name": "jkinner/ringside",
"path": "api/clients/java/com/facebook/api/IFacebookRestClient.java",
"license": "lgpl-2.1",
"size": 46105
} | [
"java.io.File",
"java.io.IOException"
] | import java.io.File; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 141,117 |
public FaceletTaglibTagAttributeType<T> removeAllDisplayName()
{
childNode.removeChildren("display-name");
return this;
}
// --------------------------------------------------------------------------------------------------------||
// ClassName: FaceletTaglibTagAttributeType ElementName: javaee:iconType ElementType : icon
// MaxOccurs: -unbounded isGeneric: true isAttribute: false isEnum: false isDataType: false
// --------------------------------------------------------------------------------------------------------|| | FaceletTaglibTagAttributeType<T> function() { childNode.removeChildren(STR); return this; } | /**
* Removes the <code>display-name</code> element
* @return the current instance of <code>FaceletTaglibTagAttributeType<T></code>
*/ | Removes the <code>display-name</code> element | removeAllDisplayName | {
"repo_name": "forge/javaee-descriptors",
"path": "impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/facelettaglibrary22/FaceletTaglibTagAttributeTypeImpl.java",
"license": "epl-1.0",
"size": 14291
} | [
"org.jboss.shrinkwrap.descriptor.api.facelettaglibrary22.FaceletTaglibTagAttributeType"
] | import org.jboss.shrinkwrap.descriptor.api.facelettaglibrary22.FaceletTaglibTagAttributeType; | import org.jboss.shrinkwrap.descriptor.api.facelettaglibrary22.*; | [
"org.jboss.shrinkwrap"
] | org.jboss.shrinkwrap; | 953,345 |
public List<org.ng200.openolympus.jooq.tables.pojos.ContestParticipation> fetchByScore(BigDecimal... values) {
return fetch(ContestParticipation.CONTEST_PARTICIPATION.SCORE, values);
} | List<org.ng200.openolympus.jooq.tables.pojos.ContestParticipation> function(BigDecimal... values) { return fetch(ContestParticipation.CONTEST_PARTICIPATION.SCORE, values); } | /**
* Fetch records that have <code>score IN (values)</code>
*/ | Fetch records that have <code>score IN (values)</code> | fetchByScore | {
"repo_name": "nickguletskii/OpenOlympus",
"path": "src-gen/main/java/org/ng200/openolympus/jooq/tables/daos/ContestParticipationDao.java",
"license": "mit",
"size": 4319
} | [
"java.math.BigDecimal",
"java.util.List",
"org.ng200.openolympus.jooq.tables.ContestParticipation"
] | import java.math.BigDecimal; import java.util.List; import org.ng200.openolympus.jooq.tables.ContestParticipation; | import java.math.*; import java.util.*; import org.ng200.openolympus.jooq.tables.*; | [
"java.math",
"java.util",
"org.ng200.openolympus"
] | java.math; java.util; org.ng200.openolympus; | 2,200,558 |
public synchronized Map<TriggerDescriptor,Trigger<?>> getTriggers() {
return this.getTriggers(IMode.AUTO);
}
| synchronized Map<TriggerDescriptor,Trigger<?>> function() { return this.getTriggers(IMode.AUTO); } | /**
* Returns all triggers defined on this project; or if detected to be
* necessary, also all parents.
* <p>
* @return a map of triggers, might be empty, but never null
*/ | Returns all triggers defined on this project; or if detected to be necessary, also all parents. | getTriggers | {
"repo_name": "rrialq/jenkins-inheritance-plugin",
"path": "src/main/java/hudson/plugins/project_inheritance/projects/InheritanceProject.java",
"license": "gpl-3.0",
"size": 155118
} | [
"hudson.triggers.Trigger",
"hudson.triggers.TriggerDescriptor",
"java.util.Map"
] | import hudson.triggers.Trigger; import hudson.triggers.TriggerDescriptor; import java.util.Map; | import hudson.triggers.*; import java.util.*; | [
"hudson.triggers",
"java.util"
] | hudson.triggers; java.util; | 309,138 |
private void registerBluetoothIntentsIfNeeded() {
// Check if this process has the BLUETOOTH permission or not.
mHasBluetoothPermission = hasPermission(
android.Manifest.permission.BLUETOOTH);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
mHasBluetoothPermission &= ApiHelperForS.hasBluetoothConnectPermission();
}
// Add a Bluetooth headset to the list of available devices if a BT
// headset is detected and if we have the BLUETOOTH permission.
// We must do this initial check using a dedicated method since the
// broadcasted intent BluetoothHeadset.ACTION_CONNECTION_STATE_CHANGED
// is not sticky and will only be received if a BT headset is connected
// after this method has been called.
if (!mHasBluetoothPermission) {
Log.w(TAG, "Requires BLUETOOTH permission");
return;
}
mAudioDevices[DEVICE_BLUETOOTH_HEADSET] = hasBluetoothHeadset();
// Register receivers for broadcast intents related to changes in
// Bluetooth headset availability and usage of the SCO channel.
registerForBluetoothHeadsetIntentBroadcast();
registerForBluetoothScoIntentBroadcast();
} | void function() { mHasBluetoothPermission = hasPermission( android.Manifest.permission.BLUETOOTH); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { mHasBluetoothPermission &= ApiHelperForS.hasBluetoothConnectPermission(); } if (!mHasBluetoothPermission) { Log.w(TAG, STR); return; } mAudioDevices[DEVICE_BLUETOOTH_HEADSET] = hasBluetoothHeadset(); registerForBluetoothHeadsetIntentBroadcast(); registerForBluetoothScoIntentBroadcast(); } | /**
* Register for BT intents if we have the BLUETOOTH permission.
* Also extends the list of available devices with a BT device if one exists.
*/ | Register for BT intents if we have the BLUETOOTH permission. Also extends the list of available devices with a BT device if one exists | registerBluetoothIntentsIfNeeded | {
"repo_name": "chromium/chromium",
"path": "media/base/android/java/src/org/chromium/media/AudioManagerAndroid.java",
"license": "bsd-3-clause",
"size": 53660
} | [
"android.os.Build",
"org.chromium.base.Log",
"org.chromium.base.compat.ApiHelperForS"
] | import android.os.Build; import org.chromium.base.Log; import org.chromium.base.compat.ApiHelperForS; | import android.os.*; import org.chromium.base.*; import org.chromium.base.compat.*; | [
"android.os",
"org.chromium.base"
] | android.os; org.chromium.base; | 593,897 |
public void setMarketDataSenderFactory(final MarketDataSenderFactory marketDataSenderFactory) {
ArgumentChecker.notNull(marketDataSenderFactory, "marketDataSenderFactory");
_marketDataSenderFactory = marketDataSenderFactory;
} | void function(final MarketDataSenderFactory marketDataSenderFactory) { ArgumentChecker.notNull(marketDataSenderFactory, STR); _marketDataSenderFactory = marketDataSenderFactory; } | /**
* Sets the market data sender factory.
*
* @param marketDataSenderFactory
* the factory, not null
*/ | Sets the market data sender factory | setMarketDataSenderFactory | {
"repo_name": "McLeodMoores/starling",
"path": "projects/live-data/src/main/java/com/opengamma/livedata/server/StandardLiveDataServer.java",
"license": "apache-2.0",
"size": 53596
} | [
"com.opengamma.livedata.server.distribution.MarketDataSenderFactory",
"com.opengamma.util.ArgumentChecker"
] | import com.opengamma.livedata.server.distribution.MarketDataSenderFactory; import com.opengamma.util.ArgumentChecker; | import com.opengamma.livedata.server.distribution.*; import com.opengamma.util.*; | [
"com.opengamma.livedata",
"com.opengamma.util"
] | com.opengamma.livedata; com.opengamma.util; | 2,740,716 |
public static Image getPluginImage(String symbolicName, String path) {
try {
URL url = getPluginImageURL(symbolicName, path);
if (url != null) {
return getPluginImageFromUrl(url);
}
} catch (Throwable e) {
// Ignore any exceptions
}
return null;
} | static Image function(String symbolicName, String path) { try { URL url = getPluginImageURL(symbolicName, path); if (url != null) { return getPluginImageFromUrl(url); } } catch (Throwable e) { } return null; } | /**
* Returns an {@link Image} based on a {@link Bundle} and resource entry path.
*
* @param symbolicName
* the symbolic name of the {@link Bundle}.
* @param path
* the path of the resource entry.
* @return the {@link Image} stored in the file at the specified path.
*/ | Returns an <code>Image</code> based on a <code>Bundle</code> and resource entry path | getPluginImage | {
"repo_name": "openrobots-dev/ChibiOS",
"path": "tools/eclipse/debug_support/src/org/eclipse/wb/swt/ResourceManager.java",
"license": "gpl-3.0",
"size": 14336
} | [
"org.eclipse.swt.graphics.Image"
] | import org.eclipse.swt.graphics.Image; | import org.eclipse.swt.graphics.*; | [
"org.eclipse.swt"
] | org.eclipse.swt; | 1,731,109 |
void unregisterForRingbackTone(Handler h); | void unregisterForRingbackTone(Handler h); | /**
* Unregisters for ringback tone notification.
*/ | Unregisters for ringback tone notification | unregisterForRingbackTone | {
"repo_name": "JSDemos/android-sdk-20",
"path": "src/com/android/internal/telephony/Phone.java",
"license": "apache-2.0",
"size": 62674
} | [
"android.os.Handler"
] | import android.os.Handler; | import android.os.*; | [
"android.os"
] | android.os; | 1,071,500 |
private void breadth(final ComponentEvent<?> event)
{
IEventSink sink = event.getSink();
boolean targetsApplication = sink instanceof Application;
boolean targetsSession = targetsApplication || sink instanceof Session;
boolean targetsCycle = targetsSession || sink instanceof RequestCycle;
boolean targetsComponent = sink instanceof Component;
if (!targetsComponent && !targetsCycle)
{
dispatcher.dispatchEvent(sink, event, null);
return;
}
if (targetsApplication)
{
dispatcher.dispatchEvent(source.getApplication(), event, null);
}
if (event.isStop())
{
return;
}
if (targetsSession)
{
dispatcher.dispatchEvent(source.getSession(), event, null);
}
if (event.isStop())
{
return;
}
if (targetsCycle)
{
dispatcher.dispatchEvent(source.getRequestCycle(), event, null);
}
if (event.isStop())
{
return;
}
Component cursor = targetsCycle ? source.getPage() : (Component)sink;
dispatchToComponent(dispatcher, cursor, event);
if (event.isStop())
{
return;
}
event.resetShallow(); // reset shallow flag
if (cursor instanceof MarkupContainer)
{
((MarkupContainer)cursor).visitChildren(new ComponentEventVisitor(event, dispatcher));
}
} | void function(final ComponentEvent<?> event) { IEventSink sink = event.getSink(); boolean targetsApplication = sink instanceof Application; boolean targetsSession = targetsApplication sink instanceof Session; boolean targetsCycle = targetsSession sink instanceof RequestCycle; boolean targetsComponent = sink instanceof Component; if (!targetsComponent && !targetsCycle) { dispatcher.dispatchEvent(sink, event, null); return; } if (targetsApplication) { dispatcher.dispatchEvent(source.getApplication(), event, null); } if (event.isStop()) { return; } if (targetsSession) { dispatcher.dispatchEvent(source.getSession(), event, null); } if (event.isStop()) { return; } if (targetsCycle) { dispatcher.dispatchEvent(source.getRequestCycle(), event, null); } if (event.isStop()) { return; } Component cursor = targetsCycle ? source.getPage() : (Component)sink; dispatchToComponent(dispatcher, cursor, event); if (event.isStop()) { return; } event.resetShallow(); if (cursor instanceof MarkupContainer) { ((MarkupContainer)cursor).visitChildren(new ComponentEventVisitor(event, dispatcher)); } } | /**
* Breadth broadcast
*
* @param event
*/ | Breadth broadcast | breadth | {
"repo_name": "dashorst/wicket",
"path": "wicket-core/src/main/java/org/apache/wicket/ComponentEventSender.java",
"license": "apache-2.0",
"size": 7719
} | [
"org.apache.wicket.event.IEventSink",
"org.apache.wicket.request.cycle.RequestCycle"
] | import org.apache.wicket.event.IEventSink; import org.apache.wicket.request.cycle.RequestCycle; | import org.apache.wicket.event.*; import org.apache.wicket.request.cycle.*; | [
"org.apache.wicket"
] | org.apache.wicket; | 43,457 |
public void addDocuments(Iterable<? extends Iterable<? extends IndexableField>> docs, Analyzer analyzer) throws IOException {
updateDocuments(null, docs, analyzer);
} | void function(Iterable<? extends Iterable<? extends IndexableField>> docs, Analyzer analyzer) throws IOException { updateDocuments(null, docs, analyzer); } | /**
* Atomically adds a block of documents, analyzed using the
* provided analyzer, with sequentially assigned document
* IDs, such that an external reader will see all or none
* of the documents.
*
* @throws CorruptIndexException if the index is corrupt
* @throws IOException if there is a low-level IO error
*
* @lucene.experimental
*/ | Atomically adds a block of documents, analyzed using the provided analyzer, with sequentially assigned document IDs, such that an external reader will see all or none of the documents | addDocuments | {
"repo_name": "yintaoxue/read-open-source-code",
"path": "lucene-4.7.2/src/org/apache/lucene/index/IndexWriter.java",
"license": "apache-2.0",
"size": 176689
} | [
"java.io.IOException",
"org.apache.lucene.analysis.Analyzer"
] | import java.io.IOException; import org.apache.lucene.analysis.Analyzer; | import java.io.*; import org.apache.lucene.analysis.*; | [
"java.io",
"org.apache.lucene"
] | java.io; org.apache.lucene; | 1,549,969 |
Collection<AABB> getBlockCollisionBoxes(int x, int y, int z); | Collection<AABB> getBlockCollisionBoxes(int x, int y, int z); | /**
* Gets the collision boxes of the block
* at the given coordinates.
*
* @param x The x coordinate
* @param y The y coordinate
* @param z The z coordinate
* @return The collision boxes, or empty if none were found
*/ | Gets the collision boxes of the block at the given coordinates | getBlockCollisionBoxes | {
"repo_name": "LanternPowered/LanternServer",
"path": "src/main/java/org/lanternpowered/server/world/extent/IExtent.java",
"license": "mit",
"size": 1148
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 1,907,876 |
public Table getTable(final String tableName, boolean throwException) throws HiveException {
String[] names = Utilities.getDbTableName(tableName);
return this.getTable(names[0], names[1], throwException);
} | Table function(final String tableName, boolean throwException) throws HiveException { String[] names = Utilities.getDbTableName(tableName); return this.getTable(names[0], names[1], throwException); } | /**
* Returns metadata for the table named tableName
* @param tableName the name of the table
* @param throwException controls whether an exception is thrown or a returns a null
* @return the table metadata
* @throws HiveException if there's an internal error or if the
* table doesn't exist
*/ | Returns metadata for the table named tableName | getTable | {
"repo_name": "nishantmonu51/hive",
"path": "ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java",
"license": "apache-2.0",
"size": 254947
} | [
"org.apache.hadoop.hive.ql.exec.Utilities"
] | import org.apache.hadoop.hive.ql.exec.Utilities; | import org.apache.hadoop.hive.ql.exec.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 1,047,537 |
public static String sendToSlaveServer( TransMeta transMeta, TransExecutionConfiguration executionConfiguration,
Repository repository, IMetaStore metaStore ) throws KettleException {
String carteObjectId;
SlaveServer slaveServer = executionConfiguration.getRemoteServer();
if ( slaveServer == null ) {
throw new KettleException( "No slave server specified" );
}
if ( Utils.isEmpty( transMeta.getName() ) ) {
throw new KettleException( "The transformation needs a name to uniquely identify it by on the remote server." );
}
try {
// Inject certain internal variables to make it more intuitive.
//
Map<String, String> vars = new HashMap<>();
for ( String var : Const.INTERNAL_TRANS_VARIABLES ) {
vars.put( var, transMeta.getVariable( var ) );
}
for ( String var : Const.INTERNAL_JOB_VARIABLES ) {
vars.put( var, transMeta.getVariable( var ) );
}
executionConfiguration.getVariables().putAll( vars );
slaveServer.injectVariables( executionConfiguration.getVariables() );
slaveServer.getLogChannel().setLogLevel( executionConfiguration.getLogLevel() );
if ( executionConfiguration.isPassingExport() ) {
// First export the job...
//
FileObject tempFile =
KettleVFS.createTempFile( "transExport", ".zip", System.getProperty( "java.io.tmpdir" ), transMeta );
TopLevelResource topLevelResource =
ResourceUtil.serializeResourceExportInterface( tempFile.getName().toString(), transMeta, transMeta,
repository, metaStore, executionConfiguration.getXML(), CONFIGURATION_IN_EXPORT_FILENAME );
// Send the zip file over to the slave server...
//
String result =
slaveServer.sendExport( topLevelResource.getArchiveName(), AddExportServlet.TYPE_TRANS, topLevelResource
.getBaseResourceName() );
WebResult webResult = WebResult.fromXMLString( result );
if ( !webResult.getResult().equalsIgnoreCase( WebResult.STRING_OK ) ) {
throw new KettleException( "There was an error passing the exported transformation to the remote server: "
+ Const.CR + webResult.getMessage() );
}
carteObjectId = webResult.getId();
} else {
// Now send it off to the remote server...
//
String xml = new TransConfiguration( transMeta, executionConfiguration ).getXML();
String reply = slaveServer.sendXML( xml, RegisterTransServlet.CONTEXT_PATH + "/?xml=Y" );
WebResult webResult = WebResult.fromXMLString( reply );
if ( !webResult.getResult().equalsIgnoreCase( WebResult.STRING_OK ) ) {
throw new KettleException( "There was an error posting the transformation on the remote server: " + Const.CR
+ webResult.getMessage() );
}
carteObjectId = webResult.getId();
}
// Prepare the transformation
//
String reply =
slaveServer.execService( PrepareExecutionTransServlet.CONTEXT_PATH + "/?name=" + URLEncoder.encode( transMeta
.getName(), "UTF-8" ) + "&xml=Y&id=" + carteObjectId );
WebResult webResult = WebResult.fromXMLString( reply );
if ( !webResult.getResult().equalsIgnoreCase( WebResult.STRING_OK ) ) {
throw new KettleException( "There was an error preparing the transformation for excution on the remote server: "
+ Const.CR + webResult.getMessage() );
}
// Start the transformation
//
reply =
slaveServer.execService( StartExecutionTransServlet.CONTEXT_PATH + "/?name=" + URLEncoder.encode( transMeta
.getName(), "UTF-8" ) + "&xml=Y&id=" + carteObjectId );
webResult = WebResult.fromXMLString( reply );
if ( !webResult.getResult().equalsIgnoreCase( WebResult.STRING_OK ) ) {
throw new KettleException( "There was an error starting the transformation on the remote server: " + Const.CR
+ webResult.getMessage() );
}
return carteObjectId;
} catch ( KettleException ke ) {
throw ke;
} catch ( Exception e ) {
throw new KettleException( e );
}
} | static String function( TransMeta transMeta, TransExecutionConfiguration executionConfiguration, Repository repository, IMetaStore metaStore ) throws KettleException { String carteObjectId; SlaveServer slaveServer = executionConfiguration.getRemoteServer(); if ( slaveServer == null ) { throw new KettleException( STR ); } if ( Utils.isEmpty( transMeta.getName() ) ) { throw new KettleException( STR ); } try { for ( String var : Const.INTERNAL_TRANS_VARIABLES ) { vars.put( var, transMeta.getVariable( var ) ); } for ( String var : Const.INTERNAL_JOB_VARIABLES ) { vars.put( var, transMeta.getVariable( var ) ); } executionConfiguration.getVariables().putAll( vars ); slaveServer.injectVariables( executionConfiguration.getVariables() ); slaveServer.getLogChannel().setLogLevel( executionConfiguration.getLogLevel() ); if ( executionConfiguration.isPassingExport() ) { KettleVFS.createTempFile( STR, ".zip", System.getProperty( STR ), transMeta ); TopLevelResource topLevelResource = ResourceUtil.serializeResourceExportInterface( tempFile.getName().toString(), transMeta, transMeta, repository, metaStore, executionConfiguration.getXML(), CONFIGURATION_IN_EXPORT_FILENAME ); slaveServer.sendExport( topLevelResource.getArchiveName(), AddExportServlet.TYPE_TRANS, topLevelResource .getBaseResourceName() ); WebResult webResult = WebResult.fromXMLString( result ); if ( !webResult.getResult().equalsIgnoreCase( WebResult.STRING_OK ) ) { throw new KettleException( STR + Const.CR + webResult.getMessage() ); } carteObjectId = webResult.getId(); } else { String reply = slaveServer.sendXML( xml, RegisterTransServlet.CONTEXT_PATH + STR ); WebResult webResult = WebResult.fromXMLString( reply ); if ( !webResult.getResult().equalsIgnoreCase( WebResult.STRING_OK ) ) { throw new KettleException( STR + Const.CR + webResult.getMessage() ); } carteObjectId = webResult.getId(); } slaveServer.execService( PrepareExecutionTransServlet.CONTEXT_PATH + STR + URLEncoder.encode( transMeta .getName(), "UTF-8" ) + STR + carteObjectId ); WebResult webResult = WebResult.fromXMLString( reply ); if ( !webResult.getResult().equalsIgnoreCase( WebResult.STRING_OK ) ) { throw new KettleException( STR + Const.CR + webResult.getMessage() ); } slaveServer.execService( StartExecutionTransServlet.CONTEXT_PATH + STR + URLEncoder.encode( transMeta .getName(), "UTF-8" ) + STR + carteObjectId ); webResult = WebResult.fromXMLString( reply ); if ( !webResult.getResult().equalsIgnoreCase( WebResult.STRING_OK ) ) { throw new KettleException( STR + Const.CR + webResult.getMessage() ); } return carteObjectId; } catch ( KettleException ke ) { throw ke; } catch ( Exception e ) { throw new KettleException( e ); } } | /**
* Send the transformation for execution to a Carte slave server.
*
* @param transMeta
* the transformation meta-data
* @param executionConfiguration
* the transformation execution configuration
* @param repository
* the repository
* @return The Carte object ID on the server.
* @throws KettleException
* if any errors occur during the dispatch to the slave server
*/ | Send the transformation for execution to a Carte slave server | sendToSlaveServer | {
"repo_name": "alina-ipatina/pentaho-kettle",
"path": "engine/src/org/pentaho/di/trans/Trans.java",
"license": "apache-2.0",
"size": 197880
} | [
"java.net.URLEncoder",
"org.pentaho.di.cluster.SlaveServer",
"org.pentaho.di.core.Const",
"org.pentaho.di.core.exception.KettleException",
"org.pentaho.di.core.util.Utils",
"org.pentaho.di.core.vfs.KettleVFS",
"org.pentaho.di.repository.Repository",
"org.pentaho.di.resource.ResourceUtil",
"org.pentaho.di.resource.TopLevelResource",
"org.pentaho.di.www.AddExportServlet",
"org.pentaho.di.www.PrepareExecutionTransServlet",
"org.pentaho.di.www.RegisterTransServlet",
"org.pentaho.di.www.StartExecutionTransServlet",
"org.pentaho.di.www.WebResult",
"org.pentaho.metastore.api.IMetaStore"
] | import java.net.URLEncoder; import org.pentaho.di.cluster.SlaveServer; import org.pentaho.di.core.Const; import org.pentaho.di.core.exception.KettleException; import org.pentaho.di.core.util.Utils; import org.pentaho.di.core.vfs.KettleVFS; import org.pentaho.di.repository.Repository; import org.pentaho.di.resource.ResourceUtil; import org.pentaho.di.resource.TopLevelResource; import org.pentaho.di.www.AddExportServlet; import org.pentaho.di.www.PrepareExecutionTransServlet; import org.pentaho.di.www.RegisterTransServlet; import org.pentaho.di.www.StartExecutionTransServlet; import org.pentaho.di.www.WebResult; import org.pentaho.metastore.api.IMetaStore; | import java.net.*; import org.pentaho.di.cluster.*; import org.pentaho.di.core.*; import org.pentaho.di.core.exception.*; import org.pentaho.di.core.util.*; import org.pentaho.di.core.vfs.*; import org.pentaho.di.repository.*; import org.pentaho.di.resource.*; import org.pentaho.di.www.*; import org.pentaho.metastore.api.*; | [
"java.net",
"org.pentaho.di",
"org.pentaho.metastore"
] | java.net; org.pentaho.di; org.pentaho.metastore; | 2,578,113 |
private void enablePreferences(boolean enableBlocker, Preference channelBlacklistPreference, Preference channelWhitelistPreference) {
findPreference(getString(R.string.pref_key_channel_filter_method)).setEnabled(enableBlocker);
initChannelFilteringPreferences(enableBlocker, channelBlacklistPreference, channelWhitelistPreference);
findPreference(getString(R.string.pref_key_preferred_languages)).setEnabled(enableBlocker);
findPreference(getString(R.string.pref_key_lang_detection_video_filtering)).setEnabled(enableBlocker);
findPreference(getString(R.string.pref_key_low_views_filter)).setEnabled(enableBlocker);
findPreference(getString(R.string.pref_key_dislikes_filter)).setEnabled(enableBlocker);
} | void function(boolean enableBlocker, Preference channelBlacklistPreference, Preference channelWhitelistPreference) { findPreference(getString(R.string.pref_key_channel_filter_method)).setEnabled(enableBlocker); initChannelFilteringPreferences(enableBlocker, channelBlacklistPreference, channelWhitelistPreference); findPreference(getString(R.string.pref_key_preferred_languages)).setEnabled(enableBlocker); findPreference(getString(R.string.pref_key_lang_detection_video_filtering)).setEnabled(enableBlocker); findPreference(getString(R.string.pref_key_low_views_filter)).setEnabled(enableBlocker); findPreference(getString(R.string.pref_key_dislikes_filter)).setEnabled(enableBlocker); } | /**
* Enable/Disable the preferences "views" based on whether the video blocker is enabled or not.
*
* @param enableBlocker True means video blocker is enabled by the user.
* @param channelBlacklistPreference {@link Preference} for channel blacklisting.
* @param channelWhitelistPreference {@link Preference} for channel whitelisting.
*/ | Enable/Disable the preferences "views" based on whether the video blocker is enabled or not | enablePreferences | {
"repo_name": "ram-on/SkyTube",
"path": "app/src/main/java/free/rm/skytube/gui/fragments/preferences/VideoBlockerPreferenceFragment.java",
"license": "gpl-3.0",
"size": 18037
} | [
"androidx.preference.Preference"
] | import androidx.preference.Preference; | import androidx.preference.*; | [
"androidx.preference"
] | androidx.preference; | 1,927,025 |
public void paint(Graphics g)
{
if (color != RESERVED_FOR_CUSTOM_COLOR)
{
g2d = (Graphics2D) g;
ourDimensions = getSize();
Rectangle2D.Double background = new Rectangle2D.Double(0, 0, ourDimensions.width, ourDimensions.height);
g2d.setColor(color);
g2d.fill(background);
}
else
{
// determine whether to use a light or dark background
if ((customColor.getRed() > TOO_LIGHT_VALUE || customColor.getGreen() > TOO_LIGHT_VALUE || customColor
.getBlue() > TOO_LIGHT_VALUE))
{
setBackground(Color.DARK_GRAY);
}
else
{
setBackground(Color.WHITE);
}
// set the text color and the text
setForeground(customColor);
setText("Custom");
// Call the parent paint so the text is drawn
super.paint(g);
}
} | void function(Graphics g) { if (color != RESERVED_FOR_CUSTOM_COLOR) { g2d = (Graphics2D) g; ourDimensions = getSize(); Rectangle2D.Double background = new Rectangle2D.Double(0, 0, ourDimensions.width, ourDimensions.height); g2d.setColor(color); g2d.fill(background); } else { if ((customColor.getRed() > TOO_LIGHT_VALUE customColor.getGreen() > TOO_LIGHT_VALUE customColor .getBlue() > TOO_LIGHT_VALUE)) { setBackground(Color.DARK_GRAY); } else { setBackground(Color.WHITE); } setForeground(customColor); setText(STR); super.paint(g); } } | /** Makes it paint a square of color instead of a string or render the custom text with the current custom color
*
* @param g The graphics that are being used for the painting */ | Makes it paint a square of color instead of a string or render the custom text with the current custom color | paint | {
"repo_name": "darksideprogramming/LineFit",
"path": "LineFit WS/LineFit/src/linefit/ColorBoxRenderer.java",
"license": "agpl-3.0",
"size": 4775
} | [
"java.awt.Color",
"java.awt.Graphics",
"java.awt.Graphics2D",
"java.awt.geom.Rectangle2D"
] | import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.geom.Rectangle2D; | import java.awt.*; import java.awt.geom.*; | [
"java.awt"
] | java.awt; | 585,441 |
@Override
public List<E> subList(final int fromIndex, final int toIndex) {
return Collections.checkedList(super.subList(fromIndex, toIndex), type);
} | List<E> function(final int fromIndex, final int toIndex) { return Collections.checkedList(super.subList(fromIndex, toIndex), type); } | /**
* Returns a checked sublist.
*
* <p><b>Limitation:</b> current implementation checks only the type.
* It does not prevent the insertion of {@code null} values.</p>
*
* @param fromIndex index of the first element.
* @param toIndex index after the last element.
* @return the sublist in the given index range.
*/ | Returns a checked sublist. Limitation: current implementation checks only the type. It does not prevent the insertion of null values | subList | {
"repo_name": "Geomatys/sis",
"path": "core/sis-utility/src/main/java/org/apache/sis/internal/util/CheckedArrayList.java",
"license": "apache-2.0",
"size": 14016
} | [
"java.util.Collections",
"java.util.List"
] | import java.util.Collections; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,860,589 |
@Test(groups = "Hybrid", enabled = true, timeOut = 300000)
public void AONE_15493() throws Exception
{
String testName = getTestName() + uniqueRun;
String opUser1 = getUserNameForDomain(testName + "opUser1", testDomain);
String opSiteName = getSiteName(testName) + "-OP";
String opFileName1 = getFileName(testName) + "1";
String opFileName2 = getFileName(testName) + "2";
String opFileName3 = getFileName(testName) + "3";
String cloudSiteName = getSiteName(testName) + "-CL1";
String folderName = getFolderName(testName);
// ---- Step 1 ----
// ---- Step action ----
// Click Sync to Cloud for the folder..
// ---- Expected results ----
// Already synced files should be skipped.
ShareUser.login(drone, opUser1, DEFAULT_PASSWORD);
DocumentLibraryPage documentLibraryPage = ShareUser.openSitesDocumentLibrary(drone, opSiteName).render();
DestinationAndAssigneePage destinationAndAssigneePage = documentLibraryPage.getFileDirectoryInfo(folderName).selectSyncToCloud().render();
destinationAndAssigneePage.selectNetwork(testDomain1);
destinationAndAssigneePage.selectSite(cloudSiteName);
destinationAndAssigneePage.selectFolder(folderName);
destinationAndAssigneePage.clickSyncButton();
Assert.assertTrue(documentLibraryPage.isSyncMessagePresent(), "Message is not displayed");
documentLibraryPage.render();
documentLibraryPage.selectFolder(folderName);
Assert.assertTrue(documentLibraryPage.getFileDirectoryInfo(opFileName1).isCloudSynced(), opFileName1 + " is not synced");
Assert.assertTrue(documentLibraryPage.getFileDirectoryInfo(opFileName2).isCloudSynced(), opFileName2 + " is not synced");
Assert.assertTrue(documentLibraryPage.getFileDirectoryInfo(opFileName3).isIndirectlySyncedIconPresent(), opFileName2 + " is not synced");
}
| @Test(groups = STR, enabled = true, timeOut = 300000) void function() throws Exception { String testName = getTestName() + uniqueRun; String opUser1 = getUserNameForDomain(testName + STR, testDomain); String opSiteName = getSiteName(testName) + "-OP"; String opFileName1 = getFileName(testName) + "1"; String opFileName2 = getFileName(testName) + "2"; String opFileName3 = getFileName(testName) + "3"; String cloudSiteName = getSiteName(testName) + "-CL1"; String folderName = getFolderName(testName); ShareUser.login(drone, opUser1, DEFAULT_PASSWORD); DocumentLibraryPage documentLibraryPage = ShareUser.openSitesDocumentLibrary(drone, opSiteName).render(); DestinationAndAssigneePage destinationAndAssigneePage = documentLibraryPage.getFileDirectoryInfo(folderName).selectSyncToCloud().render(); destinationAndAssigneePage.selectNetwork(testDomain1); destinationAndAssigneePage.selectSite(cloudSiteName); destinationAndAssigneePage.selectFolder(folderName); destinationAndAssigneePage.clickSyncButton(); Assert.assertTrue(documentLibraryPage.isSyncMessagePresent(), STR); documentLibraryPage.render(); documentLibraryPage.selectFolder(folderName); Assert.assertTrue(documentLibraryPage.getFileDirectoryInfo(opFileName1).isCloudSynced(), opFileName1 + STR); Assert.assertTrue(documentLibraryPage.getFileDirectoryInfo(opFileName2).isCloudSynced(), opFileName2 + STR); Assert.assertTrue(documentLibraryPage.getFileDirectoryInfo(opFileName3).isIndirectlySyncedIconPresent(), opFileName2 + STR); } | /**
* AONE-15493:Already synced files.
*/ | AONE-15493:Already synced files | AONE_15493 | {
"repo_name": "nguyentienlong/community-edition",
"path": "projects/qa-share/src/test/java/org/alfresco/share/cloudsync/HybridSyncNegativeTests2.java",
"license": "lgpl-3.0",
"size": 62857
} | [
"org.alfresco.po.share.site.document.DocumentLibraryPage",
"org.alfresco.po.share.workflow.DestinationAndAssigneePage",
"org.alfresco.share.util.ShareUser",
"org.testng.Assert",
"org.testng.annotations.Test"
] | import org.alfresco.po.share.site.document.DocumentLibraryPage; import org.alfresco.po.share.workflow.DestinationAndAssigneePage; import org.alfresco.share.util.ShareUser; import org.testng.Assert; import org.testng.annotations.Test; | import org.alfresco.po.share.site.document.*; import org.alfresco.po.share.workflow.*; import org.alfresco.share.util.*; import org.testng.*; import org.testng.annotations.*; | [
"org.alfresco.po",
"org.alfresco.share",
"org.testng",
"org.testng.annotations"
] | org.alfresco.po; org.alfresco.share; org.testng; org.testng.annotations; | 770,068 |
default @Nullable String getExpectedVersionString() {
return null;
} | default @Nullable String getExpectedVersionString() { return null; } | /**
* Returns an expected version string. The same major version is and SDK is expected to be returned.
*/ | Returns an expected version string. The same major version is and SDK is expected to be returned | getExpectedVersionString | {
"repo_name": "zdary/intellij-community",
"path": "platform/lang-impl/src/com/intellij/openapi/roots/ui/configuration/UnknownSdk.java",
"license": "apache-2.0",
"size": 1691
} | [
"org.jetbrains.annotations.Nullable"
] | import org.jetbrains.annotations.Nullable; | import org.jetbrains.annotations.*; | [
"org.jetbrains.annotations"
] | org.jetbrains.annotations; | 1,957,650 |
private boolean alreadyScheduled(String ipAddress, String pkgName) {
synchronized (m_thresholdableServices) {
for (ThresholdableService tSvc : m_thresholdableServices) {
InetAddress addr = (InetAddress) tSvc.getAddress();
if (InetAddressUtils.str(addr).equals(InetAddressUtils.normalize(ipAddress)) && tSvc.getPackageName().equals(pkgName)) {
return true;
}
}
}
return false;
} | boolean function(String ipAddress, String pkgName) { synchronized (m_thresholdableServices) { for (ThresholdableService tSvc : m_thresholdableServices) { InetAddress addr = (InetAddress) tSvc.getAddress(); if (InetAddressUtils.str(addr).equals(InetAddressUtils.normalize(ipAddress)) && tSvc.getPackageName().equals(pkgName)) { return true; } } } return false; } | /**
* Returns true if specified address/pkg pair is already represented in the
* thresholdable services list. False otherwise.
*/ | Returns true if specified address/pkg pair is already represented in the thresholdable services list. False otherwise | alreadyScheduled | {
"repo_name": "bugcy013/opennms-tmp-tools",
"path": "opennms-services/src/main/java/org/opennms/netmgt/threshd/Threshd.java",
"license": "gpl-2.0",
"size": 18208
} | [
"java.net.InetAddress",
"org.opennms.core.utils.InetAddressUtils"
] | import java.net.InetAddress; import org.opennms.core.utils.InetAddressUtils; | import java.net.*; import org.opennms.core.utils.*; | [
"java.net",
"org.opennms.core"
] | java.net; org.opennms.core; | 514,090 |
public List getRowKeys() {
return this.data;
}
| List function() { return this.data; } | /**
* Returns the row keys. In this case, each series is a key.
*
* @return The row keys.
*/ | Returns the row keys. In this case, each series is a key | getRowKeys | {
"repo_name": "linuxuser586/jfreechart",
"path": "source/org/jfree/data/gantt/TaskSeriesCollection.java",
"license": "lgpl-2.1",
"size": 22000
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,026,721 |
public static <T extends GraphEntity> boolean containsAll(Collection<T> collection, Collection<T> toFind) {
return toFind.stream().allMatch(e -> contains(collection, e));
}
/**
* Returns true if the <code>left</code> and <code>right</code> contain the same
* elements, using {@link GraphEntity#deepEquals(Object)} </code> for comparing
* elements, or if both are null or empty.
*
* @param left a collection {@link GraphEntity}
* @param right a colleciton of {@link GraphEntity} | static <T extends GraphEntity> boolean function(Collection<T> collection, Collection<T> toFind) { return toFind.stream().allMatch(e -> contains(collection, e)); } /** * Returns true if the <code>left</code> and <code>right</code> contain the same * elements, using {@link GraphEntity#deepEquals(Object)} </code> for comparing * elements, or if both are null or empty. * * @param left a collection {@link GraphEntity} * @param right a colleciton of {@link GraphEntity} | /**
* Returns true if the <code>collection</code> contains all elements of
* <code>toFind</code>, using {@link GraphEntity#deepEquals(Object)} for
* comparing elements.
*
* @param collection the collection to check
* @param toFind the entities to find in the collection
* @param <T>
* @return true if <code>collection</code> deep-equals-contains all of
* <code>toFind</code>
*/ | Returns true if the <code>collection</code> contains all elements of <code>toFind</code>, using <code>GraphEntity#deepEquals(Object)</code> for comparing elements | containsAll | {
"repo_name": "researchstudio-sat/webofneeds",
"path": "webofneeds/won-utils/won-utils-shacl2java/src/main/java/won/shacl2java/runtime/DeepEqualsUtils.java",
"license": "apache-2.0",
"size": 4274
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 2,336,566 |
@Override
public void setProperties(Map<String, Object> props) {
super.setProperties(props);
if (props.get(STRATEGY_CLASS_PROP_KEY) != null) {
String strategy_class = (String) props.get(STRATEGY_CLASS_PROP_KEY);
try {
ClusteringStrategyIfc strategy_tmp = (ClusteringStrategyIfc) Class.forName(
strategy_class).newInstance();
strategy_tmp.setSessionManagerHandler(this);
strategy_tmp.setProperties(props);
// strategy_tmp.init(getName());
strategy = strategy_tmp;
strategy.setSessionManagerHandler(this);
log.log(Level.CONFIG, "Loaded SM strategy: {0}", strategy_class);
// strategy.nodeConnected(getComponentId());
addTrusted(getComponentId());
if (clusterController != null) {
strategy.setClusterController(clusterController);
}
} catch (ClassNotFoundException | IllegalAccessException | InstantiationException e) {
log.log(Level.SEVERE, "Cannot instance clustering strategy class: " +
strategy_class, e);
}
}
updateServiceEntity();
try {
if (props.get(MY_DOMAIN_NAME_PROP_KEY) != null) {
my_hostname = JID.jidInstance((String) props.get(MY_DOMAIN_NAME_PROP_KEY));
my_address = JID.jidInstance(getName(), (String) props.get(
MY_DOMAIN_NAME_PROP_KEY), null);
}
} catch (TigaseStringprepException ex) {
log.log(Level.WARNING,
"Creating component source address failed stringprep processing: {0}@{1}",
new Object[] { getName(),
my_hostname });
}
}
//~--- methods --------------------------------------------------------------
| void function(Map<String, Object> props) { super.setProperties(props); if (props.get(STRATEGY_CLASS_PROP_KEY) != null) { String strategy_class = (String) props.get(STRATEGY_CLASS_PROP_KEY); try { ClusteringStrategyIfc strategy_tmp = (ClusteringStrategyIfc) Class.forName( strategy_class).newInstance(); strategy_tmp.setSessionManagerHandler(this); strategy_tmp.setProperties(props); strategy = strategy_tmp; strategy.setSessionManagerHandler(this); log.log(Level.CONFIG, STR, strategy_class); addTrusted(getComponentId()); if (clusterController != null) { strategy.setClusterController(clusterController); } } catch (ClassNotFoundException IllegalAccessException InstantiationException e) { log.log(Level.SEVERE, STR + strategy_class, e); } } updateServiceEntity(); try { if (props.get(MY_DOMAIN_NAME_PROP_KEY) != null) { my_hostname = JID.jidInstance((String) props.get(MY_DOMAIN_NAME_PROP_KEY)); my_address = JID.jidInstance(getName(), (String) props.get( MY_DOMAIN_NAME_PROP_KEY), null); } } catch (TigaseStringprepException ex) { log.log(Level.WARNING, STR, new Object[] { getName(), my_hostname }); } } | /**
* Standard component's configuration method.
*
*
* @param props
*/ | Standard component's configuration method | setProperties | {
"repo_name": "DanielYao/tigase-server",
"path": "src/main/java/tigase/cluster/SessionManagerClustered.java",
"license": "agpl-3.0",
"size": 17180
} | [
"java.util.Map",
"java.util.logging.Level"
] | import java.util.Map; import java.util.logging.Level; | import java.util.*; import java.util.logging.*; | [
"java.util"
] | java.util; | 2,215,160 |
@Override
public void close() throws OncRpcException, IOException {
buffer = null;
socket = null;
} | void function() throws OncRpcException, IOException { buffer = null; socket = null; } | /**
* Closes this encoding XDR stream and releases any system resources
* associated with this stream. The general contract of <code>close</code>
* is that it closes the encoding XDR stream. A closed XDR stream cannot
* perform encoding operations and cannot be reopened.
*
* @throws OncRpcException
* if an ONC/RPC error occurs.
* @throws IOException
* if an I/O error occurs.
*/ | Closes this encoding XDR stream and releases any system resources associated with this stream. The general contract of <code>close</code> is that it closes the encoding XDR stream. A closed XDR stream cannot perform encoding operations and cannot be reopened | close | {
"repo_name": "SnakeDoc/GuestVM",
"path": "guestvm~guestvm/com.oracle.max.ve.nfsserver/src/org/acplt/oncrpc/XdrTcpEncodingStream.java",
"license": "bsd-3-clause",
"size": 14120
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 273,946 |
public static SAML11AssertionType createSAML11Assertion(String id, XMLGregorianCalendar issueInstant, String issuer) {
SAML11AssertionType assertion = new SAML11AssertionType(id, issueInstant);
assertion.setIssuer(issuer);
return assertion;
} | static SAML11AssertionType function(String id, XMLGregorianCalendar issueInstant, String issuer) { SAML11AssertionType assertion = new SAML11AssertionType(id, issueInstant); assertion.setIssuer(issuer); return assertion; } | /**
* Create an assertion
*
* @param id
* @param issuer
*
* @return
*/ | Create an assertion | createSAML11Assertion | {
"repo_name": "chameleon82/keycloak",
"path": "saml-core/src/main/java/org/keycloak/saml/processing/core/saml/v2/util/AssertionUtil.java",
"license": "apache-2.0",
"size": 22336
} | [
"javax.xml.datatype.XMLGregorianCalendar",
"org.keycloak.dom.saml.v1.assertion.SAML11AssertionType"
] | import javax.xml.datatype.XMLGregorianCalendar; import org.keycloak.dom.saml.v1.assertion.SAML11AssertionType; | import javax.xml.datatype.*; import org.keycloak.dom.saml.v1.assertion.*; | [
"javax.xml",
"org.keycloak.dom"
] | javax.xml; org.keycloak.dom; | 1,842,661 |
public InvoicePaidApplied getInvoicePaidApplied(int index) {
return index < getInvoicePaidApplieds().size() ? getInvoicePaidApplieds().get(index) : new InvoicePaidApplied();
} | InvoicePaidApplied function(int index) { return index < getInvoicePaidApplieds().size() ? getInvoicePaidApplieds().get(index) : new InvoicePaidApplied(); } | /**
* This method retrieves a specific applied payment from the list, by array index
*
* @param index the index of the applied payment to retrieve
* @return an InvoicePaidApplied
*/ | This method retrieves a specific applied payment from the list, by array index | getInvoicePaidApplied | {
"repo_name": "quikkian-ua-devops/will-financials",
"path": "kfs-ar/src/main/java/org/kuali/kfs/module/ar/document/PaymentApplicationDocument.java",
"license": "agpl-3.0",
"size": 79628
} | [
"org.kuali.kfs.module.ar.businessobject.InvoicePaidApplied"
] | import org.kuali.kfs.module.ar.businessobject.InvoicePaidApplied; | import org.kuali.kfs.module.ar.businessobject.*; | [
"org.kuali.kfs"
] | org.kuali.kfs; | 2,666,325 |
public ObjectInputStream getEntrada() {
return entrada;
} | ObjectInputStream function() { return entrada; } | /**
* Pide la entrada.
*
* @return Devuelve la entrada
*/ | Pide la entrada | getEntrada | {
"repo_name": "JavaPeppers/jrpg-2017b-cliente",
"path": "src/main/java/cliente/Cliente.java",
"license": "mit",
"size": 14040
} | [
"java.io.ObjectInputStream"
] | import java.io.ObjectInputStream; | import java.io.*; | [
"java.io"
] | java.io; | 964,393 |
@SuppressWarnings("unchecked")
public B usingDriverExecutable(File file) {
checkNotNull(file);
checkExecutable(file);
this.exe = file;
return (B) this;
} | @SuppressWarnings(STR) B function(File file) { checkNotNull(file); checkExecutable(file); this.exe = file; return (B) this; } | /**
* Sets which driver executable the builder will use.
*
* @param file The executable to use.
* @return A self reference.
*/ | Sets which driver executable the builder will use | usingDriverExecutable | {
"repo_name": "krmahadevan/selenium",
"path": "java/client/src/org/openqa/selenium/remote/service/DriverService.java",
"license": "apache-2.0",
"size": 11194
} | [
"com.google.common.base.Preconditions",
"java.io.File"
] | import com.google.common.base.Preconditions; import java.io.File; | import com.google.common.base.*; import java.io.*; | [
"com.google.common",
"java.io"
] | com.google.common; java.io; | 1,076,031 |
INaviView getView(INaviFunction function); | INaviView getView(INaviFunction function); | /**
* Returns the view backed by a given function.
*
* @param function The function that backs the view.
*
* @return The view backed by a given function.
*/ | Returns the view backed by a given function | getView | {
"repo_name": "google/binnavi",
"path": "src/main/java/com/google/security/zynamics/binnavi/disassembly/views/IViewContainer.java",
"license": "apache-2.0",
"size": 6097
} | [
"com.google.security.zynamics.binnavi.disassembly.INaviFunction"
] | import com.google.security.zynamics.binnavi.disassembly.INaviFunction; | import com.google.security.zynamics.binnavi.disassembly.*; | [
"com.google.security"
] | com.google.security; | 818,761 |
protected ZonelessTime getTime() {
ZonelessTime zt = new ZonelessTime();
zt.setZonelessTime(getCal().getTimeInMillis());
return zt;
} | ZonelessTime function() { ZonelessTime zt = new ZonelessTime(); zt.setZonelessTime(getCal().getTimeInMillis()); return zt; } | /**
* Converts this literal to a
* {@link org.apache.calcite.util.ZonelessTime} object.
*/ | Converts this literal to a <code>org.apache.calcite.util.ZonelessTime</code> object | getTime | {
"repo_name": "YrAuYong/incubator-calcite",
"path": "core/src/main/java/org/apache/calcite/sql/SqlAbstractDateTimeLiteral.java",
"license": "apache-2.0",
"size": 4501
} | [
"org.apache.calcite.util.ZonelessTime"
] | import org.apache.calcite.util.ZonelessTime; | import org.apache.calcite.util.*; | [
"org.apache.calcite"
] | org.apache.calcite; | 1,296,727 |
public ServiceCall<List<CertificateIssuerItem>> listCertificateIssuersAsync(final String vaultBaseUrl, final Integer maxresults, final ListOperationCallback<CertificateIssuerItem> serviceCallback) {
return innerKeyVaultClient.getCertificateIssuersAsync(vaultBaseUrl, maxresults, serviceCallback);
} | ServiceCall<List<CertificateIssuerItem>> function(final String vaultBaseUrl, final Integer maxresults, final ListOperationCallback<CertificateIssuerItem> serviceCallback) { return innerKeyVaultClient.getCertificateIssuersAsync(vaultBaseUrl, maxresults, serviceCallback); } | /**
* List certificate issuers for the specified vault.
*
* @param vaultBaseUrl The vault name, e.g. https://myvault.vault.azure.net
* @param maxresults Maximum number of results to return in a page. If not specified the service will return up to 25 results.
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/ | List certificate issuers for the specified vault | listCertificateIssuersAsync | {
"repo_name": "pomortaz/azure-sdk-for-java",
"path": "azure-keyvault/src/main/java/com/microsoft/azure/keyvault/KeyVaultClient.java",
"license": "mit",
"size": 85271
} | [
"com.microsoft.azure.ListOperationCallback",
"com.microsoft.azure.keyvault.models.CertificateIssuerItem",
"com.microsoft.rest.ServiceCall",
"java.util.List"
] | import com.microsoft.azure.ListOperationCallback; import com.microsoft.azure.keyvault.models.CertificateIssuerItem; import com.microsoft.rest.ServiceCall; import java.util.List; | import com.microsoft.azure.*; import com.microsoft.azure.keyvault.models.*; import com.microsoft.rest.*; import java.util.*; | [
"com.microsoft.azure",
"com.microsoft.rest",
"java.util"
] | com.microsoft.azure; com.microsoft.rest; java.util; | 1,164,509 |
private void deleteIPCondition(Connection connection, int conID) throws SQLException {
final String query = "DELETE FROM AM_IP_CONDITION WHERE CONDITION_GROUP_ID = ?";
try (PreparedStatement preparedStatement = connection.prepareStatement(query)) {
preparedStatement.setInt(1, conID);
preparedStatement.execute();
}
} | void function(Connection connection, int conID) throws SQLException { final String query = STR; try (PreparedStatement preparedStatement = connection.prepareStatement(query)) { preparedStatement.setInt(1, conID); preparedStatement.execute(); } } | /**
* Deleting IP condition from database
*
* @param connection connection to the database
* @param conID condition group id/ pipeline id of the ip condition
* @throws SQLException if error occurred when ip condition is deleted
*/ | Deleting IP condition from database | deleteIPCondition | {
"repo_name": "lakmali/carbon-apimgt",
"path": "components/apimgt/org.wso2.carbon.apimgt.core/src/main/java/org/wso2/carbon/apimgt/core/dao/impl/PolicyDAOImpl.java",
"license": "apache-2.0",
"size": 109019
} | [
"java.sql.Connection",
"java.sql.PreparedStatement",
"java.sql.SQLException"
] | import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 1,241,615 |
public static Document createDocument(String xmlString)
{
log.debug("createDocument()");
Document document = null;
DocumentBuilderFactory builderFactory =
DocumentBuilderFactory.newInstance();
builderFactory.setNamespaceAware(true);
try
{
setDocumentBuilderFactoryFeatures(builderFactory);
DocumentBuilder documentBuilder = builderFactory.newDocumentBuilder();
document = documentBuilder.parse(xmlString);
}
catch (IOException ex)
{
log.error(ex.getMessage(), ex);
}
catch (SAXException ex)
{
log.error(ex.getMessage(), ex);
}
catch(ParserConfigurationException e)
{
log.error(e.getMessage(), e);
}
return document;
} | static Document function(String xmlString) { log.debug(STR); Document document = null; DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance(); builderFactory.setNamespaceAware(true); try { setDocumentBuilderFactoryFeatures(builderFactory); DocumentBuilder documentBuilder = builderFactory.newDocumentBuilder(); document = documentBuilder.parse(xmlString); } catch (IOException ex) { log.error(ex.getMessage(), ex); } catch (SAXException ex) { log.error(ex.getMessage(), ex); } catch(ParserConfigurationException e) { log.error(e.getMessage(), e); } return document; } | /**
* Create document object from XML string
*
* @return Document
*/ | Create document object from XML string | createDocument | {
"repo_name": "clhedrick/sakai",
"path": "samigo/samigo-qti/src/java/org/sakaiproject/tool/assessment/qti/util/XmlUtil.java",
"license": "apache-2.0",
"size": 20571
} | [
"java.io.IOException",
"javax.xml.parsers.DocumentBuilder",
"javax.xml.parsers.DocumentBuilderFactory",
"javax.xml.parsers.ParserConfigurationException",
"org.w3c.dom.Document",
"org.xml.sax.SAXException"
] | import java.io.IOException; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import org.w3c.dom.Document; import org.xml.sax.SAXException; | import java.io.*; import javax.xml.parsers.*; import org.w3c.dom.*; import org.xml.sax.*; | [
"java.io",
"javax.xml",
"org.w3c.dom",
"org.xml.sax"
] | java.io; javax.xml; org.w3c.dom; org.xml.sax; | 1,504,431 |
public OffsetDateTime getExpirationDateTime() {
return this.expirationDateTime;
} | OffsetDateTime function() { return this.expirationDateTime; } | /**
* Get the expirationDateTime property: The expirationDateTime property.
*
* @return the expirationDateTime value.
*/ | Get the expirationDateTime property: The expirationDateTime property | getExpirationDateTime | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/textanalytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/models/JobMetadata.java",
"license": "mit",
"size": 3872
} | [
"java.time.OffsetDateTime"
] | import java.time.OffsetDateTime; | import java.time.*; | [
"java.time"
] | java.time; | 2,897,591 |
@Test
public void testAddDiscardStateHandleAfterFailure() throws Exception {
// Setup
LongStateStorage stateHandleProvider = new LongStateStorage();
CuratorFramework client = spy(ZooKeeper.getClient());
when(client.create()).thenThrow(new RuntimeException("Expected test Exception."));
ZooKeeperStateHandleStore<Long> store = new ZooKeeperStateHandleStore<>(
client, stateHandleProvider, Executors.directExecutor());
// Config
final String pathInZooKeeper = "/testAddDiscardStateHandleAfterFailure";
final Long state = 81282227L;
try {
// Test
store.add(pathInZooKeeper, state);
fail("Did not throw expected exception");
}
catch (Exception ignored) {
}
// Verify
// State handle created and discarded
assertEquals(1, stateHandleProvider.getStateHandles().size());
assertEquals(state, stateHandleProvider.getStateHandles().get(0).retrieveState());
assertEquals(1, stateHandleProvider.getStateHandles().get(0).getNumberOfDiscardCalls());
} | void function() throws Exception { LongStateStorage stateHandleProvider = new LongStateStorage(); CuratorFramework client = spy(ZooKeeper.getClient()); when(client.create()).thenThrow(new RuntimeException(STR)); ZooKeeperStateHandleStore<Long> store = new ZooKeeperStateHandleStore<>( client, stateHandleProvider, Executors.directExecutor()); final String pathInZooKeeper = STR; final Long state = 81282227L; try { store.add(pathInZooKeeper, state); fail(STR); } catch (Exception ignored) { } assertEquals(1, stateHandleProvider.getStateHandles().size()); assertEquals(state, stateHandleProvider.getStateHandles().get(0).retrieveState()); assertEquals(1, stateHandleProvider.getStateHandles().get(0).getNumberOfDiscardCalls()); } | /**
* Tests that the created state handle is discarded if ZooKeeper create fails.
*/ | Tests that the created state handle is discarded if ZooKeeper create fails | testAddDiscardStateHandleAfterFailure | {
"repo_name": "DieBauer/flink",
"path": "flink-runtime/src/test/java/org/apache/flink/runtime/zookeeper/ZooKeeperStateHandleStoreITCase.java",
"license": "apache-2.0",
"size": 19399
} | [
"org.apache.curator.framework.CuratorFramework",
"org.apache.flink.runtime.concurrent.Executors",
"org.junit.Assert",
"org.mockito.Mockito"
] | import org.apache.curator.framework.CuratorFramework; import org.apache.flink.runtime.concurrent.Executors; import org.junit.Assert; import org.mockito.Mockito; | import org.apache.curator.framework.*; import org.apache.flink.runtime.concurrent.*; import org.junit.*; import org.mockito.*; | [
"org.apache.curator",
"org.apache.flink",
"org.junit",
"org.mockito"
] | org.apache.curator; org.apache.flink; org.junit; org.mockito; | 1,357,500 |
public Object clone() throws CloneNotSupportedException {
SimilarityProfile clone = (SimilarityProfile) super.clone();
//new SimilarityProfile((CaseStruct) caseStruct.clone(), username, domain);
List keys = caseStruct.getFeaturePaths();
for (int i = 0; i < keys.size(); i++) {
String key = (String) keys.get(i);
Double relevance = (Double) relevances.get(key);
if (relevance != null)
clone.relevances.put(key, new Double(relevance.doubleValue()));
SimilarityGraph graph = (SimilarityGraph) graphs.get(key);
if (graph != null)
clone.graphs.put(key, graph.clone());
clone.similarityArrays = (Hashtable) ((Hashtable) similarityArrays)
.clone();
Integer similarityType = (Integer) similarityTypes.get(key);
if (similarityType != null)
clone.similarityTypes.put(key, Integer.valueOf(similarityType
.intValue()));
List symbolValueList = (List) symbolValueLists.get(key);
if (symbolValueList != null) {
List newSymbolValueList = new ArrayList();
for (int j = 0; j < symbolValueList.size(); j++) {
// this list is all strings
newSymbolValueList.add((String) symbolValueList.get(j));
}
clone.symbolValueLists.put(key, newSymbolValueList);
}
try {
SimilarityMeasure simMeasure = (SimilarityMeasure) similarityMeasures
.get(key);
if (simMeasure != null)
clone.similarityMeasures.put(key, simMeasure.clone());
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
}
return clone;
}
| Object function() throws CloneNotSupportedException { SimilarityProfile clone = (SimilarityProfile) super.clone(); List keys = caseStruct.getFeaturePaths(); for (int i = 0; i < keys.size(); i++) { String key = (String) keys.get(i); Double relevance = (Double) relevances.get(key); if (relevance != null) clone.relevances.put(key, new Double(relevance.doubleValue())); SimilarityGraph graph = (SimilarityGraph) graphs.get(key); if (graph != null) clone.graphs.put(key, graph.clone()); clone.similarityArrays = (Hashtable) ((Hashtable) similarityArrays) .clone(); Integer similarityType = (Integer) similarityTypes.get(key); if (similarityType != null) clone.similarityTypes.put(key, Integer.valueOf(similarityType .intValue())); List symbolValueList = (List) symbolValueLists.get(key); if (symbolValueList != null) { List newSymbolValueList = new ArrayList(); for (int j = 0; j < symbolValueList.size(); j++) { newSymbolValueList.add((String) symbolValueList.get(j)); } clone.symbolValueLists.put(key, newSymbolValueList); } try { SimilarityMeasure simMeasure = (SimilarityMeasure) similarityMeasures .get(key); if (simMeasure != null) clone.similarityMeasures.put(key, simMeasure.clone()); } catch (CloneNotSupportedException e) { e.printStackTrace(); } } return clone; } | /**
* Creates and returns a copy of this SimilarityProfile.
*
* @return a clone of this instance.
*/ | Creates and returns a copy of this SimilarityProfile | clone | {
"repo_name": "knoxsp/Concept",
"path": "src/cbml/cbr/SimilarityProfile.java",
"license": "gpl-2.0",
"size": 39835
} | [
"java.util.ArrayList",
"java.util.Hashtable",
"java.util.List"
] | import java.util.ArrayList; import java.util.Hashtable; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,411,738 |
public void setFilldbl3(BigDecimal filldbl3) {
this.filldbl3 = filldbl3;
} | void function(BigDecimal filldbl3) { this.filldbl3 = filldbl3; } | /**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column PTOPER.FILLDBL3
*
* @param filldbl3 the value for PTOPER.FILLDBL3
*
* @mbggenerated Fri Jul 22 13:16:43 CST 2011
*/ | This method was generated by MyBatis Generator. This method sets the value of the database column PTOPER.FILLDBL3 | setFilldbl3 | {
"repo_name": "zhanrui/ky-epss",
"path": "src/main/java/platform/repository/model/Ptoper.java",
"license": "gpl-2.0",
"size": 27817
} | [
"java.math.BigDecimal"
] | import java.math.BigDecimal; | import java.math.*; | [
"java.math"
] | java.math; | 458,677 |
// Setup the command line options
CommandLine commandLine = new CommandLineHelper().startApp(createOptions(), "flatnj [options] <input>",
"An implementation of the Flat Net Joining (FlatNJ) algorithm to produce planar networks where labels can appear inside the network.\n" +
"Required input is quartet-like (4-split) data, although flatnj can automatically generate this from multiple sequence alignments, location data (X,Y coordinates) or other compatible split networks.\n" +
"Input can either be nexus format containing: taxa, character, data, distances, locations, splits or quadruples blocks, or a fasta-style format file containing the multiple sequence alignments.",
args);
// If we didn't return a command line object then just return. Probably the user requested help or
// input invalid args
if (commandLine == null) {
return;
}
try {
// Configure logger
LogConfig.defaultConfig(commandLine.hasOption(OPT_VERBOSE));
// Parsing the command line.
log.info("Running Flat Neighbor Joining (FlatNJ) Algorithm");
log.debug("Parsing command line options");
FlatNJOptions opts = processArgs(commandLine);
FlatNJ flatNJ = new FlatNJ(opts);
flatNJ.run();
if (flatNJ.failed()) {
log.error(flatNJ.getErrorMessage());
}
else {
log.info("Completed successfully");
}
} catch (Exception e) {
System.err.println("\nException: " + e.toString());
System.err.println("\nStack trace:");
System.err.println(StringUtils.join(e.getStackTrace(), "\n"));
System.exit(1);
}
} | CommandLine commandLine = new CommandLineHelper().startApp(createOptions(), STR, STR + STR + STR, args); if (commandLine == null) { return; } try { LogConfig.defaultConfig(commandLine.hasOption(OPT_VERBOSE)); log.info(STR); log.debug(STR); FlatNJOptions opts = processArgs(commandLine); FlatNJ flatNJ = new FlatNJ(opts); flatNJ.run(); if (flatNJ.failed()) { log.error(flatNJ.getErrorMessage()); } else { log.info(STR); } } catch (Exception e) { System.err.println(STR + e.toString()); System.err.println(STR); System.err.println(StringUtils.join(e.getStackTrace(), "\n")); System.exit(1); } } | /**
* Main method
*
* @param args the command line arguments
*/ | Main method | main | {
"repo_name": "maplesond/spectre",
"path": "flatnj/src/main/java/uk/ac/uea/cmp/spectre/flatnj/FlatNJCLI.java",
"license": "gpl-3.0",
"size": 6903
} | [
"org.apache.commons.cli.CommandLine",
"org.apache.commons.lang3.StringUtils",
"uk.ac.uea.cmp.spectre.core.ui.cli.CommandLineHelper",
"uk.ac.uea.cmp.spectre.core.util.LogConfig"
] | import org.apache.commons.cli.CommandLine; import org.apache.commons.lang3.StringUtils; import uk.ac.uea.cmp.spectre.core.ui.cli.CommandLineHelper; import uk.ac.uea.cmp.spectre.core.util.LogConfig; | import org.apache.commons.cli.*; import org.apache.commons.lang3.*; import uk.ac.uea.cmp.spectre.core.ui.cli.*; import uk.ac.uea.cmp.spectre.core.util.*; | [
"org.apache.commons",
"uk.ac.uea"
] | org.apache.commons; uk.ac.uea; | 571,491 |
@ApiModelProperty(value = "")
public String getEnQueueTime() {
return enQueueTime;
} | @ApiModelProperty(value = "") String function() { return enQueueTime; } | /**
* Get enQueueTime
* @return enQueueTime
**/ | Get enQueueTime | getEnQueueTime | {
"repo_name": "cliffano/swaggy-jenkins",
"path": "clients/java-pkmst/generated/src/main/java/com/prokarma/pkmst/model/PipelinelatestRun.java",
"license": "mit",
"size": 10421
} | [
"io.swagger.annotations.ApiModelProperty"
] | import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.*; | [
"io.swagger.annotations"
] | io.swagger.annotations; | 185,495 |
public Viewer getViewer() {
return currentViewer;
} | Viewer function() { return currentViewer; } | /**
* This returns the viewer as required by the {@link IViewerProvider} interface.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This returns the viewer as required by the <code>IViewerProvider</code> interface. | getViewer | {
"repo_name": "florianpirchner/nndesigner",
"path": "org.eclipse.athene.nn.model.editor/src/org/eclipse/athene/nn/model/tensorflow/presentation/TensorflowEditor.java",
"license": "epl-1.0",
"size": 54430
} | [
"org.eclipse.jface.viewers.Viewer"
] | import org.eclipse.jface.viewers.Viewer; | import org.eclipse.jface.viewers.*; | [
"org.eclipse.jface"
] | org.eclipse.jface; | 1,032,427 |
private boolean overridesSuperclassMethod(JavaClass javaClass, Method method) {
if (method.isStatic())
return false;
try {
JavaClass[] superclassList = javaClass.getSuperClasses();
if (superclassList != null) {
JavaClassAndMethod match = Hierarchy.findMethod(superclassList, method.getName(), method.getSignature(),
Hierarchy.INSTANCE_METHOD);
if (match != null)
return true;
}
JavaClass[] interfaceList = javaClass.getAllInterfaces();
if (interfaceList != null) {
JavaClassAndMethod match = Hierarchy.findMethod(interfaceList, method.getName(), method.getSignature(),
Hierarchy.INSTANCE_METHOD);
if (match != null)
return true;
}
return false;
} catch (ClassNotFoundException e) {
return true;
}
} | boolean function(JavaClass javaClass, Method method) { if (method.isStatic()) return false; try { JavaClass[] superclassList = javaClass.getSuperClasses(); if (superclassList != null) { JavaClassAndMethod match = Hierarchy.findMethod(superclassList, method.getName(), method.getSignature(), Hierarchy.INSTANCE_METHOD); if (match != null) return true; } JavaClass[] interfaceList = javaClass.getAllInterfaces(); if (interfaceList != null) { JavaClassAndMethod match = Hierarchy.findMethod(interfaceList, method.getName(), method.getSignature(), Hierarchy.INSTANCE_METHOD); if (match != null) return true; } return false; } catch (ClassNotFoundException e) { return true; } } | /**
* Determine if given method overrides a superclass or superinterface
* method.
*
* @param javaClass
* class defining the method
* @param method
* the method
* @return true if the method overrides a superclass/superinterface method,
* false if not
* @throws ClassNotFoundException
*/ | Determine if given method overrides a superclass or superinterface method | overridesSuperclassMethod | {
"repo_name": "jesusaplsoft/FindAllBugs",
"path": "findbugs/src/java/edu/umd/cs/findbugs/model/ClassFeatureSet.java",
"license": "gpl-2.0",
"size": 11989
} | [
"edu.umd.cs.findbugs.ba.Hierarchy",
"edu.umd.cs.findbugs.ba.JavaClassAndMethod",
"org.apache.bcel.classfile.JavaClass",
"org.apache.bcel.classfile.Method"
] | import edu.umd.cs.findbugs.ba.Hierarchy; import edu.umd.cs.findbugs.ba.JavaClassAndMethod; import org.apache.bcel.classfile.JavaClass; import org.apache.bcel.classfile.Method; | import edu.umd.cs.findbugs.ba.*; import org.apache.bcel.classfile.*; | [
"edu.umd.cs",
"org.apache.bcel"
] | edu.umd.cs; org.apache.bcel; | 1,149,161 |
@Override
public void update(LineEvent event) {
LineEvent.Type type = event.getType();
if (type == LineEvent.Type.STOP)
playCompleted = true;
} | void function(LineEvent event) { LineEvent.Type type = event.getType(); if (type == LineEvent.Type.STOP) playCompleted = true; } | /**
* Listens to the START and STOP events of the audio line.
*/ | Listens to the START and STOP events of the audio line | update | {
"repo_name": "JonasAndree/Programmering2",
"path": "src/UML/exercise/AudioPlayer.java",
"license": "mit",
"size": 2557
} | [
"javax.sound.sampled.LineEvent"
] | import javax.sound.sampled.LineEvent; | import javax.sound.sampled.*; | [
"javax.sound"
] | javax.sound; | 1,378,729 |
@Test
public void testDataflowSideInputEmpty() throws Exception {
PipelineOptions options = PipelineOptionsFactory.create();
ExecutionContext executionContext = DataflowExecutionContext.withoutSideInputs();
DataflowSideInputReader sideInputReader = DataflowSideInputReader.of(
Collections.<SideInputInfo>emptyList(), options, executionContext);
assertTrue(sideInputReader.isEmpty());
} | void function() throws Exception { PipelineOptions options = PipelineOptionsFactory.create(); ExecutionContext executionContext = DataflowExecutionContext.withoutSideInputs(); DataflowSideInputReader sideInputReader = DataflowSideInputReader.of( Collections.<SideInputInfo>emptyList(), options, executionContext); assertTrue(sideInputReader.isEmpty()); } | /**
* Tests that when a {@link PCollectionView} is not available in a
* {@link DataflowSideInputReader}, it is reflected properly.
*/ | Tests that when a <code>PCollectionView</code> is not available in a <code>DataflowSideInputReader</code>, it is reflected properly | testDataflowSideInputEmpty | {
"repo_name": "dhananjaypatkar/DataflowJavaSDK",
"path": "sdk/src/test/java/com/google/cloud/dataflow/sdk/runners/worker/DataflowSideInputReaderTest.java",
"license": "apache-2.0",
"size": 7350
} | [
"com.google.api.services.dataflow.model.SideInputInfo",
"com.google.cloud.dataflow.sdk.options.PipelineOptions",
"com.google.cloud.dataflow.sdk.options.PipelineOptionsFactory",
"com.google.cloud.dataflow.sdk.util.ExecutionContext",
"java.util.Collections",
"org.junit.Assert"
] | import com.google.api.services.dataflow.model.SideInputInfo; import com.google.cloud.dataflow.sdk.options.PipelineOptions; import com.google.cloud.dataflow.sdk.options.PipelineOptionsFactory; import com.google.cloud.dataflow.sdk.util.ExecutionContext; import java.util.Collections; import org.junit.Assert; | import com.google.api.services.dataflow.model.*; import com.google.cloud.dataflow.sdk.options.*; import com.google.cloud.dataflow.sdk.util.*; import java.util.*; import org.junit.*; | [
"com.google.api",
"com.google.cloud",
"java.util",
"org.junit"
] | com.google.api; com.google.cloud; java.util; org.junit; | 2,870,733 |
public int getRotation()
{
return this.getCOSObject().getInt(COSName.R, 0);
} | int function() { return this.getCOSObject().getInt(COSName.R, 0); } | /**
* This will retrieve the rotation of the annotation widget. It must be a multiple of 90. Default is 0
*
* @return the rotation
*/ | This will retrieve the rotation of the annotation widget. It must be a multiple of 90. Default is 0 | getRotation | {
"repo_name": "mdamt/pdfbox",
"path": "pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/PDAppearanceCharacteristicsDictionary.java",
"license": "apache-2.0",
"size": 6534
} | [
"org.apache.pdfbox.cos.COSName"
] | import org.apache.pdfbox.cos.COSName; | import org.apache.pdfbox.cos.*; | [
"org.apache.pdfbox"
] | org.apache.pdfbox; | 1,525,116 |
public Observable<ServiceResponse<IssuerBundle>> updateCertificateIssuerWithServiceResponseAsync(String vaultBaseUrl, String issuerName) {
if (vaultBaseUrl == null) {
throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null.");
}
if (issuerName == null) {
throw new IllegalArgumentException("Parameter issuerName is required and cannot be null.");
}
if (this.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null.");
} | Observable<ServiceResponse<IssuerBundle>> function(String vaultBaseUrl, String issuerName) { if (vaultBaseUrl == null) { throw new IllegalArgumentException(STR); } if (issuerName == null) { throw new IllegalArgumentException(STR); } if (this.apiVersion() == null) { throw new IllegalArgumentException(STR); } | /**
* Updates the specified certificate issuer.
* The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity. This operation requires the certificates/setissuers permission.
*
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
* @param issuerName The name of the issuer.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable to the IssuerBundle object
*/ | Updates the specified certificate issuer. The UpdateCertificateIssuer operation performs an update on the specified certificate issuer entity. This operation requires the certificates/setissuers permission | updateCertificateIssuerWithServiceResponseAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/keyvault/microsoft-azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java",
"license": "mit",
"size": 884227
} | [
"com.microsoft.azure.keyvault.models.IssuerBundle",
"com.microsoft.rest.ServiceResponse"
] | import com.microsoft.azure.keyvault.models.IssuerBundle; import com.microsoft.rest.ServiceResponse; | import com.microsoft.azure.keyvault.models.*; import com.microsoft.rest.*; | [
"com.microsoft.azure",
"com.microsoft.rest"
] | com.microsoft.azure; com.microsoft.rest; | 1,553,099 |
public void display(float offsetX, float offsetY, float offsetZ, float speed, int amount, Location center, List<Player> players) throws ParticleVersionException, ParticleDataException, IllegalArgumentException {
if (!isSupported()) {
throw new ParticleVersionException("This particle effect is not supported by your server version");
}
if (hasProperty(ParticleProperty.REQUIRES_DATA)) {
throw new ParticleDataException("This particle effect requires additional data");
}
if (hasProperty(ParticleProperty.REQUIRES_WATER) && !isWater(center)) {
throw new IllegalArgumentException("There is no water at the center location");
}
new ParticlePacket(this, offsetX, offsetY, offsetZ, speed, amount, isLongDistance(center, players), null).sendTo(center, players);
} | void function(float offsetX, float offsetY, float offsetZ, float speed, int amount, Location center, List<Player> players) throws ParticleVersionException, ParticleDataException, IllegalArgumentException { if (!isSupported()) { throw new ParticleVersionException(STR); } if (hasProperty(ParticleProperty.REQUIRES_DATA)) { throw new ParticleDataException(STR); } if (hasProperty(ParticleProperty.REQUIRES_WATER) && !isWater(center)) { throw new IllegalArgumentException(STR); } new ParticlePacket(this, offsetX, offsetY, offsetZ, speed, amount, isLongDistance(center, players), null).sendTo(center, players); } | /**
* Displays a particle effect which is only visible for the specified players
*
* @param offsetX Maximum distance particles can fly away from the center on the x-axis
* @param offsetY Maximum distance particles can fly away from the center on the y-axis
* @param offsetZ Maximum distance particles can fly away from the center on the z-axis
* @param speed Display speed of the particles
* @param amount Amount of particles
* @param center Center location of the effect
* @param players Receivers of the effect
* @throws ParticleVersionException If the particle effect is not supported by the server version
* @throws ParticleDataException If the particle effect requires additional data
* @throws IllegalArgumentException If the particle effect requires water and none is at the center location
* @see ParticlePacket
* @see ParticlePacket#sendTo(Location, List)
*/ | Displays a particle effect which is only visible for the specified players | display | {
"repo_name": "fahlur/MonsterSnatcher",
"path": "src/me.Fahlur.MonsterSnatcher/ParticleEffect.java",
"license": "gpl-3.0",
"size": 59984
} | [
"java.util.List",
"org.bukkit.Location",
"org.bukkit.entity.Player"
] | import java.util.List; import org.bukkit.Location; import org.bukkit.entity.Player; | import java.util.*; import org.bukkit.*; import org.bukkit.entity.*; | [
"java.util",
"org.bukkit",
"org.bukkit.entity"
] | java.util; org.bukkit; org.bukkit.entity; | 789,417 |
public void testFullTest() {
resetCounter();
XMPPTCPConnection x0 = getConnection(0);
XMPPTCPConnection x1 = getConnection(1);
XMPPSmackConfiguration.DEBUG = true;
FixedResolver tr0 = new FixedResolver("127.0.0.1", 20080);
FixedTransportManager ftm0 = new FixedTransportManager(tr0);
JmfMediaManager jmf0 = new JmfMediaManager(ftm0);
List<JingleMediaManager> trl0 = new ArrayList<JingleMediaManager>();
trl0.add(jmf0);
FixedResolver tr1 = new FixedResolver("127.0.0.1", 20040);
FixedTransportManager ftm1 = new FixedTransportManager(tr1);
JmfMediaManager jmf1 = new JmfMediaManager(ftm1);
List<JingleMediaManager> trl1 = new ArrayList<JingleMediaManager>();
trl1.add(jmf1);
JingleManager man0 = new JingleManager(x0, trl0);
JingleManager man1 = new JingleManager(x1, trl1); | void function() { resetCounter(); XMPPTCPConnection x0 = getConnection(0); XMPPTCPConnection x1 = getConnection(1); XMPPSmackConfiguration.DEBUG = true; FixedResolver tr0 = new FixedResolver(STR, 20080); FixedTransportManager ftm0 = new FixedTransportManager(tr0); JmfMediaManager jmf0 = new JmfMediaManager(ftm0); List<JingleMediaManager> trl0 = new ArrayList<JingleMediaManager>(); trl0.add(jmf0); FixedResolver tr1 = new FixedResolver(STR, 20040); FixedTransportManager ftm1 = new FixedTransportManager(tr1); JmfMediaManager jmf1 = new JmfMediaManager(ftm1); List<JingleMediaManager> trl1 = new ArrayList<JingleMediaManager>(); trl1.add(jmf1); JingleManager man0 = new JingleManager(x0, trl0); JingleManager man1 = new JingleManager(x1, trl1); | /**
* This is a full test in the Jingle API.
*/ | This is a full test in the Jingle API | testFullTest | {
"repo_name": "igniterealtime/Smack",
"path": "smack-jingle-old/src/integration-test/java/org/jivesoftware/smackx/jingle/JingleManagerTest.java",
"license": "apache-2.0",
"size": 38730
} | [
"java.util.ArrayList",
"java.util.List",
"org.jivesoftware.smackx.jingle.media.JingleMediaManager",
"org.jivesoftware.smackx.jingle.mediaimpl.jmf.JmfMediaManager",
"org.jivesoftware.smackx.jingle.nat.FixedResolver",
"org.jivesoftware.smackx.jingle.nat.FixedTransportManager"
] | import java.util.ArrayList; import java.util.List; import org.jivesoftware.smackx.jingle.media.JingleMediaManager; import org.jivesoftware.smackx.jingle.mediaimpl.jmf.JmfMediaManager; import org.jivesoftware.smackx.jingle.nat.FixedResolver; import org.jivesoftware.smackx.jingle.nat.FixedTransportManager; | import java.util.*; import org.jivesoftware.smackx.jingle.media.*; import org.jivesoftware.smackx.jingle.mediaimpl.jmf.*; import org.jivesoftware.smackx.jingle.nat.*; | [
"java.util",
"org.jivesoftware.smackx"
] | java.util; org.jivesoftware.smackx; | 1,326,955 |
public ShaderNodeDefinition findDefinition(Statement statement) throws IOException {
String defLine[] = statement.getLine().split(":");
String defName = defLine[1].trim();
ShaderNodeDefinition def = getNodeDefinitions().get(defName);
if (def == null) {
if (defLine.length == 3) {
List<ShaderNodeDefinition> defs = null;
try {
defs = assetManager.loadAsset(new ShaderNodeDefinitionKey(defLine[2].trim()));
} catch (AssetNotFoundException e) {
throw new MatParseException("Couldn't find " + defLine[2].trim(), statement, e);
}
for (ShaderNodeDefinition definition : defs) {
definition.setPath(defLine[2].trim());
if (defName.equals(definition.getName())) {
def = definition;
}
if (!(getNodeDefinitions().containsKey(definition.getName()))) {
getNodeDefinitions().put(definition.getName(), definition);
}
}
}
if (def == null) {
throw new MatParseException(defName + " is not a declared as Shader Node Definition", statement);
}
}
return def;
}
// public void updateCondition(ShaderNodeVariable var, VariableMapping mapping) {
//
// String condition = mergeConditions(shaderNode.getCondition(), mapping.getCondition(), "&&");
//
// if (var.getCondition() == null) {
// if (!nulledConditions.contains(var.getNameSpace() + "." + var.getName())) {
// var.setCondition(condition);
// }
// } else {
// var.setCondition(mergeConditions(var.getCondition(), condition, "||"));
// if (var.getCondition() == null) {
// nulledConditions.add(var.getNameSpace() + "." + var.getName());
// }
// }
// } | ShaderNodeDefinition function(Statement statement) throws IOException { String defLine[] = statement.getLine().split(":"); String defName = defLine[1].trim(); ShaderNodeDefinition def = getNodeDefinitions().get(defName); if (def == null) { if (defLine.length == 3) { List<ShaderNodeDefinition> defs = null; try { defs = assetManager.loadAsset(new ShaderNodeDefinitionKey(defLine[2].trim())); } catch (AssetNotFoundException e) { throw new MatParseException(STR + defLine[2].trim(), statement, e); } for (ShaderNodeDefinition definition : defs) { definition.setPath(defLine[2].trim()); if (defName.equals(definition.getName())) { def = definition; } if (!(getNodeDefinitions().containsKey(definition.getName()))) { getNodeDefinitions().put(definition.getName(), definition); } } } if (def == null) { throw new MatParseException(defName + STR, statement); } } return def; } | /**
* find the definition from this statement (loads it if necessary)
*
* @param statement the statement being read
* @return the definition
* @throws IOException
*/ | find the definition from this statement (loads it if necessary) | findDefinition | {
"repo_name": "PlanetWaves/clockworkengine",
"path": "trunk/jme3-core/src/plugins/java/com/jme3/material/plugins/ShaderNodeLoaderDelegate.java",
"license": "apache-2.0",
"size": 44651
} | [
"com.jme3.asset.AssetNotFoundException",
"com.jme3.asset.ShaderNodeDefinitionKey",
"com.jme3.shader.ShaderNodeDefinition",
"com.jme3.util.blockparser.Statement",
"java.io.IOException",
"java.util.List"
] | import com.jme3.asset.AssetNotFoundException; import com.jme3.asset.ShaderNodeDefinitionKey; import com.jme3.shader.ShaderNodeDefinition; import com.jme3.util.blockparser.Statement; import java.io.IOException; import java.util.List; | import com.jme3.asset.*; import com.jme3.shader.*; import com.jme3.util.blockparser.*; import java.io.*; import java.util.*; | [
"com.jme3.asset",
"com.jme3.shader",
"com.jme3.util",
"java.io",
"java.util"
] | com.jme3.asset; com.jme3.shader; com.jme3.util; java.io; java.util; | 2,534,873 |
// request extensions; single extensions not supported
public void setOcspExtensions(List<Extension> extensions)
{
this.ocspExtensions = (extensions == null)
? Collections.<Extension>emptyList()
: new ArrayList<Extension>(extensions);
} | void function(List<Extension> extensions) { this.ocspExtensions = (extensions == null) ? Collections.<Extension>emptyList() : new ArrayList<Extension>(extensions); } | /**
* Sets the optional OCSP request extensions.
*
* @param extensions a list of extensions. The list is copied to protect
* against subsequent modification.
*/ | Sets the optional OCSP request extensions | setOcspExtensions | {
"repo_name": "wangsongpeng/jdk-src",
"path": "src/main/java/java/security/cert/PKIXRevocationChecker.java",
"license": "apache-2.0",
"size": 12302
} | [
"java.util.ArrayList",
"java.util.Collections",
"java.util.List"
] | import java.util.ArrayList; import java.util.Collections; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,893,188 |
@Test
public void testInitialRefresh4Consumers() throws Exception
{
//System.out.println( "\n--->Running testInitialRefresh4Consumers" );
ReplicationConsumer consumer1 = createConsumer();
ReplicationConsumer consumer2 = createConsumer();
ReplicationConsumer consumer3 = createConsumer();
ReplicationConsumer consumer4 = createConsumer();
assertTrue( waitUntilLimitSyncReplClient( TOTAL_COUNT, consumer1, consumer2, consumer3, consumer4 ) );
consumer1.stop();
consumer2.stop();
consumer3.stop();
consumer4.stop();
//System.out.println( "\n<-- Done" );
} | void function() throws Exception { ReplicationConsumer consumer1 = createConsumer(); ReplicationConsumer consumer2 = createConsumer(); ReplicationConsumer consumer3 = createConsumer(); ReplicationConsumer consumer4 = createConsumer(); assertTrue( waitUntilLimitSyncReplClient( TOTAL_COUNT, consumer1, consumer2, consumer3, consumer4 ) ); consumer1.stop(); consumer2.stop(); consumer3.stop(); consumer4.stop(); } | /**
* Test with 2 consumers
*/ | Test with 2 consumers | testInitialRefresh4Consumers | {
"repo_name": "lucastheisen/apache-directory-server",
"path": "server-integ/src/test/java/org/apache/directory/server/replication/ClientInitialRefreshIT.java",
"license": "apache-2.0",
"size": 14697
} | [
"org.apache.directory.server.ldap.replication.consumer.ReplicationConsumer",
"org.junit.Assert"
] | import org.apache.directory.server.ldap.replication.consumer.ReplicationConsumer; import org.junit.Assert; | import org.apache.directory.server.ldap.replication.consumer.*; import org.junit.*; | [
"org.apache.directory",
"org.junit"
] | org.apache.directory; org.junit; | 755,663 |
protected boolean setLastWriteTime(String fileName, long time)
{
try
{
DirectoryEntryInformation dirEntInf = findDirectoryEntry(fileName);
if (dirEntInf == null || dirEntInf.directoryEntry == null)
return false;
setWriteTime(dirEntInf.directoryEntry, time);
writeDirectoryEntry(dirEntInf);
return true;
}
catch(DirectoryException e)
{
return false;
}
} //end setLastWriteTime(String fileName, long time)
| boolean function(String fileName, long time) { try { DirectoryEntryInformation dirEntInf = findDirectoryEntry(fileName); if (dirEntInf == null dirEntInf.directoryEntry == null) return false; setWriteTime(dirEntInf.directoryEntry, time); writeDirectoryEntry(dirEntInf); return true; } catch(DirectoryException e) { return false; } } | /**
* Set the last write time of the directory entry given by
* fileName.
* @param fileName the name of the file.
* @param time is the last write time in milliseconds since
* January 1, 1970, 00:00:00 GMT.
* @return true if the last write time could be set otherwise false.
*/ | Set the last write time of the directory entry given by fileName | setLastWriteTime | {
"repo_name": "hannoman/xxl",
"path": "src/xxl/core/io/fat/DIR.java",
"license": "lgpl-3.0",
"size": 132958
} | [
"xxl.core.io.fat.errors.DirectoryException"
] | import xxl.core.io.fat.errors.DirectoryException; | import xxl.core.io.fat.errors.*; | [
"xxl.core.io"
] | xxl.core.io; | 2,545,905 |
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<ScriptInner> updateAsync(
String resourceGroupName,
String clusterName,
String databaseName,
String scriptName,
ScriptInner parameters,
Context context) {
return beginUpdateAsync(resourceGroupName, clusterName, databaseName, scriptName, parameters, context)
.last()
.flatMap(this.client::getLroFinalResultOrError);
} | @ServiceMethod(returns = ReturnType.SINGLE) Mono<ScriptInner> function( String resourceGroupName, String clusterName, String databaseName, String scriptName, ScriptInner parameters, Context context) { return beginUpdateAsync(resourceGroupName, clusterName, databaseName, scriptName, parameters, context) .last() .flatMap(this.client::getLroFinalResultOrError); } | /**
* Updates a database script.
*
* @param resourceGroupName The name of the resource group containing the Kusto cluster.
* @param clusterName The name of the Kusto cluster.
* @param databaseName The name of the database in the Kusto cluster.
* @param scriptName The name of the Kusto database script.
* @param parameters The Kusto Script parameters contains to the KQL to run.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return class representing a database script on successful completion of {@link Mono}.
*/ | Updates a database script | updateAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/kusto/azure-resourcemanager-kusto/src/main/java/com/azure/resourcemanager/kusto/implementation/ScriptsClientImpl.java",
"license": "mit",
"size": 84671
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.util.Context",
"com.azure.resourcemanager.kusto.fluent.models.ScriptInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.util.Context; import com.azure.resourcemanager.kusto.fluent.models.ScriptInner; | import com.azure.core.annotation.*; import com.azure.core.util.*; import com.azure.resourcemanager.kusto.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 887,597 |
public ManagedClusterWindowsProfile windowsProfile() {
return this.windowsProfile;
} | ManagedClusterWindowsProfile function() { return this.windowsProfile; } | /**
* Get profile for Windows VMs in the container service cluster.
*
* @return the windowsProfile value
*/ | Get profile for Windows VMs in the container service cluster | windowsProfile | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/containerservice/mgmt-v2020_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2020_02_01/implementation/ManagedClusterInner.java",
"license": "mit",
"size": 16893
} | [
"com.microsoft.azure.management.containerservice.v2020_02_01.ManagedClusterWindowsProfile"
] | import com.microsoft.azure.management.containerservice.v2020_02_01.ManagedClusterWindowsProfile; | import com.microsoft.azure.management.containerservice.v2020_02_01.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 2,501,319 |
public URL[] getURLs() {
if (repositoryURLs != null) {
return repositoryURLs.clone();
}
URL[] external = super.getURLs();
int filesLength = files.length;
int jarFilesLength = jarRealFiles.length;
int externalsLength = external.length;
int off = 0;
int i;
try {
URL[] urls = new URL[filesLength + jarFilesLength + externalsLength];
if (searchExternalFirst) {
for (i = 0; i < externalsLength; i++) {
urls[i] = external[i];
}
off = externalsLength;
}
for (i = 0; i < filesLength; i++) {
urls[off + i] = getURL(files[i], true);
}
off += filesLength;
for (i = 0; i < jarFilesLength; i++) {
urls[off + i] = getURL(jarRealFiles[i], true);
}
off += jarFilesLength;
if (!searchExternalFirst) {
for (i = 0; i < externalsLength; i++) {
urls[off + i] = external[i];
}
}
repositoryURLs = urls;
} catch (MalformedURLException e) {
repositoryURLs = new URL[0];
}
return repositoryURLs.clone();
}
// ------------------------------------------------------ Lifecycle Methods
| URL[] function() { if (repositoryURLs != null) { return repositoryURLs.clone(); } URL[] external = super.getURLs(); int filesLength = files.length; int jarFilesLength = jarRealFiles.length; int externalsLength = external.length; int off = 0; int i; try { URL[] urls = new URL[filesLength + jarFilesLength + externalsLength]; if (searchExternalFirst) { for (i = 0; i < externalsLength; i++) { urls[i] = external[i]; } off = externalsLength; } for (i = 0; i < filesLength; i++) { urls[off + i] = getURL(files[i], true); } off += filesLength; for (i = 0; i < jarFilesLength; i++) { urls[off + i] = getURL(jarRealFiles[i], true); } off += jarFilesLength; if (!searchExternalFirst) { for (i = 0; i < externalsLength; i++) { urls[off + i] = external[i]; } } repositoryURLs = urls; } catch (MalformedURLException e) { repositoryURLs = new URL[0]; } return repositoryURLs.clone(); } | /**
* Returns the search path of URLs for loading classes and resources.
* This includes the original list of URLs specified to the constructor,
* along with any URLs subsequently appended by the addURL() method.
* @return the search path of URLs for loading classes and resources.
*/ | Returns the search path of URLs for loading classes and resources. This includes the original list of URLs specified to the constructor, along with any URLs subsequently appended by the addURL() method | getURLs | {
"repo_name": "yuyupapa/OpenSource",
"path": "apache-tomcat-6.0.48/java/org/apache/catalina/loader/WebappClassLoader.java",
"license": "apache-2.0",
"size": 126194
} | [
"java.net.MalformedURLException"
] | import java.net.MalformedURLException; | import java.net.*; | [
"java.net"
] | java.net; | 2,523,724 |
public static void setParameters(File file) throws FileNotFoundException, IOException {
setParameters(new FileInputStream(file));
} | static void function(File file) throws FileNotFoundException, IOException { setParameters(new FileInputStream(file)); } | /**
* This sets the parameters to the values given by a properties file denoted by the given file
* object.
*
* @throws IOException
* @throws FileNotFoundException
*/ | This sets the parameters to the values given by a properties file denoted by the given file object | setParameters | {
"repo_name": "boob-sbcm/3838438",
"path": "src/main/java/com/rapidminer/tools/ParameterService.java",
"license": "agpl-3.0",
"size": 22466
} | [
"java.io.File",
"java.io.FileInputStream",
"java.io.FileNotFoundException",
"java.io.IOException"
] | import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,225,929 |
@Action
public void showHelp() {
if (helpBox == null) {
JFrame mainFrame = SwordfishApp.getApplication().getMainFrame();
helpBox = new SwordfishHelpDialog(mainFrame);
helpBox.setLocationRelativeTo(mainFrame);
}
SwordfishApp.getApplication().show(helpBox);
} | void function() { if (helpBox == null) { JFrame mainFrame = SwordfishApp.getApplication().getMainFrame(); helpBox = new SwordfishHelpDialog(mainFrame); helpBox.setLocationRelativeTo(mainFrame); } SwordfishApp.getApplication().show(helpBox); } | /**
* Show the help box, formatted for the help.html
*/ | Show the help box, formatted for the help.html | showHelp | {
"repo_name": "secondfoundation/Second-Foundation-Src",
"path": "src/turk/src/interface/acpc_2010_server/Swordfish/src/swordfish/view/SwordfishView.java",
"license": "lgpl-2.1",
"size": 52335
} | [
"javax.swing.JFrame"
] | import javax.swing.JFrame; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 1,151,592 |
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux<OperationValueInner> listAsync() {
return new PagedFlux<>(() -> listSinglePageAsync());
} | @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux<OperationValueInner> function() { return new PagedFlux<>(() -> listSinglePageAsync()); } | /**
* Gets a list of hybrid compute operations.
*
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a list of hybrid compute operations.
*/ | Gets a list of hybrid compute operations | listAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/hybridcompute/azure-resourcemanager-hybridcompute/src/main/java/com/azure/resourcemanager/hybridcompute/implementation/OperationsClientImpl.java",
"license": "mit",
"size": 7894
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.PagedFlux",
"com.azure.resourcemanager.hybridcompute.fluent.models.OperationValueInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedFlux; import com.azure.resourcemanager.hybridcompute.fluent.models.OperationValueInner; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.resourcemanager.hybridcompute.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 1,178,452 |
public final Index getIndex(int i) {
return indexList[i];
} | final Index function(int i) { return indexList[i]; } | /**
* Returns the Index object at the given index
*/ | Returns the Index object at the given index | getIndex | {
"repo_name": "Julien35/dev-courses",
"path": "tutoriel-spring-mvc/lib/hsqldb/src/org/hsqldb/TableBase.java",
"license": "mit",
"size": 18351
} | [
"org.hsqldb.index.Index"
] | import org.hsqldb.index.Index; | import org.hsqldb.index.*; | [
"org.hsqldb.index"
] | org.hsqldb.index; | 1,152,394 |
boolean precedes(final String s1, final String s2) {
String symbol1 = s1.toLowerCase(Locale.ENGLISH);
String symbol2 = s2.toLowerCase(Locale.ENGLISH);
if (!precedenceMap.keySet().contains(symbol1)) {
return false;
}
if (!precedenceMap.keySet().contains(symbol2)) {
return false;
}
int index1 = ((Integer) precedenceMap.get(symbol1)).intValue();
int index2 = ((Integer) precedenceMap.get(symbol2)).intValue();
boolean precedesResult = (index1 < index2);
return precedesResult;
} | boolean precedes(final String s1, final String s2) { String symbol1 = s1.toLowerCase(Locale.ENGLISH); String symbol2 = s2.toLowerCase(Locale.ENGLISH); if (!precedenceMap.keySet().contains(symbol1)) { return false; } if (!precedenceMap.keySet().contains(symbol2)) { return false; } int index1 = ((Integer) precedenceMap.get(symbol1)).intValue(); int index2 = ((Integer) precedenceMap.get(symbol2)).intValue(); boolean precedesResult = (index1 < index2); return precedesResult; } | /**
* Determines whether one symbol precedes another.
* @param s1 symbol 1
* @param s2 symbol 2
* @return true if symbol 1 precedes symbol 2
*/ | Determines whether one symbol precedes another | precedes | {
"repo_name": "karolaug/log4j-extras",
"path": "src/main/java/org/apache/log4j/rule/InFixToPostFix.java",
"license": "apache-2.0",
"size": 11808
} | [
"java.util.Locale"
] | import java.util.Locale; | import java.util.*; | [
"java.util"
] | java.util; | 894,584 |
@Override
public int compare(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) {
return compareBytes(b1, s1 + 4, l1 - 4, b2, s2 + 4, l2 - 4);
}
}
static { // register this comparator
WritableComparator.define(HiveBytesArrayWritable.class, new Comparator());
} | int function(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) { return compareBytes(b1, s1 + 4, l1 - 4, b2, s2 + 4, l2 - 4); } } static { WritableComparator.define(HiveBytesArrayWritable.class, new Comparator()); } | /**
* Compare the buffers in serialized form.
*/ | Compare the buffers in serialized form | compare | {
"repo_name": "jasontedor/elasticsearch-hadoop",
"path": "hive/src/main/java/org/elasticsearch/hadoop/hive/HiveBytesArrayWritable.java",
"license": "apache-2.0",
"size": 3632
} | [
"org.apache.hadoop.io.WritableComparator"
] | import org.apache.hadoop.io.WritableComparator; | import org.apache.hadoop.io.*; | [
"org.apache.hadoop"
] | org.apache.hadoop; | 1,020,202 |
public final Property<Expiry> expiry() {
return metaBean().expiry().createProperty(this);
} | final Property<Expiry> function() { return metaBean().expiry().createProperty(this); } | /**
* Gets the the {@code expiry} property.
* @return the property, not null
*/ | Gets the the expiry property | expiry | {
"repo_name": "jeorme/OG-Platform",
"path": "projects/OG-FinancialTypes/src/main/java/com/opengamma/financial/security/option/EquityWarrantSecurity.java",
"license": "apache-2.0",
"size": 20805
} | [
"com.opengamma.util.time.Expiry",
"org.joda.beans.Property"
] | import com.opengamma.util.time.Expiry; import org.joda.beans.Property; | import com.opengamma.util.time.*; import org.joda.beans.*; | [
"com.opengamma.util",
"org.joda.beans"
] | com.opengamma.util; org.joda.beans; | 966,231 |
public int getDropDownVerticalOffset() {
if(mAutoCompleteMode == AUTOCOMPLETE_MODE_NONE)
return 0;
return ((AutoCompleteTextView)mInputView).getDropDownVerticalOffset();
} | int function() { if(mAutoCompleteMode == AUTOCOMPLETE_MODE_NONE) return 0; return ((AutoCompleteTextView)mInputView).getDropDownVerticalOffset(); } | /**
* <p>Gets the vertical offset used for the auto-complete drop-down list.</p>
* <p>Only work when autoComplete mode is {@link #AUTOCOMPLETE_MODE_SINGLE} or {@link #AUTOCOMPLETE_MODE_MULTI}</p>
*
* @return the vertical offset
*
* @attr ref android.R.styleable#ListPopupWindow_dropDownVerticalOffset
*/ | Gets the vertical offset used for the auto-complete drop-down list. Only work when autoComplete mode is <code>#AUTOCOMPLETE_MODE_SINGLE</code> or <code>#AUTOCOMPLETE_MODE_MULTI</code> | getDropDownVerticalOffset | {
"repo_name": "android9527/AndroidDemo",
"path": "material/src/main/java/com/rey/material/widget/EditText.java",
"license": "apache-2.0",
"size": 149798
} | [
"android.widget.AutoCompleteTextView"
] | import android.widget.AutoCompleteTextView; | import android.widget.*; | [
"android.widget"
] | android.widget; | 2,832,249 |
public void allowTypeHierarchy(Class type) {
addPermission(new TypeHierarchyPermission(type));
} | void function(Class type) { addPermission(new TypeHierarchyPermission(type)); } | /**
* Add security permission for a type hierarchy.
*
* @param type the base type to allow
* @since 1.4.7
*/ | Add security permission for a type hierarchy | allowTypeHierarchy | {
"repo_name": "Groostav/XStream-GG",
"path": "xstream/src/java/com/thoughtworks/xstream/XStream.java",
"license": "bsd-3-clause",
"size": 90964
} | [
"com.thoughtworks.xstream.security.TypeHierarchyPermission"
] | import com.thoughtworks.xstream.security.TypeHierarchyPermission; | import com.thoughtworks.xstream.security.*; | [
"com.thoughtworks.xstream"
] | com.thoughtworks.xstream; | 1,265,235 |
public static boolean hideKeyboard(View view) {
InputMethodManager imm =
(InputMethodManager) view.getContext().getSystemService(
Context.INPUT_METHOD_SERVICE);
return imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
} | static boolean function(View view) { InputMethodManager imm = (InputMethodManager) view.getContext().getSystemService( Context.INPUT_METHOD_SERVICE); return imm.hideSoftInputFromWindow(view.getWindowToken(), 0); } | /**
* Hides the keyboard.
* @param view The {@link View} that is currently accepting input.
* @return Whether the keyboard was visible before.
*/ | Hides the keyboard | hideKeyboard | {
"repo_name": "guorendong/iridium-browser-ubuntu",
"path": "ui/android/java/src/org/chromium/ui/UiUtils.java",
"license": "bsd-3-clause",
"size": 12780
} | [
"android.content.Context",
"android.view.View",
"android.view.inputmethod.InputMethodManager"
] | import android.content.Context; import android.view.View; import android.view.inputmethod.InputMethodManager; | import android.content.*; import android.view.*; import android.view.inputmethod.*; | [
"android.content",
"android.view"
] | android.content; android.view; | 1,038,981 |
public void stop(LensEventService service) {
if (service == null) {
LOG.warn("Unable to stop store as Event service is null");
}
} | void function(LensEventService service) { if (service == null) { LOG.warn(STR); } } | /**
* Stop the store.
*
* @param service
* the service
*/ | Stop the store | stop | {
"repo_name": "rajubairishetti/lens",
"path": "lens-server/src/main/java/org/apache/lens/server/stats/store/StatisticsStore.java",
"license": "apache-2.0",
"size": 2086
} | [
"org.apache.lens.server.api.events.LensEventService"
] | import org.apache.lens.server.api.events.LensEventService; | import org.apache.lens.server.api.events.*; | [
"org.apache.lens"
] | org.apache.lens; | 963,823 |
public void setMzTolerance(MZTolerance mzTolerance) {
this.mzTolerance = mzTolerance;
}
| void function(MZTolerance mzTolerance) { this.mzTolerance = mzTolerance; } | /**
* the mz tolerance that was used to find identity
*
* @param mzTolerance
*/ | the mz tolerance that was used to find identity | setMzTolerance | {
"repo_name": "du-lab/mzmine2",
"path": "src/main/java/net/sf/mzmine/datamodel/identities/ms2/interf/AbstractMSMSIdentity.java",
"license": "gpl-2.0",
"size": 1593
} | [
"net.sf.mzmine.parameters.parametertypes.tolerances.MZTolerance"
] | import net.sf.mzmine.parameters.parametertypes.tolerances.MZTolerance; | import net.sf.mzmine.parameters.parametertypes.tolerances.*; | [
"net.sf.mzmine"
] | net.sf.mzmine; | 1,678,431 |
Subsets and Splits