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 static ChainableStatement contents(String expression) {
return new DefaultChainableStatement("contents", JsUtils.quotes(expression));
}
|
static ChainableStatement function(String expression) { return new DefaultChainableStatement(STR, JsUtils.quotes(expression)); }
|
/**
* Binds the <code>contents</code> statement.
*/
|
Binds the <code>contents</code> statement
|
contents
|
{
"repo_name": "openengsb-attic/forks-org.odlabs.wiquery",
"path": "src/main/java/org/odlabs/wiquery/core/javascript/helper/TraversingHelper.java",
"license": "mit",
"size": 4757
}
|
[
"org.odlabs.wiquery.core.javascript.ChainableStatement",
"org.odlabs.wiquery.core.javascript.DefaultChainableStatement",
"org.odlabs.wiquery.core.javascript.JsUtils"
] |
import org.odlabs.wiquery.core.javascript.ChainableStatement; import org.odlabs.wiquery.core.javascript.DefaultChainableStatement; import org.odlabs.wiquery.core.javascript.JsUtils;
|
import org.odlabs.wiquery.core.javascript.*;
|
[
"org.odlabs.wiquery"
] |
org.odlabs.wiquery;
| 651,260
|
public List<FormLine> getLines() {
return this.lines;
}
|
List<FormLine> function() { return this.lines; }
|
/**
* Get the lines property: When includeFieldElements is set to true, a list
* of recognized text lines.
*
* @return the unmodifiable list of recognized lines.
*/
|
Get the lines property: When includeFieldElements is set to true, a list of recognized text lines
|
getLines
|
{
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/formrecognizer/azure-ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/models/FormPage.java",
"license": "mit",
"size": 4006
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,528,635
|
@Override
public ResourceLocator getResourceLocator() {
return MavenPom4EditPlugin.INSTANCE;
}
|
ResourceLocator function() { return MavenPom4EditPlugin.INSTANCE; }
|
/**
* Return the resource locator for this item provider's resources.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
|
Return the resource locator for this item provider's resources.
|
getResourceLocator
|
{
"repo_name": "Treehopper/EclipseAugments",
"path": "pom-editor/eu.hohenegger.xsd.pom.ui/src-gen/eu/hohenegger/xsd/pom/provider/ContributorsTypeItemProvider.java",
"license": "epl-1.0",
"size": 5063
}
|
[
"org.eclipse.emf.common.util.ResourceLocator"
] |
import org.eclipse.emf.common.util.ResourceLocator;
|
import org.eclipse.emf.common.util.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 2,552,120
|
public void setSessionFactory(SessionFactory sessionFactory) {
this.sessionFactory = sessionFactory;
}
|
void function(SessionFactory sessionFactory) { this.sessionFactory = sessionFactory; }
|
/**
* Set Hibernate Session Factory
*
* @param SessionFactory
* - Hibernate Session Factory
*/
|
Set Hibernate Session Factory
|
setSessionFactory
|
{
"repo_name": "machadolucas/watchout",
"path": "src/main/java/com/riskvis/db/dao/impl/InsurancesHasPlacesrisksIdDAO.java",
"license": "apache-2.0",
"size": 3054
}
|
[
"org.hibernate.SessionFactory"
] |
import org.hibernate.SessionFactory;
|
import org.hibernate.*;
|
[
"org.hibernate"
] |
org.hibernate;
| 1,724,986
|
@Override
public void close() throws IOException {
if (closed) {
return;
}
IndexOutput entryTableOut = null;
// TODO this code should clean up after itself
// (remove partial .cfs/.cfe)
boolean success = false;
try {
if (!pendingEntries.isEmpty() || outputTaken.get()) {
throw new IllegalStateException("CFS has pending open files");
}
closed = true;
// open the compound stream; we can safely use IOContext.DEFAULT
// here because this will only open the output if no file was
// added to the CFS
getOutput(IOContext.DEFAULT);
assert dataOut != null;
CodecUtil.writeFooter(dataOut);
success = true;
} finally {
if (success) {
IOUtils.close(dataOut);
} else {
IOUtils.closeWhileHandlingException(dataOut);
}
}
success = false;
try {
entryTableOut = directory.createOutput(entryTableName, IOContext.DEFAULT);
writeEntryTable(entries.values(), entryTableOut);
success = true;
} finally {
if (success) {
IOUtils.close(entryTableOut);
} else {
IOUtils.closeWhileHandlingException(entryTableOut);
}
}
}
|
void function() throws IOException { if (closed) { return; } IndexOutput entryTableOut = null; boolean success = false; try { if (!pendingEntries.isEmpty() outputTaken.get()) { throw new IllegalStateException(STR); } closed = true; getOutput(IOContext.DEFAULT); assert dataOut != null; CodecUtil.writeFooter(dataOut); success = true; } finally { if (success) { IOUtils.close(dataOut); } else { IOUtils.closeWhileHandlingException(dataOut); } } success = false; try { entryTableOut = directory.createOutput(entryTableName, IOContext.DEFAULT); writeEntryTable(entries.values(), entryTableOut); success = true; } finally { if (success) { IOUtils.close(entryTableOut); } else { IOUtils.closeWhileHandlingException(entryTableOut); } } }
|
/**
* Closes all resources and writes the entry table
*
* @throws IllegalStateException
* if close() had been called before or if no file has been added to
* this object
*/
|
Closes all resources and writes the entry table
|
close
|
{
"repo_name": "williamchengit/TestRepo",
"path": "solr-4.9.0/lucene/core/src/java/org/apache/lucene/store/CompoundFileWriter.java",
"license": "apache-2.0",
"size": 11258
}
|
[
"java.io.IOException",
"org.apache.lucene.codecs.CodecUtil",
"org.apache.lucene.util.IOUtils"
] |
import java.io.IOException; import org.apache.lucene.codecs.CodecUtil; import org.apache.lucene.util.IOUtils;
|
import java.io.*; import org.apache.lucene.codecs.*; import org.apache.lucene.util.*;
|
[
"java.io",
"org.apache.lucene"
] |
java.io; org.apache.lucene;
| 2,227,552
|
public static ComplexVector valueOf(Complex... elements) {
int n = elements.length;
ComplexVector V = FACTORY.array(n);
V._dimension = n;
for (int i = 0; i < n; i++) {
Complex complex = elements[i];
V._reals[i] = complex.getReal();
V._imags[i] = complex.getImaginary();
}
return V;
}
|
static ComplexVector function(Complex... elements) { int n = elements.length; ComplexVector V = FACTORY.array(n); V._dimension = n; for (int i = 0; i < n; i++) { Complex complex = elements[i]; V._reals[i] = complex.getReal(); V._imags[i] = complex.getImaginary(); } return V; }
|
/**
* Returns a new vector holding the specified complex numbers.
*
* @param elements the complex numbers elements.
* @return the vector having the specified complex numbers.
*/
|
Returns a new vector holding the specified complex numbers
|
valueOf
|
{
"repo_name": "infsci2560sp16/full-stack-web-project-zhz92",
"path": "src/org/jscience/mathematics/vector/ComplexVector.java",
"license": "mit",
"size": 9955
}
|
[
"org.jscience.mathematics.number.Complex"
] |
import org.jscience.mathematics.number.Complex;
|
import org.jscience.mathematics.number.*;
|
[
"org.jscience.mathematics"
] |
org.jscience.mathematics;
| 972,973
|
public void installUI(JComponent a) {
for (int i = 0; i < uis.size(); i++) {
((ComponentUI) (uis.elementAt(i))).installUI(a);
}
}
|
void function(JComponent a) { for (int i = 0; i < uis.size(); i++) { ((ComponentUI) (uis.elementAt(i))).installUI(a); } }
|
/**
* Invokes the <code>installUI</code> method on each UI handled by this object.
*/
|
Invokes the <code>installUI</code> method on each UI handled by this object
|
installUI
|
{
"repo_name": "isaacl/openjdk-jdk",
"path": "src/share/classes/javax/swing/plaf/multi/MultiMenuItemUI.java",
"license": "gpl-2.0",
"size": 7675
}
|
[
"javax.swing.JComponent",
"javax.swing.plaf.ComponentUI"
] |
import javax.swing.JComponent; import javax.swing.plaf.ComponentUI;
|
import javax.swing.*; import javax.swing.plaf.*;
|
[
"javax.swing"
] |
javax.swing;
| 2,612,339
|
ICitation newCitation(String publicationTypeLocator,String docTitle, String docAbstract, String language,
String publicationTitle, String publisherLocator, String userLocator, boolean isPrivate);
|
ICitation newCitation(String publicationTypeLocator,String docTitle, String docAbstract, String language, String publicationTitle, String publisherLocator, String userLocator, boolean isPrivate);
|
/**
* Create a new {@link ICitation}. Must continue to fillin details.
* @param publicationTypeLocator
* @param docTitle
* @param docAbstract
* @param language
* @param publicationTitle
* @param publisherLocator
* @param userLocator
* @param isPrivate
* @return
*/
|
Create a new <code>ICitation</code>. Must continue to fillin details
|
newCitation
|
{
"repo_name": "SolrSherlock/JSONTopicMap",
"path": "src/java/org/topicquests/topicmap/json/model/api/ICitationModel.java",
"license": "apache-2.0",
"size": 1221
}
|
[
"org.topicquests.model.api.node.ICitation"
] |
import org.topicquests.model.api.node.ICitation;
|
import org.topicquests.model.api.node.*;
|
[
"org.topicquests.model"
] |
org.topicquests.model;
| 2,548,670
|
public void unregister() {
all().remove(this);
}
@Deprecated
public static final CopyOnWriteList<RunListener> LISTENERS = ExtensionListView.createCopyOnWriteList(RunListener.class);
|
void function() { all().remove(this); } public static final CopyOnWriteList<RunListener> LISTENERS = ExtensionListView.createCopyOnWriteList(RunListener.class);
|
/**
* Reverse operation of {@link #register()}.
*/
|
Reverse operation of <code>#register()</code>
|
unregister
|
{
"repo_name": "viqueen/jenkins",
"path": "core/src/main/java/hudson/model/listeners/RunListener.java",
"license": "mit",
"size": 10024
}
|
[
"hudson.util.CopyOnWriteList"
] |
import hudson.util.CopyOnWriteList;
|
import hudson.util.*;
|
[
"hudson.util"
] |
hudson.util;
| 2,599,677
|
public boolean isPointless() {
if(size()>0) return false;
if(documentation!=null && !documentation.contents.isEmpty())
return false;
return true;
}
private static final class Documentation {
@XmlAnyElement
@XmlMixed
List<Object> contents = new ArrayList<Object>();
|
boolean function() { if(size()>0) return false; if(documentation!=null && !documentation.contents.isEmpty()) return false; return true; } private static final class Documentation { List<Object> contents = new ArrayList<Object>();
|
/**
* Returns true if this {@link BindInfo} doesn't contain any useful
* information.
*
* This flag is used to discard unused {@link BindInfo}s early to save memory footprint.
*/
|
Returns true if this <code>BindInfo</code> doesn't contain any useful information. This flag is used to discard unused <code>BindInfo</code>s early to save memory footprint
|
isPointless
|
{
"repo_name": "universsky/openjdk",
"path": "jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/BindInfo.java",
"license": "gpl-2.0",
"size": 12615
}
|
[
"java.util.ArrayList",
"java.util.List"
] |
import java.util.ArrayList; import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,008,783
|
public void disconnect() throws ServiceDisconnectionFailedException {
}
|
void function() throws ServiceDisconnectionFailedException { }
|
/**
* Closes the global connection to the data source.
*
* @exception ServiceDisconnectionFailedException if closing the connection
* failed
*/
|
Closes the global connection to the data source
|
disconnect
|
{
"repo_name": "integrated/jakarta-slide-server",
"path": "src/stores/org/apache/slide/store/impl/rdbms/AbstractRDBMSStore.java",
"license": "apache-2.0",
"size": 35108
}
|
[
"org.apache.slide.common.ServiceDisconnectionFailedException"
] |
import org.apache.slide.common.ServiceDisconnectionFailedException;
|
import org.apache.slide.common.*;
|
[
"org.apache.slide"
] |
org.apache.slide;
| 198,520
|
private void testTamperedWrite(AEADBlockCipher cipher, CipherParameters params)
throws Exception
{
cipher.init(true, params);
byte[] ciphertext = new byte[cipher.getOutputSize(streamSize)];
cipher.doFinal(ciphertext, cipher.processBytes(new byte[streamSize], 0, streamSize, ciphertext, 0));
// Tamper
ciphertext[0] += 1;
cipher.init(false, params);
ByteArrayOutputStream plaintext = new ByteArrayOutputStream();
OutputStream output = createCipherOutputStream(plaintext, cipher);
for (int i = 0; i < ciphertext.length; i++)
{
output.write(ciphertext[i]);
}
try
{
output.close();
fail("Expected invalid ciphertext after tamper and write : " + cipher.getAlgorithmName());
}
catch (InvalidCipherTextIOException e)
{
// Expected
}
}
|
void function(AEADBlockCipher cipher, CipherParameters params) throws Exception { cipher.init(true, params); byte[] ciphertext = new byte[cipher.getOutputSize(streamSize)]; cipher.doFinal(ciphertext, cipher.processBytes(new byte[streamSize], 0, streamSize, ciphertext, 0)); ciphertext[0] += 1; cipher.init(false, params); ByteArrayOutputStream plaintext = new ByteArrayOutputStream(); OutputStream output = createCipherOutputStream(plaintext, cipher); for (int i = 0; i < ciphertext.length; i++) { output.write(ciphertext[i]); } try { output.close(); fail(STR + cipher.getAlgorithmName()); } catch (InvalidCipherTextIOException e) { } }
|
/**
* Test tampering of ciphertext followed by write to decrypting CipherOutputStream
*/
|
Test tampering of ciphertext followed by write to decrypting CipherOutputStream
|
testTamperedWrite
|
{
"repo_name": "ttt43ttt/gwt-crypto",
"path": "src/test/java/org/bouncycastle/crypto/test/CipherStreamTest.java",
"license": "apache-2.0",
"size": 22389
}
|
[
"java.io.ByteArrayOutputStream",
"java.io.OutputStream",
"org.bouncycastle.crypto.CipherParameters",
"org.bouncycastle.crypto.io.InvalidCipherTextIOException",
"org.bouncycastle.crypto.modes.AEADBlockCipher"
] |
import java.io.ByteArrayOutputStream; import java.io.OutputStream; import org.bouncycastle.crypto.CipherParameters; import org.bouncycastle.crypto.io.InvalidCipherTextIOException; import org.bouncycastle.crypto.modes.AEADBlockCipher;
|
import java.io.*; import org.bouncycastle.crypto.*; import org.bouncycastle.crypto.io.*; import org.bouncycastle.crypto.modes.*;
|
[
"java.io",
"org.bouncycastle.crypto"
] |
java.io; org.bouncycastle.crypto;
| 1,175,861
|
CheckResponse visit(String host, String uri, String proxy, int timeout, Map<String,String> headers);
|
CheckResponse visit(String host, String uri, String proxy, int timeout, Map<String,String> headers);
|
/**
* check url belonged to group id
*
* @param host
* @param uri
* @param timeout
* @param headers
* @return Check Response
* @throws Exception
*/
|
check url belonged to group id
|
visit
|
{
"repo_name": "sdgdsffdsfff/zeus",
"path": "slb/src/main/java/com/ctrip/zeus/service/tools/check/VisitUrlClientService.java",
"license": "apache-2.0",
"size": 746
}
|
[
"com.ctrip.zeus.model.tools.CheckResponse",
"java.util.Map"
] |
import com.ctrip.zeus.model.tools.CheckResponse; import java.util.Map;
|
import com.ctrip.zeus.model.tools.*; import java.util.*;
|
[
"com.ctrip.zeus",
"java.util"
] |
com.ctrip.zeus; java.util;
| 591,097
|
private static Area buildPrimitive()
{
Rectangle2D.Double body = new Rectangle2D.Double(6, 0, 30, 12);
Ellipse2D.Double head = new Ellipse2D.Double(0, 0, 12, 12);
Ellipse2D.Double tail = new Ellipse2D.Double(30, 0, 12, 12);
Area tick = new Area(body);
tick.add(new Area(head));
tick.add(new Area(tail));
return tick;
}
|
static Area function() { Rectangle2D.Double body = new Rectangle2D.Double(6, 0, 30, 12); Ellipse2D.Double head = new Ellipse2D.Double(0, 0, 12, 12); Ellipse2D.Double tail = new Ellipse2D.Double(30, 0, 12, 12); Area tick = new Area(body); tick.add(new Area(head)); tick.add(new Area(tail)); return tick; }
|
/**
* Builds a bar.
*/
|
Builds a bar
|
buildPrimitive
|
{
"repo_name": "ervandew/formic",
"path": "src/java/net/java/swingfx/waitwithstyle/SingleComponentInfiniteProgress.java",
"license": "lgpl-2.1",
"size": 18081
}
|
[
"java.awt.geom.Area",
"java.awt.geom.Ellipse2D",
"java.awt.geom.Rectangle2D"
] |
import java.awt.geom.Area; import java.awt.geom.Ellipse2D; import java.awt.geom.Rectangle2D;
|
import java.awt.geom.*;
|
[
"java.awt"
] |
java.awt;
| 23,796
|
public static ims.clinical.vo.IntraOperativeCareRecordMinVo insert(DomainObjectMap map, ims.clinical.vo.IntraOperativeCareRecordMinVo valueObject, ims.core.clinical.domain.objects.IntraOperativeCareRecord domainObject)
{
if (null == domainObject)
{
return valueObject;
}
if (null == map)
{
map = new DomainObjectMap();
}
valueObject.setID_IntraOperativeCareRecord(domainObject.getId());
valueObject.setIsRIE(domainObject.getIsRIE());
// If this is a recordedInError record, and the domainObject
// value isIncludeRecord has not been set, then we return null and
// not the value object
if (valueObject.getIsRIE() != null && valueObject.getIsRIE().booleanValue() == true && !domainObject.isIncludeRecord())
return null;
// If this is not a recordedInError record, and the domainObject
// value isIncludeRecord has been set, then we return null and
// not the value object
if ((valueObject.getIsRIE() == null || valueObject.getIsRIE().booleanValue() == false) && domainObject.isIncludeRecord())
return null;
// CareContext
if (domainObject.getCareContext() != null)
{
if(domainObject.getCareContext() instanceof HibernateProxy) // If the proxy is set, there is no need to lazy load, the proxy knows the id already.
{
HibernateProxy p = (HibernateProxy) domainObject.getCareContext();
int id = Integer.parseInt(p.getHibernateLazyInitializer().getIdentifier().toString());
valueObject.setCareContext(new ims.core.admin.vo.CareContextRefVo(id, -1));
}
else
{
valueObject.setCareContext(new ims.core.admin.vo.CareContextRefVo(domainObject.getCareContext().getId(), domainObject.getCareContext().getVersion()));
}
}
return valueObject;
}
|
static ims.clinical.vo.IntraOperativeCareRecordMinVo function(DomainObjectMap map, ims.clinical.vo.IntraOperativeCareRecordMinVo valueObject, ims.core.clinical.domain.objects.IntraOperativeCareRecord domainObject) { if (null == domainObject) { return valueObject; } if (null == map) { map = new DomainObjectMap(); } valueObject.setID_IntraOperativeCareRecord(domainObject.getId()); valueObject.setIsRIE(domainObject.getIsRIE()); if (valueObject.getIsRIE() != null && valueObject.getIsRIE().booleanValue() == true && !domainObject.isIncludeRecord()) return null; if ((valueObject.getIsRIE() == null valueObject.getIsRIE().booleanValue() == false) && domainObject.isIncludeRecord()) return null; if (domainObject.getCareContext() != null) { if(domainObject.getCareContext() instanceof HibernateProxy) { HibernateProxy p = (HibernateProxy) domainObject.getCareContext(); int id = Integer.parseInt(p.getHibernateLazyInitializer().getIdentifier().toString()); valueObject.setCareContext(new ims.core.admin.vo.CareContextRefVo(id, -1)); } else { valueObject.setCareContext(new ims.core.admin.vo.CareContextRefVo(domainObject.getCareContext().getId(), domainObject.getCareContext().getVersion())); } } return valueObject; }
|
/**
* Update the ValueObject with the Domain Object.
* @param map DomainObjectMap of DomainObjects to already created ValueObjects.
* @param valueObject to be updated
* @param domainObject ims.core.clinical.domain.objects.IntraOperativeCareRecord
*/
|
Update the ValueObject with the Domain Object
|
insert
|
{
"repo_name": "open-health-hub/openmaxims-linux",
"path": "openmaxims_workspace/ValueObjects/src/ims/clinical/vo/domain/IntraOperativeCareRecordMinVoAssembler.java",
"license": "agpl-3.0",
"size": 18256
}
|
[
"org.hibernate.proxy.HibernateProxy"
] |
import org.hibernate.proxy.HibernateProxy;
|
import org.hibernate.proxy.*;
|
[
"org.hibernate.proxy"
] |
org.hibernate.proxy;
| 2,779,273
|
@Override
public void close() throws IOException {
// TODO: Close SSL sockets using a background thread so they close
// gracefully.
synchronized (handshakeLock) {
if (!handshakeStarted) {
// prevent further attemps to start handshake
handshakeStarted = true;
synchronized (this) {
free();
if (socket != this) {
if (autoClose && !socket.isClosed()) socket.close();
} else {
if (!super.isClosed()) super.close();
}
}
return;
}
}
NativeCrypto.SSL_interrupt(sslNativePointer);
synchronized (this) {
synchronized (writeLock) {
synchronized (readLock) {
// Shut down the SSL connection, per se.
try {
if (handshakeStarted) {
BlockGuard.getThreadPolicy().onNetwork();
NativeCrypto.SSL_shutdown(sslNativePointer, fd, this);
}
} catch (IOException ignored) {
}
free();
if (socket != this) {
if (autoClose && !socket.isClosed())
socket.close();
} else {
if (!super.isClosed())
super.close();
}
}
}
}
}
|
void function() throws IOException { synchronized (handshakeLock) { if (!handshakeStarted) { handshakeStarted = true; synchronized (this) { free(); if (socket != this) { if (autoClose && !socket.isClosed()) socket.close(); } else { if (!super.isClosed()) super.close(); } } return; } } NativeCrypto.SSL_interrupt(sslNativePointer); synchronized (this) { synchronized (writeLock) { synchronized (readLock) { try { if (handshakeStarted) { BlockGuard.getThreadPolicy().onNetwork(); NativeCrypto.SSL_shutdown(sslNativePointer, fd, this); } } catch (IOException ignored) { } free(); if (socket != this) { if (autoClose && !socket.isClosed()) socket.close(); } else { if (!super.isClosed()) super.close(); } } } } }
|
/**
* Closes the SSL socket. Once closed, a socket is not available for further
* use anymore under any circumstance. A new socket must be created.
*
* @throws <code>IOException</code> if an I/O error happens during the
* socket's closure.
*/
|
Closes the SSL socket. Once closed, a socket is not available for further use anymore under any circumstance. A new socket must be created
|
close
|
{
"repo_name": "openweave/openweave-core",
"path": "third_party/android/platform-libcore/android-platform-libcore/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java",
"license": "apache-2.0",
"size": 46926
}
|
[
"java.io.IOException"
] |
import java.io.IOException;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 1,154,983
|
@Test
public void testSetProductName_1()
throws Exception {
ScriptFilter fixture = new ScriptFilter();
fixture.setActions(new HashSet());
fixture.setExternalScriptId(new Integer(1));
fixture.setPersist(true);
fixture.setAllConditionsMustPass(true);
fixture.setName("");
fixture.setFilterType(ScriptFilterType.EXTERNAL);
fixture.setProductName("");
fixture.setConditions(new HashSet());
String productName = "";
fixture.setProductName(productName);
}
|
void function() throws Exception { ScriptFilter fixture = new ScriptFilter(); fixture.setActions(new HashSet()); fixture.setExternalScriptId(new Integer(1)); fixture.setPersist(true); fixture.setAllConditionsMustPass(true); fixture.setName(STRSTR"; fixture.setProductName(productName); }
|
/**
* Run the void setProductName(String) method test.
*
* @throws Exception
*
* @generatedBy CodePro at 12/15/14 1:34 PM
*/
|
Run the void setProductName(String) method test
|
testSetProductName_1
|
{
"repo_name": "intuit/Tank",
"path": "data_model/src/test/java/com/intuit/tank/project/ScriptFilterTest.java",
"license": "epl-1.0",
"size": 21962
}
|
[
"com.intuit.tank.project.ScriptFilter",
"java.util.HashSet"
] |
import com.intuit.tank.project.ScriptFilter; import java.util.HashSet;
|
import com.intuit.tank.project.*; import java.util.*;
|
[
"com.intuit.tank",
"java.util"
] |
com.intuit.tank; java.util;
| 210,541
|
public Object parse(Map params, URL url) {
return parseURL(url, params);
}
|
Object function(Map params, URL url) { return parseURL(url, params); }
|
/**
* Parse a JSON data structure from content at a given URL. Convenience variant when using Groovy named parameters for the connection params.
*
* @param params connection parameters
* @param url URL containing JSON content
* @return a data structure of lists and maps
* @since 2.2.0
*/
|
Parse a JSON data structure from content at a given URL. Convenience variant when using Groovy named parameters for the connection params
|
parse
|
{
"repo_name": "komalsukhani/debian-groovy2",
"path": "subprojects/groovy-json/src/main/java/groovy/json/JsonSlurperClassic.java",
"license": "apache-2.0",
"size": 16197
}
|
[
"java.util.Map"
] |
import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,515,330
|
AttributeInterface getAttribute();
|
AttributeInterface getAttribute();
|
/**
* To get the left operand of the condition.
* @return The Dynamic extension attribute, the left operand of the condition.
*/
|
To get the left operand of the condition
|
getAttribute
|
{
"repo_name": "NCIP/wustl-common-package",
"path": "src/edu/wustl/common/querysuite/queryobject/ICondition.java",
"license": "bsd-3-clause",
"size": 2266
}
|
[
"edu.common.dynamicextensions.domaininterface.AttributeInterface"
] |
import edu.common.dynamicextensions.domaininterface.AttributeInterface;
|
import edu.common.dynamicextensions.domaininterface.*;
|
[
"edu.common.dynamicextensions"
] |
edu.common.dynamicextensions;
| 1,775,038
|
public FlowFileSummaryDTO createFlowFileSummaryDTO(final FlowFileSummary summary, final Date now) {
final FlowFileSummaryDTO dto = new FlowFileSummaryDTO();
dto.setUuid(summary.getUuid());
dto.setFilename(summary.getFilename());
dto.setPenalized(summary.isPenalized());
final long penaltyExpiration = summary.getPenaltyExpirationMillis() - now.getTime();
dto.setPenaltyExpiresIn(penaltyExpiration>=0?penaltyExpiration:0);
dto.setPosition(summary.getPosition());
dto.setSize(summary.getSize());
final long queuedDuration = now.getTime() - summary.getLastQueuedTime();
dto.setQueuedDuration(queuedDuration);
final long age = now.getTime() - summary.getLineageStartDate();
dto.setLineageDuration(age);
return dto;
}
|
FlowFileSummaryDTO function(final FlowFileSummary summary, final Date now) { final FlowFileSummaryDTO dto = new FlowFileSummaryDTO(); dto.setUuid(summary.getUuid()); dto.setFilename(summary.getFilename()); dto.setPenalized(summary.isPenalized()); final long penaltyExpiration = summary.getPenaltyExpirationMillis() - now.getTime(); dto.setPenaltyExpiresIn(penaltyExpiration>=0?penaltyExpiration:0); dto.setPosition(summary.getPosition()); dto.setSize(summary.getSize()); final long queuedDuration = now.getTime() - summary.getLastQueuedTime(); dto.setQueuedDuration(queuedDuration); final long age = now.getTime() - summary.getLineageStartDate(); dto.setLineageDuration(age); return dto; }
|
/**
* Creates a FlowFileSummaryDTO from the specified FlowFileSummary.
*
* @param summary summary
* @return dto
*/
|
Creates a FlowFileSummaryDTO from the specified FlowFileSummary
|
createFlowFileSummaryDTO
|
{
"repo_name": "MikeThomsen/nifi",
"path": "nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java",
"license": "apache-2.0",
"size": 232154
}
|
[
"java.util.Date",
"org.apache.nifi.controller.queue.FlowFileSummary"
] |
import java.util.Date; import org.apache.nifi.controller.queue.FlowFileSummary;
|
import java.util.*; import org.apache.nifi.controller.queue.*;
|
[
"java.util",
"org.apache.nifi"
] |
java.util; org.apache.nifi;
| 2,552,772
|
@GET
public Response getQueries(@Context final UriInfo uriInfo, @QueryParam("limit") final Long limit,
@QueryParam("max") final Long maxId, @QueryParam("min") final Long minId, @QueryParam("q") final String searchTerm)
throws CatalogException {
long realLimit = MoreObjects.firstNonNull(limit, MyriaApiConstants.MYRIA_API_DEFAULT_NUM_RESULTS);
String realSearchTerm = searchTerm;
if ("".equals(realSearchTerm)) {
realSearchTerm = null;
}
List<QueryStatusEncoding> queries = server.getQueryManager().getQueries(realLimit, maxId, minId, realSearchTerm);
for (QueryStatusEncoding status : queries) {
status.url = getCanonicalResourcePath(uriInfo, status.queryId);
}
QuerySearchResults results = new QuerySearchResults();
results.results = queries;
results.max = server.getMaxQuery(realSearchTerm);
results.min = server.getMinQuery(realSearchTerm);
return Response.ok().cacheControl(MyriaApiUtils.doNotCache()).entity(results).build();
}
|
Response function(@Context final UriInfo uriInfo, @QueryParam("limit") final Long limit, @QueryParam("max") final Long maxId, @QueryParam("min") final Long minId, @QueryParam("q") final String searchTerm) throws CatalogException { long realLimit = MoreObjects.firstNonNull(limit, MyriaApiConstants.MYRIA_API_DEFAULT_NUM_RESULTS); String realSearchTerm = searchTerm; if ("".equals(realSearchTerm)) { realSearchTerm = null; } List<QueryStatusEncoding> queries = server.getQueryManager().getQueries(realLimit, maxId, minId, realSearchTerm); for (QueryStatusEncoding status : queries) { status.url = getCanonicalResourcePath(uriInfo, status.queryId); } QuerySearchResults results = new QuerySearchResults(); results.results = queries; results.max = server.getMaxQuery(realSearchTerm); results.min = server.getMinQuery(realSearchTerm); return Response.ok().cacheControl(MyriaApiUtils.doNotCache()).entity(results).build(); }
|
/**
* Get information about a query. This includes when it started, when it finished, its URL, etc.
*
* @param uriInfo the URL of the current request.
* @param limit the maximum number of results to return. If null, the default of
* {@link MyriaApiConstants.MYRIA_API_DEFAULT_NUM_RESULTS} is used. Any value <= 0 is interpreted as all
* results.
* @param maxId the largest query ID returned. If null or <= 0, all queries will be returned.
* @param minId the smallest query ID returned. If null or <= 0, all queries will be returned. Ignored if maxId is
* present.
* @param searchTerm an optional search term on the raw query string. If present, only queries with this token will be
* returned. If present, must be at least 3 characters long.
* @return information about the query.
* @throws CatalogException if there is an error in the catalog.
*/
|
Get information about a query. This includes when it started, when it finished, its URL, etc
|
getQueries
|
{
"repo_name": "bsalimi/myria",
"path": "src/edu/washington/escience/myria/api/QueryResource.java",
"license": "bsd-3-clause",
"size": 10630
}
|
[
"com.google.common.base.MoreObjects",
"edu.washington.escience.myria.api.encoding.QuerySearchResults",
"edu.washington.escience.myria.api.encoding.QueryStatusEncoding",
"edu.washington.escience.myria.coordinator.CatalogException",
"java.util.List",
"javax.ws.rs.QueryParam",
"javax.ws.rs.core.Context",
"javax.ws.rs.core.Response",
"javax.ws.rs.core.UriInfo"
] |
import com.google.common.base.MoreObjects; import edu.washington.escience.myria.api.encoding.QuerySearchResults; import edu.washington.escience.myria.api.encoding.QueryStatusEncoding; import edu.washington.escience.myria.coordinator.CatalogException; import java.util.List; import javax.ws.rs.QueryParam; import javax.ws.rs.core.Context; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo;
|
import com.google.common.base.*; import edu.washington.escience.myria.api.encoding.*; import edu.washington.escience.myria.coordinator.*; import java.util.*; import javax.ws.rs.*; import javax.ws.rs.core.*;
|
[
"com.google.common",
"edu.washington.escience",
"java.util",
"javax.ws"
] |
com.google.common; edu.washington.escience; java.util; javax.ws;
| 2,873,240
|
public void setActivatedChild(ActivatableNotificationView activatedChild) {
mActivatedChild = activatedChild;
}
|
void function(ActivatableNotificationView activatedChild) { mActivatedChild = activatedChild; }
|
/**
* In dimmed mode, a child can be activated, which happens on the first tap of the double-tap
* interaction. This child is then scaled normally and its background is fully opaque.
*/
|
In dimmed mode, a child can be activated, which happens on the first tap of the double-tap interaction. This child is then scaled normally and its background is fully opaque
|
setActivatedChild
|
{
"repo_name": "Ant-Droid/android_frameworks_base_OLD",
"path": "packages/SystemUI/src/com/android/systemui/statusbar/stack/AmbientState.java",
"license": "apache-2.0",
"size": 5553
}
|
[
"com.android.systemui.statusbar.ActivatableNotificationView"
] |
import com.android.systemui.statusbar.ActivatableNotificationView;
|
import com.android.systemui.statusbar.*;
|
[
"com.android.systemui"
] |
com.android.systemui;
| 941,524
|
protected void addSecurityEnabledPropertyDescriptor(Object object) {
itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_AbstractEndPoint_securityEnabled_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_AbstractEndPoint_securityEnabled_feature", "_UI_AbstractEndPoint_type"),
EsbPackage.Literals.ABSTRACT_END_POINT__SECURITY_ENABLED,
true,
false,
false,
ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
"QoS",
null));
}
|
void function(Object object) { itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString(STR), getString(STR, STR, STR), EsbPackage.Literals.ABSTRACT_END_POINT__SECURITY_ENABLED, true, false, false, ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, "QoS", null)); }
|
/**
* This adds a property descriptor for the Security Enabled feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
|
This adds a property descriptor for the Security Enabled feature.
|
addSecurityEnabledPropertyDescriptor
|
{
"repo_name": "chanakaudaya/developer-studio",
"path": "esb/org.wso2.developerstudio.eclipse.gmf.esb.edit/src/org/wso2/developerstudio/eclipse/gmf/esb/provider/AbstractEndPointItemProvider.java",
"license": "apache-2.0",
"size": 23207
}
|
[
"org.eclipse.emf.edit.provider.ComposeableAdapterFactory",
"org.eclipse.emf.edit.provider.ItemPropertyDescriptor",
"org.wso2.developerstudio.eclipse.gmf.esb.EsbPackage"
] |
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; import org.wso2.developerstudio.eclipse.gmf.esb.EsbPackage;
|
import org.eclipse.emf.edit.provider.*; import org.wso2.developerstudio.eclipse.gmf.esb.*;
|
[
"org.eclipse.emf",
"org.wso2.developerstudio"
] |
org.eclipse.emf; org.wso2.developerstudio;
| 2,500,954
|
protected ListSelectionListener createListSelectionListener() {
return new ListSelectionHandler();
}
|
ListSelectionListener function() { return new ListSelectionHandler(); }
|
/**
* Creates and returns an instance of ListSelectionHandler.
*/
|
Creates and returns an instance of ListSelectionHandler
|
createListSelectionListener
|
{
"repo_name": "cst316/spring16project-Modula-2",
"path": "src/net/sf/memoranda/ui/DefectTable.java",
"license": "gpl-2.0",
"size": 16678
}
|
[
"javax.swing.event.ListSelectionListener"
] |
import javax.swing.event.ListSelectionListener;
|
import javax.swing.event.*;
|
[
"javax.swing"
] |
javax.swing;
| 1,855,354
|
private void setupLauncherLibPath(FileSystem fs, Path tmpLauncherLibPath) throws IOException {
ActionService actionService = Services.get().get(ActionService.class);
List<Class<?>> classes = JavaActionExecutor.getCommonLauncherClasses();
Path baseDir = new Path(tmpLauncherLibPath, JavaActionExecutor.OOZIE_COMMON_LIBDIR);
copyJarContainingClasses(classes, fs, baseDir, JavaActionExecutor.OOZIE_COMMON_LIBDIR);
Set<String> actionTypes = actionService.getActionTypes();
for (String key : actionTypes) {
ActionExecutor executor = actionService.getExecutor(key);
if (executor instanceof JavaActionExecutor) {
JavaActionExecutor jexecutor = (JavaActionExecutor) executor;
classes = jexecutor.getLauncherClasses();
if (classes != null) {
String type = executor.getType();
Path executorDir = new Path(tmpLauncherLibPath, type);
copyJarContainingClasses(classes, fs, executorDir, type);
}
}
}
}
|
void function(FileSystem fs, Path tmpLauncherLibPath) throws IOException { ActionService actionService = Services.get().get(ActionService.class); List<Class<?>> classes = JavaActionExecutor.getCommonLauncherClasses(); Path baseDir = new Path(tmpLauncherLibPath, JavaActionExecutor.OOZIE_COMMON_LIBDIR); copyJarContainingClasses(classes, fs, baseDir, JavaActionExecutor.OOZIE_COMMON_LIBDIR); Set<String> actionTypes = actionService.getActionTypes(); for (String key : actionTypes) { ActionExecutor executor = actionService.getExecutor(key); if (executor instanceof JavaActionExecutor) { JavaActionExecutor jexecutor = (JavaActionExecutor) executor; classes = jexecutor.getLauncherClasses(); if (classes != null) { String type = executor.getType(); Path executorDir = new Path(tmpLauncherLibPath, type); copyJarContainingClasses(classes, fs, executorDir, type); } } } }
|
/**
* Copy launcher jars to Temp directory.
*
* @param fs the FileSystem
* @param tmpLauncherLibPath the tmp launcher lib path
* @throws IOException Signals that an I/O exception has occurred.
*/
|
Copy launcher jars to Temp directory
|
setupLauncherLibPath
|
{
"repo_name": "cbaenziger/oozie",
"path": "core/src/main/java/org/apache/oozie/service/ShareLibService.java",
"license": "apache-2.0",
"size": 37485
}
|
[
"java.io.IOException",
"java.util.List",
"java.util.Set",
"org.apache.hadoop.fs.FileSystem",
"org.apache.hadoop.fs.Path",
"org.apache.oozie.action.ActionExecutor",
"org.apache.oozie.action.hadoop.JavaActionExecutor"
] |
import java.io.IOException; import java.util.List; import java.util.Set; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.oozie.action.ActionExecutor; import org.apache.oozie.action.hadoop.JavaActionExecutor;
|
import java.io.*; import java.util.*; import org.apache.hadoop.fs.*; import org.apache.oozie.action.*; import org.apache.oozie.action.hadoop.*;
|
[
"java.io",
"java.util",
"org.apache.hadoop",
"org.apache.oozie"
] |
java.io; java.util; org.apache.hadoop; org.apache.oozie;
| 2,610,656
|
public void put(Object value)
{
createTime = CurrentTime.getCurrentTime();
this.value = value;
}
|
void function(Object value) { createTime = CurrentTime.getCurrentTime(); this.value = value; }
|
/**
* Sets the value.
*/
|
Sets the value
|
put
|
{
"repo_name": "mdaniel/svn-caucho-com-resin",
"path": "modules/resin/src/com/caucho/server/thread/TimedItem.java",
"license": "gpl-2.0",
"size": 2800
}
|
[
"com.caucho.util.CurrentTime"
] |
import com.caucho.util.CurrentTime;
|
import com.caucho.util.*;
|
[
"com.caucho.util"
] |
com.caucho.util;
| 2,601,936
|
public static BoundType getUpperBoundType(Range<Value> range) {
Value upper = getUpperEndpoint(range);
if(upper == Value.POSITIVE_INFINITY) {
return BoundType.CLOSED;
}
else {
return range.upperBoundType();
}
}
|
static BoundType function(Range<Value> range) { Value upper = getUpperEndpoint(range); if(upper == Value.POSITIVE_INFINITY) { return BoundType.CLOSED; } else { return range.upperBoundType(); } }
|
/**
* Equivalent to {@link Range#upperBoundType()} except that
* {@link BoundType#CLOSED} is returned if the upper endpoint is equals to
* {@link Value#POSITVE_INFINITY}.
*
* @param range
* @return the upper bound type
*/
|
Equivalent to <code>Range#upperBoundType()</code> except that <code>BoundType#CLOSED</code> is returned if the upper endpoint is equals to <code>Value#POSITVE_INFINITY</code>
|
getUpperBoundType
|
{
"repo_name": "savanibharat/concourse",
"path": "concourse-server/src/main/java/org/cinchapi/concourse/server/model/Ranges.java",
"license": "apache-2.0",
"size": 11380
}
|
[
"com.google.common.collect.BoundType",
"com.google.common.collect.Range"
] |
import com.google.common.collect.BoundType; import com.google.common.collect.Range;
|
import com.google.common.collect.*;
|
[
"com.google.common"
] |
com.google.common;
| 1,180,495
|
private MouseTarget getMouseTarget(final int x,
final int y,
final boolean includeSplitLayout,
final boolean selecting) {
if (includeSplitLayout) {
for (final Entry<Object, PositionAndSize> entry : positionAndSizeMap.entrySet()) {
if (entry.getKey() instanceof SplitLayoutConfig) {
final LayoutConfig layoutData = (LayoutConfig) entry.getKey();
final PositionAndSize positionAndSize = entry.getValue();
final MouseTarget mouseTarget = findTargetLayout(
x,
y,
true,
layoutData,
positionAndSize,
selecting);
if (mouseTarget != null) {
return mouseTarget;
}
}
}
}
for (final Entry<Object, PositionAndSize> entry : positionAndSizeMap.entrySet()) {
if (entry.getKey() instanceof TabLayoutConfig) {
final LayoutConfig layoutData = (LayoutConfig) entry.getKey();
final PositionAndSize positionAndSize = entry.getValue();
final MouseTarget mouseTarget = findTargetLayout(
x,
y,
false,
layoutData,
positionAndSize,
selecting);
if (mouseTarget != null) {
return mouseTarget;
}
}
}
return null;
}
|
MouseTarget function(final int x, final int y, final boolean includeSplitLayout, final boolean selecting) { if (includeSplitLayout) { for (final Entry<Object, PositionAndSize> entry : positionAndSizeMap.entrySet()) { if (entry.getKey() instanceof SplitLayoutConfig) { final LayoutConfig layoutData = (LayoutConfig) entry.getKey(); final PositionAndSize positionAndSize = entry.getValue(); final MouseTarget mouseTarget = findTargetLayout( x, y, true, layoutData, positionAndSize, selecting); if (mouseTarget != null) { return mouseTarget; } } } } for (final Entry<Object, PositionAndSize> entry : positionAndSizeMap.entrySet()) { if (entry.getKey() instanceof TabLayoutConfig) { final LayoutConfig layoutData = (LayoutConfig) entry.getKey(); final PositionAndSize positionAndSize = entry.getValue(); final MouseTarget mouseTarget = findTargetLayout( x, y, false, layoutData, positionAndSize, selecting); if (mouseTarget != null) { return mouseTarget; } } } return null; }
|
/**
* Gets the current target of the mouse.
*
* @param x The mouse x coordinate.
* @param y The mouse y coordinate.
* @return An object describing the target layout, tab and target position.
*/
|
Gets the current target of the mouse
|
getMouseTarget
|
{
"repo_name": "gchq/stroom",
"path": "stroom-dashboard/stroom-dashboard-client/src/main/java/stroom/dashboard/client/flexlayout/FlexLayout.java",
"license": "apache-2.0",
"size": 52634
}
|
[
"java.util.Map"
] |
import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 356,226
|
void login(String username, String password, LoginResultCallback callback);
|
void login(String username, String password, LoginResultCallback callback);
|
/**
* the abstract method to login
* @param username username
* @param password password
* @param callback login callback interface
*/
|
the abstract method to login
|
login
|
{
"repo_name": "sczyh30/yuedong-app",
"path": "app/src/main/java/com/m1racle/yuedong/presenter/service/IBaseLoginService.java",
"license": "gpl-2.0",
"size": 498
}
|
[
"com.m1racle.yuedong.presenter.service.callback.LoginResultCallback"
] |
import com.m1racle.yuedong.presenter.service.callback.LoginResultCallback;
|
import com.m1racle.yuedong.presenter.service.callback.*;
|
[
"com.m1racle.yuedong"
] |
com.m1racle.yuedong;
| 1,989,748
|
public Role getRoleByUuid(String uuid) throws APIException;
|
Role function(String uuid) throws APIException;
|
/**
* Get Role by its UUID
*
* @param uuid
* @return
* @should find object given valid uuid
* @should return null if no object found with given uuid
*/
|
Get Role by its UUID
|
getRoleByUuid
|
{
"repo_name": "Winbobob/openmrs-core",
"path": "api/src/main/java/org/openmrs/api/UserService.java",
"license": "mpl-2.0",
"size": 21666
}
|
[
"org.openmrs.Role"
] |
import org.openmrs.Role;
|
import org.openmrs.*;
|
[
"org.openmrs"
] |
org.openmrs;
| 2,198,752
|
public void setUserLayout(final IPerson person, final IUserProfile profile, final Document layoutXML, final boolean channelsAdded) {
final long startTime = System.currentTimeMillis();
final int userId = person.getID();
final int profileId = profile.getProfileId();
|
void function(final IPerson person, final IUserProfile profile, final Document layoutXML, final boolean channelsAdded) { final long startTime = System.currentTimeMillis(); final int userId = person.getID(); final int profileId = profile.getProfileId();
|
/**
* Save the user layout.
* @param person
* @param profile
* @param layoutXML
* @throws Exception
*/
|
Save the user layout
|
setUserLayout
|
{
"repo_name": "chasegawa/uPortal",
"path": "uportal-war/src/main/java/org/jasig/portal/layout/simple/RDBMUserLayoutStore.java",
"license": "apache-2.0",
"size": 80395
}
|
[
"org.jasig.portal.IUserProfile",
"org.jasig.portal.security.IPerson",
"org.w3c.dom.Document"
] |
import org.jasig.portal.IUserProfile; import org.jasig.portal.security.IPerson; import org.w3c.dom.Document;
|
import org.jasig.portal.*; import org.jasig.portal.security.*; import org.w3c.dom.*;
|
[
"org.jasig.portal",
"org.w3c.dom"
] |
org.jasig.portal; org.w3c.dom;
| 546,249
|
public Map<String, Object> toMap()
{
final Map<String, Object> map = new TreeMap<String, Object>();
map.put("type", this.getType());
map.put("arguments", this.getArguments());
map.put("location", this.getLocation());
return map;
}
/**
* {@inheritDoc}
|
Map<String, Object> function() { final Map<String, Object> map = new TreeMap<String, Object>(); map.put("type", this.getType()); map.put(STR, this.getArguments()); map.put(STR, this.getLocation()); return map; } /** * {@inheritDoc}
|
/**
* This method creates a map representation of this struct.
*
* <p>
* Each key is the name of a field.
* Each value is the result of calling the key field's getter.
* </p>
*
* @return a map containing the entries in this struct.
*/
|
This method creates a map representation of this struct. Each key is the name of a field. Each value is the result of calling the key field's getter.
|
toMap
|
{
"repo_name": "Mackenzie-High/autumn",
"path": "src/autumn/lang/compiler/ast/nodes/NewExpression.java",
"license": "apache-2.0",
"size": 6877
}
|
[
"java.util.Map",
"java.util.TreeMap"
] |
import java.util.Map; import java.util.TreeMap;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,061,442
|
interface WithNatRuleCollections {
Update withNatRuleCollections(List<AzureFirewallNatRuleCollection> natRuleCollections);
}
|
interface WithNatRuleCollections { Update withNatRuleCollections(List<AzureFirewallNatRuleCollection> natRuleCollections); }
|
/**
* Specifies natRuleCollections.
* @param natRuleCollections Collection of NAT rule collections used by Azure Firewall
* @return the next update stage
*/
|
Specifies natRuleCollections
|
withNatRuleCollections
|
{
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2020_04_01/src/main/java/com/microsoft/azure/management/network/v2020_04_01/AzureFirewall.java",
"license": "mit",
"size": 15544
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,072,020
|
List<ActivityFile> getFiles();
|
List<ActivityFile> getFiles();
|
/**
* Get files of the activity.
*
* @return Files of the activity
*/
|
Get files of the activity
|
getFiles
|
{
"repo_name": "exodev/social",
"path": "component/core/src/main/java/org/exoplatform/social/core/activity/model/ExoSocialActivity.java",
"license": "lgpl-3.0",
"size": 7375
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,369,752
|
public void createLoop(final Vector2[] vertices, int count) {
assert (m_vertices == null && m_count == 0);
assert (count >= 3);
m_count = count + 1;
m_vertices = new Vector2[m_count];
for (int i = 1; i < count; i++) {
Vector2 v1 = vertices[i - 1];
Vector2 v2 = vertices[i];
// If the code crashes here, it means your vertices are too close
// together.
if (MathUtils.distanceSquared(v1, v2) < Settings.linearSlop_constraint
* Settings.linearSlop_constraint) {
throw new RuntimeException(
"Vertices of chain shape are too close together");
}
}
for (int i = 0; i < count; i++) {
m_vertices[i] = new Vector2(vertices[i]);
}
m_vertices[count] = new Vector2(m_vertices[0]);
m_prevVertex.set(m_vertices[m_count - 2]);
m_nextVertex.set(m_vertices[1]);
m_hasPrevVertex = true;
m_hasNextVertex = true;
}
|
void function(final Vector2[] vertices, int count) { assert (m_vertices == null && m_count == 0); assert (count >= 3); m_count = count + 1; m_vertices = new Vector2[m_count]; for (int i = 1; i < count; i++) { Vector2 v1 = vertices[i - 1]; Vector2 v2 = vertices[i]; if (MathUtils.distanceSquared(v1, v2) < Settings.linearSlop_constraint * Settings.linearSlop_constraint) { throw new RuntimeException( STR); } } for (int i = 0; i < count; i++) { m_vertices[i] = new Vector2(vertices[i]); } m_vertices[count] = new Vector2(m_vertices[0]); m_prevVertex.set(m_vertices[m_count - 2]); m_nextVertex.set(m_vertices[1]); m_hasPrevVertex = true; m_hasNextVertex = true; }
|
/**
* Create a loop. This automatically adjusts connectivity.
*
* @param vertices
* an array of vertices, these are copied
* @param count
* the vertex count
*/
|
Create a loop. This automatically adjusts connectivity
|
createLoop
|
{
"repo_name": "RedTriplane/RedTriplane",
"path": "r3-box2d-jd/src/org/jbox2d/d/collision/shapes/ChainShape.java",
"license": "unlicense",
"size": 8328
}
|
[
"org.jbox2d.d.common.MathUtils",
"org.jbox2d.d.common.Settings",
"org.jbox2d.d.common.Vector2"
] |
import org.jbox2d.d.common.MathUtils; import org.jbox2d.d.common.Settings; import org.jbox2d.d.common.Vector2;
|
import org.jbox2d.d.common.*;
|
[
"org.jbox2d.d"
] |
org.jbox2d.d;
| 928,276
|
@Test
public final void testOnDestroyPlayer() {
final Player pl = PlayerTestHelper.createPlayer("hugo");
pl.setAdminLevel(5000);
pl.clearEvents();
MockStendhalRPRuleProcessor.get().addPlayer(pl);
final RPAction action = new RPAction();
action.put("type", "destroy");
action.put("target", "hugo");
CommandCenter.execute(pl, action);
assertEquals("You can't remove players", pl.events().get(0).get("text"));
}
|
final void function() { final Player pl = PlayerTestHelper.createPlayer("hugo"); pl.setAdminLevel(5000); pl.clearEvents(); MockStendhalRPRuleProcessor.get().addPlayer(pl); final RPAction action = new RPAction(); action.put("type", STR); action.put(STR, "hugo"); CommandCenter.execute(pl, action); assertEquals(STR, pl.events().get(0).get("text")); }
|
/**
* Tests for onDestroyPlayer.
*/
|
Tests for onDestroyPlayer
|
testOnDestroyPlayer
|
{
"repo_name": "markuskeunecke/stendhal",
"path": "tests/games/stendhal/server/actions/AdministrationActionTest.java",
"license": "gpl-2.0",
"size": 28095
}
|
[
"games.stendhal.server.entity.player.Player",
"games.stendhal.server.maps.MockStendhalRPRuleProcessor",
"org.junit.Assert"
] |
import games.stendhal.server.entity.player.Player; import games.stendhal.server.maps.MockStendhalRPRuleProcessor; import org.junit.Assert;
|
import games.stendhal.server.entity.player.*; import games.stendhal.server.maps.*; import org.junit.*;
|
[
"games.stendhal.server",
"org.junit"
] |
games.stendhal.server; org.junit;
| 2,112,620
|
// because MiniSQL doesn't support negation, conversion to CNF is done
// simply by distributing the ORs over the ANDs; this is of course the
// naive method that causes the formula to grow exponentially
ArrayList<Predicate[]> cnf = new ArrayList<Predicate[]>();
// special property of CNF: the number of terms in each conjunct equals the
// number of original conjuncts (i.e. AND expressions); this should be the
// capacity of each inner array
cnf.add(new Predicate[children.length]);
// iterate through each AST_AndExpr child node
for (int i = 0; i < children.length; i++) {
// get the 'm' predicates connected by ANDs
AST_AndExpr child = (AST_AndExpr) children[i];
Predicate[] preds = child.getPredicates();
int m = preds.length;
// make 'm-1' copies of the current 'n' CNF sets
int n = cnf.size();
for (int j = 1; j < m; j++) {
for (int k = 0; k < n; k++) {
cnf.add(cnf.get(k).clone());
}
}
// merge each predicate with its own copy
for (int j = 0; j < m; j++) {
for (int k = 0; k < n; k++) {
// four variables, isn't it beautiful?
cnf.get(j * n + k)[i] = preds[j];
}
}
} // for i
// convert and return the resulting array
Predicate[][] ret = new Predicate[cnf.size()][];
for (int c = 0; c < ret.length; c++) {
ret[c] = cnf.get(c);
}
return ret;
} // protected Predicate[][] getCNF()
|
ArrayList<Predicate[]> cnf = new ArrayList<Predicate[]>(); cnf.add(new Predicate[children.length]); for (int i = 0; i < children.length; i++) { AST_AndExpr child = (AST_AndExpr) children[i]; Predicate[] preds = child.getPredicates(); int m = preds.length; int n = cnf.size(); for (int j = 1; j < m; j++) { for (int k = 0; k < n; k++) { cnf.add(cnf.get(k).clone()); } } for (int j = 0; j < m; j++) { for (int k = 0; k < n; k++) { cnf.get(j * n + k)[i] = preds[j]; } } } Predicate[][] ret = new Predicate[cnf.size()][]; for (int c = 0; c < ret.length; c++) { ret[c] = cnf.get(c); } return ret; }
|
/**
* Returns the CNF version of the expression rooted at this node.
*/
|
Returns the CNF version of the expression rooted at this node
|
getCNF
|
{
"repo_name": "wang159/CS541",
"path": "project_4/yu/src/parser/AST_OrExpr.java",
"license": "gpl-2.0",
"size": 2022
}
|
[
"java.util.ArrayList"
] |
import java.util.ArrayList;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 414,917
|
private void removeUnreferencedFunctionArgs(Scope fparamScope) {
// Notice that removing unreferenced function args breaks
// Function.prototype.length. In advanced mode, we don't really care
// about this: we consider "length" the equivalent of reflecting on
// the function's lexical source.
//
// Rather than create a new option for this, we assume that if the user
// is removing globals, then it's OK to remove unused function args.
//
// See http://blickly.github.io/closure-compiler-issues/#253
if (!removeGlobals) {
return;
}
Node function = fparamScope.getRootNode();
checkState(function.isFunction());
if (NodeUtil.isGetOrSetKey(function.getParent())) {
// The parameters object literal setters can not be removed.
return;
}
Node argList = NodeUtil.getFunctionParameters(function);
// Strip as many unreferenced args off the end of the function declaration as possible.
maybeRemoveUnusedTrailingParameters(argList, fparamScope);
// Mark any remaining unused parameters are unused to OptimizeParameters can try to remove
// them.
markUnusedParameters(argList, fparamScope);
}
|
void function(Scope fparamScope) { if (!removeGlobals) { return; } Node function = fparamScope.getRootNode(); checkState(function.isFunction()); if (NodeUtil.isGetOrSetKey(function.getParent())) { return; } Node argList = NodeUtil.getFunctionParameters(function); maybeRemoveUnusedTrailingParameters(argList, fparamScope); markUnusedParameters(argList, fparamScope); }
|
/**
* Removes unreferenced arguments from a function declaration and when
* possible the function's callSites.
*
* @param fparamScope The function parameter
*/
|
Removes unreferenced arguments from a function declaration and when possible the function's callSites
|
removeUnreferencedFunctionArgs
|
{
"repo_name": "Yannic/closure-compiler",
"path": "src/com/google/javascript/jscomp/RemoveUnusedCode.java",
"license": "apache-2.0",
"size": 107462
}
|
[
"com.google.common.base.Preconditions",
"com.google.javascript.rhino.Node"
] |
import com.google.common.base.Preconditions; import com.google.javascript.rhino.Node;
|
import com.google.common.base.*; import com.google.javascript.rhino.*;
|
[
"com.google.common",
"com.google.javascript"
] |
com.google.common; com.google.javascript;
| 1,074,920
|
void writeData(@NotNull Bytes inBytes, @NotNull Consumer<WireOut> c) {
outWire.writeDocument(false, out -> {
final long readPosition = inBytes.readPosition();
final long position = outWire.bytes().writePosition();
try {
c.accept(outWire);
} catch (Throwable t) {
inBytes.readPosition(readPosition);
LOG.info("While reading " + inBytes.toDebugString(), " processing wire " + c, t);
outWire.bytes().writePosition(position);
outWire.writeEventName(() -> "exception").throwable(t);
}
// write 'reply : {} ' if no data was sent
if (position == outWire.bytes().writePosition()) {
outWire.writeEventName(reply).marshallable(EMPTY);
}
});
if (YamlLogging.showServerWrites)
try {
System.out.println("server-writes:\n" +
Wires.fromSizePrefixedBlobs(outWire.bytes(), 0, outWire.bytes().writePosition()));
} catch (Exception e) {
System.out.println("server-writes:\n" +
outWire.bytes().toDebugString());
}
}
|
void writeData(@NotNull Bytes inBytes, @NotNull Consumer<WireOut> c) { outWire.writeDocument(false, out -> { final long readPosition = inBytes.readPosition(); final long position = outWire.bytes().writePosition(); try { c.accept(outWire); } catch (Throwable t) { inBytes.readPosition(readPosition); LOG.info(STR + inBytes.toDebugString(), STR + c, t); outWire.bytes().writePosition(position); outWire.writeEventName(() -> STR).throwable(t); } if (position == outWire.bytes().writePosition()) { outWire.writeEventName(reply).marshallable(EMPTY); } }); if (YamlLogging.showServerWrites) try { System.out.println(STR + Wires.fromSizePrefixedBlobs(outWire.bytes(), 0, outWire.bytes().writePosition())); } catch (Exception e) { System.out.println(STR + outWire.bytes().toDebugString()); } }
|
/**
* write and exceptions and rolls back if no data was written
*/
|
write and exceptions and rolls back if no data was written
|
writeData
|
{
"repo_name": "Jiten-Patel/Chronicle-Engine",
"path": "src/main/java/net/openhft/chronicle/engine/server/internal/AbstractHandler.java",
"license": "lgpl-3.0",
"size": 2279
}
|
[
"java.util.function.Consumer",
"net.openhft.chronicle.bytes.Bytes",
"net.openhft.chronicle.wire.WireOut",
"net.openhft.chronicle.wire.Wires",
"net.openhft.chronicle.wire.YamlLogging",
"org.jetbrains.annotations.NotNull"
] |
import java.util.function.Consumer; import net.openhft.chronicle.bytes.Bytes; import net.openhft.chronicle.wire.WireOut; import net.openhft.chronicle.wire.Wires; import net.openhft.chronicle.wire.YamlLogging; import org.jetbrains.annotations.NotNull;
|
import java.util.function.*; import net.openhft.chronicle.bytes.*; import net.openhft.chronicle.wire.*; import org.jetbrains.annotations.*;
|
[
"java.util",
"net.openhft.chronicle",
"org.jetbrains.annotations"
] |
java.util; net.openhft.chronicle; org.jetbrains.annotations;
| 2,740,667
|
public static String getObjCType(ITypeBinding type) {
return getObjCTypeInner(type, null, false);
}
|
static String function(ITypeBinding type) { return getObjCTypeInner(type, null, false); }
|
/**
* Convert a Java type to an equivalent Objective-C type with type variables
* converted to "id" regardless of their bounds.
*/
|
Convert a Java type to an equivalent Objective-C type with type variables converted to "id" regardless of their bounds
|
getObjCType
|
{
"repo_name": "jiachenning/j2objc",
"path": "translator/src/main/java/com/google/devtools/j2objc/util/NameTable.java",
"license": "apache-2.0",
"size": 27742
}
|
[
"org.eclipse.jdt.core.dom.ITypeBinding"
] |
import org.eclipse.jdt.core.dom.ITypeBinding;
|
import org.eclipse.jdt.core.dom.*;
|
[
"org.eclipse.jdt"
] |
org.eclipse.jdt;
| 1,874,593
|
scale *= detector.getScaleFactor();
if (scale < 1) {
scale = 1; // Don't let the scale be less than one
}
labelPaint.setTextSize(scale * 5);
invalidate(); // Force the view to redraw itself
return true;
}
}
private Paint piecePaint, // Paint for drawing the piece outline normally
dimPaint, // Paint for writing the dimension and drawing dimLines
labelPaint, // Paint for writing piece labels
underPaint,
underFillPaint,
selectFillPaint;
private float scale, // Graphical scale
xPad = 50, // Graphical horizontal offset
yPad = 50, // Graphical vertical offset
lastTouchX, lastTouchY;
private int activePointerId = -1; // For use in gesture detection
private ScaleGestureDetector mScaleDetector;
private CanDraw toDraw; // The set piece being built
public CustomDrawableView(Context context, AttributeSet attr) {
super(context, attr);
piecePaint = new Paint();
piecePaint.setColor(Color.RED);
dimPaint = new Paint();
dimPaint.setTextSize(24);
dimPaint.setColor(Color.WHITE);
labelPaint = new Paint();
labelPaint.setTextSize(18);
labelPaint.setColor(Color.GRAY);
underPaint = new Paint();
underPaint.setColor(Color.MAGENTA);
underFillPaint = new Paint();
underFillPaint.setColor(Color.GRAY);
selectFillPaint = new Paint();
selectFillPaint.setARGB(127, 54, 102, 201);
mScaleDetector = new ScaleGestureDetector(context, new ScaleListener());
}
|
scale *= detector.getScaleFactor(); if (scale < 1) { scale = 1; } labelPaint.setTextSize(scale * 5); invalidate(); return true; } } private Paint piecePaint, dimPaint, labelPaint, underPaint, underFillPaint, selectFillPaint; private float scale, xPad = 50, yPad = 50, lastTouchX, lastTouchY; private int activePointerId = -1; private ScaleGestureDetector mScaleDetector; private CanDraw toDraw; public CustomDrawableView(Context context, AttributeSet attr) { super(context, attr); piecePaint = new Paint(); piecePaint.setColor(Color.RED); dimPaint = new Paint(); dimPaint.setTextSize(24); dimPaint.setColor(Color.WHITE); labelPaint = new Paint(); labelPaint.setTextSize(18); labelPaint.setColor(Color.GRAY); underPaint = new Paint(); underPaint.setColor(Color.MAGENTA); underFillPaint = new Paint(); underFillPaint.setColor(Color.GRAY); selectFillPaint = new Paint(); selectFillPaint.setARGB(127, 54, 102, 201); mScaleDetector = new ScaleGestureDetector(context, new ScaleListener()); }
|
/**
* Change the scale for the graphics.
*/
|
Change the scale for the graphics
|
onScale
|
{
"repo_name": "zgrannan/Technical-Theatre-Assistant",
"path": "src/com/zgrannan/crewandroid/CustomDrawableView.java",
"license": "mit",
"size": 16724
}
|
[
"android.content.Context",
"android.graphics.Color",
"android.graphics.Paint",
"android.util.AttributeSet",
"android.view.ScaleGestureDetector"
] |
import android.content.Context; import android.graphics.Color; import android.graphics.Paint; import android.util.AttributeSet; import android.view.ScaleGestureDetector;
|
import android.content.*; import android.graphics.*; import android.util.*; import android.view.*;
|
[
"android.content",
"android.graphics",
"android.util",
"android.view"
] |
android.content; android.graphics; android.util; android.view;
| 2,780,149
|
EClass getSegmentChildren();
|
EClass getSegmentChildren();
|
/**
* Returns the meta object for class '{@link org.fusesource.camel.component.sap.model.idoc.SegmentChildren <em>Segment Children</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for class '<em>Segment Children</em>'.
* @see org.fusesource.camel.component.sap.model.idoc.SegmentChildren
* @generated
*/
|
Returns the meta object for class '<code>org.fusesource.camel.component.sap.model.idoc.SegmentChildren Segment Children</code>'.
|
getSegmentChildren
|
{
"repo_name": "DaemonSu/fuse-master",
"path": "components/camel-sap/org.fusesource.camel.component.sap.model/src/org/fusesource/camel/component/sap/model/idoc/IdocPackage.java",
"license": "apache-2.0",
"size": 63339
}
|
[
"org.eclipse.emf.ecore.EClass"
] |
import org.eclipse.emf.ecore.EClass;
|
import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 106,706
|
EAttribute getAnimateMotionType_End();
|
EAttribute getAnimateMotionType_End();
|
/**
* Returns the meta object for the attribute '{@link org.w3._2001.smil20.language.AnimateMotionType#getEnd <em>End</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>End</em>'.
* @see org.w3._2001.smil20.language.AnimateMotionType#getEnd()
* @see #getAnimateMotionType()
* @generated
*/
|
Returns the meta object for the attribute '<code>org.w3._2001.smil20.language.AnimateMotionType#getEnd End</code>'.
|
getAnimateMotionType_End
|
{
"repo_name": "geotools/geotools",
"path": "modules/ogc/net.opengis.wmts/src/org/w3/_2001/smil20/language/LanguagePackage.java",
"license": "lgpl-2.1",
"size": 137841
}
|
[
"org.eclipse.emf.ecore.EAttribute"
] |
import org.eclipse.emf.ecore.EAttribute;
|
import org.eclipse.emf.ecore.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 1,284,528
|
boolean isAssetLocked(List<Long> assetNumbers, String documentTypeName, String excludingDocumentNumber);
|
boolean isAssetLocked(List<Long> assetNumbers, String documentTypeName, String excludingDocumentNumber);
|
/**
* Check if the given asset Numbers are locked by other documents already.
*
* @param assetNumbers
* @param documentTypeName
* @param excludingDocumentNumber
* @return
*/
|
Check if the given asset Numbers are locked by other documents already
|
isAssetLocked
|
{
"repo_name": "quikkian-ua-devops/will-financials",
"path": "kfs-core/src/main/java/org/kuali/kfs/integration/cam/CapitalAssetManagementModuleService.java",
"license": "agpl-3.0",
"size": 10154
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,929,046
|
public static Decision permit(int privilegeId, User user,
Object businessData, Map context) {
if (context == null) {
context = new HashMap();
}
EntitleManager entitleManager = Factory.getEntitleManager(appName);
context.put(SystemConstant.BUSINESS_DATA, businessData);
return entitleManager.permit(Locale.US, privilegeId, user, context);
}
|
static Decision function(int privilegeId, User user, Object businessData, Map context) { if (context == null) { context = new HashMap(); } EntitleManager entitleManager = Factory.getEntitleManager(appName); context.put(SystemConstant.BUSINESS_DATA, businessData); return entitleManager.permit(Locale.US, privilegeId, user, context); }
|
/**
* Eval decision policy, return decision result.
*
* @param privilegeId privilegeId
* @param user who requests for this operation
* @param businessData the business data
* @param context context
* @return decision result
*/
|
Eval decision policy, return decision result
|
permit
|
{
"repo_name": "colddew/ralasafe",
"path": "ralasafe-engine/src/main/java/org/ralasafe/Ralasafe.java",
"license": "mit",
"size": 6306
}
|
[
"java.util.HashMap",
"java.util.Locale",
"java.util.Map",
"org.ralasafe.SystemConstant",
"org.ralasafe.entitle.Decision",
"org.ralasafe.entitle.EntitleManager",
"org.ralasafe.user.User"
] |
import java.util.HashMap; import java.util.Locale; import java.util.Map; import org.ralasafe.SystemConstant; import org.ralasafe.entitle.Decision; import org.ralasafe.entitle.EntitleManager; import org.ralasafe.user.User;
|
import java.util.*; import org.ralasafe.*; import org.ralasafe.entitle.*; import org.ralasafe.user.*;
|
[
"java.util",
"org.ralasafe",
"org.ralasafe.entitle",
"org.ralasafe.user"
] |
java.util; org.ralasafe; org.ralasafe.entitle; org.ralasafe.user;
| 2,824,095
|
@Override
public RecoveryState recoveryState() {
return this.recoveryState;
}
|
RecoveryState function() { return this.recoveryState; }
|
/**
* Returns the current {@link RecoveryState} if this shard is recovering or has been recovering.
* Returns null if the recovery has not yet started or shard was not recovered (created via an API).
*/
|
Returns the current <code>RecoveryState</code> if this shard is recovering or has been recovering. Returns null if the recovery has not yet started or shard was not recovered (created via an API)
|
recoveryState
|
{
"repo_name": "HonzaKral/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/index/shard/IndexShard.java",
"license": "apache-2.0",
"size": 171709
}
|
[
"org.elasticsearch.indices.recovery.RecoveryState"
] |
import org.elasticsearch.indices.recovery.RecoveryState;
|
import org.elasticsearch.indices.recovery.*;
|
[
"org.elasticsearch.indices"
] |
org.elasticsearch.indices;
| 982,334
|
public static BreakIterator getWordInstance(Locale where)
{
return getBreakInstance(ULocale.forLocale(where), KIND_WORD);
}
|
static BreakIterator function(Locale where) { return getBreakInstance(ULocale.forLocale(where), KIND_WORD); }
|
/**
* Returns a new instance of BreakIterator that locates word boundaries.
* @param where A locale specifying the language of the text to be
* analyzed.
* @return An instance of BreakIterator that locates word boundaries.
* @throws NullPointerException if <code>where</code> is null.
*/
|
Returns a new instance of BreakIterator that locates word boundaries
|
getWordInstance
|
{
"repo_name": "life-beam/j2objc",
"path": "jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/BreakIterator.java",
"license": "apache-2.0",
"size": 39981
}
|
[
"android.icu.util.ULocale",
"java.util.Locale"
] |
import android.icu.util.ULocale; import java.util.Locale;
|
import android.icu.util.*; import java.util.*;
|
[
"android.icu",
"java.util"
] |
android.icu; java.util;
| 716,236
|
protected final int shiftKeys( int pos ) {
// Shift entries with the same hash.
int last, slot;
for(;;) {
pos = ( ( last = pos ) + 1 ) & mask;
while( used[ pos ] ) {
slot = (int)it.unimi.dsi.fastutil.HashCommon.murmurHash3(key[ pos ]) & mask;
if ( last <= pos ? last >= slot || slot > pos : last >= slot && slot > pos ) break;
pos = ( pos + 1 ) & mask;
}
if ( ! used[ pos ] ) break;
key[ last ] = key[ pos ];
fixPointers( pos, last );
}
used[ last ] = false;
return last;
}
|
final int function( int pos ) { int last, slot; for(;;) { pos = ( ( last = pos ) + 1 ) & mask; while( used[ pos ] ) { slot = (int)it.unimi.dsi.fastutil.HashCommon.murmurHash3(key[ pos ]) & mask; if ( last <= pos ? last >= slot slot > pos : last >= slot && slot > pos ) break; pos = ( pos + 1 ) & mask; } if ( ! used[ pos ] ) break; key[ last ] = key[ pos ]; fixPointers( pos, last ); } used[ last ] = false; return last; }
|
/** Shifts left entries with the specified hash code, starting at the specified position,
* and empties the resulting free entry.
*
* @param pos a starting position.
* @return the position cleared by the shifting process.
*/
|
Shifts left entries with the specified hash code, starting at the specified position, and empties the resulting free entry
|
shiftKeys
|
{
"repo_name": "karussell/fastutil",
"path": "src/it/unimi/dsi/fastutil/longs/LongLinkedOpenHashSet.java",
"license": "apache-2.0",
"size": 32559
}
|
[
"it.unimi.dsi.fastutil.HashCommon"
] |
import it.unimi.dsi.fastutil.HashCommon;
|
import it.unimi.dsi.fastutil.*;
|
[
"it.unimi.dsi"
] |
it.unimi.dsi;
| 2,319,102
|
jScrollPane1 = new javax.swing.JScrollPane();
String[] colunas = {"Cliente", "Quantidade"};
List<ObjectRelatorioContador> objectR = (new RelatorioDAOBD()).clientesQueMaisCompraram();
modelo = new RelatorioModelo2(colunas, objectR);
jTable1 = new javax.swing.JTable();
jLabel1 = new javax.swing.JLabel();
jTable1.setModel(modelo);
jScrollPane1.setViewportView(jTable1);
jLabel1.setFont(new java.awt.Font("Arial", 0, 16)); // NOI18N
jLabel1.setText("Clientes que Mais Compraram");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(25, Short.MAX_VALUE)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 375, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(25, 25, 25))
.addGroup(layout.createSequentialGroup()
.addGap(100, 100, 100)
.addComponent(jLabel1)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 275, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(25, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel jLabel1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTable jTable1;
// End of variables declaration//GEN-END:variables
private RelatorioModelo2 modelo;
|
jScrollPane1 = new javax.swing.JScrollPane(); String[] colunas = {STR, STR}; List<ObjectRelatorioContador> objectR = (new RelatorioDAOBD()).clientesQueMaisCompraram(); modelo = new RelatorioModelo2(colunas, objectR); jTable1 = new javax.swing.JTable(); jLabel1 = new javax.swing.JLabel(); jTable1.setModel(modelo); jScrollPane1.setViewportView(jTable1); jLabel1.setFont(new java.awt.Font("Arial", 0, 16)); jLabel1.setText(STR); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap(25, Short.MAX_VALUE) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 375, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(25, 25, 25)) .addGroup(layout.createSequentialGroup() .addGap(100, 100, 100) .addComponent(jLabel1) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 275, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(25, Short.MAX_VALUE)) ); } private javax.swing.JLabel jLabel1; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTable jTable1; private RelatorioModelo2 modelo;
|
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
|
This method is called from within the constructor to initialize the form. regenerated by the Form Editor
|
initComponents
|
{
"repo_name": "kstkelvin/crud-tema-iv",
"path": "src/view/RelatorioPanel3.java",
"license": "epl-1.0",
"size": 3129
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,123,707
|
double discharge(ItemStack stack, double amount, int tier, boolean ignoreTransferLimit, boolean externally, boolean simulate);
|
double discharge(ItemStack stack, double amount, int tier, boolean ignoreTransferLimit, boolean externally, boolean simulate);
|
/**
* Discharge an item by a specified amount of energy
*
* @param stack electric item's stack
* @param amount amount of energy to discharge in EU
* @param tier tier of the discharging device, has to be at least as high as the item to discharge
* @param ignoreTransferLimit ignore the transfer limit specified by getTransferLimit()
* @param externally use the supplied item externally, i.e. to power something else as if it was a battery
* @param simulate don't actually discharge the item, just determine the return value
* @return Energy retrieved from the electric item
*/
|
Discharge an item by a specified amount of energy
|
discharge
|
{
"repo_name": "planetguy32/TurboCraftingTable",
"path": "src/api/java/ic2/api/item/IElectricItemManager.java",
"license": "mit",
"size": 3995
}
|
[
"net.minecraft.item.ItemStack"
] |
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.*;
|
[
"net.minecraft.item"
] |
net.minecraft.item;
| 2,418,798
|
public PreUpdate<Entity<T>> getOrCreatePreUpdate()
{
Node node = childNode.getOrCreate("pre-update");
PreUpdate<Entity<T>> preUpdate = new PreUpdateImpl<Entity<T>>(this, "pre-update", childNode, node);
return preUpdate;
}
|
PreUpdate<Entity<T>> function() { Node node = childNode.getOrCreate(STR); PreUpdate<Entity<T>> preUpdate = new PreUpdateImpl<Entity<T>>(this, STR, childNode, node); return preUpdate; }
|
/**
* If not already created, a new <code>pre-update</code> element with the given value will be created.
* Otherwise, the existing <code>pre-update</code> element will be returned.
* @return a new or existing instance of <code>PreUpdate<Entity<T>></code>
*/
|
If not already created, a new <code>pre-update</code> element with the given value will be created. Otherwise, the existing <code>pre-update</code> element will be returned
|
getOrCreatePreUpdate
|
{
"repo_name": "forge/javaee-descriptors",
"path": "impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/orm10/EntityImpl.java",
"license": "epl-1.0",
"size": 47108
}
|
[
"org.jboss.shrinkwrap.descriptor.api.orm10.Entity",
"org.jboss.shrinkwrap.descriptor.api.orm10.PreUpdate",
"org.jboss.shrinkwrap.descriptor.spi.node.Node"
] |
import org.jboss.shrinkwrap.descriptor.api.orm10.Entity; import org.jboss.shrinkwrap.descriptor.api.orm10.PreUpdate; import org.jboss.shrinkwrap.descriptor.spi.node.Node;
|
import org.jboss.shrinkwrap.descriptor.api.orm10.*; import org.jboss.shrinkwrap.descriptor.spi.node.*;
|
[
"org.jboss.shrinkwrap"
] |
org.jboss.shrinkwrap;
| 1,769,125
|
public static java.util.Set extractInvestigationSet(ims.domain.ILightweightDomainFactory domainFactory, ims.ocrr.vo.InvestigationLiteVoCollection voCollection)
{
return extractInvestigationSet(domainFactory, voCollection, null, new HashMap());
}
|
static java.util.Set function(ims.domain.ILightweightDomainFactory domainFactory, ims.ocrr.vo.InvestigationLiteVoCollection voCollection) { return extractInvestigationSet(domainFactory, voCollection, null, new HashMap()); }
|
/**
* Create the ims.ocrr.configuration.domain.objects.Investigation set from the value object collection.
* @param domainFactory - used to create existing (persistent) domain objects.
* @param voCollection - the collection of value objects
*/
|
Create the ims.ocrr.configuration.domain.objects.Investigation set from the value object collection
|
extractInvestigationSet
|
{
"repo_name": "open-health-hub/openMAXIMS",
"path": "openmaxims_workspace/ValueObjects/src/ims/ocrr/vo/domain/InvestigationLiteVoAssembler.java",
"license": "agpl-3.0",
"size": 18864
}
|
[
"java.util.HashMap"
] |
import java.util.HashMap;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,672,279
|
public List<String> getAllTables() throws HiveException {
return getAllTables(SessionState.get().getCurrentDatabase());
}
|
List<String> function() throws HiveException { return getAllTables(SessionState.get().getCurrentDatabase()); }
|
/**
* Get all table names for the current database.
* @return List of table names
* @throws HiveException
*/
|
Get all table names for the current database
|
getAllTables
|
{
"repo_name": "wangbin83-gmail-com/hive-1.1.0-cdh5.4.8",
"path": "ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java",
"license": "apache-2.0",
"size": 117422
}
|
[
"java.util.List",
"org.apache.hadoop.hive.ql.session.SessionState"
] |
import java.util.List; import org.apache.hadoop.hive.ql.session.SessionState;
|
import java.util.*; import org.apache.hadoop.hive.ql.session.*;
|
[
"java.util",
"org.apache.hadoop"
] |
java.util; org.apache.hadoop;
| 1,549,335
|
public int executeUpdate(String sql) throws SQLException {
return executeUpdate(sql, Statement.NO_GENERATED_KEYS);
}
|
int function(String sql) throws SQLException { return executeUpdate(sql, Statement.NO_GENERATED_KEYS); }
|
/**
* To execute a DML statement
*
* @param sql - SQL Query
* @return Rows Affected Count
*/
|
To execute a DML statement
|
executeUpdate
|
{
"repo_name": "enisoc/vitess",
"path": "java/jdbc/src/main/java/io/vitess/jdbc/VitessStatement.java",
"license": "apache-2.0",
"size": 23462
}
|
[
"java.sql.SQLException",
"java.sql.Statement"
] |
import java.sql.SQLException; import java.sql.Statement;
|
import java.sql.*;
|
[
"java.sql"
] |
java.sql;
| 1,881,927
|
public void testGetName()
{
LinearDynamicalSystem evaluator = new LinearDynamicalSystem(
MatrixFactory.getDefault().createUniformRandom(2, 2, 0.0, 1.0, random),
MatrixFactory.getDefault().createUniformRandom(2, 2, 0.0, 1.0, random));
EvaluatorBasedCognitiveModuleSettings<Vector, Vector> settings =
new EvaluatorBasedCognitiveModuleSettings<Vector, Vector>(
evaluator,
new CogxelVectorConverter(), new CogxelVectorConverter());
CognitiveModelFactory modelFactory = new CognitiveModelLiteFactory();
String name = "Module Name";
StatefulEvaluatorBasedCognitiveModule<Vector, Vector> instance =
new StatefulEvaluatorBasedCognitiveModule<Vector, Vector>(
modelFactory.createModel(), settings, name);
assertEquals(name, instance.getName());
}
|
void function() { LinearDynamicalSystem evaluator = new LinearDynamicalSystem( MatrixFactory.getDefault().createUniformRandom(2, 2, 0.0, 1.0, random), MatrixFactory.getDefault().createUniformRandom(2, 2, 0.0, 1.0, random)); EvaluatorBasedCognitiveModuleSettings<Vector, Vector> settings = new EvaluatorBasedCognitiveModuleSettings<Vector, Vector>( evaluator, new CogxelVectorConverter(), new CogxelVectorConverter()); CognitiveModelFactory modelFactory = new CognitiveModelLiteFactory(); String name = STR; StatefulEvaluatorBasedCognitiveModule<Vector, Vector> instance = new StatefulEvaluatorBasedCognitiveModule<Vector, Vector>( modelFactory.createModel(), settings, name); assertEquals(name, instance.getName()); }
|
/**
* Test of getName method, of class gov.sandia.cognition.framework.learning.StatefulEvaluatorBasedCognitiveModule.
*/
|
Test of getName method, of class gov.sandia.cognition.framework.learning.StatefulEvaluatorBasedCognitiveModule
|
testGetName
|
{
"repo_name": "codeaudit/Foundry",
"path": "Components/FrameworkLearning/Test/gov/sandia/cognition/framework/learning/StatefulEvaluatorBasedCognitiveModuleTest.java",
"license": "bsd-3-clause",
"size": 10832
}
|
[
"gov.sandia.cognition.framework.CognitiveModelFactory",
"gov.sandia.cognition.framework.learning.converter.CogxelVectorConverter",
"gov.sandia.cognition.framework.lite.CognitiveModelLiteFactory",
"gov.sandia.cognition.math.matrix.MatrixFactory",
"gov.sandia.cognition.math.matrix.Vector",
"gov.sandia.cognition.math.signals.LinearDynamicalSystem"
] |
import gov.sandia.cognition.framework.CognitiveModelFactory; import gov.sandia.cognition.framework.learning.converter.CogxelVectorConverter; import gov.sandia.cognition.framework.lite.CognitiveModelLiteFactory; import gov.sandia.cognition.math.matrix.MatrixFactory; import gov.sandia.cognition.math.matrix.Vector; import gov.sandia.cognition.math.signals.LinearDynamicalSystem;
|
import gov.sandia.cognition.framework.*; import gov.sandia.cognition.framework.learning.converter.*; import gov.sandia.cognition.framework.lite.*; import gov.sandia.cognition.math.matrix.*; import gov.sandia.cognition.math.signals.*;
|
[
"gov.sandia.cognition"
] |
gov.sandia.cognition;
| 2,530,992
|
public static Image getImage(String path) {
return new Image(Display.getDefault(), getImageDescriptor(path)
.getImageData());
}
|
static Image function(String path) { return new Image(Display.getDefault(), getImageDescriptor(path) .getImageData()); }
|
/**
* Returns an image from the file at the given plug-in relative path.
*
* @param path
* @return image; the returned image <b>MUST be disposed after usage</b> to
* free up memory
*/
|
Returns an image from the file at the given plug-in relative path
|
getImage
|
{
"repo_name": "bkahlert/api-usability-analyzer",
"path": "de.fu_berlin.imp.apiua.entity/src/de/fu_berlin/imp/apiua/entity/ui/ImageManager.java",
"license": "mit",
"size": 9272
}
|
[
"org.eclipse.swt.graphics.Image",
"org.eclipse.swt.widgets.Display"
] |
import org.eclipse.swt.graphics.Image; import org.eclipse.swt.widgets.Display;
|
import org.eclipse.swt.graphics.*; import org.eclipse.swt.widgets.*;
|
[
"org.eclipse.swt"
] |
org.eclipse.swt;
| 795,525
|
public AlertDialog getFullLogDialog() {
return getDialog(true);
}
|
AlertDialog function() { return getDialog(true); }
|
/**
* Get a dialog with the full change log.
*
* @return An AlertDialog with a full change log displayed.
*/
|
Get a dialog with the full change log
|
getFullLogDialog
|
{
"repo_name": "sachin1092/The-Weather-App",
"path": "app/src/main/java/com/sachinshinde/theweatherapp/utils/ChangeLog.java",
"license": "apache-2.0",
"size": 15326
}
|
[
"android.app.AlertDialog"
] |
import android.app.AlertDialog;
|
import android.app.*;
|
[
"android.app"
] |
android.app;
| 1,925,103
|
void setSession(ISession session);
|
void setSession(ISession session);
|
/**
* Sets the session object this handshaker is associated with.
*
* @param session the session object
*/
|
Sets the session object this handshaker is associated with
|
setSession
|
{
"repo_name": "snf4j/snf4j",
"path": "snf4j-websocket/src/main/java/org/snf4j/websocket/handshake/IHandshaker.java",
"license": "mit",
"size": 4476
}
|
[
"org.snf4j.core.session.ISession"
] |
import org.snf4j.core.session.ISession;
|
import org.snf4j.core.session.*;
|
[
"org.snf4j.core"
] |
org.snf4j.core;
| 1,592,303
|
public Observable<ServiceResponse<Page<VirtualHubInner>>> listNextSinglePageAsync(final String nextPageLink) {
if (nextPageLink == null) {
throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
}
|
Observable<ServiceResponse<Page<VirtualHubInner>>> function(final String nextPageLink) { if (nextPageLink == null) { throw new IllegalArgumentException(STR); }
|
/**
* Lists all the VirtualHubs in a subscription.
*
ServiceResponse<PageImpl<VirtualHubInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<VirtualHubInner> object wrapped in {@link ServiceResponse} if successful.
*/
|
Lists all the VirtualHubs in a subscription
|
listNextSinglePageAsync
|
{
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/VirtualHubsInner.java",
"license": "mit",
"size": 72294
}
|
[
"com.microsoft.azure.Page",
"com.microsoft.rest.ServiceResponse"
] |
import com.microsoft.azure.Page; import com.microsoft.rest.ServiceResponse;
|
import com.microsoft.azure.*; import com.microsoft.rest.*;
|
[
"com.microsoft.azure",
"com.microsoft.rest"
] |
com.microsoft.azure; com.microsoft.rest;
| 332,729
|
public Date getOccurTime() {
return this.occurTime;
}
|
Date function() { return this.occurTime; }
|
/**
* <p>Getter for the field <code>occurTime</code>.</p>
*
* @return a {@link java.util.Date} object.
*/
|
Getter for the field <code>occurTime</code>
|
getOccurTime
|
{
"repo_name": "NotFound403/WePay",
"path": "src/main/java/cn/felord/wepay/ali/sdk/api/domain/AlipayMarketingCardUpdateModel.java",
"license": "apache-2.0",
"size": 5138
}
|
[
"java.util.Date"
] |
import java.util.Date;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,763,106
|
@Override
public synchronized void addChangeListener(ChangeListener listener)
{
changeListenerList.add(listener);
}
|
synchronized void function(ChangeListener listener) { changeListenerList.add(listener); }
|
/**
* Registers ChangeListener to receive events.
* @param listener The listener to register.
*/
|
Registers ChangeListener to receive events
|
addChangeListener
|
{
"repo_name": "IcmVis/VisNow-Pro",
"path": "src/pl/edu/icm/visnow/lib/basic/mappers/SegmentedSurfaces/Params.java",
"license": "gpl-3.0",
"size": 7466
}
|
[
"javax.swing.event.ChangeListener"
] |
import javax.swing.event.ChangeListener;
|
import javax.swing.event.*;
|
[
"javax.swing"
] |
javax.swing;
| 2,531,660
|
ListenableFuture<TaskStatus> run(Task task);
|
ListenableFuture<TaskStatus> run(Task task);
|
/**
* Run a task. The returned status should be some kind of completed status.
*
* @param task task to run
*
* @return task status, eventually
*/
|
Run a task. The returned status should be some kind of completed status
|
run
|
{
"repo_name": "knoguchi/druid",
"path": "indexing-service/src/main/java/org/apache/druid/indexing/overlord/TaskRunner.java",
"license": "apache-2.0",
"size": 4096
}
|
[
"com.google.common.util.concurrent.ListenableFuture",
"org.apache.druid.indexer.TaskStatus",
"org.apache.druid.indexing.common.task.Task"
] |
import com.google.common.util.concurrent.ListenableFuture; import org.apache.druid.indexer.TaskStatus; import org.apache.druid.indexing.common.task.Task;
|
import com.google.common.util.concurrent.*; import org.apache.druid.indexer.*; import org.apache.druid.indexing.common.task.*;
|
[
"com.google.common",
"org.apache.druid"
] |
com.google.common; org.apache.druid;
| 1,584,368
|
public void setUserData(String userId, String token) {
MobileServiceUser user = new MobileServiceUser(userId);
user.setAuthenticationToken(token);
mClient.setCurrentUser(user);
//Check for custom provider
String provider = userId.substring(0, userId.indexOf(":"));
if (provider.equals("Custom")) {
mProvider = null;
mIsCustomAuthProvider = true;
} else if (provider.equals("Facebook"))
mProvider = MobileServiceAuthenticationProvider.Facebook;
else if (provider.equals("Twitter"))
mProvider = MobileServiceAuthenticationProvider.Twitter;
else if (provider.equals("MicrosoftAccount"))
mProvider = MobileServiceAuthenticationProvider.MicrosoftAccount;
else if (provider.equals("Google"))
mProvider = MobileServiceAuthenticationProvider.Google;
}
|
void function(String userId, String token) { MobileServiceUser user = new MobileServiceUser(userId); user.setAuthenticationToken(token); mClient.setCurrentUser(user); String provider = userId.substring(0, userId.indexOf(":")); if (provider.equals(STR)) { mProvider = null; mIsCustomAuthProvider = true; } else if (provider.equals(STR)) mProvider = MobileServiceAuthenticationProvider.Facebook; else if (provider.equals(STR)) mProvider = MobileServiceAuthenticationProvider.Twitter; else if (provider.equals(STR)) mProvider = MobileServiceAuthenticationProvider.MicrosoftAccount; else if (provider.equals(STR)) mProvider = MobileServiceAuthenticationProvider.Google; }
|
/**
* Creates a nwe MobileServiceUser using a userId and token passed in.
* Also sets the current provider
* @param userId
* @param token
*/
|
Creates a nwe MobileServiceUser using a userId and token passed in. Also sets the current provider
|
setUserData
|
{
"repo_name": "aswinvijay/Android-MobileServices-Authentication",
"path": "source/client/AuthenticationDemo/src/com/msdpe/authenticationdemo/AuthService.java",
"license": "apache-2.0",
"size": 12307
}
|
[
"com.microsoft.windowsazure.mobileservices.MobileServiceAuthenticationProvider",
"com.microsoft.windowsazure.mobileservices.MobileServiceUser"
] |
import com.microsoft.windowsazure.mobileservices.MobileServiceAuthenticationProvider; import com.microsoft.windowsazure.mobileservices.MobileServiceUser;
|
import com.microsoft.windowsazure.mobileservices.*;
|
[
"com.microsoft.windowsazure"
] |
com.microsoft.windowsazure;
| 1,975,119
|
private static void applyWindows() {
if (windowsUpgradeCommands != null) {
try {
File tmp = File.createTempFile("rap-upd", ".bat");
BufferedWriter fout = new BufferedWriter(new FileWriter(tmp));
String cd = System.getProperty("user.dir");
fout.write("@echo off\r\n");
fout.write(cd.substring(0, 2) + "\r\ncd " + cd.substring(2)
+ "\r\n");
for (String cmd : windowsUpgradeCommands) {
fout.write(cmd + "\r\n");
}
fout.close();
Process p;
if (isLikelyWindowsVistaOrLater) {
p = Runtime.getRuntime().exec(
new String[] { "elevate", "-wait", "cmd", "/c",
tmp.getAbsolutePath() });
} else {
p = Runtime.getRuntime().exec(new String[] { "cmd", "/c",
tmp.getAbsolutePath() });
}
p.waitFor();
tmp.delete();
} catch (Exception e) {
e.printStackTrace();
}
}
}
|
static void function() { if (windowsUpgradeCommands != null) { try { File tmp = File.createTempFile(STR, ".bat"); BufferedWriter fout = new BufferedWriter(new FileWriter(tmp)); String cd = System.getProperty(STR); fout.write(STR); fout.write(cd.substring(0, 2) + STR + cd.substring(2) + "\r\n"); for (String cmd : windowsUpgradeCommands) { fout.write(cmd + "\r\n"); } fout.close(); Process p; if (isLikelyWindowsVistaOrLater) { p = Runtime.getRuntime().exec( new String[] { STR, "-wait", "cmd", "/c", tmp.getAbsolutePath() }); } else { p = Runtime.getRuntime().exec(new String[] { "cmd", "/c", tmp.getAbsolutePath() }); } p.waitFor(); tmp.delete(); } catch (Exception e) { e.printStackTrace(); } } }
|
/**
* Write the list of move commands to a batch file, then execute it with
* elevated privileges. This way, we only have to elevate once.
*/
|
Write the list of move commands to a batch file, then execute it with elevated privileges. This way, we only have to elevate once
|
applyWindows
|
{
"repo_name": "ddugovic/raptor-chess-interface",
"path": "raptor/src/raptor/updater/UpdateManager.java",
"license": "bsd-3-clause",
"size": 10360
}
|
[
"java.io.BufferedWriter",
"java.io.File",
"java.io.FileWriter"
] |
import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter;
|
import java.io.*;
|
[
"java.io"
] |
java.io;
| 873,746
|
public void draw(Graphics g) {
double maxLabelLength, maxLabelHeight;
int numLines, numRows, i;
float vectorLength;
float vectorLengthU;
int col, row, ytemp;
double xloc, labelSpace, scaleSpace, scaleLength;
double[] xp, yp;
int[] xd, yd;
int[] xout, yout;
float hx1, hx2;
float hy1, hy2;
float headX, headY;
float orgX, orgY;
float xphead, yphead;
float tScale, fixedScale;
float scale;
float headScale;
float minSize;
float maxSize;
Rectangle bounds;
VectorCartesianRenderer render = null;
SGLabel label;
SGLabel scaleLabel;
String scaleStr;
VectorAttribute attr = null;
Graphics2D g2 = (Graphics2D)g;
GeneralPath gp;
Stroke savedStroke = g2.getStroke();
BasicStroke stroke;
slope_ = (float)layer_.getXSlope();
xoff_ = (float)layer_.getXOffset();
yoff_ = (float)layer_.getYOffset();
//
numLines = vectors_.size();
if((numLines <= 0) || !visible_) return;
numRows = numLines/columns_;
if(numLines%columns_ != 0) numRows++;
xp = new double[columns_];
xd = new int[columns_];
yp = new double[numRows];
yd = new int[numRows];
xout = new int[2];
yout = new int[2];
g.setColor(layer_.getPane().getComponent().getForeground());
bounds = getBounds();
//
// compute location of rows and columns in device and physical coordinates
//
vectorLength = xPtoD((float)vectorLengthP_) - xPtoD(0.0f);
labelSpace = layer_.getXDtoP(LABEL_SPACE_) - layer_.getXDtoP(0);
scaleLength = layer_.getXDtoP(maxScaleLength_) - layer_.getXDtoP(0);
scaleSpace = layer_.getXDtoP(SCALE_SPACE_) - layer_.getXDtoP(0);
//
yd[0] = bounds.y + VERTICAL_BORDER_ + maxLabelHeight_;
yp[0] = layer_.getYDtoP(yd[0]);
for(i=1; i < numRows; i++) {
yd[i] = yd[i-1] + ROW_SPACE_ + maxLabelHeight_;
yp[i] = layer_.getYDtoP(yd[i]);
}
xd[0] = bounds.x + HORIZONTAL_BORDER_;
xp[0] = layer_.getXDtoP(xd[0]);
for(i=1; i < columns_; i++) {
xd[i] = xd[i-1] + COLUMN_SPACE_ + (int)vectorLength +
SCALE_SPACE_ + maxScaleLength_ +
LABEL_SPACE_ + maxLabelLength_;
xp[i] = layer_.getXDtoP(xd[i]);
}
//
row = 0;
col = 0;
Object obj;
Enumeration labelIt = label_.elements();
Enumeration scaleIt = scaleLabel_.elements();
for(Enumeration lineIt = vectors_.elements(); lineIt.hasMoreElements();) {
obj = lineIt.nextElement();
render = (VectorCartesianRenderer)obj;
attr = (VectorAttribute)render.getAttribute();
label = (SGLabel)labelIt.nextElement();
scaleLabel = (SGLabel)scaleIt.nextElement();
//
// draw line
//
g2.setColor(attr.getVectorColor());
stroke = new BasicStroke(attr.getWidth(),
attr.getCapStyle(),
attr.getMiterStyle(),
attr.getMiterLimit());
scale = (float)attr.getVectorScale();
headScale = (float)attr.getHeadScale()*0.94386f;
fixedScale = (float)(headScale*attr.getHeadFixedSize());
minSize = (float)attr.getHeadMinSize();
maxSize = (float)attr.getHeadMaxSize();
vectorLengthU = (float)(vectorLengthP_/scale);
g2.setStroke(stroke);
gp = new GeneralPath();
orgX = (float)xd[col];
orgY = (float)(yd[row] - maxLabelHeight_/2);
headX = orgX + vectorLength;
headY = orgY;
xphead = xDtoP(headX);
yphead = yDtoP(headY);
gp.moveTo(orgX, orgY);
gp.lineTo(headX, headY);
//
// add head
//
if(vectorLength == 0.0) {
g.drawLine((int)headX, (int)headY, (int)headX, (int)headY);
} else {
if(attr.getVectorStyle() != VectorAttribute.NO_HEAD) {
if(attr.getVectorStyle() == VectorAttribute.HEAD) {
// unscaled head
tScale = fixedScale;
hx1 = xPtoD(xphead - tScale);
hy1 = yPtoD(yphead + 0.35f*tScale);
hx2 = xPtoD(xphead - tScale);
hy2 = yPtoD(yphead - 0.35f*tScale);
gp.moveTo(hx1, hy1);
gp.lineTo(headX, headY);
gp.lineTo(hx2, hy2);
} else {
// scaled head
if(vectorLengthP_ >= maxSize) {
tScale = maxSize*headScale;
} else if(vectorLengthP_ <= minSize) {
tScale = minSize*headScale;
} else {
tScale = (float)(vectorLengthP_*headScale);
}
hx1 = xPtoD(xphead - tScale);
hy1 = yPtoD(yphead + 0.35f*tScale);
hx2 = xPtoD(xphead - tScale);
hy2 = yPtoD(yphead - 0.35f*tScale);
gp.moveTo(hx1, hy1);
gp.lineTo(headX, headY);
gp.lineTo(hx2, hy2);
}
}
}
g2.draw(gp);
g2.setStroke(savedStroke);
//
// draw mark
//
xout[0] = (int)orgX;
yout[0] = (int)orgY;
if(attr.getOriginStyle() == VectorAttribute.MARK) {
g.setColor(attr.getMarkColor());
render.drawMark(g, xout, yout, 1, attr);
}
//
// scale label
//
xloc = xp[col] + vectorLengthP_ + scaleSpace;
if(vectorLengthU > 1000.0 || vectorLengthU < 0.01) {
scaleStr = expFormat_.format(vectorLengthU);
} else {
scaleStr = floatFormat_.format(vectorLengthU);
}
scaleLabel.setText(scaleStr);
scaleLabel.setLocationP(new Point2D.Double(xloc, yp[row]));
//
// user label
//
xloc = xloc + scaleLength + labelSpace;
label.setLocationP(new Point2D.Double(xloc, yp[row]));
try {
scaleLabel.draw(g);
label.draw(g);
} catch (SGException e) { System.out.println(e);}
//
col++;
if(col >= columns_) {
col = 0;
row++;
}
}
switch(style_) {
case PLAIN_LINE:
g.drawRect(bounds.x, bounds.y, bounds.width-1, bounds.height-1);
break;
case RAISED:
break;
default:
case NO_BORDER:
}
}
|
void function(Graphics g) { double maxLabelLength, maxLabelHeight; int numLines, numRows, i; float vectorLength; float vectorLengthU; int col, row, ytemp; double xloc, labelSpace, scaleSpace, scaleLength; double[] xp, yp; int[] xd, yd; int[] xout, yout; float hx1, hx2; float hy1, hy2; float headX, headY; float orgX, orgY; float xphead, yphead; float tScale, fixedScale; float scale; float headScale; float minSize; float maxSize; Rectangle bounds; VectorCartesianRenderer render = null; SGLabel label; SGLabel scaleLabel; String scaleStr; VectorAttribute attr = null; Graphics2D g2 = (Graphics2D)g; GeneralPath gp; Stroke savedStroke = g2.getStroke(); BasicStroke stroke; slope_ = (float)layer_.getXSlope(); xoff_ = (float)layer_.getXOffset(); yoff_ = (float)layer_.getYOffset(); if((numLines <= 0) !visible_) return; numRows = numLines/columns_; if(numLines%columns_ != 0) numRows++; xp = new double[columns_]; xd = new int[columns_]; yp = new double[numRows]; yd = new int[numRows]; xout = new int[2]; yout = new int[2]; g.setColor(layer_.getPane().getComponent().getForeground()); bounds = getBounds(); labelSpace = layer_.getXDtoP(LABEL_SPACE_) - layer_.getXDtoP(0); scaleLength = layer_.getXDtoP(maxScaleLength_) - layer_.getXDtoP(0); scaleSpace = layer_.getXDtoP(SCALE_SPACE_) - layer_.getXDtoP(0); yp[0] = layer_.getYDtoP(yd[0]); for(i=1; i < numRows; i++) { yd[i] = yd[i-1] + ROW_SPACE_ + maxLabelHeight_; yp[i] = layer_.getYDtoP(yd[i]); } xd[0] = bounds.x + HORIZONTAL_BORDER_; xp[0] = layer_.getXDtoP(xd[0]); for(i=1; i < columns_; i++) { xd[i] = xd[i-1] + COLUMN_SPACE_ + (int)vectorLength + SCALE_SPACE_ + maxScaleLength_ + LABEL_SPACE_ + maxLabelLength_; xp[i] = layer_.getXDtoP(xd[i]); } col = 0; Object obj; Enumeration labelIt = label_.elements(); Enumeration scaleIt = scaleLabel_.elements(); for(Enumeration lineIt = vectors_.elements(); lineIt.hasMoreElements();) { obj = lineIt.nextElement(); render = (VectorCartesianRenderer)obj; attr = (VectorAttribute)render.getAttribute(); label = (SGLabel)labelIt.nextElement(); scaleLabel = (SGLabel)scaleIt.nextElement(); stroke = new BasicStroke(attr.getWidth(), attr.getCapStyle(), attr.getMiterStyle(), attr.getMiterLimit()); scale = (float)attr.getVectorScale(); headScale = (float)attr.getHeadScale()*0.94386f; fixedScale = (float)(headScale*attr.getHeadFixedSize()); minSize = (float)attr.getHeadMinSize(); maxSize = (float)attr.getHeadMaxSize(); vectorLengthU = (float)(vectorLengthP_/scale); g2.setStroke(stroke); gp = new GeneralPath(); orgX = (float)xd[col]; orgY = (float)(yd[row] - maxLabelHeight_/2); headX = orgX + vectorLength; headY = orgY; xphead = xDtoP(headX); yphead = yDtoP(headY); gp.moveTo(orgX, orgY); gp.lineTo(headX, headY); g.drawLine((int)headX, (int)headY, (int)headX, (int)headY); } else { if(attr.getVectorStyle() != VectorAttribute.NO_HEAD) { if(attr.getVectorStyle() == VectorAttribute.HEAD) { tScale = fixedScale; hx1 = xPtoD(xphead - tScale); hy1 = yPtoD(yphead + 0.35f*tScale); hx2 = xPtoD(xphead - tScale); hy2 = yPtoD(yphead - 0.35f*tScale); gp.moveTo(hx1, hy1); gp.lineTo(headX, headY); gp.lineTo(hx2, hy2); } else { if(vectorLengthP_ >= maxSize) { tScale = maxSize*headScale; } else if(vectorLengthP_ <= minSize) { tScale = minSize*headScale; } else { tScale = (float)(vectorLengthP_*headScale); } hx1 = xPtoD(xphead - tScale); hy1 = yPtoD(yphead + 0.35f*tScale); hx2 = xPtoD(xphead - tScale); hy2 = yPtoD(yphead - 0.35f*tScale); gp.moveTo(hx1, hy1); gp.lineTo(headX, headY); gp.lineTo(hx2, hy2); } } } g2.draw(gp); g2.setStroke(savedStroke); yout[0] = (int)orgY; if(attr.getOriginStyle() == VectorAttribute.MARK) { g.setColor(attr.getMarkColor()); render.drawMark(g, xout, yout, 1, attr); } if(vectorLengthU > 1000.0 vectorLengthU < 0.01) { scaleStr = expFormat_.format(vectorLengthU); } else { scaleStr = floatFormat_.format(vectorLengthU); } scaleLabel.setText(scaleStr); scaleLabel.setLocationP(new Point2D.Double(xloc, yp[row])); label.setLocationP(new Point2D.Double(xloc, yp[row])); try { scaleLabel.draw(g); label.draw(g); } catch (SGException e) { System.out.println(e);} if(col >= columns_) { col = 0; row++; } } switch(style_) { case PLAIN_LINE: g.drawRect(bounds.x, bounds.y, bounds.width-1, bounds.height-1); break; case RAISED: break; default: case NO_BORDER: } }
|
/**
* Draw the Key.
*/
|
Draw the Key
|
draw
|
{
"repo_name": "MaxwellM/ncBrowse-revamp-CAPSTONE",
"path": "src/ncBrowse/sgt/VectorKey.java",
"license": "gpl-3.0",
"size": 27989
}
|
[
"java.awt.BasicStroke",
"java.awt.Graphics",
"java.awt.Graphics2D",
"java.awt.Rectangle",
"java.awt.Stroke",
"java.awt.geom.GeneralPath",
"java.util.Enumeration"
] |
import java.awt.BasicStroke; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Rectangle; import java.awt.Stroke; import java.awt.geom.GeneralPath; import java.util.Enumeration;
|
import java.awt.*; import java.awt.geom.*; import java.util.*;
|
[
"java.awt",
"java.util"
] |
java.awt; java.util;
| 2,244,865
|
private boolean testAspInjection(String paramName) {
Random rand = new Random();
int bignum1 = 100000 + (int)(rand.nextFloat()*(999999 - 1000000 + 1));
int bignum2 = 100000 + (int)(rand.nextFloat()*(999999 - 1000000 + 1));
for (String aspPayload : ASP_PAYLOADS) {
HttpMessage msg = getNewMsg();
setParameter(msg, paramName, MessageFormat.format(aspPayload, bignum1, bignum2));
if (log.isDebugEnabled()) {
log.debug("Testing [" + paramName + "] = [" + aspPayload + "]");
}
try {
// Send the request and retrieve the response
try {
sendAndReceive(msg, false);
} catch (SocketException ex) {
if (log.isDebugEnabled()) log.debug("Caught " + ex.getClass().getName() + " " + ex.getMessage() +
" when accessing: " + msg.getRequestHeader().getURI().toString());
continue; //Advance in the ASP payload loop, no point continuing on this payload
}
// Check if the injected content has been evaluated and printed
if (msg.getResponseBody().toString().contains(Integer.toString(bignum1*bignum2))) {
// We Found IT!
// First do logging
if (log.isDebugEnabled()) {
log.debug("[ASP Code Injection Found] on parameter [" + paramName
+ "] with payload [" + aspPayload + "]");
}
// Now create the alert message
this.bingo(
Alert.RISK_HIGH,
Alert.CONFIDENCE_MEDIUM,
Constant.messages.getString(MESSAGE_PREFIX + "name.asp"),
getDescription(),
null,
paramName,
aspPayload,
null,
getSolution(),
msg);
return true;
}
} catch (IOException ex) {
//Do not try to internationalise this.. we need an error message in any event..
//if it's in English, it's still better than not having it at all.
log.warn("ASP Code Injection vulnerability check failed for parameter ["
+ paramName + "] and payload [" + aspPayload + "] due to an I/O error", ex);
}
// Check if the scan has been stopped
// if yes dispose resources and exit
if (isStop()) {
// Dispose all resources
// Exit the plugin
break;
}
}
return false;
}
|
boolean function(String paramName) { Random rand = new Random(); int bignum1 = 100000 + (int)(rand.nextFloat()*(999999 - 1000000 + 1)); int bignum2 = 100000 + (int)(rand.nextFloat()*(999999 - 1000000 + 1)); for (String aspPayload : ASP_PAYLOADS) { HttpMessage msg = getNewMsg(); setParameter(msg, paramName, MessageFormat.format(aspPayload, bignum1, bignum2)); if (log.isDebugEnabled()) { log.debug(STR + paramName + STR + aspPayload + "]"); } try { try { sendAndReceive(msg, false); } catch (SocketException ex) { if (log.isDebugEnabled()) log.debug(STR + ex.getClass().getName() + " " + ex.getMessage() + STR + msg.getRequestHeader().getURI().toString()); continue; } if (msg.getResponseBody().toString().contains(Integer.toString(bignum1*bignum2))) { if (log.isDebugEnabled()) { log.debug(STR + paramName + STR + aspPayload + "]"); } this.bingo( Alert.RISK_HIGH, Alert.CONFIDENCE_MEDIUM, Constant.messages.getString(MESSAGE_PREFIX + STR), getDescription(), null, paramName, aspPayload, null, getSolution(), msg); return true; } } catch (IOException ex) { log.warn(STR + paramName + STR + aspPayload + STR, ex); } if (isStop()) { break; } } return false; }
|
/**
* Tests for injection vulnerabilities in ASP code.
*
* @param paramName the name of the parameter that will be used for testing for injection
* @return {@code true} if the vulnerability was found, {@code false} otherwise.
* @see #ASP_PAYLOADS
*/
|
Tests for injection vulnerabilities in ASP code
|
testAspInjection
|
{
"repo_name": "pedroo21/ZAP-Multi-Scan-Rules",
"path": "CodeInjectionPlugin.java",
"license": "mit",
"size": 12915
}
|
[
"java.io.IOException",
"java.net.SocketException",
"java.text.MessageFormat",
"java.util.Random",
"org.parosproxy.paros.Constant",
"org.parosproxy.paros.core.scanner.Alert",
"org.parosproxy.paros.network.HttpMessage"
] |
import java.io.IOException; import java.net.SocketException; import java.text.MessageFormat; import java.util.Random; import org.parosproxy.paros.Constant; import org.parosproxy.paros.core.scanner.Alert; import org.parosproxy.paros.network.HttpMessage;
|
import java.io.*; import java.net.*; import java.text.*; import java.util.*; import org.parosproxy.paros.*; import org.parosproxy.paros.core.scanner.*; import org.parosproxy.paros.network.*;
|
[
"java.io",
"java.net",
"java.text",
"java.util",
"org.parosproxy.paros"
] |
java.io; java.net; java.text; java.util; org.parosproxy.paros;
| 778,379
|
@Override
public String getAddColumnStatement( String tablename, ValueMetaInterface v, String tk, boolean use_autoinc,
String pk, boolean semicolon ) {
return "ALTER TABLE " + tablename + " ADD " + getFieldDefinition( v, tk, pk, use_autoinc, true, false );
}
|
String function( String tablename, ValueMetaInterface v, String tk, boolean use_autoinc, String pk, boolean semicolon ) { return STR + tablename + STR + getFieldDefinition( v, tk, pk, use_autoinc, true, false ); }
|
/**
* Generates the SQL statement to add a column to the specified table
*
* @param tablename
* The table to add
* @param v
* The column defined as a value
* @param tk
* the name of the technical key field
* @param use_autoinc
* whether or not this field uses auto increment
* @param pk
* the name of the primary key field
* @param semicolon
* whether or not to add a semi-colon behind the statement.
* @return the SQL statement to add a column to the specified table
*
*/
|
Generates the SQL statement to add a column to the specified table
|
getAddColumnStatement
|
{
"repo_name": "emartin-pentaho/pentaho-kettle",
"path": "core/src/main/java/org/pentaho/di/core/database/HypersonicDatabaseMeta.java",
"license": "apache-2.0",
"size": 12270
}
|
[
"org.pentaho.di.core.row.ValueMetaInterface"
] |
import org.pentaho.di.core.row.ValueMetaInterface;
|
import org.pentaho.di.core.row.*;
|
[
"org.pentaho.di"
] |
org.pentaho.di;
| 2,377,902
|
EntityDefault getEntityDefaultFromArchiveByPrincipalName(String principalName) throws IllegalArgumentException;
|
EntityDefault getEntityDefaultFromArchiveByPrincipalName(String principalName) throws IllegalArgumentException;
|
/**
* Gets a {@link org.kuali.rice.kim.api.identity.entity.EntityDefault} with an principalName from the archive.
* {@link org.kuali.rice.kim.api.identity.entity.EntityDefault} is a condensed version of {@link org.kuali.rice.kim.api.identity.entity.Entity} that contains
* default values of its subclasses
*
* <p>
* This method will return null if the Entity does not exist.
* </p>
*
* @param principalName the unique principalName to retrieve the entity by. cannot be null.
* @return a {@link org.kuali.rice.kim.api.identity.entity.EntityDefault} or null
* @throws IllegalArgumentException if the principalName is blank
*/
|
Gets a <code>org.kuali.rice.kim.api.identity.entity.EntityDefault</code> with an principalName from the archive. <code>org.kuali.rice.kim.api.identity.entity.EntityDefault</code> is a condensed version of <code>org.kuali.rice.kim.api.identity.entity.Entity</code> that contains default values of its subclasses This method will return null if the Entity does not exist.
|
getEntityDefaultFromArchiveByPrincipalName
|
{
"repo_name": "sbower/kuali-rice-1",
"path": "kim/kim-impl/src/main/java/org/kuali/rice/kim/impl/identity/IdentityArchiveService.java",
"license": "apache-2.0",
"size": 4234
}
|
[
"org.kuali.rice.kim.api.identity.entity.EntityDefault"
] |
import org.kuali.rice.kim.api.identity.entity.EntityDefault;
|
import org.kuali.rice.kim.api.identity.entity.*;
|
[
"org.kuali.rice"
] |
org.kuali.rice;
| 510,030
|
public Map<String,String> getEnteredCourseGrade(String gradebookUid);
|
Map<String,String> function(String gradebookUid);
|
/**
* Get a Map of overridden CourseGrade for students.
* @param gradebookUid
* @return Map of enrollment displayId as key, point as value string
*
*/
|
Get a Map of overridden CourseGrade for students
|
getEnteredCourseGrade
|
{
"repo_name": "noondaysun/sakai",
"path": "edu-services/gradebook-service/api/src/java/org/sakaiproject/service/gradebook/shared/GradebookService.java",
"license": "apache-2.0",
"size": 27950
}
|
[
"java.util.Map"
] |
import java.util.Map;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 2,845,995
|
protected FormModel getFormModel() {
return bindingFactory.getFormModel();
}
|
FormModel function() { return bindingFactory.getFormModel(); }
|
/**
* Convenience method to return the formModel that is used in the
* {@link BindingFactory} and that should be used in the builder.
*/
|
Convenience method to return the formModel that is used in the <code>BindingFactory</code> and that should be used in the builder
|
getFormModel
|
{
"repo_name": "danilovalente/spring-richclient",
"path": "spring-richclient-core/src/main/java/org/springframework/richclient/form/builder/AbstractFormBuilder.java",
"license": "apache-2.0",
"size": 7174
}
|
[
"org.springframework.binding.form.FormModel"
] |
import org.springframework.binding.form.FormModel;
|
import org.springframework.binding.form.*;
|
[
"org.springframework.binding"
] |
org.springframework.binding;
| 521,928
|
public static Result text(String text, Object...objects) {
return text(MessageFormat.format(text, objects));
}
|
static Result function(String text, Object...objects) { return text(MessageFormat.format(text, objects)); }
|
/**
* This method will send the text to a client verbatim. It will not use any layouts. Use it to build app.services
* and to support AJAX.
*
* @param text A string containing "{index}", like so: "Message: {0}, error: {1}"
* @param objects A varargs of objects to be put into the <code>text</code>
* @return {@link Result}, to accept additional information.
* @see MessageFormat#format
*/
|
This method will send the text to a client verbatim. It will not use any layouts. Use it to build app.services and to support AJAX
|
text
|
{
"repo_name": "MTDdk/jawn",
"path": "jawn-core/src/main/java/net/javapla/jawn/core/Results.java",
"license": "lgpl-3.0",
"size": 2724
}
|
[
"java.text.MessageFormat"
] |
import java.text.MessageFormat;
|
import java.text.*;
|
[
"java.text"
] |
java.text;
| 2,441,751
|
protected void processAssociationOverride(AssociationOverrideMetadata associationOverride, EmbeddableMapping embeddableMapping, DatabaseTable defaultTable, MetadataDescriptor owningDescriptor) {
// Process and use the association override's joinColumns. Avoid calling
// getJoinColumns since, by default, that method looks for an association
// override on the descriptor. In this case that has already been taken
// care of for use before calling this method.
for (JoinColumnMetadata joinColumn : getJoinColumnsAndValidate(associationOverride.getJoinColumns(), getReferenceDescriptor())) {
// Look up the primary key field from the referenced column name.
DatabaseField pkField = getReferencedField(joinColumn.getReferencedColumnName(), getReferenceDescriptor(), MetadataLogger.PK_COLUMN);
DatabaseField fkField = ((OneToOneMapping) getMapping()).getTargetToSourceKeyFields().get(pkField);
if (fkField == null) {
throw ValidationException.invalidAssociationOverrideReferenceColumnName(pkField.getName(), associationOverride.getName(), embeddableMapping.getAttributeName(), owningDescriptor.getJavaClassName());
} else {
// Make sure we have a table set on the association override
// field, otherwise use the default table provided.
DatabaseField translationFKField = joinColumn.getForeignKeyField(pkField);
if (! translationFKField.hasTableName()) {
translationFKField.setTable(defaultTable);
}
embeddableMapping.addFieldTranslation(translationFKField, fkField.getName());
}
}
}
|
void function(AssociationOverrideMetadata associationOverride, EmbeddableMapping embeddableMapping, DatabaseTable defaultTable, MetadataDescriptor owningDescriptor) { for (JoinColumnMetadata joinColumn : getJoinColumnsAndValidate(associationOverride.getJoinColumns(), getReferenceDescriptor())) { DatabaseField pkField = getReferencedField(joinColumn.getReferencedColumnName(), getReferenceDescriptor(), MetadataLogger.PK_COLUMN); DatabaseField fkField = ((OneToOneMapping) getMapping()).getTargetToSourceKeyFields().get(pkField); if (fkField == null) { throw ValidationException.invalidAssociationOverrideReferenceColumnName(pkField.getName(), associationOverride.getName(), embeddableMapping.getAttributeName(), owningDescriptor.getJavaClassName()); } else { DatabaseField translationFKField = joinColumn.getForeignKeyField(pkField); if (! translationFKField.hasTableName()) { translationFKField.setTable(defaultTable); } embeddableMapping.addFieldTranslation(translationFKField, fkField.getName()); } } }
|
/**
* INTERNAL:
* Process an association override for either an embedded object mapping,
* or a map mapping (element-collection, 1-M and M-M) containing an
* embeddable object as the value or key.
*/
|
Process an association override for either an embedded object mapping, or a map mapping (element-collection, 1-M and M-M) containing an embeddable object as the value or key
|
processAssociationOverride
|
{
"repo_name": "bfg-repo-cleaner-demos/eclipselink.runtime-bfg-strip-big-blobs",
"path": "jpa/org.eclipse.persistence.jpa/src/org/eclipse/persistence/internal/jpa/metadata/accessors/mappings/ObjectAccessor.java",
"license": "epl-1.0",
"size": 34404
}
|
[
"org.eclipse.persistence.exceptions.ValidationException",
"org.eclipse.persistence.internal.helper.DatabaseField",
"org.eclipse.persistence.internal.helper.DatabaseTable",
"org.eclipse.persistence.internal.jpa.metadata.MetadataDescriptor",
"org.eclipse.persistence.internal.jpa.metadata.MetadataLogger",
"org.eclipse.persistence.internal.jpa.metadata.columns.AssociationOverrideMetadata",
"org.eclipse.persistence.internal.jpa.metadata.columns.JoinColumnMetadata",
"org.eclipse.persistence.mappings.EmbeddableMapping",
"org.eclipse.persistence.mappings.OneToOneMapping"
] |
import org.eclipse.persistence.exceptions.ValidationException; import org.eclipse.persistence.internal.helper.DatabaseField; import org.eclipse.persistence.internal.helper.DatabaseTable; import org.eclipse.persistence.internal.jpa.metadata.MetadataDescriptor; import org.eclipse.persistence.internal.jpa.metadata.MetadataLogger; import org.eclipse.persistence.internal.jpa.metadata.columns.AssociationOverrideMetadata; import org.eclipse.persistence.internal.jpa.metadata.columns.JoinColumnMetadata; import org.eclipse.persistence.mappings.EmbeddableMapping; import org.eclipse.persistence.mappings.OneToOneMapping;
|
import org.eclipse.persistence.exceptions.*; import org.eclipse.persistence.internal.helper.*; import org.eclipse.persistence.internal.jpa.metadata.*; import org.eclipse.persistence.internal.jpa.metadata.columns.*; import org.eclipse.persistence.mappings.*;
|
[
"org.eclipse.persistence"
] |
org.eclipse.persistence;
| 2,743,471
|
public static <T> Collection<T> intersection( Collection<T> c1, Collection<T> c2 )
{
Set<T> set1 = new HashSet<>( c1 );
set1.retainAll( new HashSet<>( c2 ) );
return set1;
}
|
static <T> Collection<T> function( Collection<T> c1, Collection<T> c2 ) { Set<T> set1 = new HashSet<>( c1 ); set1.retainAll( new HashSet<>( c2 ) ); return set1; }
|
/**
* Returns the intersection of the given Collections.
*
* @param c1 the first Collection.
* @param c2 the second Collection.
* @param <T> the type.
* @return the intersection of the Collections.
*/
|
Returns the intersection of the given Collections
|
intersection
|
{
"repo_name": "troyel/dhis2-core",
"path": "dhis-2/dhis-support/dhis-support-commons/src/main/java/org/hisp/dhis/commons/collection/CollectionUtils.java",
"license": "bsd-3-clause",
"size": 3853
}
|
[
"java.util.Collection",
"java.util.HashSet",
"java.util.Set"
] |
import java.util.Collection; import java.util.HashSet; import java.util.Set;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,112,428
|
if (attr.isGeometry()) {
return String.class;
} else if (attr.getType().equals(String.valueOf(Types.CHAR))
|| attr.getType().equals(String.valueOf(Types.VARCHAR))
|| attr.getType().equals(String.valueOf(Types.LONGVARCHAR))) {
return String.class;
} else if (attr.getType().equals(String.valueOf(Types.INTEGER))
|| attr.getType().equals(String.valueOf(Types.SMALLINT))
|| attr.getType().equals(String.valueOf(Types.TINYINT))
|| attr.getType().equals("xsd:integer")) {
return Integer.class;
} else if (attr.getType().equals(String.valueOf(Types.BIGINT))
|| attr.getType().equals("xsd:long")) {
return Long.class;
} else if (attr.getType().equals(String.valueOf(Types.DOUBLE))
|| attr.getType().equals(String.valueOf(Types.FLOAT))
|| attr.getType().equals(String.valueOf(Types.DECIMAL))
|| attr.getType().equals("xsd:float")
|| attr.getType().equals("xsd:decimal")
|| attr.getType().equals("xsd:double")) {
return Double.class;
} else if (attr.getType().equals(String.valueOf(Types.NUMERIC))) {
return BigDecimal.class;
} else if (attr.getType().equals(String.valueOf(Types.DATE))
|| attr.getType().equals(String.valueOf(Types.TIME))
|| attr.getType().equals(String.valueOf(Types.TIMESTAMP))) {
return Date.class;
} else if (attr.getType().equals(String.valueOf(Types.BOOLEAN))
|| attr.getType().equals("xsd:boolean")) {
return Boolean.class;
} else {
return String.class;
}
}
|
if (attr.isGeometry()) { return String.class; } else if (attr.getType().equals(String.valueOf(Types.CHAR)) attr.getType().equals(String.valueOf(Types.VARCHAR)) attr.getType().equals(String.valueOf(Types.LONGVARCHAR))) { return String.class; } else if (attr.getType().equals(String.valueOf(Types.INTEGER)) attr.getType().equals(String.valueOf(Types.SMALLINT)) attr.getType().equals(String.valueOf(Types.TINYINT)) attr.getType().equals(STR)) { return Integer.class; } else if (attr.getType().equals(String.valueOf(Types.BIGINT)) attr.getType().equals(STR)) { return Long.class; } else if (attr.getType().equals(String.valueOf(Types.DOUBLE)) attr.getType().equals(String.valueOf(Types.FLOAT)) attr.getType().equals(String.valueOf(Types.DECIMAL)) attr.getType().equals(STR) attr.getType().equals(STR) attr.getType().equals(STR)) { return Double.class; } else if (attr.getType().equals(String.valueOf(Types.NUMERIC))) { return BigDecimal.class; } else if (attr.getType().equals(String.valueOf(Types.DATE)) attr.getType().equals(String.valueOf(Types.TIME)) attr.getType().equals(String.valueOf(Types.TIMESTAMP))) { return Date.class; } else if (attr.getType().equals(String.valueOf(Types.BOOLEAN)) attr.getType().equals(STR)) { return Boolean.class; } else { return String.class; } }
|
/**
* Determines the java class that can represent the type of the given feature attribute.
*
* @param attr DOCUMENT ME!
*
* @return The java class that can represent the type of the given feature attribute
*/
|
Determines the java class that can represent the type of the given feature attribute
|
getClass
|
{
"repo_name": "cismet/cismap-commons",
"path": "src/main/java/de/cismet/cismap/commons/tools/FeatureTools.java",
"license": "lgpl-3.0",
"size": 10865
}
|
[
"java.math.BigDecimal",
"java.util.Date",
"org.deegree.datatypes.Types"
] |
import java.math.BigDecimal; import java.util.Date; import org.deegree.datatypes.Types;
|
import java.math.*; import java.util.*; import org.deegree.datatypes.*;
|
[
"java.math",
"java.util",
"org.deegree.datatypes"
] |
java.math; java.util; org.deegree.datatypes;
| 1,002,424
|
protected void handleGet(Request request, Response response, File file,
String entryName, final MetadataService metadataService) {
if (!file.exists()) {
response.setStatus(Status.CLIENT_ERROR_NOT_FOUND);
} else {
ZipFile zipFile;
try {
zipFile = new ZipFile(file);
} catch (Exception e) {
response.setStatus(Status.SERVER_ERROR_INTERNAL, e);
return;
}
Entity entity = new ZipEntryEntity(zipFile, entryName,
metadataService);
if (!entity.exists()) {
response.setStatus(Status.CLIENT_ERROR_NOT_FOUND);
} else {
final Representation output;
if (entity.isDirectory()) {
// Return the directory listing
final Collection<Entity> children = entity.getChildren();
final ReferenceList rl = new ReferenceList(children.size());
String fileUri = LocalReference.createFileReference(file)
.toString();
String scheme = request.getResourceRef().getScheme();
String baseUri = scheme + ":" + fileUri + "!/";
for (final Entity entry : children) {
rl.add(baseUri + entry.getName());
}
output = rl.getTextRepresentation();
try {
zipFile.close();
} catch (IOException e) {
// Do something ???
}
} else {
// Return the file content
output = entity.getRepresentation(metadataService
.getDefaultMediaType(), getTimeToLive());
output.setLocationRef(request.getResourceRef());
Entity.updateMetadata(entity.getName(), output, true,
getMetadataService());
}
response.setStatus(Status.SUCCESS_OK);
response.setEntity(output);
}
}
}
|
void function(Request request, Response response, File file, String entryName, final MetadataService metadataService) { if (!file.exists()) { response.setStatus(Status.CLIENT_ERROR_NOT_FOUND); } else { ZipFile zipFile; try { zipFile = new ZipFile(file); } catch (Exception e) { response.setStatus(Status.SERVER_ERROR_INTERNAL, e); return; } Entity entity = new ZipEntryEntity(zipFile, entryName, metadataService); if (!entity.exists()) { response.setStatus(Status.CLIENT_ERROR_NOT_FOUND); } else { final Representation output; if (entity.isDirectory()) { final Collection<Entity> children = entity.getChildren(); final ReferenceList rl = new ReferenceList(children.size()); String fileUri = LocalReference.createFileReference(file) .toString(); String scheme = request.getResourceRef().getScheme(); String baseUri = scheme + ":" + fileUri + "!/"; for (final Entity entry : children) { rl.add(baseUri + entry.getName()); } output = rl.getTextRepresentation(); try { zipFile.close(); } catch (IOException e) { } } else { output = entity.getRepresentation(metadataService .getDefaultMediaType(), getTimeToLive()); output.setLocationRef(request.getResourceRef()); Entity.updateMetadata(entity.getName(), output, true, getMetadataService()); } response.setStatus(Status.SUCCESS_OK); response.setEntity(output); } } }
|
/**
* Handles a GET call.
*
* @param request
* The request to answer.
* @param response
* The response to update.
* @param file
* The Zip archive file.
* @param entryName
* The Zip archive entry name.
* @param metadataService
* The metadata service.
*/
|
Handles a GET call
|
handleGet
|
{
"repo_name": "debrief/debrief",
"path": "org.mwc.asset.comms/docs/restlet_src/org.restlet/org/restlet/engine/local/ZipClientHelper.java",
"license": "epl-1.0",
"size": 14345
}
|
[
"java.io.File",
"java.io.IOException",
"java.util.Collection",
"java.util.zip.ZipFile",
"org.restlet.Request",
"org.restlet.Response",
"org.restlet.data.LocalReference",
"org.restlet.data.ReferenceList",
"org.restlet.data.Status",
"org.restlet.representation.Representation",
"org.restlet.service.MetadataService"
] |
import java.io.File; import java.io.IOException; import java.util.Collection; import java.util.zip.ZipFile; import org.restlet.Request; import org.restlet.Response; import org.restlet.data.LocalReference; import org.restlet.data.ReferenceList; import org.restlet.data.Status; import org.restlet.representation.Representation; import org.restlet.service.MetadataService;
|
import java.io.*; import java.util.*; import java.util.zip.*; import org.restlet.*; import org.restlet.data.*; import org.restlet.representation.*; import org.restlet.service.*;
|
[
"java.io",
"java.util",
"org.restlet",
"org.restlet.data",
"org.restlet.representation",
"org.restlet.service"
] |
java.io; java.util; org.restlet; org.restlet.data; org.restlet.representation; org.restlet.service;
| 1,396,512
|
@DELETE
@Produces(MediaTypeRestconf.APPLICATION_YANG_DATA_JSON)
@Path("data/{identifier : .+}")
public Response handleDeleteRequest(@PathParam("identifier") String uriString) {
log.debug("handleDeleteRequest: {}", uriString);
URI uri = uriInfo.getRequestUri();
try {
service.runDeleteOperationOnDataResource(uri);
return Response.ok().build();
} catch (RestconfException e) {
log.error("ERROR: handleDeleteRequest: {}", e.getMessage());
log.debug("Exception in handleDeleteRequest:", e);
return Response.status(e.getResponse().getStatus())
.entity(e.toRestconfErrorJson()).build();
}
}
|
@Produces(MediaTypeRestconf.APPLICATION_YANG_DATA_JSON) @Path(STR) Response function(@PathParam(STR) String uriString) { log.debug(STR, uriString); URI uri = uriInfo.getRequestUri(); try { service.runDeleteOperationOnDataResource(uri); return Response.ok().build(); } catch (RestconfException e) { log.error(STR, e.getMessage()); log.debug(STR, e); return Response.status(e.getResponse().getStatus()) .entity(e.toRestconfErrorJson()).build(); } }
|
/**
* Handles the RESTCONF DELETION Operation against a data resource. If the
* resource is successfully deleted, the HTTP status code "204 No Content"
* is returned in the response. If an exception occurs, then the
* HTTP status code enclosed in the RestconfException object is
* returned.
*
* @param uriString URI of the data resource to be deleted.
* @return HTTP response
*/
|
Handles the RESTCONF DELETION Operation against a data resource. If the resource is successfully deleted, the HTTP status code "204 No Content" is returned in the response. If an exception occurs, then the HTTP status code enclosed in the RestconfException object is returned
|
handleDeleteRequest
|
{
"repo_name": "opennetworkinglab/onos",
"path": "protocols/restconf/server/rpp/src/main/java/org/onosproject/protocol/restconf/server/rpp/RestconfWebResource.java",
"license": "apache-2.0",
"size": 19441
}
|
[
"javax.ws.rs.Path",
"javax.ws.rs.PathParam",
"javax.ws.rs.Produces",
"javax.ws.rs.core.Response",
"org.onosproject.restconf.api.MediaTypeRestconf",
"org.onosproject.restconf.api.RestconfException"
] |
import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.Response; import org.onosproject.restconf.api.MediaTypeRestconf; import org.onosproject.restconf.api.RestconfException;
|
import javax.ws.rs.*; import javax.ws.rs.core.*; import org.onosproject.restconf.api.*;
|
[
"javax.ws",
"org.onosproject.restconf"
] |
javax.ws; org.onosproject.restconf;
| 342,208
|
List<VdsNetworkInterface> getVdsInterfacesByNetworkId(Guid networkId);
|
List<VdsNetworkInterface> getVdsInterfacesByNetworkId(Guid networkId);
|
/**
* Retrieves the VdsNetworkInterfaces that the given network is attached to.
*
* @param networkId
* the network
* @return the list of VdsNetworkInterfaces
*/
|
Retrieves the VdsNetworkInterfaces that the given network is attached to
|
getVdsInterfacesByNetworkId
|
{
"repo_name": "jtux270/translate",
"path": "ovirt/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/network/InterfaceDao.java",
"license": "gpl-3.0",
"size": 6209
}
|
[
"java.util.List",
"org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface",
"org.ovirt.engine.core.compat.Guid"
] |
import java.util.List; import org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface; import org.ovirt.engine.core.compat.Guid;
|
import java.util.*; import org.ovirt.engine.core.common.businessentities.network.*; import org.ovirt.engine.core.compat.*;
|
[
"java.util",
"org.ovirt.engine"
] |
java.util; org.ovirt.engine;
| 2,319,361
|
public static ControlNotFlushed issueCreateStreamRequest(
MessageProcessor MP,
ConsumerDispatcherState subState,
SIBUuid12 destID,
SIBUuid8 destME)
throws SIResourceException,
SIDestinationLockedException,
SIDurableSubscriptionNotFoundException,
SINotAuthorizedException,
SIDurableSubscriptionMismatchException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "issueCreateStreamRequest", new Object[] {MP, subState, destID});
long requestID = MP.nextTick();
SIBUuid8 durHomeID = destME;
ControlMessage msg = createDurableCreateStream(MP, subState, requestID, durHomeID);
// attach requires a destination ID
msg.setGuaranteedTargetDestinationDefinitionUUID(destID);
Object result =
issueRequest(MP, msg, durHomeID,
CREATESTREAM_RETRY_TIMEOUT, -1, // 219870: retry forever, otherwise use CREATESTREAM_NUMTRIES,
requestID);
// If we get a ControlNotFlushed, return a new destination
// otherwise throw an exception.
if (result == null)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "issueCreateStreamRequest", "SIResourceException");
// Gave up because ME unreachable
throw new SIResourceException(
nls.getFormattedMessage(
"REMOTE_DURABLE_TIMEOUT_ERROR_CWSIP0631",
new Object[] {
"attach",
subState.getSubscriberID(),
subState.getDurableHome()},
null));
}
if (result instanceof ControlCardinalityInfo)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "issueCreateStreamRequest", "SIDurableSubscriptionLockedException");
// Subscription already has an attachment
throw new SIDestinationLockedException(
nls.getFormattedMessage(
"SUBSCRIPTION_IN_USE_ERROR_CWSIP0152",
new Object[] { subState.getSubscriberID(),
subState.getDurableHome()},
null));
}
else if (result instanceof ControlDurableConfirm)
{
// Throw exception based on status info
int status = ((ControlDurableConfirm) result).getStatus();
if (status == DurableConstants.STATUS_SUB_NOT_FOUND)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "issueCreateStreamRequest", "SIDurableSubscriptionNotFoundException");
// not found error
throw new SIDurableSubscriptionNotFoundException(
nls.getFormattedMessage(
"SUBSCRIPTION_DOESNT_EXIST_ERROR_CWSIP0146",
new Object[] { subState.getSubscriberID(),
subState.getDurableHome() },
null));
}
else if(status == DurableConstants.STATUS_NOT_AUTH_ERROR)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "issueCreateStreamRequest", "SINotAuthorizedException");
// not auth error
throw new SINotAuthorizedException(
nls.getFormattedMessage(
"USER_NOT_AUTH_ACTIVATE_ERROR_CWSIP0312",
new Object[] { subState.getUser(), subState.getSubscriberID(), subState.getTopicSpaceUuid() },
null));
}
else if(status == DurableConstants.STATUS_SUB_MISMATCH_ERROR)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "issueCreateStreamRequest", "SIDurableSubscriptionMismatchException");
// durable mismatch error
throw new SIDurableSubscriptionMismatchException(
nls.getFormattedMessage(
"SUBSCRIPTION_ALREADY_EXISTS_ERROR_CWSIP0143",
new Object[] { subState.getSubscriberID(),
subState.getDurableHome()},
null));
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "issueCreateStreamRequest", "SIErrorException");
SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0001",
new Object[] {
"com.ibm.ws.sib.processor.impl.DurableInputHandler",
"1:751:1.52.1.1" });
// Anything else is a general error
throw new SIErrorException(
nls.getFormattedMessage(
"INTERNAL_MESSAGING_ERROR_CWSIP0001",
new Object[] {
"com.ibm.ws.sib.processor.impl.DurableInputHandler",
"1:758:1.52.1.1" },
null));
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "issueCreateStreamRequest", result);
return (ControlNotFlushed) result;
}
|
static ControlNotFlushed function( MessageProcessor MP, ConsumerDispatcherState subState, SIBUuid12 destID, SIBUuid8 destME) throws SIResourceException, SIDestinationLockedException, SIDurableSubscriptionNotFoundException, SINotAuthorizedException, SIDurableSubscriptionMismatchException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, STR, new Object[] {MP, subState, destID}); long requestID = MP.nextTick(); SIBUuid8 durHomeID = destME; ControlMessage msg = createDurableCreateStream(MP, subState, requestID, durHomeID); msg.setGuaranteedTargetDestinationDefinitionUUID(destID); Object result = issueRequest(MP, msg, durHomeID, CREATESTREAM_RETRY_TIMEOUT, -1, requestID); if (result == null) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, STR, STR); throw new SIResourceException( nls.getFormattedMessage( STR, new Object[] { STR, subState.getSubscriberID(), subState.getDurableHome()}, null)); } if (result instanceof ControlCardinalityInfo) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, STR, STR); throw new SIDestinationLockedException( nls.getFormattedMessage( STR, new Object[] { subState.getSubscriberID(), subState.getDurableHome()}, null)); } else if (result instanceof ControlDurableConfirm) { int status = ((ControlDurableConfirm) result).getStatus(); if (status == DurableConstants.STATUS_SUB_NOT_FOUND) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, STR, STR); throw new SIDurableSubscriptionNotFoundException( nls.getFormattedMessage( STR, new Object[] { subState.getSubscriberID(), subState.getDurableHome() }, null)); } else if(status == DurableConstants.STATUS_NOT_AUTH_ERROR) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, STR, STR); throw new SINotAuthorizedException( nls.getFormattedMessage( STR, new Object[] { subState.getUser(), subState.getSubscriberID(), subState.getTopicSpaceUuid() }, null)); } else if(status == DurableConstants.STATUS_SUB_MISMATCH_ERROR) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, STR, STR); throw new SIDurableSubscriptionMismatchException( nls.getFormattedMessage( STR, new Object[] { subState.getSubscriberID(), subState.getDurableHome()}, null)); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, STR, STR); SibTr.error(tc, STR, new Object[] { STR, STR }); throw new SIErrorException( nls.getFormattedMessage( STR, new Object[] { STR, STR }, null)); } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, STR, result); return (ControlNotFlushed) result; }
|
/**
* Issue a CreateStream request for an existing remote durable subscription.
* The caller is blocked until we receive a reply for this request.
*
* @param req The state describing the request
* @return If successful, a ControlNotFlushed, otherwise an exception is thrown.
* @throws SIDurableSubscriptionMismatchException
*/
|
Issue a CreateStream request for an existing remote durable subscription. The caller is blocked until we receive a reply for this request
|
issueCreateStreamRequest
|
{
"repo_name": "OpenLiberty/open-liberty",
"path": "dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DurableInputHandler.java",
"license": "epl-1.0",
"size": 39173
}
|
[
"com.ibm.websphere.ras.TraceComponent",
"com.ibm.websphere.sib.exception.SIErrorException",
"com.ibm.websphere.sib.exception.SIResourceException",
"com.ibm.ws.sib.mfp.control.ControlCardinalityInfo",
"com.ibm.ws.sib.mfp.control.ControlDurableConfirm",
"com.ibm.ws.sib.mfp.control.ControlMessage",
"com.ibm.ws.sib.mfp.control.ControlNotFlushed",
"com.ibm.ws.sib.utils.SIBUuid12",
"com.ibm.ws.sib.utils.SIBUuid8",
"com.ibm.ws.sib.utils.ras.SibTr",
"com.ibm.wsspi.sib.core.exception.SIDestinationLockedException",
"com.ibm.wsspi.sib.core.exception.SIDurableSubscriptionMismatchException",
"com.ibm.wsspi.sib.core.exception.SIDurableSubscriptionNotFoundException",
"com.ibm.wsspi.sib.core.exception.SINotAuthorizedException"
] |
import com.ibm.websphere.ras.TraceComponent; import com.ibm.websphere.sib.exception.SIErrorException; import com.ibm.websphere.sib.exception.SIResourceException; import com.ibm.ws.sib.mfp.control.ControlCardinalityInfo; import com.ibm.ws.sib.mfp.control.ControlDurableConfirm; import com.ibm.ws.sib.mfp.control.ControlMessage; import com.ibm.ws.sib.mfp.control.ControlNotFlushed; import com.ibm.ws.sib.utils.SIBUuid12; import com.ibm.ws.sib.utils.SIBUuid8; import com.ibm.ws.sib.utils.ras.SibTr; import com.ibm.wsspi.sib.core.exception.SIDestinationLockedException; import com.ibm.wsspi.sib.core.exception.SIDurableSubscriptionMismatchException; import com.ibm.wsspi.sib.core.exception.SIDurableSubscriptionNotFoundException; import com.ibm.wsspi.sib.core.exception.SINotAuthorizedException;
|
import com.ibm.websphere.ras.*; import com.ibm.websphere.sib.exception.*; import com.ibm.ws.sib.mfp.control.*; import com.ibm.ws.sib.utils.*; import com.ibm.ws.sib.utils.ras.*; import com.ibm.wsspi.sib.core.exception.*;
|
[
"com.ibm.websphere",
"com.ibm.ws",
"com.ibm.wsspi"
] |
com.ibm.websphere; com.ibm.ws; com.ibm.wsspi;
| 2,534,989
|
public void deleteAllAddress(int userId)
throws NotificationManagerException {
NotifSchema schema = null;
try {
schema = new NotifSchema();
NotifDefaultAddressTable nat = schema.notifDefaultAddress;
nat.dereferenceUserId(userId);
schema.commit();
} catch (UtilException e) {
try {
if (schema != null) {
schema.rollback();
}
} catch (Exception ex) {
SilverTrace.warn("notificationManager",
"NotificationManager.deleteAllAddress()", "root.EX_ERR_ROLLBACK",
ex);
}
throw new NotificationManagerException(
"NotificationManager.deleteAllAddress()",
SilverpeasException.ERROR,
"notificationManager.EX_CANT_DEL_NOTIF_ADDRESS", "userId="
+ Integer.toString(userId), e);
} finally {
closeSchema(schema);
}
}
|
void function(int userId) throws NotificationManagerException { NotifSchema schema = null; try { schema = new NotifSchema(); NotifDefaultAddressTable nat = schema.notifDefaultAddress; nat.dereferenceUserId(userId); schema.commit(); } catch (UtilException e) { try { if (schema != null) { schema.rollback(); } } catch (Exception ex) { SilverTrace.warn(STR, STR, STR, ex); } throw new NotificationManagerException( STR, SilverpeasException.ERROR, STR, STR + Integer.toString(userId), e); } finally { closeSchema(schema); } }
|
/**
* Method declaration
* @param userId
* @throws NotificationManagerException
* @see
*/
|
Method declaration
|
deleteAllAddress
|
{
"repo_name": "ebonnet/Silverpeas-Core",
"path": "core-library/src/main/java/org/silverpeas/core/notification/user/client/NotificationManager.java",
"license": "agpl-3.0",
"size": 63926
}
|
[
"org.silverpeas.core.exception.SilverpeasException",
"org.silverpeas.core.exception.UtilException",
"org.silverpeas.core.notification.user.client.model.NotifDefaultAddressTable",
"org.silverpeas.core.notification.user.client.model.NotifSchema",
"org.silverpeas.core.silvertrace.SilverTrace"
] |
import org.silverpeas.core.exception.SilverpeasException; import org.silverpeas.core.exception.UtilException; import org.silverpeas.core.notification.user.client.model.NotifDefaultAddressTable; import org.silverpeas.core.notification.user.client.model.NotifSchema; import org.silverpeas.core.silvertrace.SilverTrace;
|
import org.silverpeas.core.exception.*; import org.silverpeas.core.notification.user.client.model.*; import org.silverpeas.core.silvertrace.*;
|
[
"org.silverpeas.core"
] |
org.silverpeas.core;
| 1,213,982
|
public VoltTable getTable() {
return table;
}
|
VoltTable function() { return table; }
|
/**
* Returns the underlying table
* @return the underlying table
*/
|
Returns the underlying table
|
getTable
|
{
"repo_name": "migue/voltdb",
"path": "src/frontend/org/voltdb/groovy/Tuplerator.java",
"license": "agpl-3.0",
"size": 5058
}
|
[
"org.voltdb.VoltTable"
] |
import org.voltdb.VoltTable;
|
import org.voltdb.*;
|
[
"org.voltdb"
] |
org.voltdb;
| 1,990,077
|
protected boolean doIsSameFile(final FileObject destFile) throws FileSystemException {
return false;
}
|
boolean function(final FileObject destFile) throws FileSystemException { return false; }
|
/**
* Checks if this fileObject is the same file as {@code destFile} just with a different name. E.g. for case
* insensitive filesystems like windows.
*
* @param destFile The file to compare to.
* @return true if the FileObjects are the same.
* @throws FileSystemException if an error occurs.
*/
|
Checks if this fileObject is the same file as destFile just with a different name. E.g. for case insensitive filesystems like windows
|
doIsSameFile
|
{
"repo_name": "wso2/wso2-commons-vfs",
"path": "commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractFileObject.java",
"license": "apache-2.0",
"size": 61998
}
|
[
"org.apache.commons.vfs2.FileObject",
"org.apache.commons.vfs2.FileSystemException"
] |
import org.apache.commons.vfs2.FileObject; import org.apache.commons.vfs2.FileSystemException;
|
import org.apache.commons.vfs2.*;
|
[
"org.apache.commons"
] |
org.apache.commons;
| 1,153,629
|
CmsContainerElement getElementInfo();
|
CmsContainerElement getElementInfo();
|
/**
* This method is used for serialization purposes only.<p>
*
* @return element info
*/
|
This method is used for serialization purposes only
|
getElementInfo
|
{
"repo_name": "alkacon/opencms-core",
"path": "src/org/opencms/ade/containerpage/shared/rpc/I_CmsContainerpageService.java",
"license": "lgpl-2.1",
"size": 22319
}
|
[
"org.opencms.ade.containerpage.shared.CmsContainerElement"
] |
import org.opencms.ade.containerpage.shared.CmsContainerElement;
|
import org.opencms.ade.containerpage.shared.*;
|
[
"org.opencms.ade"
] |
org.opencms.ade;
| 1,636,319
|
public WebServiceTemplateBuilder setUnmarshaller(Unmarshaller unmarshaller) {
return new WebServiceTemplateBuilder(this.detectHttpMessageSender, this.interceptors, this.internalCustomizers,
this.customizers, this.messageSenders, this.marshaller, unmarshaller, this.destinationProvider,
this.transformerFactoryClass, this.messageFactory);
}
|
WebServiceTemplateBuilder function(Unmarshaller unmarshaller) { return new WebServiceTemplateBuilder(this.detectHttpMessageSender, this.interceptors, this.internalCustomizers, this.customizers, this.messageSenders, this.marshaller, unmarshaller, this.destinationProvider, this.transformerFactoryClass, this.messageFactory); }
|
/**
* Set the {@link Unmarshaller} to use to deserialize messages.
* @param unmarshaller the message unmarshaller
* @return a new builder instance.
* @see WebServiceTemplate#setUnmarshaller(Unmarshaller)
*/
|
Set the <code>Unmarshaller</code> to use to deserialize messages
|
setUnmarshaller
|
{
"repo_name": "ilayaperumalg/spring-boot",
"path": "spring-boot-project/spring-boot/src/main/java/org/springframework/boot/webservices/client/WebServiceTemplateBuilder.java",
"license": "apache-2.0",
"size": 26888
}
|
[
"org.springframework.oxm.Unmarshaller"
] |
import org.springframework.oxm.Unmarshaller;
|
import org.springframework.oxm.*;
|
[
"org.springframework.oxm"
] |
org.springframework.oxm;
| 1,185,923
|
public Response toResponse(final KangarooException e) {
return ErrorResponseBuilder.from(e).build();
}
public static final class Binder extends AbstractBinder {
|
Response function(final KangarooException e) { return ErrorResponseBuilder.from(e).build(); } public static final class Binder extends AbstractBinder {
|
/**
* Convert to response.
*
* @param e The exceptions to handle.
* @return The Response instance for this error.
*/
|
Convert to response
|
toResponse
|
{
"repo_name": "kangaroo-server/kangaroo",
"path": "kangaroo-common/src/main/java/net/krotscheck/kangaroo/common/exception/mapper/KangarooExceptionMapper.java",
"license": "apache-2.0",
"size": 1838
}
|
[
"javax.ws.rs.core.Response",
"net.krotscheck.kangaroo.common.exception.ErrorResponseBuilder",
"net.krotscheck.kangaroo.common.exception.KangarooException",
"org.glassfish.jersey.internal.inject.AbstractBinder"
] |
import javax.ws.rs.core.Response; import net.krotscheck.kangaroo.common.exception.ErrorResponseBuilder; import net.krotscheck.kangaroo.common.exception.KangarooException; import org.glassfish.jersey.internal.inject.AbstractBinder;
|
import javax.ws.rs.core.*; import net.krotscheck.kangaroo.common.exception.*; import org.glassfish.jersey.internal.inject.*;
|
[
"javax.ws",
"net.krotscheck.kangaroo",
"org.glassfish.jersey"
] |
javax.ws; net.krotscheck.kangaroo; org.glassfish.jersey;
| 284,689
|
protected String[] getArgs() {
Bundle extras = getIntent().getExtras();
CharSequence[] argsExtra =
(extras == null || isReleaseBuild()) ? null : extras.getCharSequenceArray("args");
List<String> args = new ArrayList<>(Arrays.asList(DEBUG_ARGS));
if (argsExtra != null) {
for (int i = 0; i < argsExtra.length; i++) {
// Replace escaped commas with commas. In order to have a comma in the arg string, it has
// to be escaped when forming the Intent with "am start --esa". However, "am" doesn't remove
// the escape after splitting on unescaped commas, so it's still in the string we get.
args.add(argsExtra[i].toString().replace("\\,", ","));
}
}
// If the URL arg isn't specified, get it from AndroidManifest.xml.
boolean hasUrlArg = hasArg(args, URL_ARG);
// If the splash screen url arg isn't specified, get it from AndroidManifest.xml.
boolean hasSplashUrlArg = hasArg(args, SPLASH_URL_ARG);
// If the splash screen topics arg isn't specified, get it from AndroidManifest.xml.
boolean hasSplashTopicsArg = hasArg(args, SPLASH_TOPICS_ARG);
if (!hasUrlArg || !hasSplashUrlArg || !hasSplashTopicsArg) {
try {
ActivityInfo ai =
getPackageManager()
.getActivityInfo(getIntent().getComponent(), PackageManager.GET_META_DATA);
if (ai.metaData != null) {
if (!hasUrlArg) {
String url = ai.metaData.getString(META_DATA_APP_URL);
if (url != null) {
args.add(URL_ARG + url);
}
}
if (!hasSplashUrlArg) {
String splashUrl = ai.metaData.getString(META_DATA_SPLASH_URL);
if (splashUrl != null) {
args.add(SPLASH_URL_ARG + splashUrl);
}
}
if (!hasSplashTopicsArg) {
String splashTopics = ai.metaData.getString(META_DATA_SPLASH_TOPICS);
if (splashTopics != null) {
args.add(SPLASH_TOPICS_ARG + splashTopics);
}
}
if (ai.metaData.getBoolean(META_FORCE_MIGRATION_FOR_STORAGE_PARTITIONING)) {
args.add(FORCE_MIGRATION_FOR_STORAGE_PARTITIONING);
}
}
} catch (NameNotFoundException e) {
throw new RuntimeException("Error getting activity info", e);
}
}
addCustomProxyArgs(args);
return args.toArray(new String[0]);
}
|
String[] function() { Bundle extras = getIntent().getExtras(); CharSequence[] argsExtra = (extras == null isReleaseBuild()) ? null : extras.getCharSequenceArray("args"); List<String> args = new ArrayList<>(Arrays.asList(DEBUG_ARGS)); if (argsExtra != null) { for (int i = 0; i < argsExtra.length; i++) { args.add(argsExtra[i].toString().replace("\\,", ",")); } } boolean hasUrlArg = hasArg(args, URL_ARG); boolean hasSplashUrlArg = hasArg(args, SPLASH_URL_ARG); boolean hasSplashTopicsArg = hasArg(args, SPLASH_TOPICS_ARG); if (!hasUrlArg !hasSplashUrlArg !hasSplashTopicsArg) { try { ActivityInfo ai = getPackageManager() .getActivityInfo(getIntent().getComponent(), PackageManager.GET_META_DATA); if (ai.metaData != null) { if (!hasUrlArg) { String url = ai.metaData.getString(META_DATA_APP_URL); if (url != null) { args.add(URL_ARG + url); } } if (!hasSplashUrlArg) { String splashUrl = ai.metaData.getString(META_DATA_SPLASH_URL); if (splashUrl != null) { args.add(SPLASH_URL_ARG + splashUrl); } } if (!hasSplashTopicsArg) { String splashTopics = ai.metaData.getString(META_DATA_SPLASH_TOPICS); if (splashTopics != null) { args.add(SPLASH_TOPICS_ARG + splashTopics); } } if (ai.metaData.getBoolean(META_FORCE_MIGRATION_FOR_STORAGE_PARTITIONING)) { args.add(FORCE_MIGRATION_FOR_STORAGE_PARTITIONING); } } } catch (NameNotFoundException e) { throw new RuntimeException(STR, e); } } addCustomProxyArgs(args); return args.toArray(new String[0]); }
|
/**
* Get argv/argc style args, if any from intent extras. Returns empty array if there are none
*
* <p>To use, invoke application via, eg, adb shell am start --esa args arg1,arg2 \
* dev.cobalt.coat/dev.cobalt.app.MainActivity
*/
|
Get argv/argc style args, if any from intent extras. Returns empty array if there are none To use, invoke application via, eg, adb shell am start --esa args arg1,arg2 \ dev.cobalt.coat/dev.cobalt.app.MainActivity
|
getArgs
|
{
"repo_name": "youtube/cobalt",
"path": "starboard/android/apk/app/src/main/java/dev/cobalt/coat/CobaltActivity.java",
"license": "bsd-3-clause",
"size": 13103
}
|
[
"android.content.pm.ActivityInfo",
"android.content.pm.PackageManager",
"android.os.Bundle",
"java.util.ArrayList",
"java.util.Arrays",
"java.util.List"
] |
import android.content.pm.ActivityInfo; import android.content.pm.PackageManager; import android.os.Bundle; import java.util.ArrayList; import java.util.Arrays; import java.util.List;
|
import android.content.pm.*; import android.os.*; import java.util.*;
|
[
"android.content",
"android.os",
"java.util"
] |
android.content; android.os; java.util;
| 1,407,206
|
private String getNodePublicIp(ComputeService computeService) {
|
String function(ComputeService computeService) {
|
/**
* Return the public ip of the generated node.
* It assumes that no other node is currently running using the current group.
*
* @return
*/
|
Return the public ip of the generated node. It assumes that no other node is currently running using the current group
|
getNodePublicIp
|
{
"repo_name": "jludvice/fabric8",
"path": "itests/paxexam/basic/src/test/java/io/fabric8/itests/paxexam/basic/cloud/FabricAwsContainerTest.java",
"license": "apache-2.0",
"size": 6900
}
|
[
"org.jclouds.compute.ComputeService"
] |
import org.jclouds.compute.ComputeService;
|
import org.jclouds.compute.*;
|
[
"org.jclouds.compute"
] |
org.jclouds.compute;
| 2,801,766
|
@Test
public void testGetInnerGroup() {
System.out.println("getInnerGroup");
AbstractJssComboAction instance = new AbstractJssComboActionImpl();
ActionGroup expResult = null;
ActionGroup result = instance.getInnerGroup();
assertEquals(expResult, result);
}
|
void function() { System.out.println(STR); AbstractJssComboAction instance = new AbstractJssComboActionImpl(); ActionGroup expResult = null; ActionGroup result = instance.getInnerGroup(); assertEquals(expResult, result); }
|
/**
* Test of getInnerGroup method, of class AbstractJssComboAction.
*/
|
Test of getInnerGroup method, of class AbstractJssComboAction
|
testGetInnerGroup
|
{
"repo_name": "madmath03/JSwingShell",
"path": "src/test/java/jswingshell/action/AbstractJssComboActionTest.java",
"license": "mit",
"size": 11312
}
|
[
"org.junit.Assert"
] |
import org.junit.Assert;
|
import org.junit.*;
|
[
"org.junit"
] |
org.junit;
| 1,173,764
|
@ServiceMethod(returns = ReturnType.SINGLE)
RemoteRenderingAccountInner create(
String resourceGroupName, String accountName, RemoteRenderingAccountInner remoteRenderingAccount);
|
@ServiceMethod(returns = ReturnType.SINGLE) RemoteRenderingAccountInner create( String resourceGroupName, String accountName, RemoteRenderingAccountInner remoteRenderingAccount);
|
/**
* Creating or Updating a Remote Rendering Account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Name of an Mixed Reality Account.
* @param remoteRenderingAccount Remote Rendering Account parameter.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return remoteRenderingAccount Response.
*/
|
Creating or Updating a Remote Rendering Account
|
create
|
{
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/mixedreality/azure-resourcemanager-mixedreality/src/main/java/com/azure/resourcemanager/mixedreality/fluent/RemoteRenderingAccountsClient.java",
"license": "mit",
"size": 12840
}
|
[
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.resourcemanager.mixedreality.fluent.models.RemoteRenderingAccountInner"
] |
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.mixedreality.fluent.models.RemoteRenderingAccountInner;
|
import com.azure.core.annotation.*; import com.azure.resourcemanager.mixedreality.fluent.models.*;
|
[
"com.azure.core",
"com.azure.resourcemanager"
] |
com.azure.core; com.azure.resourcemanager;
| 2,465,790
|
DataSource getDataSource(String dataSourceName) throws DataSourceLookupFailureException;
|
DataSource getDataSource(String dataSourceName) throws DataSourceLookupFailureException;
|
/**
* Retrieve the DataSource identified by the given name.
* @param dataSourceName the name of the DataSource
* @return the DataSource (never {@code null})
* @throws DataSourceLookupFailureException if the lookup failed
*/
|
Retrieve the DataSource identified by the given name
|
getDataSource
|
{
"repo_name": "spring-projects/spring-framework",
"path": "spring-jdbc/src/main/java/org/springframework/jdbc/datasource/lookup/DataSourceLookup.java",
"license": "apache-2.0",
"size": 1425
}
|
[
"javax.sql.DataSource"
] |
import javax.sql.DataSource;
|
import javax.sql.*;
|
[
"javax.sql"
] |
javax.sql;
| 40,268
|
public void put(int typecode, int capacity, String value) {
TreeMap map = (TreeMap)weighted.get( new Integer(typecode) );
if (map == null) {// add new ordered map
map = new TreeMap();
weighted.put( new Integer(typecode), map );
}
map.put(new Integer(capacity), value);
}
|
void function(int typecode, int capacity, String value) { TreeMap map = (TreeMap)weighted.get( new Integer(typecode) ); if (map == null) { map = new TreeMap(); weighted.put( new Integer(typecode), map ); } map.put(new Integer(capacity), value); }
|
/**
* set a type name for specified type key and capacity
* @param typecode the type key
*/
|
set a type name for specified type key and capacity
|
put
|
{
"repo_name": "simeshev/parabuild-ci",
"path": "3rdparty/hibernate218/src/net/sf/hibernate/dialect/TypeNames.java",
"license": "lgpl-3.0",
"size": 3591
}
|
[
"java.util.TreeMap"
] |
import java.util.TreeMap;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 1,102,024
|
public void setComponentAndListener(AbstractButton button, MouseListener listener) {
super.setComponentAndListener(button, listener);
}
|
void function(AbstractButton button, MouseListener listener) { super.setComponentAndListener(button, listener); }
|
/**
* Type-safe way to set Control Component and control listener.
* @param button An AbstractButton that serves as Control
* component.
* @param listener A ChangeListener that implements
* Control semantics.
*/
|
Type-safe way to set Control Component and control listener
|
setComponentAndListener
|
{
"repo_name": "AlienQueen/alienlabs-skeleton-for-wicket-spring-hibernate",
"path": "lib/fmj/src.ejmf/net/sf/fmj/ejmf/toolkit/gui/controls/MouseListenerControl.java",
"license": "agpl-3.0",
"size": 2453
}
|
[
"java.awt.event.MouseListener",
"javax.swing.AbstractButton"
] |
import java.awt.event.MouseListener; import javax.swing.AbstractButton;
|
import java.awt.event.*; import javax.swing.*;
|
[
"java.awt",
"javax.swing"
] |
java.awt; javax.swing;
| 586,532
|
public MonoImage getHSVHuePlane() throws NIVisionException {
return extractFirstColorPlane(NIVision.ColorMode.HSV);
}
|
MonoImage function() throws NIVisionException { return extractFirstColorPlane(NIVision.ColorMode.HSV); }
|
/**
* Get the hue color plane from the image when represented in HSV color space.
*
* @return The hue color plane from the image.
*/
|
Get the hue color plane from the image when represented in HSV color space
|
getHSVHuePlane
|
{
"repo_name": "trc492/Frc2015RecycleRush",
"path": "code/WPILibJ/image/ColorImage.java",
"license": "mit",
"size": 17214
}
|
[
"com.ni.vision.NIVision"
] |
import com.ni.vision.NIVision;
|
import com.ni.vision.*;
|
[
"com.ni.vision"
] |
com.ni.vision;
| 2,063,701
|
private static String createScope(List<String> perms) {
if (perms == null || perms.isEmpty()) {
return "";
}
return TextUtils.join(" ", perms);
}
private static class LISessionImpl implements LISession {
private static final String LI_SDK_SHARED_PREF_STORE = "li_shared_pref_store";
private static final String SHARED_PREFERENCES_ACCESS_TOKEN = "li_sdk_access_token";
private AccessToken accessToken = null;
public LISessionImpl() {
}
|
static String function(List<String> perms) { if (perms == null perms.isEmpty()) { return STR STRli_shared_pref_storeSTRli_sdk_access_token"; private AccessToken accessToken = null; public LISessionImpl() { }
|
/**
* Builds scope based on List of permissions.
*
* @param perms
* @return
*/
|
Builds scope based on List of permissions
|
createScope
|
{
"repo_name": "vector-solutions/MatzoMatch",
"path": "linkedin-sdk/src/main/java/com/linkedin/platform/LISessionManager.java",
"license": "apache-2.0",
"size": 9877
}
|
[
"java.util.List"
] |
import java.util.List;
|
import java.util.*;
|
[
"java.util"
] |
java.util;
| 73,781
|
public String[] lookupParameterNames(AccessibleObject methodOrConstructor);
|
String[] function(AccessibleObject methodOrConstructor);
|
/**
* Lookup the parameter names of a given method.
*
* @param methodOrConstructor
* the {@link Method} or {@link Constructor} for which the parameter names
* are looked up.
* @return A list of the parameter names.
* @throws ParameterNamesNotFoundException
* if no parameter names were found.
* @throws NullPointerException
* if the parameter is null.
* @throws SecurityException
* if reflection is not permitted on the containing {@link Class} of the
* parameter
*/
|
Lookup the parameter names of a given method
|
lookupParameterNames
|
{
"repo_name": "codehaus/paranamer-git",
"path": "paranamer/src/java/com/thoughtworks/paranamer/Paranamer.java",
"license": "bsd-3-clause",
"size": 3402
}
|
[
"java.lang.reflect.AccessibleObject"
] |
import java.lang.reflect.AccessibleObject;
|
import java.lang.reflect.*;
|
[
"java.lang"
] |
java.lang;
| 1,161,498
|
public void makeSureSqlDatabaseIsOpen ()
{
if(notesOpenHelper == null)
{
notesOpenHelper = new NotesOpenHelper(this);
}
if(sqlDatabase == null)
{
sqlDatabase = notesOpenHelper.getWritableDatabase();
}
else
{
if( ! sqlDatabase.isOpen() )
{
sqlDatabase = notesOpenHelper.getWritableDatabase();
}
}
}
|
void function () { if(notesOpenHelper == null) { notesOpenHelper = new NotesOpenHelper(this); } if(sqlDatabase == null) { sqlDatabase = notesOpenHelper.getWritableDatabase(); } else { if( ! sqlDatabase.isOpen() ) { sqlDatabase = notesOpenHelper.getWritableDatabase(); } } }
|
/**
* checks whether <code>notesOpenHelper</code> is open and
* whether <code>sqlDatabase</code> is open
* and makes sure, that both are.
*/
|
checks whether <code>notesOpenHelper</code> is open and whether <code>sqlDatabase</code> is open and makes sure, that both are
|
makeSureSqlDatabaseIsOpen
|
{
"repo_name": "prurigro/myownnotes-android-protocol_unlock",
"path": "src/org/aykit/owncloud_notes/NoteListActivity.java",
"license": "gpl-3.0",
"size": 36482
}
|
[
"org.aykit.owncloud_notes.sql.NotesOpenHelper"
] |
import org.aykit.owncloud_notes.sql.NotesOpenHelper;
|
import org.aykit.owncloud_notes.sql.*;
|
[
"org.aykit.owncloud_notes"
] |
org.aykit.owncloud_notes;
| 2,800,182
|
public void setTabsSelectedStyle(Style style) {
tabsList.setSelectedStyle(style);
}
|
void function(Style style) { tabsList.setSelectedStyle(style); }
|
/**
* Sets the tabs selected style
* @param style
*/
|
Sets the tabs selected style
|
setTabsSelectedStyle
|
{
"repo_name": "jgittings/chainbench",
"path": "LWUIT_1_5/UI/src/com/sun/lwuit/TabbedPane.java",
"license": "apache-2.0",
"size": 22470
}
|
[
"com.sun.lwuit.plaf.Style"
] |
import com.sun.lwuit.plaf.Style;
|
import com.sun.lwuit.plaf.*;
|
[
"com.sun.lwuit"
] |
com.sun.lwuit;
| 2,848,302
|
void setOnPageChangeListener(ViewPager.OnPageChangeListener listener);
|
void setOnPageChangeListener(ViewPager.OnPageChangeListener listener);
|
/**
* Set a page change listener which will receive forwarded events.
*
* @param listener
*/
|
Set a page change listener which will receive forwarded events
|
setOnPageChangeListener
|
{
"repo_name": "prasannata/StackX",
"path": "stackx-app/src/com/viewpagerindicator/PageIndicator.java",
"license": "gpl-3.0",
"size": 1863
}
|
[
"android.support.v4.view.ViewPager"
] |
import android.support.v4.view.ViewPager;
|
import android.support.v4.view.*;
|
[
"android.support"
] |
android.support;
| 2,450,687
|
public Adapter createValueSetDefinitionDirectoryEntryAdapter() {
return null;
}
|
Adapter function() { return null; }
|
/**
* Creates a new adapter for an object of class '{@link org.openhealthtools.mdht.cts2.valuesetdefinition.ValueSetDefinitionDirectoryEntry
* <em>Directory Entry</em>}'.
* <!-- begin-user-doc -->
* This default implementation returns null so that we can easily ignore cases;
* it's useful to ignore a case when inheritance will catch all the cases anyway.
* <!-- end-user-doc -->
*
* @return the new adapter.
* @see org.openhealthtools.mdht.cts2.valuesetdefinition.ValueSetDefinitionDirectoryEntry
* @generated
*/
|
Creates a new adapter for an object of class '<code>org.openhealthtools.mdht.cts2.valuesetdefinition.ValueSetDefinitionDirectoryEntry Directory Entry</code>'. This default implementation returns null so that we can easily ignore cases; it's useful to ignore a case when inheritance will catch all the cases anyway.
|
createValueSetDefinitionDirectoryEntryAdapter
|
{
"repo_name": "drbgfc/mdht",
"path": "cts2/plugins/org.openhealthtools.mdht.cts2.core/src/org/openhealthtools/mdht/cts2/valuesetdefinition/util/ValueSetDefinitionAdapterFactory.java",
"license": "epl-1.0",
"size": 27532
}
|
[
"org.eclipse.emf.common.notify.Adapter"
] |
import org.eclipse.emf.common.notify.Adapter;
|
import org.eclipse.emf.common.notify.*;
|
[
"org.eclipse.emf"
] |
org.eclipse.emf;
| 1,728,556
|
public void setOnCompletionListener(IMediaPlayer.OnCompletionListener l) {
mOnCompletionListener = l;
}
|
void function(IMediaPlayer.OnCompletionListener l) { mOnCompletionListener = l; }
|
/**
* Register a callback to be invoked when the end of a media file
* has been reached during playback.
*
* @param l The callback that will be run
*/
|
Register a callback to be invoked when the end of a media file has been reached during playback
|
setOnCompletionListener
|
{
"repo_name": "martji/AndroidDemo",
"path": "giraffeplayer/src/main/java/tcking/github/com/giraffeplayer/IjkVideoView.java",
"license": "apache-2.0",
"size": 35111
}
|
[
"tv.danmaku.ijk.media.player.IMediaPlayer"
] |
import tv.danmaku.ijk.media.player.IMediaPlayer;
|
import tv.danmaku.ijk.media.player.*;
|
[
"tv.danmaku.ijk"
] |
tv.danmaku.ijk;
| 2,097,416
|
public void testGenerateResponse() {
final String betterURI = "http://example.com/test";
final String headerName = "Vary";
final String headerValue = "Accept-Encoding";
HttpServletResponse response = createResponseMock();
response.setHeader("Location", betterURI);
response.setHeader(headerName, headerValue);
EasyMock.replay(response);
BetterRequestException bre = new BetterRequestException(betterURI);
bre.addHeader(headerName, headerValue);
bre.generateResponse(response, null);
EasyMock.verify(response);
}
|
void function() { final String betterURI = STRVarySTRAccept-EncodingSTRLocation", betterURI); response.setHeader(headerName, headerValue); EasyMock.replay(response); BetterRequestException bre = new BetterRequestException(betterURI); bre.addHeader(headerName, headerValue); bre.generateResponse(response, null); EasyMock.verify(response); }
|
/**
* Test the response location and headers are set.
*/
|
Test the response location and headers are set
|
testGenerateResponse
|
{
"repo_name": "iipc/openwayback",
"path": "wayback-core/src/test/java/org/archive/wayback/exception/BetterRequestExceptionTest.java",
"license": "apache-2.0",
"size": 4160
}
|
[
"org.easymock.EasyMock"
] |
import org.easymock.EasyMock;
|
import org.easymock.*;
|
[
"org.easymock"
] |
org.easymock;
| 871,663
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.