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 list | imports_info stringlengths 19 34.8k | cluster_imports_info stringlengths 15 3.66k | libraries list | libraries_info stringlengths 6 661 | id int64 0 2.92M |
|---|---|---|---|---|---|---|---|---|---|---|---|
private OutlinedCall caseBlock(SwitchStatementGenerator.CaseBlock caseBlock, CodeVisitor mv) {
SwitchClause firstClause = caseBlock.clauses.get(0);
MethodTypeDescriptor methodDescriptor = SwitchBlockCodeVisitor.methodDescriptor(mv);
MethodCode method = codegen.method(mv, "case", methodDescriptor);
return outlined(new SwitchBlockCodeVisitor(firstClause, method, mv), body -> {
Variable<Integer> switchTarget = body.getSwitchTargetParameter();
List<SwitchClause> clauses = caseBlock.clauses;
int[] switchTargets = caseBlock.switchTargets;
int numTargets = caseBlock.numTargets();
Completion lastResult = Completion.Normal;
if (numTargets > 1) {
Jump[] labels = new Jump[numTargets];
for (int i = 0; i < labels.length; ++i) {
labels[i] = new Jump();
}
Jump defaultInstr = new Jump();
body.load(switchTarget);
body.tableswitch(1, numTargets, defaultInstr, labels);
body.mark(defaultInstr);
for (int i = 0, lastTarget = 0; i < clauses.size(); ++i) {
if (lastTarget != switchTargets[i]) {
lastTarget = switchTargets[i];
body.mark(labels[lastTarget - 1]);
}
lastResult = clauses.get(i).accept(this, body);
}
} else {
for (SwitchClause clause : clauses) {
lastResult = clause.accept(this, body);
}
}
return lastResult;
});
} | OutlinedCall function(SwitchStatementGenerator.CaseBlock caseBlock, CodeVisitor mv) { SwitchClause firstClause = caseBlock.clauses.get(0); MethodTypeDescriptor methodDescriptor = SwitchBlockCodeVisitor.methodDescriptor(mv); MethodCode method = codegen.method(mv, "case", methodDescriptor); return outlined(new SwitchBlockCodeVisitor(firstClause, method, mv), body -> { Variable<Integer> switchTarget = body.getSwitchTargetParameter(); List<SwitchClause> clauses = caseBlock.clauses; int[] switchTargets = caseBlock.switchTargets; int numTargets = caseBlock.numTargets(); Completion lastResult = Completion.Normal; if (numTargets > 1) { Jump[] labels = new Jump[numTargets]; for (int i = 0; i < labels.length; ++i) { labels[i] = new Jump(); } Jump defaultInstr = new Jump(); body.load(switchTarget); body.tableswitch(1, numTargets, defaultInstr, labels); body.mark(defaultInstr); for (int i = 0, lastTarget = 0; i < clauses.size(); ++i) { if (lastTarget != switchTargets[i]) { lastTarget = switchTargets[i]; body.mark(labels[lastTarget - 1]); } lastResult = clauses.get(i).accept(this, body); } } else { for (SwitchClause clause : clauses) { lastResult = clause.accept(this, body); } } return lastResult; }); } | /**
* Generates a case-block method.
*
* @param caseBlock
* the case-block
* @param mv
* the code visitor
* @return the outlined-call object
*/ | Generates a case-block method | caseBlock | {
"repo_name": "anba/es6draft",
"path": "src/main/java/com/github/anba/es6draft/compiler/SwitchStatementGenerator.java",
"license": "mit",
"size": 38934
} | [
"com.github.anba.es6draft.ast.SwitchClause",
"com.github.anba.es6draft.compiler.CodeVisitor",
"com.github.anba.es6draft.compiler.StatementGenerator",
"com.github.anba.es6draft.compiler.assembler.Code",
"com.github.anba.es6draft.compiler.assembler.Jump",
"com.github.anba.es6draft.compiler.assembler.MethodT... | import com.github.anba.es6draft.ast.SwitchClause; import com.github.anba.es6draft.compiler.CodeVisitor; import com.github.anba.es6draft.compiler.StatementGenerator; import com.github.anba.es6draft.compiler.assembler.Code; import com.github.anba.es6draft.compiler.assembler.Jump; import com.github.anba.es6draft.compiler.assembler.MethodTypeDescriptor; import com.github.anba.es6draft.compiler.assembler.Variable; import java.util.List; | import com.github.anba.es6draft.ast.*; import com.github.anba.es6draft.compiler.*; import com.github.anba.es6draft.compiler.assembler.*; import java.util.*; | [
"com.github.anba",
"java.util"
] | com.github.anba; java.util; | 577,977 |
private void getTransactionListRequest() {
BasicXmlDocument document = new BasicXmlDocument();
document.parseString("<" + TransactionType.GET_TRANSACTION_LIST.getValue()
+ " xmlns = \"" + XML_NAMESPACE + "\" />");
addAuthentication(document);
addReportingBatchId(document);
currentRequest = document;
} | void function() { BasicXmlDocument document = new BasicXmlDocument(); document.parseString("<" + TransactionType.GET_TRANSACTION_LIST.getValue() + STRSTR\STR); addAuthentication(document); addReportingBatchId(document); currentRequest = document; } | /**
* Return data for all transactions in a specified batch
*/ | Return data for all transactions in a specified batch | getTransactionListRequest | {
"repo_name": "YOTOV-LIMITED/sdk-android",
"path": "src/net/authorize/reporting/Transaction.java",
"license": "apache-2.0",
"size": 6638
} | [
"net.authorize.util.BasicXmlDocument"
] | import net.authorize.util.BasicXmlDocument; | import net.authorize.util.*; | [
"net.authorize.util"
] | net.authorize.util; | 1,066,409 |
public boolean write() {
PrintStream out = null;
try {
out = new PrintStream(new FileOutputStream(this.path));
out.print(this.content.toString());
} catch (FileNotFoundException e) {
System.out.println("File not found, can't write.");
}
finally {
if (out != null){
out.close();
return true;
}
}
return false;
}
| boolean function() { PrintStream out = null; try { out = new PrintStream(new FileOutputStream(this.path)); out.print(this.content.toString()); } catch (FileNotFoundException e) { System.out.println(STR); } finally { if (out != null){ out.close(); return true; } } return false; } | /**
* Write content to path.
* @throws FileNotFoundException
*/ | Write content to path | write | {
"repo_name": "ArjanO/AP-NLP",
"path": "src/main/java/nl/han/ica/ap/nlp/util/File.java",
"license": "mit",
"size": 4301
} | [
"java.io.FileNotFoundException",
"java.io.FileOutputStream",
"java.io.PrintStream"
] | import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.PrintStream; | import java.io.*; | [
"java.io"
] | java.io; | 600,817 |
protected void createField(Document document, String xpath, CmsLuceneField field) {
CmsSetupXmlHelper.setValue(document, xpath + "/@" + I_CmsXmlConfiguration.A_NAME, field.getName());
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(field.getDisplayNameForConfiguration())) {
CmsSetupXmlHelper.setValue(
document,
xpath + "/@" + CmsSearchConfiguration.A_DISPLAY,
field.getDisplayNameForConfiguration());
}
if (field.isCompressed()) {
CmsSetupXmlHelper.setValue(
document,
xpath + "/@" + CmsSearchConfiguration.A_STORE,
CmsLuceneField.STR_COMPRESS);
} else {
CmsSetupXmlHelper.setValue(
document,
xpath + "/@" + CmsSearchConfiguration.A_STORE,
String.valueOf(field.isStored()));
}
String index;
if (field.isIndexed()) {
if (field.isTokenizedAndIndexed()) {
// index and tokenized
index = CmsStringUtil.TRUE;
} else {
// indexed but not tokenized
index = CmsLuceneField.STR_UN_TOKENIZED;
}
} else {
// not indexed at all
index = CmsStringUtil.FALSE;
}
CmsSetupXmlHelper.setValue(document, xpath + "/@" + CmsSearchConfiguration.A_INDEX, index);
if (field.getBoost() != CmsSearchField.BOOST_DEFAULT) {
CmsSetupXmlHelper.setValue(
document,
xpath + "/@" + CmsSearchConfiguration.A_BOOST,
String.valueOf(field.getBoost()));
}
if (field.isInExcerptAndStored()) {
CmsSetupXmlHelper.setValue(document, xpath + "/@" + CmsSearchConfiguration.A_EXCERPT, String.valueOf(true));
}
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(field.getDefaultValue())) {
CmsSetupXmlHelper.setValue(
document,
xpath + "/@" + I_CmsXmlConfiguration.A_DEFAULT,
field.getDefaultValue());
}
if (field.getAnalyzer() != null) {
String className = field.getAnalyzer().getClass().getName();
if (className.startsWith(CmsSearchManager.LUCENE_ANALYZER)) {
className = className.substring(CmsSearchManager.LUCENE_ANALYZER.length());
}
CmsSetupXmlHelper.setValue(document, xpath + "/@" + CmsSearchConfiguration.A_ANALYZER, className);
}
// field mappings
Iterator<I_CmsSearchFieldMapping> mappings = field.getMappings().iterator();
while (mappings.hasNext()) {
CmsSearchFieldMapping mapping = (CmsSearchFieldMapping)mappings.next();
String mappingPath = xpath
+ "/"
+ CmsSearchConfiguration.N_MAPPING
+ "[@"
+ I_CmsXmlConfiguration.A_TYPE
+ "='"
+ mapping.getType().toString()
+ "']";
if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(mapping.getParam())) {
mappingPath += "[text()='" + mapping.getParam() + "']";
}
createFieldMapping(document, mappingPath, mapping);
}
} | void function(Document document, String xpath, CmsLuceneField field) { CmsSetupXmlHelper.setValue(document, xpath + "/@" + I_CmsXmlConfiguration.A_NAME, field.getName()); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(field.getDisplayNameForConfiguration())) { CmsSetupXmlHelper.setValue( document, xpath + "/@" + CmsSearchConfiguration.A_DISPLAY, field.getDisplayNameForConfiguration()); } if (field.isCompressed()) { CmsSetupXmlHelper.setValue( document, xpath + "/@" + CmsSearchConfiguration.A_STORE, CmsLuceneField.STR_COMPRESS); } else { CmsSetupXmlHelper.setValue( document, xpath + "/@" + CmsSearchConfiguration.A_STORE, String.valueOf(field.isStored())); } String index; if (field.isIndexed()) { if (field.isTokenizedAndIndexed()) { index = CmsStringUtil.TRUE; } else { index = CmsLuceneField.STR_UN_TOKENIZED; } } else { index = CmsStringUtil.FALSE; } CmsSetupXmlHelper.setValue(document, xpath + "/@" + CmsSearchConfiguration.A_INDEX, index); if (field.getBoost() != CmsSearchField.BOOST_DEFAULT) { CmsSetupXmlHelper.setValue( document, xpath + "/@" + CmsSearchConfiguration.A_BOOST, String.valueOf(field.getBoost())); } if (field.isInExcerptAndStored()) { CmsSetupXmlHelper.setValue(document, xpath + "/@" + CmsSearchConfiguration.A_EXCERPT, String.valueOf(true)); } if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(field.getDefaultValue())) { CmsSetupXmlHelper.setValue( document, xpath + "/@" + I_CmsXmlConfiguration.A_DEFAULT, field.getDefaultValue()); } if (field.getAnalyzer() != null) { String className = field.getAnalyzer().getClass().getName(); if (className.startsWith(CmsSearchManager.LUCENE_ANALYZER)) { className = className.substring(CmsSearchManager.LUCENE_ANALYZER.length()); } CmsSetupXmlHelper.setValue(document, xpath + "/@" + CmsSearchConfiguration.A_ANALYZER, className); } Iterator<I_CmsSearchFieldMapping> mappings = field.getMappings().iterator(); while (mappings.hasNext()) { CmsSearchFieldMapping mapping = (CmsSearchFieldMapping)mappings.next(); String mappingPath = xpath + "/" + CmsSearchConfiguration.N_MAPPING + "[@" + I_CmsXmlConfiguration.A_TYPE + "='" + mapping.getType().toString() + "']"; if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(mapping.getParam())) { mappingPath += STR + mapping.getParam() + "']"; } createFieldMapping(document, mappingPath, mapping); } } | /**
* Creates a new field node.<p>
*
* @param document the document to modify
* @param xpath the xpath to the field, ie <code>opencms/search/fieldconfigurations/fieldconfiguration[name='...']/fields/field[@name="..."]</code>
* @param field the field
*/ | Creates a new field node | createField | {
"repo_name": "ggiudetti/opencms-core",
"path": "src-setup/org/opencms/setup/xml/A_CmsXmlSearch.java",
"license": "lgpl-2.1",
"size": 13770
} | [
"java.util.Iterator",
"org.dom4j.Document",
"org.opencms.configuration.CmsSearchConfiguration",
"org.opencms.search.CmsSearchManager",
"org.opencms.search.fields.CmsLuceneField",
"org.opencms.search.fields.CmsSearchField",
"org.opencms.search.fields.CmsSearchFieldMapping",
"org.opencms.util.CmsStringU... | import java.util.Iterator; import org.dom4j.Document; import org.opencms.configuration.CmsSearchConfiguration; import org.opencms.search.CmsSearchManager; import org.opencms.search.fields.CmsLuceneField; import org.opencms.search.fields.CmsSearchField; import org.opencms.search.fields.CmsSearchFieldMapping; import org.opencms.util.CmsStringUtil; | import java.util.*; import org.dom4j.*; import org.opencms.configuration.*; import org.opencms.search.*; import org.opencms.search.fields.*; import org.opencms.util.*; | [
"java.util",
"org.dom4j",
"org.opencms.configuration",
"org.opencms.search",
"org.opencms.util"
] | java.util; org.dom4j; org.opencms.configuration; org.opencms.search; org.opencms.util; | 1,795,212 |
private VLSNBucket scanForNewBucket(EnvironmentImpl envImpl,
VLSN first,
VLSN last,
long startLsn)
throws IOException {
VLSNBucket newBucket = new VLSNBucket(fileNumber, stride,
maxMappings, maxDistance,
first);
int readBufferSize =
envImpl.getConfigManager().getInt
(EnvironmentParams.LOG_ITERATOR_MAX_SIZE);
NewBucketReader scanner =
new NewBucketReader(newBucket, envImpl, readBufferSize, first,
last, startLsn);
while (!scanner.isDone() && (scanner.readNextEntry())) {
}
assert scanner.isDone();
return newBucket;
} | VLSNBucket function(EnvironmentImpl envImpl, VLSN first, VLSN last, long startLsn) throws IOException { VLSNBucket newBucket = new VLSNBucket(fileNumber, stride, maxMappings, maxDistance, first); int readBufferSize = envImpl.getConfigManager().getInt (EnvironmentParams.LOG_ITERATOR_MAX_SIZE); NewBucketReader scanner = new NewBucketReader(newBucket, envImpl, readBufferSize, first, last, startLsn); while (!scanner.isDone() && (scanner.readNextEntry())) { } assert scanner.isDone(); return newBucket; } | /**
* Scan the log fle for VLSN->LSN mappings for creating a new bucket.
*
* @throws IOException
*/ | Scan the log fle for VLSN->LSN mappings for creating a new bucket | scanForNewBucket | {
"repo_name": "prat0318/dbms",
"path": "mini_dbms/je-5.0.103/src/com/sleepycat/je/rep/vlsn/VLSNBucket.java",
"license": "mit",
"size": 37658
} | [
"com.sleepycat.je.config.EnvironmentParams",
"com.sleepycat.je.dbi.EnvironmentImpl",
"java.io.IOException"
] | import com.sleepycat.je.config.EnvironmentParams; import com.sleepycat.je.dbi.EnvironmentImpl; import java.io.IOException; | import com.sleepycat.je.config.*; import com.sleepycat.je.dbi.*; import java.io.*; | [
"com.sleepycat.je",
"java.io"
] | com.sleepycat.je; java.io; | 1,079,317 |
@SuppressWarnings("resource")
public String getLength() {
try {
return CmsFileUtil.formatFilesize(
IOUtils.toByteArray(new FileInputStream(m_variationPath)).length,
A_CmsUI.get().getLocale());
} catch (IOException e) {
return "";
}
} | @SuppressWarnings(STR) String function() { try { return CmsFileUtil.formatFilesize( IOUtils.toByteArray(new FileInputStream(m_variationPath)).length, A_CmsUI.get().getLocale()); } catch (IOException e) { return ""; } } | /**
* Get length of variation.<p>
*
* @return string representation of length
*/ | Get length of variation | getLength | {
"repo_name": "alkacon/opencms-core",
"path": "src/org/opencms/ui/apps/cacheadmin/CmsVariationBean.java",
"license": "lgpl-2.1",
"size": 3291
} | [
"java.io.FileInputStream",
"java.io.IOException",
"org.apache.commons.io.IOUtils",
"org.opencms.util.CmsFileUtil"
] | import java.io.FileInputStream; import java.io.IOException; import org.apache.commons.io.IOUtils; import org.opencms.util.CmsFileUtil; | import java.io.*; import org.apache.commons.io.*; import org.opencms.util.*; | [
"java.io",
"org.apache.commons",
"org.opencms.util"
] | java.io; org.apache.commons; org.opencms.util; | 1,100,852 |
public void paintComponent(Graphics g)
{
mxGraph graph = graphComponent.getGraph();
Rectangle clip = g.getClipBounds();
updateIncrementAndUnits();
// Fills clipping area with background.
if (activelength > 0 && inactiveBackground != null)
{
g.setColor(inactiveBackground);
}
else
{
g.setColor(getBackground());
}
g.fillRect(clip.x, clip.y, clip.width, clip.height);
// Draws the active region.
g.setColor(getBackground());
Point2D p = new Point2D.Double(activeoffset, activelength);
if (orientation == ORIENTATION_HORIZONTAL)
{
g.fillRect((int) p.getX(), clip.y, (int) p.getY(), clip.height);
}
else
{
g.fillRect(clip.x, (int) p.getX(), clip.width, (int) p.getY());
}
double left = clip.getX();
double top = clip.getY();
double right = left + clip.getWidth();
double bottom = top + clip.getHeight();
// Fetches some global display state information
mxPoint trans = graph.getView().getTranslate();
double scale = graph.getView().getScale();
double tx = trans.getX() * scale;
double ty = trans.getY() * scale;
// Sets the distance of the grid lines in pixels
double stepping = increment;
if (stepping < tickDistance)
{
int count = (int) Math
.round(Math.ceil(tickDistance / stepping) / 2) * 2;
stepping = count * stepping;
}
// Creates a set of strokes with individual dash offsets
// for each direction
((Graphics2D) g).setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
g.setFont(labelFont);
g.setColor(Color.black);
int smallTick = rulerSize - rulerSize / 3;
int middleTick = rulerSize / 2;
// TODO: Merge into a single drawing loop for both orientations
if (orientation == ORIENTATION_HORIZONTAL)
{
double xs = Math.floor((left - tx) / stepping) * stepping + tx;
double xe = Math.ceil(right / stepping) * stepping;
xe += (int) Math.ceil(stepping);
for (double x = xs; x <= xe; x += stepping)
{
// FIXME: Workaround for rounding errors when adding stepping to
// xs or ys multiple times (leads to double grid lines when zoom
// is set to eg. 121%)
double xx = Math.round((x - tx) / stepping) * stepping + tx;
int ix = (int) Math.round(xx);
g.drawLine(ix, rulerSize, ix, 0);
String text = format((x - tx) / increment);
g.drawString(text, ix + 2, labelFont.getSize());
ix += (int) Math.round(stepping / 4);
g.drawLine(ix, rulerSize, ix, smallTick);
ix += (int) Math.round(stepping / 4);
g.drawLine(ix, rulerSize, ix, middleTick);
ix += (int) Math.round(stepping / 4);
g.drawLine(ix, rulerSize, ix, smallTick);
}
}
else
{
double ys = Math.floor((top - ty) / stepping) * stepping + ty;
double ye = Math.ceil(bottom / stepping) * stepping;
ye += (int) Math.ceil(stepping);
for (double y = ys; y <= ye; y += stepping)
{
// FIXME: Workaround for rounding errors when adding stepping to
// xs or ys multiple times (leads to double grid lines when zoom
// is set to eg. 121%)
y = Math.round((y - ty) / stepping) * stepping + ty;
int iy = (int) Math.round(y);
g.drawLine(rulerSize, iy, 0, iy);
String text = format((y - ty) / increment);
// Rotates the labels in the vertical ruler
AffineTransform at = ((Graphics2D) g).getTransform();
((Graphics2D) g).rotate(-Math.PI / 2, 0, iy);
g.drawString(text, 1, iy + labelFont.getSize());
((Graphics2D) g).setTransform(at);
iy += (int) Math.round(stepping / 4);
g.drawLine(rulerSize, iy, smallTick, iy);
iy += (int) Math.round(stepping / 4);
g.drawLine(rulerSize, iy, middleTick, iy);
iy += (int) Math.round(stepping / 4);
g.drawLine(rulerSize, iy, smallTick, iy);
}
}
// Draw Mouseposition
g.setColor(Color.green);
if (orientation == ORIENTATION_HORIZONTAL)
{
g.drawLine(mouse.x, rulerSize, mouse.x, 0);
}
else
{
g.drawLine(rulerSize, mouse.y, 0, mouse.y);
}
} | void function(Graphics g) { mxGraph graph = graphComponent.getGraph(); Rectangle clip = g.getClipBounds(); updateIncrementAndUnits(); if (activelength > 0 && inactiveBackground != null) { g.setColor(inactiveBackground); } else { g.setColor(getBackground()); } g.fillRect(clip.x, clip.y, clip.width, clip.height); g.setColor(getBackground()); Point2D p = new Point2D.Double(activeoffset, activelength); if (orientation == ORIENTATION_HORIZONTAL) { g.fillRect((int) p.getX(), clip.y, (int) p.getY(), clip.height); } else { g.fillRect(clip.x, (int) p.getX(), clip.width, (int) p.getY()); } double left = clip.getX(); double top = clip.getY(); double right = left + clip.getWidth(); double bottom = top + clip.getHeight(); mxPoint trans = graph.getView().getTranslate(); double scale = graph.getView().getScale(); double tx = trans.getX() * scale; double ty = trans.getY() * scale; double stepping = increment; if (stepping < tickDistance) { int count = (int) Math .round(Math.ceil(tickDistance / stepping) / 2) * 2; stepping = count * stepping; } ((Graphics2D) g).setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); g.setFont(labelFont); g.setColor(Color.black); int smallTick = rulerSize - rulerSize / 3; int middleTick = rulerSize / 2; if (orientation == ORIENTATION_HORIZONTAL) { double xs = Math.floor((left - tx) / stepping) * stepping + tx; double xe = Math.ceil(right / stepping) * stepping; xe += (int) Math.ceil(stepping); for (double x = xs; x <= xe; x += stepping) { double xx = Math.round((x - tx) / stepping) * stepping + tx; int ix = (int) Math.round(xx); g.drawLine(ix, rulerSize, ix, 0); String text = format((x - tx) / increment); g.drawString(text, ix + 2, labelFont.getSize()); ix += (int) Math.round(stepping / 4); g.drawLine(ix, rulerSize, ix, smallTick); ix += (int) Math.round(stepping / 4); g.drawLine(ix, rulerSize, ix, middleTick); ix += (int) Math.round(stepping / 4); g.drawLine(ix, rulerSize, ix, smallTick); } } else { double ys = Math.floor((top - ty) / stepping) * stepping + ty; double ye = Math.ceil(bottom / stepping) * stepping; ye += (int) Math.ceil(stepping); for (double y = ys; y <= ye; y += stepping) { y = Math.round((y - ty) / stepping) * stepping + ty; int iy = (int) Math.round(y); g.drawLine(rulerSize, iy, 0, iy); String text = format((y - ty) / increment); AffineTransform at = ((Graphics2D) g).getTransform(); ((Graphics2D) g).rotate(-Math.PI / 2, 0, iy); g.drawString(text, 1, iy + labelFont.getSize()); ((Graphics2D) g).setTransform(at); iy += (int) Math.round(stepping / 4); g.drawLine(rulerSize, iy, smallTick, iy); iy += (int) Math.round(stepping / 4); g.drawLine(rulerSize, iy, middleTick, iy); iy += (int) Math.round(stepping / 4); g.drawLine(rulerSize, iy, smallTick, iy); } } g.setColor(Color.green); if (orientation == ORIENTATION_HORIZONTAL) { g.drawLine(mouse.x, rulerSize, mouse.x, 0); } else { g.drawLine(rulerSize, mouse.y, 0, mouse.y); } } | /**
* Paints the ruler.
*
* @param g
* The graphics to paint the ruler to.
*/ | Paints the ruler | paintComponent | {
"repo_name": "Hyiero/THEICAT",
"path": "src/main/java/com/mxgraph/examples/swing/editor/EditorRuler.java",
"license": "mit",
"size": 13328
} | [
"java.awt.Color",
"java.awt.Graphics",
"java.awt.Graphics2D",
"java.awt.Rectangle",
"java.awt.RenderingHints",
"java.awt.geom.AffineTransform",
"java.awt.geom.Point2D"
] | import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Rectangle; import java.awt.RenderingHints; import java.awt.geom.AffineTransform; import java.awt.geom.Point2D; | import java.awt.*; import java.awt.geom.*; | [
"java.awt"
] | java.awt; | 1,975,073 |
public static boolean validateEndpointURLs(ArrayList<String> endpoints) {
long validatorOptions =
UrlValidator.ALLOW_2_SLASHES + UrlValidator.ALLOW_ALL_SCHEMES + UrlValidator.ALLOW_LOCAL_URLS;
RegexValidator authorityValidator = new RegexValidator(".*");
UrlValidator urlValidator = new UrlValidator(authorityValidator, validatorOptions);
for (String endpoint : endpoints) {
// If url is a JMS connection url, validation is skipped. If not, validity is checked.
if (!endpoint.startsWith("jms:") && !urlValidator.isValid(endpoint)) {
try {
// If the url is not identified as valid from the above check,
// next step is determine the validity of the encoded url (done through the URI constructor).
URL endpointUrl = new URL(endpoint);
URI endpointUri = new URI(endpointUrl.getProtocol(), endpointUrl.getAuthority(),
endpointUrl.getPath(), endpointUrl.getQuery(), null);
if (!urlValidator.isValid(endpointUri.toString())) {
log.error("Invalid endpoint url " + endpointUrl);
return false;
}
} catch (URISyntaxException | MalformedURLException e) {
log.error("Error while parsing the endpoint url " + endpoint);
return false;
}
}
}
return true;
} | static boolean function(ArrayList<String> endpoints) { long validatorOptions = UrlValidator.ALLOW_2_SLASHES + UrlValidator.ALLOW_ALL_SCHEMES + UrlValidator.ALLOW_LOCAL_URLS; RegexValidator authorityValidator = new RegexValidator(".*"); UrlValidator urlValidator = new UrlValidator(authorityValidator, validatorOptions); for (String endpoint : endpoints) { if (!endpoint.startsWith("jms:") && !urlValidator.isValid(endpoint)) { try { URL endpointUrl = new URL(endpoint); URI endpointUri = new URI(endpointUrl.getProtocol(), endpointUrl.getAuthority(), endpointUrl.getPath(), endpointUrl.getQuery(), null); if (!urlValidator.isValid(endpointUri.toString())) { log.error(STR + endpointUrl); return false; } } catch (URISyntaxException MalformedURLException e) { log.error(STR + endpoint); return false; } } } return true; } | /**
* Validate sandbox and production endpoint URLs.
*
* @param endpoints sandbox and production endpoint URLs inclusive list
* @return validity of given URLs
*/ | Validate sandbox and production endpoint URLs | validateEndpointURLs | {
"repo_name": "ruks/carbon-apimgt",
"path": "components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/utils/APIUtil.java",
"license": "apache-2.0",
"size": 564037
} | [
"java.net.MalformedURLException",
"java.net.URISyntaxException",
"java.util.ArrayList",
"org.apache.commons.validator.routines.RegexValidator",
"org.apache.commons.validator.routines.UrlValidator"
] | import java.net.MalformedURLException; import java.net.URISyntaxException; import java.util.ArrayList; import org.apache.commons.validator.routines.RegexValidator; import org.apache.commons.validator.routines.UrlValidator; | import java.net.*; import java.util.*; import org.apache.commons.validator.routines.*; | [
"java.net",
"java.util",
"org.apache.commons"
] | java.net; java.util; org.apache.commons; | 889,463 |
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
seven = new javax.swing.JButton();
nine = new javax.swing.JButton();
five = new javax.swing.JButton();
eight = new javax.swing.JButton();
four = new javax.swing.JButton();
six = new javax.swing.JButton();
three = new javax.swing.JButton();
one = new javax.swing.JButton();
two = new javax.swing.JButton();
zero = new javax.swing.JButton();
decimal = new javax.swing.JButton();
equals = new javax.swing.JButton();
add = new javax.swing.JButton();
subtract = new javax.swing.JButton();
mod = new javax.swing.JButton();
exponent = new javax.swing.JButton();
divide = new javax.swing.JButton();
multiply = new javax.swing.JButton();
leftP = new javax.swing.JButton();
rightP = new javax.swing.JButton();
delete = new javax.swing.JButton();
answer = new javax.swing.JButton();
clear = new javax.swing.JButton();
pane = new javax.swing.JScrollPane();
expressions = new javax.swing.JTextArea();
result = new javax.swing.JTextField();
conversions = new javax.swing.JList(); | @SuppressWarnings(STR) void function() { seven = new javax.swing.JButton(); nine = new javax.swing.JButton(); five = new javax.swing.JButton(); eight = new javax.swing.JButton(); four = new javax.swing.JButton(); six = new javax.swing.JButton(); three = new javax.swing.JButton(); one = new javax.swing.JButton(); two = new javax.swing.JButton(); zero = new javax.swing.JButton(); decimal = new javax.swing.JButton(); equals = new javax.swing.JButton(); add = new javax.swing.JButton(); subtract = new javax.swing.JButton(); mod = new javax.swing.JButton(); exponent = new javax.swing.JButton(); divide = new javax.swing.JButton(); multiply = new javax.swing.JButton(); leftP = new javax.swing.JButton(); rightP = new javax.swing.JButton(); delete = new javax.swing.JButton(); answer = new javax.swing.JButton(); clear = new javax.swing.JButton(); pane = new javax.swing.JScrollPane(); expressions = new javax.swing.JTextArea(); result = new javax.swing.JTextField(); conversions = new javax.swing.JList(); | /**
* This method is called from within the constructor to initialize the form.
*/ | This method is called from within the constructor to initialize the form | initComponents | {
"repo_name": "PrestonMonteWest/Calculator",
"path": "sources/calculator/Window.java",
"license": "mit",
"size": 48471
} | [
"javax.swing.JButton"
] | import javax.swing.JButton; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 813,878 |
UserAssociation installUser(UserGroup parent, Identity identity, boolean accountNonExpired); | UserAssociation installUser(UserGroup parent, Identity identity, boolean accountNonExpired); | /**
* Install user.
*
* @param parent
* @param identity
* @param accountNonExpired
*/ | Install user | installUser | {
"repo_name": "eldevanjr/helianto",
"path": "helianto-core/src/main/java/org/helianto/user/UserMgr.java",
"license": "apache-2.0",
"size": 4500
} | [
"org.helianto.core.domain.Identity",
"org.helianto.user.domain.UserAssociation",
"org.helianto.user.domain.UserGroup"
] | import org.helianto.core.domain.Identity; import org.helianto.user.domain.UserAssociation; import org.helianto.user.domain.UserGroup; | import org.helianto.core.domain.*; import org.helianto.user.domain.*; | [
"org.helianto.core",
"org.helianto.user"
] | org.helianto.core; org.helianto.user; | 1,966,261 |
void onDirectoryChange(final File directory); | void onDirectoryChange(final File directory); | /**
* Directory changed Event.
*
* @param directory The directory changed
*/ | Directory changed Event | onDirectoryChange | {
"repo_name": "trivium-io/trivium-core",
"path": "src/io/trivium/dep/org/apache/commons/io/monitor/FileAlterationListener.java",
"license": "apache-2.0",
"size": 2425
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 723,529 |
@Test
public void testSerialize() {
RouterSolicitation rs = new RouterSolicitation();
rs.addOption(NeighborDiscoveryOptions.TYPE_TARGET_LL_ADDRESS,
MAC_ADDRESS1.toBytes());
assertArrayEquals(rs.serialize(), bytePacket);
} | void function() { RouterSolicitation rs = new RouterSolicitation(); rs.addOption(NeighborDiscoveryOptions.TYPE_TARGET_LL_ADDRESS, MAC_ADDRESS1.toBytes()); assertArrayEquals(rs.serialize(), bytePacket); } | /**
* Tests serialize and setters.
*/ | Tests serialize and setters | testSerialize | {
"repo_name": "rvhub/onos",
"path": "utils/misc/src/test/java/org/onlab/packet/ndp/RouterSolicitationTest.java",
"license": "apache-2.0",
"size": 3655
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 2,065,555 |
Collection<? extends F> getDeclaredFields(C clazz); | Collection<? extends F> getDeclaredFields(C clazz); | /**
* Gets all the declared fields of the given class.
*/ | Gets all the declared fields of the given class | getDeclaredFields | {
"repo_name": "GeeQuery/cxf-plus",
"path": "src/main/java/com/github/cxfplus/com/sun/xml/bind/v2/model/nav/Navigator.java",
"license": "apache-2.0",
"size": 11454
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 803,621 |
private void getCounts(String path, Counts counts) {
DataNode node = getNode(path);
if (node == null) {
return;
}
String[] children = null;
int len = 0;
synchronized (node) {
Set<String> childs = node.getChildren();
if (childs != null) {
children = childs.toArray(new String[childs.size()]);
}
len = (node.data == null ? 0 : node.data.length);
}
// add itself
counts.count += 1;
counts.bytes += len;
if (children == null || children.length == 0) {
return;
}
for (String child : children) {
getCounts(path + "/" + child, counts);
}
} | void function(String path, Counts counts) { DataNode node = getNode(path); if (node == null) { return; } String[] children = null; int len = 0; synchronized (node) { Set<String> childs = node.getChildren(); if (childs != null) { children = childs.toArray(new String[childs.size()]); } len = (node.data == null ? 0 : node.data.length); } counts.count += 1; counts.bytes += len; if (children == null children.length == 0) { return; } for (String child : children) { getCounts(path + "/" + child, counts); } } | /**
* this method gets the count of nodes and the bytes under a subtree
*
* @param path
* the path to be used
* @param counts
* the int count
*/ | this method gets the count of nodes and the bytes under a subtree | getCounts | {
"repo_name": "cloudera/recordservice",
"path": "thirdparty/zookeeper-cdh5-3.4.5_5.8.0/src/java/main/org/apache/zookeeper/server/DataTree.java",
"license": "apache-2.0",
"size": 48971
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 584,801 |
@Override
public ResourceLocator getResourceLocator() {
return DsEditPlugin.INSTANCE;
} | ResourceLocator function() { return DsEditPlugin.INSTANCE; } | /**
* Return the resource locator for this item provider's resources.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | Return the resource locator for this item provider's resources. | getResourceLocator | {
"repo_name": "nwnpallewela/developer-studio",
"path": "data-services/plugins/org.wso2.developerstudio.eclipse.ds.edit/src/org/wso2/developerstudio/eclipse/ds/provider/MaxRowCountItemProvider.java",
"license": "apache-2.0",
"size": 4977
} | [
"org.eclipse.emf.common.util.ResourceLocator"
] | import org.eclipse.emf.common.util.ResourceLocator; | import org.eclipse.emf.common.util.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 728,635 |
protected void trimStackFrames(List<String[]> stacks) {
int trimmed = -1;
for (int size = stacks.size(), i = size - 1; 0 < i; i--) {
String[] curr = (String[]) stacks.get(i);
String[] next = (String[]) stacks.get(i - 1);
List<String> currList = new ArrayList<String>(Arrays.asList(curr));
List<String> nextList = new ArrayList<String>(Arrays.asList(next));
ExceptionUtils.removeCommonFrames(currList, nextList);
trimmed = curr.length - currList.size();
if (0 < trimmed) {
currList.add("\t... " + trimmed + " more");
stacks.set(
i,
currList.toArray(new String[currList.size()])
);
}
}
} | void function(List<String[]> stacks) { int trimmed = -1; for (int size = stacks.size(), i = size - 1; 0 < i; i--) { String[] curr = (String[]) stacks.get(i); String[] next = (String[]) stacks.get(i - 1); List<String> currList = new ArrayList<String>(Arrays.asList(curr)); List<String> nextList = new ArrayList<String>(Arrays.asList(next)); ExceptionUtils.removeCommonFrames(currList, nextList); trimmed = curr.length - currList.size(); if (0 < trimmed) { currList.add(STR + trimmed + STR); stacks.set( i, currList.toArray(new String[currList.size()]) ); } } } | /**
* Trims the stack frames. The first set is left untouched. The rest
* of the frames are truncated from the bottom by comparing with
* one just on top.
*
* @param stacks The list containing String[] elements
* @since 2.0
*/ | Trims the stack frames. The first set is left untouched. The rest of the frames are truncated from the bottom by comparing with one just on top | trimStackFrames | {
"repo_name": "uchoice/exf",
"path": "exf-client/src/main/java/net/uchoice/exf/client/exception/NestableDelegate.java",
"license": "apache-2.0",
"size": 12574
} | [
"java.util.ArrayList",
"java.util.Arrays",
"java.util.List"
] | import java.util.ArrayList; import java.util.Arrays; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 452,068 |
private void unlockEntries(Iterable<GridCacheEntryEx> locked) {
for (GridCacheEntryEx entry : locked)
GridUnsafe.monitorExit(entry);
AffinityTopologyVersion topVer = ctx.affinity().affinityTopologyVersion();
for (GridCacheEntryEx entry : locked)
ctx.evicts().touch(entry, topVer);
} | void function(Iterable<GridCacheEntryEx> locked) { for (GridCacheEntryEx entry : locked) GridUnsafe.monitorExit(entry); AffinityTopologyVersion topVer = ctx.affinity().affinityTopologyVersion(); for (GridCacheEntryEx entry : locked) ctx.evicts().touch(entry, topVer); } | /**
* Releases java-level locks on cache entries.
*
* @param locked Locked entries.
*/ | Releases java-level locks on cache entries | unlockEntries | {
"repo_name": "nivanov/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/local/atomic/GridLocalAtomicCache.java",
"license": "apache-2.0",
"size": 52923
} | [
"org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion",
"org.apache.ignite.internal.processors.cache.GridCacheEntryEx",
"org.apache.ignite.internal.util.GridUnsafe"
] | import org.apache.ignite.internal.processors.affinity.AffinityTopologyVersion; import org.apache.ignite.internal.processors.cache.GridCacheEntryEx; import org.apache.ignite.internal.util.GridUnsafe; | import org.apache.ignite.internal.processors.affinity.*; import org.apache.ignite.internal.processors.cache.*; import org.apache.ignite.internal.util.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 2,357,711 |
public void init(ServletConfig config) throws ServletException {
super.init(config);
_sHomeDirectory = config.getServletContext().getRealPath("")+File.separator;
Properties props = null;
try {
props = WPSServlet.getProperties();
} catch (Exception ex) {
ex.printStackTrace();
throw new ServletException("Loading properties file failed. ("+ex.getMessage()+")");
}
try {
ClassLoader classLoader = WPSServlet.class.getClassLoader();
String sClassIWPSServer = (String)props.get(IWPSServer.class.getSimpleName());
_wpsServer = (IWPSServer)classLoader.loadClass(sClassIWPSServer).newInstance();
_wpsServer.init(classLoader);
} catch (Exception ex) {
ex.printStackTrace();
throw new ServletException("Loading IWPSServer interface failed. ("+ex.getMessage()+")");
}
_xmlOptions = new XmlOptions();
HashMap<String, String> mapPrefixes = new HashMap<String, String>();
mapPrefixes.put("http://www.opengis.net/wps/1.0.0", "wps");
mapPrefixes.put("http://www.opengis.net/ows/1.1", "ows");
mapPrefixes.put("http://www.w3.org/1999/xlink", "xlink");
mapPrefixes.put(WPSConstants.WPS_DEFAULT_NAMESPACE, "ica");
_xmlOptions.setSaveSuggestedPrefixes(mapPrefixes);
_xmlOptions.setSaveAggressiveNamespaces();
_xmlOptions.setSavePrettyPrint();
_xmlOptions.setCharacterEncoding(WPSConstants.WPS_ENCODING);
_bInitialized = true;
}
| void function(ServletConfig config) throws ServletException { super.init(config); _sHomeDirectory = config.getServletContext().getRealPath(STRLoading properties file failed. (STR)STRLoading IWPSServer interface failed. (STR)STRhttp: mapPrefixes.put(STRhttp: mapPrefixes.put(WPSConstants.WPS_DEFAULT_NAMESPACE, "ica"); _xmlOptions.setSaveSuggestedPrefixes(mapPrefixes); _xmlOptions.setSaveAggressiveNamespaces(); _xmlOptions.setSavePrettyPrint(); _xmlOptions.setCharacterEncoding(WPSConstants.WPS_ENCODING); _bInitialized = true; } | /**
* Initializes the servlet.
* @return void
* @param config The servlet configuration.
* @throws ServletException When an error occurs.
*/ | Initializes the servlet | init | {
"repo_name": "TUD-IfC/WebGen-WPS",
"path": "src/ica/wps/server/WPSServlet.java",
"license": "gpl-3.0",
"size": 14646
} | [
"javax.servlet.ServletConfig",
"javax.servlet.ServletException"
] | import javax.servlet.ServletConfig; import javax.servlet.ServletException; | import javax.servlet.*; | [
"javax.servlet"
] | javax.servlet; | 502,691 |
public static ContainerReportsProto getRandomContainerReports(
int numberOfContainers) {
List<ContainerReplicaProto> containerInfos = new ArrayList<>();
for (int i = 0; i < numberOfContainers; i++) {
containerInfos.add(getRandomContainerInfo(i));
}
return getContainerReports(containerInfos);
} | static ContainerReportsProto function( int numberOfContainers) { List<ContainerReplicaProto> containerInfos = new ArrayList<>(); for (int i = 0; i < numberOfContainers; i++) { containerInfos.add(getRandomContainerInfo(i)); } return getContainerReports(containerInfos); } | /**
* Generates random container report with the given number of containers.
*
* @param numberOfContainers number of containers to be in container report
*
* @return ContainerReportsProto
*/ | Generates random container report with the given number of containers | getRandomContainerReports | {
"repo_name": "xiao-chen/hadoop",
"path": "hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/TestUtils.java",
"license": "apache-2.0",
"size": 14183
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 1,223,954 |
AuditEntity getAudit(Long auditId); | AuditEntity getAudit(Long auditId); | /**
* Returns the existing audit for given id
*
* @param auditId audit id
* @return Audit retrieved
*/ | Returns the existing audit for given id | getAudit | {
"repo_name": "Orange-OpenSource/ocara",
"path": "app/src/main/java/com/orange/ocara/data/cache/db/ModelManager.java",
"license": "mpl-2.0",
"size": 5939
} | [
"com.orange.ocara.data.cache.model.AuditEntity"
] | import com.orange.ocara.data.cache.model.AuditEntity; | import com.orange.ocara.data.cache.model.*; | [
"com.orange.ocara"
] | com.orange.ocara; | 2,383,228 |
public Map<String, GitHubBranch> getBranches() {
Map<String, GitHubBranch> branchList = new HashMap<>();
JSONArray branches = new JSONArray(call(Path.REPO_BRANCHS));
for (int i = 0; i < branches.length(); i++) {
JSONObject jsonBranch = branches.getJSONObject(i);
String name = jsonBranch.getString("name");
String sha = jsonBranch.getJSONObject("commit").getString("sha");
GitHubBranch branch = new GitHubBranch(name, sha);
branchList.put(name, branch);
}
return branchList;
} | Map<String, GitHubBranch> function() { Map<String, GitHubBranch> branchList = new HashMap<>(); JSONArray branches = new JSONArray(call(Path.REPO_BRANCHS)); for (int i = 0; i < branches.length(); i++) { JSONObject jsonBranch = branches.getJSONObject(i); String name = jsonBranch.getString("name"); String sha = jsonBranch.getJSONObject(STR).getString("sha"); GitHubBranch branch = new GitHubBranch(name, sha); branchList.put(name, branch); } return branchList; } | /**
* Gets the current list of branches the repository has
*
* @return A map of branches with the key being the branch name
*/ | Gets the current list of branches the repository has | getBranches | {
"repo_name": "lordmat0/github-stream",
"path": "src/main/java/com/lordmat/githubstream/data/GitHubCaller.java",
"license": "gpl-2.0",
"size": 10895
} | [
"com.lordmat.githubstream.bean.GitHubBranch",
"com.lordmat.githubstream.resource.Path",
"java.util.HashMap",
"java.util.Map",
"org.json.JSONArray",
"org.json.JSONObject"
] | import com.lordmat.githubstream.bean.GitHubBranch; import com.lordmat.githubstream.resource.Path; import java.util.HashMap; import java.util.Map; import org.json.JSONArray; import org.json.JSONObject; | import com.lordmat.githubstream.bean.*; import com.lordmat.githubstream.resource.*; import java.util.*; import org.json.*; | [
"com.lordmat.githubstream",
"java.util",
"org.json"
] | com.lordmat.githubstream; java.util; org.json; | 733,345 |
@Generated
@Selector("attackTime")
public native double attackTime(); | @Selector(STR) native double function(); | /**
* [@property] attackTime
* <p>
* The time for the attenuation gain to ramp into effect.
* [@note]
* The attack time is scaled by unitsPerSecond internally, so can be provided at the client's native time scale.
*/ | [@property] attackTime The time for the attenuation gain to ramp into effect. [@note] The attack time is scaled by unitsPerSecond internally, so can be provided at the client's native time scale | attackTime | {
"repo_name": "multi-os-engine/moe-core",
"path": "moe.apple/moe.platform.ios/src/main/java/apple/phase/PHASEDucker.java",
"license": "apache-2.0",
"size": 9405
} | [
"org.moe.natj.objc.ann.Selector"
] | import org.moe.natj.objc.ann.Selector; | import org.moe.natj.objc.ann.*; | [
"org.moe.natj"
] | org.moe.natj; | 2,834,263 |
public void findPageContentlets(String HTMLPageIdentifier, String containerIdentifier, String orderby, boolean working, long languageId, User user, boolean respectFrontendRoles,List<Contentlet> returnValue); | void function(String HTMLPageIdentifier, String containerIdentifier, String orderby, boolean working, long languageId, User user, boolean respectFrontendRoles,List<Contentlet> returnValue); | /**
* Returns the contentlets on a given page. Will only return contentlets the user has permission to read/use
* You can pass -1 for languageId if you don't want to query to pull based
* on languages or 0 if you want to get the default language
* @param HTMLPageIdentifier
* @param containerIdentifier
* @param orderby
* @param working
* @param languageId
* @param user
* @param respectFrontendRoles
* @param returnValue - value returned by primary API Method
*/ | Returns the contentlets on a given page. Will only return contentlets the user has permission to read/use You can pass -1 for languageId if you don't want to query to pull based on languages or 0 if you want to get the default language | findPageContentlets | {
"repo_name": "guhb/core",
"path": "src/com/dotmarketing/portlets/contentlet/business/ContentletAPIPostHook.java",
"license": "gpl-3.0",
"size": 52012
} | [
"com.dotmarketing.portlets.contentlet.model.Contentlet",
"com.liferay.portal.model.User",
"java.util.List"
] | import com.dotmarketing.portlets.contentlet.model.Contentlet; import com.liferay.portal.model.User; import java.util.List; | import com.dotmarketing.portlets.contentlet.model.*; import com.liferay.portal.model.*; import java.util.*; | [
"com.dotmarketing.portlets",
"com.liferay.portal",
"java.util"
] | com.dotmarketing.portlets; com.liferay.portal; java.util; | 644,610 |
@Deprecated
public void setDestinationDir(File destinationDir) {
DeprecationLogger.deprecateProperty(AbstractCompile.class, "destinationDir")
.replaceWith("destinationDirectory")
.willBeRemovedInGradle8()
.withUpgradeGuideSection(7, "compile_task_wiring")
.nagUser();
this.destinationDirectory.set(destinationDir);
} | void function(File destinationDir) { DeprecationLogger.deprecateProperty(AbstractCompile.class, STR) .replaceWith(STR) .willBeRemovedInGradle8() .withUpgradeGuideSection(7, STR) .nagUser(); this.destinationDirectory.set(destinationDir); } | /**
* Sets the directory to generate the {@code .class} files into.
*
* @param destinationDir The destination directory. Must not be null.
*
* @deprecated Use {@link #getDestinationDirectory()}.set() instead. This method will be removed in Gradle 8.0.
*/ | Sets the directory to generate the .class files into | setDestinationDir | {
"repo_name": "gradle/gradle",
"path": "subprojects/language-jvm/src/main/java/org/gradle/api/tasks/compile/AbstractCompile.java",
"license": "apache-2.0",
"size": 7857
} | [
"java.io.File",
"org.gradle.internal.deprecation.DeprecationLogger"
] | import java.io.File; import org.gradle.internal.deprecation.DeprecationLogger; | import java.io.*; import org.gradle.internal.deprecation.*; | [
"java.io",
"org.gradle.internal"
] | java.io; org.gradle.internal; | 723,643 |
private Metadata parseMetadata(XmlPullParser parser) throws XmlPullParserException, IOException
{
String name = null;
parser.require(XmlPullParser.START_TAG, null, Metadata.getName());
// Create element
Metadata metadata = new Metadata();
// Read attributes
String id = parser.getAttributeValue(null, "id");
// Read sub elements
RDF_RDF rdf_RDF = null;
while (parser.next() != XmlPullParser.END_TAG)
{
if (parser.getEventType() != XmlPullParser.START_TAG)
{
continue;
}
name = parser.getName();
if (name.equals("rdf:RDF"))
{
rdf_RDF = (parseRdf_RDF(parser));
} else
{
skip(parser);
}
}
// Fill element
if (id != null)
metadata.setId(id);
if (rdf_RDF != null)
metadata.setRdf_RDF(rdf_RDF);
return metadata;
} | Metadata function(XmlPullParser parser) throws XmlPullParserException, IOException { String name = null; parser.require(XmlPullParser.START_TAG, null, Metadata.getName()); Metadata metadata = new Metadata(); String id = parser.getAttributeValue(null, "id"); RDF_RDF rdf_RDF = null; while (parser.next() != XmlPullParser.END_TAG) { if (parser.getEventType() != XmlPullParser.START_TAG) { continue; } name = parser.getName(); if (name.equals(STR)) { rdf_RDF = (parseRdf_RDF(parser)); } else { skip(parser); } } if (id != null) metadata.setId(id); if (rdf_RDF != null) metadata.setRdf_RDF(rdf_RDF); return metadata; } | /**
* Returns a Metadata element
*
* @param parser
* @return
* @throws org.xmlpull.v1.XmlPullParserException
* @throws java.io.IOException
*/ | Returns a Metadata element | parseMetadata | {
"repo_name": "interoberlin/sugarmonkey",
"path": "lib/src/main/java/de/interoberlin/sauvignon/lib/controller/SvgParser.java",
"license": "gpl-3.0",
"size": 55508
} | [
"de.interoberlin.sauvignon.lib.model.svg.meta.Metadata",
"java.io.IOException",
"org.xmlpull.v1.XmlPullParser",
"org.xmlpull.v1.XmlPullParserException"
] | import de.interoberlin.sauvignon.lib.model.svg.meta.Metadata; import java.io.IOException; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; | import de.interoberlin.sauvignon.lib.model.svg.meta.*; import java.io.*; import org.xmlpull.v1.*; | [
"de.interoberlin.sauvignon",
"java.io",
"org.xmlpull.v1"
] | de.interoberlin.sauvignon; java.io; org.xmlpull.v1; | 878,913 |
private void updateLayoutVersion(int newLayoutVersion, long newStartTxn)
throws IOException {
StringBuilder logMsg = new StringBuilder()
.append("Updating edits cache to use layout version ")
.append(newLayoutVersion)
.append(" starting from txn ID ")
.append(newStartTxn);
if (layoutVersion != INVALID_LAYOUT_VERSION) {
logMsg.append("; previous version was ").append(layoutVersion)
.append("; old entries will be cleared.");
}
Journal.LOG.info(logMsg.toString());
initialize(newStartTxn);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
EditLogFileOutputStream.writeHeader(newLayoutVersion,
new DataOutputStream(baos));
layoutVersion = newLayoutVersion;
layoutHeader = ByteBuffer.wrap(baos.toByteArray());
} | void function(int newLayoutVersion, long newStartTxn) throws IOException { StringBuilder logMsg = new StringBuilder() .append(STR) .append(newLayoutVersion) .append(STR) .append(newStartTxn); if (layoutVersion != INVALID_LAYOUT_VERSION) { logMsg.append(STR).append(layoutVersion) .append(STR); } Journal.LOG.info(logMsg.toString()); initialize(newStartTxn); ByteArrayOutputStream baos = new ByteArrayOutputStream(); EditLogFileOutputStream.writeHeader(newLayoutVersion, new DataOutputStream(baos)); layoutVersion = newLayoutVersion; layoutHeader = ByteBuffer.wrap(baos.toByteArray()); } | /**
* Update the layout version of the cache. This clears out all existing
* entries, and populates the new layout version and header for that version.
*
* @param newLayoutVersion The new layout version to be stored in the cache
* @param newStartTxn The new lowest transaction in the cache
*/ | Update the layout version of the cache. This clears out all existing entries, and populates the new layout version and header for that version | updateLayoutVersion | {
"repo_name": "steveloughran/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/JournaledEditsCache.java",
"license": "apache-2.0",
"size": 17891
} | [
"java.io.ByteArrayOutputStream",
"java.io.DataOutputStream",
"java.io.IOException",
"java.nio.ByteBuffer",
"org.apache.hadoop.hdfs.server.namenode.EditLogFileOutputStream"
] | import java.io.ByteArrayOutputStream; import java.io.DataOutputStream; import java.io.IOException; import java.nio.ByteBuffer; import org.apache.hadoop.hdfs.server.namenode.EditLogFileOutputStream; | import java.io.*; import java.nio.*; import org.apache.hadoop.hdfs.server.namenode.*; | [
"java.io",
"java.nio",
"org.apache.hadoop"
] | java.io; java.nio; org.apache.hadoop; | 1,343,019 |
public Adapter createAssociationDirectoryAdapter() {
return null;
} | Adapter function() { return null; } | /**
* Creates a new adapter for an object of class '{@link org.openhealthtools.mdht.cts2.association.AssociationDirectory <em>Directory</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
*
* @return the new adapter.
* @see org.openhealthtools.mdht.cts2.association.AssociationDirectory
* @generated
*/ | Creates a new adapter for an object of class '<code>org.openhealthtools.mdht.cts2.association.AssociationDirectory Directory</code>'. This default implementation returns null so that we can easily ignore cases; it's useful to ignore a case when inheritance will catch all the cases anyway. | createAssociationDirectoryAdapter | {
"repo_name": "drbgfc/mdht",
"path": "cts2/plugins/org.openhealthtools.mdht.cts2.core/src/org/openhealthtools/mdht/cts2/association/util/AssociationAdapterFactory.java",
"license": "epl-1.0",
"size": 13419
} | [
"org.eclipse.emf.common.notify.Adapter"
] | import org.eclipse.emf.common.notify.Adapter; | import org.eclipse.emf.common.notify.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,590,412 |
return AddCommitteeMembershipRule.class;
} | return AddCommitteeMembershipRule.class; } | /**
*
* Returns the <code>{@link AddCommitteeMembershipRule}</code> class which is needed to validate a
* <code>{@link CommitteeMembershipBase}</code>
*
* @return <code>{@link AddCommitteeMembershipRule} class</code>
*/ | Returns the <code><code>AddCommitteeMembershipRule</code></code> class which is needed to validate a <code><code>CommitteeMembershipBase</code></code> | getRuleInterfaceClass | {
"repo_name": "mukadder/kc",
"path": "coeus-impl/src/main/java/org/kuali/coeus/common/committee/impl/rule/event/AddCommitteeMembershipEvent.java",
"license": "agpl-3.0",
"size": 3347
} | [
"org.kuali.coeus.common.committee.impl.rule.AddCommitteeMembershipRule"
] | import org.kuali.coeus.common.committee.impl.rule.AddCommitteeMembershipRule; | import org.kuali.coeus.common.committee.impl.rule.*; | [
"org.kuali.coeus"
] | org.kuali.coeus; | 777,855 |
private static Signature getSignature(String keyAlgorithm)
throws NoSuchAlgorithmException
{
if (keyAlgorithm.equalsIgnoreCase("DSA")) {
return Signature.getInstance("SHA1withDSA");
} else if (keyAlgorithm.equalsIgnoreCase("RSA")) {
return Signature.getInstance("SHA256withRSA");
} else if (keyAlgorithm.equalsIgnoreCase("EC")) {
return Signature.getInstance("SHA256withECDSA");
}
throw new IllegalArgumentException(
"Key algorithm should be either DSA, RSA or EC");
} | static Signature function(String keyAlgorithm) throws NoSuchAlgorithmException { if (keyAlgorithm.equalsIgnoreCase("DSA")) { return Signature.getInstance(STR); } else if (keyAlgorithm.equalsIgnoreCase("RSA")) { return Signature.getInstance(STR); } else if (keyAlgorithm.equalsIgnoreCase("EC")) { return Signature.getInstance(STR); } throw new IllegalArgumentException( STR); } | /**
* Get default signature object base on default signature algorithm derived
* from given key algorithm for use in encoding usage.
*/ | Get default signature object base on default signature algorithm derived from given key algorithm for use in encoding usage | getSignature | {
"repo_name": "166MMX/openjdk.java.net-openjfx-8u40-rt",
"path": "modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/JarSignature.java",
"license": "gpl-2.0",
"size": 19865
} | [
"java.security.NoSuchAlgorithmException",
"java.security.Signature"
] | import java.security.NoSuchAlgorithmException; import java.security.Signature; | import java.security.*; | [
"java.security"
] | java.security; | 2,621,659 |
public PublicKey getPublicKey() {
return publicKey;
} | PublicKey function() { return publicKey; } | /**
* Gets the public key.
*
* @return the public key
*/ | Gets the public key | getPublicKey | {
"repo_name": "Deepnekroz/kaa",
"path": "common/endpoint-shared/src/main/java/org/kaaproject/kaa/common/endpoint/security/MessageEncoderDecoder.java",
"license": "apache-2.0",
"size": 11906
} | [
"java.security.PublicKey"
] | import java.security.PublicKey; | import java.security.*; | [
"java.security"
] | java.security; | 278,757 |
public String uploadAttachments(File[] files, int msTimeout) throws ServiceException {
Part[] parts = new Part[files.length];
for (int i = 0; i < files.length; i++) {
File file = files[i];
String contentType = URLConnection.getFileNameMap().getContentTypeFor(file.getName());
try {
parts[i] = new FilePart(file.getName(), file, contentType, "UTF-8");
} catch (IOException e) {
throw ZClientException.IO_ERROR(e.getMessage(), e);
}
}
return uploadAttachments(parts, msTimeout);
} | String function(File[] files, int msTimeout) throws ServiceException { Part[] parts = new Part[files.length]; for (int i = 0; i < files.length; i++) { File file = files[i]; String contentType = URLConnection.getFileNameMap().getContentTypeFor(file.getName()); try { parts[i] = new FilePart(file.getName(), file, contentType, "UTF-8"); } catch (IOException e) { throw ZClientException.IO_ERROR(e.getMessage(), e); } } return uploadAttachments(parts, msTimeout); } | /**
* Uploads files to <tt>FileUploadServlet</tt>.
* @return the attachment id
*/ | Uploads files to FileUploadServlet | uploadAttachments | {
"repo_name": "nico01f/z-pec",
"path": "ZimbraClient/src/java/com/zimbra/client/ZMailbox.java",
"license": "mit",
"size": 216305
} | [
"com.zimbra.common.service.ServiceException",
"com.zimbra.common.zclient.ZClientException",
"java.io.File",
"java.io.IOException",
"java.net.URLConnection",
"org.apache.commons.httpclient.methods.multipart.FilePart",
"org.apache.commons.httpclient.methods.multipart.Part"
] | import com.zimbra.common.service.ServiceException; import com.zimbra.common.zclient.ZClientException; import java.io.File; import java.io.IOException; import java.net.URLConnection; import org.apache.commons.httpclient.methods.multipart.FilePart; import org.apache.commons.httpclient.methods.multipart.Part; | import com.zimbra.common.service.*; import com.zimbra.common.zclient.*; import java.io.*; import java.net.*; import org.apache.commons.httpclient.methods.multipart.*; | [
"com.zimbra.common",
"java.io",
"java.net",
"org.apache.commons"
] | com.zimbra.common; java.io; java.net; org.apache.commons; | 1,225,220 |
private void setUpViewPagerAndTabLayout() {
ViewPagerAdapter viewPagerAdapter = new ViewPagerAdapter(getChildFragmentManager());
viewPagerAdapter.addFragment(AccountsFragment.newInstance(Constants.SAVINGS_ACCOUNTS),
getString(R.string.savings));
viewPagerAdapter.addFragment(AccountsFragment.newInstance(Constants.LOAN_ACCOUNTS),
getString(R.string.loan));
viewPagerAdapter.addFragment(AccountsFragment.newInstance(Constants.SHARE_ACCOUNTS),
getString(R.string.share));
viewPager.setOffscreenPageLimit(2);
viewPager.setAdapter(viewPagerAdapter);
switch (accountType) {
case SAVINGS:
viewPager.setCurrentItem(0);
break;
case LOAN:
viewPager.setCurrentItem(1);
break;
case SHARE:
viewPager.setCurrentItem(2);
break;
} | void function() { ViewPagerAdapter viewPagerAdapter = new ViewPagerAdapter(getChildFragmentManager()); viewPagerAdapter.addFragment(AccountsFragment.newInstance(Constants.SAVINGS_ACCOUNTS), getString(R.string.savings)); viewPagerAdapter.addFragment(AccountsFragment.newInstance(Constants.LOAN_ACCOUNTS), getString(R.string.loan)); viewPagerAdapter.addFragment(AccountsFragment.newInstance(Constants.SHARE_ACCOUNTS), getString(R.string.share)); viewPager.setOffscreenPageLimit(2); viewPager.setAdapter(viewPagerAdapter); switch (accountType) { case SAVINGS: viewPager.setCurrentItem(0); break; case LOAN: viewPager.setCurrentItem(1); break; case SHARE: viewPager.setCurrentItem(2); break; } | /**
* Setting up {@link ViewPagerAdapter} and {@link TabLayout} for Savings, Loans and Share
* accounts. {@code accountType} is used for setting the current Fragment
*/ | Setting up <code>ViewPagerAdapter</code> and <code>TabLayout</code> for Savings, Loans and Share accounts. accountType is used for setting the current Fragment | setUpViewPagerAndTabLayout | {
"repo_name": "therajanmaurya/self-service-app",
"path": "app/src/main/java/org/mifos/mobilebanking/ui/fragments/ClientAccountsFragment.java",
"license": "mpl-2.0",
"size": 20391
} | [
"org.mifos.mobilebanking.ui.adapters.ViewPagerAdapter",
"org.mifos.mobilebanking.utils.Constants"
] | import org.mifos.mobilebanking.ui.adapters.ViewPagerAdapter; import org.mifos.mobilebanking.utils.Constants; | import org.mifos.mobilebanking.ui.adapters.*; import org.mifos.mobilebanking.utils.*; | [
"org.mifos.mobilebanking"
] | org.mifos.mobilebanking; | 969,674 |
private void send(int rmtMapIdx, int rmtRdcIdx, int newBufMinSize) {
HadoopShuffleMessage msg = msgs[rmtMapIdx];
final long msgId = msg.id();
final GridFutureAdapter<?> fut;
if (embedded)
fut = null;
else {
fut = new GridFutureAdapter<>();
IgniteBiTuple<HadoopShuffleMessage, GridFutureAdapter<?>> old = sentMsgs.putIfAbsent(msgId,
new IgniteBiTuple<HadoopShuffleMessage, GridFutureAdapter<?>>(msg, fut));
assert old == null;
}
try {
io.apply(reduceAddrs[rmtRdcIdx], msg);
if (embedded)
remoteShuffleState(reduceAddrs[rmtRdcIdx]).onShuffleMessage();
}
catch (GridClosureException e) {
if (fut != null)
fut.onDone(U.unwrap(e));
} | void function(int rmtMapIdx, int rmtRdcIdx, int newBufMinSize) { HadoopShuffleMessage msg = msgs[rmtMapIdx]; final long msgId = msg.id(); final GridFutureAdapter<?> fut; if (embedded) fut = null; else { fut = new GridFutureAdapter<>(); IgniteBiTuple<HadoopShuffleMessage, GridFutureAdapter<?>> old = sentMsgs.putIfAbsent(msgId, new IgniteBiTuple<HadoopShuffleMessage, GridFutureAdapter<?>>(msg, fut)); assert old == null; } try { io.apply(reduceAddrs[rmtRdcIdx], msg); if (embedded) remoteShuffleState(reduceAddrs[rmtRdcIdx]).onShuffleMessage(); } catch (GridClosureException e) { if (fut != null) fut.onDone(U.unwrap(e)); } | /**
* Send message.
*
* @param rmtMapIdx Remote map index.
* @param rmtRdcIdx Remote reducer index.
* @param newBufMinSize Min new buffer size.
*/ | Send message | send | {
"repo_name": "pperalta/ignite",
"path": "modules/hadoop/src/main/java/org/apache/ignite/internal/processors/hadoop/shuffle/HadoopShuffleJob.java",
"license": "apache-2.0",
"size": 35701
} | [
"org.apache.ignite.internal.util.future.GridFutureAdapter",
"org.apache.ignite.internal.util.lang.GridClosureException",
"org.apache.ignite.internal.util.typedef.internal.U",
"org.apache.ignite.lang.IgniteBiTuple"
] | import org.apache.ignite.internal.util.future.GridFutureAdapter; import org.apache.ignite.internal.util.lang.GridClosureException; import org.apache.ignite.internal.util.typedef.internal.U; import org.apache.ignite.lang.IgniteBiTuple; | import org.apache.ignite.internal.util.future.*; import org.apache.ignite.internal.util.lang.*; import org.apache.ignite.internal.util.typedef.internal.*; import org.apache.ignite.lang.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 400,001 |
public void pause(boolean pause) {
imageAnimation.pause(pause);
}
/**
* A flag which indicates if the icon has been changed with {@link #setIcon(Icon)} | void function(boolean pause) { imageAnimation.pause(pause); } /** * A flag which indicates if the icon has been changed with {@link #setIcon(Icon)} | /**
* Pauses the animation
*
* @param pause
*/ | Pauses the animation | pause | {
"repo_name": "thnaeff/GuiUtil",
"path": "src/ch/thn/guiutil/component/imageanimation/ImageAnimationLabel.java",
"license": "apache-2.0",
"size": 5391
} | [
"javax.swing.Icon"
] | import javax.swing.Icon; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 181,659 |
private static String prepSentence(String sentence, String to, String[] cos,
String[][] nes) {
// initialize reverse map
reverseMap = new Hashtable<String, String>();
// replace TARGET and CONTEXT objects and NEs
sentence = replaceTarget(sentence, to, nes);
if (sentence == null) return null;
sentence = replaceContext(sentence, cos, nes);
sentence = replaceNes(sentence, nes);
// add '#' at beginning and end of sentence
sentence = "# " + sentence + " #";
return sentence;
}
| static String function(String sentence, String to, String[] cos, String[][] nes) { reverseMap = new Hashtable<String, String>(); sentence = replaceTarget(sentence, to, nes); if (sentence == null) return null; sentence = replaceContext(sentence, cos, nes); sentence = replaceNes(sentence, nes); sentence = STR + sentence + STR; return sentence; } | /**
* Prepares a sentence for answer extraction.
*
* @param sentence input sentence
* @param to the TARGET object of the question
* @param cos the CONTEXT objects of the question
* @param nes the NEs in the sentence
* @return sentence ready for answer extraction or <code>null</code>, if
* there is no TARGET object in the input sentence
*/ | Prepares a sentence for answer extraction | prepSentence | {
"repo_name": "vishnujayvel/QAGenerator",
"path": "src/info/ephyra/answeranalysis/AnswerAnalyzer.java",
"license": "gpl-3.0",
"size": 14324
} | [
"java.util.Hashtable"
] | import java.util.Hashtable; | import java.util.*; | [
"java.util"
] | java.util; | 527,688 |
//-----------------------------------------------------------------------
public SimpleUserProfile getProfile() {
return _profile;
} | SimpleUserProfile function() { return _profile; } | /**
* Gets the user profile, containing user settings.
* @return the value of the property, not null
*/ | Gets the user profile, containing user settings | getProfile | {
"repo_name": "McLeodMoores/starling",
"path": "projects/master/src/main/java/com/opengamma/master/user/ManageableUser.java",
"license": "apache-2.0",
"size": 25391
} | [
"com.opengamma.core.user.impl.SimpleUserProfile"
] | import com.opengamma.core.user.impl.SimpleUserProfile; | import com.opengamma.core.user.impl.*; | [
"com.opengamma.core"
] | com.opengamma.core; | 1,130,749 |
public PactDslJsonArray timestamp(String format) {
FastDateFormat instance = FastDateFormat.getInstance(format);
body.put(instance.format(new Date(DATE_2000)));
generators.addGenerator(Category.BODY, rootPath + appendArrayIndex(0), new DateTimeGenerator(format));
matchers.addRule(rootPath + appendArrayIndex(0), matchTimestamp(format));
return this;
} | PactDslJsonArray function(String format) { FastDateFormat instance = FastDateFormat.getInstance(format); body.put(instance.format(new Date(DATE_2000))); generators.addGenerator(Category.BODY, rootPath + appendArrayIndex(0), new DateTimeGenerator(format)); matchers.addRule(rootPath + appendArrayIndex(0), matchTimestamp(format)); return this; } | /**
* Element that must match the given timestamp format
* @param format timestamp format
*/ | Element that must match the given timestamp format | timestamp | {
"repo_name": "Fitzoh/pact-jvm",
"path": "pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslJsonArray.java",
"license": "apache-2.0",
"size": 35404
} | [
"au.com.dius.pact.model.generators.Category",
"au.com.dius.pact.model.generators.DateTimeGenerator",
"java.util.Date",
"org.apache.commons.lang3.time.FastDateFormat"
] | import au.com.dius.pact.model.generators.Category; import au.com.dius.pact.model.generators.DateTimeGenerator; import java.util.Date; import org.apache.commons.lang3.time.FastDateFormat; | import au.com.dius.pact.model.generators.*; import java.util.*; import org.apache.commons.lang3.time.*; | [
"au.com.dius",
"java.util",
"org.apache.commons"
] | au.com.dius; java.util; org.apache.commons; | 1,111,046 |
@Override
public Iterator<IntTaggedWord> ruleIteratorByWord(int word, int loc, String featureSpec) {
if (word == wordIndex.indexOf(BOUNDARY)) {
// Deterministic tagging of the boundary symbol
return rulesWithWord[word].iterator();
} else if (isKnown(word)) {
// Strict lexical tagging for seen *lemma* types
// We need to copy the word form into the rules, which currently have lemmas in them
return rulesWithWord[word].iterator();
} else {
if (DEBUG) System.err.println("UNKNOWN WORD");
// Unknown word signatures
Set<IntTaggedWord> lexRules = Generics.newHashSet(10);
List<IntTaggedWord> uwRules = rulesWithWord[wordIndex.indexOf(UNKNOWN_WORD)];
// Inject the word into these rules instead of the UW signature
for (IntTaggedWord iTW : uwRules) {
lexRules.add(new IntTaggedWord(word, iTW.tag));
}
return lexRules.iterator();
}
} | Iterator<IntTaggedWord> function(int word, int loc, String featureSpec) { if (word == wordIndex.indexOf(BOUNDARY)) { return rulesWithWord[word].iterator(); } else if (isKnown(word)) { return rulesWithWord[word].iterator(); } else { if (DEBUG) System.err.println(STR); Set<IntTaggedWord> lexRules = Generics.newHashSet(10); List<IntTaggedWord> uwRules = rulesWithWord[wordIndex.indexOf(UNKNOWN_WORD)]; for (IntTaggedWord iTW : uwRules) { lexRules.add(new IntTaggedWord(word, iTW.tag)); } return lexRules.iterator(); } } | /**
* Rule table is lemmas. So isKnown() is slightly trickier.
*/ | Rule table is lemmas. So isKnown() is slightly trickier | ruleIteratorByWord | {
"repo_name": "hbbpb/stanford-corenlp-gv",
"path": "src/edu/stanford/nlp/parser/lexparser/FactoredLexicon.java",
"license": "gpl-2.0",
"size": 20642
} | [
"edu.stanford.nlp.util.Generics",
"java.util.Iterator",
"java.util.List",
"java.util.Set"
] | import edu.stanford.nlp.util.Generics; import java.util.Iterator; import java.util.List; import java.util.Set; | import edu.stanford.nlp.util.*; import java.util.*; | [
"edu.stanford.nlp",
"java.util"
] | edu.stanford.nlp; java.util; | 1,486,971 |
public BigDecimal getRecognizedAmt ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_RecognizedAmt);
if (bd == null)
return Env.ZERO;
return bd;
} | BigDecimal function () { BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_RecognizedAmt); if (bd == null) return Env.ZERO; return bd; } | /** Get Recognized Amount.
@return Recognized Amount */ | Get Recognized Amount | getRecognizedAmt | {
"repo_name": "geneos/adempiere",
"path": "base/src/org/compiere/model/X_C_RevenueRecognition_Plan.java",
"license": "gpl-2.0",
"size": 9475
} | [
"java.math.BigDecimal",
"org.compiere.util.Env"
] | import java.math.BigDecimal; import org.compiere.util.Env; | import java.math.*; import org.compiere.util.*; | [
"java.math",
"org.compiere.util"
] | java.math; org.compiere.util; | 1,246,366 |
public RouteDefinition from(@AsEndpointUri String uri) {
RouteDefinition route = createRoute();
route.from(uri);
return route(route);
} | RouteDefinition function(@AsEndpointUri String uri) { RouteDefinition route = createRoute(); route.from(uri); return route(route); } | /**
* Creates a new route from the given URI input
*
* @param uri the from uri
* @return the builder
*/ | Creates a new route from the given URI input | from | {
"repo_name": "christophd/camel",
"path": "core/camel-core-model/src/main/java/org/apache/camel/model/RoutesDefinition.java",
"license": "apache-2.0",
"size": 12997
} | [
"org.apache.camel.spi.AsEndpointUri"
] | import org.apache.camel.spi.AsEndpointUri; | import org.apache.camel.spi.*; | [
"org.apache.camel"
] | org.apache.camel; | 335,449 |
return Optional.ofNullable(index);
} | return Optional.ofNullable(index); } | /**
* Get index segment.
*
* @return index segment
*/ | Get index segment | getIndex | {
"repo_name": "apache/incubator-shardingsphere",
"path": "shardingsphere-sql-parser/shardingsphere-sql-parser-statement/src/main/java/org/apache/shardingsphere/sql/parser/sql/common/statement/ddl/AlterIndexStatement.java",
"license": "apache-2.0",
"size": 1491
} | [
"java.util.Optional"
] | import java.util.Optional; | import java.util.*; | [
"java.util"
] | java.util; | 129,791 |
try {
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"org.apache.harmony.test.func.api.javax."
+ "naming.event.EventDirCtxFactory");
ctx = new InitialDirContext(env);
l = new NamingEventListenerSample();
((EventDirContext) ctx.lookup("")).addNamingListener(ctxName,
EventContext.ONELEVEL_SCOPE, l);
} catch (Exception e) {
e.printStackTrace();
System.exit(fail(e.toString()));
}
} | try { Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY, STR + STR); ctx = new InitialDirContext(env); l = new NamingEventListenerSample(); ((EventDirContext) ctx.lookup("")).addNamingListener(ctxName, EventContext.ONELEVEL_SCOPE, l); } catch (Exception e) { e.printStackTrace(); System.exit(fail(e.toString())); } } | /**
* Create InitialDirContext and NamingEventListener objects, register event
* listener.
*/ | Create InitialDirContext and NamingEventListener objects, register event listener | setUp | {
"repo_name": "freeVM/freeVM",
"path": "enhanced/buildtest/tests/functional/src/test/functional/org/apache/harmony/test/func/api/javax/naming/event/EventTest.java",
"license": "apache-2.0",
"size": 8517
} | [
"java.util.Hashtable",
"javax.naming.Context",
"javax.naming.directory.InitialDirContext",
"javax.naming.event.EventContext",
"javax.naming.event.EventDirContext"
] | import java.util.Hashtable; import javax.naming.Context; import javax.naming.directory.InitialDirContext; import javax.naming.event.EventContext; import javax.naming.event.EventDirContext; | import java.util.*; import javax.naming.*; import javax.naming.directory.*; import javax.naming.event.*; | [
"java.util",
"javax.naming"
] | java.util; javax.naming; | 2,781,307 |
public void eraseAllFiles() {
//Clean internal old files
String[] files = context.fileList();
for (String fileName : files) {
eraseFile(fileName);
}
//Clean external old files
if (isExternalStorageAvailable()) {
File rootDirectory = new File(externalMemoryPath);
File[] externalFiles = rootDirectory.listFiles();
if (files != null) {
for (File file : externalFiles) {
file.delete();
}
}
}
} | void function() { String[] files = context.fileList(); for (String fileName : files) { eraseFile(fileName); } if (isExternalStorageAvailable()) { File rootDirectory = new File(externalMemoryPath); File[] externalFiles = rootDirectory.listFiles(); if (files != null) { for (File file : externalFiles) { file.delete(); } } } } | /**
* Clean old files.
* This methods removes all internal and external memory files that contains the this.extension extension.
*/ | Clean old files. This methods removes all internal and external memory files that contains the this.extension extension | eraseAllFiles | {
"repo_name": "OpenRedu/mobile",
"path": "OpenRedu/app/src/main/java/br/ufpe/cin/openredu/util/cache/FileManager.java",
"license": "gpl-2.0",
"size": 4714
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 2,235,447 |
public INDArray toVector(String word){
if (wordToId.containsKey(word)){
return embeddings.getRow(wordToId.get(word));
}
return null;
} | INDArray function(String word){ if (wordToId.containsKey(word)){ return embeddings.getRow(wordToId.get(word)); } return null; } | /**
* Converts word to vectors
* @param word word to be converted to vector
* @return Vector if words exists or null otherwise
*/ | Converts word to vectors | toVector | {
"repo_name": "USCDataScience/SentimentAnalysisParser",
"path": "sentiment-dl/src/main/java/edu/usc/irds/sentiment/analysis/dl/GlobalVectors.java",
"license": "apache-2.0",
"size": 5635
} | [
"org.nd4j.linalg.api.ndarray.INDArray"
] | import org.nd4j.linalg.api.ndarray.INDArray; | import org.nd4j.linalg.api.ndarray.*; | [
"org.nd4j.linalg"
] | org.nd4j.linalg; | 377,734 |
void setCompressionRegistry(CompressorRegistry registry); | void setCompressionRegistry(CompressorRegistry registry); | /**
* Sets the compressor registry to use when resolving {@link #pickCompressor}. If unset, the
* default CompressorRegistry will be used. If the stream has a {@code start()} method,
* setCompressionRegistry must be called prior to start.
*
* @see CompressorRegistry#getDefaultInstance()
*
* @param registry the compressors to use.
*/ | Sets the compressor registry to use when resolving <code>#pickCompressor</code>. If unset, the default CompressorRegistry will be used. If the stream has a start() method, setCompressionRegistry must be called prior to start | setCompressionRegistry | {
"repo_name": "eonezhang/grpc-java",
"path": "core/src/main/java/io/grpc/internal/Stream.java",
"license": "bsd-3-clause",
"size": 5284
} | [
"io.grpc.CompressorRegistry"
] | import io.grpc.CompressorRegistry; | import io.grpc.*; | [
"io.grpc"
] | io.grpc; | 26,906 |
public static void grantUriPermissionToIntent(@NonNull Context context, @NonNull Intent intent,
@NonNull Uri uri) {
// Workaround for Android bug.
// grantUriPermission also needed for KITKAT,
// see https://code.google.com/p/android/issues/detail?id=76683
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {
List<ResolveInfo> resInfoList = context.getPackageManager()
.queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY);
for (ResolveInfo resolveInfo : resInfoList) {
String packageName = resolveInfo.activityInfo.packageName;
context.grantUriPermission(packageName, uri,
Intent.FLAG_GRANT_READ_URI_PERMISSION
| Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
}
}
} | static void function(@NonNull Context context, @NonNull Intent intent, @NonNull Uri uri) { if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) { List<ResolveInfo> resInfoList = context.getPackageManager() .queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY); for (ResolveInfo resolveInfo : resInfoList) { String packageName = resolveInfo.activityInfo.packageName; context.grantUriPermission(packageName, uri, Intent.FLAG_GRANT_READ_URI_PERMISSION Intent.FLAG_GRANT_WRITE_URI_PERMISSION); } } } | /**
* Grant Uri Permission To Intent
* @param context Context
* @param intent Intent
* @param uri uri
*/ | Grant Uri Permission To Intent | grantUriPermissionToIntent | {
"repo_name": "ligboy/selectphoto",
"path": "library/src/main/java/org/ligboy/selectphoto/ContextUtil.java",
"license": "apache-2.0",
"size": 3763
} | [
"android.content.Context",
"android.content.Intent",
"android.content.pm.PackageManager",
"android.content.pm.ResolveInfo",
"android.net.Uri",
"android.os.Build",
"android.support.annotation.NonNull",
"java.util.List"
] | import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.net.Uri; import android.os.Build; import android.support.annotation.NonNull; import java.util.List; | import android.content.*; import android.content.pm.*; import android.net.*; import android.os.*; import android.support.annotation.*; import java.util.*; | [
"android.content",
"android.net",
"android.os",
"android.support",
"java.util"
] | android.content; android.net; android.os; android.support; java.util; | 2,804,062 |
public Coordinate getCoordinateFromLine(String line) {
try {
int x = Integer.valueOf(this.readPartFromLine(line, FILE_PART.XPOS));
int y = Integer.valueOf(this.readPartFromLine(line, FILE_PART.YPOS));
return new Coordinate(x, y);
} catch (Exception e) {
Logger.write(String.format("MapLoader::getCoordinateFromLine: Can not parse a coordinate from line \"%s\"!", line));
return null;
}
} | Coordinate function(String line) { try { int x = Integer.valueOf(this.readPartFromLine(line, FILE_PART.XPOS)); int y = Integer.valueOf(this.readPartFromLine(line, FILE_PART.YPOS)); return new Coordinate(x, y); } catch (Exception e) { Logger.write(String.format(STR%s\"!", line)); return null; } } | /**
* Fetches the Coordinate of the element
* @param line Line from the mapfile
* @return Coordinate of the element
*/ | Fetches the Coordinate of the element | getCoordinateFromLine | {
"repo_name": "MariusTimmer/MenschAergereDichNicht",
"path": "src/de/lebk/madn/gui/MapLoader.java",
"license": "mit",
"size": 7229
} | [
"de.lebk.madn.Coordinate",
"de.lebk.madn.Logger"
] | import de.lebk.madn.Coordinate; import de.lebk.madn.Logger; | import de.lebk.madn.*; | [
"de.lebk.madn"
] | de.lebk.madn; | 2,404,082 |
public int getListenerCount() {
Object[][] ls = listeners;
int total = 0;
for (int i = ls.length-1; i >= 0; i--) {
total += ((EventListener[])ls[i][1]).length;
}
return total;
} | int function() { Object[][] ls = listeners; int total = 0; for (int i = ls.length-1; i >= 0; i--) { total += ((EventListener[])ls[i][1]).length; } return total; } | /**
* Returns the total number of listeners for this listener list.
* @return a non-negative integer
*/ | Returns the total number of listeners for this listener list | getListenerCount | {
"repo_name": "djb61230/jflicks",
"path": "jlirc/src/org/lirc/EventListenerList.java",
"license": "gpl-3.0",
"size": 8122
} | [
"java.util.EventListener"
] | import java.util.EventListener; | import java.util.*; | [
"java.util"
] | java.util; | 1,864,767 |
public Get setTimeRange(long minStamp, long maxStamp)
throws IOException {
tr = new TimeRange(minStamp, maxStamp);
return this;
} | Get function(long minStamp, long maxStamp) throws IOException { tr = new TimeRange(minStamp, maxStamp); return this; } | /**
* Get versions of columns only within the specified timestamp range,
* [minStamp, maxStamp).
* @param minStamp minimum timestamp value, inclusive
* @param maxStamp maximum timestamp value, exclusive
* @throws IOException if invalid time range
* @return this for invocation chaining
*/ | Get versions of columns only within the specified timestamp range, [minStamp, maxStamp) | setTimeRange | {
"repo_name": "zqxjjj/NobidaBase",
"path": "target/hbase-0.94.9/hbase-0.94.9/src/main/java/org/apache/hadoop/hbase/client/Get.java",
"license": "apache-2.0",
"size": 13935
} | [
"java.io.IOException",
"org.apache.hadoop.hbase.io.TimeRange"
] | import java.io.IOException; import org.apache.hadoop.hbase.io.TimeRange; | import java.io.*; import org.apache.hadoop.hbase.io.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 658,217 |
public static TranslatableText.Builder builder(Translatable translatable, Object... args) {
return new TranslatableText.Builder(translatable, args);
}
/**
* Creates a new {@link TranslatableText.Builder} with the formatting and
* actions of the specified {@link Text} and the given {@link Translation} | static TranslatableText.Builder function(Translatable translatable, Object... args) { return new TranslatableText.Builder(translatable, args); } /** * Creates a new {@link TranslatableText.Builder} with the formatting and * actions of the specified {@link Text} and the given {@link Translation} | /**
* Creates a new unformatted {@link TranslatableText.Builder} from the given
* {@link Translatable}.
*
* @param translatable The translatable for the builder
* @param args The arguments for the translation
* @return The created text builder
* @see TranslatableText
* @see TranslatableText.Builder
*/ | Creates a new unformatted <code>TranslatableText.Builder</code> from the given <code>Translatable</code> | builder | {
"repo_name": "JBYoshi/SpongeAPI",
"path": "src/main/java/org/spongepowered/api/text/Text.java",
"license": "mit",
"size": 42927
} | [
"org.spongepowered.api.text.translation.Translatable",
"org.spongepowered.api.text.translation.Translation"
] | import org.spongepowered.api.text.translation.Translatable; import org.spongepowered.api.text.translation.Translation; | import org.spongepowered.api.text.translation.*; | [
"org.spongepowered.api"
] | org.spongepowered.api; | 2,159,655 |
public TransparentDataEncryptionStatus status() {
return this.status;
} | TransparentDataEncryptionStatus function() { return this.status; } | /**
* Get the status of the database transparent data encryption. Possible values include: 'Enabled', 'Disabled'.
*
* @return the status value
*/ | Get the status of the database transparent data encryption. Possible values include: 'Enabled', 'Disabled' | status | {
"repo_name": "hovsepm/azure-sdk-for-java",
"path": "sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/TransparentDataEncryptionInner.java",
"license": "mit",
"size": 1897
} | [
"com.microsoft.azure.management.sql.v2014_04_01.TransparentDataEncryptionStatus"
] | import com.microsoft.azure.management.sql.v2014_04_01.TransparentDataEncryptionStatus; | import com.microsoft.azure.management.sql.v2014_04_01.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 2,626,222 |
public static Optional<String> nameOf(Arena a){
for (Map.Entry<String, Arena> entry : arenas.entrySet()) {
if (a.equals(entry.getValue())) {
return Optional.of(entry.getKey());
}
}
return Optional.absent();
} | static Optional<String> function(Arena a){ for (Map.Entry<String, Arena> entry : arenas.entrySet()) { if (a.equals(entry.getValue())) { return Optional.of(entry.getKey()); } } return Optional.absent(); } | /**
* Gets the name of a given arena
* @param a The arena
* @return An optional object containing the name or nothing
*/ | Gets the name of a given arena | nameOf | {
"repo_name": "Spawned/Ludus",
"path": "src/main/java/in/spawned/ludus/managers/Arenas.java",
"license": "mit",
"size": 1881
} | [
"com.google.common.base.Optional",
"in.spawned.ludus.interfaces.Arena",
"java.util.Map"
] | import com.google.common.base.Optional; import in.spawned.ludus.interfaces.Arena; import java.util.Map; | import com.google.common.base.*; import in.spawned.ludus.interfaces.*; import java.util.*; | [
"com.google.common",
"in.spawned.ludus",
"java.util"
] | com.google.common; in.spawned.ludus; java.util; | 632,828 |
@Override
public WorkflowInstance get(String id) throws WorkflowException {
ParamChecker.notNull(id, "id");
try {
ResultSetReader rs = SqlStatement.parse(SqlStatement.selectColumns(OozieColumn.PI_state).where(
SqlStatement.isEqual(OozieColumn.PI_wfId, ParamChecker.notNull(id, "id"))).
prepareAndSetValues(connection).executeQuery());
rs.next();
LiteWorkflowInstance pInstance = WritableUtils.fromByteArray(rs.getByteArray(OozieColumn.PI_state),
LiteWorkflowInstance.class);
return pInstance;
}
catch (SQLException e) {
throw new WorkflowException(ErrorCode.E0713, e.getMessage(), e);
}
} | WorkflowInstance function(String id) throws WorkflowException { ParamChecker.notNull(id, "id"); try { ResultSetReader rs = SqlStatement.parse(SqlStatement.selectColumns(OozieColumn.PI_state).where( SqlStatement.isEqual(OozieColumn.PI_wfId, ParamChecker.notNull(id, "id"))). prepareAndSetValues(connection).executeQuery()); rs.next(); LiteWorkflowInstance pInstance = WritableUtils.fromByteArray(rs.getByteArray(OozieColumn.PI_state), LiteWorkflowInstance.class); return pInstance; } catch (SQLException e) { throw new WorkflowException(ErrorCode.E0713, e.getMessage(), e); } } | /**
* Loads the Workflow instance with the given ID.
*
* @param id
* @return
* @throws WorkflowException
*/ | Loads the Workflow instance with the given ID | get | {
"repo_name": "terrancesnyder/oozie-hadoop2",
"path": "core/src/main/java/org/apache/oozie/workflow/lite/DBLiteWorkflowLib.java",
"license": "apache-2.0",
"size": 5220
} | [
"java.sql.SQLException",
"org.apache.oozie.ErrorCode",
"org.apache.oozie.store.OozieSchema",
"org.apache.oozie.util.ParamChecker",
"org.apache.oozie.util.WritableUtils",
"org.apache.oozie.util.db.SqlStatement",
"org.apache.oozie.workflow.WorkflowException",
"org.apache.oozie.workflow.WorkflowInstance"... | import java.sql.SQLException; import org.apache.oozie.ErrorCode; import org.apache.oozie.store.OozieSchema; import org.apache.oozie.util.ParamChecker; import org.apache.oozie.util.WritableUtils; import org.apache.oozie.util.db.SqlStatement; import org.apache.oozie.workflow.WorkflowException; import org.apache.oozie.workflow.WorkflowInstance; | import java.sql.*; import org.apache.oozie.*; import org.apache.oozie.store.*; import org.apache.oozie.util.*; import org.apache.oozie.util.db.*; import org.apache.oozie.workflow.*; | [
"java.sql",
"org.apache.oozie"
] | java.sql; org.apache.oozie; | 2,043,661 |
public static RegionMetadata loadMetadataFromURI(final URI uri)
throws IOException {
return loadMetadataFromURI(uri, null);
} | static RegionMetadata function(final URI uri) throws IOException { return loadMetadataFromURI(uri, null); } | /**
* Loads a set of region metadata by downloading an XML file from the
* given URI and parsing it.
*
* @param uri the uri of the XML file to parse
* @return the parsed region metadata
* @throws IOException on error fetching or parsing the XML file
*/ | Loads a set of region metadata by downloading an XML file from the given URI and parsing it | loadMetadataFromURI | {
"repo_name": "trasa/aws-sdk-java",
"path": "aws-java-sdk-core/src/main/java/com/amazonaws/regions/RegionUtils.java",
"license": "apache-2.0",
"size": 17156
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 358,154 |
public String toString() {
return String.format(Locale.US,
"id: %d\n" + "remote id: %d\n" + "name: %s\n" + "description: %s\n" + "expiry: %s\n"
+ "isImportant: %b\n" + "isMarkedDone: %b\n",
id, remoteId, name, description, expiry.toString(), isImportant, isMarkedDone);
} | String function() { return String.format(Locale.US, STR + STR + STR + STR + STR + STR + STR, id, remoteId, name, description, expiry.toString(), isImportant, isMarkedDone); } | /**
* Return a string representation of this object.
*
* @see java.lang.Object#toString()
*/ | Return a string representation of this object | toString | {
"repo_name": "gwutama/MAD-Todo",
"path": "src/com/utama/madtodo/models/TodoEntity.java",
"license": "mit",
"size": 5663
} | [
"java.util.Locale"
] | import java.util.Locale; | import java.util.*; | [
"java.util"
] | java.util; | 763,547 |
int[] decodeEnd(BitArray row) throws NotFoundException {
// For convenience, reverse the row and then
// search from 'the start' for the end block
row.reverse();
try {
int endStart = skipWhiteSpace(row);
int[] endPattern = findGuardPattern(row, endStart, END_PATTERN_REVERSED);
// The start & end patterns must be pre/post fixed by a quiet zone. This
// zone must be at least 10 times the width of a narrow line.
// ref: http://www.barcode-1.net/i25code.html
validateQuietZone(row, endPattern[0]);
// Now recalculate the indices of where the 'endblock' starts & stops to
// accommodate
// the reversed nature of the search
int temp = endPattern[0];
endPattern[0] = row.getSize() - endPattern[1];
endPattern[1] = row.getSize() - temp;
return endPattern;
} finally {
// Put the row back the right way.
row.reverse();
}
}
| int[] decodeEnd(BitArray row) throws NotFoundException { row.reverse(); try { int endStart = skipWhiteSpace(row); int[] endPattern = findGuardPattern(row, endStart, END_PATTERN_REVERSED); validateQuietZone(row, endPattern[0]); int temp = endPattern[0]; endPattern[0] = row.getSize() - endPattern[1]; endPattern[1] = row.getSize() - temp; return endPattern; } finally { row.reverse(); } } | /**
* Identify where the end of the middle / payload section ends.
*
* @param row row of black/white values to search
* @return Array, containing index of start of 'end block' and end of 'end
* block'
* @throws NotFoundException
*/ | Identify where the end of the middle / payload section ends | decodeEnd | {
"repo_name": "wasn-lab/visual-positioning",
"path": "core/src/com/google/zxing/oned/ITFReader.java",
"license": "apache-2.0",
"size": 12510
} | [
"com.google.zxing.NotFoundException",
"com.google.zxing.common.BitArray"
] | import com.google.zxing.NotFoundException; import com.google.zxing.common.BitArray; | import com.google.zxing.*; import com.google.zxing.common.*; | [
"com.google.zxing"
] | com.google.zxing; | 1,031,469 |
boolean sqlMapInsertSelectiveElementGenerated(XmlElement element,
IntrospectedTable introspectedTable); | boolean sqlMapInsertSelectiveElementGenerated(XmlElement element, IntrospectedTable introspectedTable); | /**
* This method is called when the insert selective element is generated.
*
* @param element
* the generated <insert> element
* @param introspectedTable
* The class containing information about the table as
* introspected from the database
* @return true if the element should be generated, false if the generated
* element should be ignored. In the case of multiple plugins, the
* first plugin returning false will disable the calling of further
* plugins.
*/ | This method is called when the insert selective element is generated | sqlMapInsertSelectiveElementGenerated | {
"repo_name": "NanYoMy/mybatis-generator",
"path": "src/main/java/org/mybatis/generator/api/Plugin.java",
"license": "mit",
"size": 72792
} | [
"org.mybatis.generator.api.dom.xml.XmlElement"
] | import org.mybatis.generator.api.dom.xml.XmlElement; | import org.mybatis.generator.api.dom.xml.*; | [
"org.mybatis.generator"
] | org.mybatis.generator; | 2,749,867 |
public void setData(ClusterConfig data) {
if (data != null) {
data.setState(Constant.Cluster.State.ERROR);
setDataBytes(SerializationUtils.serialize(data));
}
}
| void function(ClusterConfig data) { if (data != null) { data.setState(Constant.Cluster.State.ERROR); setDataBytes(SerializationUtils.serialize(data)); } } | /**
* Method to set the ClusterConf as bytes in db.
*
*/ | Method to set the ClusterConf as bytes in db | setData | {
"repo_name": "zengzhaozheng/ankush",
"path": "ankush/src/main/java/com/impetus/ankush/common/domain/Template.java",
"license": "lgpl-3.0",
"size": 5422
} | [
"com.impetus.ankush2.constant.Constant",
"com.impetus.ankush2.framework.config.ClusterConfig",
"org.springframework.util.SerializationUtils"
] | import com.impetus.ankush2.constant.Constant; import com.impetus.ankush2.framework.config.ClusterConfig; import org.springframework.util.SerializationUtils; | import com.impetus.ankush2.constant.*; import com.impetus.ankush2.framework.config.*; import org.springframework.util.*; | [
"com.impetus.ankush2",
"org.springframework.util"
] | com.impetus.ankush2; org.springframework.util; | 378,196 |
@ServiceMethod(returns = ReturnType.SINGLE)
public AppResourceInner update(
String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context) {
return updateAsync(resourceGroupName, serviceName, appName, appResource, context).block();
} | @ServiceMethod(returns = ReturnType.SINGLE) AppResourceInner function( String resourceGroupName, String serviceName, String appName, AppResourceInner appResource, Context context) { return updateAsync(resourceGroupName, serviceName, appName, appResource, context).block(); } | /**
* Operation to update an exiting App.
*
* @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
* from the Azure Resource Manager API or the portal.
* @param serviceName The name of the Service resource.
* @param appName The name of the App resource.
* @param appResource Parameters for the update operation.
* @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 app resource payload.
*/ | Operation to update an exiting App | update | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-appplatform/src/main/java/com/azure/resourcemanager/appplatform/implementation/AppsClientImpl.java",
"license": "mit",
"size": 93809
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.util.Context",
"com.azure.resourcemanager.appplatform.fluent.models.AppResourceInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.util.Context; import com.azure.resourcemanager.appplatform.fluent.models.AppResourceInner; | import com.azure.core.annotation.*; import com.azure.core.util.*; import com.azure.resourcemanager.appplatform.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 1,149,974 |
public FunctionSpec migrate(SdkComponents components) throws IOException {
return getSpec();
} | FunctionSpec function(SdkComponents components) throws IOException { return getSpec(); } | /**
* Build a new payload set in the context of the given {@link SdkComponents}, if applicable.
*
* <p>When re-serializing this transform, the ids reference in the rehydrated payload may
* conflict with those defined by the serialization context. In that case, the components must
* be re-registered and a new payload returned.
*/ | Build a new payload set in the context of the given <code>SdkComponents</code>, if applicable. When re-serializing this transform, the ids reference in the rehydrated payload may conflict with those defined by the serialization context. In that case, the components must be re-registered and a new payload returned | migrate | {
"repo_name": "iemejia/incubator-beam",
"path": "runners/core-construction-java/src/main/java/org/apache/beam/runners/core/construction/PTransformTranslation.java",
"license": "apache-2.0",
"size": 25077
} | [
"java.io.IOException",
"org.apache.beam.model.pipeline.v1.RunnerApi"
] | import java.io.IOException; import org.apache.beam.model.pipeline.v1.RunnerApi; | import java.io.*; import org.apache.beam.model.pipeline.v1.*; | [
"java.io",
"org.apache.beam"
] | java.io; org.apache.beam; | 852,385 |
@PublicEvolving
void emitWatermark(Watermark mark); | void emitWatermark(Watermark mark); | /**
* Emits the given {@link Watermark}. A Watermark of value {@code t} declares that no
* elements with a timestamp {@code t' <= t} will occur any more. If further such elements
* will be emitted, those elements are considered <i>late</i>.
*
* <p>This method is only relevant when running on {@link TimeCharacteristic#EventTime}. On
* {@link TimeCharacteristic#ProcessingTime},Watermarks will be ignored. On {@link
* TimeCharacteristic#IngestionTime}, the Watermarks will be replaced by the automatic
* ingestion time watermarks.
*
* @param mark The Watermark to emit
*/ | Emits the given <code>Watermark</code>. A Watermark of value t declares that no elements with a timestamp t' late. This method is only relevant when running on <code>TimeCharacteristic#EventTime</code>. On <code>TimeCharacteristic#ProcessingTime</code>,Watermarks will be ignored. On <code>TimeCharacteristic#IngestionTime</code>, the Watermarks will be replaced by the automatic ingestion time watermarks | emitWatermark | {
"repo_name": "rmetzger/flink",
"path": "flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/SourceFunction.java",
"license": "apache-2.0",
"size": 12092
} | [
"org.apache.flink.streaming.api.watermark.Watermark"
] | import org.apache.flink.streaming.api.watermark.Watermark; | import org.apache.flink.streaming.api.watermark.*; | [
"org.apache.flink"
] | org.apache.flink; | 231,548 |
public Date getDate() {
return new Date(timestamp * 1000L);
} | Date function() { return new Date(timestamp * 1000L); } | /**
* Gets the timestamp as a {@code Date} instance.
*
* @return the Date
*/ | Gets the timestamp as a Date instance | getDate | {
"repo_name": "sunnysuperman/commons",
"path": "src/main/java/com/github/sunnysuperman/commons/model/ObjectId.java",
"license": "apache-2.0",
"size": 14216
} | [
"java.util.Date"
] | import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 733,731 |
public final void delete(IContext context)
{
Core.delete(context, getMendixObject());
} | final void function(IContext context) { Core.delete(context, getMendixObject()); } | /**
* Delete the object using the specified context.
*/ | Delete the object using the specified context | delete | {
"repo_name": "mendix/MobileSlider",
"path": "test/javasource/profileservice/proxies/GetDisplayNameResponse.java",
"license": "apache-2.0",
"size": 5377
} | [
"com.mendix.core.Core",
"com.mendix.systemwideinterfaces.core.IContext"
] | import com.mendix.core.Core; import com.mendix.systemwideinterfaces.core.IContext; | import com.mendix.core.*; import com.mendix.systemwideinterfaces.core.*; | [
"com.mendix.core",
"com.mendix.systemwideinterfaces"
] | com.mendix.core; com.mendix.systemwideinterfaces; | 1,732,897 |
public void run() throws Exception {
BufferedReader inReader = new BufferedReader(new InputStreamReader(System.in));
while (true) {
// Print the very simple prompt.
System.out.println();
System.out.print("> ");
read(inReader.readLine().split("\\s+"));
}
} | void function() throws Exception { BufferedReader inReader = new BufferedReader(new InputStreamReader(System.in)); while (true) { System.out.println(); System.out.print(STR); read(inReader.readLine().split("\\s+")); } } | /**
* Create a shell for the user to send commands to clients.
*/ | Create a shell for the user to send commands to clients | run | {
"repo_name": "merlimat/pulsar",
"path": "pulsar-testclient/src/main/java/org/apache/pulsar/testclient/LoadSimulationController.java",
"license": "apache-2.0",
"size": 34775
} | [
"java.io.BufferedReader",
"java.io.InputStreamReader"
] | import java.io.BufferedReader; import java.io.InputStreamReader; | import java.io.*; | [
"java.io"
] | java.io; | 2,017,483 |
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<CheckNameResultInner> checkNameAvailabilityWithResponse(
String resourceGroupName,
String clusterName,
String databaseName,
ScriptCheckNameRequest scriptName,
Context context) {
return checkNameAvailabilityWithResponseAsync(resourceGroupName, clusterName, databaseName, scriptName, context)
.block();
} | @ServiceMethod(returns = ReturnType.SINGLE) Response<CheckNameResultInner> function( String resourceGroupName, String clusterName, String databaseName, ScriptCheckNameRequest scriptName, Context context) { return checkNameAvailabilityWithResponseAsync(resourceGroupName, clusterName, databaseName, scriptName, context) .block(); } | /**
* Checks that the script name is valid and is not already in use.
*
* @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 script.
* @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 the result returned from a check name availability request along with {@link Response}.
*/ | Checks that the script name is valid and is not already in use | checkNameAvailabilityWithResponse | {
"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.http.rest.Response",
"com.azure.core.util.Context",
"com.azure.resourcemanager.kusto.fluent.models.CheckNameResultInner",
"com.azure.resourcemanager.kusto.models.ScriptCheckNameRequest"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.kusto.fluent.models.CheckNameResultInner; import com.azure.resourcemanager.kusto.models.ScriptCheckNameRequest; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.kusto.fluent.models.*; import com.azure.resourcemanager.kusto.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 887,614 |
public void mouseReleased(MouseEvent e)
{
DesktopManager dm = getDesktopManager();
xOffset = 0;
yOffset = 0;
if (e.getSource() == frame && frame.isResizable())
dm.endResizingFrame(frame);
else if (e.getSource() == titlePane)
dm.endDraggingFrame(frame);
} | void function(MouseEvent e) { DesktopManager dm = getDesktopManager(); xOffset = 0; yOffset = 0; if (e.getSource() == frame && frame.isResizable()) dm.endResizingFrame(frame); else if (e.getSource() == titlePane) dm.endDraggingFrame(frame); } | /**
* This method is called when the mouse is released.
*
* @param e The MouseEvent.
*/ | This method is called when the mouse is released | mouseReleased | {
"repo_name": "aosm/gcc_40",
"path": "libjava/javax/swing/plaf/basic/BasicInternalFrameUI.java",
"license": "gpl-2.0",
"size": 44949
} | [
"java.awt.event.MouseEvent",
"javax.swing.DesktopManager"
] | import java.awt.event.MouseEvent; import javax.swing.DesktopManager; | import java.awt.event.*; import javax.swing.*; | [
"java.awt",
"javax.swing"
] | java.awt; javax.swing; | 1,097,964 |
List<PageId> getEnclosingFrames();
| List<PageId> getEnclosingFrames(); | /**
* PageIds of PageFrame
*
* @return
*/ | PageIds of PageFrame | getEnclosingFrames | {
"repo_name": "spMohanty/sigmah_svn_to_git_migration_test",
"path": "sigmah/src/main/java/org/sigmah/client/page/PageState.java",
"license": "gpl-3.0",
"size": 935
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,610,994 |
protected void startZKStandalone(int port, String dir) throws IOException,
InterruptedException {
LOG.info("Starting standalone ZooKeeper instance on port " + port);
zk = new ZKInProcessServer(port, dir);
zk.start();
} | void function(int port, String dir) throws IOException, InterruptedException { LOG.info(STR + port); zk = new ZKInProcessServer(port, dir); zk.start(); } | /**
* Initialises in standalone mode, creating an in-process ZK.
*/ | Initialises in standalone mode, creating an in-process ZK | startZKStandalone | {
"repo_name": "anuragphadke/Flume-Hive",
"path": "src/java/com/cloudera/flume/master/ZooKeeperService.java",
"license": "apache-2.0",
"size": 5071
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,828,173 |
@Bean
public ErrorProperties errorProperties(ServerProperties serverProperties) {
return serverProperties.getError();
} | ErrorProperties function(ServerProperties serverProperties) { return serverProperties.getError(); } | /**
* Construct a {@link ErrorProperties} with the current server properties.
*
* @param serverProperties Current server properties.
* @return A singleton {@link ErrorProperties} bean.
* @since 1.0.0
*/ | Construct a <code>ErrorProperties</code> with the current server properties | errorProperties | {
"repo_name": "cmateosl/rol-api",
"path": "src/main/java/es/esky/role/Application.java",
"license": "apache-2.0",
"size": 3034
} | [
"org.springframework.boot.autoconfigure.web.ErrorProperties",
"org.springframework.boot.autoconfigure.web.ServerProperties"
] | import org.springframework.boot.autoconfigure.web.ErrorProperties; import org.springframework.boot.autoconfigure.web.ServerProperties; | import org.springframework.boot.autoconfigure.web.*; | [
"org.springframework.boot"
] | org.springframework.boot; | 2,433,799 |
public static long copy(final InputStream is, final RandomAccessFile raf,
final long offset, long length, final LongRangeListener lrl,
final WriteListener wl) throws IOException {
if (length < 0) {
throw new IllegalArgumentException("Invalid byte count: " + length);
}
final byte buffer[] = new byte[DEFAULT_BUFFER_SIZE];
int bytesRead = 0;
long written = 0;
long filePosition = offset;
try {
while (length > 0) {
if (length < DEFAULT_BUFFER_SIZE) {
bytesRead = is.read(buffer, 0, (int) length);
} else {
bytesRead = is.read(buffer, 0, DEFAULT_BUFFER_SIZE);
}
if (bytesRead == -1) {
break;
}
length -= bytesRead;
synchronized (raf) {
raf.seek(filePosition);
raf.write(buffer, 0, bytesRead);
}
if (wl != null) {
wl.onBytesRead(bytesRead);
}
if (lrl != null) {
lrl.onRangeComplete(new LongRange(filePosition,
filePosition + bytesRead - 1));
}
filePosition += bytesRead;
written += bytesRead;
// LOG.debug("IoUtils now written: {}", written);
}
return written;
} catch (final IOException e) {
LOG.debug("Got IOException during copy", e);
throw e;
} catch (final RuntimeException e) {
LOG.warn("Runtime error", e);
throw e;
}
} | static long function(final InputStream is, final RandomAccessFile raf, final long offset, long length, final LongRangeListener lrl, final WriteListener wl) throws IOException { if (length < 0) { throw new IllegalArgumentException(STR + length); } final byte buffer[] = new byte[DEFAULT_BUFFER_SIZE]; int bytesRead = 0; long written = 0; long filePosition = offset; try { while (length > 0) { if (length < DEFAULT_BUFFER_SIZE) { bytesRead = is.read(buffer, 0, (int) length); } else { bytesRead = is.read(buffer, 0, DEFAULT_BUFFER_SIZE); } if (bytesRead == -1) { break; } length -= bytesRead; synchronized (raf) { raf.seek(filePosition); raf.write(buffer, 0, bytesRead); } if (wl != null) { wl.onBytesRead(bytesRead); } if (lrl != null) { lrl.onRangeComplete(new LongRange(filePosition, filePosition + bytesRead - 1)); } filePosition += bytesRead; written += bytesRead; } return written; } catch (final IOException e) { LOG.debug(STR, e); throw e; } catch (final RuntimeException e) { LOG.warn(STR, e); throw e; } } | /**
* Copy method for copying data from an {@link InputStream} to a
* {@link RandomAccessFile}.
*
* @param is The input data.
* @param raf The file to write to.
* @param offset The offset within the file to start writing at.
* @param length The number of bytes to copy.
* @return The number of bytes copied.
* @throws IOException If any IO error occurs.
*/ | Copy method for copying data from an <code>InputStream</code> to a <code>RandomAccessFile</code> | copy | {
"repo_name": "adamfisk/littleshoot-util",
"path": "src/main/java/org/littleshoot/util/IoUtils.java",
"license": "gpl-2.0",
"size": 9541
} | [
"java.io.IOException",
"java.io.InputStream",
"java.io.RandomAccessFile",
"org.apache.commons.lang.math.LongRange"
] | import java.io.IOException; import java.io.InputStream; import java.io.RandomAccessFile; import org.apache.commons.lang.math.LongRange; | import java.io.*; import org.apache.commons.lang.math.*; | [
"java.io",
"org.apache.commons"
] | java.io; org.apache.commons; | 1,440,498 |
public static SensorParams create(Supplier<Keys.Args> keySet, Object... values) {
return new SensorParams(keySet, values);
} | static SensorParams function(Supplier<Keys.Args> keySet, Object... values) { return new SensorParams(keySet, values); } | /**
* Factory method to create a {@code SensorParams} object which indicates
* information used to connect a {@link Sensor} to its source.
*
* @param keySet a Supplier yielding a particular set of String keys
* @param values the values correlated with the specified keys.
*
* @return a SensorParams configuration
*/ | Factory method to create a SensorParams object which indicates information used to connect a <code>Sensor</code> to its source | create | {
"repo_name": "user405/test",
"path": "src/main/java/org/numenta/nupic/network/sensor/SensorParams.java",
"license": "agpl-3.0",
"size": 4978
} | [
"java.util.function.Supplier"
] | import java.util.function.Supplier; | import java.util.function.*; | [
"java.util"
] | java.util; | 1,688,336 |
protected void startTraffic() {
if(trafficSrv == null) trafficSrv = new Intent(awareContext, Traffic.class);
awareContext.startService(trafficSrv);
} | void function() { if(trafficSrv == null) trafficSrv = new Intent(awareContext, Traffic.class); awareContext.startService(trafficSrv); } | /**
* Start traffic module
*/ | Start traffic module | startTraffic | {
"repo_name": "cluo29/com.aware.plugin.trying",
"path": "aware-core/src/main/java/com/aware/Aware.java",
"license": "apache-2.0",
"size": 76881
} | [
"android.content.Intent"
] | import android.content.Intent; | import android.content.*; | [
"android.content"
] | android.content; | 349,028 |
@NonNull
@SuppressWarnings("unused")
public String getTime(@NonNull final Context context) {
final StringBuilder sb = new StringBuilder();
if (getHour() > 0) {
if (getHour() == 1) {
sb.append(context.getString(R.string.label_interval_hour_singular));
} else {
sb.append(getHour()).append(" ").append(context.getString(R.string.label_interval_hour_plural));
}
}
if (getMinute() > 0) {
if (getMinute() == 1) {
sb.append(context.getString(R.string.label_interval_minute_singular));
} else {
sb.append(getMinute()).append(" ").append(context.getString(R.string.label_interval_hour_plural));
}
}
if (getSeconds() > 0) {
if (getSeconds() == 1) {
sb.append(context.getString(R.string.label_interval_second_singular));
} else {
sb.append(getSeconds()).append(" ").append(context.getString(R.string.label_interval_second_plural));
}
}
return sb.toString();
} | @SuppressWarnings(STR) String function(@NonNull final Context context) { final StringBuilder sb = new StringBuilder(); if (getHour() > 0) { if (getHour() == 1) { sb.append(context.getString(R.string.label_interval_hour_singular)); } else { sb.append(getHour()).append(" ").append(context.getString(R.string.label_interval_hour_plural)); } } if (getMinute() > 0) { if (getMinute() == 1) { sb.append(context.getString(R.string.label_interval_minute_singular)); } else { sb.append(getMinute()).append(" ").append(context.getString(R.string.label_interval_hour_plural)); } } if (getSeconds() > 0) { if (getSeconds() == 1) { sb.append(context.getString(R.string.label_interval_second_singular)); } else { sb.append(getSeconds()).append(" ").append(context.getString(R.string.label_interval_second_plural)); } } return sb.toString(); } | /**
* Gets the time string description using all the necessary representation Strings.
* Example 1 = 3683s --> 1 hour 1 minute 23 seconds.
* Example 2 = 189s --> 3 minutes 9 seconds.
*
* @param context of the calling method.
* @return {@link java.lang.String} with the long String representation.
*/ | Gets the time string description using all the necessary representation Strings. Example 1 = 3683s --> 1 hour 1 minute 23 seconds. Example 2 = 189s --> 3 minutes 9 seconds | getTime | {
"repo_name": "Sensirion/SmartGadget-Android",
"path": "app/src/main/java/com/sensirion/smartgadget/utils/TimeFormatter.java",
"license": "bsd-3-clause",
"size": 5378
} | [
"android.content.Context",
"android.support.annotation.NonNull"
] | import android.content.Context; import android.support.annotation.NonNull; | import android.content.*; import android.support.annotation.*; | [
"android.content",
"android.support"
] | android.content; android.support; | 248,838 |
@BeanTagAttribute(name="sourceCode")
public String getSourceCode() {
return sourceCode;
}
| @BeanTagAttribute(name=STR) String function() { return sourceCode; } | /**
* The text to render with syntax highlighting
*
* @return String
*/ | The text to render with syntax highlighting | getSourceCode | {
"repo_name": "ua-eas/ksd-kc5.2.1-rice2.3.6-ua",
"path": "rice-framework/krad-web-framework/src/main/java/org/kuali/rice/krad/uif/widget/SyntaxHighlighter.java",
"license": "apache-2.0",
"size": 4896
} | [
"org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute"
] | import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute; | import org.kuali.rice.krad.datadictionary.parse.*; | [
"org.kuali.rice"
] | org.kuali.rice; | 1,077,600 |
RemoteConnection con = RemotingContext.getRemoteConnection();
if (con != null) {
Collection<Principal> principals = new HashSet<>();
SecurityIdentity localIdentity = con.getSecurityIdentity();
if (localIdentity != null) {
final Principal principal = localIdentity.getPrincipal();
final String realm = principal instanceof RealmPrincipal ? ((RealmPrincipal) principal).getRealm() : null;
principals.add(new RealmUser(realm, principal.getName()));
for (String role : localIdentity.getRoles()) {
principals.add(new RealmGroup(role));
principals.add(new RealmRole(role));
}
return principals;
} else {
return Collections.emptySet();
}
}
return null;
}
/**
* Push a new {@link Principal} and Credential pair.
*
* This method is to be called before an EJB invocation is passed through it's security interceptor, at that point the
* Principal and Credential pair can be verified.
*
* Note: This method should be called from within a {@link PrivilegedAction}.
*
* @param principal - The alternative {@link Principal} to use in verification before the next EJB is called.
* @param credential - The credential to verify with the {@linl Principal} | RemoteConnection con = RemotingContext.getRemoteConnection(); if (con != null) { Collection<Principal> principals = new HashSet<>(); SecurityIdentity localIdentity = con.getSecurityIdentity(); if (localIdentity != null) { final Principal principal = localIdentity.getPrincipal(); final String realm = principal instanceof RealmPrincipal ? ((RealmPrincipal) principal).getRealm() : null; principals.add(new RealmUser(realm, principal.getName())); for (String role : localIdentity.getRoles()) { principals.add(new RealmGroup(role)); principals.add(new RealmRole(role)); } return principals; } else { return Collections.emptySet(); } } return null; } /** * Push a new {@link Principal} and Credential pair. * * This method is to be called before an EJB invocation is passed through it's security interceptor, at that point the * Principal and Credential pair can be verified. * * Note: This method should be called from within a {@link PrivilegedAction}. * * @param principal - The alternative {@link Principal} to use in verification before the next EJB is called. * @param credential - The credential to verify with the {@linl Principal} | /**
* Obtain a {@link Collection} containing the {@link Principal} instances for the user associated with the connection.
*
* Note: This method should be called from within a {@link PrivilegedAction}.
*
* @return The Collection of Principals for the user authenticated with the connection. An empty Collection will be returned
* of no user is associated with the connection, {@code null} will be returned if no connection is associated with
* the {@link Thread}
*/ | Obtain a <code>Collection</code> containing the <code>Principal</code> instances for the user associated with the connection. Note: This method should be called from within a <code>PrivilegedAction</code> | getConnectionPrincipals | {
"repo_name": "xasx/wildfly",
"path": "security/api/src/main/java/org/jboss/as/security/api/ConnectionSecurityContext.java",
"license": "lgpl-2.1",
"size": 5676
} | [
"java.security.Principal",
"java.util.Collection",
"java.util.Collections",
"java.util.HashSet",
"org.jboss.as.core.security.RealmGroup",
"org.jboss.as.core.security.RealmRole",
"org.jboss.as.core.security.RealmUser",
"org.jboss.as.core.security.api.RealmPrincipal",
"org.jboss.as.security.remoting.R... | import java.security.Principal; import java.util.Collection; import java.util.Collections; import java.util.HashSet; import org.jboss.as.core.security.RealmGroup; import org.jboss.as.core.security.RealmRole; import org.jboss.as.core.security.RealmUser; import org.jboss.as.core.security.api.RealmPrincipal; import org.jboss.as.security.remoting.RemoteConnection; import org.jboss.as.security.remoting.RemotingContext; import org.wildfly.security.auth.server.SecurityIdentity; | import java.security.*; import java.util.*; import org.jboss.as.core.security.*; import org.jboss.as.core.security.api.*; import org.jboss.as.security.remoting.*; import org.wildfly.security.auth.server.*; | [
"java.security",
"java.util",
"org.jboss.as",
"org.wildfly.security"
] | java.security; java.util; org.jboss.as; org.wildfly.security; | 27,546 |
public String[] getRoles(HttpServletRequest request) {
return new String[]{Constants.BLOG_CONTRIBUTOR_ROLE};
} | String[] function(HttpServletRequest request) { return new String[]{Constants.BLOG_CONTRIBUTOR_ROLE}; } | /**
* Gets a list of all roles that are allowed to access this action.
*
* @return an array of Strings representing role names
* @param request
*/ | Gets a list of all roles that are allowed to access this action | getRoles | {
"repo_name": "arshadalisoomro/pebble",
"path": "src/main/java/net/sourceforge/pebble/web/action/SaveCategoryAction.java",
"license": "bsd-3-clause",
"size": 4345
} | [
"javax.servlet.http.HttpServletRequest",
"net.sourceforge.pebble.Constants"
] | import javax.servlet.http.HttpServletRequest; import net.sourceforge.pebble.Constants; | import javax.servlet.http.*; import net.sourceforge.pebble.*; | [
"javax.servlet",
"net.sourceforge.pebble"
] | javax.servlet; net.sourceforge.pebble; | 2,868,740 |
@Ignore
@Test public void testVanityDriver() throws SQLException {
Properties info = new Properties();
Connection connection =
DriverManager.getConnection("jdbc:csv:", info);
connection.close();
} | @Test void function() throws SQLException { Properties info = new Properties(); Connection connection = DriverManager.getConnection(STR, info); connection.close(); } | /**
* Tests the vanity driver.
*/ | Tests the vanity driver | testVanityDriver | {
"repo_name": "arina-ielchiieva/calcite",
"path": "example/csv/src/test/java/org/apache/calcite/test/CsvTest.java",
"license": "apache-2.0",
"size": 37426
} | [
"java.sql.Connection",
"java.sql.DriverManager",
"java.sql.SQLException",
"java.util.Properties",
"org.junit.Test"
] | import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; import java.util.Properties; import org.junit.Test; | import java.sql.*; import java.util.*; import org.junit.*; | [
"java.sql",
"java.util",
"org.junit"
] | java.sql; java.util; org.junit; | 2,002,086 |
INDArray activate(boolean training, LayerWorkspaceMgr workspaceMgr); | INDArray activate(boolean training, LayerWorkspaceMgr workspaceMgr); | /**
* Perform forward pass and return the activations array with the last set input
*
* @param training training or test mode
* @param workspaceMgr Workspace manager
* @return the activation (layer output) of the last specified input. Note that the returned array should be placed
* in the {@link org.deeplearning4j.nn.workspace.ArrayType#ACTIVATIONS} workspace via the workspace manager
*/ | Perform forward pass and return the activations array with the last set input | activate | {
"repo_name": "RobAltena/deeplearning4j",
"path": "deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/nn/api/Layer.java",
"license": "apache-2.0",
"size": 8729
} | [
"org.deeplearning4j.nn.workspace.LayerWorkspaceMgr",
"org.nd4j.linalg.api.ndarray.INDArray"
] | import org.deeplearning4j.nn.workspace.LayerWorkspaceMgr; import org.nd4j.linalg.api.ndarray.INDArray; | import org.deeplearning4j.nn.workspace.*; import org.nd4j.linalg.api.ndarray.*; | [
"org.deeplearning4j.nn",
"org.nd4j.linalg"
] | org.deeplearning4j.nn; org.nd4j.linalg; | 124,501 |
public Observable<ServiceResponse<Page<LinkResourceFormatInner>>> listByHubNextSinglePageAsync(final String nextPageLink) {
if (nextPageLink == null) {
throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
} | Observable<ServiceResponse<Page<LinkResourceFormatInner>>> function(final String nextPageLink) { if (nextPageLink == null) { throw new IllegalArgumentException(STR); } | /**
* Gets all the links in the specified hub.
*
ServiceResponse<PageImpl<LinkResourceFormatInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<LinkResourceFormatInner> object wrapped in {@link ServiceResponse} if successful.
*/ | Gets all the links in the specified hub | listByHubNextSinglePageAsync | {
"repo_name": "martinsawicki/azure-sdk-for-java",
"path": "azure-mgmt-customerinsights/src/main/java/com/microsoft/azure/management/customerinsights/implementation/LinksInner.java",
"license": "mit",
"size": 39620
} | [
"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; | 2,130,580 |
public Node getParentNode()
{
return parent;
} | Node function() { return parent; } | /**
* <b>DOM L1</b>
* Returns the parent node, if one is known.
*/ | DOM L1 Returns the parent node, if one is known | getParentNode | {
"repo_name": "rhuitl/uClinux",
"path": "lib/classpath/gnu/xml/dom/DomNode.java",
"license": "gpl-2.0",
"size": 63148
} | [
"org.w3c.dom.Node"
] | import org.w3c.dom.Node; | import org.w3c.dom.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 2,200,093 |
IndexShardState state(); | IndexShardState state(); | /**
* Returns the latest internal shard state.
*/ | Returns the latest internal shard state | state | {
"repo_name": "sneivandt/elasticsearch",
"path": "core/src/main/java/org/elasticsearch/indices/cluster/IndicesClusterStateService.java",
"license": "apache-2.0",
"size": 45761
} | [
"org.elasticsearch.index.shard.IndexShardState"
] | import org.elasticsearch.index.shard.IndexShardState; | import org.elasticsearch.index.shard.*; | [
"org.elasticsearch.index"
] | org.elasticsearch.index; | 201,053 |
public String getEscapedDescription() {
return StringEscapeUtils.escapeHtml(description);
} | String function() { return StringEscapeUtils.escapeHtml(description); } | /**
* Gets the description attribute.
* @return Returns the description.
*/ | Gets the description attribute | getEscapedDescription | {
"repo_name": "vivantech/kc_fixes",
"path": "src/main/java/org/kuali/kra/bo/SponsorTerm.java",
"license": "apache-2.0",
"size": 5654
} | [
"org.apache.commons.lang.StringEscapeUtils"
] | import org.apache.commons.lang.StringEscapeUtils; | import org.apache.commons.lang.*; | [
"org.apache.commons"
] | org.apache.commons; | 2,560,013 |
private String toSeparatedString(List<String> stringList, char separator) {
StringBuffer result = new StringBuffer();
Iterator<String> it = stringList.iterator();
while (it.hasNext()) {
result.append(it.next());
if (it.hasNext()) {
result.append(separator);
}
}
return result.toString();
} | String function(List<String> stringList, char separator) { StringBuffer result = new StringBuffer(); Iterator<String> it = stringList.iterator(); while (it.hasNext()) { result.append(it.next()); if (it.hasNext()) { result.append(separator); } } return result.toString(); } | /**
* Concatenates the elements of the string list separated by the given separator character.<p>
*
* @param stringList the list
* @param separator the separator
*
* @return the concatenated string
*/ | Concatenates the elements of the string list separated by the given separator character | toSeparatedString | {
"repo_name": "alkacon/opencms-core",
"path": "src/org/opencms/search/CmsSearchParameters.java",
"license": "lgpl-2.1",
"size": 41833
} | [
"java.util.Iterator",
"java.util.List"
] | import java.util.Iterator; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 334,357 |
public List<BarcodeProduct> getBarcodeProducts(); | List<BarcodeProduct> function(); | /**
* Returns a list of products created by the user. Ordered by failed products,
* pending products, uploading products, and uploaded products.
*
* @return list of barcode products
*/ | Returns a list of products created by the user. Ordered by failed products, pending products, uploading products, and uploaded products | getBarcodeProducts | {
"repo_name": "z0lope0z/InstaWebsite",
"path": "app/src/main/java/com/lopefied/instawebsite/product/BarcodeProductService.java",
"license": "apache-2.0",
"size": 865
} | [
"com.lopefied.instawebsite.model.BarcodeProduct",
"java.util.List"
] | import com.lopefied.instawebsite.model.BarcodeProduct; import java.util.List; | import com.lopefied.instawebsite.model.*; import java.util.*; | [
"com.lopefied.instawebsite",
"java.util"
] | com.lopefied.instawebsite; java.util; | 1,458,501 |
public boolean validateScanDataEnterer_validateScanDataEntererTemplateId(ScanDataEnterer scanDataEnterer, DiagnosticChain diagnostics, Map<Object, Object> context) {
return scanDataEnterer.validateScanDataEntererTemplateId(diagnostics, context);
}
| boolean function(ScanDataEnterer scanDataEnterer, DiagnosticChain diagnostics, Map<Object, Object> context) { return scanDataEnterer.validateScanDataEntererTemplateId(diagnostics, context); } | /**
* Validates the validateScanDataEntererTemplateId constraint of '<em>Scan Data Enterer</em>'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | Validates the validateScanDataEntererTemplateId constraint of 'Scan Data Enterer'. | validateScanDataEnterer_validateScanDataEntererTemplateId | {
"repo_name": "drbgfc/mdht",
"path": "cda/deprecated/org.openhealthtools.mdht.uml.cda.ihe/src/org/openhealthtools/mdht/uml/cda/ihe/util/IHEValidator.java",
"license": "epl-1.0",
"size": 429642
} | [
"java.util.Map",
"org.eclipse.emf.common.util.DiagnosticChain",
"org.openhealthtools.mdht.uml.cda.ihe.ScanDataEnterer"
] | import java.util.Map; import org.eclipse.emf.common.util.DiagnosticChain; import org.openhealthtools.mdht.uml.cda.ihe.ScanDataEnterer; | import java.util.*; import org.eclipse.emf.common.util.*; import org.openhealthtools.mdht.uml.cda.ihe.*; | [
"java.util",
"org.eclipse.emf",
"org.openhealthtools.mdht"
] | java.util; org.eclipse.emf; org.openhealthtools.mdht; | 914,283 |
public String toSQLString(int tableSufix) throws SQLException
{
if(this.operator == null || this.operator.getOperator() == null)
{
throw new SQLException("Null operator in condition");
}
String newOperator = new String(operator.getOperator());
String newValue;
if(newOperator.equals(Operator.IS_NULL ) )
{
newOperator = Operator.IS ;
newValue = new String(Constants.NULL );
}
else if(newOperator.equals(Operator.IS_NOT_NULL ) )
{
newOperator = Operator.IS_NOT;
newValue = new String(Constants.NULL );
}
else
{
newValue = new String(value);
}
if(newOperator.equals(Operator.STARTS_WITH))
{
newValue = newValue+"%";
newOperator = Operator.LIKE;
}
else if(newOperator.equals(Operator.ENDS_WITH))
{
newValue = "%"+newValue;
newOperator = Operator.LIKE;
}
else if(newOperator.equals(Operator.CONTAINS))
{
newValue = "%"+newValue+"%";
newOperator = Operator.LIKE;
}
else if(newOperator.equals(Operator.EQUALS_CONDITION))
{
newOperator = Operator.EQUAL;
}
else if(newOperator.equals(Operator.NOT_EQUALS_CONDITION))
{
newOperator = Operator.NOT_EQUALS;
}
else if(newOperator.equals(Operator.IN_CONDITION))
{
newOperator = Operator.IN;
}
else if(newOperator.equals(Operator.NOT_IN_CONDITION))
{
newOperator = Operator.NOT_IN;
}
//Mandar : Execute for operator other (is null or is not null)
if(!(newOperator.equalsIgnoreCase(Operator.IS) || newOperator.equalsIgnoreCase(Operator.IS_NOT)) )
{
if (dataElement.getFieldType().equalsIgnoreCase(Constants.FIELD_TYPE_TINY_INT))
{
if (newValue.equalsIgnoreCase(Constants.CONDITION_VALUE_YES))
{
newValue = Constants.TINY_INT_VALUE_ONE;
}
else
{
newValue = Constants.TINY_INT_VALUE_ZERO;
}
}
if (dataElement.getFieldType().equalsIgnoreCase(Constants.FIELD_TYPE_VARCHAR)
|| dataElement.getFieldType().equalsIgnoreCase(Constants.FIELD_TYPE_TEXT)
|| dataElement.getFieldType().equalsIgnoreCase(Constants.FIELD_TYPE_TIMESTAMP_TIME))
{
if(dataElement.getField().equals("TISSUE_SITE") &&
(newOperator.equals(Operator.IN) || newOperator.equals(Operator.NOT_IN)))
{
newValue = CDEManager.getCDEManager().getSubValueStr(Constants.CDE_NAME_TISSUE_SITE,newValue);
}
else
{
newValue = checkQuotes(newValue );
newValue = "'" + newValue + "'";
//To make queries case insensitive, value is converted to
//UPPER(<<value>>)
if (dataElement.getFieldType().equalsIgnoreCase(Constants.FIELD_TYPE_VARCHAR)
|| dataElement.getFieldType().equalsIgnoreCase(Constants.FIELD_TYPE_TEXT))
{
newValue = Constants.UPPER +"("+newValue+")";
}
}
}
else if (dataElement.getFieldType().equalsIgnoreCase(Constants.FIELD_TYPE_DATE)
|| dataElement.getFieldType().equalsIgnoreCase(Constants.FIELD_TYPE_TIMESTAMP_DATE))
{
try
{
Date date = new Date();
date = Utility.parseDate(newValue);
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
String value = (calendar.get(Calendar.MONTH)+1) + "-"
+ calendar.get(Calendar.DAY_OF_MONTH) + "-"
+ calendar.get(Calendar.YEAR);
newValue = Variables.strTodateFunction
+ "('" + value + "','" + Variables.datePattern + "')";
}
catch (ParseException parseExp)
{
Logger.out.debug("Wrong Date Format");
}
}
}
//Aarti: To make queries case insensitive condition is converted to
//UPPER(<<fieldname>>) <<Operator>> UPPER(<<value>>)
//Mandar 28mar06: newValue checked for null before converting to uppercase.
//bug id: 1615
String dataElementString;
if(!newValue.equalsIgnoreCase(Constants.NULL) && (dataElement.getFieldType().equalsIgnoreCase(Constants.FIELD_TYPE_VARCHAR)
|| dataElement.getFieldType().equalsIgnoreCase(Constants.FIELD_TYPE_TEXT)))
{
dataElementString = dataElement.toUpperSQLString(tableSufix);
}
else
{
dataElementString = dataElement.toSQLString(tableSufix);
}
Logger.out.debug("---------->>>>>>>>>>>>>>>>>>>>... "+dataElementString
+ " "+ newOperator + " " + newValue.toString() + " ");
return new String(dataElementString
+ " "+ newOperator + " " + newValue.toString() + " ");
}
| String function(int tableSufix) throws SQLException { if(this.operator == null this.operator.getOperator() == null) { throw new SQLException(STR); } String newOperator = new String(operator.getOperator()); String newValue; if(newOperator.equals(Operator.IS_NULL ) ) { newOperator = Operator.IS ; newValue = new String(Constants.NULL ); } else if(newOperator.equals(Operator.IS_NOT_NULL ) ) { newOperator = Operator.IS_NOT; newValue = new String(Constants.NULL ); } else { newValue = new String(value); } if(newOperator.equals(Operator.STARTS_WITH)) { newValue = newValue+"%"; newOperator = Operator.LIKE; } else if(newOperator.equals(Operator.ENDS_WITH)) { newValue = "%"+newValue; newOperator = Operator.LIKE; } else if(newOperator.equals(Operator.CONTAINS)) { newValue = "%"+newValue+"%"; newOperator = Operator.LIKE; } else if(newOperator.equals(Operator.EQUALS_CONDITION)) { newOperator = Operator.EQUAL; } else if(newOperator.equals(Operator.NOT_EQUALS_CONDITION)) { newOperator = Operator.NOT_EQUALS; } else if(newOperator.equals(Operator.IN_CONDITION)) { newOperator = Operator.IN; } else if(newOperator.equals(Operator.NOT_IN_CONDITION)) { newOperator = Operator.NOT_IN; } if(!(newOperator.equalsIgnoreCase(Operator.IS) newOperator.equalsIgnoreCase(Operator.IS_NOT)) ) { if (dataElement.getFieldType().equalsIgnoreCase(Constants.FIELD_TYPE_TINY_INT)) { if (newValue.equalsIgnoreCase(Constants.CONDITION_VALUE_YES)) { newValue = Constants.TINY_INT_VALUE_ONE; } else { newValue = Constants.TINY_INT_VALUE_ZERO; } } if (dataElement.getFieldType().equalsIgnoreCase(Constants.FIELD_TYPE_VARCHAR) dataElement.getFieldType().equalsIgnoreCase(Constants.FIELD_TYPE_TEXT) dataElement.getFieldType().equalsIgnoreCase(Constants.FIELD_TYPE_TIMESTAMP_TIME)) { if(dataElement.getField().equals(STR) && (newOperator.equals(Operator.IN) newOperator.equals(Operator.NOT_IN))) { newValue = CDEManager.getCDEManager().getSubValueStr(Constants.CDE_NAME_TISSUE_SITE,newValue); } else { newValue = checkQuotes(newValue ); newValue = "'" + newValue + "'"; if (dataElement.getFieldType().equalsIgnoreCase(Constants.FIELD_TYPE_VARCHAR) dataElement.getFieldType().equalsIgnoreCase(Constants.FIELD_TYPE_TEXT)) { newValue = Constants.UPPER +"("+newValue+")"; } } } else if (dataElement.getFieldType().equalsIgnoreCase(Constants.FIELD_TYPE_DATE) dataElement.getFieldType().equalsIgnoreCase(Constants.FIELD_TYPE_TIMESTAMP_DATE)) { try { Date date = new Date(); date = Utility.parseDate(newValue); Calendar calendar = Calendar.getInstance(); calendar.setTime(date); String value = (calendar.get(Calendar.MONTH)+1) + "-" + calendar.get(Calendar.DAY_OF_MONTH) + "-" + calendar.get(Calendar.YEAR); newValue = Variables.strTodateFunction + "('" + value + "','" + Variables.datePattern + "')"; } catch (ParseException parseExp) { Logger.out.debug(STR); } } } String dataElementString; if(!newValue.equalsIgnoreCase(Constants.NULL) && (dataElement.getFieldType().equalsIgnoreCase(Constants.FIELD_TYPE_VARCHAR) dataElement.getFieldType().equalsIgnoreCase(Constants.FIELD_TYPE_TEXT))) { dataElementString = dataElement.toUpperSQLString(tableSufix); } else { dataElementString = dataElement.toSQLString(tableSufix); } Logger.out.debug(STR+dataElementString + " "+ newOperator + " " + newValue.toString() + " "); return new String(dataElementString + " "+ newOperator + " " + newValue.toString() + " "); } | /**
* Forms String of this condition object
* @param tableSufix sufix that needs to be appended to table names
* @return
* @throws SQLException
*/ | Forms String of this condition object | toSQLString | {
"repo_name": "NCIP/cab2b",
"path": "software/dependencies/commonpackage/HEAD_TAG_10_Jan_2007_RELEASE_BRANCH_FOR_V11/src/edu/wustl/common/query/Condition.java",
"license": "bsd-3-clause",
"size": 8998
} | [
"edu.wustl.common.cde.CDEManager",
"edu.wustl.common.util.Utility",
"edu.wustl.common.util.global.Constants",
"edu.wustl.common.util.global.Variables",
"edu.wustl.common.util.logger.Logger",
"java.sql.SQLException",
"java.text.ParseException",
"java.util.Calendar",
"java.util.Date"
] | import edu.wustl.common.cde.CDEManager; import edu.wustl.common.util.Utility; import edu.wustl.common.util.global.Constants; import edu.wustl.common.util.global.Variables; import edu.wustl.common.util.logger.Logger; import java.sql.SQLException; import java.text.ParseException; import java.util.Calendar; import java.util.Date; | import edu.wustl.common.cde.*; import edu.wustl.common.util.*; import edu.wustl.common.util.global.*; import edu.wustl.common.util.logger.*; import java.sql.*; import java.text.*; import java.util.*; | [
"edu.wustl.common",
"java.sql",
"java.text",
"java.util"
] | edu.wustl.common; java.sql; java.text; java.util; | 1,366,267 |
@Nonnull
public Builder minArgs (@Nonnegative final int nMinArgs)
{
ValueEnforcer.isGE0 (nMinArgs, "MinArgs");
m_nMinArgs = nMinArgs;
return this;
}
/**
* Set the maximum number of arguments that can be present. By default it is
* 0. The difference between minimum and maximum arguments are the optional
* arguments. If the option is repeatable, this value is per occurrence.
*
* @param nMaxArgs
* Number of maximum arguments. Must be ≥ 0 or
* {@link #INFINITE_VALUES} | Builder function (@Nonnegative final int nMinArgs) { ValueEnforcer.isGE0 (nMinArgs, STR); m_nMinArgs = nMinArgs; return this; } /** * Set the maximum number of arguments that can be present. By default it is * 0. The difference between minimum and maximum arguments are the optional * arguments. If the option is repeatable, this value is per occurrence. * * @param nMaxArgs * Number of maximum arguments. Must be ≥ 0 or * {@link #INFINITE_VALUES} | /**
* Set the minimum number of arguments that must be present. By default it
* is 0. This is the number of required arguments. If the option is
* repeatable, this value is per occurrence.
*
* @param nMinArgs
* Number of minimum arguments. Must be ≥ 0.
* @return this for chaining
*/ | Set the minimum number of arguments that must be present. By default it is 0. This is the number of required arguments. If the option is repeatable, this value is per occurrence | minArgs | {
"repo_name": "phax/ph-commons",
"path": "ph-cli/src/main/java/com/helger/cli/Option.java",
"license": "apache-2.0",
"size": 19582
} | [
"com.helger.commons.ValueEnforcer",
"javax.annotation.Nonnegative"
] | import com.helger.commons.ValueEnforcer; import javax.annotation.Nonnegative; | import com.helger.commons.*; import javax.annotation.*; | [
"com.helger.commons",
"javax.annotation"
] | com.helger.commons; javax.annotation; | 2,816,343 |
protected Object batchedValueFromRow(AbstractRecord row, ObjectLevelReadQuery query, CacheKey parentCacheKey) {
ReadQuery batchQuery = (ReadQuery)query.getProperty(this);
if (batchQuery == null) {
if (query.hasBatchReadAttributes()) {
Map<DatabaseMapping, ReadQuery> queries = query.getBatchFetchPolicy().getMappingQueries();
if (queries != null) {
batchQuery = queries.get(this);
}
}
if (batchQuery == null) {
batchQuery = prepareNestedBatchQuery(query);
batchQuery.setIsExecutionClone(true);
} else {
batchQuery = (ReadQuery)batchQuery.clone();
batchQuery.setIsExecutionClone(true);
}
query.setProperty(this, batchQuery);
}
return this.indirectionPolicy.valueFromBatchQuery(batchQuery, row, query, parentCacheKey);
} | Object function(AbstractRecord row, ObjectLevelReadQuery query, CacheKey parentCacheKey) { ReadQuery batchQuery = (ReadQuery)query.getProperty(this); if (batchQuery == null) { if (query.hasBatchReadAttributes()) { Map<DatabaseMapping, ReadQuery> queries = query.getBatchFetchPolicy().getMappingQueries(); if (queries != null) { batchQuery = queries.get(this); } } if (batchQuery == null) { batchQuery = prepareNestedBatchQuery(query); batchQuery.setIsExecutionClone(true); } else { batchQuery = (ReadQuery)batchQuery.clone(); batchQuery.setIsExecutionClone(true); } query.setProperty(this, batchQuery); } return this.indirectionPolicy.valueFromBatchQuery(batchQuery, row, query, parentCacheKey); } | /**
* INTERNAL:
* Retrieve the value through using batch reading.
* This executes a single query to read the target for all of the objects and stores the
* result of the batch query in the original query to allow the other objects to share the results.
*/ | Retrieve the value through using batch reading. This executes a single query to read the target for all of the objects and stores the result of the batch query in the original query to allow the other objects to share the results | batchedValueFromRow | {
"repo_name": "gameduell/eclipselink.runtime",
"path": "foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/mappings/ForeignReferenceMapping.java",
"license": "epl-1.0",
"size": 115540
} | [
"java.util.Map",
"org.eclipse.persistence.internal.identitymaps.CacheKey",
"org.eclipse.persistence.internal.sessions.AbstractRecord",
"org.eclipse.persistence.queries.ObjectLevelReadQuery",
"org.eclipse.persistence.queries.ReadQuery"
] | import java.util.Map; import org.eclipse.persistence.internal.identitymaps.CacheKey; import org.eclipse.persistence.internal.sessions.AbstractRecord; import org.eclipse.persistence.queries.ObjectLevelReadQuery; import org.eclipse.persistence.queries.ReadQuery; | import java.util.*; import org.eclipse.persistence.internal.identitymaps.*; import org.eclipse.persistence.internal.sessions.*; import org.eclipse.persistence.queries.*; | [
"java.util",
"org.eclipse.persistence"
] | java.util; org.eclipse.persistence; | 1,608,635 |
public void setDividerDrawable(Drawable divider) {
if (divider == mDivider) {
return;
}
mDivider = divider;
if (divider != null) {
mDividerWidth = divider.getIntrinsicWidth();
mDividerHeight = divider.getIntrinsicHeight();
} else {
mDividerWidth = 0;
mDividerHeight = 0;
}
setWillNotDraw(divider == null);
requestLayout();
} | void function(Drawable divider) { if (divider == mDivider) { return; } mDivider = divider; if (divider != null) { mDividerWidth = divider.getIntrinsicWidth(); mDividerHeight = divider.getIntrinsicHeight(); } else { mDividerWidth = 0; mDividerHeight = 0; } setWillNotDraw(divider == null); requestLayout(); } | /**
* Set a drawable to be used as a divider between items.
*
* @param divider Drawable that will divide each item.
*
* @see #setShowDividers(int)
*
* @attr ref android.R.styleable#LinearLayout_divider
*/ | Set a drawable to be used as a divider between items | setDividerDrawable | {
"repo_name": "syslover33/ctank",
"path": "java/android-sdk-linux_r24.4.1_src/sources/android-23/android/widget/LinearLayout.java",
"license": "gpl-3.0",
"size": 78991
} | [
"android.graphics.drawable.Drawable"
] | import android.graphics.drawable.Drawable; | import android.graphics.drawable.*; | [
"android.graphics"
] | android.graphics; | 943,304 |
public static void enableAutoSpell( JTextComponent text, boolean enable ){
enableAutoSpell( text, enable, null );
}
| static void function( JTextComponent text, boolean enable ){ enableAutoSpell( text, enable, null ); } | /**
* Enable or disable the auto spell checking feature (red zigzag line) for a text component.
* If you change the document then you need to reenable it.
*
* @param text
* the JTextComponent that should change
* @param enable
* true, enable the feature.
*/ | Enable or disable the auto spell checking feature (red zigzag line) for a text component. If you change the document then you need to reenable it | enableAutoSpell | {
"repo_name": "magsilva/jortho",
"path": "src/com/inet/jortho/SpellChecker.java",
"license": "gpl-2.0",
"size": 39770
} | [
"javax.swing.text.JTextComponent"
] | import javax.swing.text.JTextComponent; | import javax.swing.text.*; | [
"javax.swing"
] | javax.swing; | 561,441 |
public static HRegion createRegionAndWAL(final RegionInfo info, final Path rootDir,
final Configuration conf, final TableDescriptor htd, MobFileCache mobFileCache)
throws IOException {
HRegion region = createRegionAndWAL(info, rootDir, conf, htd, false);
region.setMobFileCache(mobFileCache);
region.initialize();
return region;
} | static HRegion function(final RegionInfo info, final Path rootDir, final Configuration conf, final TableDescriptor htd, MobFileCache mobFileCache) throws IOException { HRegion region = createRegionAndWAL(info, rootDir, conf, htd, false); region.setMobFileCache(mobFileCache); region.initialize(); return region; } | /**
* Create a region with it's own WAL. Be sure to call
* {@link HBaseTestingUtil#closeRegionAndWAL(HRegion)} to clean up all resources.
*/ | Create a region with it's own WAL. Be sure to call <code>HBaseTestingUtil#closeRegionAndWAL(HRegion)</code> to clean up all resources | createRegionAndWAL | {
"repo_name": "mahak/hbase",
"path": "hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtil.java",
"license": "apache-2.0",
"size": 151013
} | [
"java.io.IOException",
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.fs.Path",
"org.apache.hadoop.hbase.client.RegionInfo",
"org.apache.hadoop.hbase.client.TableDescriptor",
"org.apache.hadoop.hbase.mob.MobFileCache",
"org.apache.hadoop.hbase.regionserver.HRegion"
] | import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; import org.apache.hadoop.hbase.client.RegionInfo; import org.apache.hadoop.hbase.client.TableDescriptor; import org.apache.hadoop.hbase.mob.MobFileCache; import org.apache.hadoop.hbase.regionserver.HRegion; | import java.io.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.fs.*; import org.apache.hadoop.hbase.client.*; import org.apache.hadoop.hbase.mob.*; import org.apache.hadoop.hbase.regionserver.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 404,244 |
private void assertDeviceTestsPass(TestRunResult result) {
assertFalse(String.format("Failed to successfully run device tests for %s. Reason: %s",
result.getName(), result.getRunFailureMessage()), result.isRunFailure());
if (result.hasFailedTests()) {
StringBuilder errorBuilder = new StringBuilder("on-device tests failed:\n");
for (Map.Entry<TestIdentifier, TestResult> resultEntry :
result.getTestResults().entrySet()) {
if (!resultEntry.getValue().getStatus().equals(TestStatus.PASSED)) {
errorBuilder.append(resultEntry.getKey().toString());
errorBuilder.append(":\n");
errorBuilder.append(resultEntry.getValue().getStackTrace());
}
}
fail(errorBuilder.toString());
}
} | void function(TestRunResult result) { assertFalse(String.format(STR, result.getName(), result.getRunFailureMessage()), result.isRunFailure()); if (result.hasFailedTests()) { StringBuilder errorBuilder = new StringBuilder(STR); for (Map.Entry<TestIdentifier, TestResult> resultEntry : result.getTestResults().entrySet()) { if (!resultEntry.getValue().getStatus().equals(TestStatus.PASSED)) { errorBuilder.append(resultEntry.getKey().toString()); errorBuilder.append(":\n"); errorBuilder.append(resultEntry.getValue().getStackTrace()); } } fail(errorBuilder.toString()); } } | /**
* Helper method that checks that all tests in given result passed, and attempts to generate
* a meaningful error message if they failed.
*
* @param result
*/ | Helper method that checks that all tests in given result passed, and attempts to generate a meaningful error message if they failed | assertDeviceTestsPass | {
"repo_name": "s20121035/rk3288_android5.1_repo",
"path": "cts/hostsidetests/appsecurity/src/com/android/cts/appsecurity/KeySetHostTest.java",
"license": "gpl-3.0",
"size": 18396
} | [
"com.android.ddmlib.testrunner.TestIdentifier",
"com.android.ddmlib.testrunner.TestResult",
"com.android.ddmlib.testrunner.TestRunResult",
"java.util.Map"
] | import com.android.ddmlib.testrunner.TestIdentifier; import com.android.ddmlib.testrunner.TestResult; import com.android.ddmlib.testrunner.TestRunResult; import java.util.Map; | import com.android.ddmlib.testrunner.*; import java.util.*; | [
"com.android.ddmlib",
"java.util"
] | com.android.ddmlib; java.util; | 1,702,361 |
public static DataFlavor decodeDataFlavor(String nat)
throws ClassNotFoundException
{
String retval_str = SystemFlavorMap.decodeJavaMIMEType(nat);
return (retval_str != null)
? new DataFlavor(retval_str)
: null;
}
private static final class SoftCache<K, V> {
Map<K, SoftReference<LinkedHashSet<V>>> cache; | static DataFlavor function(String nat) throws ClassNotFoundException { String retval_str = SystemFlavorMap.decodeJavaMIMEType(nat); return (retval_str != null) ? new DataFlavor(retval_str) : null; } private static final class SoftCache<K, V> { Map<K, SoftReference<LinkedHashSet<V>>> cache; | /**
* Decodes a <code>String</code> native for use as a
* <code>DataFlavor</code>.
*
* @param nat the <code>String</code> to decode
* @return the decoded <code>DataFlavor</code>, or <code>null</code> if
* nat is not an encoded <code>String</code> native
*/ | Decodes a <code>String</code> native for use as a <code>DataFlavor</code> | decodeDataFlavor | {
"repo_name": "shun634501730/java_source_cn",
"path": "src_en/java/awt/datatransfer/SystemFlavorMap.java",
"license": "apache-2.0",
"size": 51189
} | [
"java.lang.ref.SoftReference",
"java.util.LinkedHashSet",
"java.util.Map"
] | import java.lang.ref.SoftReference; import java.util.LinkedHashSet; import java.util.Map; | import java.lang.ref.*; import java.util.*; | [
"java.lang",
"java.util"
] | java.lang; java.util; | 978,070 |
private Table createMainTable (final PresentationObject content) {
final Table mainTable = new Table();
mainTable.setCellpadding (getCellpadding ());
mainTable.setCellspacing (getCellspacing ());
mainTable.setWidth (Table.HUNDRED_PERCENT);
mainTable.setColumns (1);
mainTable.setRowColor (1, getHeaderColor ());
mainTable.setRowAlignment(1, Table.HORIZONTAL_ALIGN_CENTER) ;
mainTable.add (getSmallHeader (localize (TERMINATEMEMBERSHIP_KEY,
TERMINATEMEMBERSHIP_DEFAULT)),
1, 1);
mainTable.add (content, 1, 2);
return mainTable;
}
| Table function (final PresentationObject content) { final Table mainTable = new Table(); mainTable.setCellpadding (getCellpadding ()); mainTable.setCellspacing (getCellspacing ()); mainTable.setWidth (Table.HUNDRED_PERCENT); mainTable.setColumns (1); mainTable.setRowColor (1, getHeaderColor ()); mainTable.setRowAlignment(1, Table.HORIZONTAL_ALIGN_CENTER) ; mainTable.add (getSmallHeader (localize (TERMINATEMEMBERSHIP_KEY, TERMINATEMEMBERSHIP_DEFAULT)), 1, 1); mainTable.add (content, 1, 2); return mainTable; } | /**
* Returns a styled table with content placed properly
*
* @param content the page unique content
* @return Table to add to output
*/ | Returns a styled table with content placed properly | createMainTable | {
"repo_name": "idega/platform2",
"path": "src/se/idega/idegaweb/commune/school/presentation/TerminateClassMembership.java",
"license": "gpl-3.0",
"size": 27129
} | [
"com.idega.presentation.PresentationObject",
"com.idega.presentation.Table"
] | import com.idega.presentation.PresentationObject; import com.idega.presentation.Table; | import com.idega.presentation.*; | [
"com.idega.presentation"
] | com.idega.presentation; | 1,504,833 |
@Bean
@Conditional(InsightsSAMLBeanInitializationCondition.class)
public SAMLProcessingFilter samlWebSSOProcessingFilter() throws Exception {
SAMLProcessingFilter samlWebSSOProcessingFilter = new SAMLProcessingFilter();
samlWebSSOProcessingFilter.setAuthenticationManager(super.authenticationManager());
samlWebSSOProcessingFilter.setAuthenticationSuccessHandler(successRedirectHandler());
samlWebSSOProcessingFilter.setAuthenticationFailureHandler(authenticationFailureHandler());
samlWebSSOProcessingFilter.setFilterProcessesUrl("/saml/SSO");
return samlWebSSOProcessingFilter;
} | @Conditional(InsightsSAMLBeanInitializationCondition.class) SAMLProcessingFilter function() throws Exception { SAMLProcessingFilter samlWebSSOProcessingFilter = new SAMLProcessingFilter(); samlWebSSOProcessingFilter.setAuthenticationManager(super.authenticationManager()); samlWebSSOProcessingFilter.setAuthenticationSuccessHandler(successRedirectHandler()); samlWebSSOProcessingFilter.setAuthenticationFailureHandler(authenticationFailureHandler()); samlWebSSOProcessingFilter.setFilterProcessesUrl(STR); return samlWebSSOProcessingFilter; } | /**
* Used to initialize WebSSOProcessingFilter which can redirect saml/login
* request to /saml/SSO
*
* @return
* @throws Exception
*/ | Used to initialize WebSSOProcessingFilter which can redirect saml/login request to /saml/SSO | samlWebSSOProcessingFilter | {
"repo_name": "CognizantOneDevOps/Insights",
"path": "PlatformService/src/main/java/com/cognizant/devops/platformservice/security/config/saml/InsightsSecurityConfigurationAdapterSAML.java",
"license": "apache-2.0",
"size": 26210
} | [
"org.springframework.context.annotation.Conditional",
"org.springframework.security.saml.SAMLProcessingFilter"
] | import org.springframework.context.annotation.Conditional; import org.springframework.security.saml.SAMLProcessingFilter; | import org.springframework.context.annotation.*; import org.springframework.security.saml.*; | [
"org.springframework.context",
"org.springframework.security"
] | org.springframework.context; org.springframework.security; | 2,607,881 |
interface WithEnabled {
WithCreate withEnabled(Boolean enabled);
}
interface WithCreate extends Creatable<ActivityLogAlertResource>, Resource.DefinitionWithTags<WithCreate>, DefinitionStages.WithDescription, DefinitionStages.WithEnabled {
}
}
interface Update extends Appliable<ActivityLogAlertResource>, Resource.UpdateWithTags<Update>, UpdateStages.WithEnabled {
} | interface WithEnabled { WithCreate withEnabled(Boolean enabled); } interface WithCreate extends Creatable<ActivityLogAlertResource>, Resource.DefinitionWithTags<WithCreate>, DefinitionStages.WithDescription, DefinitionStages.WithEnabled { } } interface Update extends Appliable<ActivityLogAlertResource>, Resource.UpdateWithTags<Update>, UpdateStages.WithEnabled { } | /**
* Specifies enabled.
* @param enabled Indicates whether this activity log alert is enabled. If an activity log alert is not enabled, then none of its actions will be activated
* @return the next definition stage
*/ | Specifies enabled | withEnabled | {
"repo_name": "navalev/azure-sdk-for-java",
"path": "sdk/monitor/mgmt-v2017_03_01_preview/src/main/java/com/microsoft/azure/management/monitor/v2017_03_01_preview/ActivityLogAlertResource.java",
"license": "mit",
"size": 6270
} | [
"com.microsoft.azure.arm.model.Appliable",
"com.microsoft.azure.arm.model.Creatable",
"com.microsoft.azure.arm.resources.models.Resource"
] | import com.microsoft.azure.arm.model.Appliable; import com.microsoft.azure.arm.model.Creatable; import com.microsoft.azure.arm.resources.models.Resource; | import com.microsoft.azure.arm.model.*; import com.microsoft.azure.arm.resources.models.*; | [
"com.microsoft.azure"
] | com.microsoft.azure; | 1,512,585 |
@Bean
public HandlerExceptionResolver handlerExceptionResolver() {
List<HandlerExceptionResolver> exceptionResolvers = new ArrayList<HandlerExceptionResolver>();
configureHandlerExceptionResolvers(exceptionResolvers);
if (exceptionResolvers.isEmpty()) {
addDefaultHandlerExceptionResolvers(exceptionResolvers);
}
HandlerExceptionResolverComposite composite = new HandlerExceptionResolverComposite();
composite.setOrder(0);
composite.setExceptionResolvers(exceptionResolvers);
return composite;
}
/**
* Override this method to configure the list of
* {@link HandlerExceptionResolver}s to use. Adding resolvers to the list
* turns off the default resolvers that would otherwise be registered by
* default. Also see {@link #addDefaultHandlerExceptionResolvers(List)} | HandlerExceptionResolver function() { List<HandlerExceptionResolver> exceptionResolvers = new ArrayList<HandlerExceptionResolver>(); configureHandlerExceptionResolvers(exceptionResolvers); if (exceptionResolvers.isEmpty()) { addDefaultHandlerExceptionResolvers(exceptionResolvers); } HandlerExceptionResolverComposite composite = new HandlerExceptionResolverComposite(); composite.setOrder(0); composite.setExceptionResolvers(exceptionResolvers); return composite; } /** * Override this method to configure the list of * {@link HandlerExceptionResolver}s to use. Adding resolvers to the list * turns off the default resolvers that would otherwise be registered by * default. Also see {@link #addDefaultHandlerExceptionResolvers(List)} | /**
* Returns a {@link HandlerExceptionResolverComposite} containing a list
* of exception resolvers obtained either through
* {@link #configureHandlerExceptionResolvers(List)} or through
* {@link #addDefaultHandlerExceptionResolvers(List)}.
* <p><strong>Note:</strong> This method cannot be made final due to CGLib
* constraints. Rather than overriding it, consider overriding
* {@link #configureHandlerExceptionResolvers(List)}, which allows
* providing a list of resolvers.
*/ | Returns a <code>HandlerExceptionResolverComposite</code> containing a list of exception resolvers obtained either through <code>#configureHandlerExceptionResolvers(List)</code> or through <code>#addDefaultHandlerExceptionResolvers(List)</code>. Note: This method cannot be made final due to CGLib constraints. Rather than overriding it, consider overriding <code>#configureHandlerExceptionResolvers(List)</code>, which allows providing a list of resolvers | handlerExceptionResolver | {
"repo_name": "qobel/esoguproject",
"path": "spring-framework/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/WebMvcConfigurationSupport.java",
"license": "apache-2.0",
"size": 35035
} | [
"java.util.ArrayList",
"java.util.List",
"org.springframework.web.servlet.HandlerExceptionResolver",
"org.springframework.web.servlet.handler.HandlerExceptionResolverComposite"
] | import java.util.ArrayList; import java.util.List; import org.springframework.web.servlet.HandlerExceptionResolver; import org.springframework.web.servlet.handler.HandlerExceptionResolverComposite; | import java.util.*; import org.springframework.web.servlet.*; import org.springframework.web.servlet.handler.*; | [
"java.util",
"org.springframework.web"
] | java.util; org.springframework.web; | 1,135,411 |
public OCStackResult doBootstrap() {
if (null == configurationListener) {
Log.e(LOG_TAG, "doBootstrap: listener not set!");
return OCStackResult.OC_STACK_LISTENER_NOT_SET;
}
OCStackResult result;
int ordinal = nativeDoBootstrap();
result = OCStackResult.conversion(ordinal);
return result;
}
// ******** JNI UTILITY FUNCTIONS **********// | OCStackResult function() { if (null == configurationListener) { Log.e(LOG_TAG, STR); return OCStackResult.OC_STACK_LISTENER_NOT_SET; } OCStackResult result; int ordinal = nativeDoBootstrap(); result = OCStackResult.conversion(ordinal); return result; } | /**
* API for bootstrapping system configuration parameters from a bootstrap
* server.
* <p>
* Listener should be set using setConfigurationListener API.
* <p>
* Listener IConfigurationListener::onBootStrapCallback will be notified
* when the response arrives.
*
* @return OCStackResult - OC_STACK_OK on success, otherwise a failure error
* code.
*/ | API for bootstrapping system configuration parameters from a bootstrap server. Listener should be set using setConfigurationListener API. Listener IConfigurationListener::onBootStrapCallback will be notified when the response arrives | doBootstrap | {
"repo_name": "kadasaikumar/iotivity-1.2.1",
"path": "service/things-manager/sdk/java/src/org/iotivity/service/tm/ThingsConfiguration.java",
"license": "gpl-3.0",
"size": 11516
} | [
"android.util.Log"
] | import android.util.Log; | import android.util.*; | [
"android.util"
] | android.util; | 1,771,145 |
public Document getDocument() {
return getDOM().getOwnerDocument();
} | Document function() { return getDOM().getOwnerDocument(); } | /**
* PUBLIC:
* Return the document.
*/ | Return the document | getDocument | {
"repo_name": "RallySoftware/eclipselink.runtime",
"path": "foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/oxm/record/DOMRecord.java",
"license": "epl-1.0",
"size": 29768
} | [
"org.w3c.dom.Document"
] | import org.w3c.dom.Document; | import org.w3c.dom.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 2,560,939 |
public ConditionBase createCondition() {
logOverride("condition", condition);
condition = new NestedCondition();
return condition;
} | ConditionBase function() { logOverride(STR, condition); condition = new NestedCondition(); return condition; } | /**
* Add a condition element.
* @return <code>ConditionBase</code>.
* @since Ant 1.6.2
*/ | Add a condition element | createCondition | {
"repo_name": "BIORIMP/biorimp",
"path": "BIO-RIMP/test_data/code/antapache/src/main/org/apache/tools/ant/taskdefs/optional/testing/Funtest.java",
"license": "gpl-2.0",
"size": 17946
} | [
"org.apache.tools.ant.taskdefs.condition.ConditionBase"
] | import org.apache.tools.ant.taskdefs.condition.ConditionBase; | import org.apache.tools.ant.taskdefs.condition.*; | [
"org.apache.tools"
] | org.apache.tools; | 513,973 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.