method
stringlengths 13
441k
| clean_method
stringlengths 7
313k
| doc
stringlengths 17
17.3k
| comment
stringlengths 3
1.42k
| method_name
stringlengths 1
273
| extra
dict | imports
list | imports_info
stringlengths 19
34.8k
| cluster_imports_info
stringlengths 15
3.66k
| libraries
list | libraries_info
stringlengths 6
661
| id
int64 0
2.92M
|
---|---|---|---|---|---|---|---|---|---|---|---|
public void execute(Map<String, Object> jobDataMap);
|
void function(Map<String, Object> jobDataMap);
|
/**
* Execute this job
*
* @param jobDataMap Any data the job needs to execute. Changes to this data will be remembered between executions.
*/
|
Execute this job
|
execute
|
{
"repo_name": "mrdon/SAL",
"path": "sal-api/src/main/java/com/atlassian/sal/api/scheduling/PluginJob.java",
"license": "bsd-3-clause",
"size": 688
}
|
[
"java.util.Map"
] |
import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 113,043 |
public Matrix3d setFloats(ByteBuffer buffer) {
MemUtil.INSTANCE.getf(this, buffer.position(), buffer);
return this;
}
|
Matrix3d function(ByteBuffer buffer) { MemUtil.INSTANCE.getf(this, buffer.position(), buffer); return this; }
|
/**
* Set the values of this matrix by reading 9 float values from the given {@link ByteBuffer} in column-major order,
* starting at its current position.
* <p>
* The ByteBuffer is expected to contain the values in column-major order.
* <p>
* The position of the ByteBuffer will not be changed by this method.
*
* @param buffer
* the ByteBuffer to read the matrix values from in column-major order
* @return this
*/
|
Set the values of this matrix by reading 9 float values from the given <code>ByteBuffer</code> in column-major order, starting at its current position. The ByteBuffer is expected to contain the values in column-major order. The position of the ByteBuffer will not be changed by this method
|
setFloats
|
{
"repo_name": "JOML-CI/JOML",
"path": "src/org/joml/Matrix3d.java",
"license": "mit",
"size": 201309
}
|
[
"java.nio.ByteBuffer"
] |
import java.nio.ByteBuffer;
|
import java.nio.*;
|
[
"java.nio"
] |
java.nio;
| 2,612,076 |
void load(InputStream in) throws XmlDocumentCheckedException;
|
void load(InputStream in) throws XmlDocumentCheckedException;
|
/**
* This method replaces the content of the current root node
* with that of the InputStream.
*
* @param in A stream containing an XML document.
* @throws XmlDocumentCheckedException If the XML is invalid.
*/
|
This method replaces the content of the current root node with that of the InputStream
|
load
|
{
"repo_name": "bclemenzi/java-xml",
"path": "src/main/java/com/nfbsoftware/xml/IXmlDocument.java",
"license": "gpl-2.0",
"size": 3083
}
|
[
"com.nfbsoftware.xml.exception.XmlDocumentCheckedException",
"java.io.InputStream"
] |
import com.nfbsoftware.xml.exception.XmlDocumentCheckedException; import java.io.InputStream;
|
import com.nfbsoftware.xml.exception.*; import java.io.*;
|
[
"com.nfbsoftware.xml",
"java.io"
] |
com.nfbsoftware.xml; java.io;
| 2,552,218 |
public boolean updatePlacesData(ILocationServiceListener serviceListener, int updateCode){
if(mService != null) {
mService.updateLocationData(updateCode);
return true;
} else {
serviceListeners.put(serviceListener, updateCode);
startLocationService();
return false;
}
}
|
boolean function(ILocationServiceListener serviceListener, int updateCode){ if(mService != null) { mService.updateLocationData(updateCode); return true; } else { serviceListeners.put(serviceListener, updateCode); startLocationService(); return false; } }
|
/**
* update location-sensistive data in Places related to a particular context
* If the LocationService is not yet started, start it instead.
* @param serviceListener the listener of location-sensitive data updates
* @param updateCode the update context we are interested in
* @return true if the location service was started already, false otherwise
*/
|
update location-sensistive data in Places related to a particular context If the LocationService is not yet started, start it instead
|
updatePlacesData
|
{
"repo_name": "Natio/Places",
"path": "app/src/main/java/com/gcw/sapienza/places/PlacesApplication.java",
"license": "apache-2.0",
"size": 16027
}
|
[
"com.gcw.sapienza.places.services.ILocationServiceListener"
] |
import com.gcw.sapienza.places.services.ILocationServiceListener;
|
import com.gcw.sapienza.places.services.*;
|
[
"com.gcw.sapienza"
] |
com.gcw.sapienza;
| 1,981,524 |
public static void acknowledge(Notification[] notices, String user, Date time) throws SQLException {
if (notices == null) {
throw new IllegalArgumentException("Cannot take null parameters.");
}
int[] ids = new int[notices.length];
for (int i = 0; i < ids.length; i++) {
ids[i] = notices[i].getId();
}
acknowledge(ids, user, time);
}
|
static void function(Notification[] notices, String user, Date time) throws SQLException { if (notices == null) { throw new IllegalArgumentException(STR); } int[] ids = new int[notices.length]; for (int i = 0; i < ids.length; i++) { ids[i] = notices[i].getId(); } acknowledge(ids, user, time); }
|
/**
* Acknowledge a list of notices with the given username and the given time.
*
* @param notices an array of {@link org.opennms.web.notification.Notification} objects.
* @param user a {@link java.lang.String} object.
* @param time a java$util$Date object.
* @throws java.sql.SQLException if any.
*/
|
Acknowledge a list of notices with the given username and the given time
|
acknowledge
|
{
"repo_name": "rfdrake/opennms",
"path": "opennms-webapp/src/main/java/org/opennms/web/notification/NoticeFactory.java",
"license": "gpl-2.0",
"size": 29007
}
|
[
"java.sql.SQLException",
"java.util.Date"
] |
import java.sql.SQLException; import java.util.Date;
|
import java.sql.*; import java.util.*;
|
[
"java.sql",
"java.util"
] |
java.sql; java.util;
| 2,211,020 |
public Value readPropertyValue(Collection<ObjectLabel> objlabels, PKeys propertystr) {
return readPropertyValue(objlabels, propertystr, null);
}
|
Value function(Collection<ObjectLabel> objlabels, PKeys propertystr) { return readPropertyValue(objlabels, propertystr, null); }
|
/**
* 8.6.2.1 [[Get]]
* Returns the value of the given property in the given objects.
* The internal prototype chains are used.
* Absent is converted to undefined. Attributes are set to bottom.
*/
|
8.6.2.1 [[Get]] Returns the value of the given property in the given objects. The internal prototype chains are used. Absent is converted to undefined. Attributes are set to bottom
|
readPropertyValue
|
{
"repo_name": "cs-au-dk/TAJS",
"path": "src/dk/brics/tajs/analysis/PropVarOperations.java",
"license": "apache-2.0",
"size": 65791
}
|
[
"dk.brics.tajs.lattice.ObjectLabel",
"dk.brics.tajs.lattice.PKeys",
"dk.brics.tajs.lattice.Value",
"java.util.Collection"
] |
import dk.brics.tajs.lattice.ObjectLabel; import dk.brics.tajs.lattice.PKeys; import dk.brics.tajs.lattice.Value; import java.util.Collection;
|
import dk.brics.tajs.lattice.*; import java.util.*;
|
[
"dk.brics.tajs",
"java.util"
] |
dk.brics.tajs; java.util;
| 1,272,129 |
public Rule apply(ISubstitution.Immutable subst) {
ISubstitution.Immutable localSubst = subst.removeAll(paramVars()).retainAll(freeVars());
if(localSubst.isEmpty()) {
return (Rule) this;
}
List<Pattern> params = this.params();
IConstraint body = this.body();
ICompleteness.Immutable bodyCriticalEdges = this.bodyCriticalEdges();
Set.Immutable<ITermVar> freeVars = this.freeVars;
if(freeVars != null) {
// before renaming is included in localSubst
freeVars = freeVars.__removeAll(localSubst.domainSet()).__insertAll(localSubst.rangeSet());
}
final FreshVars fresh = new FreshVars(localSubst.domainSet(), localSubst.rangeSet(), freeVars());
final IRenaming ren = fresh.fresh(paramVars());
fresh.fix();
if(!ren.isEmpty()) {
params = params().stream().map(p -> p.apply(ren)).collect(ImmutableList.toImmutableList());
localSubst = ren.asSubstitution().compose(localSubst);
}
body = body.apply(localSubst);
if(bodyCriticalEdges != null) {
bodyCriticalEdges = bodyCriticalEdges.apply(localSubst);
}
return Rule.of(name(), params, body).withBodyCriticalEdges(bodyCriticalEdges).setFreeVars(freeVars);
}
|
Rule function(ISubstitution.Immutable subst) { ISubstitution.Immutable localSubst = subst.removeAll(paramVars()).retainAll(freeVars()); if(localSubst.isEmpty()) { return (Rule) this; } List<Pattern> params = this.params(); IConstraint body = this.body(); ICompleteness.Immutable bodyCriticalEdges = this.bodyCriticalEdges(); Set.Immutable<ITermVar> freeVars = this.freeVars; if(freeVars != null) { freeVars = freeVars.__removeAll(localSubst.domainSet()).__insertAll(localSubst.rangeSet()); } final FreshVars fresh = new FreshVars(localSubst.domainSet(), localSubst.rangeSet(), freeVars()); final IRenaming ren = fresh.fresh(paramVars()); fresh.fix(); if(!ren.isEmpty()) { params = params().stream().map(p -> p.apply(ren)).collect(ImmutableList.toImmutableList()); localSubst = ren.asSubstitution().compose(localSubst); } body = body.apply(localSubst); if(bodyCriticalEdges != null) { bodyCriticalEdges = bodyCriticalEdges.apply(localSubst); } return Rule.of(name(), params, body).withBodyCriticalEdges(bodyCriticalEdges).setFreeVars(freeVars); }
|
/**
* Apply capture avoiding substitution.
*/
|
Apply capture avoiding substitution
|
apply
|
{
"repo_name": "metaborg/nabl",
"path": "statix.solver/src/main/java/mb/statix/spec/ARule.java",
"license": "apache-2.0",
"size": 8188
}
|
[
"com.google.common.collect.ImmutableList",
"io.usethesource.capsule.Set",
"java.util.List"
] |
import com.google.common.collect.ImmutableList; import io.usethesource.capsule.Set; import java.util.List;
|
import com.google.common.collect.*; import io.usethesource.capsule.*; import java.util.*;
|
[
"com.google.common",
"io.usethesource.capsule",
"java.util"
] |
com.google.common; io.usethesource.capsule; java.util;
| 2,231,190 |
@Override
@Generated(value = "com.sun.tools.xjc.Driver", date = "2014-09-19T03:10:02-06:00", comment = "JAXB RI v2.2.6")
public String toString() {
return ToStringBuilder.reflectionToString(this, JAXBToStringStyle.MULTI_LINE_STYLE);
}
|
@Generated(value = STR, date = STR, comment = STR) String function() { return ToStringBuilder.reflectionToString(this, JAXBToStringStyle.MULTI_LINE_STYLE); }
|
/**
* Generates a String representation of the contents of this type.
* This is an extension method, produced by the 'ts' xjc plugin
*
*/
|
Generates a String representation of the contents of this type. This is an extension method, produced by the 'ts' xjc plugin
|
toString
|
{
"repo_name": "angecab10/travelport-uapi-tutorial",
"path": "src/com/travelport/schema/air_v29_0/TypeTicketModifierAccountingType.java",
"license": "gpl-3.0",
"size": 3365
}
|
[
"javax.annotation.Generated",
"org.apache.commons.lang.builder.ToStringBuilder",
"org.apache.cxf.xjc.runtime.JAXBToStringStyle"
] |
import javax.annotation.Generated; import org.apache.commons.lang.builder.ToStringBuilder; import org.apache.cxf.xjc.runtime.JAXBToStringStyle;
|
import javax.annotation.*; import org.apache.commons.lang.builder.*; import org.apache.cxf.xjc.runtime.*;
|
[
"javax.annotation",
"org.apache.commons",
"org.apache.cxf"
] |
javax.annotation; org.apache.commons; org.apache.cxf;
| 2,385,877 |
public static void checkFormat (File f, String expectedGuess,
String expectedExt, String expectedMime)
{
try
{
URI format = Formatizer.guessFormat (f);
assertEquals ("got wrong format for guessing " + f.getAbsolutePath (),
expectedGuess, format.toString ());
format = Formatizer.getFormatFromMime (Files.probeContentType (f
.toPath ()));
assertEquals ("got wrong format for mime of " + f.getAbsolutePath (),
expectedMime, format.toString ());
format = Formatizer.getFormatFromExtension (f.getName ().substring (
f.getName ().lastIndexOf (".") + 1));
assertEquals ("got wrong format for ext of " + f.getAbsolutePath (),
expectedExt, format.toString ());
}
catch (IOException e)
{
e.printStackTrace ();
fail ("couldn't test format for " + f.getAbsolutePath ());
}
}
|
static void function (File f, String expectedGuess, String expectedExt, String expectedMime) { try { URI format = Formatizer.guessFormat (f); assertEquals (STR + f.getAbsolutePath (), expectedGuess, format.toString ()); format = Formatizer.getFormatFromMime (Files.probeContentType (f .toPath ())); assertEquals (STR + f.getAbsolutePath (), expectedMime, format.toString ()); format = Formatizer.getFormatFromExtension (f.getName ().substring ( f.getName ().lastIndexOf (".") + 1)); assertEquals (STR + f.getAbsolutePath (), expectedExt, format.toString ()); } catch (IOException e) { e.printStackTrace (); fail (STR + f.getAbsolutePath ()); } }
|
/**
* Check format.
*
* Taken from CombineExt project.
*
* @param f
* the file
* @param expectedGuess
* the expected format by guess
* @param expectedExt
* the expected format from the extension
* @param expectedMime
* the expected format from the mime
*/
|
Check format. Taken from CombineExt project
|
checkFormat
|
{
"repo_name": "binfalse/CombineExt-PharmML",
"path": "src/test/java/de/unirostock/sems/cbext/pharmml/PharmMlTest.java",
"license": "gpl-3.0",
"size": 9363
}
|
[
"de.unirostock.sems.cbext.Formatizer",
"java.io.File",
"java.io.IOException",
"java.nio.file.Files"
] |
import de.unirostock.sems.cbext.Formatizer; import java.io.File; import java.io.IOException; import java.nio.file.Files;
|
import de.unirostock.sems.cbext.*; import java.io.*; import java.nio.file.*;
|
[
"de.unirostock.sems",
"java.io",
"java.nio"
] |
de.unirostock.sems; java.io; java.nio;
| 1,277,707 |
public static void showResults(ImageSearchHits hits, String title) {
JFrame resultFrame = new JFrame(title);
resultFrame.setLayout(new BoxLayout(resultFrame.getContentPane(),
BoxLayout.Y_AXIS));
JPanel panel = new JPanel();
panel.setLayout(new GridLayout(0, 4, 5, 5));
panel.setBorder(new EmptyBorder(10, 10, 10, 10));
JScrollPane scrollPane = new JScrollPane(panel);
resultFrame.add(scrollPane);
for (int i = 0; i < hits.length(); i++) {
String id = hits.doc(i)
.getField(DocumentBuilder.FIELD_NAME_IDENTIFIER)
.stringValue();
String companyName = "";
try (BufferedReader br = new BufferedReader(new FileReader(
new File(Config.COMPANY_DIR + id + ".company")))) {
companyName = br.readLine();
} catch (IOException e) {
e.printStackTrace();
continue;
}
BufferedImage image = null;
try {
image = ImageIO.read(new File(Config.IMAGE_BASE_DIR + id
+ ".png"));
} catch (IOException e) {
e.printStackTrace();
continue;
}
JLabel imageLabel = new JLabel(
new ImageIcon(
image.getScaledInstance(
image.getWidth() > 200
&& image.getWidth() >= image
.getHeight() ? 200 : -1,
image.getHeight() > image.getWidth()
&& image.getHeight() > 80 ? 80 : -1,
Image.SCALE_SMOOTH)));
JLabel textLabel = new JLabel(
"<html><body><p style=\"width:160px;max-width:160px;min-height:80px\">"
+ companyName + "<br />Score: " + hits.score(i)
+ "</p></body></html>");
panel.add(imageLabel);
panel.add(textLabel);
}
Dimension dim = new Dimension(1200, 800);
resultFrame.setPreferredSize(dim);
resultFrame.setSize(dim);
resultFrame.setMinimumSize(dim);
resultFrame.setLocationRelativeTo(null);
resultFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
resultFrame.setVisible(true);
}
|
static void function(ImageSearchHits hits, String title) { JFrame resultFrame = new JFrame(title); resultFrame.setLayout(new BoxLayout(resultFrame.getContentPane(), BoxLayout.Y_AXIS)); JPanel panel = new JPanel(); panel.setLayout(new GridLayout(0, 4, 5, 5)); panel.setBorder(new EmptyBorder(10, 10, 10, 10)); JScrollPane scrollPane = new JScrollPane(panel); resultFrame.add(scrollPane); for (int i = 0; i < hits.length(); i++) { String id = hits.doc(i) .getField(DocumentBuilder.FIELD_NAME_IDENTIFIER) .stringValue(); String companyName = STR.companySTR.pngSTR<html><body><p style=\STR>STR<br />Score: STR</p></body></html>"); panel.add(imageLabel); panel.add(textLabel); } Dimension dim = new Dimension(1200, 800); resultFrame.setPreferredSize(dim); resultFrame.setSize(dim); resultFrame.setMinimumSize(dim); resultFrame.setLocationRelativeTo(null); resultFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); resultFrame.setVisible(true); }
|
/**
* Presents the results in a simple window.
*
* @param hits The result set to be viewed.
* @param title The window title.
*/
|
Presents the results in a simple window
|
showResults
|
{
"repo_name": "Faedrivin/datathonms2014",
"path": "src/main/Identifier.java",
"license": "unlicense",
"size": 8010
}
|
[
"java.awt.Dimension",
"java.awt.GridLayout",
"javax.swing.BoxLayout",
"javax.swing.JFrame",
"javax.swing.JPanel",
"javax.swing.JScrollPane",
"javax.swing.border.EmptyBorder",
"net.semanticmetadata.lire.DocumentBuilder",
"net.semanticmetadata.lire.ImageSearchHits"
] |
import java.awt.Dimension; import java.awt.GridLayout; import javax.swing.BoxLayout; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.border.EmptyBorder; import net.semanticmetadata.lire.DocumentBuilder; import net.semanticmetadata.lire.ImageSearchHits;
|
import java.awt.*; import javax.swing.*; import javax.swing.border.*; import net.semanticmetadata.lire.*;
|
[
"java.awt",
"javax.swing",
"net.semanticmetadata.lire"
] |
java.awt; javax.swing; net.semanticmetadata.lire;
| 2,373,860 |
@Override
public QueueReceiver createReceiver(final Queue queue, final String messageSelector) throws JMSException {
lock();
try {
QueueSession session = getQueueSessionInternal();
if (ActiveMQRASession.trace) {
ActiveMQRALogger.LOGGER.trace("createReceiver " + session + " queue=" + queue + " selector=" + messageSelector);
}
QueueReceiver result = session.createReceiver(queue, messageSelector);
result = new ActiveMQRAQueueReceiver(result, this);
if (ActiveMQRASession.trace) {
ActiveMQRALogger.LOGGER.trace("createdReceiver " + session + " receiver=" + result);
}
addConsumer(result);
return result;
} finally {
unlock();
}
}
|
QueueReceiver function(final Queue queue, final String messageSelector) throws JMSException { lock(); try { QueueSession session = getQueueSessionInternal(); if (ActiveMQRASession.trace) { ActiveMQRALogger.LOGGER.trace(STR + session + STR + queue + STR + messageSelector); } QueueReceiver result = session.createReceiver(queue, messageSelector); result = new ActiveMQRAQueueReceiver(result, this); if (ActiveMQRASession.trace) { ActiveMQRALogger.LOGGER.trace(STR + session + STR + result); } addConsumer(result); return result; } finally { unlock(); } }
|
/**
* Create a queue receiver
*
* @param queue The queue
* @param messageSelector
* @return The queue receiver
* @throws JMSException Thrown if an error occurs
*/
|
Create a queue receiver
|
createReceiver
|
{
"repo_name": "mnovak1/activemq-artemis",
"path": "artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRASession.java",
"license": "apache-2.0",
"size": 48497
}
|
[
"javax.jms.JMSException",
"javax.jms.Queue",
"javax.jms.QueueReceiver",
"javax.jms.QueueSession"
] |
import javax.jms.JMSException; import javax.jms.Queue; import javax.jms.QueueReceiver; import javax.jms.QueueSession;
|
import javax.jms.*;
|
[
"javax.jms"
] |
javax.jms;
| 918,697 |
public String evaluate(Matcher rule, Matcher cond, Resolver resolver) {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < elements.length; i++) {
buf.append(elements[i].evaluate(rule, cond, resolver));
}
return buf.toString();
}
|
String function(Matcher rule, Matcher cond, Resolver resolver) { StringBuffer buf = new StringBuffer(); for (int i = 0; i < elements.length; i++) { buf.append(elements[i].evaluate(rule, cond, resolver)); } return buf.toString(); }
|
/**
* Evaluate the substitution based on the context
*
* @param rule corresponding matched rule
* @param cond last matched condition
*/
|
Evaluate the substitution based on the context
|
evaluate
|
{
"repo_name": "plumer/codana",
"path": "tomcat_files/8.0.21/Substitution.java",
"license": "mit",
"size": 9922
}
|
[
"java.util.regex.Matcher"
] |
import java.util.regex.Matcher;
|
import java.util.regex.*;
|
[
"java.util"
] |
java.util;
| 1,294,030 |
public BigInteger generateVerifier(byte[] salt, byte[] identity, byte[] password)
{
BigInteger x = SRP6Util.calculateX(digest, N, salt, identity, password);
return g.modPow(x, N);
}
|
BigInteger function(byte[] salt, byte[] identity, byte[] password) { BigInteger x = SRP6Util.calculateX(digest, N, salt, identity, password); return g.modPow(x, N); }
|
/**
* Creates a new SRP verifier
* @param salt The salt to use, generally should be large and random
* @param identity The user's identifying information (eg. username)
* @param password The user's password
* @return A new verifier for use in future SRP authentication
*/
|
Creates a new SRP verifier
|
generateVerifier
|
{
"repo_name": "Skywalker-11/spongycastle",
"path": "core/src/main/java/org/spongycastle/crypto/agreement/srp/SRP6VerifierGenerator.java",
"license": "mit",
"size": 1646
}
|
[
"java.math.BigInteger"
] |
import java.math.BigInteger;
|
import java.math.*;
|
[
"java.math"
] |
java.math;
| 207,994 |
public Set<Plotter> getPlotters() {
return Collections.unmodifiableSet(plotters);
}
|
Set<Plotter> function() { return Collections.unmodifiableSet(plotters); }
|
/**
* Gets an <b>unmodifiable</b> set of the plotter objects in the graph
*
* @return an unmodifiable {@link java.util.Set} of the plotter objects
*/
|
Gets an unmodifiable set of the plotter objects in the graph
|
getPlotters
|
{
"repo_name": "homedog21/bedwars-reloaded",
"path": "src/io/github/yannici/bedwars/Metrics.java",
"license": "gpl-2.0",
"size": 25684
}
|
[
"java.util.Collections",
"java.util.Set"
] |
import java.util.Collections; import java.util.Set;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,192,115 |
public void applyChanges() {
for (Node n : toRemove) {
compiler.reportChangeToEnclosingScope(n);
n.getParent().removeChild(n);
}
for (Node n : toReplaceWithZero) {
compiler.reportChangeToEnclosingScope(n);
n.replaceWith(IR.number(0).srcref(n));
}
}
|
void function() { for (Node n : toRemove) { compiler.reportChangeToEnclosingScope(n); n.getParent().removeChild(n); } for (Node n : toReplaceWithZero) { compiler.reportChangeToEnclosingScope(n); n.replaceWith(IR.number(0).srcref(n)); } }
|
/**
* Applies optimizations to all previously marked nodes.
*/
|
Applies optimizations to all previously marked nodes
|
applyChanges
|
{
"repo_name": "Pimm/closure-compiler",
"path": "src/com/google/javascript/jscomp/RemoveUnusedVars.java",
"license": "apache-2.0",
"size": 35176
}
|
[
"com.google.javascript.rhino.IR",
"com.google.javascript.rhino.Node"
] |
import com.google.javascript.rhino.IR; import com.google.javascript.rhino.Node;
|
import com.google.javascript.rhino.*;
|
[
"com.google.javascript"
] |
com.google.javascript;
| 2,418,095 |
public void updateSPS(
SPSDescriptor spsd,
TransactionController tc,
boolean recompile,
boolean updateSYSCOLUMNS,
boolean wait,
boolean firstCompilation)
throws StandardException;
|
void function( SPSDescriptor spsd, TransactionController tc, boolean recompile, boolean updateSYSCOLUMNS, boolean wait, boolean firstCompilation) throws StandardException;
|
/**
* Updates SYS.SYSSTATEMENTS with the info from the
* SPSD.
*
* @param spsd The descriptor to add
* @param tc The transaction controller
* @param recompile whether to recompile or invalidate
* @param updateSYSCOLUMNS indicate whether syscolumns needs to be updated
* or not.
* @param wait If true, then the caller wants to wait for locks. False will be
* @param firstCompilation first time SPS is getting compiled.
* when we using a nested user xaction - we want to timeout right away if
* the parent holds the lock. (bug 4821)
*
* @exception StandardException Thrown on error
*/
|
Updates SYS.SYSSTATEMENTS with the info from the SPSD
|
updateSPS
|
{
"repo_name": "SnappyDataInc/snappy-store",
"path": "gemfirexd/core/src/main/java/com/pivotal/gemfirexd/internal/iapi/sql/dictionary/DataDictionary.java",
"license": "apache-2.0",
"size": 74186
}
|
[
"com.pivotal.gemfirexd.internal.iapi.error.StandardException",
"com.pivotal.gemfirexd.internal.iapi.store.access.TransactionController"
] |
import com.pivotal.gemfirexd.internal.iapi.error.StandardException; import com.pivotal.gemfirexd.internal.iapi.store.access.TransactionController;
|
import com.pivotal.gemfirexd.internal.iapi.error.*; import com.pivotal.gemfirexd.internal.iapi.store.access.*;
|
[
"com.pivotal.gemfirexd"
] |
com.pivotal.gemfirexd;
| 307,283 |
public VirtualNetworkGatewayConnectionListEntityInner withVirtualNetworkGateway2(
VirtualNetworkConnectionGatewayReference virtualNetworkGateway2) {
if (this.innerProperties() == null) {
this.innerProperties = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat();
}
this.innerProperties().withVirtualNetworkGateway2(virtualNetworkGateway2);
return this;
}
|
VirtualNetworkGatewayConnectionListEntityInner function( VirtualNetworkConnectionGatewayReference virtualNetworkGateway2) { if (this.innerProperties() == null) { this.innerProperties = new VirtualNetworkGatewayConnectionListEntityPropertiesFormat(); } this.innerProperties().withVirtualNetworkGateway2(virtualNetworkGateway2); return this; }
|
/**
* Set the virtualNetworkGateway2 property: The reference to virtual network gateway resource.
*
* @param virtualNetworkGateway2 the virtualNetworkGateway2 value to set.
* @return the VirtualNetworkGatewayConnectionListEntityInner object itself.
*/
|
Set the virtualNetworkGateway2 property: The reference to virtual network gateway resource
|
withVirtualNetworkGateway2
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/models/VirtualNetworkGatewayConnectionListEntityInner.java",
"license": "mit",
"size": 20243
}
|
[
"com.azure.resourcemanager.network.models.VirtualNetworkConnectionGatewayReference"
] |
import com.azure.resourcemanager.network.models.VirtualNetworkConnectionGatewayReference;
|
import com.azure.resourcemanager.network.models.*;
|
[
"com.azure.resourcemanager"
] |
com.azure.resourcemanager;
| 630,488 |
private static KuduPredicate.ComparisonOp getKuduOperator(BinaryPredicate.Operator op) {
switch (op) {
case GT: return ComparisonOp.GREATER;
case LT: return ComparisonOp.LESS;
case GE: return ComparisonOp.GREATER_EQUAL;
case LE: return ComparisonOp.LESS_EQUAL;
case EQ: return ComparisonOp.EQUAL;
default: return null;
}
}
@Override
public boolean hasStorageLayerConjuncts() { return !kuduConjuncts_.isEmpty(); }
|
static KuduPredicate.ComparisonOp function(BinaryPredicate.Operator op) { switch (op) { case GT: return ComparisonOp.GREATER; case LT: return ComparisonOp.LESS; case GE: return ComparisonOp.GREATER_EQUAL; case LE: return ComparisonOp.LESS_EQUAL; case EQ: return ComparisonOp.EQUAL; default: return null; } } public boolean hasStorageLayerConjuncts() { return !kuduConjuncts_.isEmpty(); }
|
/**
* Returns a Kudu comparison operator for the BinaryPredicate operator, or null if
* the operation is not supported by Kudu.
*/
|
Returns a Kudu comparison operator for the BinaryPredicate operator, or null if the operation is not supported by Kudu
|
getKuduOperator
|
{
"repo_name": "cloudera/Impala",
"path": "fe/src/main/java/org/apache/impala/planner/KuduScanNode.java",
"license": "apache-2.0",
"size": 22959
}
|
[
"org.apache.impala.analysis.BinaryPredicate",
"org.apache.kudu.client.KuduPredicate"
] |
import org.apache.impala.analysis.BinaryPredicate; import org.apache.kudu.client.KuduPredicate;
|
import org.apache.impala.analysis.*; import org.apache.kudu.client.*;
|
[
"org.apache.impala",
"org.apache.kudu"
] |
org.apache.impala; org.apache.kudu;
| 2,004,120 |
public ClosableIterator<org.ontoware.rdf2go.model.node.Node> getAllNicknames_asNode() {
return Base.getAll_asNode(this.model, this.getResource(), NICKNAME);
}
|
ClosableIterator<org.ontoware.rdf2go.model.node.Node> function() { return Base.getAll_asNode(this.model, this.getResource(), NICKNAME); }
|
/**
* Get all values of property Nickname as an Iterator over RDF2Go nodes
*
* @return a ClosableIterator of RDF2Go Nodes [Generated from RDFReactor
* template rule #get8dynamic]
*/
|
Get all values of property Nickname as an Iterator over RDF2Go nodes
|
getAllNicknames_asNode
|
{
"repo_name": "m0ep/master-thesis",
"path": "source/apis/rdf2go/rdf2go-foaf/src/main/java/com/xmlns/foaf/Thing.java",
"license": "mit",
"size": 274766
}
|
[
"org.ontoware.aifbcommons.collection.ClosableIterator",
"org.ontoware.rdfreactor.runtime.Base"
] |
import org.ontoware.aifbcommons.collection.ClosableIterator; import org.ontoware.rdfreactor.runtime.Base;
|
import org.ontoware.aifbcommons.collection.*; import org.ontoware.rdfreactor.runtime.*;
|
[
"org.ontoware.aifbcommons",
"org.ontoware.rdfreactor"
] |
org.ontoware.aifbcommons; org.ontoware.rdfreactor;
| 2,810,004 |
private String readBoundary() throws IOException {
BufferedReader reader = new BufferedReader(new FileReader(mFileToUpload));
String boundary = reader.readLine();
reader.close();
if (boundary == null || boundary.trim().isEmpty()) {
Log.e(TAG, "Ignoring invalid crash dump: '" + mFileToUpload + "'");
return null;
}
boundary = boundary.trim();
if (!boundary.startsWith("--") || boundary.length() < 10) {
Log.e(TAG, "Ignoring invalidly bound crash dump: '" + mFileToUpload + "'");
return null;
}
boundary = boundary.substring(2); // Remove the initial --
return boundary;
}
|
String function() throws IOException { BufferedReader reader = new BufferedReader(new FileReader(mFileToUpload)); String boundary = reader.readLine(); reader.close(); if (boundary == null boundary.trim().isEmpty()) { Log.e(TAG, STR + mFileToUpload + "'"); return null; } boundary = boundary.trim(); if (!boundary.startsWith("--") boundary.length() < 10) { Log.e(TAG, STR + mFileToUpload + "'"); return null; } boundary = boundary.substring(2); return boundary; }
|
/**
* Get the boundary from the file, we need it for the content-type.
*
* @return the boundary if found, else null.
* @throws IOException
*/
|
Get the boundary from the file, we need it for the content-type
|
readBoundary
|
{
"repo_name": "vadimtk/chrome4sdp",
"path": "chrome/android/java/src/org/chromium/chrome/browser/crash/MinidumpUploadCallable.java",
"license": "bsd-3-clause",
"size": 13586
}
|
[
"android.util.Log",
"java.io.BufferedReader",
"java.io.FileReader",
"java.io.IOException"
] |
import android.util.Log; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException;
|
import android.util.*; import java.io.*;
|
[
"android.util",
"java.io"
] |
android.util; java.io;
| 302,671 |
@Test
public void testGetAllModelsAsJson() {
String testUrl = jettyBaseUrl + testAllModelsPath + ".json";
String acceptContent = "application/json";
try {
// call web application
WebClient client = new WebClient(BrowserVersion.CHROME);
client.addRequestHeader("Accept", acceptContent);
Page page = client.getPage(testUrl);
WebResponse response = page.getWebResponse();
// make sure we have a JSON response
assertEquals(acceptContent, response.getContentType());
// deserialize and check content
String json = response.getContentAsString();
ObjectMapper mapper = new ObjectMapper();
JsonFactory factory = new JsonFactory();
JsonParser parser = factory.createJsonParser(json);
TestModels models = mapper.readValue(parser, new TypeReference<TestModels>() {});
assertNotNull(models);
assertFalse(models.getModelList().isEmpty());
assertEquals(testModelList.size(), models.getModelList().size());
// make sure we have matching content
int matches = 0;
for (TestModel testModel : testModelList) {
String id = testModel.getId();
for (TestModel model : models.getModelList()) {
if (id.equals(model.getId())) {
matches++;
}
}
}
assertEquals(testModelList.size(), matches);
}
catch (Exception e) {
// FailingHttpStatusCodeException, MalformedURLException, IOException, JsonSyntaxException
fail(e.getMessage());
}
}
|
void function() { String testUrl = jettyBaseUrl + testAllModelsPath + ".json"; String acceptContent = STR; try { WebClient client = new WebClient(BrowserVersion.CHROME); client.addRequestHeader(STR, acceptContent); Page page = client.getPage(testUrl); WebResponse response = page.getWebResponse(); assertEquals(acceptContent, response.getContentType()); String json = response.getContentAsString(); ObjectMapper mapper = new ObjectMapper(); JsonFactory factory = new JsonFactory(); JsonParser parser = factory.createJsonParser(json); TestModels models = mapper.readValue(parser, new TypeReference<TestModels>() {}); assertNotNull(models); assertFalse(models.getModelList().isEmpty()); assertEquals(testModelList.size(), models.getModelList().size()); int matches = 0; for (TestModel testModel : testModelList) { String id = testModel.getId(); for (TestModel model : models.getModelList()) { if (id.equals(model.getId())) { matches++; } } } assertEquals(testModelList.size(), matches); } catch (Exception e) { fail(e.getMessage()); } }
|
/**
* Test method for {@link com.sawert.sandbox.spring.mvc.controller.TestRestController#getAllModels()}.
*/
|
Test method for <code>com.sawert.sandbox.spring.mvc.controller.TestRestController#getAllModels()</code>
|
testGetAllModelsAsJson
|
{
"repo_name": "bsawert/spring-sandbox",
"path": "spring-mvc/mvc-webapp/src/test/java/com/sawert/sandbox/spring/mvc/controller/TestRestControllerIT.java",
"license": "apache-2.0",
"size": 8537
}
|
[
"com.gargoylesoftware.htmlunit.BrowserVersion",
"com.gargoylesoftware.htmlunit.Page",
"com.gargoylesoftware.htmlunit.WebClient",
"com.gargoylesoftware.htmlunit.WebResponse",
"com.sawert.sandbox.spring.mvc.model.TestModel",
"com.sawert.sandbox.spring.mvc.model.TestModels",
"org.codehaus.jackson.JsonFactory",
"org.codehaus.jackson.JsonParser",
"org.codehaus.jackson.map.ObjectMapper",
"org.codehaus.jackson.type.TypeReference",
"org.junit.Assert"
] |
import com.gargoylesoftware.htmlunit.BrowserVersion; import com.gargoylesoftware.htmlunit.Page; import com.gargoylesoftware.htmlunit.WebClient; import com.gargoylesoftware.htmlunit.WebResponse; import com.sawert.sandbox.spring.mvc.model.TestModel; import com.sawert.sandbox.spring.mvc.model.TestModels; import org.codehaus.jackson.JsonFactory; import org.codehaus.jackson.JsonParser; import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.type.TypeReference; import org.junit.Assert;
|
import com.gargoylesoftware.htmlunit.*; import com.sawert.sandbox.spring.mvc.model.*; import org.codehaus.jackson.*; import org.codehaus.jackson.map.*; import org.codehaus.jackson.type.*; import org.junit.*;
|
[
"com.gargoylesoftware.htmlunit",
"com.sawert.sandbox",
"org.codehaus.jackson",
"org.junit"
] |
com.gargoylesoftware.htmlunit; com.sawert.sandbox; org.codehaus.jackson; org.junit;
| 1,295,596 |
private static Expression performRuntimeChecksOnParameter(
Variable parameter, TypeDescriptor requiredType) {
Expression parameterReference = parameter.createReference();
// If the parameter type in bridge method is different from the one in the method
// that will handle the call, add a cast to perform the runtime type check.
return parameter.getTypeDescriptor().isAssignableTo(requiredType)
? parameterReference
: CastExpression.newBuilder()
.setExpression(parameterReference)
.setCastTypeDescriptor(requiredType)
.build();
}
|
static Expression function( Variable parameter, TypeDescriptor requiredType) { Expression parameterReference = parameter.createReference(); return parameter.getTypeDescriptor().isAssignableTo(requiredType) ? parameterReference : CastExpression.newBuilder() .setExpression(parameterReference) .setCastTypeDescriptor(requiredType) .build(); }
|
/**
* Returns an expression of the type required in the forwarding call, inserting a cast if
* necessary.
*/
|
Returns an expression of the type required in the forwarding call, inserting a cast if necessary
|
performRuntimeChecksOnParameter
|
{
"repo_name": "google/j2cl",
"path": "transpiler/java/com/google/j2cl/transpiler/passes/BridgeMethodsCreator.java",
"license": "apache-2.0",
"size": 5760
}
|
[
"com.google.j2cl.transpiler.ast.CastExpression",
"com.google.j2cl.transpiler.ast.Expression",
"com.google.j2cl.transpiler.ast.TypeDescriptor",
"com.google.j2cl.transpiler.ast.Variable"
] |
import com.google.j2cl.transpiler.ast.CastExpression; import com.google.j2cl.transpiler.ast.Expression; import com.google.j2cl.transpiler.ast.TypeDescriptor; import com.google.j2cl.transpiler.ast.Variable;
|
import com.google.j2cl.transpiler.ast.*;
|
[
"com.google.j2cl"
] |
com.google.j2cl;
| 2,741,161 |
@Override public Dictionary getIfPresent(
DictionaryColumnUniqueIdentifier dictionaryColumnUniqueIdentifier) {
Dictionary forwardDictionary = null;
ColumnDictionaryInfo columnDictionaryInfo = (ColumnDictionaryInfo) carbonLRUCache.get(
getLruCacheKey(dictionaryColumnUniqueIdentifier.getColumnIdentifier().getColumnId(),
CacheType.FORWARD_DICTIONARY));
if (null != columnDictionaryInfo) {
forwardDictionary = new ForwardDictionary(columnDictionaryInfo);
incrementDictionaryAccessCount(columnDictionaryInfo);
}
return forwardDictionary;
}
|
@Override Dictionary function( DictionaryColumnUniqueIdentifier dictionaryColumnUniqueIdentifier) { Dictionary forwardDictionary = null; ColumnDictionaryInfo columnDictionaryInfo = (ColumnDictionaryInfo) carbonLRUCache.get( getLruCacheKey(dictionaryColumnUniqueIdentifier.getColumnIdentifier().getColumnId(), CacheType.FORWARD_DICTIONARY)); if (null != columnDictionaryInfo) { forwardDictionary = new ForwardDictionary(columnDictionaryInfo); incrementDictionaryAccessCount(columnDictionaryInfo); } return forwardDictionary; }
|
/**
* This method will return the value for the given key. It will not check and load
* the data for the given key
*
* @param dictionaryColumnUniqueIdentifier unique identifier which contains dbName,
* tableName and columnIdentifier
* @return
*/
|
This method will return the value for the given key. It will not check and load the data for the given key
|
getIfPresent
|
{
"repo_name": "manishgupta88/carbondata",
"path": "core/src/main/java/org/apache/carbondata/core/cache/dictionary/ForwardDictionaryCache.java",
"license": "apache-2.0",
"size": 12272
}
|
[
"org.apache.carbondata.core.cache.CacheType"
] |
import org.apache.carbondata.core.cache.CacheType;
|
import org.apache.carbondata.core.cache.*;
|
[
"org.apache.carbondata"
] |
org.apache.carbondata;
| 521,710 |
public CloudFoundryOperations resetClient(CloudCredentials credentials, IProgressMonitor monitor)
throws CoreException {
internalResetClient();
return getClient(credentials, monitor);
}
|
CloudFoundryOperations function(CloudCredentials credentials, IProgressMonitor monitor) throws CoreException { internalResetClient(); return getClient(credentials, monitor); }
|
/**
* Public for testing only. Clients should not call outside of test
* framework.Use {@link #resetClient(IProgressMonitor)} for actual client
* reset, as credentials should not be normally be passed through this API.
* Credentials typically are stored and retrieved indirectly by the
* behaviour through the server instance.
*
* @param monitor
* @param credentials
* @throws CoreException
*/
|
Public for testing only. Clients should not call outside of test framework.Use <code>#resetClient(IProgressMonitor)</code> for actual client reset, as credentials should not be normally be passed through this API. Credentials typically are stored and retrieved indirectly by the behaviour through the server instance
|
resetClient
|
{
"repo_name": "pradeep-b/cft",
"path": "org.eclipse.cft.server.core/src/org/eclipse/cft/server/core/internal/client/CloudFoundryServerBehaviour.java",
"license": "apache-2.0",
"size": 64299
}
|
[
"org.cloudfoundry.client.lib.CloudCredentials",
"org.cloudfoundry.client.lib.CloudFoundryOperations",
"org.eclipse.core.runtime.CoreException",
"org.eclipse.core.runtime.IProgressMonitor"
] |
import org.cloudfoundry.client.lib.CloudCredentials; import org.cloudfoundry.client.lib.CloudFoundryOperations; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor;
|
import org.cloudfoundry.client.lib.*; import org.eclipse.core.runtime.*;
|
[
"org.cloudfoundry.client",
"org.eclipse.core"
] |
org.cloudfoundry.client; org.eclipse.core;
| 1,393,158 |
CmsImageInfoBean updateImageProperties(String resourcePath, String locale, Map<String, String> properties)
throws CmsRpcException;
|
CmsImageInfoBean updateImageProperties(String resourcePath, String locale, Map<String, String> properties) throws CmsRpcException;
|
/**
* Saves the given properties to the resource and returns the data to be displayed in the preview dialog.<p>
*
* @param resourcePath the path to the selected resource
* @param locale the content locale
* @param properties a map with the key/value pairs of the properties to be updated
*
* @return the updates preview data
*
* @throws CmsRpcException if something goes wrong
*/
|
Saves the given properties to the resource and returns the data to be displayed in the preview dialog
|
updateImageProperties
|
{
"repo_name": "victos/opencms-core",
"path": "src/org/opencms/ade/galleries/shared/rpc/I_CmsPreviewService.java",
"license": "lgpl-2.1",
"size": 4087
}
|
[
"java.util.Map",
"org.opencms.ade.galleries.shared.CmsImageInfoBean",
"org.opencms.gwt.CmsRpcException"
] |
import java.util.Map; import org.opencms.ade.galleries.shared.CmsImageInfoBean; import org.opencms.gwt.CmsRpcException;
|
import java.util.*; import org.opencms.ade.galleries.shared.*; import org.opencms.gwt.*;
|
[
"java.util",
"org.opencms.ade",
"org.opencms.gwt"
] |
java.util; org.opencms.ade; org.opencms.gwt;
| 2,532,898 |
List<EmployeeFunding> findCSFTrackersAsEmployeeFunding(Map fieldValues, boolean isConsolidated);
|
List<EmployeeFunding> findCSFTrackersAsEmployeeFunding(Map fieldValues, boolean isConsolidated);
|
/**
* This method finds the CSF trackers according to input fields and values and converts the trackers into EmployeeFunding
*
* @param fieldValues the input fields and values
* @param isConsolidated consolidation option is applied or not
* @return a collection of CSF trackers as EmployeeFunding
*/
|
This method finds the CSF trackers according to input fields and values and converts the trackers into EmployeeFunding
|
findCSFTrackersAsEmployeeFunding
|
{
"repo_name": "quikkian-ua-devops/will-financials",
"path": "kfs-ld/src/main/java/org/kuali/kfs/module/ld/dataaccess/LaborCalculatedSalaryFoundationTrackerDao.java",
"license": "agpl-3.0",
"size": 2630
}
|
[
"java.util.List",
"java.util.Map",
"org.kuali.kfs.module.ld.businessobject.EmployeeFunding"
] |
import java.util.List; import java.util.Map; import org.kuali.kfs.module.ld.businessobject.EmployeeFunding;
|
import java.util.*; import org.kuali.kfs.module.ld.businessobject.*;
|
[
"java.util",
"org.kuali.kfs"
] |
java.util; org.kuali.kfs;
| 2,664,161 |
@Override
public ServletContext getServletContext() {
if (context == null) {
context = new ApplicationContext(this);
if (altDDName != null)
context.setAttribute(Globals.ALT_DD_ATTR,altDDName);
}
return (context.getFacade());
}
|
ServletContext function() { if (context == null) { context = new ApplicationContext(this); if (altDDName != null) context.setAttribute(Globals.ALT_DD_ATTR,altDDName); } return (context.getFacade()); }
|
/**
* Return the servlet context for which this Context is a facade.
*/
|
Return the servlet context for which this Context is a facade
|
getServletContext
|
{
"repo_name": "WhiteBearSolutions/WBSAirback",
"path": "packages/wbsairback-tomcat/wbsairback-tomcat-7.0.22/java/org/apache/catalina/core/StandardContext.java",
"license": "apache-2.0",
"size": 198551
}
|
[
"javax.servlet.ServletContext",
"org.apache.catalina.Globals"
] |
import javax.servlet.ServletContext; import org.apache.catalina.Globals;
|
import javax.servlet.*; import org.apache.catalina.*;
|
[
"javax.servlet",
"org.apache.catalina"
] |
javax.servlet; org.apache.catalina;
| 1,555,159 |
public List<BuildableItem> getPendingItems() {
return new ArrayList<BuildableItem>(snapshot.pendings);
}
|
List<BuildableItem> function() { return new ArrayList<BuildableItem>(snapshot.pendings); }
|
/**
* Gets the snapshot of all {@link BuildableItem}s.
*/
|
Gets the snapshot of all <code>BuildableItem</code>s
|
getPendingItems
|
{
"repo_name": "dariver/jenkins",
"path": "core/src/main/java/hudson/model/Queue.java",
"license": "mit",
"size": 112142
}
|
[
"java.util.ArrayList",
"java.util.List"
] |
import java.util.ArrayList; import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,501,454 |
protected String getDefaultMessage(String code) {
try {
if (messageSource != null) {
return messageSource.getMessage(code, null, LocaleContextHolder.getLocale());
}
return ConstrainedProperty.DEFAULT_MESSAGES.get(code);
}
catch (Exception e) {
return ConstrainedProperty.DEFAULT_MESSAGES.get(code);
}
}
|
String function(String code) { try { if (messageSource != null) { return messageSource.getMessage(code, null, LocaleContextHolder.getLocale()); } return ConstrainedProperty.DEFAULT_MESSAGES.get(code); } catch (Exception e) { return ConstrainedProperty.DEFAULT_MESSAGES.get(code); } }
|
/**
* Returns the default message for the given message code in the
* current locale. Note that the string returned includes any
* placeholders that the required message has - these must be
* expanded by the caller if required.
* @param code The i18n message code to look up.
* @return The message corresponding to the given code in the
* current locale.
*/
|
Returns the default message for the given message code in the current locale. Note that the string returned includes any placeholders that the required message has - these must be expanded by the caller if required
|
getDefaultMessage
|
{
"repo_name": "erdi/grails-core",
"path": "grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/AbstractConstraint.java",
"license": "apache-2.0",
"size": 10567
}
|
[
"org.springframework.context.i18n.LocaleContextHolder"
] |
import org.springframework.context.i18n.LocaleContextHolder;
|
import org.springframework.context.i18n.*;
|
[
"org.springframework.context"
] |
org.springframework.context;
| 1,381,996 |
private boolean removeNode(Node node, BigInteger distance) {
if (bucket == null) {
return closestChild(distance).removeNode(node, distance);
} else {
boolean res = false;
// Get node from bucket or cache
Identifier id = node.getId();
Node fn = (Node) bucket.get(id);
if (fn == null) fn = (Node) cache.get(id);
// Check if stale and should be removed
if ((fn != null) && (fn.incFailCount() >= conf.STALE)) {
// If in bucket, move a node from replacement cache to bucket, call listener
if ((bucket.remove(id) != null) && (cache.size() > 0)) {
Node mostRecent = (Node) Collections.max(cache.values(),
Node.LASTSEEN_COMPARATOR);
cache.remove(mostRecent.getId());
bucket.put(mostRecent.getId(), mostRecent);
checkCallListener(mostRecent);
}
cache.remove(id);
res = true;
} else {
res = (fn == null);
}
compactify();
return res;
}
}
|
boolean function(Node node, BigInteger distance) { if (bucket == null) { return closestChild(distance).removeNode(node, distance); } else { boolean res = false; Identifier id = node.getId(); Node fn = (Node) bucket.get(id); if (fn == null) fn = (Node) cache.get(id); if ((fn != null) && (fn.incFailCount() >= conf.STALE)) { if ((bucket.remove(id) != null) && (cache.size() > 0)) { Node mostRecent = (Node) Collections.max(cache.values(), Node.LASTSEEN_COMPARATOR); cache.remove(mostRecent.getId()); bucket.put(mostRecent.getId(), mostRecent); checkCallListener(mostRecent); } cache.remove(id); res = true; } else { res = (fn == null); } compactify(); return res; } }
|
/**
* Merely skip computing the distance from the node to local node every time.
**/
|
Merely skip computing the distance from the node to local node every time
|
removeNode
|
{
"repo_name": "lvanni/synapse",
"path": "jSynapse/trunk/src/org/planx/xmlstore/routing/Space.java",
"license": "mit",
"size": 22807
}
|
[
"java.math.BigInteger",
"java.util.Collections"
] |
import java.math.BigInteger; import java.util.Collections;
|
import java.math.*; import java.util.*;
|
[
"java.math",
"java.util"
] |
java.math; java.util;
| 1,237,920 |
public String getResponseType() {
ArgumentCaptor<String> t = ArgumentCaptor.forClass(String.class);
verify(response).setContentType(t.capture());
return t.getValue();
}
|
String function() { ArgumentCaptor<String> t = ArgumentCaptor.forClass(String.class); verify(response).setContentType(t.capture()); return t.getValue(); }
|
/**
* The content type of the response.
*
* @return the content type (if set by the servlet call, or null if not)
*/
|
The content type of the response
|
getResponseType
|
{
"repo_name": "dstl/baleen",
"path": "baleen-core/src/test/java/uk/gov/dstl/baleen/testing/servlets/ServletCaller.java",
"license": "apache-2.0",
"size": 7709
}
|
[
"org.mockito.ArgumentCaptor",
"org.mockito.Mockito"
] |
import org.mockito.ArgumentCaptor; import org.mockito.Mockito;
|
import org.mockito.*;
|
[
"org.mockito"
] |
org.mockito;
| 1,002,498 |
public ServiceFuture<Void> deleteAsync(String resourceGroupName, String serviceName, String authsid, String ifMatch, final ServiceCallback<Void> serviceCallback) {
return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, serviceName, authsid, ifMatch), serviceCallback);
}
|
ServiceFuture<Void> function(String resourceGroupName, String serviceName, String authsid, String ifMatch, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, serviceName, authsid, ifMatch), serviceCallback); }
|
/**
* Deletes specific authorization server instance.
*
* @param resourceGroupName The name of the resource group.
* @param serviceName The name of the API Management service.
* @param authsid Identifier of the authorization server.
* @param ifMatch ETag of the Entity. ETag should match the current entity state from the header response of the GET request or it should be * for unconditional update.
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceFuture} object
*/
|
Deletes specific authorization server instance
|
deleteAsync
|
{
"repo_name": "navalev/azure-sdk-for-java",
"path": "sdk/apimanagement/mgmt-v2018_06_01_preview/src/main/java/com/microsoft/azure/management/apimanagement/v2018_06_01_preview/implementation/AuthorizationServersInner.java",
"license": "mit",
"size": 68711
}
|
[
"com.microsoft.rest.ServiceCallback",
"com.microsoft.rest.ServiceFuture"
] |
import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture;
|
import com.microsoft.rest.*;
|
[
"com.microsoft.rest"
] |
com.microsoft.rest;
| 2,031,489 |
public void startCDATA() throws SAXException;
|
void function() throws SAXException;
|
/**
* Receive notification that a CDATA section is beginning. Data in a
* CDATA section is is reported through the appropriate event, either
* <em>characters()</em> or <em>ignorableWhitespace</em>.
*
* @throws SAXException
* @see #endCDATA()
*/
|
Receive notification that a CDATA section is beginning. Data in a CDATA section is is reported through the appropriate event, either characters() or ignorableWhitespace
|
startCDATA
|
{
"repo_name": "shelan/jdk9-mirror",
"path": "jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/dtdparser/DTDEventListener.java",
"license": "gpl-2.0",
"size": 13531
}
|
[
"org.xml.sax.SAXException"
] |
import org.xml.sax.SAXException;
|
import org.xml.sax.*;
|
[
"org.xml.sax"
] |
org.xml.sax;
| 639,886 |
@Override
public void afterCompletion(
HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)
throws Exception {
logger.info("@@@@@@@@@@@@@CheckInterecptor afterCompletion() 메서드 실행@@@@@@@@@@@@@");
}
|
void function( HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { logger.info(STR); }
|
/**
* This implementation is empty.
*/
|
This implementation is empty
|
afterCompletion
|
{
"repo_name": "ChangKeunYou/springsecurity3",
"path": "src/main/java/www/spring/security/common/module/CheckInterecptor.java",
"license": "mit",
"size": 1766
}
|
[
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse"
] |
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.*;
|
[
"javax.servlet"
] |
javax.servlet;
| 1,784,831 |
public void removeDecorators() {
dayViewDecorators.clear();
adapter.setDecorators(dayViewDecorators);
}
/**
* Remove a specific decorator instance. Same rules as {@linkplain List#remove(Object)}
|
void function() { dayViewDecorators.clear(); adapter.setDecorators(dayViewDecorators); } /** * Remove a specific decorator instance. Same rules as {@linkplain List#remove(Object)}
|
/**
* Remove all decorators
*/
|
Remove all decorators
|
removeDecorators
|
{
"repo_name": "ViyaletaShleveda/material-calendarview",
"path": "library/src/main/java/com/prolificinteractive/materialcalendarview/MaterialCalendarView.java",
"license": "mit",
"size": 70392
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,368,154 |
try {
return MAPPER.writeValueAsString(from(evt));
} catch (final JsonProcessingException ex) {
LOGGER.error("Error processing JSON: {}", ex.getMessage());
return null;
}
}
|
try { return MAPPER.writeValueAsString(from(evt)); } catch (final JsonProcessingException ex) { LOGGER.error(STR, ex.getMessage()); return null; } }
|
/**
* Serialize a Event into a JSON String
* @param evt the Fedora event
* @return a JSON string
*/
|
Serialize a Event into a JSON String
|
serialize
|
{
"repo_name": "fcrepo4/fcrepo4",
"path": "fcrepo-event-serialization/src/main/java/org/fcrepo/event/serialization/JsonLDSerializer.java",
"license": "apache-2.0",
"size": 2264
}
|
[
"com.fasterxml.jackson.core.JsonProcessingException"
] |
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.*;
|
[
"com.fasterxml.jackson"
] |
com.fasterxml.jackson;
| 989,690 |
void reloadFromImageFile(File file, FSNamesystem target) throws IOException {
target.clear();
LOG.debug("Reloading namespace from " + file);
loadFSImage(file, target, null);
}
|
void reloadFromImageFile(File file, FSNamesystem target) throws IOException { target.clear(); LOG.debug(STR + file); loadFSImage(file, target, null); }
|
/**
* Toss the current image and namesystem, reloading from the specified
* file.
*/
|
Toss the current image and namesystem, reloading from the specified file
|
reloadFromImageFile
|
{
"repo_name": "sungsoo/hadoop-2.3.0",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImage.java",
"license": "apache-2.0",
"size": 47358
}
|
[
"java.io.File",
"java.io.IOException"
] |
import java.io.File; import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 891,659 |
public BitSet getBitSet() {
return bitset;
}
|
BitSet function() { return bitset; }
|
/**
* Return the bit set used to store the Bloom filter.
* @return bit set representing the Bloom filter.
*/
|
Return the bit set used to store the Bloom filter
|
getBitSet
|
{
"repo_name": "sranasir/SPADE",
"path": "src/spade/core/BloomFilter.java",
"license": "gpl-3.0",
"size": 16157
}
|
[
"java.util.BitSet"
] |
import java.util.BitSet;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,728,413 |
@Override
public String format(Object value, String pattern, Locale locale) {
return format(value, pattern, locale, (TimeZone)null);
}
|
String function(Object value, String pattern, Locale locale) { return format(value, pattern, locale, (TimeZone)null); }
|
/**
* <p>Format an object using the specified pattern and/or
* <code>Locale</code>.
*
* @param value The value validation is being performed on.
* @param pattern The pattern used to format the value.
* @param locale The locale to use for the Format.
* @return The value formatted as a <code>String</code>.
*/
|
Format an object using the specified pattern and/or <code>Locale</code>
|
format
|
{
"repo_name": "lamsfoundation/lams",
"path": "3rdParty_sources/commons-validator/org/apache/commons/validator/routines/AbstractCalendarValidator.java",
"license": "gpl-2.0",
"size": 16430
}
|
[
"java.util.Locale",
"java.util.TimeZone"
] |
import java.util.Locale; import java.util.TimeZone;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,286,347 |
protected void checkNumCompiledSparkInst(int expectedNumCompiled) {
assertEquals("Unexpected number of compiled Spark instructions.",
expectedNumCompiled, Statistics.getNoOfCompiledSPInst());
}
|
void function(int expectedNumCompiled) { assertEquals(STR, expectedNumCompiled, Statistics.getNoOfCompiledSPInst()); }
|
/**
* Checks that the number of Spark instructions that the current test case has
* compiled is equal to the expected number. Generates a JUnit error message
* if the number is out of line.
*
* @param expectedNumCompiled
* number of Spark instructions that the current test case is
* expected to compile
*/
|
Checks that the number of Spark instructions that the current test case has compiled is equal to the expected number. Generates a JUnit error message if the number is out of line
|
checkNumCompiledSparkInst
|
{
"repo_name": "asurve/incubator-systemml",
"path": "src/test/java/org/apache/sysml/test/integration/AutomatedTestBase.java",
"license": "apache-2.0",
"size": 59347
}
|
[
"org.apache.sysml.utils.Statistics",
"org.junit.Assert"
] |
import org.apache.sysml.utils.Statistics; import org.junit.Assert;
|
import org.apache.sysml.utils.*; import org.junit.*;
|
[
"org.apache.sysml",
"org.junit"
] |
org.apache.sysml; org.junit;
| 1,589,719 |
public AS AS(SqlCompileableSelectChildNode selectChild) {
return new AS(this, selectChild);
}
|
AS function(SqlCompileableSelectChildNode selectChild) { return new AS(this, selectChild); }
|
/**
* Creates a AS followed by a {@link SELECT} statement
*/
|
Creates a AS followed by a <code>SELECT</code> statement
|
AS
|
{
"repo_name": "sockeqwe/sqlbrite-dao",
"path": "dao/src/main/java/com/hannesdorfmann/sqlbrite/dao/sql/view/CREATE_VIEW_IF_NOT_EXISTS.java",
"license": "apache-2.0",
"size": 791
}
|
[
"com.hannesdorfmann.sqlbrite.dao.sql.select.SqlCompileableSelectChildNode"
] |
import com.hannesdorfmann.sqlbrite.dao.sql.select.SqlCompileableSelectChildNode;
|
import com.hannesdorfmann.sqlbrite.dao.sql.select.*;
|
[
"com.hannesdorfmann.sqlbrite"
] |
com.hannesdorfmann.sqlbrite;
| 631,535 |
Mapper<LongWritable,Text, VarIntWritable, VarLongWritable>.Context context =
EasyMock.createMock(Mapper.Context.class);
context.write(new VarIntWritable(TasteHadoopUtils.idToIndex(789L)), new VarLongWritable(789L));
EasyMock.replay(context);
new ItemIDIndexMapper().map(new LongWritable(123L), new Text("456,789,5.0"), context);
EasyMock.verify(context);
}
/**
* tests {@link ItemIDIndexReducer}
|
Mapper<LongWritable,Text, VarIntWritable, VarLongWritable>.Context context = EasyMock.createMock(Mapper.Context.class); context.write(new VarIntWritable(TasteHadoopUtils.idToIndex(789L)), new VarLongWritable(789L)); EasyMock.replay(context); new ItemIDIndexMapper().map(new LongWritable(123L), new Text(STR), context); EasyMock.verify(context); } /** * tests {@link ItemIDIndexReducer}
|
/**
* tests {@link ItemIDIndexMapper}
*/
|
tests <code>ItemIDIndexMapper</code>
|
testItemIDIndexMapper
|
{
"repo_name": "huran2014/huran.github.io",
"path": "program_learning/Java/MyEclipseProfessional2014/mr/src/test/java/org/apache/mahout/cf/taste/hadoop/item/RecommenderJobTest.java",
"license": "gpl-2.0",
"size": 34424
}
|
[
"org.apache.hadoop.io.LongWritable",
"org.apache.hadoop.io.Text",
"org.apache.hadoop.mapreduce.Mapper",
"org.apache.mahout.cf.taste.hadoop.TasteHadoopUtils",
"org.apache.mahout.math.VarIntWritable",
"org.apache.mahout.math.VarLongWritable",
"org.easymock.EasyMock"
] |
import org.apache.hadoop.io.LongWritable; import org.apache.hadoop.io.Text; import org.apache.hadoop.mapreduce.Mapper; import org.apache.mahout.cf.taste.hadoop.TasteHadoopUtils; import org.apache.mahout.math.VarIntWritable; import org.apache.mahout.math.VarLongWritable; import org.easymock.EasyMock;
|
import org.apache.hadoop.io.*; import org.apache.hadoop.mapreduce.*; import org.apache.mahout.cf.taste.hadoop.*; import org.apache.mahout.math.*; import org.easymock.*;
|
[
"org.apache.hadoop",
"org.apache.mahout",
"org.easymock"
] |
org.apache.hadoop; org.apache.mahout; org.easymock;
| 2,802,489 |
public synchronized void dequeue() throws IOException {
final int length = byteDiskQueue.dequeueInt();
buffer.size(length);
byteDiskQueue.dequeue(buffer.elements(), 0, length);
size--;
}
|
synchronized void function() throws IOException { final int length = byteDiskQueue.dequeueInt(); buffer.size(length); byteDiskQueue.dequeue(buffer.elements(), 0, length); size--; }
|
/** Dequeues a byte array from the queue in FIFO fashion. The actual byte array
* will be stored in the {@linkplain #buffer() queue buffer}. */
|
Dequeues a byte array from the queue in FIFO fashion. The actual byte array
|
dequeue
|
{
"repo_name": "guillaumepitel/BUbiNG",
"path": "src/it/unimi/di/law/bubing/util/ByteArrayDiskQueue.java",
"license": "apache-2.0",
"size": 6693
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 2,654,019 |
public void setEras(String[] newEras) {
eras = Arrays.copyOf(newEras, newEras.length);
}
|
void function(String[] newEras) { eras = Arrays.copyOf(newEras, newEras.length); }
|
/**
* Sets era strings. For example: "AD" and "BC".
* @param newEras the new era strings.
*/
|
Sets era strings. For example: "AD" and "BC"
|
setEras
|
{
"repo_name": "life-beam/j2objc",
"path": "jre_emul/android/platform/libcore/ojluni/src/main/java/java/text/DateFormatSymbols.java",
"license": "apache-2.0",
"size": 37489
}
|
[
"java.util.Arrays"
] |
import java.util.Arrays;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 176,166 |
Employee save(Employee employee) throws DBException;
|
Employee save(Employee employee) throws DBException;
|
/**
* Insert a new Employee.
*
* @param employee
* The employee.
* @return Employee.
* @throws DBException
* If a problem occurs.
*/
|
Insert a new Employee
|
save
|
{
"repo_name": "oswa/bianccoAdmin",
"path": "BianccoAdministrator/src/main/java/com/biancco/admin/persistence/dao/EmployeeDAO.java",
"license": "apache-2.0",
"size": 2851
}
|
[
"com.biancco.admin.app.exception.DBException",
"com.biancco.admin.persistence.model.Employee"
] |
import com.biancco.admin.app.exception.DBException; import com.biancco.admin.persistence.model.Employee;
|
import com.biancco.admin.app.exception.*; import com.biancco.admin.persistence.model.*;
|
[
"com.biancco.admin"
] |
com.biancco.admin;
| 2,767,263 |
public void visit(final float f, final Field field) throws IOException;
|
void function(final float f, final Field field) throws IOException;
|
/**
* Called to visit a float32 field
*
* @param f
* The field value
*
* @param field
* The field type metadata
*
* @throws IOException
* FieldVisitor instances are usually serializers (writers), and
* thus write to an underlying data output stream. This
* exception declaration is to pass on any IOExceptions thrown
* when writing to that underlying data output stream.
*/
|
Called to visit a float32 field
|
visit
|
{
"repo_name": "culvertsoft/mgen",
"path": "mgen-javalib/src/main/java/se/culvertsoft/mgen/javapack/serialization/FieldVisitor.java",
"license": "mit",
"size": 6784
}
|
[
"java.io.IOException",
"se.culvertsoft.mgen.api.model.Field"
] |
import java.io.IOException; import se.culvertsoft.mgen.api.model.Field;
|
import java.io.*; import se.culvertsoft.mgen.api.model.*;
|
[
"java.io",
"se.culvertsoft.mgen"
] |
java.io; se.culvertsoft.mgen;
| 1,046,531 |
private PlanNode createJoinPlan(
Analyzer analyzer, TableRef leftmostRef, List<Pair<TableRef, PlanNode>> refPlans)
throws ImpalaException {
LOG.trace("createJoinPlan: " + leftmostRef.getAlias());
// the refs that have yet to be joined
List<Pair<TableRef, PlanNode>> remainingRefs = Lists.newArrayList();
PlanNode root = null; // root of accumulated join plan
for (Pair<TableRef, PlanNode> entry: refPlans) {
if (entry.first == leftmostRef) {
root = entry.second;
} else {
remainingRefs.add(entry);
}
}
Preconditions.checkNotNull(root);
// refs that have been joined. The union of joinedRefs and the refs in remainingRefs
// are the set of all table refs.
Set<TableRef> joinedRefs = Sets.newHashSet();
joinedRefs.add(leftmostRef);
// If the leftmostTblRef is an outer/semi/cross join, we must invert it.
if (leftmostRef.getJoinOp().isOuterJoin()
|| leftmostRef.getJoinOp().isSemiJoin()
|| leftmostRef.getJoinOp().isCrossJoin()) {
leftmostRef.invertJoin();
}
long numOps = 0;
int i = 0;
while (!remainingRefs.isEmpty()) {
// we minimize the resulting cardinality at each step in the join chain,
// which minimizes the total number of hash table lookups
PlanNode newRoot = null;
Pair<TableRef, PlanNode> minEntry = null;
for (Pair<TableRef, PlanNode> entry: remainingRefs) {
TableRef ref = entry.first;
LOG.trace(Integer.toString(i) + " considering ref " + ref.getAlias());
// Determine whether we can or must consider this join at this point in the plan.
// Place outer/semi joins at a fixed position in the plan tree (IMPALA-860),
// s.t. all the tables appearing to the left/right of an outer/semi join in
// the original query still remain to the left/right after join ordering. This
// prevents join re-ordering across outer/semi joins which is generally wrong.
// The checks below relies on remainingRefs being in the order as they originally
// appeared in the query.
JoinOperator joinOp = ref.getJoinOp();
if (joinOp.isOuterJoin() || joinOp.isSemiJoin()) {
List<TupleId> currentTids = Lists.newArrayList(root.getTblRefIds());
currentTids.add(ref.getId());
// Place outer/semi joins at a fixed position in the plan tree. We know that
// the join resulting from 'ref' must become the new root if the current
// root materializes exactly those tuple ids corresponding to TableRefs
// appearing to the left of 'ref' in the original query.
List<TupleId> tableRefTupleIds = ref.getAllTupleIds();
if (!currentTids.containsAll(tableRefTupleIds) ||
!tableRefTupleIds.containsAll(currentTids)) {
// Do not consider the remaining table refs to prevent incorrect re-ordering
// of tables across outer/semi/anti joins.
break;
}
} else if (ref.getJoinOp().isCrossJoin()) {
if (!joinedRefs.contains(ref.getLeftTblRef())) continue;
}
PlanNode rhsPlan = entry.second;
analyzer.setAssignedConjuncts(root.getAssignedConjuncts());
PlanNode candidate = createJoinNode(analyzer, root, rhsPlan, null, ref, false);
if (candidate == null) continue;
LOG.trace("cardinality=" + Long.toString(candidate.getCardinality()));
if (joinOp.isOuterJoin() || joinOp.isSemiJoin() || joinOp.isCrossJoin()) {
// Invert the join if doing so reduces the size of build-side hash table
// (may also reduce network costs depending on the join strategy).
// Only consider this optimization if both the lhs/rhs cardinalities are known.
long lhsCard = root.getCardinality();
long rhsCard = rhsPlan.getCardinality();
if (lhsCard != -1 && rhsCard != -1 &&
lhsCard * root.getAvgRowSize() < rhsCard * rhsPlan.getAvgRowSize()) {
ref.setJoinOp(ref.getJoinOp().invert());
candidate = createJoinNode(analyzer, rhsPlan, root, ref, null, false);
Preconditions.checkNotNull(candidate);
}
// Use 'candidate' as the new root; don't consider any other table refs at this
// position in the plan.
if (joinOp.isOuterJoin() || joinOp.isSemiJoin()) {
newRoot = candidate;
minEntry = entry;
break;
}
}
if (newRoot == null || candidate.getCardinality() < newRoot.getCardinality()) {
newRoot = candidate;
minEntry = entry;
}
}
if (newRoot == null) return null;
// we need to insert every rhs row into the hash table and then look up
// every lhs row
long lhsCardinality = root.getCardinality();
long rhsCardinality = minEntry.second.getCardinality();
numOps += lhsCardinality + rhsCardinality;
LOG.debug(Integer.toString(i) + " chose " + minEntry.first.getAlias()
+ " #lhs=" + Long.toString(lhsCardinality)
+ " #rhs=" + Long.toString(rhsCardinality)
+ " #ops=" + Long.toString(numOps));
remainingRefs.remove(minEntry);
joinedRefs.add(minEntry.first);
root = newRoot;
// assign id_ after running through the possible choices in order to end up
// with a dense sequence of node ids
root.setId(nodeIdGenerator_.getNextId());
analyzer.setAssignedConjuncts(root.getAssignedConjuncts());
// build side copies data to a compact representation in the tuple buffer.
root.getChildren().get(1).setCompactData(true);
++i;
}
return root;
}
|
PlanNode function( Analyzer analyzer, TableRef leftmostRef, List<Pair<TableRef, PlanNode>> refPlans) throws ImpalaException { LOG.trace(STR + leftmostRef.getAlias()); List<Pair<TableRef, PlanNode>> remainingRefs = Lists.newArrayList(); PlanNode root = null; for (Pair<TableRef, PlanNode> entry: refPlans) { if (entry.first == leftmostRef) { root = entry.second; } else { remainingRefs.add(entry); } } Preconditions.checkNotNull(root); Set<TableRef> joinedRefs = Sets.newHashSet(); joinedRefs.add(leftmostRef); if (leftmostRef.getJoinOp().isOuterJoin() leftmostRef.getJoinOp().isSemiJoin() leftmostRef.getJoinOp().isCrossJoin()) { leftmostRef.invertJoin(); } long numOps = 0; int i = 0; while (!remainingRefs.isEmpty()) { PlanNode newRoot = null; Pair<TableRef, PlanNode> minEntry = null; for (Pair<TableRef, PlanNode> entry: remainingRefs) { TableRef ref = entry.first; LOG.trace(Integer.toString(i) + STR + ref.getAlias()); JoinOperator joinOp = ref.getJoinOp(); if (joinOp.isOuterJoin() joinOp.isSemiJoin()) { List<TupleId> currentTids = Lists.newArrayList(root.getTblRefIds()); currentTids.add(ref.getId()); List<TupleId> tableRefTupleIds = ref.getAllTupleIds(); if (!currentTids.containsAll(tableRefTupleIds) !tableRefTupleIds.containsAll(currentTids)) { break; } } else if (ref.getJoinOp().isCrossJoin()) { if (!joinedRefs.contains(ref.getLeftTblRef())) continue; } PlanNode rhsPlan = entry.second; analyzer.setAssignedConjuncts(root.getAssignedConjuncts()); PlanNode candidate = createJoinNode(analyzer, root, rhsPlan, null, ref, false); if (candidate == null) continue; LOG.trace(STR + Long.toString(candidate.getCardinality())); if (joinOp.isOuterJoin() joinOp.isSemiJoin() joinOp.isCrossJoin()) { long lhsCard = root.getCardinality(); long rhsCard = rhsPlan.getCardinality(); if (lhsCard != -1 && rhsCard != -1 && lhsCard * root.getAvgRowSize() < rhsCard * rhsPlan.getAvgRowSize()) { ref.setJoinOp(ref.getJoinOp().invert()); candidate = createJoinNode(analyzer, rhsPlan, root, ref, null, false); Preconditions.checkNotNull(candidate); } if (joinOp.isOuterJoin() joinOp.isSemiJoin()) { newRoot = candidate; minEntry = entry; break; } } if (newRoot == null candidate.getCardinality() < newRoot.getCardinality()) { newRoot = candidate; minEntry = entry; } } if (newRoot == null) return null; long lhsCardinality = root.getCardinality(); long rhsCardinality = minEntry.second.getCardinality(); numOps += lhsCardinality + rhsCardinality; LOG.debug(Integer.toString(i) + STR + minEntry.first.getAlias() + STR + Long.toString(lhsCardinality) + STR + Long.toString(rhsCardinality) + STR + Long.toString(numOps)); remainingRefs.remove(minEntry); joinedRefs.add(minEntry.first); root = newRoot; root.setId(nodeIdGenerator_.getNextId()); analyzer.setAssignedConjuncts(root.getAssignedConjuncts()); root.getChildren().get(1).setCompactData(true); ++i; } return root; }
|
/**
* Returns a plan with leftmostRef's plan as its leftmost input; the joins
* are in decreasing order of selectiveness (percentage of rows they eliminate).
* The leftmostRef's join will be inverted if it is an outer/semi/cross join.
*/
|
Returns a plan with leftmostRef's plan as its leftmost input; the joins are in decreasing order of selectiveness (percentage of rows they eliminate). The leftmostRef's join will be inverted if it is an outer/semi/cross join
|
createJoinPlan
|
{
"repo_name": "AtScaleInc/Impala",
"path": "fe/src/main/java/com/cloudera/impala/planner/Planner.java",
"license": "apache-2.0",
"size": 98502
}
|
[
"com.cloudera.impala.analysis.Analyzer",
"com.cloudera.impala.analysis.JoinOperator",
"com.cloudera.impala.analysis.TableRef",
"com.cloudera.impala.analysis.TupleId",
"com.cloudera.impala.common.ImpalaException",
"com.cloudera.impala.common.Pair",
"com.google.common.base.Preconditions",
"com.google.common.collect.Lists",
"com.google.common.collect.Sets",
"java.util.List",
"java.util.Set"
] |
import com.cloudera.impala.analysis.Analyzer; import com.cloudera.impala.analysis.JoinOperator; import com.cloudera.impala.analysis.TableRef; import com.cloudera.impala.analysis.TupleId; import com.cloudera.impala.common.ImpalaException; import com.cloudera.impala.common.Pair; import com.google.common.base.Preconditions; import com.google.common.collect.Lists; import com.google.common.collect.Sets; import java.util.List; import java.util.Set;
|
import com.cloudera.impala.analysis.*; import com.cloudera.impala.common.*; import com.google.common.base.*; import com.google.common.collect.*; import java.util.*;
|
[
"com.cloudera.impala",
"com.google.common",
"java.util"
] |
com.cloudera.impala; com.google.common; java.util;
| 1,479,786 |
protected Ignite startGridWithIgfs(String gridName, String igfsName, IgfsMode mode,
@Nullable IgfsSecondaryFileSystem secondaryFs, @Nullable IgfsIpcEndpointConfiguration restCfg) throws Exception {
FileSystemConfiguration igfsCfg = new FileSystemConfiguration();
igfsCfg.setDataCacheName("dataCache");
igfsCfg.setMetaCacheName("metaCache");
igfsCfg.setName(igfsName);
igfsCfg.setBlockSize(IGFS_BLOCK_SIZE);
igfsCfg.setDefaultMode(mode);
igfsCfg.setIpcEndpointConfiguration(restCfg);
igfsCfg.setSecondaryFileSystem(secondaryFs);
igfsCfg.setPrefetchBlocks(PREFETCH_BLOCKS);
igfsCfg.setSequentialReadsBeforePrefetch(SEQ_READS_BEFORE_PREFETCH);
CacheConfiguration dataCacheCfg = defaultCacheConfiguration();
dataCacheCfg.setName("dataCache");
dataCacheCfg.setCacheMode(PARTITIONED);
dataCacheCfg.setNearConfiguration(null);
dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(2));
dataCacheCfg.setBackups(0);
dataCacheCfg.setAtomicityMode(TRANSACTIONAL);
dataCacheCfg.setOffHeapMaxMemory(0);
CacheConfiguration metaCacheCfg = defaultCacheConfiguration();
metaCacheCfg.setName("metaCache");
metaCacheCfg.setCacheMode(REPLICATED);
metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC);
metaCacheCfg.setAtomicityMode(TRANSACTIONAL);
IgniteConfiguration cfg = new IgniteConfiguration();
cfg.setGridName(gridName);
TcpDiscoverySpi discoSpi = new TcpDiscoverySpi();
discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true));
cfg.setDiscoverySpi(discoSpi);
cfg.setCacheConfiguration(dataCacheCfg, metaCacheCfg);
cfg.setFileSystemConfiguration(igfsCfg);
cfg.setLocalHost("127.0.0.1");
cfg.setConnectorConfiguration(null);
HadoopConfiguration hadoopCfg = createHadoopConfiguration();
if (hadoopCfg != null)
cfg.setHadoopConfiguration(hadoopCfg);
return G.start(cfg);
}
|
Ignite function(String gridName, String igfsName, IgfsMode mode, @Nullable IgfsSecondaryFileSystem secondaryFs, @Nullable IgfsIpcEndpointConfiguration restCfg) throws Exception { FileSystemConfiguration igfsCfg = new FileSystemConfiguration(); igfsCfg.setDataCacheName(STR); igfsCfg.setMetaCacheName(STR); igfsCfg.setName(igfsName); igfsCfg.setBlockSize(IGFS_BLOCK_SIZE); igfsCfg.setDefaultMode(mode); igfsCfg.setIpcEndpointConfiguration(restCfg); igfsCfg.setSecondaryFileSystem(secondaryFs); igfsCfg.setPrefetchBlocks(PREFETCH_BLOCKS); igfsCfg.setSequentialReadsBeforePrefetch(SEQ_READS_BEFORE_PREFETCH); CacheConfiguration dataCacheCfg = defaultCacheConfiguration(); dataCacheCfg.setName(STR); dataCacheCfg.setCacheMode(PARTITIONED); dataCacheCfg.setNearConfiguration(null); dataCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC); dataCacheCfg.setAffinityMapper(new IgfsGroupDataBlocksKeyMapper(2)); dataCacheCfg.setBackups(0); dataCacheCfg.setAtomicityMode(TRANSACTIONAL); dataCacheCfg.setOffHeapMaxMemory(0); CacheConfiguration metaCacheCfg = defaultCacheConfiguration(); metaCacheCfg.setName(STR); metaCacheCfg.setCacheMode(REPLICATED); metaCacheCfg.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC); metaCacheCfg.setAtomicityMode(TRANSACTIONAL); IgniteConfiguration cfg = new IgniteConfiguration(); cfg.setGridName(gridName); TcpDiscoverySpi discoSpi = new TcpDiscoverySpi(); discoSpi.setIpFinder(new TcpDiscoveryVmIpFinder(true)); cfg.setDiscoverySpi(discoSpi); cfg.setCacheConfiguration(dataCacheCfg, metaCacheCfg); cfg.setFileSystemConfiguration(igfsCfg); cfg.setLocalHost(STR); cfg.setConnectorConfiguration(null); HadoopConfiguration hadoopCfg = createHadoopConfiguration(); if (hadoopCfg != null) cfg.setHadoopConfiguration(hadoopCfg); return G.start(cfg); }
|
/**
* Start grid with IGFS.
*
* @param gridName Grid name.
* @param igfsName IGFS name
* @param mode IGFS mode.
* @param secondaryFs Secondary file system (optional).
* @param restCfg Rest configuration string (optional).
* @return Started grid instance.
* @throws Exception If failed.
*/
|
Start grid with IGFS
|
startGridWithIgfs
|
{
"repo_name": "kromulan/ignite",
"path": "modules/hadoop/src/test/java/org/apache/ignite/internal/processors/hadoop/HadoopAbstractMapReduceTest.java",
"license": "apache-2.0",
"size": 15485
}
|
[
"org.apache.ignite.Ignite",
"org.apache.ignite.cache.CacheWriteSynchronizationMode",
"org.apache.ignite.configuration.CacheConfiguration",
"org.apache.ignite.configuration.FileSystemConfiguration",
"org.apache.ignite.configuration.HadoopConfiguration",
"org.apache.ignite.configuration.IgniteConfiguration",
"org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper",
"org.apache.ignite.igfs.IgfsIpcEndpointConfiguration",
"org.apache.ignite.igfs.IgfsMode",
"org.apache.ignite.igfs.secondary.IgfsSecondaryFileSystem",
"org.apache.ignite.internal.util.typedef.G",
"org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi",
"org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder",
"org.jetbrains.annotations.Nullable"
] |
import org.apache.ignite.Ignite; import org.apache.ignite.cache.CacheWriteSynchronizationMode; import org.apache.ignite.configuration.CacheConfiguration; import org.apache.ignite.configuration.FileSystemConfiguration; import org.apache.ignite.configuration.HadoopConfiguration; import org.apache.ignite.configuration.IgniteConfiguration; import org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper; import org.apache.ignite.igfs.IgfsIpcEndpointConfiguration; import org.apache.ignite.igfs.IgfsMode; import org.apache.ignite.igfs.secondary.IgfsSecondaryFileSystem; import org.apache.ignite.internal.util.typedef.G; import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi; import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder; import org.jetbrains.annotations.Nullable;
|
import org.apache.ignite.*; import org.apache.ignite.cache.*; import org.apache.ignite.configuration.*; import org.apache.ignite.igfs.*; import org.apache.ignite.igfs.secondary.*; import org.apache.ignite.internal.util.typedef.*; import org.apache.ignite.spi.discovery.tcp.*; import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*; import org.jetbrains.annotations.*;
|
[
"org.apache.ignite",
"org.jetbrains.annotations"
] |
org.apache.ignite; org.jetbrains.annotations;
| 2,694,949 |
public static int getLogWriterLevel(final Level log4jLevel) {
Integer result = S2I.get(log4jLevel.name());
if (result == null)
throw new IllegalArgumentException("Unknown Log4J level [" + log4jLevel + "].");
return result;
}
|
static int function(final Level log4jLevel) { Integer result = S2I.get(log4jLevel.name()); if (result == null) throw new IllegalArgumentException(STR + log4jLevel + "]."); return result; }
|
/**
* convert log4j level to logwriter code
*
* @param log4jLevel log4j level object
* @return legacy logwriter code
*/
|
convert log4j level to logwriter code
|
getLogWriterLevel
|
{
"repo_name": "smanvi-pivotal/geode",
"path": "geode-core/src/main/java/org/apache/geode/internal/logging/log4j/LogLevel.java",
"license": "apache-2.0",
"size": 6300
}
|
[
"org.apache.logging.log4j.Level"
] |
import org.apache.logging.log4j.Level;
|
import org.apache.logging.log4j.*;
|
[
"org.apache.logging"
] |
org.apache.logging;
| 2,458,678 |
public ClientFactoryBuilder proxyConfig(ProxySelector proxySelector) {
requireNonNull(proxySelector, "proxySelector");
option(ClientFactoryOptions.PROXY_CONFIG_SELECTOR, ProxyConfigSelector.of(proxySelector));
return this;
}
|
ClientFactoryBuilder function(ProxySelector proxySelector) { requireNonNull(proxySelector, STR); option(ClientFactoryOptions.PROXY_CONFIG_SELECTOR, ProxyConfigSelector.of(proxySelector)); return this; }
|
/**
* Sets the {@link ProxySelector} which determines the {@link ProxyConfig} to be used.
*
* <p>This method makes a best effort to provide compatibility with {@link ProxySelector},
* but it has some limitations. See {@link ProxyConfigSelector#of(ProxySelector)} for more information.
*/
|
Sets the <code>ProxySelector</code> which determines the <code>ProxyConfig</code> to be used. This method makes a best effort to provide compatibility with <code>ProxySelector</code>, but it has some limitations. See <code>ProxyConfigSelector#of(ProxySelector)</code> for more information
|
proxyConfig
|
{
"repo_name": "minwoox/armeria",
"path": "core/src/main/java/com/linecorp/armeria/client/ClientFactoryBuilder.java",
"license": "apache-2.0",
"size": 31760
}
|
[
"com.linecorp.armeria.client.proxy.ProxyConfigSelector",
"java.net.ProxySelector",
"java.util.Objects"
] |
import com.linecorp.armeria.client.proxy.ProxyConfigSelector; import java.net.ProxySelector; import java.util.Objects;
|
import com.linecorp.armeria.client.proxy.*; import java.net.*; import java.util.*;
|
[
"com.linecorp.armeria",
"java.net",
"java.util"
] |
com.linecorp.armeria; java.net; java.util;
| 1,837,382 |
public short getShort(int columnIndex) throws SQLException {
Short value = getObject(columnIndex, Short.class);
return value == null ? 0 : value;
}
/**
* Returns the column value, cast to the specified type.
*
* <p>
* This can be used as an alternative to getters that return primitive types, if you need to
* distinguish between 0 and SQL NULL. For example:
*
* <blockquote>
*
* <pre>
* Long value = row.getObject(0, Long.class);
* if (value == null) {
* // The value was SQL NULL, not 0.
* }
|
short function(int columnIndex) throws SQLException { Short value = getObject(columnIndex, Short.class); return value == null ? 0 : value; } /** * Returns the column value, cast to the specified type. * * <p> * This can be used as an alternative to getters that return primitive types, if you need to * distinguish between 0 and SQL NULL. For example: * * <blockquote> * * <pre> * Long value = row.getObject(0, Long.class); * if (value == null) { * * }
|
/**
* Returns the column value, or 0 if the value is SQL NULL.
*
* <p>
* To distinguish between 0 and SQL NULL, use either {@link #wasNull()} or
* {@link #getObject(int,Class)}.
*
* @param columnIndex 1-based column number (0 is invalid)
*/
|
Returns the column value, or 0 if the value is SQL NULL. To distinguish between 0 and SQL NULL, use either <code>#wasNull()</code> or <code>#getObject(int,Class)</code>
|
getShort
|
{
"repo_name": "derekstavis/bluntly",
"path": "vendor/github.com/youtube/vitess/java/client/src/main/java/com/youtube/vitess/client/cursor/Row.java",
"license": "mit",
"size": 22340
}
|
[
"java.sql.SQLException"
] |
import java.sql.SQLException;
|
import java.sql.*;
|
[
"java.sql"
] |
java.sql;
| 2,397,189 |
public boolean isAllowedTo(String subjectid, String resourcePath, String httpMethod) {
boolean allow = false;
if (subjectid != null && !StringUtils.isBlank(resourcePath) && !StringUtils.isBlank(httpMethod)) {
// urlDecode resource path
resourcePath = Utils.urlDecode(resourcePath);
if (getResourcePermissions().isEmpty()) {
// Default policy is "deny all". Returning true here would make it "allow all".
return false;
}
if (isDeniedExplicitly(subjectid, resourcePath, httpMethod)) {
return false;
}
if (getResourcePermissions().containsKey(subjectid) &&
getResourcePermissions().get(subjectid).containsKey(resourcePath)) {
// subject-specific permissions have precedence over wildcard permissions
// i.e. only the permissions for that subjectid are checked, other permissions are ignored
allow = isAllowed(subjectid, resourcePath, httpMethod);
} else {
allow = isAllowed(subjectid, resourcePath, httpMethod) ||
isAllowed(subjectid, ALLOW_ALL, httpMethod) ||
isAllowed(ALLOW_ALL, resourcePath, httpMethod) ||
isAllowed(ALLOW_ALL, ALLOW_ALL, httpMethod);
}
}
if (allow) {
if (isRootApp() && !Para.getConfig().getConfigBoolean("clients_can_access_root_app", false)) {
return false;
}
if (StringUtils.isBlank(subjectid)) {
// guest access check
return isAllowed(ALLOW_ALL, resourcePath, GUEST.toString());
}
return true;
}
return isAllowedImplicitly(subjectid, resourcePath, httpMethod);
}
|
boolean function(String subjectid, String resourcePath, String httpMethod) { boolean allow = false; if (subjectid != null && !StringUtils.isBlank(resourcePath) && !StringUtils.isBlank(httpMethod)) { resourcePath = Utils.urlDecode(resourcePath); if (getResourcePermissions().isEmpty()) { return false; } if (isDeniedExplicitly(subjectid, resourcePath, httpMethod)) { return false; } if (getResourcePermissions().containsKey(subjectid) && getResourcePermissions().get(subjectid).containsKey(resourcePath)) { allow = isAllowed(subjectid, resourcePath, httpMethod); } else { allow = isAllowed(subjectid, resourcePath, httpMethod) isAllowed(subjectid, ALLOW_ALL, httpMethod) isAllowed(ALLOW_ALL, resourcePath, httpMethod) isAllowed(ALLOW_ALL, ALLOW_ALL, httpMethod); } } if (allow) { if (isRootApp() && !Para.getConfig().getConfigBoolean(STR, false)) { return false; } if (StringUtils.isBlank(subjectid)) { return isAllowed(ALLOW_ALL, resourcePath, GUEST.toString()); } return true; } return isAllowedImplicitly(subjectid, resourcePath, httpMethod); }
|
/**
* Checks if a subject is allowed to call method X on resource Y.
* @param subjectid subject id
* @param resourcePath resource path or object type
* @param httpMethod HTTP method name
* @return true if allowed
*/
|
Checks if a subject is allowed to call method X on resource Y
|
isAllowedTo
|
{
"repo_name": "Erudika/para",
"path": "para-core/src/main/java/com/erudika/para/core/App.java",
"license": "apache-2.0",
"size": 42818
}
|
[
"com.erudika.para.core.App",
"com.erudika.para.core.utils.Para",
"com.erudika.para.core.utils.Utils",
"org.apache.commons.lang3.StringUtils"
] |
import com.erudika.para.core.App; import com.erudika.para.core.utils.Para; import com.erudika.para.core.utils.Utils; import org.apache.commons.lang3.StringUtils;
|
import com.erudika.para.core.*; import com.erudika.para.core.utils.*; import org.apache.commons.lang3.*;
|
[
"com.erudika.para",
"org.apache.commons"
] |
com.erudika.para; org.apache.commons;
| 234,850 |
public native void addShapeList( Shape[] shapes, ExtrudeGeometryOptions options );
|
native void function( Shape[] shapes, ExtrudeGeometryOptions options );
|
/** Adds the shapes to the list to extrude.
*
* @param shapes Array of shapes
* @param options options
*/
|
Adds the shapes to the list to extrude
|
addShapeList
|
{
"repo_name": "pesse/gwt-jsinterop-threejs",
"path": "jsinterop-threejs/src/main/java/de/pesse/gwt/jsinterop/threeJs/geometries/ExtrudeGeometry.java",
"license": "apache-2.0",
"size": 1692
}
|
[
"de.pesse.gwt.jsinterop.threeJs.core.Shape"
] |
import de.pesse.gwt.jsinterop.threeJs.core.Shape;
|
import de.pesse.gwt.jsinterop.*;
|
[
"de.pesse.gwt"
] |
de.pesse.gwt;
| 1,774,718 |
public List<NameValuePair> getParams() {
return params;
}
|
List<NameValuePair> function() { return params; }
|
/**
* Get the list of additional parameters included in this request.
*
* @return The list of additional parameters
*/
|
Get the list of additional parameters included in this request
|
getParams
|
{
"repo_name": "RallyTools/RallyRestToolkitForJava",
"path": "src/main/java/com/rallydev/rest/request/Request.java",
"license": "mit",
"size": 2213
}
|
[
"java.util.List",
"org.apache.http.NameValuePair"
] |
import java.util.List; import org.apache.http.NameValuePair;
|
import java.util.*; import org.apache.http.*;
|
[
"java.util",
"org.apache.http"
] |
java.util; org.apache.http;
| 1,355,117 |
@Test
public void matchOchSignalTypeTest() {
Criterion criterion = Criteria.matchOchSignalType(OchSignalType.FIXED_GRID);
ObjectNode result = criterionCodec.encode(criterion, context);
assertThat(result, matchesCriterion(criterion));
}
|
void function() { Criterion criterion = Criteria.matchOchSignalType(OchSignalType.FIXED_GRID); ObjectNode result = criterionCodec.encode(criterion, context); assertThat(result, matchesCriterion(criterion)); }
|
/**
* Tests Och signal type criterion.
*/
|
Tests Och signal type criterion
|
matchOchSignalTypeTest
|
{
"repo_name": "maxkondr/onos-porta",
"path": "core/common/src/test/java/org/onosproject/codec/impl/CriterionCodecTest.java",
"license": "apache-2.0",
"size": 14228
}
|
[
"com.fasterxml.jackson.databind.node.ObjectNode",
"org.hamcrest.MatcherAssert",
"org.onosproject.codec.impl.CriterionJsonMatcher",
"org.onosproject.net.OchSignalType",
"org.onosproject.net.flow.criteria.Criteria",
"org.onosproject.net.flow.criteria.Criterion"
] |
import com.fasterxml.jackson.databind.node.ObjectNode; import org.hamcrest.MatcherAssert; import org.onosproject.codec.impl.CriterionJsonMatcher; import org.onosproject.net.OchSignalType; import org.onosproject.net.flow.criteria.Criteria; import org.onosproject.net.flow.criteria.Criterion;
|
import com.fasterxml.jackson.databind.node.*; import org.hamcrest.*; import org.onosproject.codec.impl.*; import org.onosproject.net.*; import org.onosproject.net.flow.criteria.*;
|
[
"com.fasterxml.jackson",
"org.hamcrest",
"org.onosproject.codec",
"org.onosproject.net"
] |
com.fasterxml.jackson; org.hamcrest; org.onosproject.codec; org.onosproject.net;
| 2,495,180 |
void actionSelect(AjaxRequestTarget aTarget) throws IOException, AnnotationException;
|
void actionSelect(AjaxRequestTarget aTarget) throws IOException, AnnotationException;
|
/**
* Load the annotation pointed to in {@link AnnotatorState#getSelection()} in the detail panel.
*/
|
Load the annotation pointed to in <code>AnnotatorState#getSelection()</code> in the detail panel
|
actionSelect
|
{
"repo_name": "webanno/webanno",
"path": "webanno-api-annotation/src/main/java/de/tudarmstadt/ukp/clarin/webanno/api/annotation/action/AnnotationActionHandler.java",
"license": "apache-2.0",
"size": 3961
}
|
[
"de.tudarmstadt.ukp.clarin.webanno.api.annotation.exception.AnnotationException",
"java.io.IOException",
"org.apache.wicket.ajax.AjaxRequestTarget"
] |
import de.tudarmstadt.ukp.clarin.webanno.api.annotation.exception.AnnotationException; import java.io.IOException; import org.apache.wicket.ajax.AjaxRequestTarget;
|
import de.tudarmstadt.ukp.clarin.webanno.api.annotation.exception.*; import java.io.*; import org.apache.wicket.ajax.*;
|
[
"de.tudarmstadt.ukp",
"java.io",
"org.apache.wicket"
] |
de.tudarmstadt.ukp; java.io; org.apache.wicket;
| 922,331 |
public static void deleteStoredEntities(
String entityName, String sessionID, DatastoreService datastore) {
Filter currentUserFilter = new FilterPredicate("id", FilterOperator.EQUAL, sessionID);
Query query = new Query(entityName).setFilter(currentUserFilter);
PreparedQuery results = datastore.prepare(query);
for (Entity entity : results.asIterable()) {
datastore.delete(entity.getKey());
}
}
|
static void function( String entityName, String sessionID, DatastoreService datastore) { Filter currentUserFilter = new FilterPredicate("id", FilterOperator.EQUAL, sessionID); Query query = new Query(entityName).setFilter(currentUserFilter); PreparedQuery results = datastore.prepare(query); for (Entity entity : results.asIterable()) { datastore.delete(entity.getKey()); } }
|
/**
* This function deletes all Entitys in Datastore of type specified by parameter.
*
* @param entityName name of Entity to delete
* @param sessionID unique id of session to delete entities from
* @param datastore DatastoreService instance used to access Book info from database
*/
|
This function deletes all Entitys in Datastore of type specified by parameter
|
deleteStoredEntities
|
{
"repo_name": "googleinterns/step43-2020",
"path": "portfolio/src/main/java/com/google/sps/utils/BooksMemoryUtils.java",
"license": "apache-2.0",
"size": 28388
}
|
[
"com.google.appengine.api.datastore.DatastoreService",
"com.google.appengine.api.datastore.Entity",
"com.google.appengine.api.datastore.PreparedQuery",
"com.google.appengine.api.datastore.Query"
] |
import com.google.appengine.api.datastore.DatastoreService; import com.google.appengine.api.datastore.Entity; import com.google.appengine.api.datastore.PreparedQuery; import com.google.appengine.api.datastore.Query;
|
import com.google.appengine.api.datastore.*;
|
[
"com.google.appengine"
] |
com.google.appengine;
| 685,741 |
public void setReturnType(String type) {
if (!Strings.isEmpty(type)
&& !Objects.equals("void", type)
&& !Objects.equals(Void.class.getName(), type)) {
this.sarlAction.setReturnType(newTypeRef(container, type));
} else {
this.sarlAction.setReturnType(null);
}
}
|
void function(String type) { if (!Strings.isEmpty(type) && !Objects.equals("void", type) && !Objects.equals(Void.class.getName(), type)) { this.sarlAction.setReturnType(newTypeRef(container, type)); } else { this.sarlAction.setReturnType(null); } }
|
/** Change the return type.
@param type the return type of the member.
*/
|
Change the return type
|
setReturnType
|
{
"repo_name": "jgfoster/sarl",
"path": "main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/SarlActionBuilderImpl.java",
"license": "apache-2.0",
"size": 6640
}
|
[
"java.util.Objects",
"org.eclipse.xtext.util.Strings"
] |
import java.util.Objects; import org.eclipse.xtext.util.Strings;
|
import java.util.*; import org.eclipse.xtext.util.*;
|
[
"java.util",
"org.eclipse.xtext"
] |
java.util; org.eclipse.xtext;
| 190,685 |
public void setDynaSpotTranslucence(float a) {
DYNASPOT_MAX_TRANSLUCENCY = a;
dsST = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, DYNASPOT_MAX_TRANSLUCENCY);
}
|
void function(float a) { DYNASPOT_MAX_TRANSLUCENCY = a; dsST = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, DYNASPOT_MAX_TRANSLUCENCY); }
|
/**
* Set the translucence level of the dynaspot area.
*
* @param a alpha value in [0.0-1.0]
*/
|
Set the translucence level of the dynaspot area
|
setDynaSpotTranslucence
|
{
"repo_name": "sharwell/zgrnbviewer",
"path": "org-tvl-netbeans-zgrviewer/src/fr/inria/zvtm/engine/DynaPicker.java",
"license": "lgpl-3.0",
"size": 16532
}
|
[
"java.awt.AlphaComposite"
] |
import java.awt.AlphaComposite;
|
import java.awt.*;
|
[
"java.awt"
] |
java.awt;
| 2,247,407 |
private boolean isAcceptableModifierKey(int keyCode) {
switch (keyCode) {
case KeyEvent.KEYCODE_ALT_LEFT:
case KeyEvent.KEYCODE_ALT_RIGHT:
case KeyEvent.KEYCODE_SHIFT_LEFT:
case KeyEvent.KEYCODE_SHIFT_RIGHT:
return true;
default:
return false;
}
}
|
boolean function(int keyCode) { switch (keyCode) { case KeyEvent.KEYCODE_ALT_LEFT: case KeyEvent.KEYCODE_ALT_RIGHT: case KeyEvent.KEYCODE_SHIFT_LEFT: case KeyEvent.KEYCODE_SHIFT_RIGHT: return true; default: return false; } }
|
/**
* Return true if the keyCode is an accepted modifier key for the
* dialer (ALT or SHIFT).
*/
|
Return true if the keyCode is an accepted modifier key for the dialer (ALT or SHIFT)
|
isAcceptableModifierKey
|
{
"repo_name": "s20121035/rk3288_android5.1_repo",
"path": "packages/apps/InCallUI/src/com/android/incallui/DialpadFragment.java",
"license": "gpl-3.0",
"size": 20705
}
|
[
"android.view.KeyEvent"
] |
import android.view.KeyEvent;
|
import android.view.*;
|
[
"android.view"
] |
android.view;
| 854,530 |
public void load(FloatBuffer buffer) {
x = buffer.get();
y = buffer.get();
z = buffer.get();
w = buffer.get();
}
|
void function(FloatBuffer buffer) { x = buffer.get(); y = buffer.get(); z = buffer.get(); w = buffer.get(); }
|
/**
* Loads values for this {@link Vector4} from the given {@link FloatBuffer}.
*
* @param buffer The {@link FloatBuffer} to load values from.
*/
|
Loads values for this <code>Vector4</code> from the given <code>FloatBuffer</code>
|
load
|
{
"repo_name": "Arcbe/GPVM",
"path": "src/taiga/code/math/Vector4.java",
"license": "lgpl-3.0",
"size": 5279
}
|
[
"java.nio.FloatBuffer"
] |
import java.nio.FloatBuffer;
|
import java.nio.*;
|
[
"java.nio"
] |
java.nio;
| 1,780,968 |
public static Student readStudentByNumber(final Integer number) {
return Bennu.getInstance().getStudentNumbersSet().stream().filter(sn -> sn.getNumber().equals(number))
.map(StudentNumber::getStudent).findAny().orElse(null);
}
|
static Student function(final Integer number) { return Bennu.getInstance().getStudentNumbersSet().stream().filter(sn -> sn.getNumber().equals(number)) .map(StudentNumber::getStudent).findAny().orElse(null); }
|
/**
* It should be given preference to use {@link Registration#readByNumber(Integer)} instead of
* this method. If it is not possible to use {@link Registration#readByNumber(Integer)}, then
* the logic should be evaluated and reviewed.
*
* @param number
* @return
*/
|
It should be given preference to use <code>Registration#readByNumber(Integer)</code> instead of this method. If it is not possible to use <code>Registration#readByNumber(Integer)</code>, then the logic should be evaluated and reviewed
|
readStudentByNumber
|
{
"repo_name": "qub-it/fenixedu-academic",
"path": "src/main/java/org/fenixedu/academic/domain/student/Student.java",
"license": "lgpl-3.0",
"size": 15610
}
|
[
"org.fenixedu.bennu.core.domain.Bennu"
] |
import org.fenixedu.bennu.core.domain.Bennu;
|
import org.fenixedu.bennu.core.domain.*;
|
[
"org.fenixedu.bennu"
] |
org.fenixedu.bennu;
| 2,315,929 |
private static JPanel makeListPanel(String inNameKey, JList<String> inList)
{
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
panel.add(new JLabel(I18nManager.getText(inNameKey)), BorderLayout.NORTH);
inList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
panel.add(new JScrollPane(inList), BorderLayout.CENTER);
return panel;
}
|
static JPanel function(String inNameKey, JList<String> inList) { JPanel panel = new JPanel(); panel.setLayout(new BorderLayout()); panel.add(new JLabel(I18nManager.getText(inNameKey)), BorderLayout.NORTH); inList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); panel.add(new JScrollPane(inList), BorderLayout.CENTER); return panel; }
|
/**
* Make one of the three list panels
* @param inNameKey key for heading text
* @param inList list object
* @return panel object
*/
|
Make one of the three list panels
|
makeListPanel
|
{
"repo_name": "activityworkshop/GpsPrune",
"path": "src/tim/prune/gui/SelectorDisplay.java",
"license": "gpl-2.0",
"size": 11184
}
|
[
"java.awt.BorderLayout",
"javax.swing.JLabel",
"javax.swing.JList",
"javax.swing.JPanel",
"javax.swing.JScrollPane",
"javax.swing.ListSelectionModel"
] |
import java.awt.BorderLayout; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.ListSelectionModel;
|
import java.awt.*; import javax.swing.*;
|
[
"java.awt",
"javax.swing"
] |
java.awt; javax.swing;
| 1,762,493 |
public static void setVector(UInt1Vector vector, Byte... values) {
final int length = values.length;
vector.allocateNew(length);
for (int i = 0; i < length; i++) {
if (values[i] != null) {
vector.set(i, values[i]);
}
}
vector.setValueCount(length);
}
|
static void function(UInt1Vector vector, Byte... values) { final int length = values.length; vector.allocateNew(length); for (int i = 0; i < length; i++) { if (values[i] != null) { vector.set(i, values[i]); } } vector.setValueCount(length); }
|
/**
* Populate values for UInt1Vector.
*/
|
Populate values for UInt1Vector
|
setVector
|
{
"repo_name": "wesm/arrow",
"path": "java/vector/src/test/java/org/apache/arrow/vector/testing/ValueVectorDataPopulator.java",
"license": "apache-2.0",
"size": 20903
}
|
[
"org.apache.arrow.vector.UInt1Vector"
] |
import org.apache.arrow.vector.UInt1Vector;
|
import org.apache.arrow.vector.*;
|
[
"org.apache.arrow"
] |
org.apache.arrow;
| 335,786 |
public void setNoQuerySetOpen() {
curState = State.DISABLED;
fireSourceChanged(ISources.WORKBENCH, STATE, DISABLED);
}
|
void function() { curState = State.DISABLED; fireSourceChanged(ISources.WORKBENCH, STATE, DISABLED); }
|
/**
* Indicate that there are no open query sets
*
*/
|
Indicate that there are no open query sets
|
setNoQuerySetOpen
|
{
"repo_name": "intelligentautomation/proteus",
"path": "plugins/com.iai.proteus/src/com/iai/proteus/ui/queryset/QuerySetOpenState.java",
"license": "lgpl-3.0",
"size": 1507
}
|
[
"org.eclipse.ui.ISources"
] |
import org.eclipse.ui.ISources;
|
import org.eclipse.ui.*;
|
[
"org.eclipse.ui"
] |
org.eclipse.ui;
| 585,566 |
public boolean bulkApiLogin() throws Exception {
log.info("Authenticating salesforce bulk api");
boolean success = false;
String hostName = this.workUnitState.getProp(ConfigurationKeys.SOURCE_CONN_HOST_NAME);
String apiVersion = this.workUnitState.getProp(ConfigurationKeys.SOURCE_CONN_VERSION);
if (Strings.isNullOrEmpty(apiVersion)) {
apiVersion = "29.0";
}
String soapAuthEndPoint = hostName + SALESFORCE_SOAP_SERVICE + "/" + apiVersion;
try {
ConnectorConfig partnerConfig = new ConnectorConfig();
if (super.workUnitState.contains(ConfigurationKeys.SOURCE_CONN_USE_PROXY_URL)
&& !super.workUnitState.getProp(ConfigurationKeys.SOURCE_CONN_USE_PROXY_URL).isEmpty()) {
partnerConfig.setProxy(super.workUnitState.getProp(ConfigurationKeys.SOURCE_CONN_USE_PROXY_URL),
super.workUnitState.getPropAsInt(ConfigurationKeys.SOURCE_CONN_USE_PROXY_PORT));
}
String accessToken = sfConnector.getAccessToken();
if (accessToken == null) {
boolean isConnectSuccess = sfConnector.connect();
if (isConnectSuccess) {
accessToken = sfConnector.getAccessToken();
}
}
if (accessToken != null) {
String serviceEndpoint = sfConnector.getInstanceUrl() + SALESFORCE_SOAP_SERVICE + "/" + apiVersion;
partnerConfig.setSessionId(accessToken);
partnerConfig.setServiceEndpoint(serviceEndpoint);
} else {
String securityToken = this.workUnitState.getProp(ConfigurationKeys.SOURCE_CONN_SECURITY_TOKEN);
String password = PasswordManager.getInstance(this.workUnitState)
.readPassword(this.workUnitState.getProp(ConfigurationKeys.SOURCE_CONN_PASSWORD));
partnerConfig.setUsername(this.workUnitState.getProp(ConfigurationKeys.SOURCE_CONN_USERNAME));
partnerConfig.setPassword(password + securityToken);
}
partnerConfig.setAuthEndpoint(soapAuthEndPoint);
new PartnerConnection(partnerConfig);
String soapEndpoint = partnerConfig.getServiceEndpoint();
String restEndpoint = soapEndpoint.substring(0, soapEndpoint.indexOf("Soap/")) + "async/" + apiVersion;
ConnectorConfig config = new ConnectorConfig();
config.setSessionId(partnerConfig.getSessionId());
config.setRestEndpoint(restEndpoint);
config.setCompression(true);
config.setTraceFile("traceLogs.txt");
config.setTraceMessage(false);
config.setPrettyPrintXml(true);
if (super.workUnitState.contains(ConfigurationKeys.SOURCE_CONN_USE_PROXY_URL)
&& !super.workUnitState.getProp(ConfigurationKeys.SOURCE_CONN_USE_PROXY_URL).isEmpty()) {
config.setProxy(super.workUnitState.getProp(ConfigurationKeys.SOURCE_CONN_USE_PROXY_URL),
super.workUnitState.getPropAsInt(ConfigurationKeys.SOURCE_CONN_USE_PROXY_PORT));
}
this.bulkConnection = new BulkConnection(config);
success = true;
} catch (RuntimeException e) {
throw new RuntimeException("Failed to connect to salesforce bulk api; error - " + e, e);
}
return success;
}
|
boolean function() throws Exception { log.info(STR); boolean success = false; String hostName = this.workUnitState.getProp(ConfigurationKeys.SOURCE_CONN_HOST_NAME); String apiVersion = this.workUnitState.getProp(ConfigurationKeys.SOURCE_CONN_VERSION); if (Strings.isNullOrEmpty(apiVersion)) { apiVersion = "29.0"; } String soapAuthEndPoint = hostName + SALESFORCE_SOAP_SERVICE + "/" + apiVersion; try { ConnectorConfig partnerConfig = new ConnectorConfig(); if (super.workUnitState.contains(ConfigurationKeys.SOURCE_CONN_USE_PROXY_URL) && !super.workUnitState.getProp(ConfigurationKeys.SOURCE_CONN_USE_PROXY_URL).isEmpty()) { partnerConfig.setProxy(super.workUnitState.getProp(ConfigurationKeys.SOURCE_CONN_USE_PROXY_URL), super.workUnitState.getPropAsInt(ConfigurationKeys.SOURCE_CONN_USE_PROXY_PORT)); } String accessToken = sfConnector.getAccessToken(); if (accessToken == null) { boolean isConnectSuccess = sfConnector.connect(); if (isConnectSuccess) { accessToken = sfConnector.getAccessToken(); } } if (accessToken != null) { String serviceEndpoint = sfConnector.getInstanceUrl() + SALESFORCE_SOAP_SERVICE + "/" + apiVersion; partnerConfig.setSessionId(accessToken); partnerConfig.setServiceEndpoint(serviceEndpoint); } else { String securityToken = this.workUnitState.getProp(ConfigurationKeys.SOURCE_CONN_SECURITY_TOKEN); String password = PasswordManager.getInstance(this.workUnitState) .readPassword(this.workUnitState.getProp(ConfigurationKeys.SOURCE_CONN_PASSWORD)); partnerConfig.setUsername(this.workUnitState.getProp(ConfigurationKeys.SOURCE_CONN_USERNAME)); partnerConfig.setPassword(password + securityToken); } partnerConfig.setAuthEndpoint(soapAuthEndPoint); new PartnerConnection(partnerConfig); String soapEndpoint = partnerConfig.getServiceEndpoint(); String restEndpoint = soapEndpoint.substring(0, soapEndpoint.indexOf("Soap/")) + STR + apiVersion; ConnectorConfig config = new ConnectorConfig(); config.setSessionId(partnerConfig.getSessionId()); config.setRestEndpoint(restEndpoint); config.setCompression(true); config.setTraceFile(STR); config.setTraceMessage(false); config.setPrettyPrintXml(true); if (super.workUnitState.contains(ConfigurationKeys.SOURCE_CONN_USE_PROXY_URL) && !super.workUnitState.getProp(ConfigurationKeys.SOURCE_CONN_USE_PROXY_URL).isEmpty()) { config.setProxy(super.workUnitState.getProp(ConfigurationKeys.SOURCE_CONN_USE_PROXY_URL), super.workUnitState.getPropAsInt(ConfigurationKeys.SOURCE_CONN_USE_PROXY_PORT)); } this.bulkConnection = new BulkConnection(config); success = true; } catch (RuntimeException e) { throw new RuntimeException(STR + e, e); } return success; }
|
/**
* Login to salesforce
* @return login status
*/
|
Login to salesforce
|
bulkApiLogin
|
{
"repo_name": "aditya1105/gobblin",
"path": "gobblin-salesforce/src/main/java/org/apache/gobblin/salesforce/SalesforceExtractor.java",
"license": "apache-2.0",
"size": 41935
}
|
[
"com.google.common.base.Strings",
"com.sforce.async.BulkConnection",
"com.sforce.soap.partner.PartnerConnection",
"com.sforce.ws.ConnectorConfig",
"org.apache.gobblin.configuration.ConfigurationKeys",
"org.apache.gobblin.password.PasswordManager"
] |
import com.google.common.base.Strings; import com.sforce.async.BulkConnection; import com.sforce.soap.partner.PartnerConnection; import com.sforce.ws.ConnectorConfig; import org.apache.gobblin.configuration.ConfigurationKeys; import org.apache.gobblin.password.PasswordManager;
|
import com.google.common.base.*; import com.sforce.async.*; import com.sforce.soap.partner.*; import com.sforce.ws.*; import org.apache.gobblin.configuration.*; import org.apache.gobblin.password.*;
|
[
"com.google.common",
"com.sforce.async",
"com.sforce.soap",
"com.sforce.ws",
"org.apache.gobblin"
] |
com.google.common; com.sforce.async; com.sforce.soap; com.sforce.ws; org.apache.gobblin;
| 2,617,325 |
public void resetTxMetrics() {
txMetrics = new TransactionMetricsAdapter();
}
|
void function() { txMetrics = new TransactionMetricsAdapter(); }
|
/**
* Resets tx metrics.
*/
|
Resets tx metrics
|
resetTxMetrics
|
{
"repo_name": "tkpanther/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedContext.java",
"license": "apache-2.0",
"size": 22810
}
|
[
"org.apache.ignite.internal.processors.cache.transactions.TransactionMetricsAdapter"
] |
import org.apache.ignite.internal.processors.cache.transactions.TransactionMetricsAdapter;
|
import org.apache.ignite.internal.processors.cache.transactions.*;
|
[
"org.apache.ignite"
] |
org.apache.ignite;
| 1,342,800 |
public static List<Place> createFromXml(AbstractController controller, String xmlPath) {
List<Place> places = new ArrayList<Place>();
try {
File xmlFile = new File(xmlPath);
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
Document doc = dBuilder.parse(xmlFile);
NodeList nodeList = doc.getElementsByTagName("locality");
for(int i = 0; i < nodeList.getLength(); i++) {
Node node = nodeList.item(i);
if(node.getNodeType() == Node.ELEMENT_NODE) {
Element placeElement = (Element) node;
Element locationElement = (Element) placeElement.getElementsByTagName("location").item(0);
String name = placeElement.getAttribute("name");
String altitude = locationElement.getAttribute("altitude");
String latitude = locationElement.getAttribute("latitude");
String longitude = locationElement.getAttribute("longitude");
Place newPlace = new Place(controller, name, altitude, latitude, longitude);
places.add(newPlace);
}
}
} catch (Exception e) {
e.printStackTrace();
}
return places;
}
|
static List<Place> function(AbstractController controller, String xmlPath) { List<Place> places = new ArrayList<Place>(); try { File xmlFile = new File(xmlPath); DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); Document doc = dBuilder.parse(xmlFile); NodeList nodeList = doc.getElementsByTagName(STR); for(int i = 0; i < nodeList.getLength(); i++) { Node node = nodeList.item(i); if(node.getNodeType() == Node.ELEMENT_NODE) { Element placeElement = (Element) node; Element locationElement = (Element) placeElement.getElementsByTagName(STR).item(0); String name = placeElement.getAttribute("name"); String altitude = locationElement.getAttribute(STR); String latitude = locationElement.getAttribute(STR); String longitude = locationElement.getAttribute(STR); Place newPlace = new Place(controller, name, altitude, latitude, longitude); places.add(newPlace); } } } catch (Exception e) { e.printStackTrace(); } return places; }
|
/**
* Class method to batch create Places from an xml file.
*
* @param controller Controller that the created models should be bound to.
* @param xmlPath Path to xml file containing the places
* @return List of places.
*/
|
Class method to batch create Places from an xml file
|
createFromXml
|
{
"repo_name": "samuel02/WeatherApp",
"path": "src/app/models/Place.java",
"license": "mit",
"size": 3612
}
|
[
"app.controllers.AbstractController",
"java.io.File",
"java.util.ArrayList",
"java.util.List",
"javax.xml.parsers.DocumentBuilder",
"javax.xml.parsers.DocumentBuilderFactory",
"org.w3c.dom.Document",
"org.w3c.dom.Element",
"org.w3c.dom.Node",
"org.w3c.dom.NodeList"
] |
import app.controllers.AbstractController; import java.io.File; import java.util.ArrayList; import java.util.List; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList;
|
import app.controllers.*; import java.io.*; import java.util.*; import javax.xml.parsers.*; import org.w3c.dom.*;
|
[
"app.controllers",
"java.io",
"java.util",
"javax.xml",
"org.w3c.dom"
] |
app.controllers; java.io; java.util; javax.xml; org.w3c.dom;
| 263,694 |
private void assertEmpty(Map map) {
assertEquals(Collections.emptyMap(), map);
}
|
void function(Map map) { assertEquals(Collections.emptyMap(), map); }
|
/**
* Validate passed map is empty.
*
* @param map Map to validate it is empty.
*/
|
Validate passed map is empty
|
assertEmpty
|
{
"repo_name": "dlnufox/ignite",
"path": "modules/core/src/test/java/org/apache/ignite/internal/processors/igfs/IgfsMetaManagerSelfTest.java",
"license": "apache-2.0",
"size": 20158
}
|
[
"java.util.Collections",
"java.util.Map"
] |
import java.util.Collections; import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,915,827 |
@Override
public ClusterLock rename(String name) {
return new ClusterLock(DSL.name(name), null);
}
|
ClusterLock function(String name) { return new ClusterLock(DSL.name(name), null); }
|
/**
* Rename this table
*/
|
Rename this table
|
rename
|
{
"repo_name": "gchq/stroom",
"path": "stroom-cluster/stroom-cluster-lock-impl-db-jooq/src/main/java/stroom/cluster/lock/impl/db/jooq/tables/ClusterLock.java",
"license": "apache-2.0",
"size": 4675
}
|
[
"org.jooq.impl.DSL"
] |
import org.jooq.impl.DSL;
|
import org.jooq.impl.*;
|
[
"org.jooq.impl"
] |
org.jooq.impl;
| 307,342 |
public void testEquals() {
JFreeChart chart1 = new JFreeChart("Title",
new Font("SansSerif", Font.PLAIN, 12), new PiePlot(), true);
JFreeChart chart2 = new JFreeChart("Title",
new Font("SansSerif", Font.PLAIN, 12), new PiePlot(), true);
assertTrue(chart1.equals(chart2));
assertTrue(chart2.equals(chart1));
// renderingHints
chart1.setRenderingHints(new RenderingHints(
RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_ON));
assertFalse(chart1.equals(chart2));
chart2.setRenderingHints(new RenderingHints(
RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_ON));
assertTrue(chart1.equals(chart2));
// borderVisible
chart1.setBorderVisible(true);
assertFalse(chart1.equals(chart2));
chart2.setBorderVisible(true);
assertTrue(chart1.equals(chart2));
// borderStroke
BasicStroke s = new BasicStroke(2.0f);
chart1.setBorderStroke(s);
assertFalse(chart1.equals(chart2));
chart2.setBorderStroke(s);
assertTrue(chart1.equals(chart2));
// borderPaint
chart1.setBorderPaint(Color.red);
assertFalse(chart1.equals(chart2));
chart2.setBorderPaint(Color.red);
assertTrue(chart1.equals(chart2));
// padding
chart1.setPadding(new RectangleInsets(1, 2, 3, 4));
assertFalse(chart1.equals(chart2));
chart2.setPadding(new RectangleInsets(1, 2, 3, 4));
assertTrue(chart1.equals(chart2));
// title
chart1.setTitle("XYZ");
assertFalse(chart1.equals(chart2));
chart2.setTitle("XYZ");
assertTrue(chart1.equals(chart2));
// subtitles
chart1.addSubtitle(new TextTitle("Subtitle"));
assertFalse(chart1.equals(chart2));
chart2.addSubtitle(new TextTitle("Subtitle"));
assertTrue(chart1.equals(chart2));
// plot
chart1 = new JFreeChart("Title",
new Font("SansSerif", Font.PLAIN, 12), new RingPlot(), false);
chart2 = new JFreeChart("Title",
new Font("SansSerif", Font.PLAIN, 12), new PiePlot(), false);
assertFalse(chart1.equals(chart2));
chart2 = new JFreeChart("Title",
new Font("SansSerif", Font.PLAIN, 12), new RingPlot(), false);
assertTrue(chart1.equals(chart2));
// backgroundPaint
chart1.setBackgroundPaint(new GradientPaint(1.0f, 2.0f, Color.red,
3.0f, 4.0f, Color.blue));
assertFalse(chart1.equals(chart2));
chart2.setBackgroundPaint(new GradientPaint(1.0f, 2.0f, Color.red,
3.0f, 4.0f, Color.blue));
assertTrue(chart1.equals(chart2));
// backgroundImage
chart1.setBackgroundImage(JFreeChart.INFO.getLogo());
assertFalse(chart1.equals(chart2));
chart2.setBackgroundImage(JFreeChart.INFO.getLogo());
assertTrue(chart1.equals(chart2));
// backgroundImageAlignment
chart1.setBackgroundImageAlignment(Align.BOTTOM_LEFT);
assertFalse(chart1.equals(chart2));
chart2.setBackgroundImageAlignment(Align.BOTTOM_LEFT);
assertTrue(chart1.equals(chart2));
// backgroundImageAlpha
chart1.setBackgroundImageAlpha(0.1f);
assertFalse(chart1.equals(chart2));
chart2.setBackgroundImageAlpha(0.1f);
assertTrue(chart1.equals(chart2));
}
|
void function() { JFreeChart chart1 = new JFreeChart("Title", new Font(STR, Font.PLAIN, 12), new PiePlot(), true); JFreeChart chart2 = new JFreeChart("Title", new Font(STR, Font.PLAIN, 12), new PiePlot(), true); assertTrue(chart1.equals(chart2)); assertTrue(chart2.equals(chart1)); chart1.setRenderingHints(new RenderingHints( RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON)); assertFalse(chart1.equals(chart2)); chart2.setRenderingHints(new RenderingHints( RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON)); assertTrue(chart1.equals(chart2)); chart1.setBorderVisible(true); assertFalse(chart1.equals(chart2)); chart2.setBorderVisible(true); assertTrue(chart1.equals(chart2)); BasicStroke s = new BasicStroke(2.0f); chart1.setBorderStroke(s); assertFalse(chart1.equals(chart2)); chart2.setBorderStroke(s); assertTrue(chart1.equals(chart2)); chart1.setBorderPaint(Color.red); assertFalse(chart1.equals(chart2)); chart2.setBorderPaint(Color.red); assertTrue(chart1.equals(chart2)); chart1.setPadding(new RectangleInsets(1, 2, 3, 4)); assertFalse(chart1.equals(chart2)); chart2.setPadding(new RectangleInsets(1, 2, 3, 4)); assertTrue(chart1.equals(chart2)); chart1.setTitle("XYZ"); assertFalse(chart1.equals(chart2)); chart2.setTitle("XYZ"); assertTrue(chart1.equals(chart2)); chart1.addSubtitle(new TextTitle(STR)); assertFalse(chart1.equals(chart2)); chart2.addSubtitle(new TextTitle(STR)); assertTrue(chart1.equals(chart2)); chart1 = new JFreeChart("Title", new Font(STR, Font.PLAIN, 12), new RingPlot(), false); chart2 = new JFreeChart("Title", new Font(STR, Font.PLAIN, 12), new PiePlot(), false); assertFalse(chart1.equals(chart2)); chart2 = new JFreeChart("Title", new Font(STR, Font.PLAIN, 12), new RingPlot(), false); assertTrue(chart1.equals(chart2)); chart1.setBackgroundPaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f, Color.blue)); assertFalse(chart1.equals(chart2)); chart2.setBackgroundPaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f, Color.blue)); assertTrue(chart1.equals(chart2)); chart1.setBackgroundImage(JFreeChart.INFO.getLogo()); assertFalse(chart1.equals(chart2)); chart2.setBackgroundImage(JFreeChart.INFO.getLogo()); assertTrue(chart1.equals(chart2)); chart1.setBackgroundImageAlignment(Align.BOTTOM_LEFT); assertFalse(chart1.equals(chart2)); chart2.setBackgroundImageAlignment(Align.BOTTOM_LEFT); assertTrue(chart1.equals(chart2)); chart1.setBackgroundImageAlpha(0.1f); assertFalse(chart1.equals(chart2)); chart2.setBackgroundImageAlpha(0.1f); assertTrue(chart1.equals(chart2)); }
|
/**
* Check that the equals() method can distinguish all fields.
*/
|
Check that the equals() method can distinguish all fields
|
testEquals
|
{
"repo_name": "martingwhite/astor",
"path": "examples/chart_11/tests/org/jfree/chart/junit/JFreeChartTests.java",
"license": "gpl-2.0",
"size": 19774
}
|
[
"java.awt.BasicStroke",
"java.awt.Color",
"java.awt.Font",
"java.awt.GradientPaint",
"java.awt.RenderingHints",
"org.jfree.chart.JFreeChart",
"org.jfree.chart.plot.PiePlot",
"org.jfree.chart.plot.RingPlot",
"org.jfree.chart.title.TextTitle",
"org.jfree.chart.title.Title",
"org.jfree.chart.util.Align",
"org.jfree.chart.util.RectangleInsets"
] |
import java.awt.BasicStroke; import java.awt.Color; import java.awt.Font; import java.awt.GradientPaint; import java.awt.RenderingHints; import org.jfree.chart.JFreeChart; import org.jfree.chart.plot.PiePlot; import org.jfree.chart.plot.RingPlot; import org.jfree.chart.title.TextTitle; import org.jfree.chart.title.Title; import org.jfree.chart.util.Align; import org.jfree.chart.util.RectangleInsets;
|
import java.awt.*; import org.jfree.chart.*; import org.jfree.chart.plot.*; import org.jfree.chart.title.*; import org.jfree.chart.util.*;
|
[
"java.awt",
"org.jfree.chart"
] |
java.awt; org.jfree.chart;
| 1,092,514 |
@JsonIgnore
private PatternsList getPatternsList(PatternsList list) {
return list == null ? new PatternsList(Collections.emptyList()) : list;
}
}
@ToString
public static class IgnoredPathPatterns {
@Setter
private IgnoredPatterns promotion;
@Setter
private IgnoredPatterns data;
|
PatternsList function(PatternsList list) { return list == null ? new PatternsList(Collections.emptyList()) : list; } } public static class IgnoredPathPatterns { private IgnoredPatterns promotion; private IgnoredPatterns data;
|
/**
* Safely gets patterns list. Ensures that output is never null.
*
* @param list the input list
* @return an empty list in case of input list is null, otherwise the input list
*/
|
Safely gets patterns list. Ensures that output is never null
|
getPatternsList
|
{
"repo_name": "alexcreasy/pnc",
"path": "moduleconfig/src/main/java/org/jboss/pnc/common/json/moduleconfig/IndyRepoDriverModuleConfig.java",
"license": "apache-2.0",
"size": 6686
}
|
[
"java.util.Collections"
] |
import java.util.Collections;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,811,014 |
String toDateTimeString(Date date);
|
String toDateTimeString(Date date);
|
/**
* Translates the specified date into a string with a time component, formatted according to the "stringDateTimeFormat" that the
* service is configured with
*
* @param date
* @return formatted string version of the specified date
*/
|
Translates the specified date into a string with a time component, formatted according to the "stringDateTimeFormat" that the service is configured with
|
toDateTimeString
|
{
"repo_name": "ua-eas/ua-rice-2.1.9",
"path": "core/api/src/main/java/org/kuali/rice/core/api/datetime/DateTimeService.java",
"license": "apache-2.0",
"size": 5684
}
|
[
"java.util.Date"
] |
import java.util.Date;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 334,742 |
public static DictItem toModel(DictItemSoap soapModel) {
if (soapModel == null) {
return null;
}
DictItem model = new DictItemImpl();
model.setDictItemId(soapModel.getDictItemId());
model.setCompanyId(soapModel.getCompanyId());
model.setGroupId(soapModel.getGroupId());
model.setUserId(soapModel.getUserId());
model.setCreateDate(soapModel.getCreateDate());
model.setModifiedDate(soapModel.getModifiedDate());
model.setDictCollectionId(soapModel.getDictCollectionId());
model.setItemCode(soapModel.getItemCode());
model.setItemName(soapModel.getItemName());
model.setItemDescription(soapModel.getItemDescription());
model.setParentItemId(soapModel.getParentItemId());
model.setTreeIndex(soapModel.getTreeIndex());
model.setIssueStatus(soapModel.getIssueStatus());
model.setDictVersionId(soapModel.getDictVersionId());
return model;
}
|
static DictItem function(DictItemSoap soapModel) { if (soapModel == null) { return null; } DictItem model = new DictItemImpl(); model.setDictItemId(soapModel.getDictItemId()); model.setCompanyId(soapModel.getCompanyId()); model.setGroupId(soapModel.getGroupId()); model.setUserId(soapModel.getUserId()); model.setCreateDate(soapModel.getCreateDate()); model.setModifiedDate(soapModel.getModifiedDate()); model.setDictCollectionId(soapModel.getDictCollectionId()); model.setItemCode(soapModel.getItemCode()); model.setItemName(soapModel.getItemName()); model.setItemDescription(soapModel.getItemDescription()); model.setParentItemId(soapModel.getParentItemId()); model.setTreeIndex(soapModel.getTreeIndex()); model.setIssueStatus(soapModel.getIssueStatus()); model.setDictVersionId(soapModel.getDictVersionId()); return model; }
|
/**
* Converts the soap model instance into a normal model instance.
*
* @param soapModel the soap model instance to convert
* @return the normal model instance
*/
|
Converts the soap model instance into a normal model instance
|
toModel
|
{
"repo_name": "hltn/opencps",
"path": "portlets/opencps-portlet/docroot/WEB-INF/src/org/opencps/datamgt/model/impl/DictItemModelImpl.java",
"license": "agpl-3.0",
"size": 30428
}
|
[
"org.opencps.datamgt.model.DictItem",
"org.opencps.datamgt.model.DictItemSoap"
] |
import org.opencps.datamgt.model.DictItem; import org.opencps.datamgt.model.DictItemSoap;
|
import org.opencps.datamgt.model.*;
|
[
"org.opencps.datamgt"
] |
org.opencps.datamgt;
| 1,130,196 |
@SmallTest
@Feature({"ContextualSearch"})
@Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE})
public void testPromoOpenCountForDecided() throws InterruptedException, TimeoutException {
mPolicy.overrideDecidedStateForTesting(true);
// An open should not count for decided users.
clickToExpandAndClosePanel();
assertEquals(0, mPolicy.getPromoOpenCount());
}
|
@Feature({STR}) @Restriction({RESTRICTION_TYPE_PHONE, RESTRICTION_TYPE_NON_LOW_END_DEVICE}) void function() throws InterruptedException, TimeoutException { mPolicy.overrideDecidedStateForTesting(true); clickToExpandAndClosePanel(); assertEquals(0, mPolicy.getPromoOpenCount()); }
|
/**
* Tests the promo open counter.
*/
|
Tests the promo open counter
|
testPromoOpenCountForDecided
|
{
"repo_name": "Just-D/chromium-1",
"path": "chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java",
"license": "bsd-3-clause",
"size": 70757
}
|
[
"java.util.concurrent.TimeoutException",
"org.chromium.base.test.util.Feature",
"org.chromium.base.test.util.Restriction"
] |
import java.util.concurrent.TimeoutException; import org.chromium.base.test.util.Feature; import org.chromium.base.test.util.Restriction;
|
import java.util.concurrent.*; import org.chromium.base.test.util.*;
|
[
"java.util",
"org.chromium.base"
] |
java.util; org.chromium.base;
| 2,739,046 |
public static Resource[] selectOutOfDateSources(ProjectComponent logTo,
Resource[] source,
FileNameMapper mapper,
ResourceFactory targets) {
return selectOutOfDateSources(logTo, source, mapper, targets,
FILE_UTILS.getFileTimestampGranularity());
}
|
static Resource[] function(ProjectComponent logTo, Resource[] source, FileNameMapper mapper, ResourceFactory targets) { return selectOutOfDateSources(logTo, source, mapper, targets, FILE_UTILS.getFileTimestampGranularity()); }
|
/**
* Tells which source files should be reprocessed based on the
* last modification date of target files.
* @param logTo where to send (more or less) interesting output.
* @param source array of resources bearing relative path and last
* modification date.
* @param mapper filename mapper indicating how to find the target
* files.
* @param targets object able to map as a resource a relative path
* at <b>destination</b>.
* @return array containing the source files which need to be
* copied or processed, because the targets are out of date or do
* not exist.
*/
|
Tells which source files should be reprocessed based on the last modification date of target files
|
selectOutOfDateSources
|
{
"repo_name": "Mayo-WE01051879/mayosapp",
"path": "Build/src/main/org/apache/tools/ant/util/ResourceUtils.java",
"license": "mit",
"size": 33762
}
|
[
"org.apache.tools.ant.ProjectComponent",
"org.apache.tools.ant.types.Resource",
"org.apache.tools.ant.types.ResourceFactory"
] |
import org.apache.tools.ant.ProjectComponent; import org.apache.tools.ant.types.Resource; import org.apache.tools.ant.types.ResourceFactory;
|
import org.apache.tools.ant.*; import org.apache.tools.ant.types.*;
|
[
"org.apache.tools"
] |
org.apache.tools;
| 1,891,862 |
public HttpHead createHeadMethod(final String path) {
return new HttpHead(repositoryURL + path);
}
|
HttpHead function(final String path) { return new HttpHead(repositoryURL + path); }
|
/**
* Create HEAD method
* @param path Resource path, relative to repository baseURL
* @return HEAD method
**/
|
Create HEAD method
|
createHeadMethod
|
{
"repo_name": "fcrepo4-labs/fcrepo4-client",
"path": "fcrepo-client-impl/src/main/java/org/fcrepo/client/utils/HttpHelper.java",
"license": "apache-2.0",
"size": 17056
}
|
[
"org.apache.http.client.methods.HttpHead"
] |
import org.apache.http.client.methods.HttpHead;
|
import org.apache.http.client.methods.*;
|
[
"org.apache.http"
] |
org.apache.http;
| 1,253,099 |
public void disable() throws TimeoutException, NotConnectedException {
byte options = 0;
boolean isResponseExpected = getResponseExpected(FUNCTION_DISABLE);
if(isResponseExpected) {
options = 8;
}
ByteBuffer bb = ipcon.createRequestBuffer(uid, (byte)8, FUNCTION_DISABLE, options, (byte)(0));
if(isResponseExpected) {
byte[] response = sendRequestExpectResponse(bb.array(), FUNCTION_DISABLE);
bb = ByteBuffer.wrap(response, 8, response.length - 8);
bb.order(ByteOrder.LITTLE_ENDIAN);
} else {
sendRequestNoResponse(bb.array());
}
}
|
void function() throws TimeoutException, NotConnectedException { byte options = 0; boolean isResponseExpected = getResponseExpected(FUNCTION_DISABLE); if(isResponseExpected) { options = 8; } ByteBuffer bb = ipcon.createRequestBuffer(uid, (byte)8, FUNCTION_DISABLE, options, (byte)(0)); if(isResponseExpected) { byte[] response = sendRequestExpectResponse(bb.array(), FUNCTION_DISABLE); bb = ByteBuffer.wrap(response, 8, response.length - 8); bb.order(ByteOrder.LITTLE_ENDIAN); } else { sendRequestNoResponse(bb.array()); } }
|
/**
* Disables the driver chip. The configurations are kept (velocity,
* acceleration, etc) but the motor is not driven until it is enabled again.
*/
|
Disables the driver chip. The configurations are kept (velocity, acceleration, etc) but the motor is not driven until it is enabled again
|
disable
|
{
"repo_name": "ezeeb/pipes-tinkerforge",
"path": "src/main/java/com/tinkerforge/BrickDC.java",
"license": "apache-2.0",
"size": 34074
}
|
[
"java.nio.ByteBuffer",
"java.nio.ByteOrder"
] |
import java.nio.ByteBuffer; import java.nio.ByteOrder;
|
import java.nio.*;
|
[
"java.nio"
] |
java.nio;
| 26,408 |
@Test
public void testSetMessageListener() {
final BasicMongoClientMetrics metrics = new BasicMongoClientMetrics();
metrics.setMessageListener(null);
metrics.setMessageListener(createMock(MongoMessageListener.class));
metrics.setMessageListener(NoOpMongoMessageListener.NO_OP);
metrics.close();
}
|
void function() { final BasicMongoClientMetrics metrics = new BasicMongoClientMetrics(); metrics.setMessageListener(null); metrics.setMessageListener(createMock(MongoMessageListener.class)); metrics.setMessageListener(NoOpMongoMessageListener.NO_OP); metrics.close(); }
|
/**
* Test method for
* {@link BasicMongoClientMetrics#setMessageListener(MongoMessageListener)}.
*/
|
Test method for <code>BasicMongoClientMetrics#setMessageListener(MongoMessageListener)</code>
|
testSetMessageListener
|
{
"repo_name": "allanbank/mongodb-async-driver",
"path": "src/test/java/com/allanbank/mongodb/client/metrics/basic/BasicMongoClientMetricsTest.java",
"license": "apache-2.0",
"size": 6349
}
|
[
"com.allanbank.mongodb.client.metrics.MongoMessageListener",
"com.allanbank.mongodb.client.metrics.NoOpMongoMessageListener"
] |
import com.allanbank.mongodb.client.metrics.MongoMessageListener; import com.allanbank.mongodb.client.metrics.NoOpMongoMessageListener;
|
import com.allanbank.mongodb.client.metrics.*;
|
[
"com.allanbank.mongodb"
] |
com.allanbank.mongodb;
| 2,519,587 |
public Configuration fromSystem() {
MapConfiguration mapConfig =
setupConfiguration(new MapConfiguration((Properties) System.getProperties().clone()));
// Disables trimming so system properties that include whitespace (such as line.separator) will
// be preserved.
mapConfig.setTrimmingDisabled(true);
return mapConfig;
}
|
Configuration function() { MapConfiguration mapConfig = setupConfiguration(new MapConfiguration((Properties) System.getProperties().clone())); mapConfig.setTrimmingDisabled(true); return mapConfig; }
|
/**
* Loads configuration from system defined arguments, i.e. -Dapi.x.y.z=abc.
*/
|
Loads configuration from system defined arguments, i.e. -Dapi.x.y.z=abc
|
fromSystem
|
{
"repo_name": "googleads/googleads-java-lib",
"path": "modules/ads_lib/src/main/java/com/google/api/ads/common/lib/conf/ConfigurationHelper.java",
"license": "apache-2.0",
"size": 11503
}
|
[
"java.util.Properties",
"org.apache.commons.configuration.Configuration",
"org.apache.commons.configuration.MapConfiguration"
] |
import java.util.Properties; import org.apache.commons.configuration.Configuration; import org.apache.commons.configuration.MapConfiguration;
|
import java.util.*; import org.apache.commons.configuration.*;
|
[
"java.util",
"org.apache.commons"
] |
java.util; org.apache.commons;
| 564,411 |
public Collection<File> findFiles(Collection<File> someSearchFolders, XPathQuery... someQueries) {
ThreadExecutionStatus status = new ThreadExecutionStatus();
for (File folder : someSearchFolders) {
XPathEvaluatorThread thread = new XPathEvaluatorThread(status, folder, someQueries);
thread.addListener(this);
synchronized (this) {
activeScans++;
}
getThreadPool().addThread(thread);
}
while (activeScans > 0) {
ThreadHelper.sleep(SLEEP_TIME);
}
Collection<File> unmodifuableResults;
synchronized (this) {
unmodifuableResults = Collections.unmodifiableCollection(results);
}
return unmodifuableResults;
}
|
Collection<File> function(Collection<File> someSearchFolders, XPathQuery... someQueries) { ThreadExecutionStatus status = new ThreadExecutionStatus(); for (File folder : someSearchFolders) { XPathEvaluatorThread thread = new XPathEvaluatorThread(status, folder, someQueries); thread.addListener(this); synchronized (this) { activeScans++; } getThreadPool().addThread(thread); } while (activeScans > 0) { ThreadHelper.sleep(SLEEP_TIME); } Collection<File> unmodifuableResults; synchronized (this) { unmodifuableResults = Collections.unmodifiableCollection(results); } return unmodifuableResults; }
|
/**
* The method returns all files which meet the specified criteria.
*
* @param someSearchFolders
* the folders which are to be searched
* @param someQueries
* the queries which will be performed on each file
*
* @return a list of files which meet the specified criteria
*/
|
The method returns all files which meet the specified criteria
|
findFiles
|
{
"repo_name": "gammalgris/jmul",
"path": "Utilities/Persistence/src/jmul/persistence/file/FileLookup.java",
"license": "gpl-3.0",
"size": 10628
}
|
[
"java.io.File",
"java.util.Collection",
"java.util.Collections"
] |
import java.io.File; import java.util.Collection; import java.util.Collections;
|
import java.io.*; import java.util.*;
|
[
"java.io",
"java.util"
] |
java.io; java.util;
| 1,063,379 |
collectAccessTokenOptions();
if(user == null) {
user = usersApi.getUser(getRequestedUserId());
}
if(requestParameters.hasParameter(VcmsGuiPathParams.ACTIVE_TAB_ID)) {
activeTabId = requestParameters.getParameter(VcmsGuiPathParams.ACTIVE_TAB_ID);
}
}
|
collectAccessTokenOptions(); if(user == null) { user = usersApi.getUser(getRequestedUserId()); } if(requestParameters.hasParameter(VcmsGuiPathParams.ACTIVE_TAB_ID)) { activeTabId = requestParameters.getParameter(VcmsGuiPathParams.ACTIVE_TAB_ID); } }
|
/**
* Initializes bean by downloading user details from the users api.
*
* Parameter {@link VcmsGuiPaths#USER_ID} is required, which indicates requested user id.
* Note that if {@link #ACTIVE_TAB} parameter is provided during bean initialization,
* it will automatically switch to tab identified by given id.
*/
|
Initializes bean by downloading user details from the users api. Parameter <code>VcmsGuiPaths#USER_ID</code> is required, which indicates requested user id. Note that if <code>#ACTIVE_TAB</code> parameter is provided during bean initialization, it will automatically switch to tab identified by given id
|
loadUser
|
{
"repo_name": "ow2-xlcloud/vcms",
"path": "vcms-gui/modules/users/src/main/java/org/xlcloud/console/users/controllers/UserDetailsBean.java",
"license": "apache-2.0",
"size": 12471
}
|
[
"org.xlcloud.console.controllers.request.path.VcmsGuiPathParams"
] |
import org.xlcloud.console.controllers.request.path.VcmsGuiPathParams;
|
import org.xlcloud.console.controllers.request.path.*;
|
[
"org.xlcloud.console"
] |
org.xlcloud.console;
| 592,695 |
@RequestMapping("/toggleFavoriteOrganisation")
public String toggleFavoriteOrganisation(HttpServletRequest request) throws IOException, ServletException {
Integer orgId = WebUtil.readIntParam(request, "orgId", false);
Integer userId = getUserId();
if (orgId != null) {
userManagementService.toggleOrganisationFavorite(orgId, userId);
}
List<Organisation> favoriteOrganisations = userManagementService.getFavoriteOrganisationsByUser(userId);
request.setAttribute("favoriteOrganisations", favoriteOrganisations);
String activeOrgId = request.getParameter("activeOrgId");
request.setAttribute("activeOrgId", activeOrgId);
return "favoriteOrganisations";
}
|
@RequestMapping(STR) String function(HttpServletRequest request) throws IOException, ServletException { Integer orgId = WebUtil.readIntParam(request, "orgId", false); Integer userId = getUserId(); if (orgId != null) { userManagementService.toggleOrganisationFavorite(orgId, userId); } List<Organisation> favoriteOrganisations = userManagementService.getFavoriteOrganisationsByUser(userId); request.setAttribute(STR, favoriteOrganisations); String activeOrgId = request.getParameter(STR); request.setAttribute(STR, activeOrgId); return STR; }
|
/**
* Toggles whether organisation is marked as favorite.
*/
|
Toggles whether organisation is marked as favorite
|
toggleFavoriteOrganisation
|
{
"repo_name": "lamsfoundation/lams",
"path": "lams_central/src/java/org/lamsfoundation/lams/web/IndexController.java",
"license": "gpl-2.0",
"size": 12755
}
|
[
"java.io.IOException",
"java.util.List",
"javax.servlet.ServletException",
"javax.servlet.http.HttpServletRequest",
"org.lamsfoundation.lams.usermanagement.Organisation",
"org.lamsfoundation.lams.util.WebUtil",
"org.springframework.web.bind.annotation.RequestMapping"
] |
import java.io.IOException; import java.util.List; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import org.lamsfoundation.lams.usermanagement.Organisation; import org.lamsfoundation.lams.util.WebUtil; import org.springframework.web.bind.annotation.RequestMapping;
|
import java.io.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import org.lamsfoundation.lams.usermanagement.*; import org.lamsfoundation.lams.util.*; import org.springframework.web.bind.annotation.*;
|
[
"java.io",
"java.util",
"javax.servlet",
"org.lamsfoundation.lams",
"org.springframework.web"
] |
java.io; java.util; javax.servlet; org.lamsfoundation.lams; org.springframework.web;
| 2,475,378 |
public RestoreSnapshotRequest indexSettings(Settings.Builder settings) {
this.indexSettings = settings.build();
return this;
}
|
RestoreSnapshotRequest function(Settings.Builder settings) { this.indexSettings = settings.build(); return this; }
|
/**
* Sets settings that should be added/changed in all restored indices
*/
|
Sets settings that should be added/changed in all restored indices
|
indexSettings
|
{
"repo_name": "zuoyebushiwo/elasticsearch-1.5.0",
"path": "src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java",
"license": "apache-2.0",
"size": 24393
}
|
[
"org.elasticsearch.common.settings.Settings"
] |
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.*;
|
[
"org.elasticsearch.common"
] |
org.elasticsearch.common;
| 775,001 |
// -------------------------------------------------------------------------
public BloombergConnector getBloombergConnector() {
return _bloombergConnector;
}
|
BloombergConnector function() { return _bloombergConnector; }
|
/**
* Gets the Bloomberg connector.
*
* @return the connector, not null
*/
|
Gets the Bloomberg connector
|
getBloombergConnector
|
{
"repo_name": "McLeodMoores/starling",
"path": "projects/bloomberg/src/main/java/com/opengamma/bbg/livedata/BloombergLiveDataServer.java",
"license": "apache-2.0",
"size": 13818
}
|
[
"com.opengamma.bbg.BloombergConnector"
] |
import com.opengamma.bbg.BloombergConnector;
|
import com.opengamma.bbg.*;
|
[
"com.opengamma.bbg"
] |
com.opengamma.bbg;
| 428,984 |
private void stopLeading()
{
giant.lock();
try {
if (leading) {
leading = false;
mayBeStopped.signalAll();
final Lifecycle leaderLifecycle = leaderLifecycleRef.getAndSet(null);
if (leaderLifecycle != null) {
leaderLifecycle.stop();
}
}
}
finally {
giant.unlock();
}
}
|
void function() { giant.lock(); try { if (leading) { leading = false; mayBeStopped.signalAll(); final Lifecycle leaderLifecycle = leaderLifecycleRef.getAndSet(null); if (leaderLifecycle != null) { leaderLifecycle.stop(); } } } finally { giant.unlock(); } }
|
/**
* Relinquish leadership. May be called multiple times, even when not currently the leader.
*/
|
Relinquish leadership. May be called multiple times, even when not currently the leader
|
stopLeading
|
{
"repo_name": "skyportsystems/druid",
"path": "indexing-service/src/main/java/io/druid/indexing/overlord/TaskMaster.java",
"license": "apache-2.0",
"size": 9131
}
|
[
"com.metamx.common.lifecycle.Lifecycle"
] |
import com.metamx.common.lifecycle.Lifecycle;
|
import com.metamx.common.lifecycle.*;
|
[
"com.metamx.common"
] |
com.metamx.common;
| 2,709,476 |
public String getExternalAuthServiceName(Connection c) throws
BadServerResponse,
XenAPIException,
XmlRpcException {
String method_call = "host.get_external_auth_service_name";
String session = c.getSessionReference();
Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
Map response = c.dispatch(method_call, method_params);
Object result = response.get("Value");
return Types.toString(result);
}
|
String function(Connection c) throws BadServerResponse, XenAPIException, XmlRpcException { String method_call = STR; String session = c.getSessionReference(); Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)}; Map response = c.dispatch(method_call, method_params); Object result = response.get("Value"); return Types.toString(result); }
|
/**
* Get the external_auth_service_name field of the given host.
*
* @return value of the field
*/
|
Get the external_auth_service_name field of the given host
|
getExternalAuthServiceName
|
{
"repo_name": "cinderella/incubator-cloudstack",
"path": "deps/XenServerJava/com/xensource/xenapi/Host.java",
"license": "apache-2.0",
"size": 105838
}
|
[
"com.xensource.xenapi.Types",
"java.util.Map",
"org.apache.xmlrpc.XmlRpcException"
] |
import com.xensource.xenapi.Types; import java.util.Map; import org.apache.xmlrpc.XmlRpcException;
|
import com.xensource.xenapi.*; import java.util.*; import org.apache.xmlrpc.*;
|
[
"com.xensource.xenapi",
"java.util",
"org.apache.xmlrpc"
] |
com.xensource.xenapi; java.util; org.apache.xmlrpc;
| 625,206 |
public PoolRemoveNodesOptions withIfModifiedSince(DateTime ifModifiedSince) {
if (ifModifiedSince == null) {
this.ifModifiedSince = null;
} else {
this.ifModifiedSince = new DateTimeRfc1123(ifModifiedSince);
}
return this;
}
|
PoolRemoveNodesOptions function(DateTime ifModifiedSince) { if (ifModifiedSince == null) { this.ifModifiedSince = null; } else { this.ifModifiedSince = new DateTimeRfc1123(ifModifiedSince); } return this; }
|
/**
* Set the ifModifiedSince value.
*
* @param ifModifiedSince the ifModifiedSince value to set
* @return the PoolRemoveNodesOptions object itself.
*/
|
Set the ifModifiedSince value
|
withIfModifiedSince
|
{
"repo_name": "pomortaz/azure-sdk-for-java",
"path": "azure-batch/src/main/java/com/microsoft/azure/batch/protocol/models/PoolRemoveNodesOptions.java",
"license": "mit",
"size": 6891
}
|
[
"com.microsoft.rest.DateTimeRfc1123",
"org.joda.time.DateTime"
] |
import com.microsoft.rest.DateTimeRfc1123; import org.joda.time.DateTime;
|
import com.microsoft.rest.*; import org.joda.time.*;
|
[
"com.microsoft.rest",
"org.joda.time"
] |
com.microsoft.rest; org.joda.time;
| 2,333,208 |
public List<org.ng200.openolympus.jooq.tables.pojos.Solution> fetchByMaximumScore(BigDecimal... values) {
return fetch(Solution.SOLUTION.MAXIMUM_SCORE, values);
}
|
List<org.ng200.openolympus.jooq.tables.pojos.Solution> function(BigDecimal... values) { return fetch(Solution.SOLUTION.MAXIMUM_SCORE, values); }
|
/**
* Fetch records that have <code>maximum_score IN (values)</code>
*/
|
Fetch records that have <code>maximum_score IN (values)</code>
|
fetchByMaximumScore
|
{
"repo_name": "nickguletskii/OpenOlympus",
"path": "src-gen/main/java/org/ng200/openolympus/jooq/tables/daos/SolutionDao.java",
"license": "mit",
"size": 4564
}
|
[
"java.math.BigDecimal",
"java.util.List",
"org.ng200.openolympus.jooq.tables.Solution"
] |
import java.math.BigDecimal; import java.util.List; import org.ng200.openolympus.jooq.tables.Solution;
|
import java.math.*; import java.util.*; import org.ng200.openolympus.jooq.tables.*;
|
[
"java.math",
"java.util",
"org.ng200.openolympus"
] |
java.math; java.util; org.ng200.openolympus;
| 1,261,516 |
private void drawAttachedSprites(Graphics2D g2d, int x, int y) {
Collection<AttachedSprite> sprites = attachedSprites;
if (sprites != null) {
for (AttachedSprite sprite : sprites) {
sprite.draw(g2d, x, y);
}
}
}
|
void function(Graphics2D g2d, int x, int y) { Collection<AttachedSprite> sprites = attachedSprites; if (sprites != null) { for (AttachedSprite sprite : sprites) { sprite.draw(g2d, x, y); } } }
|
/**
* Draw all attached sprites.
*
* @param g2d graphics
* @param x x position of the view
* @param y y position of the view
*/
|
Draw all attached sprites
|
drawAttachedSprites
|
{
"repo_name": "AntumDeluge/arianne-stendhal",
"path": "src/games/stendhal/client/gui/j2d/entity/Entity2DView.java",
"license": "gpl-2.0",
"size": 23578
}
|
[
"java.awt.Graphics2D",
"java.util.Collection"
] |
import java.awt.Graphics2D; import java.util.Collection;
|
import java.awt.*; import java.util.*;
|
[
"java.awt",
"java.util"
] |
java.awt; java.util;
| 1,473,886 |
public Iterator getNames() {
return _properties.keySet().iterator();
}
|
Iterator function() { return _properties.keySet().iterator(); }
|
/**
* Gets an iterator that iterates over all the property names. The
* {@link Iterator} will return only {@link String} instances.
*
* @return
* the {@link Iterator} that will iterate over all the names, never
* <code>null</code>.
*/
|
Gets an iterator that iterates over all the property names. The <code>Iterator</code> will return only <code>String</code> instances
|
getNames
|
{
"repo_name": "muloem/xins",
"path": "src/java-common/org/xins/common/collections/StatsPropertyReader.java",
"license": "bsd-3-clause",
"size": 4819
}
|
[
"java.util.Iterator"
] |
import java.util.Iterator;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,067,386 |
private static SpannableString generateBulletedString(Context context, int stringResId) {
SpannableString bullet = new SpannableString(context.getString(stringResId));
bullet.setSpan(new ChromeBulletSpan(context), 0, bullet.length(), 0);
return bullet;
}
|
static SpannableString function(Context context, int stringResId) { SpannableString bullet = new SpannableString(context.getString(stringResId)); bullet.setSpan(new ChromeBulletSpan(context), 0, bullet.length(), 0); return bullet; }
|
/**
* Generates a bulleted {@link SpannableString}.
* @param context The {@link Context} used to retrieve the String.
* @param stringResId The resource id of the String to bullet.
* @return A {@link SpannableString} with a bullet in front of the provided String.
*/
|
Generates a bulleted <code>SpannableString</code>
|
generateBulletedString
|
{
"repo_name": "chromium/chromium",
"path": "chrome/browser/tab/java/src/org/chromium/chrome/browser/tab/SadTab.java",
"license": "bsd-3-clause",
"size": 11035
}
|
[
"android.content.Context",
"android.text.SpannableString",
"org.chromium.ui.widget.ChromeBulletSpan"
] |
import android.content.Context; import android.text.SpannableString; import org.chromium.ui.widget.ChromeBulletSpan;
|
import android.content.*; import android.text.*; import org.chromium.ui.widget.*;
|
[
"android.content",
"android.text",
"org.chromium.ui"
] |
android.content; android.text; org.chromium.ui;
| 591,474 |
private static boolean insideGetUniqueIdCall(Node n) {
Node parent = n.getParent();
String name = parent.isCall() ?
parent.getFirstChild().getQualifiedName() : null;
return name != null && name.endsWith(GET_UNIQUE_ID_FUNCTION);
}
|
static boolean function(Node n) { Node parent = n.getParent(); String name = parent.isCall() ? parent.getFirstChild().getQualifiedName() : null; return name != null && name.endsWith(GET_UNIQUE_ID_FUNCTION); }
|
/**
* Returns whether the node is an argument of a function that returns
* a unique id (the last part of the qualified name matches
* GET_UNIQUE_ID_FUNCTION).
*/
|
Returns whether the node is an argument of a function that returns a unique id (the last part of the qualified name matches GET_UNIQUE_ID_FUNCTION)
|
insideGetUniqueIdCall
|
{
"repo_name": "mbebenita/closure-compiler",
"path": "src/com/google/javascript/jscomp/CheckMissingGetCssName.java",
"license": "apache-2.0",
"size": 4201
}
|
[
"com.google.javascript.rhino.Node"
] |
import com.google.javascript.rhino.Node;
|
import com.google.javascript.rhino.*;
|
[
"com.google.javascript"
] |
com.google.javascript;
| 216,984 |
public SimulatePipelineResponse simulate(SimulatePipelineRequest request, RequestOptions options) throws IOException {
return restHighLevelClient.performRequestAndParseEntity(
request,
IngestRequestConverters::simulatePipeline,
options,
SimulatePipelineResponse::fromXContent,
emptySet()
);
}
|
SimulatePipelineResponse function(SimulatePipelineRequest request, RequestOptions options) throws IOException { return restHighLevelClient.performRequestAndParseEntity( request, IngestRequestConverters::simulatePipeline, options, SimulatePipelineResponse::fromXContent, emptySet() ); }
|
/**
* Simulate a pipeline on a set of documents provided in the request
* <p>
* See
* <a href="https://www.elastic.co/guide/en/elasticsearch/reference/master/simulate-pipeline-api.html">
* Simulate Pipeline API on elastic.co</a>
*
* @param request the request
* @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
* @return the response
* @throws IOException in case there is a problem sending the request or parsing back the response
*/
|
Simulate a pipeline on a set of documents provided in the request See Simulate Pipeline API on elastic.co
|
simulate
|
{
"repo_name": "GlenRSmith/elasticsearch",
"path": "client/rest-high-level/src/main/java/org/elasticsearch/client/IngestClient.java",
"license": "apache-2.0",
"size": 10093
}
|
[
"java.io.IOException",
"java.util.Collections",
"org.elasticsearch.action.ingest.SimulatePipelineRequest",
"org.elasticsearch.action.ingest.SimulatePipelineResponse"
] |
import java.io.IOException; import java.util.Collections; import org.elasticsearch.action.ingest.SimulatePipelineRequest; import org.elasticsearch.action.ingest.SimulatePipelineResponse;
|
import java.io.*; import java.util.*; import org.elasticsearch.action.ingest.*;
|
[
"java.io",
"java.util",
"org.elasticsearch.action"
] |
java.io; java.util; org.elasticsearch.action;
| 1,690,790 |
private RemoteWaveletContainer getOrCreateRemoteWavelet(WaveletName waveletName) {
Preconditions.checkArgument(!isLocalWavelet(waveletName), "%s is not remote", waveletName);
return waveMap.getOrCreateRemoteWavelet(waveletName);
}
|
RemoteWaveletContainer function(WaveletName waveletName) { Preconditions.checkArgument(!isLocalWavelet(waveletName), STR, waveletName); return waveMap.getOrCreateRemoteWavelet(waveletName); }
|
/**
* Returns a container for a remote wavelet. If it doesn't exist, it will be created.
* This method is only called in response to a Federation Remote doing an update
* or commit on this wavelet.
*
* @param waveletName name of wavelet
* @return an existing or new instance.
* @throws IllegalArgumentException if the name refers to a local wavelet.
*/
|
Returns a container for a remote wavelet. If it doesn't exist, it will be created. This method is only called in response to a Federation Remote doing an update or commit on this wavelet
|
getOrCreateRemoteWavelet
|
{
"repo_name": "gburd/wave",
"path": "src/org/waveprotocol/box/server/waveserver/WaveServerImpl.java",
"license": "apache-2.0",
"size": 26765
}
|
[
"com.google.common.base.Preconditions",
"org.waveprotocol.wave.model.id.WaveletName"
] |
import com.google.common.base.Preconditions; import org.waveprotocol.wave.model.id.WaveletName;
|
import com.google.common.base.*; import org.waveprotocol.wave.model.id.*;
|
[
"com.google.common",
"org.waveprotocol.wave"
] |
com.google.common; org.waveprotocol.wave;
| 2,713,753 |
public static String pad(int len) {
char[] dash = new char[len];
Arrays.fill(dash, ' ');
return new String(dash);
}
|
static String function(int len) { char[] dash = new char[len]; Arrays.fill(dash, ' '); return new String(dash); }
|
/**
* Creates space filled string of given length.
*
* @param len Number of spaces.
* @return Space filled string of given length.
*/
|
Creates space filled string of given length
|
pad
|
{
"repo_name": "murador/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java",
"license": "apache-2.0",
"size": 294985
}
|
[
"java.util.Arrays"
] |
import java.util.Arrays;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,945,052 |
public void printStats() {
System.out.println("============= ECLAT v0.96r6 - STATS =============");
long temps = endTime - startTimestamp;
System.out.println(" Transactions count from database : "
+ database.size());
System.out.println(" Frequent itemsets count : "
+ itemsetCount);
System.out.println(" Total time ~ " + temps + " ms");
System.out.println(" Maximum memory usage : "
+ MemoryLogger.getInstance().getMaxMemory() + " mb");
System.out.println("===================================================");
}
|
void function() { System.out.println(STR); long temps = endTime - startTimestamp; System.out.println(STR + database.size()); System.out.println(STR + itemsetCount); System.out.println(STR + temps + STR); System.out.println(STR + MemoryLogger.getInstance().getMaxMemory() + STR); System.out.println(STR); }
|
/**
* Print statistics about the algorithm execution to System.out.
*/
|
Print statistics about the algorithm execution to System.out
|
printStats
|
{
"repo_name": "chihsuan/lib-SPMF",
"path": "ca/pfv/spmf/algorithms/frequentpatterns/eclat/AlgoEclat.java",
"license": "gpl-3.0",
"size": 23732
}
|
[
"ca.pfv.spmf.tools.MemoryLogger"
] |
import ca.pfv.spmf.tools.MemoryLogger;
|
import ca.pfv.spmf.tools.*;
|
[
"ca.pfv.spmf"
] |
ca.pfv.spmf;
| 46,242 |
@Test
public void testQueryRewrite_feature_feature_false() {
Graph graph = model.getGraph();
Node subject = FEATURE_A.asNode();
Node predicate = Geo.SF_CONTAINS_NODE;
Node object = FEATURE_D.asNode();
GenericPropertyFunction instance = new SfContainsPF();
QueryRewriteIndex queryRewriteIndex = QueryRewriteIndex.createDefault();
Boolean expResult = false;
Boolean result = instance.queryRewrite(graph, subject, predicate, object, queryRewriteIndex);
assertEquals(expResult, result);
}
|
void function() { Graph graph = model.getGraph(); Node subject = FEATURE_A.asNode(); Node predicate = Geo.SF_CONTAINS_NODE; Node object = FEATURE_D.asNode(); GenericPropertyFunction instance = new SfContainsPF(); QueryRewriteIndex queryRewriteIndex = QueryRewriteIndex.createDefault(); Boolean expResult = false; Boolean result = instance.queryRewrite(graph, subject, predicate, object, queryRewriteIndex); assertEquals(expResult, result); }
|
/**
* Test of queryRewrite method, of class GenericPropertyFunction.
*/
|
Test of queryRewrite method, of class GenericPropertyFunction
|
testQueryRewrite_feature_feature_false
|
{
"repo_name": "apache/jena",
"path": "jena-geosparql/src/test/java/org/apache/jena/geosparql/geo/topological/GenericPropertyFunctionTest.java",
"license": "apache-2.0",
"size": 21628
}
|
[
"org.apache.jena.geosparql.geo.topological.property_functions.simple_features.SfContainsPF",
"org.apache.jena.geosparql.implementation.index.QueryRewriteIndex",
"org.apache.jena.geosparql.implementation.vocabulary.Geo",
"org.apache.jena.graph.Graph",
"org.apache.jena.graph.Node",
"org.junit.Assert"
] |
import org.apache.jena.geosparql.geo.topological.property_functions.simple_features.SfContainsPF; import org.apache.jena.geosparql.implementation.index.QueryRewriteIndex; import org.apache.jena.geosparql.implementation.vocabulary.Geo; import org.apache.jena.graph.Graph; import org.apache.jena.graph.Node; import org.junit.Assert;
|
import org.apache.jena.geosparql.geo.topological.property_functions.simple_features.*; import org.apache.jena.geosparql.implementation.index.*; import org.apache.jena.geosparql.implementation.vocabulary.*; import org.apache.jena.graph.*; import org.junit.*;
|
[
"org.apache.jena",
"org.junit"
] |
org.apache.jena; org.junit;
| 462,573 |
return new HazardMutable(this.id, this.explodes, this.deathAnimation, this.harmless);
}
public DeathAnimation getDeathAnimation() { return deathAnimation; }
|
return new HazardMutable(this.id, this.explodes, this.deathAnimation, this.harmless); } public DeathAnimation getDeathAnimation() { return deathAnimation; }
|
/**
*
* Creates a copy of this hazard that is mutable. The returned mutable object can not modify this immutable object.
*
* @return
* a mutable version of this object that can not affect the original
*
*/
|
Creates a copy of this hazard that is mutable. The returned mutable object can not modify this immutable object
|
mutableCopy
|
{
"repo_name": "ErikaRedmark/monkey-shines-java-port",
"path": "Monkey Shines/src/org/erikaredmark/monkeyshines/Hazard.java",
"license": "gpl-3.0",
"size": 7838
}
|
[
"org.erikaredmark.monkeyshines.editor.HazardMutable"
] |
import org.erikaredmark.monkeyshines.editor.HazardMutable;
|
import org.erikaredmark.monkeyshines.editor.*;
|
[
"org.erikaredmark.monkeyshines"
] |
org.erikaredmark.monkeyshines;
| 2,115,093 |
ExtensionResponse readExtensionResponse(KSIRequestContext context, ServiceCredentials credentials, TLVElement input) throws KSIException;
|
ExtensionResponse readExtensionResponse(KSIRequestContext context, ServiceCredentials credentials, TLVElement input) throws KSIException;
|
/**
* Reads an extension response.
*/
|
Reads an extension response
|
readExtensionResponse
|
{
"repo_name": "GuardTime/ksi-java-sdk",
"path": "ksi-service-client/src/main/java/com/guardtime/ksi/pdu/ExtenderPduFactory.java",
"license": "apache-2.0",
"size": 1944
}
|
[
"com.guardtime.ksi.exceptions.KSIException",
"com.guardtime.ksi.service.client.ServiceCredentials",
"com.guardtime.ksi.tlv.TLVElement"
] |
import com.guardtime.ksi.exceptions.KSIException; import com.guardtime.ksi.service.client.ServiceCredentials; import com.guardtime.ksi.tlv.TLVElement;
|
import com.guardtime.ksi.exceptions.*; import com.guardtime.ksi.service.client.*; import com.guardtime.ksi.tlv.*;
|
[
"com.guardtime.ksi"
] |
com.guardtime.ksi;
| 2,524,093 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.