method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
sequence
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
sequence
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public Timestamp getUpdated(); public static final String COLUMNNAME_UpdatedBy = "UpdatedBy";
Timestamp function(); public static final String COLUMNNAME_UpdatedBy = STR;
/** Get Updated. * Date this record was updated */
Get Updated. Date this record was updated
getUpdated
{ "repo_name": "geneos/adempiere", "path": "base/src/org/compiere/model/I_GL_FundRestriction.java", "license": "gpl-2.0", "size": 5303 }
[ "java.sql.Timestamp" ]
import java.sql.Timestamp;
import java.sql.*;
[ "java.sql" ]
java.sql;
2,269,493
public void setItemLabelPadding(RectangleInsets padding) { if (padding == null) { throw new IllegalArgumentException("Null 'padding' argument."); } this.itemLabelPadding = padding; notifyListeners(new TitleChangeEvent(this)); }
void function(RectangleInsets padding) { if (padding == null) { throw new IllegalArgumentException(STR); } this.itemLabelPadding = padding; notifyListeners(new TitleChangeEvent(this)); }
/** * Sets the padding used for the item labels in the legend. * * @param padding the padding (<code>null</code> not permitted). */
Sets the padding used for the item labels in the legend
setItemLabelPadding
{ "repo_name": "fluidware/Eastwood-Charts", "path": "source/org/jfree/chart/title/LegendTitle.java", "license": "lgpl-2.1", "size": 22438 }
[ "org.jfree.chart.event.TitleChangeEvent", "org.jfree.ui.RectangleInsets" ]
import org.jfree.chart.event.TitleChangeEvent; import org.jfree.ui.RectangleInsets;
import org.jfree.chart.event.*; import org.jfree.ui.*;
[ "org.jfree.chart", "org.jfree.ui" ]
org.jfree.chart; org.jfree.ui;
1,859,189
return (ComplexDataType) fixture; }
return (ComplexDataType) fixture; }
/** * Returns the fixture for this Complex Data Type test case. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
Returns the fixture for this Complex Data Type test case.
getFixture
{ "repo_name": "adbrucker/SecureBPMN", "path": "designer/src/org.activiti.designer.model.tests/src/org/eclipse/bpmn2/tests/ComplexDataTypeTest.java", "license": "apache-2.0", "size": 1204 }
[ "org.eclipse.bpmn2.ComplexDataType" ]
import org.eclipse.bpmn2.ComplexDataType;
import org.eclipse.bpmn2.*;
[ "org.eclipse.bpmn2" ]
org.eclipse.bpmn2;
417,061
static boolean validSwitchChild(SwitchRetained sw, NodeRetained node) { int whichChild = sw.whichChild; if (whichChild == Switch.CHILD_NONE) { return false; } if (whichChild == Switch.CHILD_ALL) { return true; } ArrayList children = sw.children; if (whichChild >= 0) { // most common case return (children.get(whichChild) == node); } // Switch.CHILD_MASK for (int i=children.size()-1; i >=0; i--) { if (sw.childMask.get(i) && (children.get(i) == node)) { return true; } } return false; }
static boolean validSwitchChild(SwitchRetained sw, NodeRetained node) { int whichChild = sw.whichChild; if (whichChild == Switch.CHILD_NONE) { return false; } if (whichChild == Switch.CHILD_ALL) { return true; } ArrayList children = sw.children; if (whichChild >= 0) { return (children.get(whichChild) == node); } for (int i=children.size()-1; i >=0; i--) { if (sw.childMask.get(i) && (children.get(i) == node)) { return true; } } return false; }
/** * Determinte if nodeR is a valid child to render for * Switch Node swR. */
Determinte if nodeR is a valid child to render for Switch Node swR
validSwitchChild
{ "repo_name": "danteinforno/j3d-core", "path": "src/classes/share/javax/media/j3d/GroupRetained.java", "license": "gpl-2.0", "size": 97190 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
1,703,678
static void checkRemove(boolean canRemove) { checkState(canRemove, "no calls to next() since the last call to remove()"); }
static void checkRemove(boolean canRemove) { checkState(canRemove, STR); }
/** * Precondition tester for {@code Iterator.remove()} that throws an exception with a consistent * error message. */
Precondition tester for Iterator.remove() that throws an exception with a consistent error message
checkRemove
{ "repo_name": "10xEngineer/My-Wallet-Android", "path": "src/com/google/common/collect/Iterators.java", "license": "gpl-3.0", "size": 48447 }
[ "com.google.common.base.Preconditions" ]
import com.google.common.base.Preconditions;
import com.google.common.base.*;
[ "com.google.common" ]
com.google.common;
1,201,223
public Integer createOrderAndInvoice(OrderWS order) throws SessionInternalError { Integer orderId = doCreateOrder(order, true).getId(); InvoiceDTO invoice = doCreateInvoice(orderId); return invoice == null ? null : invoice.getId(); }
Integer function(OrderWS order) throws SessionInternalError { Integer orderId = doCreateOrder(order, true).getId(); InvoiceDTO invoice = doCreateInvoice(orderId); return invoice == null ? null : invoice.getId(); }
/** * Creates the given Order in jBilling, generates an Invoice for the same. * Returns the generated Invoice ID */
Creates the given Order in jBilling, generates an Invoice for the same. Returns the generated Invoice ID
createOrderAndInvoice
{ "repo_name": "tarique313/nBilling", "path": "src/java/com/sapienter/jbilling/server/util/WebServicesSessionSpringBean.java", "license": "agpl-3.0", "size": 119293 }
[ "com.sapienter.jbilling.common.SessionInternalError", "com.sapienter.jbilling.server.invoice.db.InvoiceDTO", "com.sapienter.jbilling.server.order.OrderWS" ]
import com.sapienter.jbilling.common.SessionInternalError; import com.sapienter.jbilling.server.invoice.db.InvoiceDTO; import com.sapienter.jbilling.server.order.OrderWS;
import com.sapienter.jbilling.common.*; import com.sapienter.jbilling.server.invoice.db.*; import com.sapienter.jbilling.server.order.*;
[ "com.sapienter.jbilling" ]
com.sapienter.jbilling;
274,199
public BufferedImage loadImage (String path) { if (StringUtil.isBlank(path)) { return null; } File imgpath = null; try { // First try for a localized image. String localeStr = Locale.getDefault().getLanguage(); imgpath = _app.getLocalPath(path.replace(".", "_" + localeStr + ".")); return ImageIO.read(imgpath); } catch (IOException ioe) { // No biggie, we'll try the generic one. } // If that didn't work, try a generic one. try { imgpath = _app.getLocalPath(path); return ImageIO.read(imgpath); } catch (IOException ioe2) { log.warning("Failed to load image", "path", imgpath, "error", ioe2); return null; } }
BufferedImage function (String path) { if (StringUtil.isBlank(path)) { return null; } File imgpath = null; try { String localeStr = Locale.getDefault().getLanguage(); imgpath = _app.getLocalPath(path.replace(".", "_" + localeStr + ".")); return ImageIO.read(imgpath); } catch (IOException ioe) { } try { imgpath = _app.getLocalPath(path); return ImageIO.read(imgpath); } catch (IOException ioe2) { log.warning(STR, "path", imgpath, "error", ioe2); return null; } }
/** * Load the image at the path. Before trying the exact path/file specified we will look to see * if we can find a localized version by sticking a _<language> in front of the "." in the * filename. */
Load the image at the path. Before trying the exact path/file specified we will look to see if we can find a localized version by sticking a _ in front of the "." in the filename
loadImage
{ "repo_name": "makkus/getdown", "path": "src/main/java/com/threerings/getdown/launcher/Getdown.java", "license": "bsd-2-clause", "size": 47633 }
[ "com.samskivert.util.StringUtil", "java.awt.image.BufferedImage", "java.io.File", "java.io.IOException", "java.util.Locale", "javax.imageio.ImageIO" ]
import com.samskivert.util.StringUtil; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import java.util.Locale; import javax.imageio.ImageIO;
import com.samskivert.util.*; import java.awt.image.*; import java.io.*; import java.util.*; import javax.imageio.*;
[ "com.samskivert.util", "java.awt", "java.io", "java.util", "javax.imageio" ]
com.samskivert.util; java.awt; java.io; java.util; javax.imageio;
459,600
public boolean contains(JComponent a, int b, int c) { boolean returnValue = ((ComponentUI) (uis.elementAt(0))).contains(a,b,c); for (int i = 1; i < uis.size(); i++) { ((ComponentUI) (uis.elementAt(i))).contains(a,b,c); } return returnValue; }
boolean function(JComponent a, int b, int c) { boolean returnValue = ((ComponentUI) (uis.elementAt(0))).contains(a,b,c); for (int i = 1; i < uis.size(); i++) { ((ComponentUI) (uis.elementAt(i))).contains(a,b,c); } return returnValue; }
/** * Invokes the <code>contains</code> method on each UI handled by this object. * * @return the value obtained from the first UI, which is * the UI obtained from the default <code>LookAndFeel</code> */
Invokes the <code>contains</code> method on each UI handled by this object
contains
{ "repo_name": "isaacl/openjdk-jdk", "path": "src/share/classes/javax/swing/plaf/multi/MultiMenuItemUI.java", "license": "gpl-2.0", "size": 7675 }
[ "javax.swing.JComponent", "javax.swing.plaf.ComponentUI" ]
import javax.swing.JComponent; import javax.swing.plaf.ComponentUI;
import javax.swing.*; import javax.swing.plaf.*;
[ "javax.swing" ]
javax.swing;
2,612,336
public void finishOrder(Order order) { order.setStatus(OrderStatus.FINISHED); em.merge(order); mailer.mailOrder(order); }
void function(Order order) { order.setStatus(OrderStatus.FINISHED); em.merge(order); mailer.mailOrder(order); }
/** * Finish the given order and update the data. * @param order */
Finish the given order and update the data
finishOrder
{ "repo_name": "wesleyegberto/javaee_projects", "path": "ToyShop-Faces/src/main/java/com/github/wesleyegberto/toyshop/business/order/boundary/OrderManager.java", "license": "mit", "size": 1654 }
[ "com.github.wesleyegberto.toyshop.business.order.entity.Order", "com.github.wesleyegberto.toyshop.business.order.entity.OrderStatus" ]
import com.github.wesleyegberto.toyshop.business.order.entity.Order; import com.github.wesleyegberto.toyshop.business.order.entity.OrderStatus;
import com.github.wesleyegberto.toyshop.business.order.entity.*;
[ "com.github.wesleyegberto" ]
com.github.wesleyegberto;
993,666
public List<Pair<User, Number>> getLoginTimesPerMemberWithoutZeros() { final List<Pair<User, Number>> result = getLoginTimesPerMember(); final List<Number> loginTimes = getListLoginTimes(); final int index = loginTimes.indexOf(new Integer(0)); return result.subList(0, index); }
List<Pair<User, Number>> function() { final List<Pair<User, Number>> result = getLoginTimesPerMember(); final List<Number> loginTimes = getListLoginTimes(); final int index = loginTimes.indexOf(new Integer(0)); return result.subList(0, index); }
/** * gets a list with <code>Pair</code>s, where the first element of each pair is the member id, and the second element is the number of times that * member logged in. Same as <code>getLoginTimesPerMember</code> except that this list has the zero results skipped, as needed by the top ten. * @return a list with member id's and login times. */
gets a list with <code>Pair</code>s, where the first element of each pair is the member id, and the second element is the number of times that member logged in. Same as <code>getLoginTimesPerMember</code> except that this list has the zero results skipped, as needed by the top ten
getLoginTimesPerMemberWithoutZeros
{ "repo_name": "mateli/OpenCyclos", "path": "src/main/java/nl/strohalm/cyclos/services/stats/activity/LoginTimesPerMemberStats.java", "license": "gpl-2.0", "size": 3690 }
[ "java.util.List", "nl.strohalm.cyclos.entities.access.User", "nl.strohalm.cyclos.utils.Pair" ]
import java.util.List; import nl.strohalm.cyclos.entities.access.User; import nl.strohalm.cyclos.utils.Pair;
import java.util.*; import nl.strohalm.cyclos.entities.access.*; import nl.strohalm.cyclos.utils.*;
[ "java.util", "nl.strohalm.cyclos" ]
java.util; nl.strohalm.cyclos;
2,707,805
private void getNextPacketIfRequired(int numBytes) throws IOException { if ((this.buffer == null) || ((this.pos + numBytes) > this.buffer.length)) { getNextPacketFromServer(); } }
void function(int numBytes) throws IOException { if ((this.buffer == null) ((this.pos + numBytes) > this.buffer.length)) { getNextPacketFromServer(); } }
/** * Determines if another packet needs to be read from the server to be able * to read numBytes from the stream. * * @param numBytes * the number of bytes to be read * * @throws IOException * if an I/O error occors. */
Determines if another packet needs to be read from the server to be able to read numBytes from the stream
getNextPacketIfRequired
{ "repo_name": "ac2cz/FoxTelem", "path": "lib/mysql-connector-java-8.0.13/src/main/protocol-impl/java/com/mysql/cj/protocol/a/CompressedInputStream.java", "license": "gpl-3.0", "size": 9409 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,577,385
public static void removeMaxResults(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdf2go.model.node.Node value) { Base.remove(model, instanceResource, MAXRESULTS, value); }
static void function(Model model, org.ontoware.rdf2go.model.node.Resource instanceResource, org.ontoware.rdf2go.model.node.Node value) { Base.remove(model, instanceResource, MAXRESULTS, value); }
/** * Removes a value of property MaxResults as an RDF2Go node * * @param model * an RDF2Go model * @param resource * an RDF2Go resource * @param value * the value to be removed * * [Generated from RDFReactor template rule #remove1static] */
Removes a value of property MaxResults as an RDF2Go node
removeMaxResults
{ "repo_name": "m0ep/master-thesis", "path": "source/apis/rdf2go/rdf2go-sioc-services/src/main/java/org/rdfs/sioc/services/Service.java", "license": "mit", "size": 80965 }
[ "org.ontoware.rdf2go.model.Model", "org.ontoware.rdfreactor.runtime.Base" ]
import org.ontoware.rdf2go.model.Model; import org.ontoware.rdfreactor.runtime.Base;
import org.ontoware.rdf2go.model.*; import org.ontoware.rdfreactor.runtime.*;
[ "org.ontoware.rdf2go", "org.ontoware.rdfreactor" ]
org.ontoware.rdf2go; org.ontoware.rdfreactor;
2,349,207
private Node makeAssignmentExprNode() { Node decl = IR.exprResult( IR.assign( NodeUtil.newQName( compiler, namespace, firstNode , namespace), createNamespaceLiteral())); decl.putBooleanProp(Node.IS_NAMESPACE, true); if (candidateDefinition == null) { decl.getFirstChild().setJSDocInfo(NodeUtil.createConstantJsDoc()); } checkState(isNamespacePlaceholder(decl)); setSourceInfo(decl); return decl; }
Node function() { Node decl = IR.exprResult( IR.assign( NodeUtil.newQName( compiler, namespace, firstNode , namespace), createNamespaceLiteral())); decl.putBooleanProp(Node.IS_NAMESPACE, true); if (candidateDefinition == null) { decl.getFirstChild().setJSDocInfo(NodeUtil.createConstantJsDoc()); } checkState(isNamespacePlaceholder(decl)); setSourceInfo(decl); return decl; }
/** * Creates a dotted namespace assignment expression * (e.g. <code>foo.bar = {};</code>). */
Creates a dotted namespace assignment expression (e.g. <code>foo.bar = {};</code>)
makeAssignmentExprNode
{ "repo_name": "MatrixFrog/closure-compiler", "path": "src/com/google/javascript/jscomp/ProcessClosurePrimitives.java", "license": "apache-2.0", "size": 57419 }
[ "com.google.common.base.Preconditions", "com.google.javascript.rhino.IR", "com.google.javascript.rhino.Node" ]
import com.google.common.base.Preconditions; import com.google.javascript.rhino.IR; import com.google.javascript.rhino.Node;
import com.google.common.base.*; import com.google.javascript.rhino.*;
[ "com.google.common", "com.google.javascript" ]
com.google.common; com.google.javascript;
1,011,871
// set up the test data set ArrayList<Double> data = new ArrayList<Double>(); data.add(1.0); data.add(3.0); data.add(6.0); ArrrayListDataPoints temp = new ArrrayListDataPoints(data, ValueDisplayType.firstNumberOnly); // test getSum Assert.assertTrue(temp.getSum() == 10); // test getSumExceptLast, Assert.assertTrue(temp.getSumExceptLast() == 4); // test toString Assert.assertEquals("1.0, 3.0, 6.0", temp.toString()); // test compareTo using firstNumberOnly ArrayList<Double> data2 = new ArrayList<Double>(); data2.add(1.0); data2.add(3.0); data2.add(6.0); ArrrayListDataPoints temp2 = new ArrrayListDataPoints(data2, ValueDisplayType.firstNumberOnly); Assert.assertTrue(temp.compareTo(temp2) == 0); data2 = new ArrayList<Double>(); data2.add(3.0); data2.add(1.0); data2.add(6.0); temp2 = new ArrrayListDataPoints(data2, ValueDisplayType.firstNumberOnly); Assert.assertTrue(temp.compareTo(temp2) == -1); // test compareTo using sumExceptLastNumber temp.setDataSortingType(ValueDisplayType.sumExceptLastNumber); temp2.setDataSortingType(ValueDisplayType.sumExceptLastNumber); Assert.assertTrue(temp.compareTo(temp2) == 0); data2 = new ArrayList<Double>(); data2.add(3.0); data2.add(6.0); data2.add(1.0); temp2.setData(data2); Assert.assertTrue(temp.compareTo(temp2) == -1); // test compareTo using sumOfNumbers temp.setDataSortingType(ValueDisplayType.sumOfNumbers); temp2.setDataSortingType(ValueDisplayType.sumOfNumbers); Assert.assertTrue(temp.compareTo(temp2) == 0); data2 = new ArrayList<Double>(); data2.add(3.0); data2.add(5.0); data2.add(1.0); temp2.setData(data2); Assert.assertTrue(temp.compareTo(temp2) == 1); }
ArrayList<Double> data = new ArrayList<Double>(); data.add(1.0); data.add(3.0); data.add(6.0); ArrrayListDataPoints temp = new ArrrayListDataPoints(data, ValueDisplayType.firstNumberOnly); Assert.assertTrue(temp.getSum() == 10); Assert.assertTrue(temp.getSumExceptLast() == 4); Assert.assertEquals(STR, temp.toString()); ArrayList<Double> data2 = new ArrayList<Double>(); data2.add(1.0); data2.add(3.0); data2.add(6.0); ArrrayListDataPoints temp2 = new ArrrayListDataPoints(data2, ValueDisplayType.firstNumberOnly); Assert.assertTrue(temp.compareTo(temp2) == 0); data2 = new ArrayList<Double>(); data2.add(3.0); data2.add(1.0); data2.add(6.0); temp2 = new ArrrayListDataPoints(data2, ValueDisplayType.firstNumberOnly); Assert.assertTrue(temp.compareTo(temp2) == -1); temp.setDataSortingType(ValueDisplayType.sumExceptLastNumber); temp2.setDataSortingType(ValueDisplayType.sumExceptLastNumber); Assert.assertTrue(temp.compareTo(temp2) == 0); data2 = new ArrayList<Double>(); data2.add(3.0); data2.add(6.0); data2.add(1.0); temp2.setData(data2); Assert.assertTrue(temp.compareTo(temp2) == -1); temp.setDataSortingType(ValueDisplayType.sumOfNumbers); temp2.setDataSortingType(ValueDisplayType.sumOfNumbers); Assert.assertTrue(temp.compareTo(temp2) == 0); data2 = new ArrayList<Double>(); data2.add(3.0); data2.add(5.0); data2.add(1.0); temp2.setData(data2); Assert.assertTrue(temp.compareTo(temp2) == 1); }
/** * Tests the ArrrayListDataPoints class and the methods getSum, * getSumExceptLast, toString and compareTo. * * @throws Exception */
Tests the ArrrayListDataPoints class and the methods getSum, getSumExceptLast, toString and compareTo
testArrrayListDataPoints
{ "repo_name": "nikgoodley-ibboost/jsparklines", "path": "src/test/java/no/uib/jsparklines/test/data/ArrrayListDataPointsTest.java", "license": "apache-2.0", "size": 2647 }
[ "java.util.ArrayList", "junit.framework.Assert", "no.uib.jsparklines.data.ArrrayListDataPoints", "no.uib.jsparklines.renderers.JSparklinesArrayListBarChartTableCellRenderer" ]
import java.util.ArrayList; import junit.framework.Assert; import no.uib.jsparklines.data.ArrrayListDataPoints; import no.uib.jsparklines.renderers.JSparklinesArrayListBarChartTableCellRenderer;
import java.util.*; import junit.framework.*; import no.uib.jsparklines.data.*; import no.uib.jsparklines.renderers.*;
[ "java.util", "junit.framework", "no.uib.jsparklines" ]
java.util; junit.framework; no.uib.jsparklines;
2,853,175
public void updateLog(final StringBuffer pBuff) { if (pBuff != null) { mBuffer = pBuff; String text = pBuff.toString(); if (!text.isEmpty()) { mEnable = true; if (mTextView != null) { mTextView.setVisibility(View.VISIBLE); mTextView.setText(Html.fromHtml(text), TextView.BufferType.SPANNABLE); } }
void function(final StringBuffer pBuff) { if (pBuff != null) { mBuffer = pBuff; String text = pBuff.toString(); if (!text.isEmpty()) { mEnable = true; if (mTextView != null) { mTextView.setVisibility(View.VISIBLE); mTextView.setText(Html.fromHtml(text), TextView.BufferType.SPANNABLE); } }
/** * Method used to update log * * @param pBuff */
Method used to update log
updateLog
{ "repo_name": "wathika/EMV-NFC-Paycard-Enrollment", "path": "sample/src/main/java/com/github/devnied/emvnfccard/fragment/viewPager/impl/LogFragment.java", "license": "apache-2.0", "size": 4893 }
[ "android.text.Html", "android.view.View", "android.widget.TextView" ]
import android.text.Html; import android.view.View; import android.widget.TextView;
import android.text.*; import android.view.*; import android.widget.*;
[ "android.text", "android.view", "android.widget" ]
android.text; android.view; android.widget;
2,505,270
public void testEquals() { ArcDialFrame f1 = new ArcDialFrame(); ArcDialFrame f2 = new ArcDialFrame(); assertTrue(f1.equals(f2)); // background paint f1.setBackgroundPaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f, Color.yellow)); assertFalse(f1.equals(f2)); f2.setBackgroundPaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f, Color.yellow)); assertTrue(f1.equals(f2)); // foreground paint f1.setForegroundPaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f, Color.yellow)); assertFalse(f1.equals(f2)); f2.setForegroundPaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f, Color.yellow)); assertTrue(f1.equals(f2)); // stroke f1.setStroke(new BasicStroke(1.1f)); assertFalse(f1.equals(f2)); f2.setStroke(new BasicStroke(1.1f)); assertTrue(f1.equals(f2)); // inner radius f1.setInnerRadius(0.11); assertFalse(f1.equals(f2)); f2.setInnerRadius(0.11); assertTrue(f1.equals(f2)); // outer radius f1.setOuterRadius(0.88); assertFalse(f1.equals(f2)); f2.setOuterRadius(0.88); assertTrue(f1.equals(f2)); // startAngle f1.setStartAngle(99); assertFalse(f1.equals(f2)); f2.setStartAngle(99); assertTrue(f1.equals(f2)); // extent f1.setExtent(33); assertFalse(f1.equals(f2)); f2.setExtent(33); assertTrue(f1.equals(f2)); // check an inherited attribute f1.setVisible(false); assertFalse(f1.equals(f2)); f2.setVisible(false); assertTrue(f1.equals(f2)); }
void function() { ArcDialFrame f1 = new ArcDialFrame(); ArcDialFrame f2 = new ArcDialFrame(); assertTrue(f1.equals(f2)); f1.setBackgroundPaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f, Color.yellow)); assertFalse(f1.equals(f2)); f2.setBackgroundPaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f, Color.yellow)); assertTrue(f1.equals(f2)); f1.setForegroundPaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f, Color.yellow)); assertFalse(f1.equals(f2)); f2.setForegroundPaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f, Color.yellow)); assertTrue(f1.equals(f2)); f1.setStroke(new BasicStroke(1.1f)); assertFalse(f1.equals(f2)); f2.setStroke(new BasicStroke(1.1f)); assertTrue(f1.equals(f2)); f1.setInnerRadius(0.11); assertFalse(f1.equals(f2)); f2.setInnerRadius(0.11); assertTrue(f1.equals(f2)); f1.setOuterRadius(0.88); assertFalse(f1.equals(f2)); f2.setOuterRadius(0.88); assertTrue(f1.equals(f2)); f1.setStartAngle(99); assertFalse(f1.equals(f2)); f2.setStartAngle(99); assertTrue(f1.equals(f2)); f1.setExtent(33); assertFalse(f1.equals(f2)); f2.setExtent(33); assertTrue(f1.equals(f2)); f1.setVisible(false); assertFalse(f1.equals(f2)); f2.setVisible(false); assertTrue(f1.equals(f2)); }
/** * Confirm that the equals method can distinguish all the required fields. */
Confirm that the equals method can distinguish all the required fields
testEquals
{ "repo_name": "JSansalone/JFreeChart", "path": "tests/org/jfree/chart/plot/dial/junit/ArcDialFrameTests.java", "license": "lgpl-2.1", "size": 6164 }
[ "java.awt.BasicStroke", "java.awt.Color", "java.awt.GradientPaint", "org.jfree.chart.plot.dial.ArcDialFrame" ]
import java.awt.BasicStroke; import java.awt.Color; import java.awt.GradientPaint; import org.jfree.chart.plot.dial.ArcDialFrame;
import java.awt.*; import org.jfree.chart.plot.dial.*;
[ "java.awt", "org.jfree.chart" ]
java.awt; org.jfree.chart;
2,560,974
private boolean scrollToChildRect(Rect rect, boolean immediate) { final int delta = computeScrollDeltaToGetChildRectOnScreen(rect); final boolean scroll = delta != 0; if (scroll) { if (immediate) { if (mHorizontal) { scrollBy(delta, 0); } else { scrollBy(0, delta); } } else { if (mHorizontal) { smoothScrollBy(delta, 0); } else { smoothScrollBy(0, delta); } } } return scroll; }
boolean function(Rect rect, boolean immediate) { final int delta = computeScrollDeltaToGetChildRectOnScreen(rect); final boolean scroll = delta != 0; if (scroll) { if (immediate) { if (mHorizontal) { scrollBy(delta, 0); } else { scrollBy(0, delta); } } else { if (mHorizontal) { smoothScrollBy(delta, 0); } else { smoothScrollBy(0, delta); } } } return scroll; }
/** * If rect is off screen, scroll just enough to get it (or at least the * first screen size chunk of it) on screen. * * @param rect The rectangle. * @param immediate True to scroll immediately without animation * @return true if scrolling was performed */
If rect is off screen, scroll just enough to get it (or at least the first screen size chunk of it) on screen
scrollToChildRect
{ "repo_name": "rex-xxx/mt6572_x201", "path": "packages/apps/Browser/src/com/android/browser/view/ScrollerView.java", "license": "gpl-2.0", "size": 70418 }
[ "android.graphics.Rect" ]
import android.graphics.Rect;
import android.graphics.*;
[ "android.graphics" ]
android.graphics;
511,586
TableStatistics getTableStatistics(Session session, TableHandle tableHandle, Constraint<ColumnHandle> constraint);
TableStatistics getTableStatistics(Session session, TableHandle tableHandle, Constraint<ColumnHandle> constraint);
/** * Return statistics for specified table for given filtering contraint. */
Return statistics for specified table for given filtering contraint
getTableStatistics
{ "repo_name": "wagnermarkd/presto", "path": "presto-main/src/main/java/com/facebook/presto/metadata/Metadata.java", "license": "apache-2.0", "size": 10968 }
[ "com.facebook.presto.Session", "com.facebook.presto.spi.ColumnHandle", "com.facebook.presto.spi.Constraint", "com.facebook.presto.spi.statistics.TableStatistics" ]
import com.facebook.presto.Session; import com.facebook.presto.spi.ColumnHandle; import com.facebook.presto.spi.Constraint; import com.facebook.presto.spi.statistics.TableStatistics;
import com.facebook.presto.*; import com.facebook.presto.spi.*; import com.facebook.presto.spi.statistics.*;
[ "com.facebook.presto" ]
com.facebook.presto;
2,180,887
Progress getProgress();
Progress getProgress();
/** Gets the Progress object; this has a float (0.0 - 1.0) * indicating the bytes processed by the iterator so far */
Gets the Progress object; this has a float (0.0 - 1.0) indicating the bytes processed by the iterator so far
getProgress
{ "repo_name": "amirsojoodi/tez", "path": "tez-runtime-library/src/main/java/org/apache/tez/runtime/library/common/sort/impl/TezRawKeyValueIterator.java", "license": "apache-2.0", "size": 2485 }
[ "org.apache.hadoop.util.Progress" ]
import org.apache.hadoop.util.Progress;
import org.apache.hadoop.util.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
2,005,269
protected List<URL> scrapePackageList() throws IOException { List<URL> urls = new ArrayList<>(); URL getPackages = new URL(getBase(), Ckan.API_LIST); JsonObject obj = makeJsonRequest(getPackages); if (!obj.getBoolean(Ckan.SUCCESS)) { return urls; } JsonArray arr = obj.getJsonArray(Ckan.RESULT); for (JsonString str : arr.getValuesAs(JsonString.class)) { urls.add(ckanDatasetURL(str.getString())); } return urls; }
List<URL> function() throws IOException { List<URL> urls = new ArrayList<>(); URL getPackages = new URL(getBase(), Ckan.API_LIST); JsonObject obj = makeJsonRequest(getPackages); if (!obj.getBoolean(Ckan.SUCCESS)) { return urls; } JsonArray arr = obj.getJsonArray(Ckan.RESULT); for (JsonString str : arr.getValuesAs(JsonString.class)) { urls.add(ckanDatasetURL(str.getString())); } return urls; }
/** * Get the list of all the CKAN packages (DCAT Dataset). * * @return List of URLs * @throws IOException */
Get the list of all the CKAN packages (DCAT Dataset)
scrapePackageList
{ "repo_name": "Fedict/dcattools", "path": "scrapers/src/main/java/be/fedict/dcat/scrapers/CkanJson.java", "license": "bsd-2-clause", "size": 17143 }
[ "java.io.IOException", "java.util.ArrayList", "java.util.List", "javax.json.JsonArray", "javax.json.JsonObject", "javax.json.JsonString" ]
import java.io.IOException; import java.util.ArrayList; import java.util.List; import javax.json.JsonArray; import javax.json.JsonObject; import javax.json.JsonString;
import java.io.*; import java.util.*; import javax.json.*;
[ "java.io", "java.util", "javax.json" ]
java.io; java.util; javax.json;
810,658
public List<CanvassingDetail> findAll() throws CanvassingDetailDaoException;
List<CanvassingDetail> function() throws CanvassingDetailDaoException;
/** * Returns all rows from the canvassing_detail table that match the criteria ''. */
Returns all rows from the canvassing_detail table that match the criteria ''
findAll
{ "repo_name": "rmage/gnvc-ims", "path": "src/java/com/app/wms/engine/db/dao/CanvassingDetailDao.java", "license": "lgpl-3.0", "size": 4812 }
[ "com.app.wms.engine.db.dto.CanvassingDetail", "com.app.wms.engine.db.exceptions.CanvassingDetailDaoException", "java.util.List" ]
import com.app.wms.engine.db.dto.CanvassingDetail; import com.app.wms.engine.db.exceptions.CanvassingDetailDaoException; import java.util.List;
import com.app.wms.engine.db.dto.*; import com.app.wms.engine.db.exceptions.*; import java.util.*;
[ "com.app.wms", "java.util" ]
com.app.wms; java.util;
241,271
@Test(timeout = 90000) public void testManyWatchersWhenNoConnection() throws Exception { int count = 3; List<MyWatcher> wList = new ArrayList<MyWatcher>(count); MyWatcher w; String path = "/node"; // Child watcher for (int i = 0; i < count; i++) { String nodePath = path + i; zk1.create(nodePath, null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); nodePath += "/"; } for (int i = 0; i < count; i++) { String nodePath = path + i; w = new MyWatcher(path + i, 2); wList.add(w); LOG.info("Adding child watcher {} on path {}", new Object[] { w, nodePath }); zk1.getChildren(nodePath, w); nodePath += "/"; } Assert.assertEquals("Failed to add watchers!", count, zk1 .getChildWatches().size()); // Data watcher for (int i = 0; i < count; i++) { String nodePath = path + i; w = wList.get(i); LOG.info("Adding data watcher {} on path {}", new Object[] { w, nodePath }); zk1.getData(nodePath, w, null); nodePath += "/"; } Assert.assertEquals("Failed to add watchers!", count, zk1 .getDataWatches().size()); stopServer(); for (int i = 0; i < count; i++) { final MyWatcher watcher = wList.get(i); removeWatches(zk1, path + i, watcher, WatcherType.Any, true, Code.OK); Assert.assertTrue("Didn't remove watcher", watcher.matches()); } Assert.assertEquals("Didn't remove watch references!", 0, zk1 .getChildWatches().size()); Assert.assertEquals("Didn't remove watch references!", 0, zk1 .getDataWatches().size()); }
@Test(timeout = 90000) void function() throws Exception { int count = 3; List<MyWatcher> wList = new ArrayList<MyWatcher>(count); MyWatcher w; String path = "/node"; for (int i = 0; i < count; i++) { String nodePath = path + i; zk1.create(nodePath, null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); nodePath += "/"; } for (int i = 0; i < count; i++) { String nodePath = path + i; w = new MyWatcher(path + i, 2); wList.add(w); LOG.info(STR, new Object[] { w, nodePath }); zk1.getChildren(nodePath, w); nodePath += "/"; } Assert.assertEquals(STR, count, zk1 .getChildWatches().size()); for (int i = 0; i < count; i++) { String nodePath = path + i; w = wList.get(i); LOG.info(STR, new Object[] { w, nodePath }); zk1.getData(nodePath, w, null); nodePath += "/"; } Assert.assertEquals(STR, count, zk1 .getDataWatches().size()); stopServer(); for (int i = 0; i < count; i++) { final MyWatcher watcher = wList.get(i); removeWatches(zk1, path + i, watcher, WatcherType.Any, true, Code.OK); Assert.assertTrue(STR, watcher.matches()); } Assert.assertEquals(STR, 0, zk1 .getChildWatches().size()); Assert.assertEquals(STR, 0, zk1 .getDataWatches().size()); }
/** * Test verifies removal of many watchers locally when no connection and * WatcherType#Any. Also, verifies internal watchManager datastructures */
Test verifies removal of many watchers locally when no connection and WatcherType#Any. Also, verifies internal watchManager datastructures
testManyWatchersWhenNoConnection
{ "repo_name": "rkhmelichek/zookeeper", "path": "src/java/test/org/apache/zookeeper/RemoveWatchesTest.java", "license": "apache-2.0", "size": 51637 }
[ "java.util.ArrayList", "java.util.List", "org.apache.zookeeper.KeeperException", "org.apache.zookeeper.Watcher", "org.apache.zookeeper.ZooDefs", "org.junit.Assert", "org.junit.Test" ]
import java.util.ArrayList; import java.util.List; import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.Watcher; import org.apache.zookeeper.ZooDefs; import org.junit.Assert; import org.junit.Test;
import java.util.*; import org.apache.zookeeper.*; import org.junit.*;
[ "java.util", "org.apache.zookeeper", "org.junit" ]
java.util; org.apache.zookeeper; org.junit;
1,833,891
private void doCheckAndCreatePattern(final List<Cell> pattern) { if (pattern.size() < mMinWiredDots) { mLockPatternView.setDisplayMode(DisplayMode.Wrong); mTextInfo.setText(getResources().getQuantityString( R.plurals.alp_42447968_pmsg_connect_x_dots, mMinWiredDots, mMinWiredDots)); mLockPatternView.postDelayed(mLockPatternViewReloader, DELAY_TIME_TO_RELOAD_LOCK_PATTERN_VIEW); return; } if (getIntent().hasExtra(EXTRA_PATTERN)) { new LoadingDialog<Void, Void, Boolean>(this, false) {
void function(final List<Cell> pattern) { if (pattern.size() < mMinWiredDots) { mLockPatternView.setDisplayMode(DisplayMode.Wrong); mTextInfo.setText(getResources().getQuantityString( R.plurals.alp_42447968_pmsg_connect_x_dots, mMinWiredDots, mMinWiredDots)); mLockPatternView.postDelayed(mLockPatternViewReloader, DELAY_TIME_TO_RELOAD_LOCK_PATTERN_VIEW); return; } if (getIntent().hasExtra(EXTRA_PATTERN)) { new LoadingDialog<Void, Void, Boolean>(this, false) {
/** * Checks and creates the pattern. * * @param pattern * the current pattern of lock pattern view. */
Checks and creates the pattern
doCheckAndCreatePattern
{ "repo_name": "air01a/raspadmin-android", "path": "lockpattern/src/com/haibison/android/lockpattern/LockPatternActivity.java", "license": "gpl-2.0", "size": 38138 }
[ "com.haibison.android.lockpattern.util.LoadingDialog", "com.haibison.android.lockpattern.widget.LockPatternView", "java.util.List" ]
import com.haibison.android.lockpattern.util.LoadingDialog; import com.haibison.android.lockpattern.widget.LockPatternView; import java.util.List;
import com.haibison.android.lockpattern.util.*; import com.haibison.android.lockpattern.widget.*; import java.util.*;
[ "com.haibison.android", "java.util" ]
com.haibison.android; java.util;
1,880,476
protected OAuth20RefreshToken generateRefreshToken(final AccessTokenRequestDataHolder responseHolder, final OAuth20AccessToken accessToken) { LOGGER.debug("Creating refresh token for [{}]", responseHolder.getService()); val refreshToken = this.refreshTokenFactory.create(responseHolder.getService(), responseHolder.getAuthentication(), responseHolder.getTicketGrantingTicket(), responseHolder.getScopes(), responseHolder.getRegisteredService().getClientId(), accessToken.getId(), responseHolder.getClaims()); LOGGER.debug("Adding refresh token [{}] to the registry", refreshToken); addTicketToRegistry(refreshToken, responseHolder.getTicketGrantingTicket()); if (responseHolder.isExpireOldRefreshToken()) { expireOldRefreshToken(responseHolder); } return refreshToken; }
OAuth20RefreshToken function(final AccessTokenRequestDataHolder responseHolder, final OAuth20AccessToken accessToken) { LOGGER.debug(STR, responseHolder.getService()); val refreshToken = this.refreshTokenFactory.create(responseHolder.getService(), responseHolder.getAuthentication(), responseHolder.getTicketGrantingTicket(), responseHolder.getScopes(), responseHolder.getRegisteredService().getClientId(), accessToken.getId(), responseHolder.getClaims()); LOGGER.debug(STR, refreshToken); addTicketToRegistry(refreshToken, responseHolder.getTicketGrantingTicket()); if (responseHolder.isExpireOldRefreshToken()) { expireOldRefreshToken(responseHolder); } return refreshToken; }
/** * Generate refresh token. * * @param responseHolder the response holder * @param accessToken the related Access token * @return the refresh token */
Generate refresh token
generateRefreshToken
{ "repo_name": "leleuj/cas", "path": "support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/web/response/accesstoken/OAuth20DefaultTokenGenerator.java", "license": "apache-2.0", "size": 14056 }
[ "org.apereo.cas.support.oauth.web.response.accesstoken.ext.AccessTokenRequestDataHolder", "org.apereo.cas.ticket.accesstoken.OAuth20AccessToken", "org.apereo.cas.ticket.refreshtoken.OAuth20RefreshToken" ]
import org.apereo.cas.support.oauth.web.response.accesstoken.ext.AccessTokenRequestDataHolder; import org.apereo.cas.ticket.accesstoken.OAuth20AccessToken; import org.apereo.cas.ticket.refreshtoken.OAuth20RefreshToken;
import org.apereo.cas.support.oauth.web.response.accesstoken.ext.*; import org.apereo.cas.ticket.accesstoken.*; import org.apereo.cas.ticket.refreshtoken.*;
[ "org.apereo.cas" ]
org.apereo.cas;
1,529,787
@Override public int getColorForGreaterThan(int position) { int color = COLOR_NONE; for(int i = conversations.size()-1; i > position; i--) { int status = getItem(i).getStatus(); if (status == Conversation.STATUS_HIGHLIGHT) { return App.getColorScheme().getHighlight(); } else if (color == COLOR_NONE && getColorAt(i) != COLOR_NONE) { color = getColorAt(i); } } return COLOR_NONE; }
int function(int position) { int color = COLOR_NONE; for(int i = conversations.size()-1; i > position; i--) { int status = getItem(i).getStatus(); if (status == Conversation.STATUS_HIGHLIGHT) { return App.getColorScheme().getHighlight(); } else if (color == COLOR_NONE && getColorAt(i) != COLOR_NONE) { color = getColorAt(i); } } return COLOR_NONE; }
/** * Get the state color for all conversations greater than the given position. */
Get the state color for all conversations greater than the given position
getColorForGreaterThan
{ "repo_name": "thelinuxgeekcommunity/simpleirc", "path": "application/src/main/java/tk/jordynsmediagroup/simpleirc/adapter/ConversationPagerAdapter.java", "license": "gpl-3.0", "size": 8750 }
[ "tk.jordynsmediagroup.simpleirc.App", "tk.jordynsmediagroup.simpleirc.model.Conversation" ]
import tk.jordynsmediagroup.simpleirc.App; import tk.jordynsmediagroup.simpleirc.model.Conversation;
import tk.jordynsmediagroup.simpleirc.*; import tk.jordynsmediagroup.simpleirc.model.*;
[ "tk.jordynsmediagroup.simpleirc" ]
tk.jordynsmediagroup.simpleirc;
1,480,247
private static <T extends Number> T pvToPositive(Object pValue, Boolean pPositive, Class<?> pClass){ if (pClass==null || pValue== null){ return null; } BigDecimal xValue = toBigDecimal(pValue); if (pPositive != null){ if (pPositive){ xValue = abs(xValue); }else{ xValue = multiply(abs(xValue), -1); } } return pvConvertToClass(xValue, pClass); }
static <T extends Number> T function(Object pValue, Boolean pPositive, Class<?> pClass){ if (pClass==null pValue== null){ return null; } BigDecimal xValue = toBigDecimal(pValue); if (pPositive != null){ if (pPositive){ xValue = abs(xValue); }else{ xValue = multiply(abs(xValue), -1); } } return pvConvertToClass(xValue, pClass); }
/** * Retorna valor negativo ou positivo conforme paremeto <b>pPositive<b/> independetemente do sinal do valor recebido. * @param pValue * @param pPositive * @param pClass Para para a qual o valor será convertido. * @return */
Retorna valor negativo ou positivo conforme paremeto pPositive independetemente do sinal do valor recebido
pvToPositive
{ "repo_name": "dbsoftcombr/dbssdk", "path": "src/main/java/br/com/dbsoft/util/DBSNumber.java", "license": "mit", "size": 45959 }
[ "java.math.BigDecimal" ]
import java.math.BigDecimal;
import java.math.*;
[ "java.math" ]
java.math;
2,142,492
public EjbJarType<T> moduleName(String moduleName) { childNode.getOrCreate("module-name").text(moduleName); return this; }
EjbJarType<T> function(String moduleName) { childNode.getOrCreate(STR).text(moduleName); return this; }
/** * Sets the <code>module-name</code> element * @param moduleName the value for the element <code>module-name</code> * @return the current instance of <code>EjbJarType<T></code> */
Sets the <code>module-name</code> element
moduleName
{ "repo_name": "forge/javaee-descriptors", "path": "impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/ejbjar31/EjbJarTypeImpl.java", "license": "epl-1.0", "size": 18264 }
[ "org.jboss.shrinkwrap.descriptor.api.ejbjar31.EjbJarType" ]
import org.jboss.shrinkwrap.descriptor.api.ejbjar31.EjbJarType;
import org.jboss.shrinkwrap.descriptor.api.ejbjar31.*;
[ "org.jboss.shrinkwrap" ]
org.jboss.shrinkwrap;
1,645,102
protected void setError(final Object error, final HttpServletResponse response){ this.error = new HashMap<String, Object>(); this.error.put("message", error); log.error("JSON error: "+error); this.sucess = new HashMap<String, Object>(); response.setStatus(HttpServletResponse.SC_BAD_REQUEST); }
void function(final Object error, final HttpServletResponse response){ this.error = new HashMap<String, Object>(); this.error.put(STR, error); log.error(STR+error); this.sucess = new HashMap<String, Object>(); response.setStatus(HttpServletResponse.SC_BAD_REQUEST); }
/** * Set Error. * @param error error. */
Set Error
setError
{ "repo_name": "cristiani/encuestame", "path": "enme-mvc/controllers/src/main/java/org/encuestame/mvc/controller/AbstractJsonControllerV1.java", "license": "apache-2.0", "size": 14795 }
[ "java.util.HashMap", "javax.servlet.http.HttpServletResponse" ]
import java.util.HashMap; import javax.servlet.http.HttpServletResponse;
import java.util.*; import javax.servlet.http.*;
[ "java.util", "javax.servlet" ]
java.util; javax.servlet;
2,029,182
public int getMetaFromState(IBlockState state) { int i = 0; i = i | ((EnumFacing)state.getValue(FACING)).getHorizontalIndex(); if (((Boolean)state.getValue(POWERED)).booleanValue()) { i |= 8; } if (((Boolean)state.getValue(OPEN)).booleanValue()) { i |= 4; } return i; }
int function(IBlockState state) { int i = 0; i = i ((EnumFacing)state.getValue(FACING)).getHorizontalIndex(); if (((Boolean)state.getValue(POWERED)).booleanValue()) { i = 8; } if (((Boolean)state.getValue(OPEN)).booleanValue()) { i = 4; } return i; }
/** * Convert the BlockState into the correct metadata value */
Convert the BlockState into the correct metadata value
getMetaFromState
{ "repo_name": "lucemans/ShapeClient-SRC", "path": "net/minecraft/block/BlockFenceGate.java", "license": "mpl-2.0", "size": 9012 }
[ "net.minecraft.block.state.IBlockState", "net.minecraft.util.EnumFacing" ]
import net.minecraft.block.state.IBlockState; import net.minecraft.util.EnumFacing;
import net.minecraft.block.state.*; import net.minecraft.util.*;
[ "net.minecraft.block", "net.minecraft.util" ]
net.minecraft.block; net.minecraft.util;
1,787,799
public double calculate(List<Double> list, double[] weights) { if(list.size() == 0) { return 0; } double sum = 0; for(int i = 0; i < list.size(); i++) { sum += 1 / (list.get(i) * weights[i]); } return sum / list.size(); }
double function(List<Double> list, double[] weights) { if(list.size() == 0) { return 0; } double sum = 0; for(int i = 0; i < list.size(); i++) { sum += 1 / (list.get(i) * weights[i]); } return sum / list.size(); }
/** * Calculates the weighted harmonic mean. * @param List<Double> the list * @param double[] weights for the data set * @return the result */
Calculates the weighted harmonic mean
calculate
{ "repo_name": "jessemull/MicroFlex", "path": "src/main/java/com/github/jessemull/microflex/integerflex/stat/HarmonicMeanInteger.java", "license": "apache-2.0", "size": 7476 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
498,686
public RemoteTable getRemoteTable(String strRecordName) throws RemoteException { if ((strRecordName == null) || (strRecordName.length() == 0)) strRecordName = this.getMainRecord().getTableNames(false); // Main Record if (strRecordName.lastIndexOf('.') != -1) // Correct this if a class name is passed strRecordName = strRecordName.substring(strRecordName.lastIndexOf('.') + 1); Record record = this.getRecord(strRecordName); if (record == null) return null; // It must be one of this session's files if (this instanceof TableSession) { if (this.getMainRecord() == record) return (RemoteTable)this; } RemoteTable table = null; for (int iIndex = 0; iIndex < this.getSessionObjectCount(); iIndex++) { BaseSession sessionObject = this.getSessionObjectAt(iIndex); if (sessionObject instanceof TableSession) { if (sessionObject.getMainRecord() != null) if (sessionObject.getMainRecord().getTableNames(false).equals(strRecordName)) return (RemoteTable)sessionObject; } } // Not wrapped yet, wrap in a new TableSessionObject try { RecordOwner recordOwner = record.getRecordOwner(); boolean bMainQuery = false; if (recordOwner != null) if (record == recordOwner.getMainRecord()) bMainQuery = true; table = new TableSession(this, record, null); if (recordOwner != null) if (bMainQuery) { recordOwner.addRecord(record, bMainQuery); // If the session wanted to access this record too, make sure it still can. Utility.getLogger().info("Should not create a sub-session for the main record!"); // It is common to do this for thin sessions } } catch (Exception ex) { table = null; } return table; }
RemoteTable function(String strRecordName) throws RemoteException { if ((strRecordName == null) (strRecordName.length() == 0)) strRecordName = this.getMainRecord().getTableNames(false); if (strRecordName.lastIndexOf('.') != -1) strRecordName = strRecordName.substring(strRecordName.lastIndexOf('.') + 1); Record record = this.getRecord(strRecordName); if (record == null) return null; if (this instanceof TableSession) { if (this.getMainRecord() == record) return (RemoteTable)this; } RemoteTable table = null; for (int iIndex = 0; iIndex < this.getSessionObjectCount(); iIndex++) { BaseSession sessionObject = this.getSessionObjectAt(iIndex); if (sessionObject instanceof TableSession) { if (sessionObject.getMainRecord() != null) if (sessionObject.getMainRecord().getTableNames(false).equals(strRecordName)) return (RemoteTable)sessionObject; } } try { RecordOwner recordOwner = record.getRecordOwner(); boolean bMainQuery = false; if (recordOwner != null) if (record == recordOwner.getMainRecord()) bMainQuery = true; table = new TableSession(this, record, null); if (recordOwner != null) if (bMainQuery) { recordOwner.addRecord(record, bMainQuery); Utility.getLogger().info(STR); } } catch (Exception ex) { table = null; } return table; }
/** * Get the remote table for this session. * @param strRecordName Table Name or Class Name of the record to find * Note: This method is used when the SessionObject is used as an application's remote peer. */
Get the remote table for this session
getRemoteTable
{ "repo_name": "jbundle/jbundle", "path": "base/remote/src/main/java/org/jbundle/base/remote/db/Session.java", "license": "gpl-3.0", "size": 9903 }
[ "org.jbundle.base.db.Record", "org.jbundle.base.model.RecordOwner", "org.jbundle.base.model.Utility", "org.jbundle.base.remote.BaseSession", "org.jbundle.model.RemoteException", "org.jbundle.thin.base.remote.RemoteTable" ]
import org.jbundle.base.db.Record; import org.jbundle.base.model.RecordOwner; import org.jbundle.base.model.Utility; import org.jbundle.base.remote.BaseSession; import org.jbundle.model.RemoteException; import org.jbundle.thin.base.remote.RemoteTable;
import org.jbundle.base.db.*; import org.jbundle.base.model.*; import org.jbundle.base.remote.*; import org.jbundle.model.*; import org.jbundle.thin.base.remote.*;
[ "org.jbundle.base", "org.jbundle.model", "org.jbundle.thin" ]
org.jbundle.base; org.jbundle.model; org.jbundle.thin;
1,367,755
public static DatumRange datumRange( PyObject arg0, Units context ) { DatumRange newRange= JythonOps.datumRange(arg0); if ( ! context.isConvertibleTo(newRange.getUnits()) ) { newRange= DatumRange.newDatumRange( newRange.min().value(), newRange.max().value(), context ); } else if ( context!=newRange.getUnits() ) { newRange= new DatumRange( newRange.min().convertTo(context), newRange.max().convertTo(context) ); } return newRange; }
static DatumRange function( PyObject arg0, Units context ) { DatumRange newRange= JythonOps.datumRange(arg0); if ( ! context.isConvertibleTo(newRange.getUnits()) ) { newRange= DatumRange.newDatumRange( newRange.min().value(), newRange.max().value(), context ); } else if ( context!=newRange.getUnits() ) { newRange= new DatumRange( newRange.min().convertTo(context), newRange.max().convertTo(context) ); } return newRange; }
/** * coerce python objects to DatumRange, when the units are known. * * @param arg0 PyQDataSet, String, array or List. * @param context the units. * @return range with the same magnitude, but context units. */
coerce python objects to DatumRange, when the units are known
datumRange
{ "repo_name": "autoplot/app", "path": "JythonSupport/src/org/autoplot/jythonsupport/JythonOps.java", "license": "gpl-2.0", "size": 18118 }
[ "org.das2.datum.DatumRange", "org.das2.datum.Units", "org.python.core.PyObject" ]
import org.das2.datum.DatumRange; import org.das2.datum.Units; import org.python.core.PyObject;
import org.das2.datum.*; import org.python.core.*;
[ "org.das2.datum", "org.python.core" ]
org.das2.datum; org.python.core;
1,989,755
ActionFuture<ClusterStateResponse> state(ClusterStateRequest request);
ActionFuture<ClusterStateResponse> state(ClusterStateRequest request);
/** * The state of the cluster. * * @param request The cluster state request. * @return The result future */
The state of the cluster
state
{ "repo_name": "EvilMcJerkface/crate", "path": "server/src/main/java/org/elasticsearch/client/ClusterAdminClient.java", "license": "apache-2.0", "size": 4533 }
[ "org.elasticsearch.action.ActionFuture", "org.elasticsearch.action.admin.cluster.state.ClusterStateRequest", "org.elasticsearch.action.admin.cluster.state.ClusterStateResponse" ]
import org.elasticsearch.action.ActionFuture; import org.elasticsearch.action.admin.cluster.state.ClusterStateRequest; import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse;
import org.elasticsearch.action.*; import org.elasticsearch.action.admin.cluster.state.*;
[ "org.elasticsearch.action" ]
org.elasticsearch.action;
2,046,735
public Element toXml(Document doc, Stack stack) { // get the basic work done Element header = super.toXml(doc, stack); // add draft, subject header.setAttribute("subject", getSubject()); header.setAttribute("draft", new Boolean(getDraft()).toString()); return header; } // toXml } // BaseAnnouncementMessageHeader protected class PrivacyFilter implements Filter { protected Filter m_filter = null; public PrivacyFilter(Filter filter) { m_filter = filter; } // PrivacyFilter
Element function(Document doc, Stack stack) { Element header = super.toXml(doc, stack); header.setAttribute(STR, getSubject()); header.setAttribute("draft", new Boolean(getDraft()).toString()); return header; } } protected class PrivacyFilter implements Filter { protected Filter m_filter = null; public PrivacyFilter(Filter filter) { m_filter = filter; }
/** * Serialize the resource into XML, adding an element to the doc under the top of the stack element. * * @param doc * The DOM doc to contain the XML (or null for a string return). * @param stack * The DOM elements, the top of which is the containing element of the new "resource" element. * @return The newly added element. */
Serialize the resource into XML, adding an element to the doc under the top of the stack element
toXml
{ "repo_name": "harfalm/Sakai-10.1", "path": "announcement/announcement-impl/impl/src/java/org/sakaiproject/announcement/impl/BaseAnnouncementService.java", "license": "apache-2.0", "size": 63688 }
[ "java.util.Stack", "org.sakaiproject.javax.Filter", "org.w3c.dom.Document", "org.w3c.dom.Element" ]
import java.util.Stack; import org.sakaiproject.javax.Filter; import org.w3c.dom.Document; import org.w3c.dom.Element;
import java.util.*; import org.sakaiproject.javax.*; import org.w3c.dom.*;
[ "java.util", "org.sakaiproject.javax", "org.w3c.dom" ]
java.util; org.sakaiproject.javax; org.w3c.dom;
2,664,800
private JsonElement get(final JsonObject wrapper, String memberName) { final JsonElement elem = wrapper.get(memberName); if (elem == null) { throw new JsonParseException( "No '" + memberName + "' member found in what was expected to be an interface wrapper." ); } return elem; }
JsonElement function(final JsonObject wrapper, String memberName) { final JsonElement elem = wrapper.get(memberName); if (elem == null) { throw new JsonParseException( STR + memberName + STR ); } return elem; }
/** * Returns the JSON element. * * @param wrapper the JSON wrapper * @param memberName the member name * @return the JSON element */
Returns the JSON element
get
{ "repo_name": "compomics/compomics-utilities", "path": "src/main/java/com/compomics/util/io/json/adapter/InterfaceAdapter.java", "license": "apache-2.0", "size": 6052 }
[ "com.google.gson.JsonElement", "com.google.gson.JsonObject", "com.google.gson.JsonParseException" ]
import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException;
import com.google.gson.*;
[ "com.google.gson" ]
com.google.gson;
1,744,533
public EvalAdhocUser getAdhocUserByUsername(String username) { EvalAdhocUser user = null; if ( (Boolean) settings.get(EvalSettings.ENABLE_ADHOC_USERS) ) { List<EvalAdhocUser> users = dao.findBySearch(EvalAdhocUser.class, new Search("username", username) ); if (users.size() > 0) { user = users.get(0); } } return user; }
EvalAdhocUser function(String username) { EvalAdhocUser user = null; if ( (Boolean) settings.get(EvalSettings.ENABLE_ADHOC_USERS) ) { List<EvalAdhocUser> users = dao.findBySearch(EvalAdhocUser.class, new Search(STR, username) ); if (users.size() > 0) { user = users.get(0); } } return user; }
/** * Get the adhoc user by the unique username (login name) * * @param username the unique login name * @return the adhoc user or null if not found */
Get the adhoc user by the unique username (login name)
getAdhocUserByUsername
{ "repo_name": "buckett/evaluation", "path": "impl/src/java/org/sakaiproject/evaluation/dao/EvalAdhocSupportImpl.java", "license": "apache-2.0", "size": 12989 }
[ "java.util.List", "org.sakaiproject.evaluation.logic.EvalSettings", "org.sakaiproject.evaluation.model.EvalAdhocUser", "org.sakaiproject.genericdao.api.search.Search" ]
import java.util.List; import org.sakaiproject.evaluation.logic.EvalSettings; import org.sakaiproject.evaluation.model.EvalAdhocUser; import org.sakaiproject.genericdao.api.search.Search;
import java.util.*; import org.sakaiproject.evaluation.logic.*; import org.sakaiproject.evaluation.model.*; import org.sakaiproject.genericdao.api.search.*;
[ "java.util", "org.sakaiproject.evaluation", "org.sakaiproject.genericdao" ]
java.util; org.sakaiproject.evaluation; org.sakaiproject.genericdao;
548,734
@UpdateProvider(type=AsyncProcessFileSqlProvider.class, method="updateByExampleSelective") int updateByExampleSelective(@Param("record") AsyncProcessFile record, @Param("example") AsyncProcessFileCriteria example);
@UpdateProvider(type=AsyncProcessFileSqlProvider.class, method=STR) int updateByExampleSelective(@Param(STR) AsyncProcessFile record, @Param(STR) AsyncProcessFileCriteria example);
/** * This method was generated by MyBatis Generator. * This method corresponds to the database table ASYNC_PROCESS_FILE * * @mbggenerated */
This method was generated by MyBatis Generator. This method corresponds to the database table ASYNC_PROCESS_FILE
updateByExampleSelective
{ "repo_name": "agwlvssainokuni/sqlapp", "path": "src/generated/java/cherry/sqlapp/db/gen/mapper/AsyncProcessFileMapper.java", "license": "apache-2.0", "size": 9287 }
[ "org.apache.ibatis.annotations.Param", "org.apache.ibatis.annotations.UpdateProvider" ]
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.annotations.*;
[ "org.apache.ibatis" ]
org.apache.ibatis;
1,704,568
public static CreateMatch newEmptyMatch() { return new Mutable(null, null); }
static CreateMatch function() { return new Mutable(null, null); }
/** * Returns an empty, mutable match. * Fields of the mutable match can be filled to create a partial match, usable as matcher input. * * @return the empty match. * */
Returns an empty, mutable match. Fields of the mutable match can be filled to create a partial match, usable as matcher input
newEmptyMatch
{ "repo_name": "FTSRG/mondo-collab-mergespaceexploration", "path": "plugins/org.eclipse.viatra.dse.merge/src/org/eclipse/viatra/dse/merge/iq/CreateMatch.java", "license": "epl-1.0", "size": 7245 }
[ "org.eclipse.viatra.dse.merge.iq.CreateMatch" ]
import org.eclipse.viatra.dse.merge.iq.CreateMatch;
import org.eclipse.viatra.dse.merge.iq.*;
[ "org.eclipse.viatra" ]
org.eclipse.viatra;
1,011,129
public long getEvictedCount() { return this.stats.getEvictedCount(); } private static class EvictionThread extends Thread { private WeakReference<LruBlockCache> cache; public EvictionThread(LruBlockCache cache) { super("LruBlockCache.EvictionThread"); setDaemon(true); this.cache = new WeakReference<LruBlockCache>(cache); }
long function() { return this.stats.getEvictedCount(); } private static class EvictionThread extends Thread { private WeakReference<LruBlockCache> cache; public EvictionThread(LruBlockCache cache) { super(STR); setDaemon(true); this.cache = new WeakReference<LruBlockCache>(cache); }
/** * Get the number of blocks that have been evicted during the lifetime * of this cache. */
Get the number of blocks that have been evicted during the lifetime of this cache
getEvictedCount
{ "repo_name": "Shmuma/hbase", "path": "src/main/java/org/apache/hadoop/hbase/io/hfile/LruBlockCache.java", "license": "apache-2.0", "size": 23616 }
[ "java.lang.ref.WeakReference" ]
import java.lang.ref.WeakReference;
import java.lang.ref.*;
[ "java.lang" ]
java.lang;
1,007,201
switch(groupNumber) { case ZERO_VAL: return ZERO; case MAX_VAL: return MAX; case ALL_VAL: return ALL; case ANY_VAL: return ANY; default: if(UnsignedInts.compare(groupNumber, MAX_VAL) > 0) { // greater than max_val, but not one of the reserved values throw new IllegalArgumentException("Unknown special group number: " + groupNumber); } return new OFGroup(groupNumber); } }
switch(groupNumber) { case ZERO_VAL: return ZERO; case MAX_VAL: return MAX; case ALL_VAL: return ALL; case ANY_VAL: return ANY; default: if(UnsignedInts.compare(groupNumber, MAX_VAL) > 0) { throw new IllegalArgumentException(STR + groupNumber); } return new OFGroup(groupNumber); } }
/** * get an OFGroup object corresponding to a raw 32-bit integer group number. * NOTE: The group object may either be newly allocated or cached. Do not * rely on either behavior. * * @param groupNumber the raw 32-bit group number * @return a corresponding OFPort */
get an OFGroup object corresponding to a raw 32-bit integer group number. rely on either behavior
of
{ "repo_name": "floodlight/loxigen-artifacts", "path": "openflowj/src/main/java/org/projectfloodlight/openflow/types/OFGroup.java", "license": "apache-2.0", "size": 4626 }
[ "com.google.common.primitives.UnsignedInts" ]
import com.google.common.primitives.UnsignedInts;
import com.google.common.primitives.*;
[ "com.google.common" ]
com.google.common;
467,140
private int stringToFlow(String flowcontrol) { flowcontrol = flowcontrol.toLowerCase(); if (flowcontrol.equals("none")) { return SerialPort.FLOWCONTROL_NONE; } if (flowcontrol.equals("xon/xoff out")) { return SerialPort.FLOWCONTROL_XONXOFF_OUT; } if (flowcontrol.equals("xon/xoff in")) { return SerialPort.FLOWCONTROL_XONXOFF_IN; } if (flowcontrol.equals("rts/cts in")) { return SerialPort.FLOWCONTROL_RTSCTS_IN; } if (flowcontrol.equals("rts/cts out")) { return SerialPort.FLOWCONTROL_RTSCTS_OUT; } return SerialPort.FLOWCONTROL_NONE; }// stringToFlow
int function(String flowcontrol) { flowcontrol = flowcontrol.toLowerCase(); if (flowcontrol.equals("none")) { return SerialPort.FLOWCONTROL_NONE; } if (flowcontrol.equals(STR)) { return SerialPort.FLOWCONTROL_XONXOFF_OUT; } if (flowcontrol.equals(STR)) { return SerialPort.FLOWCONTROL_XONXOFF_IN; } if (flowcontrol.equals(STR)) { return SerialPort.FLOWCONTROL_RTSCTS_IN; } if (flowcontrol.equals(STR)) { return SerialPort.FLOWCONTROL_RTSCTS_OUT; } return SerialPort.FLOWCONTROL_NONE; }
/** * Converts a <tt>String</tt> describing a flow control type to the * <tt>int</tt> which is defined in SerialPort. * * @param flowcontrol the <tt>String</tt> describing the flow control type. * @return the <tt>int</tt> describing the flow control type. */
Converts a String describing a flow control type to the int which is defined in SerialPort
stringToFlow
{ "repo_name": "cdjackson/openhab", "path": "bundles/binding/org.openhab.binding.modbus/src/main/java/net/wimpi/modbus/util/SerialParameters.java", "license": "epl-1.0", "size": 22677 }
[ "gnu.io.SerialPort" ]
import gnu.io.SerialPort;
import gnu.io.*;
[ "gnu.io" ]
gnu.io;
1,413,843
@Override protected Iterable<String> transform(final String item) { if (null == item) { return Collections.emptyList(); } return Arrays.asList(item.toUpperCase().split(",")); } }
Iterable<String> function(final String item) { if (null == item) { return Collections.emptyList(); } return Arrays.asList(item.toUpperCase().split(",")); } }
/** * Converts to upper case and splits on commas. * * @param item the I item to be transformed * @return the upper case and split on commas output. */
Converts to upper case and splits on commas
transform
{ "repo_name": "gchq/Gaffer", "path": "core/common-util/src/test/java/uk/gov/gchq/gaffer/commonutil/iterable/TransformOneToManyIterableTest.java", "license": "apache-2.0", "size": 7579 }
[ "java.util.Arrays", "java.util.Collections" ]
import java.util.Arrays; import java.util.Collections;
import java.util.*;
[ "java.util" ]
java.util;
2,049,263
public Object nextElement() throws NoSuchElementException { return (iterator.next()); }
Object function() throws NoSuchElementException { return (iterator.next()); }
/** * Returns the next element of this enumeration if this enumeration * has at least one more element to provide. * * @return the next element of this enumeration * @throws NoSuchElementException if no more elements exist */
Returns the next element of this enumeration if this enumeration has at least one more element to provide
nextElement
{ "repo_name": "NorthFacing/step-by-Java", "path": "fra-tomcat/fra-tomcat-analysis/source/book01/HowTomcatWorks/src/org/apache/catalina/util/Enumerator.java", "license": "gpl-2.0", "size": 5293 }
[ "java.util.NoSuchElementException" ]
import java.util.NoSuchElementException;
import java.util.*;
[ "java.util" ]
java.util;
2,085,898
public void addProject(final ProjectDef projectDef) { if (projectDef == null) { throw new NullPointerException("projectDef"); } projects.addElement(projectDef); }
void function(final ProjectDef projectDef) { if (projectDef == null) { throw new NullPointerException(STR); } projects.addElement(projectDef); }
/** * Specifies the generation of IDE project file. Experimental. * @param projectDef project file generation specification */
Specifies the generation of IDE project file. Experimental
addProject
{ "repo_name": "flax3lbs/cpptasks-parallel", "path": "src/main/java/net/sf/antcontrib/cpptasks/CCTask.java", "license": "apache-2.0", "size": 52971 }
[ "net.sf.antcontrib.cpptasks.ide.ProjectDef" ]
import net.sf.antcontrib.cpptasks.ide.ProjectDef;
import net.sf.antcontrib.cpptasks.ide.*;
[ "net.sf.antcontrib" ]
net.sf.antcontrib;
1,447,393
CheckNamespaceAvailabilityResponse checkAvailability(String namespaceName) throws IOException, ServiceException, ParserConfigurationException, SAXException;
CheckNamespaceAvailabilityResponse checkAvailability(String namespaceName) throws IOException, ServiceException, ParserConfigurationException, SAXException;
/** * Checks the availability of the given service namespace across all Windows * Azure subscriptions. This is useful because the domain name is created * based on the service namespace name. (see * http://msdn.microsoft.com/en-us/library/windowsazure/jj870968.aspx for * more information) * * @param namespaceName Required. The namespace name. * @throws IOException Signals that an I/O exception of some sort has * occurred. This class is the general class of exceptions produced by * failed or interrupted I/O operations. * @throws ServiceException Thrown if an unexpected response is found. * @throws ParserConfigurationException Thrown if there was a serious * configuration error with the document parser. * @throws SAXException Thrown if there was an error parsing the XML * response. * @return The response to a query for the availability status of a * namespace name. */
Checks the availability of the given service namespace across all Windows Azure subscriptions. This is useful because the domain name is created based on the service namespace name. (see HREF for more information)
checkAvailability
{ "repo_name": "southworkscom/azure-sdk-for-java", "path": "service-management/azure-svc-mgmt-servicebus/src/main/java/com/microsoft/windowsazure/management/servicebus/NamespaceOperations.java", "license": "apache-2.0", "size": 20585 }
[ "com.microsoft.windowsazure.exception.ServiceException", "com.microsoft.windowsazure.management.servicebus.models.CheckNamespaceAvailabilityResponse", "java.io.IOException", "javax.xml.parsers.ParserConfigurationException", "org.xml.sax.SAXException" ]
import com.microsoft.windowsazure.exception.ServiceException; import com.microsoft.windowsazure.management.servicebus.models.CheckNamespaceAvailabilityResponse; import java.io.IOException; import javax.xml.parsers.ParserConfigurationException; import org.xml.sax.SAXException;
import com.microsoft.windowsazure.exception.*; import com.microsoft.windowsazure.management.servicebus.models.*; import java.io.*; import javax.xml.parsers.*; import org.xml.sax.*;
[ "com.microsoft.windowsazure", "java.io", "javax.xml", "org.xml.sax" ]
com.microsoft.windowsazure; java.io; javax.xml; org.xml.sax;
1,111,173
public void addIgnoredView(View v) { mViewAbove.addIgnoredView(v); }
void function(View v) { mViewAbove.addIgnoredView(v); }
/** * Add a View ignored by the Touch Down event when mode is Fullscreen * * @param v a view to be ignored */
Add a View ignored by the Touch Down event when mode is Fullscreen
addIgnoredView
{ "repo_name": "tassadar2002/ouser", "path": "src/com/slidingmenu/lib/SlidingMenu.java", "license": "gpl-3.0", "size": 27642 }
[ "android.view.View" ]
import android.view.View;
import android.view.*;
[ "android.view" ]
android.view;
578,409
public static void printExecutionTimesComparison(Map<String, Long> timeMap, long maxTime) { for (Entry<String, Long> entry : timeMap.entrySet()) { System.out.println(entry.getKey() + maxTime / entry.getValue() + " times faster"); } }
static void function(Map<String, Long> timeMap, long maxTime) { for (Entry<String, Long> entry : timeMap.entrySet()) { System.out.println(entry.getKey() + maxTime / entry.getValue() + STR); } }
/** * Take the biggest execution time and every execution time divide by it. * * @param timeMap * @param maxTime */
Take the biggest execution time and every execution time divide by it
printExecutionTimesComparison
{ "repo_name": "antalpeti/Test", "path": "src/performance/TimeUtil.java", "license": "apache-2.0", "size": 1384 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
102,902
public String getCommentsAsHTML() { return org.yeastrc.utils.HTML.convertToHTML(this.getComments()); } public java.util.Date getLastChange() { return this.lastChange; }
String function() { return org.yeastrc.utils.HTML.convertToHTML(this.getComments()); } public java.util.Date getLastChange() { return this.lastChange; }
/** * Returns the comments as HTML * @return The comments as HTML */
Returns the comments as HTML
getCommentsAsHTML
{ "repo_name": "yeastrc/msdapl", "path": "MSDaPl_Web_App/src/org/yeastrc/project/Project.java", "license": "apache-2.0", "size": 11413 }
[ "java.sql.Date" ]
import java.sql.Date;
import java.sql.*;
[ "java.sql" ]
java.sql;
2,257,539
public int numBroadcastPeers(Sha256Hash txHash) { lock.lock(); try { cleanTable(); Entry entry = table.get(txHash); if (entry == null) { // No such TX known. return 0; } else if (entry.tx == null) { // We've seen at least one peer announce with an inv. checkNotNull(entry.addresses); return entry.addresses.size(); } else { final Transaction tx = entry.tx.get(); if (tx == null) { // We previously downloaded this transaction, but nothing cared about it so the garbage collector threw // it away. We also deleted the set that tracked which peers had seen it. Treat this case as a zero and // just delete it from the map. table.remove(txHash); return 0; } else { checkState(entry.addresses == null); return tx.getConfidence().numBroadcastPeers(); } } } finally { lock.unlock(); } }
int function(Sha256Hash txHash) { lock.lock(); try { cleanTable(); Entry entry = table.get(txHash); if (entry == null) { return 0; } else if (entry.tx == null) { checkNotNull(entry.addresses); return entry.addresses.size(); } else { final Transaction tx = entry.tx.get(); if (tx == null) { table.remove(txHash); return 0; } else { checkState(entry.addresses == null); return tx.getConfidence().numBroadcastPeers(); } } } finally { lock.unlock(); } }
/** * Returns the number of peers that have seen the given hash recently. */
Returns the number of peers that have seen the given hash recently
numBroadcastPeers
{ "repo_name": "doged/dogecoindarkj", "path": "core/src/main/java/com/dogecoindark/dogecoindarkj/core/TxConfidenceTable.java", "license": "apache-2.0", "size": 14733 }
[ "com.google.common.base.Preconditions" ]
import com.google.common.base.Preconditions;
import com.google.common.base.*;
[ "com.google.common" ]
com.google.common;
857,093
public DataNode setX_translationScalar(Double x_translation);
DataNode function(Double x_translation);
/** * Translation of the sample along the X-direction of the laboratory coordinate system * <p> * <b>Type:</b> NX_FLOAT * <b>Units:</b> NX_LENGTH * </p> * * @param x_translation the x_translation */
Translation of the sample along the X-direction of the laboratory coordinate system Type: NX_FLOAT Units: NX_LENGTH
setX_translationScalar
{ "repo_name": "xen-0/dawnsci", "path": "org.eclipse.dawnsci.nexus/autogen/org/eclipse/dawnsci/nexus/NXsample.java", "license": "epl-1.0", "size": 49075 }
[ "org.eclipse.dawnsci.analysis.api.tree.DataNode" ]
import org.eclipse.dawnsci.analysis.api.tree.DataNode;
import org.eclipse.dawnsci.analysis.api.tree.*;
[ "org.eclipse.dawnsci" ]
org.eclipse.dawnsci;
1,097,892
public Object readResolve() { try { if (configVersion < 1) { convert1(); configVersion = 1; } // https://github.com/jenkinsci/docker-plugin/issues/270 if (configVersion < 2) { if (retentionStrategy instanceof DockerOnceRetentionStrategy) { DockerOnceRetentionStrategy tmpStrategy = (DockerOnceRetentionStrategy) retentionStrategy; if (tmpStrategy.getIdleMinutes() == 0) { setRetentionStrategy(new DockerOnceRetentionStrategy(10)); } } configVersion = 2; } } catch (Throwable t) { LOGGER.log(Level.SEVERE, "Can't convert old values to new (double conversion?): ", t); } try { labelSet = Label.parse(labelString); // fails sometimes under debugger } catch (Throwable t) { LOGGER.log(Level.SEVERE, "Can't parse labels: ", t); } return this; }
Object function() { try { if (configVersion < 1) { convert1(); configVersion = 1; } if (configVersion < 2) { if (retentionStrategy instanceof DockerOnceRetentionStrategy) { DockerOnceRetentionStrategy tmpStrategy = (DockerOnceRetentionStrategy) retentionStrategy; if (tmpStrategy.getIdleMinutes() == 0) { setRetentionStrategy(new DockerOnceRetentionStrategy(10)); } } configVersion = 2; } } catch (Throwable t) { LOGGER.log(Level.SEVERE, STR, t); } try { labelSet = Label.parse(labelString); } catch (Throwable t) { LOGGER.log(Level.SEVERE, STR, t); } return this; }
/** * Initializes data structure that we don't persist. */
Initializes data structure that we don't persist
readResolve
{ "repo_name": "jgriffiths1993/docker-plugin", "path": "docker-plugin/src/main/java/com/nirima/jenkins/plugins/docker/DockerTemplate.java", "license": "mit", "size": 8924 }
[ "com.nirima.jenkins.plugins.docker.strategy.DockerOnceRetentionStrategy", "hudson.model.Label", "java.util.logging.Level" ]
import com.nirima.jenkins.plugins.docker.strategy.DockerOnceRetentionStrategy; import hudson.model.Label; import java.util.logging.Level;
import com.nirima.jenkins.plugins.docker.strategy.*; import hudson.model.*; import java.util.logging.*;
[ "com.nirima.jenkins", "hudson.model", "java.util" ]
com.nirima.jenkins; hudson.model; java.util;
2,856,169
private void addAddressFieldsToEditor(String countryCode, String languageCode) { mAddressUiComponents = mAutofillProfileBridge.getAddressUiComponents(countryCode, languageCode); // In terms of order, country must be the first field. mCountryField.setCustomErrorMessage(getAddressError(AddressField.COUNTRY)); mEditor.addField(mCountryField); for (int i = 0; i < mAddressUiComponents.size(); i++) { AddressUiComponent component = mAddressUiComponents.get(i); EditorFieldModel field = mAddressFields.get(component.id); if (component.id == AddressField.ORGANIZATION && mPurpose != Purpose.PAYMENT_REQUEST && !ChromeFeatureList.isEnabled( ChromeFeatureList.AUTOFILL_ENABLE_COMPANY_NAME)) { continue; } // Labels depend on country, e.g., state is called province in some countries. These are // already localized. field.setLabel(component.label); field.setIsFullLine(component.isFullLine || component.id == AddressField.LOCALITY || component.id == AddressField.DEPENDENT_LOCALITY); // Libaddressinput formats do not always require the full name (RECIPIENT), but // PaymentRequest does. if (component.isRequired || component.id == AddressField.RECIPIENT) { field.setRequiredErrorMessage(mContext.getString( R.string.pref_edit_dialog_field_required_validation_message)); } else { field.setRequiredErrorMessage(null); } field.setCustomErrorMessage(getAddressError(component.id)); mEditor.addField(field); } // Phone number (and email if applicable) are the last fields of the address. mPhoneField.setCustomErrorMessage(mAddressErrors != null ? mAddressErrors.phone : null); mEditor.addField(mPhoneField); if (mEmailField != null) mEditor.addField(mEmailField); } private static class CountryAwarePhoneNumberValidator implements EditorFieldValidator { @Nullable private String mCountryCode;
void function(String countryCode, String languageCode) { mAddressUiComponents = mAutofillProfileBridge.getAddressUiComponents(countryCode, languageCode); mCountryField.setCustomErrorMessage(getAddressError(AddressField.COUNTRY)); mEditor.addField(mCountryField); for (int i = 0; i < mAddressUiComponents.size(); i++) { AddressUiComponent component = mAddressUiComponents.get(i); EditorFieldModel field = mAddressFields.get(component.id); if (component.id == AddressField.ORGANIZATION && mPurpose != Purpose.PAYMENT_REQUEST && !ChromeFeatureList.isEnabled( ChromeFeatureList.AUTOFILL_ENABLE_COMPANY_NAME)) { continue; } field.setLabel(component.label); field.setIsFullLine(component.isFullLine component.id == AddressField.LOCALITY component.id == AddressField.DEPENDENT_LOCALITY); if (component.isRequired component.id == AddressField.RECIPIENT) { field.setRequiredErrorMessage(mContext.getString( R.string.pref_edit_dialog_field_required_validation_message)); } else { field.setRequiredErrorMessage(null); } field.setCustomErrorMessage(getAddressError(component.id)); mEditor.addField(field); } mPhoneField.setCustomErrorMessage(mAddressErrors != null ? mAddressErrors.phone : null); mEditor.addField(mPhoneField); if (mEmailField != null) mEditor.addField(mEmailField); } private static class CountryAwarePhoneNumberValidator implements EditorFieldValidator { private String mCountryCode;
/** * Adds fields to the editor model based on the country and language code of * the profile that's being edited. */
Adds fields to the editor model based on the country and language code of the profile that's being edited
addAddressFieldsToEditor
{ "repo_name": "endlessm/chromium-browser", "path": "chrome/android/java/src/org/chromium/chrome/browser/payments/AddressEditor.java", "license": "bsd-3-clause", "size": 25672 }
[ "org.chromium.chrome.browser.autofill.prefeditor.EditorFieldModel", "org.chromium.chrome.browser.autofill.settings.AutofillProfileBridge", "org.chromium.chrome.browser.flags.ChromeFeatureList" ]
import org.chromium.chrome.browser.autofill.prefeditor.EditorFieldModel; import org.chromium.chrome.browser.autofill.settings.AutofillProfileBridge; import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.browser.autofill.prefeditor.*; import org.chromium.chrome.browser.autofill.settings.*; import org.chromium.chrome.browser.flags.*;
[ "org.chromium.chrome" ]
org.chromium.chrome;
2,161,404
@Override void doSend(I2CPMessage msg) throws I2CPMessageException { boolean success = queue.offer(msg); if (!success) throw new I2CPMessageException("I2CP write to queue failed"); } @Override public void setClientVersion(String version) {}
void doSend(I2CPMessage msg) throws I2CPMessageException { boolean success = queue.offer(msg); if (!success) throw new I2CPMessageException(STR); } public void setClientVersion(String version) {}
/** * Actually send the I2CPMessage to the client. * Nonblocking. * @throws I2CPMessageException if queue full or on other errors */
Actually send the I2CPMessage to the client. Nonblocking
doSend
{ "repo_name": "oakes/Nightweb", "path": "common/java/router/net/i2p/router/client/QueuedClientConnectionRunner.java", "license": "unlicense", "size": 2414 }
[ "net.i2p.data.i2cp.I2CPMessage", "net.i2p.data.i2cp.I2CPMessageException" ]
import net.i2p.data.i2cp.I2CPMessage; import net.i2p.data.i2cp.I2CPMessageException;
import net.i2p.data.i2cp.*;
[ "net.i2p.data" ]
net.i2p.data;
1,227,297
@Override public String toString() { ArrayList<Short> ipv6 = new ArrayList<>(8); // Set Global ID ipv6.addAll(globalID); // Set Subnet ID ipv6.addAll(subnetID); // Set Interface ID ipv6.addAll(interfaceID); // Replace consecutive sections of zeros to a double colon (::). return IP6Utils.buildIP6String(ipv6); }// toString
String function() { ArrayList<Short> ipv6 = new ArrayList<>(8); ipv6.addAll(globalID); ipv6.addAll(subnetID); ipv6.addAll(interfaceID); return IP6Utils.buildIP6String(ipv6); }
/** * Build the IPv6 address. * * @return a string representation of the IPv6 address */
Build the IPv6 address
toString
{ "repo_name": "Umoxfo/experts-net", "path": "src/experts/net/ip6/IP6.java", "license": "gpl-3.0", "size": 2686 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
1,654,162
public static <T> T makeProcessor( final String column, final ColumnProcessorFactory<T> processorFactory, final ColumnSelectorFactory selectorFactory ) { return makeProcessorInternal( factory -> factory.getColumnCapabilities(column), factory -> factory.makeDimensionSelector(DefaultDimensionSpec.of(column)), factory -> factory.makeColumnValueSelector(column), processorFactory, selectorFactory ); }
static <T> T function( final String column, final ColumnProcessorFactory<T> processorFactory, final ColumnSelectorFactory selectorFactory ) { return makeProcessorInternal( factory -> factory.getColumnCapabilities(column), factory -> factory.makeDimensionSelector(DefaultDimensionSpec.of(column)), factory -> factory.makeColumnValueSelector(column), processorFactory, selectorFactory ); }
/** * Make a processor for a particular named column. * * @param column the column * @param processorFactory the processor factory * @param selectorFactory the column selector factory * @param <T> processor type */
Make a processor for a particular named column
makeProcessor
{ "repo_name": "nishantmonu51/druid", "path": "processing/src/main/java/org/apache/druid/segment/ColumnProcessors.java", "license": "apache-2.0", "size": 17520 }
[ "org.apache.druid.query.dimension.DefaultDimensionSpec" ]
import org.apache.druid.query.dimension.DefaultDimensionSpec;
import org.apache.druid.query.dimension.*;
[ "org.apache.druid" ]
org.apache.druid;
2,314,612
public Set getBucketKeys(int bucketNum, boolean allowTombstones) { Integer buck = Integer.valueOf(bucketNum); final int retryAttempts = calcRetry(); Set ret = null; int count = 0; InternalDistributedMember nod = getOrCreateNodeForBucketRead(bucketNum); RetryTimeKeeper snoozer = null; while (count <= retryAttempts) { // It's possible this is a GemFire thread e.g. ServerConnection // which got to this point because of a distributed system shutdown or // region closure which uses interrupt to break any sleep() or wait() // calls // e.g. waitForPrimary or waitForBucketRecovery checkShutdown(); if (nod == null) { if (snoozer == null) { snoozer = new RetryTimeKeeper(this.retryTimeout); } nod = getOrCreateNodeForBucketRead(bucketNum); // No storage found for bucket, early out preventing hot loop, bug 36819 if (nod == null) { checkShutdown(); break; } count++; continue; } try { if (nod.equals(getMyId())) { ret = this.dataStore.getKeysLocally(buck, allowTombstones); } else { FetchKeysResponse r = FetchKeysMessage.send(nod, this, buck, allowTombstones); ret = r.waitForKeys(); } if (ret != null) { return ret; } } catch (PRLocallyDestroyedException pde) { if (logger.isDebugEnabled()) { logger.debug("getBucketKeys: Encountered PRLocallyDestroyedException"); } checkReadiness(); } catch (ForceReattemptException prce) { if (logger.isDebugEnabled()) { logger.debug("getBucketKeys: attempt:{}", (count + 1), prce); } checkReadiness(); if (snoozer == null) { snoozer = new RetryTimeKeeper(this.retryTimeout); } InternalDistributedMember oldNode = nod; nod = getNodeForBucketRead(buck.intValue()); if (nod != null && nod.equals(oldNode)) { if (snoozer.overMaximum()) { checkReadiness(); throw new TimeoutException(LocalizedStrings.PartitionedRegion_ATTEMPT_TO_ACQUIRE_PRIMARY_NODE_FOR_READ_ON_BUCKET_0_TIMED_OUT_IN_1_MS.toLocalizedString(new Object[] {getBucketName(buck.intValue()), Integer.valueOf(snoozer.getRetryTime())})); } snoozer.waitToRetryNode(); } } count++; } if (logger.isDebugEnabled()) { logger.debug("getBucketKeys: no keys found returning empty set"); } return Collections.EMPTY_SET; }
Set function(int bucketNum, boolean allowTombstones) { Integer buck = Integer.valueOf(bucketNum); final int retryAttempts = calcRetry(); Set ret = null; int count = 0; InternalDistributedMember nod = getOrCreateNodeForBucketRead(bucketNum); RetryTimeKeeper snoozer = null; while (count <= retryAttempts) { checkShutdown(); if (nod == null) { if (snoozer == null) { snoozer = new RetryTimeKeeper(this.retryTimeout); } nod = getOrCreateNodeForBucketRead(bucketNum); if (nod == null) { checkShutdown(); break; } count++; continue; } try { if (nod.equals(getMyId())) { ret = this.dataStore.getKeysLocally(buck, allowTombstones); } else { FetchKeysResponse r = FetchKeysMessage.send(nod, this, buck, allowTombstones); ret = r.waitForKeys(); } if (ret != null) { return ret; } } catch (PRLocallyDestroyedException pde) { if (logger.isDebugEnabled()) { logger.debug(STR); } checkReadiness(); } catch (ForceReattemptException prce) { if (logger.isDebugEnabled()) { logger.debug(STR, (count + 1), prce); } checkReadiness(); if (snoozer == null) { snoozer = new RetryTimeKeeper(this.retryTimeout); } InternalDistributedMember oldNode = nod; nod = getNodeForBucketRead(buck.intValue()); if (nod != null && nod.equals(oldNode)) { if (snoozer.overMaximum()) { checkReadiness(); throw new TimeoutException(LocalizedStrings.PartitionedRegion_ATTEMPT_TO_ACQUIRE_PRIMARY_NODE_FOR_READ_ON_BUCKET_0_TIMED_OUT_IN_1_MS.toLocalizedString(new Object[] {getBucketName(buck.intValue()), Integer.valueOf(snoozer.getRetryTime())})); } snoozer.waitToRetryNode(); } } count++; } if (logger.isDebugEnabled()) { logger.debug(STR); } return Collections.EMPTY_SET; }
/** * Fetch the keys for the given bucket identifier, if the bucket is local or * remote. This version of the method allows you to retrieve Tombstone entries * as well as undestroyed entries. * * @param bucketNum * @param allowTombstones whether to include destroyed entries in the result * @return A set of keys from bucketNum or {@link Collections#EMPTY_SET}if no * keys can be found. */
Fetch the keys for the given bucket identifier, if the bucket is local or remote. This version of the method allows you to retrieve Tombstone entries as well as undestroyed entries
getBucketKeys
{ "repo_name": "ameybarve15/incubator-geode", "path": "gemfire-core/src/main/java/com/gemstone/gemfire/internal/cache/PartitionedRegion.java", "license": "apache-2.0", "size": 403335 }
[ "com.gemstone.gemfire.cache.TimeoutException", "com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember", "com.gemstone.gemfire.internal.cache.partitioned.FetchKeysMessage", "com.gemstone.gemfire.internal.cache.partitioned.PRLocallyDestroyedException", "com.gemstone.gemfire.internal.i18n.LocalizedStrings", "java.util.Collections", "java.util.Set" ]
import com.gemstone.gemfire.cache.TimeoutException; import com.gemstone.gemfire.distributed.internal.membership.InternalDistributedMember; import com.gemstone.gemfire.internal.cache.partitioned.FetchKeysMessage; import com.gemstone.gemfire.internal.cache.partitioned.PRLocallyDestroyedException; import com.gemstone.gemfire.internal.i18n.LocalizedStrings; import java.util.Collections; import java.util.Set;
import com.gemstone.gemfire.cache.*; import com.gemstone.gemfire.distributed.internal.membership.*; import com.gemstone.gemfire.internal.cache.partitioned.*; import com.gemstone.gemfire.internal.i18n.*; import java.util.*;
[ "com.gemstone.gemfire", "java.util" ]
com.gemstone.gemfire; java.util;
172,106
private View generateHierarchy(Context context) { Resources resources = getResources(); FrameLayout.LayoutParams params; int fivePx = dpToPx(5, resources); int tenPx = dpToPx(10, resources); int twentyPx = dpToPx(20, resources); TableLayout.LayoutParams tableLayoutParams = new TableLayout.LayoutParams( 0, ViewGroup.LayoutParams.WRAP_CONTENT, 1f); tableLayoutParams.setMargins(0, 0, fivePx, 0); LinearLayout seekWrapper; FrameLayout root = new FrameLayout(context); params = createLayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, dpToPx(300, resources)); root.setLayoutParams(params); FrameLayout container = new FrameLayout(context); params = createMatchParams(); params.setMargins(0, twentyPx, 0, 0); container.setLayoutParams(params); container.setBackgroundColor(Color.argb(100, 0, 0, 0)); root.addView(container); mSpringSelectorSpinner = new Spinner(context, Spinner.MODE_DIALOG); params = createMatchWrapParams(); params.gravity = Gravity.TOP; params.setMargins(tenPx, tenPx, tenPx, 0); mSpringSelectorSpinner.setLayoutParams(params); container.addView(mSpringSelectorSpinner); LinearLayout linearLayout = new LinearLayout(context); params = createMatchWrapParams(); params.setMargins(0, 0, 0, dpToPx(80, resources)); params.gravity = Gravity.BOTTOM; linearLayout.setLayoutParams(params); linearLayout.setOrientation(LinearLayout.VERTICAL); container.addView(linearLayout); seekWrapper = new LinearLayout(context); params = createMatchWrapParams(); params.setMargins(tenPx, tenPx, tenPx, twentyPx); seekWrapper.setPadding(tenPx, tenPx, tenPx, tenPx); seekWrapper.setLayoutParams(params); seekWrapper.setOrientation(LinearLayout.HORIZONTAL); linearLayout.addView(seekWrapper); mTensionSeekBar = new SeekBar(context); mTensionSeekBar.setLayoutParams(tableLayoutParams); seekWrapper.addView(mTensionSeekBar); mTensionLabel = new TextView(getContext()); mTensionLabel.setTextColor(mTextColor); params = createLayoutParams( dpToPx(50, resources), ViewGroup.LayoutParams.MATCH_PARENT); mTensionLabel.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT); mTensionLabel.setLayoutParams(params); mTensionLabel.setMaxLines(1); seekWrapper.addView(mTensionLabel); seekWrapper = new LinearLayout(context); params = createMatchWrapParams(); params.setMargins(tenPx, tenPx, tenPx, twentyPx); seekWrapper.setPadding(tenPx, tenPx, tenPx, tenPx); seekWrapper.setLayoutParams(params); seekWrapper.setOrientation(LinearLayout.HORIZONTAL); linearLayout.addView(seekWrapper); mFrictionSeekBar = new SeekBar(context); mFrictionSeekBar.setLayoutParams(tableLayoutParams); seekWrapper.addView(mFrictionSeekBar); mFrictionLabel = new TextView(getContext()); mFrictionLabel.setTextColor(mTextColor); params = createLayoutParams(dpToPx(50, resources), ViewGroup.LayoutParams.MATCH_PARENT); mFrictionLabel.setGravity(Gravity.CENTER_VERTICAL | Gravity.LEFT); mFrictionLabel.setLayoutParams(params); mFrictionLabel.setMaxLines(1); seekWrapper.addView(mFrictionLabel); View nub = new View(context); params = createLayoutParams(dpToPx(60, resources), dpToPx(40, resources)); params.gravity = Gravity.TOP | Gravity.CENTER; nub.setLayoutParams(params); nub.setOnTouchListener(new OnNubTouchListener()); nub.setBackgroundColor(Color.argb(255, 0, 164, 209)); root.addView(nub); return root; }
View function(Context context) { Resources resources = getResources(); FrameLayout.LayoutParams params; int fivePx = dpToPx(5, resources); int tenPx = dpToPx(10, resources); int twentyPx = dpToPx(20, resources); TableLayout.LayoutParams tableLayoutParams = new TableLayout.LayoutParams( 0, ViewGroup.LayoutParams.WRAP_CONTENT, 1f); tableLayoutParams.setMargins(0, 0, fivePx, 0); LinearLayout seekWrapper; FrameLayout root = new FrameLayout(context); params = createLayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, dpToPx(300, resources)); root.setLayoutParams(params); FrameLayout container = new FrameLayout(context); params = createMatchParams(); params.setMargins(0, twentyPx, 0, 0); container.setLayoutParams(params); container.setBackgroundColor(Color.argb(100, 0, 0, 0)); root.addView(container); mSpringSelectorSpinner = new Spinner(context, Spinner.MODE_DIALOG); params = createMatchWrapParams(); params.gravity = Gravity.TOP; params.setMargins(tenPx, tenPx, tenPx, 0); mSpringSelectorSpinner.setLayoutParams(params); container.addView(mSpringSelectorSpinner); LinearLayout linearLayout = new LinearLayout(context); params = createMatchWrapParams(); params.setMargins(0, 0, 0, dpToPx(80, resources)); params.gravity = Gravity.BOTTOM; linearLayout.setLayoutParams(params); linearLayout.setOrientation(LinearLayout.VERTICAL); container.addView(linearLayout); seekWrapper = new LinearLayout(context); params = createMatchWrapParams(); params.setMargins(tenPx, tenPx, tenPx, twentyPx); seekWrapper.setPadding(tenPx, tenPx, tenPx, tenPx); seekWrapper.setLayoutParams(params); seekWrapper.setOrientation(LinearLayout.HORIZONTAL); linearLayout.addView(seekWrapper); mTensionSeekBar = new SeekBar(context); mTensionSeekBar.setLayoutParams(tableLayoutParams); seekWrapper.addView(mTensionSeekBar); mTensionLabel = new TextView(getContext()); mTensionLabel.setTextColor(mTextColor); params = createLayoutParams( dpToPx(50, resources), ViewGroup.LayoutParams.MATCH_PARENT); mTensionLabel.setGravity(Gravity.CENTER_VERTICAL Gravity.LEFT); mTensionLabel.setLayoutParams(params); mTensionLabel.setMaxLines(1); seekWrapper.addView(mTensionLabel); seekWrapper = new LinearLayout(context); params = createMatchWrapParams(); params.setMargins(tenPx, tenPx, tenPx, twentyPx); seekWrapper.setPadding(tenPx, tenPx, tenPx, tenPx); seekWrapper.setLayoutParams(params); seekWrapper.setOrientation(LinearLayout.HORIZONTAL); linearLayout.addView(seekWrapper); mFrictionSeekBar = new SeekBar(context); mFrictionSeekBar.setLayoutParams(tableLayoutParams); seekWrapper.addView(mFrictionSeekBar); mFrictionLabel = new TextView(getContext()); mFrictionLabel.setTextColor(mTextColor); params = createLayoutParams(dpToPx(50, resources), ViewGroup.LayoutParams.MATCH_PARENT); mFrictionLabel.setGravity(Gravity.CENTER_VERTICAL Gravity.LEFT); mFrictionLabel.setLayoutParams(params); mFrictionLabel.setMaxLines(1); seekWrapper.addView(mFrictionLabel); View nub = new View(context); params = createLayoutParams(dpToPx(60, resources), dpToPx(40, resources)); params.gravity = Gravity.TOP Gravity.CENTER; nub.setLayoutParams(params); nub.setOnTouchListener(new OnNubTouchListener()); nub.setBackgroundColor(Color.argb(255, 0, 164, 209)); root.addView(nub); return root; }
/** * Programmatically build up the view hierarchy to avoid the need for resources. * @return View hierarchy */
Programmatically build up the view hierarchy to avoid the need for resources
generateHierarchy
{ "repo_name": "XueXiaobo/MyCode", "path": "src/com/xc/lib/view/ui/SpringConfiguratorView.java", "license": "epl-1.0", "size": 14331 }
[ "android.content.Context", "android.content.res.Resources", "android.graphics.Color", "android.view.Gravity", "android.view.View", "android.view.ViewGroup", "android.widget.FrameLayout", "android.widget.LinearLayout", "android.widget.SeekBar", "android.widget.Spinner", "android.widget.TableLayout", "android.widget.TextView", "com.xc.lib.view.ui.Util" ]
import android.content.Context; import android.content.res.Resources; import android.graphics.Color; import android.view.Gravity; import android.view.View; import android.view.ViewGroup; import android.widget.FrameLayout; import android.widget.LinearLayout; import android.widget.SeekBar; import android.widget.Spinner; import android.widget.TableLayout; import android.widget.TextView; import com.xc.lib.view.ui.Util;
import android.content.*; import android.content.res.*; import android.graphics.*; import android.view.*; import android.widget.*; import com.xc.lib.view.ui.*;
[ "android.content", "android.graphics", "android.view", "android.widget", "com.xc.lib" ]
android.content; android.graphics; android.view; android.widget; com.xc.lib;
2,003,310
public static <T> CreateStream<T> of(Coder<T> coder, Duration batchDuration) { return of(coder, batchDuration, true); }
static <T> CreateStream<T> function(Coder<T> coder, Duration batchDuration) { return of(coder, batchDuration, true); }
/** * Creates a new Spark based stream without forced watermark sync, intended for test purposes. See * also {@link CreateStream#of(Coder, Duration, boolean)}. */
Creates a new Spark based stream without forced watermark sync, intended for test purposes. See also <code>CreateStream#of(Coder, Duration, boolean)</code>
of
{ "repo_name": "mxm/incubator-beam", "path": "runners/spark/src/main/java/org/apache/beam/runners/spark/io/CreateStream.java", "license": "apache-2.0", "size": 9251 }
[ "org.apache.beam.sdk.coders.Coder", "org.joda.time.Duration" ]
import org.apache.beam.sdk.coders.Coder; import org.joda.time.Duration;
import org.apache.beam.sdk.coders.*; import org.joda.time.*;
[ "org.apache.beam", "org.joda.time" ]
org.apache.beam; org.joda.time;
276,737
private void openFileBrowser() { hide(); try { Display display = Display.getDefault(); Shell shell = new Shell(display); FileDialog fid = new FileDialog(shell); fid.setFilterExtensions(new String[] { FILTER_EXTENSION_AVSC, FILTER_EXTENSION_TXT }); fid.setText(INPUT_SCHEMA_FILE); String filePath = fid.open(); DataMapperSchemaEditorUtil schemaEditorUtil = new DataMapperSchemaEditorUtil(inputFile); String schemaFilePath = schemaEditorUtil.createDiagram( FileUtils.readFileToString(new File(filePath)), schemaType); if (!schemaFilePath.isEmpty()) { setSelectedPath(schemaFilePath); if (Messages.LoadInputSchemaAction_SchemaTypeInput.equals(schemaType)) { InputEditPart iep = (InputEditPart) selectedEP; iep.resetInputTreeFromFile(schemaFilePath); } else if (Messages.LoadOutputSchemaAction_SchemaTypeOutput.equals(schemaType)) { OutputEditPart iep = (OutputEditPart) selectedEP; iep.resetOutputTreeFromFile(schemaFilePath); } } } catch (Exception e) { log.error(ERROR_OPENING_FILE, e); IStatus editorStatus = new Status(IStatus.ERROR, Activator.PLUGIN_ID, REASON_OPENING_FILE); ErrorDialog.openError(Display.getCurrent().getActiveShell(), ERROR_MSG_HEADER, ERROR_OPENING_FILE, editorStatus); } finally { show(); } }
void function() { hide(); try { Display display = Display.getDefault(); Shell shell = new Shell(display); FileDialog fid = new FileDialog(shell); fid.setFilterExtensions(new String[] { FILTER_EXTENSION_AVSC, FILTER_EXTENSION_TXT }); fid.setText(INPUT_SCHEMA_FILE); String filePath = fid.open(); DataMapperSchemaEditorUtil schemaEditorUtil = new DataMapperSchemaEditorUtil(inputFile); String schemaFilePath = schemaEditorUtil.createDiagram( FileUtils.readFileToString(new File(filePath)), schemaType); if (!schemaFilePath.isEmpty()) { setSelectedPath(schemaFilePath); if (Messages.LoadInputSchemaAction_SchemaTypeInput.equals(schemaType)) { InputEditPart iep = (InputEditPart) selectedEP; iep.resetInputTreeFromFile(schemaFilePath); } else if (Messages.LoadOutputSchemaAction_SchemaTypeOutput.equals(schemaType)) { OutputEditPart iep = (OutputEditPart) selectedEP; iep.resetOutputTreeFromFile(schemaFilePath); } } } catch (Exception e) { log.error(ERROR_OPENING_FILE, e); IStatus editorStatus = new Status(IStatus.ERROR, Activator.PLUGIN_ID, REASON_OPENING_FILE); ErrorDialog.openError(Display.getCurrent().getActiveShell(), ERROR_MSG_HEADER, ERROR_OPENING_FILE, editorStatus); } finally { show(); } }
/** * Open file browser */
Open file browser
openFileBrowser
{ "repo_name": "kaviththiranga/developer-studio", "path": "data-mapper/org.wso2.developerstudio.visualdatamapper.diagram/src/org/wso2/developerstudio/datamapper/diagram/custom/util/SchemaKeyEditorDialog.java", "license": "apache-2.0", "size": 15617 }
[ "java.io.File", "org.apache.commons.io.FileUtils", "org.eclipse.core.runtime.IStatus", "org.eclipse.core.runtime.Status", "org.eclipse.jface.dialogs.ErrorDialog", "org.eclipse.swt.widgets.Display", "org.eclipse.swt.widgets.FileDialog", "org.eclipse.swt.widgets.Shell", "org.wso2.developerstudio.datamapper.diagram.Activator", "org.wso2.developerstudio.datamapper.diagram.custom.action.Messages", "org.wso2.developerstudio.datamapper.diagram.edit.parts.InputEditPart", "org.wso2.developerstudio.datamapper.diagram.edit.parts.OutputEditPart", "org.wso2.developerstudio.datamapper.diagram.part.DataMapperSchemaEditorUtil" ]
import java.io.File; import org.apache.commons.io.FileUtils; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.jface.dialogs.ErrorDialog; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.FileDialog; import org.eclipse.swt.widgets.Shell; import org.wso2.developerstudio.datamapper.diagram.Activator; import org.wso2.developerstudio.datamapper.diagram.custom.action.Messages; import org.wso2.developerstudio.datamapper.diagram.edit.parts.InputEditPart; import org.wso2.developerstudio.datamapper.diagram.edit.parts.OutputEditPart; import org.wso2.developerstudio.datamapper.diagram.part.DataMapperSchemaEditorUtil;
import java.io.*; import org.apache.commons.io.*; import org.eclipse.core.runtime.*; import org.eclipse.jface.dialogs.*; import org.eclipse.swt.widgets.*; import org.wso2.developerstudio.datamapper.diagram.*; import org.wso2.developerstudio.datamapper.diagram.custom.action.*; import org.wso2.developerstudio.datamapper.diagram.edit.parts.*; import org.wso2.developerstudio.datamapper.diagram.part.*;
[ "java.io", "org.apache.commons", "org.eclipse.core", "org.eclipse.jface", "org.eclipse.swt", "org.wso2.developerstudio" ]
java.io; org.apache.commons; org.eclipse.core; org.eclipse.jface; org.eclipse.swt; org.wso2.developerstudio;
1,873,210
public static AnalyticPhantom queryPhantom(String message, String messageTitle) throws Exception{ AnalyticPhantom [] materials = AnalyticPhantom.getAnalyticPhantoms(); return (AnalyticPhantom) chooseObject(message, messageTitle, materials, materials[0]); }
static AnalyticPhantom function(String message, String messageTitle) throws Exception{ AnalyticPhantom [] materials = AnalyticPhantom.getAnalyticPhantoms(); return (AnalyticPhantom) chooseObject(message, messageTitle, materials, materials[0]); }
/** * Queries the user for a Phantom. * @param message * @param messageTitle * @return the chosen Phantom * @throws Exception */
Queries the user for a Phantom
queryPhantom
{ "repo_name": "YixingHuang/CONRAD-1", "path": "src/edu/stanford/rsl/conrad/utils/UserUtil.java", "license": "gpl-3.0", "size": 5679 }
[ "edu.stanford.rsl.conrad.phantom.AnalyticPhantom" ]
import edu.stanford.rsl.conrad.phantom.AnalyticPhantom;
import edu.stanford.rsl.conrad.phantom.*;
[ "edu.stanford.rsl" ]
edu.stanford.rsl;
1,069,585
public void cancelAllRequests(boolean mayInterruptIfRunning) { for (List<RequestHandle> requestList : requestMap.values()) { if (requestList != null) { for (RequestHandle requestHandle : requestList) { requestHandle.cancel(mayInterruptIfRunning); } } } requestMap.clear(); } // [+] HTTP HEAD
void function(boolean mayInterruptIfRunning) { for (List<RequestHandle> requestList : requestMap.values()) { if (requestList != null) { for (RequestHandle requestHandle : requestList) { requestHandle.cancel(mayInterruptIfRunning); } } } requestMap.clear(); }
/** * Cancels all pending (or potentially active) requests. <p>&nbsp;</p> <b>Note:</b> This will * only affect requests which were created with a non-null android Context. This method is * intended to be used in the onDestroy method of your android activities to destroy all * requests which are no longer required. * * @param mayInterruptIfRunning specifies if active requests should be cancelled along with * pending requests. */
Cancels all pending (or potentially active) requests. &nbsp; Note: This will only affect requests which were created with a non-null android Context. This method is intended to be used in the onDestroy method of your android activities to destroy all requests which are no longer required
cancelAllRequests
{ "repo_name": "lookwhatlook/WeiboWeiBaTong", "path": "libs/LoginBeebo-android-async-http/src/com/loopj/android/http/AsyncHttpClient.java", "license": "gpl-3.0", "size": 65767 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,182,910
private void copyFile(InputStream in, OutputStream out) throws IOException { byte[] buffer = new byte[1024]; int read; while ((read = in.read(buffer)) != -1) { out.write(buffer, 0, read); } }
void function(InputStream in, OutputStream out) throws IOException { byte[] buffer = new byte[1024]; int read; while ((read = in.read(buffer)) != -1) { out.write(buffer, 0, read); } }
/** * Copy content from input stream into output stream. * * @param in * The input stream * @param out * The output stream */
Copy content from input stream into output stream
copyFile
{ "repo_name": "nozelrosario/Dcare", "path": "plugins/de.appplant.cordova.plugin.local-notification/src/android/notification/AssetUtil.java", "license": "apache-2.0", "size": 12251 }
[ "java.io.IOException", "java.io.InputStream", "java.io.OutputStream" ]
import java.io.IOException; import java.io.InputStream; import java.io.OutputStream;
import java.io.*;
[ "java.io" ]
java.io;
1,295,586
@ApiModelProperty(required = true, value = "The name of the variable") public String getName() { return name; }
@ApiModelProperty(required = true, value = STR) String function() { return name; }
/** * The name of the variable * @return name **/
The name of the variable
getName
{ "repo_name": "knetikmedia/knetikcloud-java-client", "path": "src/main/java/com/knetikcloud/model/ActionVariableResource.java", "license": "apache-2.0", "size": 3593 }
[ "io.swagger.annotations.ApiModelProperty" ]
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.*;
[ "io.swagger.annotations" ]
io.swagger.annotations;
295,569
void setBounds(Rectangle rect);
void setBounds(Rectangle rect);
/** * Sets the bounds to the bounds of the specified <code>Rectangle</code>. * * @param rect * The new bounds */
Sets the bounds to the bounds of the specified <code>Rectangle</code>
setBounds
{ "repo_name": "opensagres/xdocreport.eclipse", "path": "rap/org.eclipse.draw2d/src/org/eclipse/draw2d/IFigure.java", "license": "lgpl-2.1", "size": 31295 }
[ "org.eclipse.draw2d.geometry.Rectangle" ]
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.draw2d.geometry.*;
[ "org.eclipse.draw2d" ]
org.eclipse.draw2d;
1,273,754
protected void checkIsNotHost(String connection, boolean checkPort) throws IllegalArgumentException, ConnectionNotFoundException { HttpUrl url = new HttpUrl(connection); // Server connections do not have a host if (url.host != null) { throw new ConnectionNotFoundException( "Connection not supported"); } if (checkPort && url.port == -1) { throw new IllegalArgumentException("Port missing"); } }
void function(String connection, boolean checkPort) throws IllegalArgumentException, ConnectionNotFoundException { HttpUrl url = new HttpUrl(connection); if (url.host != null) { throw new ConnectionNotFoundException( STR); } if (checkPort && url.port == -1) { throw new IllegalArgumentException(STR); } }
/** * Check if host is not present. * @param connection generic connection <em>protocol</em>, <em>host</em> * and <em>port number</em> * (optional parameters may be included * separated with semi-colons (;)) * @param checkPort check if the port is not omitted * @exception IllegalArgumentException if the connection contains no port * value * @exception ConnectionNotFoundException if connection contains any host * name */
Check if host is not present
checkIsNotHost
{ "repo_name": "mykmelez/pluotsorbet", "path": "java/midp/com/sun/midp/io/j2me/push/ProtocolPush.java", "license": "gpl-2.0", "size": 8967 }
[ "com.sun.midp.io.HttpUrl", "javax.microedition.io.ConnectionNotFoundException" ]
import com.sun.midp.io.HttpUrl; import javax.microedition.io.ConnectionNotFoundException;
import com.sun.midp.io.*; import javax.microedition.io.*;
[ "com.sun.midp", "javax.microedition" ]
com.sun.midp; javax.microedition;
2,897,296
@Override public boolean onActivityResult(CryptoEncryptCallback callback, int requestCode, int resultCode, android.content.Intent data, PgpData pgpData) { switch (requestCode) { case Apg.SELECT_SECRET_KEY: if (resultCode != Activity.RESULT_OK || data == null) { break; } pgpData.setSignatureKeyId(data.getLongExtra(Apg.EXTRA_KEY_ID, 0)); pgpData.setSignatureUserId(data.getStringExtra(Apg.EXTRA_USER_ID)); callback.updateEncryptLayout(); break; case Apg.SELECT_PUBLIC_KEYS: if (resultCode != Activity.RESULT_OK || data == null) { pgpData.setEncryptionKeys(null); callback.onEncryptionKeySelectionDone(); break; } pgpData.setEncryptionKeys(data.getLongArrayExtra(Apg.EXTRA_SELECTION)); callback.onEncryptionKeySelectionDone(); break; case Apg.ENCRYPT_MESSAGE: if (resultCode != Activity.RESULT_OK || data == null) { pgpData.setEncryptionKeys(null); callback.onEncryptDone(); break; } pgpData.setEncryptedData(data.getStringExtra(Apg.EXTRA_ENCRYPTED_MESSAGE)); // this was a stupid bug in an earlier version, just gonna leave this in for an APG // version or two if (pgpData.getEncryptedData() == null) { pgpData.setEncryptedData(data.getStringExtra(Apg.EXTRA_DECRYPTED_MESSAGE)); } if (pgpData.getEncryptedData() != null) { callback.onEncryptDone(); } break; default: return false; } return true; }
boolean function(CryptoEncryptCallback callback, int requestCode, int resultCode, android.content.Intent data, PgpData pgpData) { switch (requestCode) { case Apg.SELECT_SECRET_KEY: if (resultCode != Activity.RESULT_OK data == null) { break; } pgpData.setSignatureKeyId(data.getLongExtra(Apg.EXTRA_KEY_ID, 0)); pgpData.setSignatureUserId(data.getStringExtra(Apg.EXTRA_USER_ID)); callback.updateEncryptLayout(); break; case Apg.SELECT_PUBLIC_KEYS: if (resultCode != Activity.RESULT_OK data == null) { pgpData.setEncryptionKeys(null); callback.onEncryptionKeySelectionDone(); break; } pgpData.setEncryptionKeys(data.getLongArrayExtra(Apg.EXTRA_SELECTION)); callback.onEncryptionKeySelectionDone(); break; case Apg.ENCRYPT_MESSAGE: if (resultCode != Activity.RESULT_OK data == null) { pgpData.setEncryptionKeys(null); callback.onEncryptDone(); break; } pgpData.setEncryptedData(data.getStringExtra(Apg.EXTRA_ENCRYPTED_MESSAGE)); if (pgpData.getEncryptedData() == null) { pgpData.setEncryptedData(data.getStringExtra(Apg.EXTRA_DECRYPTED_MESSAGE)); } if (pgpData.getEncryptedData() != null) { callback.onEncryptDone(); } break; default: return false; } return true; }
/** * Handle the activity results that concern us. * * @param activity * @param requestCode * @param resultCode * @param data * @return handled or not */
Handle the activity results that concern us
onActivityResult
{ "repo_name": "imaeses/k-9", "path": "src/com/fsck/k9/crypto/Apg.java", "license": "bsd-3-clause", "size": 22086 }
[ "android.app.Activity", "com.fsck.k9.crypto.CryptoProvider" ]
import android.app.Activity; import com.fsck.k9.crypto.CryptoProvider;
import android.app.*; import com.fsck.k9.crypto.*;
[ "android.app", "com.fsck.k9" ]
android.app; com.fsck.k9;
1,725,260
public void createAndShowGUI() { // Create and set up the window. //new PizzaCat().setVisible(true); JFrame frame = new JFrame("Processing Results"); frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE); // Create and set up the content pane. JComponent newContentPane = new ProgressBarDemo(); newContentPane.setOpaque(true); // content panes must be opaque frame.setContentPane(newContentPane); // Display the window. frame.pack(); frame.setVisible(true); }
void function() { JFrame frame = new JFrame(STR); frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE); JComponent newContentPane = new ProgressBarDemo(); newContentPane.setOpaque(true); frame.setContentPane(newContentPane); frame.pack(); frame.setVisible(true); }
/** * Create the GUI and show it. As with all GUI code, this must run on the * event-dispatching thread. */
Create the GUI and show it. As with all GUI code, this must run on the event-dispatching thread
createAndShowGUI
{ "repo_name": "JburkeRSAC/PizzaCat", "path": "src/GUI/PizzaCat.java", "license": "gpl-3.0", "size": 176250 }
[ "javax.swing.JComponent", "javax.swing.JFrame" ]
import javax.swing.JComponent; import javax.swing.JFrame;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
372,449
public Observable<ServiceResponse<Page<USqlTable>>> listTablesSinglePageAsync(final String accountName, final String databaseName, final String schemaName, final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) { if (accountName == null) { throw new IllegalArgumentException("Parameter accountName is required and cannot be null."); } if (this.client.adlaCatalogDnsSuffix() == null) { throw new IllegalArgumentException("Parameter this.client.adlaCatalogDnsSuffix() is required and cannot be null."); } if (databaseName == null) { throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); } if (schemaName == null) { throw new IllegalArgumentException("Parameter schemaName is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); }
Observable<ServiceResponse<Page<USqlTable>>> function(final String accountName, final String databaseName, final String schemaName, final String filter, final Integer top, final Integer skip, final String select, final String orderby, final Boolean count) { if (accountName == null) { throw new IllegalArgumentException(STR); } if (this.client.adlaCatalogDnsSuffix() == null) { throw new IllegalArgumentException(STR); } if (databaseName == null) { throw new IllegalArgumentException(STR); } if (schemaName == null) { throw new IllegalArgumentException(STR); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException(STR); }
/** * Retrieves the list of tables from the Data Lake Analytics catalog. * ServiceResponse<PageImpl<USqlTable>> * @param accountName The Azure Data Lake Analytics account upon which to execute catalog operations. ServiceResponse<PageImpl<USqlTable>> * @param databaseName The name of the database containing the tables. ServiceResponse<PageImpl<USqlTable>> * @param schemaName The name of the schema containing the tables. ServiceResponse<PageImpl<USqlTable>> * @param filter OData filter. Optional. ServiceResponse<PageImpl<USqlTable>> * @param top The number of items to return. Optional. ServiceResponse<PageImpl<USqlTable>> * @param skip The number of items to skip over before returning elements. Optional. ServiceResponse<PageImpl<USqlTable>> * @param select OData Select statement. Limits the properties on each entry to just those requested, e.g. Categories?$select=CategoryName,Description. Optional. ServiceResponse<PageImpl<USqlTable>> * @param orderby OrderBy clause. One or more comma-separated expressions with an optional "asc" (the default) or "desc" depending on the order you'd like the values sorted, e.g. Categories?$orderby=CategoryName desc. Optional. ServiceResponse<PageImpl<USqlTable>> * @param count The Boolean value of true or false to request a count of the matching resources included with the resources in the response, e.g. Categories?$count=true. Optional. * @return the PagedList&lt;USqlTable&gt; object wrapped in {@link ServiceResponse} if successful. */
Retrieves the list of tables from the Data Lake Analytics catalog
listTablesSinglePageAsync
{ "repo_name": "anudeepsharma/azure-sdk-for-java", "path": "azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/implementation/CatalogsImpl.java", "license": "mit", "size": 474209 }
[ "com.microsoft.azure.Page", "com.microsoft.azure.management.datalake.analytics.models.USqlTable", "com.microsoft.rest.ServiceResponse" ]
import com.microsoft.azure.Page; import com.microsoft.azure.management.datalake.analytics.models.USqlTable; import com.microsoft.rest.ServiceResponse;
import com.microsoft.azure.*; import com.microsoft.azure.management.datalake.analytics.models.*; import com.microsoft.rest.*;
[ "com.microsoft.azure", "com.microsoft.rest" ]
com.microsoft.azure; com.microsoft.rest;
1,914,543
public static ArrayList<Player> getAllPlayers(EventData eventData) { if(eventData != null) { ArrayList<Player> allPlayers = eventData.getPlayerList().stream().collect(Collectors.toCollection(ArrayList::new)); allPlayers.add(eventData.getOwner()); return allPlayers; } return new ArrayList<>(); }
static ArrayList<Player> function(EventData eventData) { if(eventData != null) { ArrayList<Player> allPlayers = eventData.getPlayerList().stream().collect(Collectors.toCollection(ArrayList::new)); allPlayers.add(eventData.getOwner()); return allPlayers; } return new ArrayList<>(); }
/** * get all players of an event including the owner * @param eventData the event * @return ArrayList of Player */
get all players of an event including the owner
getAllPlayers
{ "repo_name": "Alf21/event-system", "path": "src/main/java/me/alf21/eventsystem/EventFunctions.java", "license": "gpl-3.0", "size": 12808 }
[ "java.util.ArrayList", "java.util.stream.Collectors", "net.gtaun.shoebill.object.Player" ]
import java.util.ArrayList; import java.util.stream.Collectors; import net.gtaun.shoebill.object.Player;
import java.util.*; import java.util.stream.*; import net.gtaun.shoebill.object.*;
[ "java.util", "net.gtaun.shoebill" ]
java.util; net.gtaun.shoebill;
2,477,877
private static <T> int gallopRight (T key, T[] a, int base, int len, int hint, Comparator<? super T> c) { if (DEBUG) assert len > 0 && hint >= 0 && hint < len; int ofs = 1; int lastOfs = 0; if (c.compare(key, a[base + hint]) < 0) { // Gallop left until a[b+hint - ofs] <= key < a[b+hint - lastOfs] int maxOfs = hint + 1; while (ofs < maxOfs && c.compare(key, a[base + hint - ofs]) < 0) { lastOfs = ofs; ofs = (ofs << 1) + 1; if (ofs <= 0) // int overflow ofs = maxOfs; } if (ofs > maxOfs) ofs = maxOfs; // Make offsets relative to b int tmp = lastOfs; lastOfs = hint - ofs; ofs = hint - tmp; } else { // a[b + hint] <= key // Gallop right until a[b+hint + lastOfs] <= key < a[b+hint + ofs] int maxOfs = len - hint; while (ofs < maxOfs && c.compare(key, a[base + hint + ofs]) >= 0) { lastOfs = ofs; ofs = (ofs << 1) + 1; if (ofs <= 0) // int overflow ofs = maxOfs; } if (ofs > maxOfs) ofs = maxOfs; // Make offsets relative to b lastOfs += hint; ofs += hint; } if (DEBUG) assert -1 <= lastOfs && lastOfs < ofs && ofs <= len; lastOfs++; while (lastOfs < ofs) { int m = lastOfs + ((ofs - lastOfs) >>> 1); if (c.compare(key, a[base + m]) < 0) ofs = m; // key < a[b + m] else lastOfs = m + 1; // a[b + m] <= key } if (DEBUG) assert lastOfs == ofs; // so a[b + ofs - 1] <= key < a[b + ofs] return ofs; }
static <T> int function (T key, T[] a, int base, int len, int hint, Comparator<? super T> c) { if (DEBUG) assert len > 0 && hint >= 0 && hint < len; int ofs = 1; int lastOfs = 0; if (c.compare(key, a[base + hint]) < 0) { int maxOfs = hint + 1; while (ofs < maxOfs && c.compare(key, a[base + hint - ofs]) < 0) { lastOfs = ofs; ofs = (ofs << 1) + 1; if (ofs <= 0) ofs = maxOfs; } if (ofs > maxOfs) ofs = maxOfs; int tmp = lastOfs; lastOfs = hint - ofs; ofs = hint - tmp; } else { int maxOfs = len - hint; while (ofs < maxOfs && c.compare(key, a[base + hint + ofs]) >= 0) { lastOfs = ofs; ofs = (ofs << 1) + 1; if (ofs <= 0) ofs = maxOfs; } if (ofs > maxOfs) ofs = maxOfs; lastOfs += hint; ofs += hint; } if (DEBUG) assert -1 <= lastOfs && lastOfs < ofs && ofs <= len; lastOfs++; while (lastOfs < ofs) { int m = lastOfs + ((ofs - lastOfs) >>> 1); if (c.compare(key, a[base + m]) < 0) ofs = m; else lastOfs = m + 1; } if (DEBUG) assert lastOfs == ofs; return ofs; }
/** Like gallopLeft, except that if the range contains an element equal to key, gallopRight returns the index after the * rightmost equal element. * * @param key the key whose insertion point to search for * @param a the array in which to search * @param base the index of the first element in the range * @param len the length of the range; must be > 0 * @param hint the index at which to begin the search, 0 <= hint < n. The closer hint is to the result, the faster this method * will run. * @param c the comparator used to order the range, and to search * @return the int k, 0 <= k <= n such that a[b + k - 1] <= key < a[b + k] */
Like gallopLeft, except that if the range contains an element equal to key, gallopRight returns the index after the rightmost equal element
gallopRight
{ "repo_name": "Guerra24/NanoUI", "path": "nanoui-core/src/main/java/com/badlogic/gdx/utils/TimSort.java", "license": "gpl-3.0", "size": 31691 }
[ "java.util.Comparator" ]
import java.util.Comparator;
import java.util.*;
[ "java.util" ]
java.util;
2,497,884
@Test @SmallTest @Feature({"Preferences"}) @Features.EnableFeatures(ChromeFeatureList.PASSWORD_EDITING_ANDROID) public void testPasswordEditingMethodWasCalled() throws Exception { PasswordEditingDelegateProvider.getInstance().setPasswordEditingDelegate( mMockPasswordEditingDelegate); setPasswordSource(new SavedPasswordEntry("https://example.com", "test user", "password")); mSettingsActivityTestRule.startSettingsActivity(); Espresso.onView(withText(containsString("test user"))).perform(click()); Espresso.onView(withEditMenuIdOrText()).perform(click()); Espresso.onView(withId(R.id.username_edit)).perform(typeText(" new")); Espresso.onView(withSaveMenuIdOrText()).perform(click()); verify(mMockPasswordEditingDelegate).editSavedPasswordEntry("test user new", "password"); // Verify that the delegate was destroyed when the password editing activity finished. waitForEvent().destroy(); }
@Feature({STR}) @Features.EnableFeatures(ChromeFeatureList.PASSWORD_EDITING_ANDROID) void function() throws Exception { PasswordEditingDelegateProvider.getInstance().setPasswordEditingDelegate( mMockPasswordEditingDelegate); setPasswordSource(new SavedPasswordEntry(STRtest userSTR newSTRtest user newSTRpassword"); waitForEvent().destroy(); }
/** * Check that the password editing method from the PasswordEditingDelegate was called when the * save button in the password editing activity was clicked. */
Check that the password editing method from the PasswordEditingDelegate was called when the save button in the password editing activity was clicked
testPasswordEditingMethodWasCalled
{ "repo_name": "endlessm/chromium-browser", "path": "chrome/android/javatests/src/org/chromium/chrome/browser/password_manager/settings/PasswordSettingsTest.java", "license": "bsd-3-clause", "size": 94005 }
[ "org.chromium.base.test.util.Feature", "org.chromium.chrome.browser.flags.ChromeFeatureList", "org.chromium.chrome.test.util.browser.Features" ]
import org.chromium.base.test.util.Feature; import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.test.util.browser.Features;
import org.chromium.base.test.util.*; import org.chromium.chrome.browser.flags.*; import org.chromium.chrome.test.util.browser.*;
[ "org.chromium.base", "org.chromium.chrome" ]
org.chromium.base; org.chromium.chrome;
2,031,399
public static Source getEnvelopeSource(WebServiceMessage message) { return ((SoapMessage)message).getEnvelope().getSource(); }
static Source function(WebServiceMessage message) { return ((SoapMessage)message).getEnvelope().getSource(); }
/** * Returns source of message envelope * @param message * @return */
Returns source of message envelope
getEnvelopeSource
{ "repo_name": "lukas-krecan/smock", "path": "common/src/main/java/net/javacrumbs/smock/common/XmlUtil.java", "license": "apache-2.0", "size": 4104 }
[ "javax.xml.transform.Source", "org.springframework.ws.WebServiceMessage", "org.springframework.ws.soap.SoapMessage" ]
import javax.xml.transform.Source; import org.springframework.ws.WebServiceMessage; import org.springframework.ws.soap.SoapMessage;
import javax.xml.transform.*; import org.springframework.ws.*; import org.springframework.ws.soap.*;
[ "javax.xml", "org.springframework.ws" ]
javax.xml; org.springframework.ws;
2,062,380
//@ requires xEncryptedVote != null; //@ requires xKiezer != null; //@ ensures \result != null; //@ signals (KOAException) false; private String saveEncryptedVote( EncryptedStem xEncryptedVote, Kiezers xKiezer) throws ie.ucd.srg.koa.exception.KOAException { KOALogHelper.log( KOALogHelper.TRACE, "[StemprocesSessionEJB] Entering saveEncryptedVote()"); String txCode = null; try { txCode = getNextTransactionCode(); xKiezer.setTransactienummer(txCode); xKiezer.setReedsgestemd(new Boolean(true)); //store encrypted vote ESBSessionEJBHome xESBSessionEJBHome = ObjectCache.getInstance().getESBSessionEJBHome(); ESBSessionEJB xESBSessionEJB = xESBSessionEJBHome.create(); xESBSessionEJB.saveEncryptedVote(xEncryptedVote); } catch (javax.ejb.CreateException xCreateException) { KOALogHelper.log(KOALogHelper.ERROR, xCreateException.getMessage()); throw new KOAException( ErrorConstants.VOTER_EXECUTE_VOTE_ERROR, xCreateException); } catch (java.rmi.RemoteException xRemoteExc) { KOALogHelper.log(KOALogHelper.ERROR, xRemoteExc.getMessage()); throw new KOAException( ErrorConstants.VOTER_EXECUTE_VOTE_ERROR, xRemoteExc); } catch (KOAException koae) { KOALogHelper.log(KOALogHelper.ERROR, koae.getMessage()); throw new KOAException( ErrorConstants.VOTER_EXECUTE_VOTE_ERROR, koae); } KOALogHelper.log( KOALogHelper.TRACE, "[StemprocesSessionEJB] Exit saveEncryptedVote()"); return txCode; }
String function( EncryptedStem xEncryptedVote, Kiezers xKiezer) throws ie.ucd.srg.koa.exception.KOAException { KOALogHelper.log( KOALogHelper.TRACE, STR); String txCode = null; try { txCode = getNextTransactionCode(); xKiezer.setTransactienummer(txCode); xKiezer.setReedsgestemd(new Boolean(true)); ESBSessionEJBHome xESBSessionEJBHome = ObjectCache.getInstance().getESBSessionEJBHome(); ESBSessionEJB xESBSessionEJB = xESBSessionEJBHome.create(); xESBSessionEJB.saveEncryptedVote(xEncryptedVote); } catch (javax.ejb.CreateException xCreateException) { KOALogHelper.log(KOALogHelper.ERROR, xCreateException.getMessage()); throw new KOAException( ErrorConstants.VOTER_EXECUTE_VOTE_ERROR, xCreateException); } catch (java.rmi.RemoteException xRemoteExc) { KOALogHelper.log(KOALogHelper.ERROR, xRemoteExc.getMessage()); throw new KOAException( ErrorConstants.VOTER_EXECUTE_VOTE_ERROR, xRemoteExc); } catch (KOAException koae) { KOALogHelper.log(KOALogHelper.ERROR, koae.getMessage()); throw new KOAException( ErrorConstants.VOTER_EXECUTE_VOTE_ERROR, koae); } KOALogHelper.log( KOALogHelper.TRACE, STR); return txCode; }
/** * This method sores the encrypted vote in the ESB and marks the user as already voted * * Note : This method has to cinfigured as on single transaction !!! * * @param EncryptedVote - The encrypte vote object to be stored * * @return String the transactioncode which belongs to this vote * * @exception ie.ucd.srg.koa.exception.KOAException * * Before OR22.3.93: * @return boolean - True if the updates are succesfully * False when the updates aren't stored * * @exception ie.ucd.srg.koa.exception.KOAException */
This method sores the encrypted vote in the ESB and marks the user as already voted Note : This method has to cinfigured as on single transaction !!
saveEncryptedVote
{ "repo_name": "GaloisInc/KOA", "path": "infrastructure/source/WebVotingSystem/src/ie/ucd/srg/koa/stemproces/beans/StemprocesSessionEJBBean.java", "license": "gpl-2.0", "size": 26245 }
[ "ie.ucd.srg.koa.constants.ErrorConstants", "ie.ucd.srg.koa.dataobjects.EncryptedStem", "ie.ucd.srg.koa.esb.beans.ESBSessionEJB", "ie.ucd.srg.koa.esb.beans.ESBSessionEJBHome", "ie.ucd.srg.koa.exception.KOAException", "ie.ucd.srg.koa.kr.beans.Kiezers", "ie.ucd.srg.koa.utils.KOALogHelper", "ie.ucd.srg.koa.utils.ObjectCache" ]
import ie.ucd.srg.koa.constants.ErrorConstants; import ie.ucd.srg.koa.dataobjects.EncryptedStem; import ie.ucd.srg.koa.esb.beans.ESBSessionEJB; import ie.ucd.srg.koa.esb.beans.ESBSessionEJBHome; import ie.ucd.srg.koa.exception.KOAException; import ie.ucd.srg.koa.kr.beans.Kiezers; import ie.ucd.srg.koa.utils.KOALogHelper; import ie.ucd.srg.koa.utils.ObjectCache;
import ie.ucd.srg.koa.constants.*; import ie.ucd.srg.koa.dataobjects.*; import ie.ucd.srg.koa.esb.beans.*; import ie.ucd.srg.koa.exception.*; import ie.ucd.srg.koa.kr.beans.*; import ie.ucd.srg.koa.utils.*;
[ "ie.ucd.srg" ]
ie.ucd.srg;
1,123,811
public void setDataStore(DataStore dataStore) { this.dataStore = dataStore; }
void function(DataStore dataStore) { this.dataStore = dataStore; }
/** * Sets the data store. * * @param dataStore the dataStore to set */
Sets the data store
setDataStore
{ "repo_name": "robward-scisys/sldeditor", "path": "modules/application/src/main/java/com/sldeditor/datasource/impl/DataSourceInfo.java", "license": "gpl-3.0", "size": 11271 }
[ "org.geotools.data.DataStore" ]
import org.geotools.data.DataStore;
import org.geotools.data.*;
[ "org.geotools.data" ]
org.geotools.data;
359,812
public SearchSourceBuilder sort(String name, SortOrder order) { return sort(SortBuilders.fieldSort(name).order(order)); }
SearchSourceBuilder function(String name, SortOrder order) { return sort(SortBuilders.fieldSort(name).order(order)); }
/** * Adds a sort against the given field name and the sort ordering. * * @param name * The name of the field * @param order * The sort ordering */
Adds a sort against the given field name and the sort ordering
sort
{ "repo_name": "drewr/elasticsearch", "path": "core/src/main/java/org/elasticsearch/search/builder/SearchSourceBuilder.java", "license": "apache-2.0", "size": 54962 }
[ "org.elasticsearch.search.sort.SortBuilders", "org.elasticsearch.search.sort.SortOrder" ]
import org.elasticsearch.search.sort.SortBuilders; import org.elasticsearch.search.sort.SortOrder;
import org.elasticsearch.search.sort.*;
[ "org.elasticsearch.search" ]
org.elasticsearch.search;
2,691,512
@Override public void revokeOAuthConsentByApplicationAndUser(String username, String tenantDomain, String applicationName) throws IdentityOAuth2Exception { if (log.isDebugEnabled()) { log.debug("Revoking OAuth consent for application: " + applicationName + " by user: " + username + " " + "tenant: " + tenantDomain); } if (username == null || applicationName == null) { if (log.isDebugEnabled()) { log.debug("Could not remove consent of user " + username + " for application " + applicationName); } return; } Connection connection = IdentityDatabaseUtil.getDBConnection(); PreparedStatement ps = null; try { String sql = SQLQueries.DELETE_USER_RPS_IN_TENANT; ps = connection.prepareStatement(sql); ps.setString(1, username); ps.setInt(2, IdentityTenantUtil.getTenantId(tenantDomain)); ps.setString(3, applicationName); ps.execute(); IdentityDatabaseUtil.commitTransaction(connection); } catch (SQLException e) { IdentityDatabaseUtil.rollbackTransaction(connection); String errorMsg = "Error deleting OAuth consent of Application " + applicationName + " and User " + username; throw new IdentityOAuth2Exception(errorMsg, e); } finally { IdentityDatabaseUtil.closeAllConnections(connection, null, ps); } }
void function(String username, String tenantDomain, String applicationName) throws IdentityOAuth2Exception { if (log.isDebugEnabled()) { log.debug(STR + applicationName + STR + username + " " + STR + tenantDomain); } if (username == null applicationName == null) { if (log.isDebugEnabled()) { log.debug(STR + username + STR + applicationName); } return; } Connection connection = IdentityDatabaseUtil.getDBConnection(); PreparedStatement ps = null; try { String sql = SQLQueries.DELETE_USER_RPS_IN_TENANT; ps = connection.prepareStatement(sql); ps.setString(1, username); ps.setInt(2, IdentityTenantUtil.getTenantId(tenantDomain)); ps.setString(3, applicationName); ps.execute(); IdentityDatabaseUtil.commitTransaction(connection); } catch (SQLException e) { IdentityDatabaseUtil.rollbackTransaction(connection); String errorMsg = STR + applicationName + STR + username; throw new IdentityOAuth2Exception(errorMsg, e); } finally { IdentityDatabaseUtil.closeAllConnections(connection, null, ps); } }
/** * Revoke the OAuth Consent which is recorded in the IDN_OPENID_USER_RPS table against the user for a particular * Application * * @param username - Username of the Consent owner * @param applicationName - Name of the OAuth App * @throws IdentityOAuth2Exception - If an unexpected error occurs. */
Revoke the OAuth Consent which is recorded in the IDN_OPENID_USER_RPS table against the user for a particular Application
revokeOAuthConsentByApplicationAndUser
{ "repo_name": "wso2-extensions/identity-inbound-auth-oauth", "path": "components/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth2/dao/TokenManagementDAOImpl.java", "license": "apache-2.0", "size": 36906 }
[ "java.sql.Connection", "java.sql.PreparedStatement", "java.sql.SQLException", "org.wso2.carbon.identity.core.util.IdentityDatabaseUtil", "org.wso2.carbon.identity.core.util.IdentityTenantUtil", "org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception" ]
import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; import org.wso2.carbon.identity.core.util.IdentityDatabaseUtil; import org.wso2.carbon.identity.core.util.IdentityTenantUtil; import org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception;
import java.sql.*; import org.wso2.carbon.identity.core.util.*; import org.wso2.carbon.identity.oauth2.*;
[ "java.sql", "org.wso2.carbon" ]
java.sql; org.wso2.carbon;
1,554,738
public static double[] getDoubles(List<Double> values) { int length = values.size(); double[] result = new double[length]; for (int i = 0; i < length; i++) { result[i] = values.get(i).doubleValue(); } return result; }
static double[] function(List<Double> values) { int length = values.size(); double[] result = new double[length]; for (int i = 0; i < length; i++) { result[i] = values.get(i).doubleValue(); } return result; }
/** * Transforms a list of Double values into an array of double. * * @param values * the list of Double * @return the array of doubles */
Transforms a list of Double values into an array of double
getDoubles
{ "repo_name": "vniu/Android-SmartChart", "path": "SmartChart/src/com/lecast/smartchart/utils/MathHelper.java", "license": "apache-2.0", "size": 5755 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
585,707
static public DecimalType deltaSince(Item item, AbstractInstant timestamp, String serviceName) { HistoricItem itemThen = historicState(item, timestamp); DecimalType valueThen = (DecimalType) itemThen.getState(); DecimalType valueNow = (DecimalType) item.getStateAs(DecimalType.class); DecimalType result = null; if (( valueThen != null) && ( valueNow != null)) { result = new DecimalType(valueNow.doubleValue() - valueThen.doubleValue()); }; return result; }
static DecimalType function(Item item, AbstractInstant timestamp, String serviceName) { HistoricItem itemThen = historicState(item, timestamp); DecimalType valueThen = (DecimalType) itemThen.getState(); DecimalType valueNow = (DecimalType) item.getStateAs(DecimalType.class); DecimalType result = null; if (( valueThen != null) && ( valueNow != null)) { result = new DecimalType(valueNow.doubleValue() - valueThen.doubleValue()); }; return result; }
/** * Gets the difference value of the state of a given <code>item</code> since a certain point in time. * The {@link PersistenceService} identified by the <code>serviceName</code> is used. * * @param item the item to get the average state value for * @param the point in time to start the check * @param serviceName the name of the {@link PersistenceService} to use * @return the difference between now and then, null if not calculable */
Gets the difference value of the state of a given <code>item</code> since a certain point in time. The <code>PersistenceService</code> identified by the <code>serviceName</code> is used
deltaSince
{ "repo_name": "hubermi/openhab", "path": "bundles/core/org.openhab.core.persistence/src/main/java/org/openhab/core/persistence/extensions/PersistenceExtensions.java", "license": "epl-1.0", "size": 19510 }
[ "org.joda.time.base.AbstractInstant", "org.openhab.core.items.Item", "org.openhab.core.library.types.DecimalType", "org.openhab.core.persistence.HistoricItem" ]
import org.joda.time.base.AbstractInstant; import org.openhab.core.items.Item; import org.openhab.core.library.types.DecimalType; import org.openhab.core.persistence.HistoricItem;
import org.joda.time.base.*; import org.openhab.core.items.*; import org.openhab.core.library.types.*; import org.openhab.core.persistence.*;
[ "org.joda.time", "org.openhab.core" ]
org.joda.time; org.openhab.core;
395,516
return (GroupChat) getMessage().getChat(); }
return (GroupChat) getMessage().getChat(); }
/** * Gets the Chat that had its title changed that triggered this Event * * @return The Chat that had its title changed that triggered this Event */
Gets the Chat that had its title changed that triggered this Event
getChat
{ "repo_name": "zackpollard/JavaTelegramBot-API", "path": "core/src/main/java/pro/zackpollard/telegrambot/api/event/chat/NewGroupChatTitleEvent.java", "license": "gpl-3.0", "size": 940 }
[ "pro.zackpollard.telegrambot.api.chat.GroupChat" ]
import pro.zackpollard.telegrambot.api.chat.GroupChat;
import pro.zackpollard.telegrambot.api.chat.*;
[ "pro.zackpollard.telegrambot" ]
pro.zackpollard.telegrambot;
689,344
private void readPixelFormat() throws IOException { int pfSize = in.readInt(); if (pfSize != 32) { throw new IOException("Pixel format size is " + pfSize + ", not 32"); } int pfFlags = in.readInt(); normal = is(pfFlags, DDPF_NORMAL); if (is(pfFlags, DDPF_FOURCC)) { compressed = true; int fourcc = in.readInt(); int swizzle = in.readInt(); in.skipBytes(16); switch (fourcc) { case PF_DXT1: bpp = 4; if (is(pfFlags, DDPF_ALPHAPIXELS)) { pixelFormat = Image.Format.DXT1A; } else { pixelFormat = Image.Format.DXT1; } break; case PF_DXT3: bpp = 8; pixelFormat = Image.Format.DXT3; break; case PF_DXT5: bpp = 8; pixelFormat = Image.Format.DXT5; if (swizzle == SWIZZLE_xGxR) { normal = true; } break; case PF_DX10: compressed = false; directx10 = true; // exit here, the rest of the structure is not valid // the real format will be available in the DX10 header return; default: throw new IOException("Unknown fourcc: " + string(fourcc) + ", " + Integer.toHexString(fourcc)); } int size = ((width + 3) / 4) * ((height + 3) / 4) * bpp * 2; if (is(flags, DDSD_LINEARSIZE)) { if (pitchOrSize == 0) { logger.warning("Must use linear size with fourcc"); pitchOrSize = size; } else if (pitchOrSize != size) { logger.log(Level.WARNING, "Expected size = {0}, real = {1}", new Object[]{size, pitchOrSize}); } } else { pitchOrSize = size; } } else { compressed = false; // skip fourCC in.readInt(); bpp = in.readInt(); redMask = in.readInt(); greenMask = in.readInt(); blueMask = in.readInt(); alphaMask = in.readInt(); if (is(pfFlags, DDPF_RGB)) { if (is(pfFlags, DDPF_ALPHAPIXELS)) { if (bpp == 16) { pixelFormat = Format.RGB5A1; } else { pixelFormat = Format.RGBA8; } } else { if (bpp == 16) { pixelFormat = Format.RGB565; } else { pixelFormat = Format.RGB8; } } } else if (is(pfFlags, DDPF_GRAYSCALE) && is(pfFlags, DDPF_ALPHAPIXELS)) { switch (bpp) { case 16: pixelFormat = Format.Luminance8Alpha8; break; default: throw new IOException("Unsupported GrayscaleAlpha BPP: " + bpp); } grayscaleOrAlpha = true; } else if (is(pfFlags, DDPF_GRAYSCALE)) { switch (bpp) { case 8: pixelFormat = Format.Luminance8; break; default: throw new IOException("Unsupported Grayscale BPP: " + bpp); } grayscaleOrAlpha = true; } else if (is(pfFlags, DDPF_ALPHA)) { switch (bpp) { case 8: pixelFormat = Format.Alpha8; break; default: throw new IOException("Unsupported Alpha BPP: " + bpp); } grayscaleOrAlpha = true; } else { throw new IOException("Unknown PixelFormat in DDS file"); } int size = (bpp / 8 * width); if (is(flags, DDSD_LINEARSIZE)) { if (pitchOrSize == 0) { logger.warning("Linear size said to contain valid value but does not"); pitchOrSize = size; } else if (pitchOrSize != size) { logger.log(Level.WARNING, "Expected size = {0}, real = {1}", new Object[]{size, pitchOrSize}); } } else { pitchOrSize = size; } } }
void function() throws IOException { int pfSize = in.readInt(); if (pfSize != 32) { throw new IOException(STR + pfSize + STR); } int pfFlags = in.readInt(); normal = is(pfFlags, DDPF_NORMAL); if (is(pfFlags, DDPF_FOURCC)) { compressed = true; int fourcc = in.readInt(); int swizzle = in.readInt(); in.skipBytes(16); switch (fourcc) { case PF_DXT1: bpp = 4; if (is(pfFlags, DDPF_ALPHAPIXELS)) { pixelFormat = Image.Format.DXT1A; } else { pixelFormat = Image.Format.DXT1; } break; case PF_DXT3: bpp = 8; pixelFormat = Image.Format.DXT3; break; case PF_DXT5: bpp = 8; pixelFormat = Image.Format.DXT5; if (swizzle == SWIZZLE_xGxR) { normal = true; } break; case PF_DX10: compressed = false; directx10 = true; return; default: throw new IOException(STR + string(fourcc) + STR + Integer.toHexString(fourcc)); } int size = ((width + 3) / 4) * ((height + 3) / 4) * bpp * 2; if (is(flags, DDSD_LINEARSIZE)) { if (pitchOrSize == 0) { logger.warning(STR); pitchOrSize = size; } else if (pitchOrSize != size) { logger.log(Level.WARNING, STR, new Object[]{size, pitchOrSize}); } } else { pitchOrSize = size; } } else { compressed = false; in.readInt(); bpp = in.readInt(); redMask = in.readInt(); greenMask = in.readInt(); blueMask = in.readInt(); alphaMask = in.readInt(); if (is(pfFlags, DDPF_RGB)) { if (is(pfFlags, DDPF_ALPHAPIXELS)) { if (bpp == 16) { pixelFormat = Format.RGB5A1; } else { pixelFormat = Format.RGBA8; } } else { if (bpp == 16) { pixelFormat = Format.RGB565; } else { pixelFormat = Format.RGB8; } } } else if (is(pfFlags, DDPF_GRAYSCALE) && is(pfFlags, DDPF_ALPHAPIXELS)) { switch (bpp) { case 16: pixelFormat = Format.Luminance8Alpha8; break; default: throw new IOException(STR + bpp); } grayscaleOrAlpha = true; } else if (is(pfFlags, DDPF_GRAYSCALE)) { switch (bpp) { case 8: pixelFormat = Format.Luminance8; break; default: throw new IOException(STR + bpp); } grayscaleOrAlpha = true; } else if (is(pfFlags, DDPF_ALPHA)) { switch (bpp) { case 8: pixelFormat = Format.Alpha8; break; default: throw new IOException(STR + bpp); } grayscaleOrAlpha = true; } else { throw new IOException(STR); } int size = (bpp / 8 * width); if (is(flags, DDSD_LINEARSIZE)) { if (pitchOrSize == 0) { logger.warning(STR); pitchOrSize = size; } else if (pitchOrSize != size) { logger.log(Level.WARNING, STR, new Object[]{size, pitchOrSize}); } } else { pitchOrSize = size; } } }
/** * Reads the PixelFormat structure in a DDS file */
Reads the PixelFormat structure in a DDS file
readPixelFormat
{ "repo_name": "delftsre/jmonkeyengine", "path": "jme3-core/src/plugins/java/com/jme3/texture/plugins/DDSLoader.java", "license": "bsd-3-clause", "size": 30279 }
[ "com.jme3.texture.Image", "java.io.IOException", "java.util.logging.Level" ]
import com.jme3.texture.Image; import java.io.IOException; import java.util.logging.Level;
import com.jme3.texture.*; import java.io.*; import java.util.logging.*;
[ "com.jme3.texture", "java.io", "java.util" ]
com.jme3.texture; java.io; java.util;
247,447
@Nonnull public static UBL23WriterBuilder<RequestForQuotationType> requestForQuotation(){return UBL23WriterBuilder.create(RequestForQuotationType.class);}
@Nonnull public static UBL23WriterBuilder<RequestForQuotationType> requestForQuotation(){return UBL23WriterBuilder.create(RequestForQuotationType.class);}
/** Create a writer builder for RemittanceAdvice. @return The builder and never <code>null</code> */
Create a writer builder for RemittanceAdvice
remittanceAdvice
{ "repo_name": "phax/ph-ubl", "path": "ph-ubl23/src/main/java/com/helger/ubl23/UBL23Writer.java", "license": "apache-2.0", "size": 32994 }
[ "javax.annotation.Nonnull" ]
import javax.annotation.Nonnull;
import javax.annotation.*;
[ "javax.annotation" ]
javax.annotation;
141,824
@Override public URL getURL(String parameterName) throws SQLException { throw unsupported("url"); }
URL function(String parameterName) throws SQLException { throw unsupported("url"); }
/** * [Not supported] */
[Not supported]
getURL
{ "repo_name": "miloszpiglas/h2mod", "path": "src/main/org/h2/jdbc/JdbcCallableStatement.java", "license": "mpl-2.0", "size": 53201 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
2,450,865
public boolean has(String name, Scriptable start) { return propertyNames.contains(name); }
boolean function(String name, Scriptable start) { return propertyNames.contains(name); }
/** * Check for the named property presence. * * @return true if it is a defined eventOut or field */
Check for the named property presence
has
{ "repo_name": "Norkart/NK-VirtualGlobe", "path": "Xj3D/src/java/org/web3d/vrml/scripting/ecmascript/builtin/FieldDefinitionArray.java", "license": "gpl-2.0", "size": 3143 }
[ "org.mozilla.javascript.Scriptable" ]
import org.mozilla.javascript.Scriptable;
import org.mozilla.javascript.*;
[ "org.mozilla.javascript" ]
org.mozilla.javascript;
1,392,463
private void readToken() { try { while (!eof && tokenQueue.isEmpty()) { String line = readLine(); if (line != null) { resetColumn(); processLine(line); } else { eof = true; // wrap up the final multi-line token, if any wrapUpandResetEntryCollector(); ioReader.close(); } } } catch (IOException e) { try { ioReader.close(); } catch (IOException e2) { throw new ParseException(e2.getMessage(), e2, lineNumber()); } throw new ParseException(e.getMessage(), e, lineNumber()); } }
void function() { try { while (!eof && tokenQueue.isEmpty()) { String line = readLine(); if (line != null) { resetColumn(); processLine(line); } else { eof = true; wrapUpandResetEntryCollector(); ioReader.close(); } } } catch (IOException e) { try { ioReader.close(); } catch (IOException e2) { throw new ParseException(e2.getMessage(), e2, lineNumber()); } throw new ParseException(e.getMessage(), e, lineNumber()); } }
/** * Reads in one or more lines until at least one token is encountered. * Precondition: tokenQueue.isEmpty() */
Reads in one or more lines until at least one token is encountered. Precondition: tokenQueue.isEmpty()
readToken
{ "repo_name": "Jobava/jgettext", "path": "src/main/java/org/fedorahosted/tennera/jgettext/catalog/parse/CatalogLexer.java", "license": "gpl-2.0", "size": 20765 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
824,103
public void setAnchorView(ViewGroup view) { mAnchor = view; FrameLayout.LayoutParams frameParams = new FrameLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT ); removeAllViews(); View v = makeControllerView(); addView(v, frameParams); }
void function(ViewGroup view) { mAnchor = view; FrameLayout.LayoutParams frameParams = new FrameLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT ); removeAllViews(); View v = makeControllerView(); addView(v, frameParams); }
/** * Set the view that acts as the anchor for the control view. * This can for example be a VideoView, or your Activity's main view. * @param view The view to which to anchor the controller when it is visible. */
Set the view that acts as the anchor for the control view. This can for example be a VideoView, or your Activity's main view
setAnchorView
{ "repo_name": "wafleh/VideoPlayer", "path": "app/src/main/java/cl/wafle/videoplayer/WafleMediaController.java", "license": "gpl-3.0", "size": 22813 }
[ "android.view.View", "android.view.ViewGroup", "android.widget.FrameLayout" ]
import android.view.View; import android.view.ViewGroup; import android.widget.FrameLayout;
import android.view.*; import android.widget.*;
[ "android.view", "android.widget" ]
android.view; android.widget;
1,334,589
public static Resource createProcessWithMultipleIsolatedActivities() { Resource rv = createBackToBackForkedProcess(); Model model = rv.getModel(); Resource act1 = createActivityElementWithActivity("G", rv); model.add(rv, RNRM.hasElement, act1); Resource act2 = createActivityElementWithActivity("H", rv); model.add(rv, RNRM.hasElement, act2); model.add(act1, RNRM.isFlowingTo, act2); Resource act3 = createActivityElementWithActivity("I", rv); model.add(rv, RNRM.hasElement, act3); model.add(act2, RNRM.isFlowingTo, act3); return rv; }
static Resource function() { Resource rv = createBackToBackForkedProcess(); Model model = rv.getModel(); Resource act1 = createActivityElementWithActivity("G", rv); model.add(rv, RNRM.hasElement, act1); Resource act2 = createActivityElementWithActivity("H", rv); model.add(rv, RNRM.hasElement, act2); model.add(act1, RNRM.isFlowingTo, act2); Resource act3 = createActivityElementWithActivity("I", rv); model.add(rv, RNRM.hasElement, act3); model.add(act2, RNRM.isFlowingTo, act3); return rv; }
/** * Creates a Process with 9 Activities, where 3 are in their own * disconnected graph * * <pre> * A * / \ * B C G * \ / | * / \ H * D E | * \ / I * F * </pre> * * @return {@link Resource} for the created process */
Creates a Process with 9 Activities, where 3 are in their own disconnected graph <code> A \ B C G \ / | \ H D E | \ / I F </code>
createProcessWithMultipleIsolatedActivities
{ "repo_name": "plamenbbn/XDATA", "path": "pint/process-alignment/test/com/bbn/c2s2/pint/testdata/ProcessModelFactory.java", "license": "apache-2.0", "size": 27770 }
[ "com.hp.hpl.jena.rdf.model.Model", "com.hp.hpl.jena.rdf.model.Resource" ]
import com.hp.hpl.jena.rdf.model.Model; import com.hp.hpl.jena.rdf.model.Resource;
import com.hp.hpl.jena.rdf.model.*;
[ "com.hp.hpl" ]
com.hp.hpl;
834,376
public void synchroniseRemoteDesktopData(TableIdentity tableId, Map<String, Map<String, String>> synchronisedItems) { RemoteDesktop remoteDesktop = remoteDesktops.get(tableId); if (remoteDesktop != null) { if (synchronisedItems.size() == 0) { return; } for (String name : synchronisedItems.keySet()) { if (!remoteDesktop.getOnlineItems().containsKey( tableId + "@" + name)) { continue; } OrthoContentItem item = (OrthoContentItem) remoteDesktop .getOnlineItems().get(tableId + "@" + name); for (NetworkedContentListener l : networkedContentManager .getNetworkedContentListeners()) { l.renderRemoteDesktop(remoteDesktop, item, synchronisedItems.get(name)); } } if (networkedContentManager.getProjectorController() != null) { for (ProjectorNode projector : networkedContentManager .getProjectorController().getOnlineProjectors()) { projector.synchronise(synchronisedItems); } } } }
void function(TableIdentity tableId, Map<String, Map<String, String>> synchronisedItems) { RemoteDesktop remoteDesktop = remoteDesktops.get(tableId); if (remoteDesktop != null) { if (synchronisedItems.size() == 0) { return; } for (String name : synchronisedItems.keySet()) { if (!remoteDesktop.getOnlineItems().containsKey( tableId + "@" + name)) { continue; } OrthoContentItem item = (OrthoContentItem) remoteDesktop .getOnlineItems().get(tableId + "@" + name); for (NetworkedContentListener l : networkedContentManager .getNetworkedContentListeners()) { l.renderRemoteDesktop(remoteDesktop, item, synchronisedItems.get(name)); } } if (networkedContentManager.getProjectorController() != null) { for (ProjectorNode projector : networkedContentManager .getProjectorController().getOnlineProjectors()) { projector.synchronise(synchronisedItems); } } } }
/** * Synchronise remote desktop data. * * @param tableId * the table id * @param synchronisedItems * the synchronised items */
Synchronise remote desktop data
synchroniseRemoteDesktopData
{ "repo_name": "synergynet/synergynet2.5", "path": "synergynet2.5/src/main/java/synergynetframework/appsystem/services/net/networkedcontentmanager/controllers/RemoteDesktopController.java", "license": "bsd-3-clause", "size": 9868 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
736,906
private static List<ByteString> extractValues(List<Long> lengths, ByteString buf) { List<ByteString> list = new ArrayList<ByteString>(lengths.size()); int start = 0; for (long len : lengths) { if (len < 0) { // This indicates a MySQL NULL value, to distinguish it from a zero-length string. list.add((ByteString) null); } else { // Lengths are returned as long, but ByteString.substring() only supports int. list.add(buf.substring(start, start + (int) len)); start += len; } } return list; }
static List<ByteString> function(List<Long> lengths, ByteString buf) { List<ByteString> list = new ArrayList<ByteString>(lengths.size()); int start = 0; for (long len : lengths) { if (len < 0) { list.add((ByteString) null); } else { list.add(buf.substring(start, start + (int) len)); start += len; } } return list; }
/** * Extract cell values from the single-buffer wire format. * * <p> * See the docs for the {@code Row} message in {@code query.proto}. */
Extract cell values from the single-buffer wire format. See the docs for the Row message in query.proto
extractValues
{ "repo_name": "rnavarro/vitess", "path": "java/client/src/main/java/io/vitess/client/cursor/Row.java", "license": "apache-2.0", "size": 23602 }
[ "com.google.protobuf.ByteString", "java.util.ArrayList", "java.util.List" ]
import com.google.protobuf.ByteString; import java.util.ArrayList; import java.util.List;
import com.google.protobuf.*; import java.util.*;
[ "com.google.protobuf", "java.util" ]
com.google.protobuf; java.util;
228,840
@Override public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); addNamePropertyDescriptor(object); addReferencedTablePropertyDescriptor(object); } return itemPropertyDescriptors; }
List<IItemPropertyDescriptor> function(Object object) { if (itemPropertyDescriptors == null) { super.getPropertyDescriptors(object); addNamePropertyDescriptor(object); addReferencedTablePropertyDescriptor(object); } return itemPropertyDescriptors; }
/** * This returns the property descriptors for the adapted class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This returns the property descriptors for the adapted class.
getPropertyDescriptors
{ "repo_name": "KuehneThomas/model-to-model-transformation-generator", "path": "src/MetaModels.Relational.edit/src/relationalMetaModel/provider/RelationalForeignKeyItemProvider.java", "license": "mit", "size": 5602 }
[ "java.util.List", "org.eclipse.emf.edit.provider.IItemPropertyDescriptor" ]
import java.util.List; import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import java.util.*; import org.eclipse.emf.edit.provider.*;
[ "java.util", "org.eclipse.emf" ]
java.util; org.eclipse.emf;
630,617
EReference getPVPH_MaxOpTmms();
EReference getPVPH_MaxOpTmms();
/** * Returns the meta object for the reference '{@link gluemodel.substationStandard.LNNodes.LNGroupP.PVPH#getMaxOpTmms <em>Max Op Tmms</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the reference '<em>Max Op Tmms</em>'. * @see gluemodel.substationStandard.LNNodes.LNGroupP.PVPH#getMaxOpTmms() * @see #getPVPH() * @generated */
Returns the meta object for the reference '<code>gluemodel.substationStandard.LNNodes.LNGroupP.PVPH#getMaxOpTmms Max Op Tmms</code>'.
getPVPH_MaxOpTmms
{ "repo_name": "georghinkel/ttc2017smartGrids", "path": "solutions/eMoflon/rgse.ttc17.metamodels.src/src/gluemodel/substationStandard/LNNodes/LNGroupP/LNGroupPPackage.java", "license": "mit", "size": 291175 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
555,247
protected static byte[] serializeNormal( Object obj ) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); baos.write(NORMAL); ObjectOutputStream oos = new ObjectOutputStream( baos ); oos.writeObject( obj ); oos.close(); return baos.toByteArray(); }
static byte[] function( Object obj ) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); baos.write(NORMAL); ObjectOutputStream oos = new ObjectOutputStream( baos ); oos.writeObject( obj ); oos.close(); return baos.toByteArray(); }
/** * Serialize the object into a byte array. */
Serialize the object into a byte array
serializeNormal
{ "repo_name": "godwingrs22/jdbm2", "path": "src/main/jdbm/helper/Serialization.java", "license": "apache-2.0", "size": 41083 }
[ "java.io.ByteArrayOutputStream", "java.io.IOException", "java.io.ObjectOutputStream" ]
import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectOutputStream;
import java.io.*;
[ "java.io" ]
java.io;
2,102,826
@Function(name = "getFloat64", arity = 2) public static Object getFloat64(ExecutionContext cx, Object thisValue, Object byteOffset, Object littleEndian) { return GetViewValue(cx, thisValue, byteOffset, littleEndian, ElementType.Float64); }
@Function(name = STR, arity = 2) static Object function(ExecutionContext cx, Object thisValue, Object byteOffset, Object littleEndian) { return GetViewValue(cx, thisValue, byteOffset, littleEndian, ElementType.Float64); }
/** * 24.2.4.6 DataView.prototype.getFloat64(byteOffset, littleEndian=false) */
24.2.4.6 DataView.prototype.getFloat64(byteOffset, littleEndian=false)
getFloat64
{ "repo_name": "rwaldron/es6draft", "path": "src/main/java/com/github/anba/es6draft/runtime/objects/binary/DataViewPrototype.java", "license": "mit", "size": 10244 }
[ "com.github.anba.es6draft.runtime.ExecutionContext", "com.github.anba.es6draft.runtime.internal.Properties", "com.github.anba.es6draft.runtime.objects.binary.DataViewConstructor" ]
import com.github.anba.es6draft.runtime.ExecutionContext; import com.github.anba.es6draft.runtime.internal.Properties; import com.github.anba.es6draft.runtime.objects.binary.DataViewConstructor;
import com.github.anba.es6draft.runtime.*; import com.github.anba.es6draft.runtime.internal.*; import com.github.anba.es6draft.runtime.objects.binary.*;
[ "com.github.anba" ]
com.github.anba;
2,902,354
public static void copy(byte[] in, OutputStream out) throws IOException { Assert.notNull(in, "No input byte array specified"); Assert.notNull(out, "No OutputStream specified"); try { out.write(in); } finally { try { out.close(); } catch (IOException ex) { } } }
static void function(byte[] in, OutputStream out) throws IOException { Assert.notNull(in, STR); Assert.notNull(out, STR); try { out.write(in); } finally { try { out.close(); } catch (IOException ex) { } } }
/** * Copy the contents of the given byte array to the given OutputStream. * Closes the stream when done. * @param in the byte array to copy from * @param out the OutputStream to copy to * @throws IOException in case of I/O errors */
Copy the contents of the given byte array to the given OutputStream. Closes the stream when done
copy
{ "repo_name": "lj654548718/ispring", "path": "src/main/java/io/ispring/ori/utils/FileCopyUtils.java", "license": "apache-2.0", "size": 7038 }
[ "java.io.IOException", "java.io.OutputStream" ]
import java.io.IOException; import java.io.OutputStream;
import java.io.*;
[ "java.io" ]
java.io;
2,015,377
protected void adjustExcludedNodes(HashMap<Node, Node> excludedNodes, Node chosenNode) { // do nothing here. }
void function(HashMap<Node, Node> excludedNodes, Node chosenNode) { }
/** * After choosing a node to place replica, adjust excluded nodes accordingly. * It should do nothing here as chosenNode is already put into exlcudeNodes, * but it can be overridden in subclass to put more related nodes into * excludedNodes. * * @param excludedNodes * @param chosenNode */
After choosing a node to place replica, adjust excluded nodes accordingly. It should do nothing here as chosenNode is already put into exlcudeNodes, but it can be overridden in subclass to put more related nodes into excludedNodes
adjustExcludedNodes
{ "repo_name": "ict-carch/hadoop-plus", "path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockPlacementPolicyDefault.java", "license": "apache-2.0", "size": 31266 }
[ "java.util.HashMap", "org.apache.hadoop.net.Node" ]
import java.util.HashMap; import org.apache.hadoop.net.Node;
import java.util.*; import org.apache.hadoop.net.*;
[ "java.util", "org.apache.hadoop" ]
java.util; org.apache.hadoop;
2,698,497
public static <K, V, C extends Serializable> SimpleDataset<C> createSimpleDataset( DatasetBuilder<K, V> datasetBuilder, LearningEnvironmentBuilder envBuilder, PartitionContextBuilder<K, V, C> partCtxBuilder, IgniteBiFunction<K, V, Vector> featureExtractor) { return create( datasetBuilder, envBuilder, partCtxBuilder, new SimpleDatasetDataBuilder<>(featureExtractor) ).wrap(SimpleDataset::new); }
static <K, V, C extends Serializable> SimpleDataset<C> function( DatasetBuilder<K, V> datasetBuilder, LearningEnvironmentBuilder envBuilder, PartitionContextBuilder<K, V, C> partCtxBuilder, IgniteBiFunction<K, V, Vector> featureExtractor) { return create( datasetBuilder, envBuilder, partCtxBuilder, new SimpleDatasetDataBuilder<>(featureExtractor) ).wrap(SimpleDataset::new); }
/** * Creates a new instance of distributed {@link SimpleDataset} using the specified {@code partCtxBuilder} and * {@code featureExtractor}. This methods determines partition {@code data} to be {@link SimpleDatasetData}, but * allows to use any desired type of partition {@code context}. * * @param datasetBuilder Dataset builder. * @param envBuilder Learning environment builder. * @param partCtxBuilder Partition {@code context} builder. * @param featureExtractor Feature extractor used to extract features and build {@link SimpleDatasetData}. * @param <K> Type of a key in {@code upstream} data. * @param <V> Type of a value in {@code upstream} data. * @param <C> Type of a partition {@code context}. * @return Dataset. */
Creates a new instance of distributed <code>SimpleDataset</code> using the specified partCtxBuilder and featureExtractor. This methods determines partition data to be <code>SimpleDatasetData</code>, but allows to use any desired type of partition context
createSimpleDataset
{ "repo_name": "ptupitsyn/ignite", "path": "modules/ml/src/main/java/org/apache/ignite/ml/dataset/DatasetFactory.java", "license": "apache-2.0", "size": 27431 }
[ "java.io.Serializable", "org.apache.ignite.ml.dataset.primitive.SimpleDataset", "org.apache.ignite.ml.dataset.primitive.builder.data.SimpleDatasetDataBuilder", "org.apache.ignite.ml.environment.LearningEnvironmentBuilder", "org.apache.ignite.ml.math.functions.IgniteBiFunction", "org.apache.ignite.ml.math.primitives.vector.Vector" ]
import java.io.Serializable; import org.apache.ignite.ml.dataset.primitive.SimpleDataset; import org.apache.ignite.ml.dataset.primitive.builder.data.SimpleDatasetDataBuilder; import org.apache.ignite.ml.environment.LearningEnvironmentBuilder; import org.apache.ignite.ml.math.functions.IgniteBiFunction; import org.apache.ignite.ml.math.primitives.vector.Vector;
import java.io.*; import org.apache.ignite.ml.dataset.primitive.*; import org.apache.ignite.ml.dataset.primitive.builder.data.*; import org.apache.ignite.ml.environment.*; import org.apache.ignite.ml.math.functions.*; import org.apache.ignite.ml.math.primitives.vector.*;
[ "java.io", "org.apache.ignite" ]
java.io; org.apache.ignite;
848,819
protected void extendDeposits(int minSize) { while (deposits.size() < minSize) { deposits.add(new Deposit()); } }
void function(int minSize) { while (deposits.size() < minSize) { deposits.add(new Deposit()); } }
/** * Adds default AccountingLineDecorators to sourceAccountingLineDecorators until it contains at least minSize elements * * @param minSize */
Adds default AccountingLineDecorators to sourceAccountingLineDecorators until it contains at least minSize elements
extendDeposits
{ "repo_name": "ua-eas/kfs-devops-automation-fork", "path": "kfs-core/src/main/java/org/kuali/kfs/fp/document/CashManagementDocument.java", "license": "agpl-3.0", "size": 30786 }
[ "org.kuali.kfs.fp.businessobject.Deposit" ]
import org.kuali.kfs.fp.businessobject.Deposit;
import org.kuali.kfs.fp.businessobject.*;
[ "org.kuali.kfs" ]
org.kuali.kfs;
1,501,635
public DrawerActivity addItems(List<DrawerItem> items) { mDrawer.addItems(items); return this; }
DrawerActivity function(List<DrawerItem> items) { mDrawer.addItems(items); return this; }
/** * Adds items to the drawer * * @param items Items to add */
Adds items to the drawer
addItems
{ "repo_name": "huhu/material-drawer", "path": "library/src/main/java/com/heinrichreimersoftware/materialdrawer/DrawerActivity.java", "license": "apache-2.0", "size": 23592 }
[ "com.heinrichreimersoftware.materialdrawer.structure.DrawerItem", "java.util.List" ]
import com.heinrichreimersoftware.materialdrawer.structure.DrawerItem; import java.util.List;
import com.heinrichreimersoftware.materialdrawer.structure.*; import java.util.*;
[ "com.heinrichreimersoftware.materialdrawer", "java.util" ]
com.heinrichreimersoftware.materialdrawer; java.util;
2,112,066
@Test public void testEquals() { PinNeedle n1 = new PinNeedle(); PinNeedle n2 = new PinNeedle(); assertTrue(n1.equals(n2)); assertTrue(n2.equals(n1)); }
void function() { PinNeedle n1 = new PinNeedle(); PinNeedle n2 = new PinNeedle(); assertTrue(n1.equals(n2)); assertTrue(n2.equals(n1)); }
/** * Check that the equals() method can distinguish all fields. */
Check that the equals() method can distinguish all fields
testEquals
{ "repo_name": "GitoMat/jfreechart", "path": "src/test/java/org/jfree/chart/needle/PinNeedleTest.java", "license": "lgpl-2.1", "size": 2632 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
276,494
@ServiceMethod(returns = ReturnType.SINGLE) private Mono<Void> deleteAsync( String resourceGroupName, String crossConnectionName, String peeringName, Context context) { return beginDeleteAsync(resourceGroupName, crossConnectionName, peeringName, context) .last() .flatMap(this.client::getLroFinalResultOrError); }
@ServiceMethod(returns = ReturnType.SINGLE) Mono<Void> function( String resourceGroupName, String crossConnectionName, String peeringName, Context context) { return beginDeleteAsync(resourceGroupName, crossConnectionName, peeringName, context) .last() .flatMap(this.client::getLroFinalResultOrError); }
/** * Deletes the specified peering from the ExpressRouteCrossConnection. * * @param resourceGroupName The name of the resource group. * @param crossConnectionName The name of the ExpressRouteCrossConnection. * @param peeringName The name of the peering. * @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 A {@link Mono} that completes when a successful response is received. */
Deletes the specified peering from the ExpressRouteCrossConnection
deleteAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/implementation/ExpressRouteCrossConnectionPeeringsClientImpl.java", "license": "mit", "size": 60338 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.util.Context" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.util.Context;
import com.azure.core.annotation.*; import com.azure.core.util.*;
[ "com.azure.core" ]
com.azure.core;
2,322,778
public Properties getProp() { return prop; }
Properties function() { return prop; }
/** * gets a references to the properties file for settings not covered in the * config loads, such as UDDI or FDS * * @return */
gets a references to the properties file for settings not covered in the config loads, such as UDDI or FDS
getProp
{ "repo_name": "mil-oss/fgsms", "path": "fgsms-agents/fgsms-agentcore/src/main/java/org/miloss/fgsms/agentcore/ConfigLoader.java", "license": "mpl-2.0", "size": 26891 }
[ "java.util.Properties" ]
import java.util.Properties;
import java.util.*;
[ "java.util" ]
java.util;
2,565,982