method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
private void setID(final String id) { MetadataUtilities.setObjectID(this, id); }
void function(final String id) { MetadataUtilities.setObjectID(this, id); }
/** * Sets an identifier unique for the XML document. * This method is invoked automatically by JAXB and should never be invoked explicitly. */
Sets an identifier unique for the XML document. This method is invoked automatically by JAXB and should never be invoked explicitly
setID
{ "repo_name": "apache/sis", "path": "core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/ISOMetadata.java", "license": "apache-2.0", "size": 14487 }
[ "org.apache.sis.internal.metadata.MetadataUtilities" ]
import org.apache.sis.internal.metadata.MetadataUtilities;
import org.apache.sis.internal.metadata.*;
[ "org.apache.sis" ]
org.apache.sis;
2,269,327
protected Node exitImports(Token node) throws ParseException { return node; }
Node function(Token node) throws ParseException { return node; }
/** * Called when exiting a parse tree node. * * @param node the node being exited * * @return the node to add to the parse tree, or * null if no parse tree should be created * * @throws ParseException if the node analysis discovered errors */
Called when exiting a parse tree node
exitImports
{ "repo_name": "richb-hanover/mibble-2.9.2", "path": "src/java/net/percederberg/mibble/asn1/Asn1Analyzer.java", "license": "gpl-2.0", "size": 275483 }
[ "net.percederberg.grammatica.parser.Node", "net.percederberg.grammatica.parser.ParseException", "net.percederberg.grammatica.parser.Token" ]
import net.percederberg.grammatica.parser.Node; import net.percederberg.grammatica.parser.ParseException; import net.percederberg.grammatica.parser.Token;
import net.percederberg.grammatica.parser.*;
[ "net.percederberg.grammatica" ]
net.percederberg.grammatica;
447,348
@Override public void validateSetup(Server server, Query query) throws ValidationException { logger.info("Starting Stackdriver writer connected to '{}', proxy {} ...", gatewayUrl, proxy); }
void function(Server server, Query query) throws ValidationException { logger.info(STR, gatewayUrl, proxy); }
/** * Sets up the object and makes sure all the required parameters are available<br/> * Minimally a Stackdriver API key must be provided using the token setting */
Sets up the object and makes sure all the required parameters are available Minimally a Stackdriver API key must be provided using the token setting
validateSetup
{ "repo_name": "kulcsartibor/jmxtrans", "path": "jmxtrans-output/jmxtrans-output-core/src/main/java/com/googlecode/jmxtrans/model/output/StackdriverWriter.java", "license": "mit", "size": 18588 }
[ "com.googlecode.jmxtrans.model.Query", "com.googlecode.jmxtrans.model.Server", "com.googlecode.jmxtrans.model.ValidationException" ]
import com.googlecode.jmxtrans.model.Query; import com.googlecode.jmxtrans.model.Server; import com.googlecode.jmxtrans.model.ValidationException;
import com.googlecode.jmxtrans.model.*;
[ "com.googlecode.jmxtrans" ]
com.googlecode.jmxtrans;
2,618,179
@ServiceMethod(returns = ReturnType.SINGLE) public Mono<Void> restartRevisionAsync(String resourceGroupName, String containerAppName, String name) { return restartRevisionWithResponseAsync(resourceGroupName, containerAppName, name) .flatMap((Response<Void> res) -> Mono.empty()); }
@ServiceMethod(returns = ReturnType.SINGLE) Mono<Void> function(String resourceGroupName, String containerAppName, String name) { return restartRevisionWithResponseAsync(resourceGroupName, containerAppName, name) .flatMap((Response<Void> res) -> Mono.empty()); }
/** * Restarts a revision for a Container App. * * @param resourceGroupName Name of the resource group to which the resource belongs. * @param containerAppName Name of the Container App. * @param name Name of the Container App Revision to restart. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return A {@link Mono} that completes when a successful response is received. */
Restarts a revision for a Container App
restartRevisionAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/implementation/ContainerAppsRevisionsClientImpl.java", "license": "mit", "size": 51756 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.Response" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*;
[ "com.azure.core" ]
com.azure.core;
527,303
@Override public ResourceLocator getResourceLocator() { return SoundgatesEditPlugin.INSTANCE; }
ResourceLocator function() { return SoundgatesEditPlugin.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": "EPiCS/soundgates", "path": "software/editor/Soundgates.edit/src/soundgates/provider/EStringToEIntegerObjectItemProvider.java", "license": "mit", "size": 5437 }
[ "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,721,698
public ServiceResponse<ProductInner> beginPutNonRetry400(ProductInner product) throws CloudException, IOException { Validator.validate(product); Call<ResponseBody> call = service.beginPutNonRetry400(product, this.client.acceptLanguage(), this.client.userAgent()); return beginPutNonRetry400Delegate(call.execute()); }
ServiceResponse<ProductInner> function(ProductInner product) throws CloudException, IOException { Validator.validate(product); Call<ResponseBody> call = service.beginPutNonRetry400(product, this.client.acceptLanguage(), this.client.userAgent()); return beginPutNonRetry400Delegate(call.execute()); }
/** * Long running put request, service returns a 400 to the initial request. * * @param product Product to put * @throws CloudException exception thrown from REST call * @throws IOException exception thrown from serialization/deserialization * @return the ProductInner object wrapped in {@link ServiceResponse} if successful. */
Long running put request, service returns a 400 to the initial request
beginPutNonRetry400
{ "repo_name": "John-Hart/autorest", "path": "src/generator/AutoRest.Java.Azure.Fluent.Tests/src/main/java/fixtures/lro/implementation/LROSADsInner.java", "license": "mit", "size": 244077 }
[ "com.microsoft.azure.CloudException", "com.microsoft.rest.ServiceResponse", "com.microsoft.rest.Validator", "java.io.IOException" ]
import com.microsoft.azure.CloudException; import com.microsoft.rest.ServiceResponse; import com.microsoft.rest.Validator; import java.io.IOException;
import com.microsoft.azure.*; import com.microsoft.rest.*; import java.io.*;
[ "com.microsoft.azure", "com.microsoft.rest", "java.io" ]
com.microsoft.azure; com.microsoft.rest; java.io;
2,080,492
@JsonProperty("descricaoTipoGranel") public String getDescricaoTipoGranel() { return descricaoTipoGranel; }
@JsonProperty(STR) String function() { return descricaoTipoGranel; }
/** * Get descricaoTipoGranel * @return descricaoTipoGranel **/
Get descricaoTipoGranel
getDescricaoTipoGranel
{ "repo_name": "samuelfac/portalunico.siscomex.gov.br", "path": "src/main/java/br/gov/siscomex/portalunico/cct_ext/model/CargaDTO.java", "license": "mit", "size": 7550 }
[ "com.fasterxml.jackson.annotation.JsonProperty" ]
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.*;
[ "com.fasterxml.jackson" ]
com.fasterxml.jackson;
180,999
public boolean fetch(String sequenceSet, String itemNames) throws IOException { return doCommand (IMAPCommand.FETCH, sequenceSet + " " + itemNames); }
boolean function(String sequenceSet, String itemNames) throws IOException { return doCommand (IMAPCommand.FETCH, sequenceSet + " " + itemNames); }
/** * Send a FETCH command to the server. * * @param sequenceSet The sequence set to fetch (e.g. 1:4,6,11,100:*) * @param itemNames The item names for the FETCH command. (e.g. BODY.PEEK[HEADER.FIELDS (SUBJECT)]) * If multiple item names are requested, these must be enclosed in parentheses, e.g. "(UID FLAGS BODY.PEEK[])" * @return {@code true} if the command was successful,{@code false} if not. * @exception IOException If a network I/O error occurs. * @see #getReplyString() * @see #getReplyStrings() */
Send a FETCH command to the server
fetch
{ "repo_name": "mohanaraosv/commons-net", "path": "src/main/java/org/apache/commons/net/imap/IMAPClient.java", "license": "apache-2.0", "size": 21900 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
984,275
public static BufferedInputStream buffer(final InputStream inputStream, int size) { // reject null early on rather than waiting for IO operation to fail if (inputStream == null) { // not checked by BufferedInputStream throw new NullPointerException(); } return inputStream instanceof BufferedInputStream ? (BufferedInputStream) inputStream : new BufferedInputStream(inputStream, size); } // read toByteArray //-----------------------------------------------------------------------
static BufferedInputStream function(final InputStream inputStream, int size) { if (inputStream == null) { throw new NullPointerException(); } return inputStream instanceof BufferedInputStream ? (BufferedInputStream) inputStream : new BufferedInputStream(inputStream, size); }
/** * Returns the given InputStream if it is already a {@link BufferedInputStream}, otherwise creates a * BufferedInputStream from the given InputStream. * * @param inputStream the InputStream to wrap or return (not null) * @param size the buffer size, if a new BufferedInputStream is created. * @return the given InputStream or a new {@link BufferedInputStream} for the given InputStream * @throws NullPointerException if the input parameter is null * @since 2.5 */
Returns the given InputStream if it is already a <code>BufferedInputStream</code>, otherwise creates a BufferedInputStream from the given InputStream
buffer
{ "repo_name": "8enet/apkeditor", "path": "src/main/java/com/zzzmode/apkeditor/utils/IOUtils.java", "license": "gpl-3.0", "size": 110244 }
[ "java.io.BufferedInputStream", "java.io.InputStream" ]
import java.io.BufferedInputStream; import java.io.InputStream;
import java.io.*;
[ "java.io" ]
java.io;
23,640
public SqlStdOperatorTable getOpTab() { return opTab; }
SqlStdOperatorTable function() { return opTab; }
/** * Returns this RexBuilder's operator table * * @return operator table */
Returns this RexBuilder's operator table
getOpTab
{ "repo_name": "mapr/incubator-calcite", "path": "core/src/main/java/org/apache/calcite/rex/RexBuilder.java", "license": "apache-2.0", "size": 43559 }
[ "org.apache.calcite.sql.fun.SqlStdOperatorTable" ]
import org.apache.calcite.sql.fun.SqlStdOperatorTable;
import org.apache.calcite.sql.fun.*;
[ "org.apache.calcite" ]
org.apache.calcite;
2,111,653
public AtomicReferenceAssert<V> hasValueMatching(Predicate<? super V> predicate) { return hasValueMatching(predicate, PredicateDescription.GIVEN); }
AtomicReferenceAssert<V> function(Predicate<? super V> predicate) { return hasValueMatching(predicate, PredicateDescription.GIVEN); }
/** * Verifies that the atomic under test has a value satisfying the given predicate. * <p> * Example: * <pre><code class='java'> // assertion succeeds * assertThat(new AtomicReference("foo")).hasValueMatching(result -&gt; result != null); * * // assertion fails * assertThat(new AtomicReference("foo")).hasValueMatching(result -&gt; result == null); </code></pre> * * @param predicate the {@link Predicate} to apply on the resulting value. * @return {@code this} assertion object. * @throws NullPointerException if the given {@link Predicate} is null * @throws AssertionError if the atomic under test is {@code null}. * @throws AssertionError if the atomic under test value does not matches with the given predicate. * * @since 3.18.0 */
Verifies that the atomic under test has a value satisfying the given predicate. Example: <code> // assertion succeeds assertThat(new AtomicReference("foo")).hasValueMatching(result -&gt; result != null); assertion fails assertThat(new AtomicReference("foo")).hasValueMatching(result -&gt; result == null); </code></code>
hasValueMatching
{ "repo_name": "hazendaz/assertj-core", "path": "src/main/java/org/assertj/core/api/AtomicReferenceAssert.java", "license": "apache-2.0", "size": 6739 }
[ "java.util.function.Predicate", "org.assertj.core.presentation.PredicateDescription" ]
import java.util.function.Predicate; import org.assertj.core.presentation.PredicateDescription;
import java.util.function.*; import org.assertj.core.presentation.*;
[ "java.util", "org.assertj.core" ]
java.util; org.assertj.core;
2,449,181
@Override public String resolveMessage(String key, Locale locale) { return bundle.get(key, locale); }
String function(String key, Locale locale) { return bundle.get(key, locale); }
/** * Returns message for the specified key and locale. * * @param key Message key. * @param locale Message locale. * @return Message for the specified key and locale. * @throws MissingResourceException if message for the specified key is * not found in provided message bundle. */
Returns message for the specified key and locale
resolveMessage
{ "repo_name": "foxinboxx/foxlabs-validation", "path": "src/main/java/org/foxlabs/validation/message/ResourceMessageResolver.java", "license": "apache-2.0", "size": 2118 }
[ "java.util.Locale" ]
import java.util.Locale;
import java.util.*;
[ "java.util" ]
java.util;
576,954
public void flush() throws IOException { try (BufferedWriter bw = new BufferedWriter(new FileWriter(gameFile, true))) { batch.append("\n\n"); bw.write(batch.toString()); } batch = new StringBuffer(); }
void function() throws IOException { try (BufferedWriter bw = new BufferedWriter(new FileWriter(gameFile, true))) { batch.append("\n\n"); bw.write(batch.toString()); } batch = new StringBuffer(); }
/** * Flushes the output buffer. * @throws IOException if an error occurs while writing to the file. This exception should be caught and the user will * be asked if they would like to continue. */
Flushes the output buffer
flush
{ "repo_name": "zbb93/FreeHoldEm", "path": "src/main/java/org/github/zbb93/logging/StdGameWatcher.java", "license": "gpl-3.0", "size": 3013 }
[ "java.io.BufferedWriter", "java.io.FileWriter", "java.io.IOException" ]
import java.io.BufferedWriter; import java.io.FileWriter; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,679,672
public synchronized int getJobState() throws IOException { try { return job.getJobState().getValue(); } catch (InterruptedException ie) { throw new IOException(ie); } }
synchronized int function() throws IOException { try { return job.getJobState().getValue(); } catch (InterruptedException ie) { throw new IOException(ie); } }
/** * Tells the service to get the state of the current job. */
Tells the service to get the state of the current job
getJobState
{ "repo_name": "ZhangXFeng/hadoop", "path": "src/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobClient.java", "license": "apache-2.0", "size": 39030 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
210,064
public static Set<WebXml> orderWebFragments(WebXml application, Map<String,WebXml> fragments, ServletContext servletContext) { return application.orderWebFragments(fragments, servletContext); }
static Set<WebXml> function(WebXml application, Map<String,WebXml> fragments, ServletContext servletContext) { return application.orderWebFragments(fragments, servletContext); }
/** * Generates the sub-set of the web-fragment.xml files to be processed in * the order that the fragments must be processed as per the rules in the * Servlet spec. * * @param application The application web.xml file * @param fragments The map of fragment names to web fragments * @param servletContext The servlet context the fragments are associated * with * @return Ordered list of web-fragment.xml files to process */
Generates the sub-set of the web-fragment.xml files to be processed in the order that the fragments must be processed as per the rules in the Servlet spec
orderWebFragments
{ "repo_name": "apache/tomcat", "path": "java/org/apache/tomcat/util/descriptor/web/WebXml.java", "license": "apache-2.0", "size": 100411 }
[ "jakarta.servlet.ServletContext", "java.util.Map", "java.util.Set" ]
import jakarta.servlet.ServletContext; import java.util.Map; import java.util.Set;
import jakarta.servlet.*; import java.util.*;
[ "jakarta.servlet", "java.util" ]
jakarta.servlet; java.util;
865,216
public void setMaxDecimalDigit(Integer v) { if (!ObjectUtils.equals(this.maxDecimalDigit, v)) { this.maxDecimalDigit = v; setModified(true); } }
void function(Integer v) { if (!ObjectUtils.equals(this.maxDecimalDigit, v)) { this.maxDecimalDigit = v; setModified(true); } }
/** * Set the value of MaxDecimalDigit * * @param v new value */
Set the value of MaxDecimalDigit
setMaxDecimalDigit
{ "repo_name": "trackplus/Genji", "path": "src/main/java/com/aurel/track/persist/BaseTTextBoxSettings.java", "license": "gpl-3.0", "size": 59636 }
[ "org.apache.commons.lang.ObjectUtils" ]
import org.apache.commons.lang.ObjectUtils;
import org.apache.commons.lang.*;
[ "org.apache.commons" ]
org.apache.commons;
2,001,118
public static com.netxforge.oss2.config.httpdatacollection.HttpDatacollectionConfig unmarshal( final java.io.Reader reader) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (com.netxforge.oss2.config.httpdatacollection.HttpDatacollectionConfig) Unmarshaller.unmarshal(com.netxforge.oss2.config.httpdatacollection.HttpDatacollectionConfig.class, reader); }
static com.netxforge.oss2.config.httpdatacollection.HttpDatacollectionConfig function( final java.io.Reader reader) throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { return (com.netxforge.oss2.config.httpdatacollection.HttpDatacollectionConfig) Unmarshaller.unmarshal(com.netxforge.oss2.config.httpdatacollection.HttpDatacollectionConfig.class, reader); }
/** * Method unmarshal. * * @param reader * @throws org.exolab.castor.xml.MarshalException if object is * null or if any SAXException is thrown during marshaling * @throws org.exolab.castor.xml.ValidationException if this * object is an invalid instance according to the schema * @return the unmarshaled * com.netxforge.oss2.config.httpdatacollection.HttpDatacollectionConfig */
Method unmarshal
unmarshal
{ "repo_name": "dzonekl/oss2nms", "path": "plugins/com.netxforge.oss2.config.model/src/com/netxforge/oss2/config/httpdatacollection/HttpDatacollectionConfig.java", "license": "gpl-3.0", "size": 13507 }
[ "org.exolab.castor.xml.Unmarshaller" ]
import org.exolab.castor.xml.Unmarshaller;
import org.exolab.castor.xml.*;
[ "org.exolab.castor" ]
org.exolab.castor;
1,105,448
public Element getBorderLine3() { String strokeWidth = Double .toString(FireChartUtil.pixelsToYears(1, parent.getChartWidth(), parent.getFirstChartYear(), parent.getLastChartYear())); Element borderLine3 = parent.getSVGDocument().createElementNS(SVGDOMImplementation.SVG_NAMESPACE_URI, "line"); borderLine3.setAttributeNS(null, "x1", Integer.toString(parent.getLastChartYear() - parent.getFirstChartYear())); borderLine3.setAttributeNS(null, "y1", "100"); borderLine3.setAttributeNS(null, "x2", Integer.toString(parent.getLastChartYear() - parent.getFirstChartYear())); borderLine3.setAttributeNS(null, "y2", "0"); borderLine3.setAttributeNS(null, "stroke-width", strokeWidth); borderLine3.setAttributeNS(null, "stroke", "black"); borderLine3.setAttributeNS(null, "stroke-linecap", "butt"); return borderLine3; }
Element function() { String strokeWidth = Double .toString(FireChartUtil.pixelsToYears(1, parent.getChartWidth(), parent.getFirstChartYear(), parent.getLastChartYear())); Element borderLine3 = parent.getSVGDocument().createElementNS(SVGDOMImplementation.SVG_NAMESPACE_URI, "line"); borderLine3.setAttributeNS(null, "x1", Integer.toString(parent.getLastChartYear() - parent.getFirstChartYear())); borderLine3.setAttributeNS(null, "y1", "100"); borderLine3.setAttributeNS(null, "x2", Integer.toString(parent.getLastChartYear() - parent.getFirstChartYear())); borderLine3.setAttributeNS(null, "y2", "0"); borderLine3.setAttributeNS(null, STR, strokeWidth); borderLine3.setAttributeNS(null, STR, "black"); borderLine3.setAttributeNS(null, STR, "butt"); return borderLine3; }
/** * Returns one part of the rectangular box which surrounds the percent scarred plot. * * @return borderLine3 */
Returns one part of the rectangular box which surrounds the percent scarred plot
getBorderLine3
{ "repo_name": "petebrew/fhaes", "path": "fhaes/src/main/java/org/fhaes/neofhchart/svg/PercentScarredPlotElementBuilder.java", "license": "gpl-3.0", "size": 8370 }
[ "org.apache.batik.dom.svg.SVGDOMImplementation", "org.w3c.dom.Element" ]
import org.apache.batik.dom.svg.SVGDOMImplementation; import org.w3c.dom.Element;
import org.apache.batik.dom.svg.*; import org.w3c.dom.*;
[ "org.apache.batik", "org.w3c.dom" ]
org.apache.batik; org.w3c.dom;
2,909,676
public RiskModelHistogram getEquivalenceClassModel() throws InterruptedException { try { return parent.getEquivalenceClassModel(); } catch (ComputationInterruptedException e) { throw new InterruptedException("Computation interrupted"); } }
RiskModelHistogram function() throws InterruptedException { try { return parent.getEquivalenceClassModel(); } catch (ComputationInterruptedException e) { throw new InterruptedException(STR); } }
/** * Returns a model of the equivalence classes in this data set * * @return * @throws InterruptedException */
Returns a model of the equivalence classes in this data set
getEquivalenceClassModel
{ "repo_name": "jgaupp/arx", "path": "src/main/org/deidentifier/arx/risk/RiskEstimateBuilderInterruptible.java", "license": "apache-2.0", "size": 5505 }
[ "org.deidentifier.arx.exceptions.ComputationInterruptedException" ]
import org.deidentifier.arx.exceptions.ComputationInterruptedException;
import org.deidentifier.arx.exceptions.*;
[ "org.deidentifier.arx" ]
org.deidentifier.arx;
411,041
public void trace(Supplier<? extends CharSequence> messageSupplier) { this.log.trace(LogMessage.of(messageSupplier)); }
void function(Supplier<? extends CharSequence> messageSupplier) { this.log.trace(LogMessage.of(messageSupplier)); }
/** * Log a message with trace log level. * * @param messageSupplier a lazy supplier for the message to log */
Log a message with trace log level
trace
{ "repo_name": "emacslisp/Java", "path": "SpringFrameworkReading/src/org/springframework/core/log/LogAccessor.java", "license": "mit", "size": 8373 }
[ "java.util.function.Supplier" ]
import java.util.function.Supplier;
import java.util.function.*;
[ "java.util" ]
java.util;
1,338,764
public void setTikaConfigUri(String tikaConfigUri) throws TikaException, IOException, SAXException { this.tikaConfigUri = tikaConfigUri; this.tikaConfig = new TikaConfig(tikaConfigUri); }
void function(String tikaConfigUri) throws TikaException, IOException, SAXException { this.tikaConfigUri = tikaConfigUri; this.tikaConfig = new TikaConfig(tikaConfigUri); }
/** * * Tika Config Uri: The URI of tika-config.xml * */
Tika Config Uri: The URI of tika-config.xml
setTikaConfigUri
{ "repo_name": "curso007/camel", "path": "components/camel-tika/src/main/java/org/apache/camel/component/tika/TikaConfiguration.java", "license": "apache-2.0", "size": 4007 }
[ "java.io.IOException", "org.apache.tika.config.TikaConfig", "org.apache.tika.exception.TikaException", "org.xml.sax.SAXException" ]
import java.io.IOException; import org.apache.tika.config.TikaConfig; import org.apache.tika.exception.TikaException; import org.xml.sax.SAXException;
import java.io.*; import org.apache.tika.config.*; import org.apache.tika.exception.*; import org.xml.sax.*;
[ "java.io", "org.apache.tika", "org.xml.sax" ]
java.io; org.apache.tika; org.xml.sax;
2,581,919
boolean updateServerList(Collection<InetSocketAddress> serverAddresses, InetSocketAddress currentHost);
boolean updateServerList(Collection<InetSocketAddress> serverAddresses, InetSocketAddress currentHost);
/** * Update the list of servers. This returns true if changing connections is necessary for load-balancing, false otherwise. * @param serverAddresses new host list * @param currentHost the host to which this client is currently connected * @return true if changing connections is necessary for load-balancing, false otherwise */
Update the list of servers. This returns true if changing connections is necessary for load-balancing, false otherwise
updateServerList
{ "repo_name": "ervinyang/tutorial_zookeeper", "path": "zookeeper-trunk/src/java/main/org/apache/zookeeper/client/HostProvider.java", "license": "mit", "size": 2643 }
[ "java.net.InetSocketAddress", "java.util.Collection" ]
import java.net.InetSocketAddress; import java.util.Collection;
import java.net.*; import java.util.*;
[ "java.net", "java.util" ]
java.net; java.util;
2,540,530
public Observable<ServiceResponse<KeyOperationResult>> signWithServiceResponseAsync(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeySignatureAlgorithm algorithm, byte[] value) { if (vaultBaseUrl == null) { throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null."); } if (keyName == null) { throw new IllegalArgumentException("Parameter keyName is required and cannot be null."); } if (keyVersion == null) { throw new IllegalArgumentException("Parameter keyVersion is required and cannot be null."); } if (this.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.apiVersion() is required and cannot be null."); } if (algorithm == null) { throw new IllegalArgumentException("Parameter algorithm is required and cannot be null."); } if (value == null) { throw new IllegalArgumentException("Parameter value is required and cannot be null."); }
Observable<ServiceResponse<KeyOperationResult>> function(String vaultBaseUrl, String keyName, String keyVersion, JsonWebKeySignatureAlgorithm algorithm, byte[] value) { if (vaultBaseUrl == null) { throw new IllegalArgumentException(STR); } if (keyName == null) { throw new IllegalArgumentException(STR); } if (keyVersion == null) { throw new IllegalArgumentException(STR); } if (this.apiVersion() == null) { throw new IllegalArgumentException(STR); } if (algorithm == null) { throw new IllegalArgumentException(STR); } if (value == null) { throw new IllegalArgumentException(STR); }
/** * Creates a signature from a digest using the specified key. * * @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. * @param keyName The name of the key. * @param keyVersion The version of the key. * @param algorithm The signing/verification algorithm identifier. For more information on possible algorithm types, see JsonWebKeySignatureAlgorithm. Possible values include: 'RS256', 'RS384', 'RS512', 'RSNULL' * @param value the Base64Url value * @return the observable to the KeyOperationResult object */
Creates a signature from a digest using the specified key
signWithServiceResponseAsync
{ "repo_name": "anudeepsharma/azure-sdk-for-java", "path": "azure-keyvault/src/main/java/com/microsoft/azure/keyvault/KeyVaultClientImpl.java", "license": "mit", "size": 399443 }
[ "com.microsoft.azure.keyvault.models.KeyOperationResult", "com.microsoft.azure.keyvault.webkey.JsonWebKeySignatureAlgorithm", "com.microsoft.rest.ServiceResponse" ]
import com.microsoft.azure.keyvault.models.KeyOperationResult; import com.microsoft.azure.keyvault.webkey.JsonWebKeySignatureAlgorithm; import com.microsoft.rest.ServiceResponse;
import com.microsoft.azure.keyvault.models.*; import com.microsoft.azure.keyvault.webkey.*; import com.microsoft.rest.*;
[ "com.microsoft.azure", "com.microsoft.rest" ]
com.microsoft.azure; com.microsoft.rest;
2,698,775
private boolean isUserSessionEstablished(HttpServletRequest request) { return (request.getSession().getAttribute(KRADConstants.USER_SESSION_KEY) != null); }
boolean function(HttpServletRequest request) { return (request.getSession().getAttribute(KRADConstants.USER_SESSION_KEY) != null); }
/** * Checks if the user who made the request has a UserSession established * * @param request the HTTPServletRequest object passed in * @return true if the user session has been established, false otherwise */
Checks if the user who made the request has a UserSession established
isUserSessionEstablished
{ "repo_name": "sbower/kuali-rice-1", "path": "impl/src/main/java/org/kuali/rice/kew/web/UserLoginFilter.java", "license": "apache-2.0", "size": 8685 }
[ "javax.servlet.http.HttpServletRequest", "org.kuali.rice.krad.util.KRADConstants" ]
import javax.servlet.http.HttpServletRequest; import org.kuali.rice.krad.util.KRADConstants;
import javax.servlet.http.*; import org.kuali.rice.krad.util.*;
[ "javax.servlet", "org.kuali.rice" ]
javax.servlet; org.kuali.rice;
20,003
public OneResponse delete() { return delete(client, id); }
OneResponse function() { return delete(client, id); }
/** * Deletes the zone from OpenNebula. * * @see Zone#delete(Client, int) */
Deletes the zone from OpenNebula
delete
{ "repo_name": "baby-gnu/one", "path": "src/oca/java/src/org/opennebula/client/zone/Zone.java", "license": "apache-2.0", "size": 6051 }
[ "org.opennebula.client.OneResponse" ]
import org.opennebula.client.OneResponse;
import org.opennebula.client.*;
[ "org.opennebula.client" ]
org.opennebula.client;
1,576,980
public TaskSummaryQueryBuilder subTaskStrategy(SubTasksStrategy... subTasksStrategy);
TaskSummaryQueryBuilder function(SubTasksStrategy... subTasksStrategy);
/** * Add one or more (task) sub-task-strategies as a criteria to the query * @param subTasksStrategy one or more {@link SubTasksStrategy} values * @return the current {@link TaskSummaryQueryBuilder} instance */
Add one or more (task) sub-task-strategies as a criteria to the query
subTaskStrategy
{ "repo_name": "winklerm/drools", "path": "kie-internal/src/main/java/org/kie/internal/task/query/TaskSummaryQueryBuilder.java", "license": "apache-2.0", "size": 11208 }
[ "org.kie.internal.task.api.model.SubTasksStrategy" ]
import org.kie.internal.task.api.model.SubTasksStrategy;
import org.kie.internal.task.api.model.*;
[ "org.kie.internal" ]
org.kie.internal;
880,438
public UnassignedInfo updateDelay(final long nanoTimeNow, final Settings settings, final Settings indexSettings) { final long newComputedLeftDelayNanos = getRemainingDelay(nanoTimeNow, settings, indexSettings); if (lastComputedLeftDelayNanos == newComputedLeftDelayNanos) { return this; } return new UnassignedInfo(this, newComputedLeftDelayNanos); }
UnassignedInfo function(final long nanoTimeNow, final Settings settings, final Settings indexSettings) { final long newComputedLeftDelayNanos = getRemainingDelay(nanoTimeNow, settings, indexSettings); if (lastComputedLeftDelayNanos == newComputedLeftDelayNanos) { return this; } return new UnassignedInfo(this, newComputedLeftDelayNanos); }
/** * Creates new UnassignedInfo object if delay needs updating. * * @return new Unassigned with updated delay, or this if no change in delay */
Creates new UnassignedInfo object if delay needs updating
updateDelay
{ "repo_name": "myelin/elasticsearch", "path": "core/src/main/java/org/elasticsearch/cluster/routing/UnassignedInfo.java", "license": "apache-2.0", "size": 16134 }
[ "org.elasticsearch.common.settings.Settings" ]
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.*;
[ "org.elasticsearch.common" ]
org.elasticsearch.common;
1,995,276
@SuppressWarnings("unchecked") public void resetLocationHighlighting(ITextEditor editor) { IDocumentProvider idp = editor.getDocumentProvider(); IAnnotationModel annotationModel = idp.getAnnotationModel(editor.getEditorInput()); Iterator<Annotation> annotationIterator = annotationModel.getAnnotationIterator(); for (Annotation annotation : Lists.newArrayList(annotationIterator)) { if (isCodeLocationAnnotation(annotation)) { annotationModel.removeAnnotation(annotation); } } }
@SuppressWarnings(STR) void function(ITextEditor editor) { IDocumentProvider idp = editor.getDocumentProvider(); IAnnotationModel annotationModel = idp.getAnnotationModel(editor.getEditorInput()); Iterator<Annotation> annotationIterator = annotationModel.getAnnotationIterator(); for (Annotation annotation : Lists.newArrayList(annotationIterator)) { if (isCodeLocationAnnotation(annotation)) { annotationModel.removeAnnotation(annotation); } } }
/** * Remove all existing location highlighting for the file currently opened in an editor. * * To gain access to an editor, use {@link JavaEditorConnector#openEditor(JavaSoftwareElement)}. * * @param editor * The editor to reset the annotations in. */
Remove all existing location highlighting for the file currently opened in an editor. To gain access to an editor, use <code>JavaEditorConnector#openEditor(JavaSoftwareElement)</code>
resetLocationHighlighting
{ "repo_name": "kopl/SPLevo", "path": "UI/org.splevo.ui/src/org/splevo/ui/sourceconnection/jdt/JavaEditorConnector.java", "license": "epl-1.0", "size": 13125 }
[ "com.google.common.collect.Lists", "java.util.Iterator", "org.eclipse.jface.text.source.Annotation", "org.eclipse.jface.text.source.IAnnotationModel", "org.eclipse.ui.texteditor.IDocumentProvider", "org.eclipse.ui.texteditor.ITextEditor" ]
import com.google.common.collect.Lists; import java.util.Iterator; import org.eclipse.jface.text.source.Annotation; import org.eclipse.jface.text.source.IAnnotationModel; import org.eclipse.ui.texteditor.IDocumentProvider; import org.eclipse.ui.texteditor.ITextEditor;
import com.google.common.collect.*; import java.util.*; import org.eclipse.jface.text.source.*; import org.eclipse.ui.texteditor.*;
[ "com.google.common", "java.util", "org.eclipse.jface", "org.eclipse.ui" ]
com.google.common; java.util; org.eclipse.jface; org.eclipse.ui;
791,356
private boolean doAccept() { boolean accepted = false; SocketChannel sc = null; try { sc = acceptSocket.accept(); accepted = true; InetAddress ia = sc.socket().getInetAddress(); int cnxncount = getClientCnxnCount(ia); if (maxClientCnxns > 0 && cnxncount >= maxClientCnxns){ throw new IOException("Too many connections from " + ia + " - max is " + maxClientCnxns ); } LOG.info("Accepted socket connection from " + sc.socket().getRemoteSocketAddress()); sc.configureBlocking(false); // Round-robin assign this connection to a selector thread if (!selectorIterator.hasNext()) { selectorIterator = selectorThreads.iterator(); } SelectorThread selectorThread = selectorIterator.next(); if (!selectorThread.addAcceptedConnection(sc)) { throw new IOException( "Unable to add connection to selector queue" + (stopped ? " (shutdown in progress)" : "")); } acceptErrorLogger.flush(); } catch (IOException e) { // accept, maxClientCnxns, configureBlocking acceptErrorLogger.rateLimitLog( "Error accepting new connection: " + e.getMessage()); fastCloseSock(sc); } return accepted; } } class SelectorThread extends AbstractSelectThread { private final int id; private final Queue<SocketChannel> acceptedQueue; private final Queue<SelectionKey> updateQueue; public SelectorThread(int id) throws IOException { super("NIOServerCxnFactory.SelectorThread-" + id); this.id = id; acceptedQueue = new LinkedBlockingQueue<SocketChannel>(); updateQueue = new LinkedBlockingQueue<SelectionKey>(); }
boolean function() { boolean accepted = false; SocketChannel sc = null; try { sc = acceptSocket.accept(); accepted = true; InetAddress ia = sc.socket().getInetAddress(); int cnxncount = getClientCnxnCount(ia); if (maxClientCnxns > 0 && cnxncount >= maxClientCnxns){ throw new IOException(STR + ia + STR + maxClientCnxns ); } LOG.info(STR + sc.socket().getRemoteSocketAddress()); sc.configureBlocking(false); if (!selectorIterator.hasNext()) { selectorIterator = selectorThreads.iterator(); } SelectorThread selectorThread = selectorIterator.next(); if (!selectorThread.addAcceptedConnection(sc)) { throw new IOException( STR + (stopped ? STR : STRError accepting new connection: STRNIOServerCxnFactory.SelectorThread-" + id); this.id = id; acceptedQueue = new LinkedBlockingQueue<SocketChannel>(); updateQueue = new LinkedBlockingQueue<SelectionKey>(); }
/** * Accept new socket connections. Enforces maximum number of connections * per client IP address. Round-robin assigns to selector thread for * handling. Returns whether pulled a connection off the accept queue * or not. If encounters an error attempts to fast close the socket. * * @return whether was able to accept a connection or not */
Accept new socket connections. Enforces maximum number of connections per client IP address. Round-robin assigns to selector thread for handling. Returns whether pulled a connection off the accept queue or not. If encounters an error attempts to fast close the socket
doAccept
{ "repo_name": "project-zerus/zookeeper", "path": "src/java/main/org/apache/zookeeper/server/NIOServerCnxnFactory.java", "license": "apache-2.0", "size": 35377 }
[ "java.io.IOException", "java.net.InetAddress", "java.nio.channels.SelectionKey", "java.nio.channels.SocketChannel", "java.util.concurrent.LinkedBlockingQueue" ]
import java.io.IOException; import java.net.InetAddress; import java.nio.channels.SelectionKey; import java.nio.channels.SocketChannel; import java.util.concurrent.LinkedBlockingQueue;
import java.io.*; import java.net.*; import java.nio.channels.*; import java.util.concurrent.*;
[ "java.io", "java.net", "java.nio", "java.util" ]
java.io; java.net; java.nio; java.util;
2,020,811
public void update(final UmaPermissionRepresentation permission) { if (permission == null) { throw new IllegalArgumentException("Permission must not be null"); } if (permission.getId() == null) { throw new IllegalArgumentException("Permission id must not be null"); }
void function(final UmaPermissionRepresentation permission) { if (permission == null) { throw new IllegalArgumentException(STR); } if (permission.getId() == null) { throw new IllegalArgumentException(STR); }
/** * Updates an existing user-managed permission * * @param permission the permission to update */
Updates an existing user-managed permission
update
{ "repo_name": "keycloak/keycloak", "path": "authz/client/src/main/java/org/keycloak/authorization/client/resource/PolicyResource.java", "license": "apache-2.0", "size": 7846 }
[ "org.keycloak.representations.idm.authorization.UmaPermissionRepresentation" ]
import org.keycloak.representations.idm.authorization.UmaPermissionRepresentation;
import org.keycloak.representations.idm.authorization.*;
[ "org.keycloak.representations" ]
org.keycloak.representations;
1,570,921
public void visit(SmcMap map) { String packageName = map.getFSM().getPackage(); String context = map.getFSM().getContext(); String mapName = map.getName(); // If a package has been specified, if (packageName != null && packageName.length() > 0) { context = packageName + "_" + context; } for (SmcState state: map.getStates()) { _source.print("extern const struct "); _source.print(context); _source.print("State "); if (packageName != null && packageName.length() > 0) { _source.print(packageName); _source.print("_"); } _source.print(mapName); _source.print("_"); _source.print(state.getInstanceName()); _source.println(";"); } return; } // end of visit(SmcMap) // // end of SmcVisitor Abstract Method Impelementation. //----------------------------------------------------------- //--------------------------------------------------------------- // Member data // } // end of class SmcHeaderCGenerator // // CHANGE LOG // $Log: SmcHeaderCGenerator.java,v $ // Revision 1.13 2012/04/21 10:04:06 fperrad // fix 3518773 : remove additional ';' with '%declare' // // Revision 1.12 2012/01/28 18:03:02 fperrad // fix 3476060 : generate both C functions and macros // // Revision 1.11 2010/12/01 15:29:09 fperrad // C: refactor when package // // Revision 1.10 2010/09/21 08:16:00 fperrad // refactor C generation // // Revision 1.9 2010/02/15 18:05:43 fperrad // fix 2950619 : make distinction between source filename (*.sm) and target filename. // // Revision 1.8 2009/11/25 22:30:19 cwrapp // Fixed problem between %fsmclass and sm file names. // // Revision 1.7 2009/11/24 20:42:39 cwrapp // v. 6.0.1 update // // Revision 1.6 2009/11/02 09:57:43 fperrad // fix C generation // // Revision 1.5 2009/09/12 21:44:49 kgreg99 // Implemented feature req. #2718941 - user defined generated class name. // A new statement was added to the syntax: %fsmclass class_name // It is optional. If not used, generated class is called as before "XxxContext" where Xxx is context class name as entered via %class statement. // If used, generated class is called asrequested. // Following language generators are touched: // c, c++, java, c#, objc, lua, groovy, scala, tcl, VB // This feature is not tested yet ! // Maybe it will be necessary to modify also the output file name. // // Revision 1.4 2009/09/05 15:39:20 cwrapp // Checking in fixes for 1944542, 1983929, 2731415, 2803547 and feature 2797126. // // Revision 1.3 2009/03/27 15:26:55 fperrad // C : the function Context_EnterStartState is generated only if FSM hasEntryActions // // Revision 1.2 2009/03/27 09:41:47 cwrapp // Added F. Perrad changes back in. // // Revision 1.1 2009/03/01 18:20:42 cwrapp // Preliminary v. 6.0.0 commit. //
void function(SmcMap map) { String packageName = map.getFSM().getPackage(); String context = map.getFSM().getContext(); String mapName = map.getName(); if (packageName != null && packageName.length() > 0) { context = packageName + "_" + context; } for (SmcState state: map.getStates()) { _source.print(STR); _source.print(context); _source.print(STR); if (packageName != null && packageName.length() > 0) { _source.print(packageName); _source.print("_"); } _source.print(mapName); _source.print("_"); _source.print(state.getInstanceName()); _source.println(";"); } return; } //
/** * Emits C header code for the FSM map. * @param map emit Groovy code for this map. */
Emits C header code for the FSM map
visit
{ "repo_name": "Praveen-1987/devstack-Quantumleap", "path": "smc/net/sf/smc/generator/SmcHeaderCGenerator.java", "license": "apache-2.0", "size": 15721 }
[ "net.sf.smc.model.SmcMap", "net.sf.smc.model.SmcState" ]
import net.sf.smc.model.SmcMap; import net.sf.smc.model.SmcState;
import net.sf.smc.model.*;
[ "net.sf.smc" ]
net.sf.smc;
2,725,220
EList<StatisticEntry> getEntries();
EList<StatisticEntry> getEntries();
/** * Returns the value of the '<em><b>Entries</b></em>' containment reference list. * The list contents are of type {@link hu.bme.mit.inf.dslreasoner.logic.model.logicresult.StatisticEntry}. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Entries</em>' containment reference list isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Entries</em>' containment reference list. * @see hu.bme.mit.inf.dslreasoner.logic.model.logicresult.LogicresultPackage#getStatistics_Entries() * @model containment="true" * @generated */
Returns the value of the 'Entries' containment reference list. The list contents are of type <code>hu.bme.mit.inf.dslreasoner.logic.model.logicresult.StatisticEntry</code>. If the meaning of the 'Entries' containment reference list isn't clear, there really should be more of a description here...
getEntries
{ "repo_name": "viatra/VIATRA-Generator", "path": "Framework/hu.bme.mit.inf.dslreasoner.logic.model/ecore-gen/hu/bme/mit/inf/dslreasoner/logic/model/logicresult/Statistics.java", "license": "epl-1.0", "size": 4788 }
[ "org.eclipse.emf.common.util.EList" ]
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,878,024
public void fetchConsents( String customerSecret, String connectionSecret, FetchConsentsResult callback ) { new ConsentsConnector(callback).fetchConsents(customerSecret, connectionSecret); }
void function( String customerSecret, String connectionSecret, FetchConsentsResult callback ) { new ConsentsConnector(callback).fetchConsents(customerSecret, connectionSecret); }
/** * You can see the list of consents of Connection. * The consents are sorted in ascending order of their ID, so the newest consents will come last. * * Result is returned through callback. * * @param customerSecret current Customer secret code * @param connectionSecret secret code of the Connection * @param callback callback for request result */
You can see the list of consents of Connection. The consents are sorted in ascending order of their ID, so the newest consents will come last. Result is returned through callback
fetchConsents
{ "repo_name": "saltedge/saltedge-android", "path": "saltedge-library/src/main/java/com/saltedge/sdk/network/SERequestManager.java", "license": "mit", "size": 31132 }
[ "com.saltedge.sdk.connector.ConsentsConnector", "com.saltedge.sdk.interfaces.FetchConsentsResult" ]
import com.saltedge.sdk.connector.ConsentsConnector; import com.saltedge.sdk.interfaces.FetchConsentsResult;
import com.saltedge.sdk.connector.*; import com.saltedge.sdk.interfaces.*;
[ "com.saltedge.sdk" ]
com.saltedge.sdk;
2,177,539
public String getXmlByTagName(String tagName) { String returnVar = null; Node node = originalDoc.getElementsByTagName(tagName).getLength() > 0 ? originalDoc .getElementsByTagName(tagName).item(0) : null; if (null != node) { returnVar = transform(node); } return returnVar; }
String function(String tagName) { String returnVar = null; Node node = originalDoc.getElementsByTagName(tagName).getLength() > 0 ? originalDoc .getElementsByTagName(tagName).item(0) : null; if (null != node) { returnVar = transform(node); } return returnVar; }
/** * Gets the xml by tag name. * * @param tagName * the tag name * @return the xml by tag name */
Gets the xml by tag name
getXmlByTagName
{ "repo_name": "MeasureAuthoringTool/MeasureAuthoringTool_LatestSprint", "path": "mat/src/main/java/mat/server/util/XmlProcessor.java", "license": "cc0-1.0", "size": 46332 }
[ "org.w3c.dom.Node" ]
import org.w3c.dom.Node;
import org.w3c.dom.*;
[ "org.w3c.dom" ]
org.w3c.dom;
1,902,365
public void addPropertyChangeListener(PropertyChangeListener l) { getPropertyChangeSupport().addPropertyChangeListener(l); }
void function(PropertyChangeListener l) { getPropertyChangeSupport().addPropertyChangeListener(l); }
/** * Add a property listener to listen to all properties of this class. * @param l The property listener to add. * @see #removePropertyChangeListener(PropertyChangeListener) */
Add a property listener to listen to all properties of this class
addPropertyChangeListener
{ "repo_name": "MHTaleb/Encologim", "path": "lib/JasperReport/src/net/sf/jasperreports/engine/design/JRDesignQuery.java", "license": "gpl-3.0", "size": 7867 }
[ "java.beans.PropertyChangeListener" ]
import java.beans.PropertyChangeListener;
import java.beans.*;
[ "java.beans" ]
java.beans;
900,500
public void debugDeniedClassAccess(String clazz, Class[] classes) { StringBuffer b = new StringBuffer(); b.append("DENY: ClassAccessCheck: " + clazz + "\n"); appendClasses(b, classes); debug(Level.WARNING, b.toString()); }
void function(String clazz, Class[] classes) { StringBuffer b = new StringBuffer(); b.append(STR + clazz + "\n"); appendClasses(b, classes); debug(Level.WARNING, b.toString()); }
/** * Called by the {@link SandboxSecurityManager} when class access was denied and * the context is in debug mode. * * @see #setDebug(boolean) * @param clazz * @param classes */
Called by the <code>SandboxSecurityManager</code> when class access was denied and the context is in debug mode
debugDeniedClassAccess
{ "repo_name": "csm/java-sandbox", "path": "src/main/java/net/datenwerke/sandbox/SandboxContext.java", "license": "lgpl-2.1", "size": 37421 }
[ "java.util.logging.Level" ]
import java.util.logging.Level;
import java.util.logging.*;
[ "java.util" ]
java.util;
1,792,198
public static BigDecimal parseFromNumberStringPercentage(String numberString) { if (numberString != null) { return new BigDecimal(numberString.replaceAll("--", "0").replaceAll("\\s|%|>|<", "")); } return null; }
static BigDecimal function(String numberString) { if (numberString != null) { return new BigDecimal(numberString.replaceAll("--", "0").replaceAll(STR, "")); } return null; }
/** * Finds out the number format in {@code String} format, and parse the number to * {@code BigDecimal} format. * * Mainly use for the ugly "< 10%", "> 90%" or "--" numbers from the API. * * @param numberString the number in {@code String} format * @return the {@code BigDecimal} that was parsed from the {@code String}. If the number format is * not recognized, than {@code null} is returned. */
Finds out the number format in String format, and parse the number to BigDecimal format. Mainly use for the ugly " 90%" or "--" numbers from the API
parseFromNumberStringPercentage
{ "repo_name": "haveal/aw-reporting", "path": "aw-reporting-model/src/main/java/com/google/api/ads/adwords/awreporting/model/util/BigDecimalUtil.java", "license": "apache-2.0", "size": 4033 }
[ "java.math.BigDecimal" ]
import java.math.BigDecimal;
import java.math.*;
[ "java.math" ]
java.math;
785,104
public float getSpeed() { if ( speed == null ) { speed = (SFFloat)getField( "speed" ); } return( speed.getValue( ) ); }
float function() { if ( speed == null ) { speed = (SFFloat)getField( "speed" ); } return( speed.getValue( ) ); }
/** Return the speed float value. * @return The speed float value. */
Return the speed float value
getSpeed
{ "repo_name": "Norkart/NK-VirtualGlobe", "path": "Xj3D/src/java/org/xj3d/sai/external/node/particlesystems/SAIPolylineEmitter.java", "license": "gpl-2.0", "size": 6091 }
[ "org.web3d.x3d.sai.SFFloat" ]
import org.web3d.x3d.sai.SFFloat;
import org.web3d.x3d.sai.*;
[ "org.web3d.x3d" ]
org.web3d.x3d;
5,570
// --------------------------------------------------------------------------------------------------------|| // ClassName: ResourceRefType ElementName: javaee:res-authType ElementType : res-auth // MaxOccurs: - isGeneric: true isAttribute: false isEnum: true isDataType: false // --------------------------------------------------------------------------------------------------------|| public ResourceRefType<T> resAuth(ResAuthType resAuth) { childNode.getOrCreate("res-auth").text(resAuth); return this; }
ResourceRefType<T> function(ResAuthType resAuth) { childNode.getOrCreate(STR).text(resAuth); return this; }
/** * Sets the <code>res-auth</code> element * @param resAuth the value for the element <code>res-auth</code> * @return the current instance of <code>ResourceRefType<T></code> */
Sets the <code>res-auth</code> element
resAuth
{ "repo_name": "forge/javaee-descriptors", "path": "impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/javaee7/ResourceRefTypeImpl.java", "license": "epl-1.0", "size": 15687 }
[ "org.jboss.shrinkwrap.descriptor.api.javaee7.ResAuthType", "org.jboss.shrinkwrap.descriptor.api.javaee7.ResourceRefType" ]
import org.jboss.shrinkwrap.descriptor.api.javaee7.ResAuthType; import org.jboss.shrinkwrap.descriptor.api.javaee7.ResourceRefType;
import org.jboss.shrinkwrap.descriptor.api.javaee7.*;
[ "org.jboss.shrinkwrap" ]
org.jboss.shrinkwrap;
2,228,211
@Override public Streamlet<R> repartition(int numPartitions, SerializableBiFunction<R, Integer, List<Integer>> partitionFn) { RemapStreamlet<R> retval = new RemapStreamlet<>(this, partitionFn); retval.setNumPartitions(numPartitions); addChild(retval); return retval; }
Streamlet<R> function(int numPartitions, SerializableBiFunction<R, Integer, List<Integer>> partitionFn) { RemapStreamlet<R> retval = new RemapStreamlet<>(this, partitionFn); retval.setNumPartitions(numPartitions); addChild(retval); return retval; }
/** * A more generalized version of repartition where a user can determine which partitions * any particular tuple should go to */
A more generalized version of repartition where a user can determine which partitions any particular tuple should go to
repartition
{ "repo_name": "ashvina/heron", "path": "heron/api/src/java/org/apache/heron/streamlet/impl/StreamletImpl.java", "license": "apache-2.0", "size": 19552 }
[ "java.util.List", "org.apache.heron.streamlet.SerializableBiFunction", "org.apache.heron.streamlet.Streamlet", "org.apache.heron.streamlet.impl.streamlets.RemapStreamlet" ]
import java.util.List; import org.apache.heron.streamlet.SerializableBiFunction; import org.apache.heron.streamlet.Streamlet; import org.apache.heron.streamlet.impl.streamlets.RemapStreamlet;
import java.util.*; import org.apache.heron.streamlet.*; import org.apache.heron.streamlet.impl.streamlets.*;
[ "java.util", "org.apache.heron" ]
java.util; org.apache.heron;
1,011,894
public static Border createBevelBorder (int type, Color highlightOuter, Color highlightInner, Color shadowOuter, Color shadowInner) { return new BevelBorder (type, highlightOuter, highlightInner, shadowOuter, shadowInner); }
static Border function (int type, Color highlightOuter, Color highlightInner, Color shadowOuter, Color shadowInner) { return new BevelBorder (type, highlightOuter, highlightInner, shadowOuter, shadowInner); }
/** * Create a beveled border of the specified type, using the specified colors * for the inner and outer highlight and shadow areas. * * @param type An int specifying either BevelBorder.LOWERED or * BevelBorder.RAISED * @param highlightOuter A Color object for the outer edge of the * highlight area * @param highlightInner A Color object for the inner edge of the * highlight area * @param shadowOuter A Color object for the outer edge of the shadow area * @param shadowInner A Color object for the inner edge of the shadow area * * @return The Border object */
Create a beveled border of the specified type, using the specified colors for the inner and outer highlight and shadow areas
createBevelBorder
{ "repo_name": "unofficial-opensource-apple/gcc_40", "path": "libjava/javax/swing/BorderFactory.java", "license": "gpl-2.0", "size": 16495 }
[ "java.awt.Color", "javax.swing.border.BevelBorder", "javax.swing.border.Border" ]
import java.awt.Color; import javax.swing.border.BevelBorder; import javax.swing.border.Border;
import java.awt.*; import javax.swing.border.*;
[ "java.awt", "javax.swing" ]
java.awt; javax.swing;
499,185
default SftpEndpointConsumerBuilder move(Expression move) { doSetProperty("move", move); return this; }
default SftpEndpointConsumerBuilder move(Expression move) { doSetProperty("move", move); return this; }
/** * Expression (such as Simple Language) used to dynamically set the * filename when moving it after processing. To move files into a .done * subdirectory just enter .done. * * The option is a: <code>org.apache.camel.Expression</code> type. * * Group: filter */
Expression (such as Simple Language) used to dynamically set the filename when moving it after processing. To move files into a .done subdirectory just enter .done. The option is a: <code>org.apache.camel.Expression</code> type. Group: filter
move
{ "repo_name": "nicolaferraro/camel", "path": "core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/SftpEndpointBuilderFactory.java", "license": "apache-2.0", "size": 228432 }
[ "org.apache.camel.Expression" ]
import org.apache.camel.Expression;
import org.apache.camel.*;
[ "org.apache.camel" ]
org.apache.camel;
1,330,451
public HttpClientRequest get(Env env, StringValue uri, Value handler) { PhpTypes.assertCallable(env, handler, "Argument to Vertx\\Http\\HttpClient::get() must be callable."); return new HttpClientRequest(client.get(uri.toString(), createResponseHandler(env, handler))); }
HttpClientRequest function(Env env, StringValue uri, Value handler) { PhpTypes.assertCallable(env, handler, STR); return new HttpClientRequest(client.get(uri.toString(), createResponseHandler(env, handler))); }
/** * Executes a GET request. */
Executes a GET request
get
{ "repo_name": "khasinski/mod-lang-php", "path": "src/main/java/io/vertx/lang/php/http/HttpClient.java", "license": "mit", "size": 8868 }
[ "com.caucho.quercus.env.Env", "com.caucho.quercus.env.StringValue", "com.caucho.quercus.env.Value", "io.vertx.lang.php.util.PhpTypes" ]
import com.caucho.quercus.env.Env; import com.caucho.quercus.env.StringValue; import com.caucho.quercus.env.Value; import io.vertx.lang.php.util.PhpTypes;
import com.caucho.quercus.env.*; import io.vertx.lang.php.util.*;
[ "com.caucho.quercus", "io.vertx.lang" ]
com.caucho.quercus; io.vertx.lang;
1,407,570
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof CPointerType)) { return false; } CPointerType other = (CPointerType) obj; return isConst == other.isConst && isVolatile == other.isVolatile && Objects.equals(type, other.type); }
boolean function(Object obj) { if (obj == this) { return true; } if (!(obj instanceof CPointerType)) { return false; } CPointerType other = (CPointerType) obj; return isConst == other.isConst && isVolatile == other.isVolatile && Objects.equals(type, other.type); }
/** * Be careful, this method compares the CType as it is to the given object, * typedefs won't be resolved. If you want to compare the type without having * typedefs in it use #getCanonicalType().equals() */
Be careful, this method compares the CType as it is to the given object, typedefs won't be resolved. If you want to compare the type without having typedefs in it use #getCanonicalType().equals()
equals
{ "repo_name": "nishanttotla/predator", "path": "cpachecker/src/org/sosy_lab/cpachecker/cfa/types/c/CPointerType.java", "license": "gpl-3.0", "size": 3707 }
[ "java.util.Objects" ]
import java.util.Objects;
import java.util.*;
[ "java.util" ]
java.util;
1,739,605
@Override public V getUnchecked(K key) { try { return get(key); } catch (ExecutionException e) { throw new UncheckedExecutionException(e); } }
V function(K key) { try { return get(key); } catch (ExecutionException e) { throw new UncheckedExecutionException(e); } }
/** * Get the value, loading it if needed. * <p> * If there is an exception loading, an UncheckedExecutionException is * thrown. * * @param key the key * @return the value * @throws UncheckedExecutionException */
Get the value, loading it if needed. If there is an exception loading, an UncheckedExecutionException is thrown
getUnchecked
{ "repo_name": "meggermo/jackrabbit-oak", "path": "oak-core/src/main/java/org/apache/jackrabbit/oak/cache/CacheLIRS.java", "license": "apache-2.0", "size": 58359 }
[ "com.google.common.util.concurrent.UncheckedExecutionException", "java.util.concurrent.ExecutionException" ]
import com.google.common.util.concurrent.UncheckedExecutionException; import java.util.concurrent.ExecutionException;
import com.google.common.util.concurrent.*; import java.util.concurrent.*;
[ "com.google.common", "java.util" ]
com.google.common; java.util;
673,994
private void buildPurposeEnvironment() { lemmaString.replace("_"," "); showedLemma = new Label(lemmaString, skin); showedLemma.setColor(Color.WHITE); showedLemma.setBounds(Gdx.graphics.getWidth()/2.3f, Gdx.graphics.getHeight()/8*7, firstWindow.getWidth()/1.1f, firstWindow.getWidth()/3.3f); glossString.trim(); if ( glossString.length() >30) glossString.subSequence(0, 30); glossString+=" [...]"; showedGloss = new Label(glossString, skin); showedGloss.setColor(Color.GRAY); showedGloss.setBounds(Gdx.graphics.getWidth()/10, Gdx.graphics.getHeight()/9.3f, Gdx.graphics.getWidth()/3, Gdx.graphics.getHeight()/7); firstAnnImage = new Image(firstAnnImageTexture); secondAnnImage = new Image(secondAnnImageTexture); thirdAnnImage = new Image(thirdAnnImageTexture); firstAnnImage.addListener(firstImageListener); secondAnnImage.addListener(secondImageListener); thirdAnnImage.addListener(thirdImageListener); firstWindow.add(firstAnnImage); secondWindow.add(secondAnnImage); thirdWindow.add(thirdAnnImage); firstAnnImage.setBounds( firstWindow.getWidth()/16.5f, firstWindow.getHeight()/4.16f, firstWindow.getWidth()/1.1f, firstWindow.getHeight()/1.47f); secondAnnImage.setBounds( firstWindow.getWidth()/16.5f, firstWindow.getHeight()/4.16f, firstWindow.getWidth()/1.1f, firstWindow.getHeight()/1.47f); thirdAnnImage.setBounds( firstWindow.getWidth()/16.5f, firstWindow.getHeight()/4.16f, firstWindow.getWidth()/1.1f, firstWindow.getHeight()/1.47f); currentGroup.addActor(showedLemma); currentGroup.addActor(showedGloss); }
void function() { lemmaString.replace("_"," "); showedLemma = new Label(lemmaString, skin); showedLemma.setColor(Color.WHITE); showedLemma.setBounds(Gdx.graphics.getWidth()/2.3f, Gdx.graphics.getHeight()/8*7, firstWindow.getWidth()/1.1f, firstWindow.getWidth()/3.3f); glossString.trim(); if ( glossString.length() >30) glossString.subSequence(0, 30); glossString+=STR; showedGloss = new Label(glossString, skin); showedGloss.setColor(Color.GRAY); showedGloss.setBounds(Gdx.graphics.getWidth()/10, Gdx.graphics.getHeight()/9.3f, Gdx.graphics.getWidth()/3, Gdx.graphics.getHeight()/7); firstAnnImage = new Image(firstAnnImageTexture); secondAnnImage = new Image(secondAnnImageTexture); thirdAnnImage = new Image(thirdAnnImageTexture); firstAnnImage.addListener(firstImageListener); secondAnnImage.addListener(secondImageListener); thirdAnnImage.addListener(thirdImageListener); firstWindow.add(firstAnnImage); secondWindow.add(secondAnnImage); thirdWindow.add(thirdAnnImage); firstAnnImage.setBounds( firstWindow.getWidth()/16.5f, firstWindow.getHeight()/4.16f, firstWindow.getWidth()/1.1f, firstWindow.getHeight()/1.47f); secondAnnImage.setBounds( firstWindow.getWidth()/16.5f, firstWindow.getHeight()/4.16f, firstWindow.getWidth()/1.1f, firstWindow.getHeight()/1.47f); thirdAnnImage.setBounds( firstWindow.getWidth()/16.5f, firstWindow.getHeight()/4.16f, firstWindow.getWidth()/1.1f, firstWindow.getHeight()/1.47f); currentGroup.addActor(showedLemma); currentGroup.addActor(showedGloss); }
/** * PRIVATE METHOD : This method builds the purpose environment on this screen, setting up all the fields as needed. * IT MUST BE CALLED after communications with the main server. */
PRIVATE METHOD : This method builds the purpose environment on this screen, setting up all the fields as needed. IT MUST BE CALLED after communications with the main server
buildPurposeEnvironment
{ "repo_name": "PetriccaRcc/SillyMonkeySolitaire", "path": "core/src/it/uniroma1/sms/screen/menuscreen/PurposeMenuScreen.java", "license": "gpl-3.0", "size": 12804 }
[ "com.badlogic.gdx.Gdx", "com.badlogic.gdx.graphics.Color", "com.badlogic.gdx.scenes.scene2d.ui.Image", "com.badlogic.gdx.scenes.scene2d.ui.Label" ]
import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.scenes.scene2d.ui.Image; import com.badlogic.gdx.scenes.scene2d.ui.Label;
import com.badlogic.gdx.*; import com.badlogic.gdx.graphics.*; import com.badlogic.gdx.scenes.scene2d.ui.*;
[ "com.badlogic.gdx" ]
com.badlogic.gdx;
243,415
public GeneralizationOfAssocClassMatch getOneArbitraryMatch(final AssociationClass pAc, final org.eclipse.uml2.uml.Class pSpec) { return rawGetOneArbitraryMatch(new Object[]{pAc, pSpec}); }
GeneralizationOfAssocClassMatch function(final AssociationClass pAc, final org.eclipse.uml2.uml.Class pSpec) { return rawGetOneArbitraryMatch(new Object[]{pAc, pSpec}); }
/** * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. * Neither determinism nor randomness of selection is guaranteed. * @param pAc the fixed value of pattern parameter ac, or null if not bound. * @param pSpec the fixed value of pattern parameter spec, or null if not bound. * @return a match represented as a GeneralizationOfAssocClassMatch object, or null if no match is found. * */
Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. Neither determinism nor randomness of selection is guaranteed
getOneArbitraryMatch
{ "repo_name": "ELTE-Soft/xUML-RT-Executor", "path": "plugins/hu.eltesoft.modelexecution.validation/src-gen/hu/eltesoft/modelexecution/validation/GeneralizationOfAssocClassMatcher.java", "license": "epl-1.0", "size": 14221 }
[ "hu.eltesoft.modelexecution.validation.GeneralizationOfAssocClassMatch", "org.eclipse.uml2.uml.AssociationClass" ]
import hu.eltesoft.modelexecution.validation.GeneralizationOfAssocClassMatch; import org.eclipse.uml2.uml.AssociationClass;
import hu.eltesoft.modelexecution.validation.*; import org.eclipse.uml2.uml.*;
[ "hu.eltesoft.modelexecution", "org.eclipse.uml2" ]
hu.eltesoft.modelexecution; org.eclipse.uml2;
393,295
@Override @Generated(value = "com.sun.tools.xjc.Driver", date = "2014-09-19T03:09:21-06:00", comment = "JAXB RI v2.2.6") public String toString() { return ToStringBuilder.reflectionToString(this, JAXBToStringStyle.MULTI_LINE_STYLE); }
@Generated(value = STR, date = STR, comment = STR) String function() { return ToStringBuilder.reflectionToString(this, JAXBToStringStyle.MULTI_LINE_STYLE); }
/** * Generates a String representation of the contents of this type. * This is an extension method, produced by the 'ts' xjc plugin * */
Generates a String representation of the contents of this type. This is an extension method, produced by the 'ts' xjc plugin
toString
{ "repo_name": "angecab10/travelport-uapi-tutorial", "path": "src/com/travelport/schema/common_v28_0/Payment.java", "license": "gpl-3.0", "size": 12711 }
[ "javax.annotation.Generated", "org.apache.commons.lang.builder.ToStringBuilder", "org.apache.cxf.xjc.runtime.JAXBToStringStyle" ]
import javax.annotation.Generated; import org.apache.commons.lang.builder.ToStringBuilder; import org.apache.cxf.xjc.runtime.JAXBToStringStyle;
import javax.annotation.*; import org.apache.commons.lang.builder.*; import org.apache.cxf.xjc.runtime.*;
[ "javax.annotation", "org.apache.commons", "org.apache.cxf" ]
javax.annotation; org.apache.commons; org.apache.cxf;
1,178,805
public void shuffle() { Collections.shuffle(this); }
void function() { Collections.shuffle(this); }
/** * Shuffles this Deck */
Shuffles this Deck
shuffle
{ "repo_name": "Vodorod/EECS-132", "path": "P5/Deck.java", "license": "gpl-3.0", "size": 4290 }
[ "java.util.Collections" ]
import java.util.Collections;
import java.util.*;
[ "java.util" ]
java.util;
2,843,920
protected Object readBytes(Object old, Decoder in) throws IOException { return in.readBytes(old instanceof ByteBuffer ? (ByteBuffer) old : null); }
Object function(Object old, Decoder in) throws IOException { return in.readBytes(old instanceof ByteBuffer ? (ByteBuffer) old : null); }
/** Called to read byte arrays. Subclasses may override to use a different * byte array representation. By default, this calls {@link * Decoder#readBytes(ByteBuffer)}.*/
Called to read byte arrays. Subclasses may override to use a different byte array representation. By default, this calls {@link
readBytes
{ "repo_name": "wojtkiewicz/avro", "path": "lang/java/avro/src/main/java/org/apache/avro/generic/GenericDatumReader.java", "license": "apache-2.0", "size": 21343 }
[ "java.io.IOException", "java.nio.ByteBuffer", "org.apache.avro.io.Decoder" ]
import java.io.IOException; import java.nio.ByteBuffer; import org.apache.avro.io.Decoder;
import java.io.*; import java.nio.*; import org.apache.avro.io.*;
[ "java.io", "java.nio", "org.apache.avro" ]
java.io; java.nio; org.apache.avro;
311,873
public DescendantSelector createDescendantSelector (Selector parent, SimpleSelector descendant) throws CSSException { return new CSSDescendantSelector(parent, descendant); }
DescendantSelector function (Selector parent, SimpleSelector descendant) throws CSSException { return new CSSDescendantSelector(parent, descendant); }
/** * <b>SAC</b>: Implements {@link * SelectorFactory#createDescendantSelector(Selector,SimpleSelector)}. */
SAC: Implements <code>SelectorFactory#createDescendantSelector(Selector,SimpleSelector)</code>
createDescendantSelector
{ "repo_name": "Uni-Sol/batik", "path": "sources/org/apache/batik/css/engine/sac/CSSSelectorFactory.java", "license": "apache-2.0", "size": 5709 }
[ "org.w3c.css.sac.CSSException", "org.w3c.css.sac.DescendantSelector", "org.w3c.css.sac.Selector", "org.w3c.css.sac.SimpleSelector" ]
import org.w3c.css.sac.CSSException; import org.w3c.css.sac.DescendantSelector; import org.w3c.css.sac.Selector; import org.w3c.css.sac.SimpleSelector;
import org.w3c.css.sac.*;
[ "org.w3c.css" ]
org.w3c.css;
707,231
public AesContent generateSecuredPayload(String customerId, Query query) throws GeneralSecurityException { return generateSecuredPayload(customerId, clientKey, query); }
AesContent function(String customerId, Query query) throws GeneralSecurityException { return generateSecuredPayload(customerId, clientKey, query); }
/** * <code> * Generates a secured payload * </code> * @param customerId The customerId as seen in Command Center. Ensure this is not the subdomain, which can be `customerId-cors.groupbycloud.com` * @param query The query to encrypt */
<code> Generates a secured payload </code>
generateSecuredPayload
{ "repo_name": "groupby/api-java", "path": "src/main/java/com/groupbyinc/api/AbstractBridge.java", "license": "mit", "size": 19553 }
[ "com.groupbyinc.common.security.AesContent", "java.security.GeneralSecurityException" ]
import com.groupbyinc.common.security.AesContent; import java.security.GeneralSecurityException;
import com.groupbyinc.common.security.*; import java.security.*;
[ "com.groupbyinc.common", "java.security" ]
com.groupbyinc.common; java.security;
1,934,780
private boolean checkIsValid() { if ( type == null ) { return false; } boolean hasMatchers = false; if ( this.matchers != null ) { for(final TopicMatcher m : this.matchers ) { if ( m != null ) { hasMatchers = true; break; } } } if ( !hasMatchers ) { return false; } if ( name == null || name.length() == 0 ) { return false; } if ( retries < -1 ) { return false; } if ( maxParallelProcesses < 1 ) { return false; } return true; }
boolean function() { if ( type == null ) { return false; } boolean hasMatchers = false; if ( this.matchers != null ) { for(final TopicMatcher m : this.matchers ) { if ( m != null ) { hasMatchers = true; break; } } } if ( !hasMatchers ) { return false; } if ( name == null name.length() == 0 ) { return false; } if ( retries < -1 ) { return false; } if ( maxParallelProcesses < 1 ) { return false; } return true; }
/** * Check if this configuration is valid, * If it is invalid, it is ignored. */
Check if this configuration is valid, If it is invalid, it is ignored
checkIsValid
{ "repo_name": "nleite/sling", "path": "bundles/extensions/event/src/main/java/org/apache/sling/event/impl/jobs/config/InternalQueueConfiguration.java", "license": "apache-2.0", "size": 15319 }
[ "org.apache.sling.event.impl.support.TopicMatcher" ]
import org.apache.sling.event.impl.support.TopicMatcher;
import org.apache.sling.event.impl.support.*;
[ "org.apache.sling" ]
org.apache.sling;
947,993
private void ensureNoMembers(@NotNull final String className) { try { final PyPullUpPresenter sut = configureByClass(className); myMocksControl.replay(); sut.launch(); } catch (final IllegalArgumentException ignored) { return; } Assert .fail("Presenter should throw exception, but it returned list of parents instead: " + myViewConfigCapture.getValue().getParents()); }
void function(@NotNull final String className) { try { final PyPullUpPresenter sut = configureByClass(className); myMocksControl.replay(); sut.launch(); } catch (final IllegalArgumentException ignored) { return; } Assert .fail(STR + myViewConfigCapture.getValue().getParents()); }
/** * Checks that refactoring does not work for classes with out of members */
Checks that refactoring does not work for classes with out of members
ensureNoMembers
{ "repo_name": "apixandru/intellij-community", "path": "python/testSrc/com/jetbrains/python/refactoring/classes/pullUp/PyPullUpPresenterTest.java", "license": "apache-2.0", "size": 8253 }
[ "org.jetbrains.annotations.NotNull", "org.junit.Assert" ]
import org.jetbrains.annotations.NotNull; import org.junit.Assert;
import org.jetbrains.annotations.*; import org.junit.*;
[ "org.jetbrains.annotations", "org.junit" ]
org.jetbrains.annotations; org.junit;
1,732,849
@Override protected Expression handleLanguageSpecificFunction(ParserRuleContext ctx, String functionName, ArrayList<ParameterExpression> paramExpression){ if(functionName.equals("dot") && paramExpression.size() == 2) { Expression.BinaryOp bop = Expression.getBinaryOp("%*%"); Expression expr = new BinaryExpression(bop); ((BinaryExpression)expr).setLeft(paramExpression.get(0).getExpr()); ((BinaryExpression)expr).setRight(paramExpression.get(1).getExpr()); return expr; } return null; }
Expression function(ParserRuleContext ctx, String functionName, ArrayList<ParameterExpression> paramExpression){ if(functionName.equals("dot") && paramExpression.size() == 2) { Expression.BinaryOp bop = Expression.getBinaryOp("%*%"); Expression expr = new BinaryExpression(bop); ((BinaryExpression)expr).setLeft(paramExpression.get(0).getExpr()); ((BinaryExpression)expr).setRight(paramExpression.get(1).getExpr()); return expr; } return null; }
/** * For Pydml, matrix multiply is invoked using dot (A, B). This is taken from numpy.dot * For Dml, it is invoked using "%*%". The dot function call in pydml is converted to a * {@link BinaryExpression} equivalent to what is done in * DmlSyntacticValidator's exitMatrixMulExpression(MatrixMulExpressionContext). */
For Pydml, matrix multiply is invoked using dot (A, B). This is taken from numpy.dot For Dml, it is invoked using "%*%". The dot function call in pydml is converted to a <code>BinaryExpression</code> equivalent to what is done in DmlSyntacticValidator's exitMatrixMulExpression(MatrixMulExpressionContext)
handleLanguageSpecificFunction
{ "repo_name": "nakul02/systemml", "path": "src/main/java/org/apache/sysml/parser/pydml/PydmlSyntacticValidator.java", "license": "apache-2.0", "size": 68234 }
[ "java.util.ArrayList", "org.antlr.v4.runtime.ParserRuleContext", "org.apache.sysml.parser.BinaryExpression", "org.apache.sysml.parser.Expression", "org.apache.sysml.parser.ParameterExpression" ]
import java.util.ArrayList; import org.antlr.v4.runtime.ParserRuleContext; import org.apache.sysml.parser.BinaryExpression; import org.apache.sysml.parser.Expression; import org.apache.sysml.parser.ParameterExpression;
import java.util.*; import org.antlr.v4.runtime.*; import org.apache.sysml.parser.*;
[ "java.util", "org.antlr.v4", "org.apache.sysml" ]
java.util; org.antlr.v4; org.apache.sysml;
1,543,840
void setCipherFactories(List<Factory.Named<Cipher>> cipherFactories);
void setCipherFactories(List<Factory.Named<Cipher>> cipherFactories);
/** * Set the named factories for {@link Cipher}. * * @param cipherFactories a list of named factories */
Set the named factories for <code>Cipher</code>
setCipherFactories
{ "repo_name": "joprsal/sshj", "path": "src/main/java/net/schmizz/sshj/Config.java", "license": "apache-2.0", "size": 5955 }
[ "java.util.List", "net.schmizz.sshj.common.Factory", "net.schmizz.sshj.transport.cipher.Cipher" ]
import java.util.List; import net.schmizz.sshj.common.Factory; import net.schmizz.sshj.transport.cipher.Cipher;
import java.util.*; import net.schmizz.sshj.common.*; import net.schmizz.sshj.transport.cipher.*;
[ "java.util", "net.schmizz.sshj" ]
java.util; net.schmizz.sshj;
1,549,880
public void changeToNextChoice() { if (this.step >= this.maximumSteps) throw new IllegalStateException("There are no more choices."); // This is any "normal" case. this.constraintExpression = NumericEqual.newInstance(this.termFromStack, this.keys[this.step]); this.jumpTo = this.pcs[this.step]; this.step++; this.appliedState = false; }
void function() { if (this.step >= this.maximumSteps) throw new IllegalStateException(STR); this.constraintExpression = NumericEqual.newInstance(this.termFromStack, this.keys[this.step]); this.jumpTo = this.pcs[this.step]; this.step++; this.appliedState = false; }
/** * Change to the next choice. * * @throws IllegalStateException If there are no more choices. */
Change to the next choice
changeToNextChoice
{ "repo_name": "wwu-pi/muggl", "path": "muggl-core/src/de/wwu/muggl/symbolic/searchAlgorithms/choice/switching/SwitchingChoicePoint.java", "license": "gpl-3.0", "size": 12066 }
[ "de.wwu.muggl.solvers.expressions.NumericEqual" ]
import de.wwu.muggl.solvers.expressions.NumericEqual;
import de.wwu.muggl.solvers.expressions.*;
[ "de.wwu.muggl" ]
de.wwu.muggl;
958,048
@Override public void enterDotOp(@NotNull BindingExpressionParser.DotOpContext ctx) { }
@Override public void enterDotOp(@NotNull BindingExpressionParser.DotOpContext ctx) { }
/** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */
The default implementation does nothing
exitComparisonOp
{ "repo_name": "syslover33/ctank", "path": "java/android-sdk-linux_r24.4.1_src/sources/android-23/android/databinding/parser/BindingExpressionBaseListener.java", "license": "gpl-3.0", "size": 14237 }
[ "org.antlr.v4.runtime.misc.NotNull" ]
import org.antlr.v4.runtime.misc.NotNull;
import org.antlr.v4.runtime.misc.*;
[ "org.antlr.v4" ]
org.antlr.v4;
486,084
public void assignDatabaseObject(Operator op, DatabaseObject dbo) { // elements is a hash table and if we rename the operator we need to do it with care since // by modifying the name of the operator we modify its hashCode. So what we do here is to // first remove the value from the hash Entry<Operator> entry = elements.remove(op); if (entry == null) throw new NoSuchElementException("Can't find " + op); if (System.identityHashCode(entry.getElement()) != System.identityHashCode(op)) throw new NoSuchElementException("Can't find " + op); op.add(dbo); elements.put(op, entry); }
void function(Operator op, DatabaseObject dbo) { Entry<Operator> entry = elements.remove(op); if (entry == null) throw new NoSuchElementException(STR + op); if (System.identityHashCode(entry.getElement()) != System.identityHashCode(op)) throw new NoSuchElementException(STR + op); op.add(dbo); elements.put(op, entry); }
/** * Assigns the database object to the given operator. * * @param op * operator whose database object is to be removed * @param dbo * database object */
Assigns the database object to the given operator
assignDatabaseObject
{ "repo_name": "dbgroup-at-ucsc/dbtune", "path": "src/edu/ucsc/dbtune/optimizer/plan/SQLStatementPlan.java", "license": "bsd-3-clause", "size": 13284 }
[ "edu.ucsc.dbtune.metadata.DatabaseObject", "java.util.NoSuchElementException" ]
import edu.ucsc.dbtune.metadata.DatabaseObject; import java.util.NoSuchElementException;
import edu.ucsc.dbtune.metadata.*; import java.util.*;
[ "edu.ucsc.dbtune", "java.util" ]
edu.ucsc.dbtune; java.util;
1,709,679
@DELETE @Path(ONE_PERM) @Description("Deletes (by resetting to default) the permissions " + "associated with a particular user.") @Nonnull Response deletePermission(@Nonnull @PathParam("id") String id, @Nonnull @Context UriInfo ui);
@Path(ONE_PERM) @Description(STR + STR) Response deletePermission(@Nonnull @PathParam("id") String id, @Nonnull @Context UriInfo ui);
/** * Delete the permissions associated with a user, which restores them to the * default (no access unless they are the owner or have admin privileges). * * @param id * The name of the user whose permissions are to be revoked. * @param ui * Information about the URI used to access this resource. * @return An indication that the delete has been successful (or not). */
Delete the permissions associated with a user, which restores them to the default (no access unless they are the owner or have admin privileges)
deletePermission
{ "repo_name": "apache/incubator-taverna-server", "path": "taverna-server-webapp/src/main/java/org/apache/taverna/server/master/rest/TavernaServerSecurityREST.java", "license": "apache-2.0", "size": 24517 }
[ "javax.annotation.Nonnull", "javax.ws.rs.Path", "javax.ws.rs.PathParam", "javax.ws.rs.core.Context", "javax.ws.rs.core.Response", "javax.ws.rs.core.UriInfo", "org.apache.cxf.jaxrs.model.wadl.Description" ]
import javax.annotation.Nonnull; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.core.Context; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo; import org.apache.cxf.jaxrs.model.wadl.Description;
import javax.annotation.*; import javax.ws.rs.*; import javax.ws.rs.core.*; import org.apache.cxf.jaxrs.model.wadl.*;
[ "javax.annotation", "javax.ws", "org.apache.cxf" ]
javax.annotation; javax.ws; org.apache.cxf;
1,867,436
public static File getFileFromRelPath(File baseDir, String relPath) { if (baseDir == null || !baseDir.exists() || relPath == null || relPath.isEmpty()) return null; File file = new File(baseDir, relPath); return file.exists() ? file : null; }
static File function(File baseDir, String relPath) { if (baseDir == null !baseDir.exists() relPath == null relPath.isEmpty()) return null; File file = new File(baseDir, relPath); return file.exists() ? file : null; }
/** * Returns a File using the given {@code baseDir} and the given {@code relPath}. * @param baseDir The base directory of the file. Must exist. * @param relPath The path to the file relative to {@code baseDir}. * @return A File, or null. */
Returns a File using the given baseDir and the given relPath
getFileFromRelPath
{ "repo_name": "bkromhout/Minerva", "path": "app/src/main/java/com/bkromhout/minerva/util/Util.java", "license": "apache-2.0", "size": 7807 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
1,760,523
public Adapter createMethodAdapter() { return null; }
Adapter function() { return null; }
/** * Creates a new adapter for an object of class '{@link org.tetrabox.minijava.model.miniJava.Method <em>Method</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.tetrabox.minijava.model.miniJava.Method * @generated */
Creates a new adapter for an object of class '<code>org.tetrabox.minijava.model.miniJava.Method Method</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.
createMethodAdapter
{ "repo_name": "tetrabox/minijava", "path": "plugins/org.tetrabox.minijava.model/src/org/tetrabox/minijava/model/miniJava/util/MiniJavaAdapterFactory.java", "license": "epl-1.0", "size": 42082 }
[ "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;
885,378
@SuppressWarnings({"unchecked", "rawtypes"}) protected void writeGraphics(View<? extends CyIdentifiable> view, final boolean groupLockedProperties) throws IOException { if (view == null) return; writeElement("<graphics"); CyIdentifiable element = view.getModel(); final VisualProperty<?> root; if (element instanceof CyNode) root = BasicVisualLexicon.NODE; else if (element instanceof CyEdge) root = BasicVisualLexicon.EDGE; else root = BasicVisualLexicon.NETWORK; final VisualLexicon visualLexicon = getVisualLexicon(); final Collection<VisualProperty<?>> visualProperties = visualLexicon.getAllDescendants(root); final List<VisualProperty<?>> attProperties = new ArrayList<VisualProperty<?>>(); // To be written as att tags final List<VisualProperty<?>> lockedProperties = new ArrayList<VisualProperty<?>>(); final Set<String> writtenKeys = new HashSet<String>(); for (VisualProperty vp : visualProperties) { // If network, ignore node and edge visual properties, // because they are also returned as NETWORK's descendants if (root == BasicVisualLexicon.NETWORK && vp.getTargetDataType() != CyNetwork.class) continue; // It doesn't have to write the property if the value is null Object value = view.getVisualProperty(vp); if (value == null) continue; if (groupLockedProperties && view.isDirectlyLocked(vp)) { lockedProperties.add(vp); continue; } else { // If not a bypass, write only leaf nodes final VisualLexiconNode node = visualLexicon.getVisualLexiconNode(vp); if (!node.getChildren().isEmpty()) continue; } // Use XGMML graphics attribute names for some visual properties final String[] keys = getGraphicsKey(vp); if (keys != null && keys.length > 0) { // XGMML graphics attributes... try { value = vp.toSerializableString(value); } catch (ClassCastException ex) { System.err.println(vp.getDisplayName() + " causes ClassCastEx: " + value.getClass() + ", expected: " + vp.getDefault().getClass().getSimpleName() ); value = null; } if (value != null) { for (int i = 0; i < keys.length; i++) { final String k = keys[i]; if (!writtenKeys.contains(k) && !ignoreGraphicsAttribute(element, k)) { writeAttributePair(k, value); writtenKeys.add(k); // to avoid writing the same key twice, because of dependencies! } } } } else if (!ignoreGraphicsAttribute(element, vp.getIdString())) { // So it can be written as nested att tags attProperties.add(vp); } } Map<String, String> unrecognizedMap = unrecognizedVisualPropertyMgr .getUnrecognizedVisualProperties(networkView, view); if (attProperties.isEmpty() && lockedProperties.isEmpty() && unrecognizedMap.isEmpty()) { write("/>\n"); } else { write(">\n"); depth++; // write Cy3-specific properties for (VisualProperty vp : attProperties) { writeVisualPropertyAtt(view, vp); } // also save unrecognized visual properties for (Map.Entry<String, String> entry : unrecognizedMap.entrySet()) { String k = entry.getKey(); String v = entry.getValue(); if (v != null) writeAttributeXML(k, ObjectType.STRING, v, false, true); } // serialize locked properties as <att> tags inside <graphics> if (!lockedProperties.isEmpty()) { writeAttributeXML("lockedVisualProperties", ObjectType.LIST, null, false, false); depth++; for (VisualProperty vp : lockedProperties) { writeVisualPropertyAtt(view, vp); } depth--; writeElement("</att>\n"); } depth--; writeElement("</graphics>\n"); } }
@SuppressWarnings({STR, STR}) void function(View<? extends CyIdentifiable> view, final boolean groupLockedProperties) throws IOException { if (view == null) return; writeElement(STR); CyIdentifiable element = view.getModel(); final VisualProperty<?> root; if (element instanceof CyNode) root = BasicVisualLexicon.NODE; else if (element instanceof CyEdge) root = BasicVisualLexicon.EDGE; else root = BasicVisualLexicon.NETWORK; final VisualLexicon visualLexicon = getVisualLexicon(); final Collection<VisualProperty<?>> visualProperties = visualLexicon.getAllDescendants(root); final List<VisualProperty<?>> attProperties = new ArrayList<VisualProperty<?>>(); final List<VisualProperty<?>> lockedProperties = new ArrayList<VisualProperty<?>>(); final Set<String> writtenKeys = new HashSet<String>(); for (VisualProperty vp : visualProperties) { if (root == BasicVisualLexicon.NETWORK && vp.getTargetDataType() != CyNetwork.class) continue; Object value = view.getVisualProperty(vp); if (value == null) continue; if (groupLockedProperties && view.isDirectlyLocked(vp)) { lockedProperties.add(vp); continue; } else { final VisualLexiconNode node = visualLexicon.getVisualLexiconNode(vp); if (!node.getChildren().isEmpty()) continue; } final String[] keys = getGraphicsKey(vp); if (keys != null && keys.length > 0) { try { value = vp.toSerializableString(value); } catch (ClassCastException ex) { System.err.println(vp.getDisplayName() + STR + value.getClass() + STR + vp.getDefault().getClass().getSimpleName() ); value = null; } if (value != null) { for (int i = 0; i < keys.length; i++) { final String k = keys[i]; if (!writtenKeys.contains(k) && !ignoreGraphicsAttribute(element, k)) { writeAttributePair(k, value); writtenKeys.add(k); } } } } else if (!ignoreGraphicsAttribute(element, vp.getIdString())) { attProperties.add(vp); } } Map<String, String> unrecognizedMap = unrecognizedVisualPropertyMgr .getUnrecognizedVisualProperties(networkView, view); if (attProperties.isEmpty() && lockedProperties.isEmpty() && unrecognizedMap.isEmpty()) { write("/>\n"); } else { write(">\n"); depth++; for (VisualProperty vp : attProperties) { writeVisualPropertyAtt(view, vp); } for (Map.Entry<String, String> entry : unrecognizedMap.entrySet()) { String k = entry.getKey(); String v = entry.getValue(); if (v != null) writeAttributeXML(k, ObjectType.STRING, v, false, true); } if (!lockedProperties.isEmpty()) { writeAttributeXML(STR, ObjectType.LIST, null, false, false); depth++; for (VisualProperty vp : lockedProperties) { writeVisualPropertyAtt(view, vp); } depth--; writeElement(STR); } depth--; writeElement(STR); } }
/** * Writes a graphics tag under graph, node, edge. * @param view * @param groupLockedProperties Whether or not locked visual properties must be grouped under a list-type att tag. * @throws IOException */
Writes a graphics tag under graph, node, edge
writeGraphics
{ "repo_name": "cytoscape/cytoscape-impl", "path": "io-impl/impl/src/main/java/org/cytoscape/io/internal/write/xgmml/GenericXGMMLWriter.java", "license": "lgpl-2.1", "size": 39709 }
[ "java.io.IOException", "java.util.ArrayList", "java.util.Collection", "java.util.HashSet", "java.util.List", "java.util.Map", "java.util.Set", "org.cytoscape.io.internal.util.xgmml.ObjectType", "org.cytoscape.model.CyEdge", "org.cytoscape.model.CyIdentifiable", "org.cytoscape.model.CyNetwork", "org.cytoscape.model.CyNode", "org.cytoscape.view.model.View", "org.cytoscape.view.model.VisualLexicon", "org.cytoscape.view.model.VisualLexiconNode", "org.cytoscape.view.model.VisualProperty", "org.cytoscape.view.presentation.property.BasicVisualLexicon" ]
import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; import org.cytoscape.io.internal.util.xgmml.ObjectType; import org.cytoscape.model.CyEdge; import org.cytoscape.model.CyIdentifiable; import org.cytoscape.model.CyNetwork; import org.cytoscape.model.CyNode; import org.cytoscape.view.model.View; import org.cytoscape.view.model.VisualLexicon; import org.cytoscape.view.model.VisualLexiconNode; import org.cytoscape.view.model.VisualProperty; import org.cytoscape.view.presentation.property.BasicVisualLexicon;
import java.io.*; import java.util.*; import org.cytoscape.io.internal.util.xgmml.*; import org.cytoscape.model.*; import org.cytoscape.view.model.*; import org.cytoscape.view.presentation.property.*;
[ "java.io", "java.util", "org.cytoscape.io", "org.cytoscape.model", "org.cytoscape.view" ]
java.io; java.util; org.cytoscape.io; org.cytoscape.model; org.cytoscape.view;
1,937,743
public int head() throws IOException { return sendCommand(NNTPCommand.HEAD); }
int function() throws IOException { return sendCommand(NNTPCommand.HEAD); }
/*** * A convenience method to send the NNTP HEAD command to the server, * receive the initial reply, and return the reply code. * <p> * @return The reply code received from the server. * @exception NNTPConnectionClosedException * If the NNTP server prematurely closes the connection as a result * of the client being idle or some other reason causing the server * to send NNTP reply code 400. This exception may be caught either * as an IOException or independently as itself. * @exception IOException If an I/O error occurs while either sending the * command or receiving the server reply. ***/
A convenience method to send the NNTP HEAD command to the server, receive the initial reply, and return the reply code.
head
{ "repo_name": "ductt-neo/commons-net-ssh", "path": "src/main/java/org/apache/commons/net/nntp/NNTP.java", "license": "apache-2.0", "size": 43219 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,476,234
public void addViews(List<View> views, boolean enabled) { throw new RuntimeException("Not supported with MergeSpinnerAdapter"); }
void function(List<View> views, boolean enabled) { throw new RuntimeException(STR); }
/** * Adds a list of views to the roster of things to appear * in the aggregate list. * * @param views * List of views to add * @param enabled * false if views are disabled, true if enabled */
Adds a list of views to the roster of things to appear in the aggregate list
addViews
{ "repo_name": "haodynasty/AndroidBleManager", "path": "app/src/main/java/com/blakequ/androidblemanager/adapter/viewadapter/MergeSpinnerAdapter.java", "license": "apache-2.0", "size": 3089 }
[ "android.view.View", "java.util.List" ]
import android.view.View; import java.util.List;
import android.view.*; import java.util.*;
[ "android.view", "java.util" ]
android.view; java.util;
2,130,376
List<? extends MCRAbstractMetadataVersion<?>> listRevisions(MCRObjectID id) throws IOException;
List<? extends MCRAbstractMetadataVersion<?>> listRevisions(MCRObjectID id) throws IOException;
/** * Lists all versions of this metadata object available in the * subversion repository. * * @param id * the id of the object to be retrieved * @return {@link List} with all {@link MCRMetadataVersion} of * the given object or null if the id is null or the metadata * store doesn't support versioning */
Lists all versions of this metadata object available in the subversion repository
listRevisions
{ "repo_name": "MyCoRe-Org/mycore", "path": "mycore-base/src/main/java/org/mycore/datamodel/common/MCRXMLMetadataManagerAdapter.java", "license": "gpl-3.0", "size": 9030 }
[ "java.io.IOException", "java.util.List", "org.mycore.datamodel.metadata.MCRObjectID" ]
import java.io.IOException; import java.util.List; import org.mycore.datamodel.metadata.MCRObjectID;
import java.io.*; import java.util.*; import org.mycore.datamodel.metadata.*;
[ "java.io", "java.util", "org.mycore.datamodel" ]
java.io; java.util; org.mycore.datamodel;
1,330,086
void initInputsByIdMap() { inputsById = new HashMap<InputId, CompilerInput>(); for (CompilerInput input : externs) { InputId id = input.getInputId(); CompilerInput previous = putCompilerInput(id, input); if (previous != null) { report(JSError.make(DUPLICATE_EXTERN_INPUT, input.getName())); } } for (CompilerInput input : inputs) { InputId id = input.getInputId(); CompilerInput previous = putCompilerInput(id, input); if (previous != null) { report(JSError.make(DUPLICATE_INPUT, input.getName())); } } }
void initInputsByIdMap() { inputsById = new HashMap<InputId, CompilerInput>(); for (CompilerInput input : externs) { InputId id = input.getInputId(); CompilerInput previous = putCompilerInput(id, input); if (previous != null) { report(JSError.make(DUPLICATE_EXTERN_INPUT, input.getName())); } } for (CompilerInput input : inputs) { InputId id = input.getInputId(); CompilerInput previous = putCompilerInput(id, input); if (previous != null) { report(JSError.make(DUPLICATE_INPUT, input.getName())); } } }
/** * Creates a map to make looking up an input by name fast. Also checks for * duplicate inputs. */
Creates a map to make looking up an input by name fast. Also checks for duplicate inputs
initInputsByIdMap
{ "repo_name": "abdullah38rcc/closure-compiler", "path": "src/com/google/javascript/jscomp/Compiler.java", "license": "apache-2.0", "size": 76660 }
[ "com.google.javascript.rhino.InputId", "java.util.HashMap" ]
import com.google.javascript.rhino.InputId; import java.util.HashMap;
import com.google.javascript.rhino.*; import java.util.*;
[ "com.google.javascript", "java.util" ]
com.google.javascript; java.util;
1,023,551
public static Signature getInstance(String algorithm, Provider provider) throws NoSuchAlgorithmException { StringBuilder sb = new StringBuilder("Signature algorithm [") .append(algorithm).append("] from provider[") .append(provider).append("] "); Object o; try { o = Engine.getInstance(SIGNATURE, algorithm, provider); } catch (InvocationTargetException x) { Throwable cause = x.getCause(); if (cause instanceof NoSuchAlgorithmException) throw (NoSuchAlgorithmException) cause; if (cause == null) cause = x; sb.append("could not be created"); NoSuchAlgorithmException y = new NoSuchAlgorithmException(sb.toString()); y.initCause(cause); throw y; } Signature result; if (o instanceof SignatureSpi) result = new DummySignature((SignatureSpi) o, algorithm); else if (o instanceof Signature) { result = (Signature) o; result.algorithm = algorithm; } else { sb.append("is of an unexpected Type: ").append(o.getClass().getName()); throw new NoSuchAlgorithmException(sb.toString()); } result.provider = provider; return result; }
static Signature function(String algorithm, Provider provider) throws NoSuchAlgorithmException { StringBuilder sb = new StringBuilder(STR) .append(algorithm).append(STR) .append(provider).append(STR); Object o; try { o = Engine.getInstance(SIGNATURE, algorithm, provider); } catch (InvocationTargetException x) { Throwable cause = x.getCause(); if (cause instanceof NoSuchAlgorithmException) throw (NoSuchAlgorithmException) cause; if (cause == null) cause = x; sb.append(STR); NoSuchAlgorithmException y = new NoSuchAlgorithmException(sb.toString()); y.initCause(cause); throw y; } Signature result; if (o instanceof SignatureSpi) result = new DummySignature((SignatureSpi) o, algorithm); else if (o instanceof Signature) { result = (Signature) o; result.algorithm = algorithm; } else { sb.append(STR).append(o.getClass().getName()); throw new NoSuchAlgorithmException(sb.toString()); } result.provider = provider; return result; }
/** * Returns an instance of <code>Signature</code> representing the specified * signature from the specified {@link Provider}. * * @param algorithm the algorithm to use. * @param provider the {@link Provider} to use. * @return a new instance repesenting the desired algorithm. * @throws NoSuchAlgorithmException if the algorithm is not implemented by the * {@link Provider}. * @throws IllegalArgumentException if either <code>algorithm</code> or * <code>provider</code> is <code>null</code>, or if * <code>algorithm</code> is an empty string. */
Returns an instance of <code>Signature</code> representing the specified signature from the specified <code>Provider</code>
getInstance
{ "repo_name": "nmacs/lm3s-uclinux", "path": "lib/classpath/java/security/Signature.java", "license": "gpl-2.0", "size": 19330 }
[ "gnu.java.security.Engine", "java.lang.reflect.InvocationTargetException" ]
import gnu.java.security.Engine; import java.lang.reflect.InvocationTargetException;
import gnu.java.security.*; import java.lang.reflect.*;
[ "gnu.java.security", "java.lang" ]
gnu.java.security; java.lang;
1,959,826
public static void assertCachedData(Cache cache, FakeDataSet fakeDataSet, Uri... uris) throws IOException { int totalLength = 0; for (Uri uri : uris) { byte[] data = fakeDataSet.getData(uri).getData(); assertDataCached(cache, uri, data); totalLength += data.length; } assertThat(cache.getCacheSpace()).isEqualTo(totalLength); }
static void function(Cache cache, FakeDataSet fakeDataSet, Uri... uris) throws IOException { int totalLength = 0; for (Uri uri : uris) { byte[] data = fakeDataSet.getData(uri).getData(); assertDataCached(cache, uri, data); totalLength += data.length; } assertThat(cache.getCacheSpace()).isEqualTo(totalLength); }
/** * Asserts that the cache content is equal to the given subset of data in the {@code fakeDataSet}. * * @throws IOException If an error occurred reading from the Cache. */
Asserts that the cache content is equal to the given subset of data in the fakeDataSet
assertCachedData
{ "repo_name": "MaTriXy/ExoPlayer", "path": "library/core/src/test/java/com/google/android/exoplayer2/upstream/cache/CacheAsserts.java", "license": "apache-2.0", "size": 5298 }
[ "android.net.Uri", "com.google.android.exoplayer2.testutil.FakeDataSet", "com.google.common.truth.Truth", "java.io.IOException" ]
import android.net.Uri; import com.google.android.exoplayer2.testutil.FakeDataSet; import com.google.common.truth.Truth; import java.io.IOException;
import android.net.*; import com.google.android.exoplayer2.testutil.*; import com.google.common.truth.*; import java.io.*;
[ "android.net", "com.google.android", "com.google.common", "java.io" ]
android.net; com.google.android; com.google.common; java.io;
2,100,409
public void diff_cleanupMerge(LinkedList<Diff> diffs) { diffs.add(new Diff(Operation.EQUAL, "")); // Add a dummy entry at the end. ListIterator<Diff> pointer = diffs.listIterator(); int count_delete = 0; int count_insert = 0; String text_delete = ""; String text_insert = ""; Diff thisDiff = pointer.next(); Diff prevEqual = null; int commonlength; while (thisDiff != null) { switch (thisDiff.operation) { case INSERT: count_insert++; text_insert += thisDiff.text; prevEqual = null; break; case DELETE: count_delete++; text_delete += thisDiff.text; prevEqual = null; break; case EQUAL: if (count_delete != 0 || count_insert != 0) { // Delete the offending records. pointer.previous(); // Reverse direction. while (count_delete-- > 0) { pointer.previous(); pointer.remove(); } while (count_insert-- > 0) { pointer.previous(); pointer.remove(); } if (count_delete != 0 && count_insert != 0) { // Factor out any common prefixies. commonlength = diff_commonPrefix(text_insert, text_delete); if (commonlength != 0) { if (pointer.hasPrevious()) { thisDiff = pointer.previous(); assert thisDiff.operation == Operation.EQUAL : "Previous diff should have been an equality."; thisDiff.text += text_insert.substring(0, commonlength); pointer.next(); } else { pointer.add(new Diff(Operation.EQUAL, text_insert.substring(0, commonlength))); } text_insert = text_insert.substring(commonlength); text_delete = text_delete.substring(commonlength); } // Factor out any common suffixies. commonlength = diff_commonSuffix(text_insert, text_delete); if (commonlength != 0) { thisDiff = pointer.next(); thisDiff.text = text_insert.substring(text_insert.length() - commonlength) + thisDiff.text; text_insert = text_insert.substring(0, text_insert.length() - commonlength); text_delete = text_delete.substring(0, text_delete.length() - commonlength); pointer.previous(); } } // Insert the merged records. if (text_delete.length() != 0) { pointer.add(new Diff(Operation.DELETE, text_delete)); } if (text_insert.length() != 0) { pointer.add(new Diff(Operation.INSERT, text_insert)); } // Step forward to the equality. thisDiff = pointer.hasNext() ? pointer.next() : null; } else if (prevEqual != null) { // Merge this equality with the previous one. prevEqual.text += thisDiff.text; pointer.remove(); thisDiff = pointer.previous(); pointer.next(); // Forward direction } count_insert = 0; count_delete = 0; text_delete = ""; text_insert = ""; prevEqual = thisDiff; break; } thisDiff = pointer.hasNext() ? pointer.next() : null; } // System.out.println(diff); if (diffs.getLast().text.length() == 0) { diffs.removeLast(); // Remove the dummy entry at the end. } boolean changes = false; // Create a new iterator at the start. // (As opposed to walking the current one back.) pointer = diffs.listIterator(); Diff prevDiff = pointer.hasNext() ? pointer.next() : null; thisDiff = pointer.hasNext() ? pointer.next() : null; Diff nextDiff = pointer.hasNext() ? pointer.next() : null; // Intentionally ignore the first and last element (don't need checking). while (nextDiff != null) { if (prevDiff.operation == Operation.EQUAL && nextDiff.operation == Operation.EQUAL) { // This is a single edit surrounded by equalities. if (thisDiff.text.endsWith(prevDiff.text)) { // Shift the edit over the previous equality. thisDiff.text = prevDiff.text + thisDiff.text.substring(0, thisDiff.text.length() - prevDiff.text.length()); nextDiff.text = prevDiff.text + nextDiff.text; pointer.previous(); // Walk past nextDiff. pointer.previous(); // Walk past thisDiff. pointer.previous(); // Walk past prevDiff. pointer.remove(); // Delete prevDiff. pointer.next(); // Walk past thisDiff. thisDiff = pointer.next(); // Walk past nextDiff. nextDiff = pointer.hasNext() ? pointer.next() : null; changes = true; } else if (thisDiff.text.startsWith(nextDiff.text)) { // Shift the edit over the next equality. prevDiff.text += nextDiff.text; thisDiff.text = thisDiff.text.substring(nextDiff.text.length()) + nextDiff.text; pointer.remove(); // Delete nextDiff. nextDiff = pointer.hasNext() ? pointer.next() : null; changes = true; } } prevDiff = thisDiff; thisDiff = nextDiff; nextDiff = pointer.hasNext() ? pointer.next() : null; } // If shifts were made, the diff needs reordering and another shift sweep. if (changes) { diff_cleanupMerge(diffs); } }
void function(LinkedList<Diff> diffs) { diffs.add(new Diff(Operation.EQUAL, STRSTRSTRPrevious diff should have been an equality.STRSTR"; prevEqual = thisDiff; break; } thisDiff = pointer.hasNext() ? pointer.next() : null; } if (diffs.getLast().text.length() == 0) { diffs.removeLast(); } boolean changes = false; pointer = diffs.listIterator(); Diff prevDiff = pointer.hasNext() ? pointer.next() : null; thisDiff = pointer.hasNext() ? pointer.next() : null; Diff nextDiff = pointer.hasNext() ? pointer.next() : null; while (nextDiff != null) { if (prevDiff.operation == Operation.EQUAL && nextDiff.operation == Operation.EQUAL) { if (thisDiff.text.endsWith(prevDiff.text)) { thisDiff.text = prevDiff.text + thisDiff.text.substring(0, thisDiff.text.length() - prevDiff.text.length()); nextDiff.text = prevDiff.text + nextDiff.text; pointer.previous(); pointer.previous(); pointer.previous(); pointer.remove(); pointer.next(); thisDiff = pointer.next(); nextDiff = pointer.hasNext() ? pointer.next() : null; changes = true; } else if (thisDiff.text.startsWith(nextDiff.text)) { prevDiff.text += nextDiff.text; thisDiff.text = thisDiff.text.substring(nextDiff.text.length()) + nextDiff.text; pointer.remove(); nextDiff = pointer.hasNext() ? pointer.next() : null; changes = true; } } prevDiff = thisDiff; thisDiff = nextDiff; nextDiff = pointer.hasNext() ? pointer.next() : null; } if (changes) { diff_cleanupMerge(diffs); } }
/** * Reorder and merge like edit sections. Merge equalities. * Any edit section can move as long as it doesn't cross an equality. * @param diffs LinkedList of Diff objects. */
Reorder and merge like edit sections. Merge equalities. Any edit section can move as long as it doesn't cross an equality
diff_cleanupMerge
{ "repo_name": "visik7/webfilesys", "path": "src/main/webapp/WEB-INF/source/name/fraser/neil/plaintext/diff_match_patch.java", "license": "gpl-3.0", "size": 84995 }
[ "java.util.LinkedList" ]
import java.util.LinkedList;
import java.util.*;
[ "java.util" ]
java.util;
224,642
public int encode(byte[] data, int off, int length, OutputStream out) throws IOException { int byteCount = 0; while (true) { // keep writing complete lines until we've exhausted the data. if (length > MAX_CHARS_PER_LINE) { // encode another line and adjust the length and position byteCount += encodeLine(data, off, MAX_CHARS_PER_LINE, out); length -= MAX_CHARS_PER_LINE; off += MAX_CHARS_PER_LINE; } else { // last line. Encode the partial and quit byteCount += encodeLine(data, off, MAX_CHARS_PER_LINE, out); break; } } return byteCount; }
int function(byte[] data, int off, int length, OutputStream out) throws IOException { int byteCount = 0; while (true) { if (length > MAX_CHARS_PER_LINE) { byteCount += encodeLine(data, off, MAX_CHARS_PER_LINE, out); length -= MAX_CHARS_PER_LINE; off += MAX_CHARS_PER_LINE; } else { byteCount += encodeLine(data, off, MAX_CHARS_PER_LINE, out); break; } } return byteCount; }
/** * encode the input data producing a UUEncoded output stream. * * @param data The array of byte data. * @param off The starting offset within the data. * @param length Length of the data to encode. * @param out The output stream the encoded data is written to. * * @return the number of bytes produced. */
encode the input data producing a UUEncoded output stream
encode
{ "repo_name": "salyh/jm14specsvn", "path": "src/main/java/org/apache/geronimo/mail/util/UUEncoder.java", "license": "apache-2.0", "size": 8319 }
[ "java.io.IOException", "java.io.OutputStream" ]
import java.io.IOException; import java.io.OutputStream;
import java.io.*;
[ "java.io" ]
java.io;
1,494,628
public void setXFA(PDXFAResource xfa) { dictionary.setItem(COSName.XFA, xfa); }
void function(PDXFAResource xfa) { dictionary.setItem(COSName.XFA, xfa); }
/** * Set the XFA resource, this is only used for PDF 1.5+ forms. * * @param xfa The xfa resource. */
Set the XFA resource, this is only used for PDF 1.5+ forms
setXFA
{ "repo_name": "benmccann/pdfbox", "path": "pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/form/PDAcroForm.java", "license": "apache-2.0", "size": 16088 }
[ "org.apache.pdfbox.cos.COSName" ]
import org.apache.pdfbox.cos.COSName;
import org.apache.pdfbox.cos.*;
[ "org.apache.pdfbox" ]
org.apache.pdfbox;
2,612,727
public void close () throws SQLException { // @D4 change -- don't throw exceptions. Instead, catch and log them. The // user called close so we won't return until we tried to close all // resources. try { // @J4a // @J4a if (resultSet_ != null) resultSet_.close(); } // @J4a catch (SQLException e) // @J4a { // @J4a if (JDTrace.isTraceOn()) // @J4a JDTrace.logInformation (this, "Closing result set while closing the row set failed: " + e.getMessage()); // @j4a } // @J4a try { // @J4a // @J4a if (statement_ != null) statement_.close(); } // @J4a catch (SQLException e) // @J4a { // @J4a if (JDTrace.isTraceOn()) // @J4a JDTrace.logInformation (this, "Closing statement set while closing the row set failed: " + e.getMessage()); // @j4a } // @J4a if (connection_ != null) connection_.close(); }
void function () throws SQLException { try { if (resultSet_ != null) resultSet_.close(); } catch (SQLException e) { if (JDTrace.isTraceOn()) JDTrace.logInformation (this, STR + e.getMessage()); } try { if (statement_ != null) statement_.close(); } catch (SQLException e) { if (JDTrace.isTraceOn()) JDTrace.logInformation (this, STR + e.getMessage()); } if (connection_ != null) connection_.close(); }
/** * Releases the rowset resources immediately instead of waiting for them to be automatically released. * This closes the connection to the database. * * @exception SQLException If an error occurs. **/
Releases the rowset resources immediately instead of waiting for them to be automatically released. This closes the connection to the database
close
{ "repo_name": "piguangming/jt400", "path": "src/com/ibm/as400/access/AS400JDBCRowSet.java", "license": "epl-1.0", "size": 312066 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,436,059
public void setLcsOverSgsValue(String lcsOverSgsValue) throws JNCException { setLcsOverSgsValue(new YangEnumeration(lcsOverSgsValue, new String[] { "disable", })); }
void function(String lcsOverSgsValue) throws JNCException { setLcsOverSgsValue(new YangEnumeration(lcsOverSgsValue, new String[] { STR, })); }
/** * Sets the value for child leaf "lcs-over-sgs", * using a String value. * @param lcsOverSgsValue used during instantiation. */
Sets the value for child leaf "lcs-over-sgs", using a String value
setLcsOverSgsValue
{ "repo_name": "jnpr-shinma/yangfile", "path": "hitel/src/hctaEpc/mmeSgsn/feature/MmeLcs.java", "license": "apache-2.0", "size": 7889 }
[ "com.tailf.jnc.YangEnumeration" ]
import com.tailf.jnc.YangEnumeration;
import com.tailf.jnc.*;
[ "com.tailf.jnc" ]
com.tailf.jnc;
1,021,183
protected JdbcDialect resolveDialect() throws CacheException { Connection conn = null; String dbProductName = null; try { conn = openConnection(false); dbProductName = conn.getMetaData().getDatabaseProductName(); } catch (SQLException e) { throw new CacheException("Failed access to metadata for detect database dialect.", e); } finally { U.closeQuiet(conn); } if ("H2".equals(dbProductName)) return new H2Dialect(); if ("MySQL".equals(dbProductName)) return new MySQLDialect(); if (dbProductName.startsWith("Microsoft SQL Server")) return new SQLServerDialect(); if ("Oracle".equals(dbProductName)) return new OracleDialect(); if (dbProductName.startsWith("DB2/")) return new DB2Dialect(); U.warn(log, "Failed to resolve dialect (BasicJdbcDialect will be used): " + dbProductName); return new BasicJdbcDialect(); }
JdbcDialect function() throws CacheException { Connection conn = null; String dbProductName = null; try { conn = openConnection(false); dbProductName = conn.getMetaData().getDatabaseProductName(); } catch (SQLException e) { throw new CacheException(STR, e); } finally { U.closeQuiet(conn); } if ("H2".equals(dbProductName)) return new H2Dialect(); if ("MySQL".equals(dbProductName)) return new MySQLDialect(); if (dbProductName.startsWith(STR)) return new SQLServerDialect(); if (STR.equals(dbProductName)) return new OracleDialect(); if (dbProductName.startsWith("DB2/")) return new DB2Dialect(); U.warn(log, STR + dbProductName); return new BasicJdbcDialect(); }
/** * Perform dialect resolution. * * @return The resolved dialect. * @throws CacheException Indicates problems accessing the metadata. */
Perform dialect resolution
resolveDialect
{ "repo_name": "pperalta/ignite", "path": "modules/core/src/main/java/org/apache/ignite/cache/store/jdbc/CacheAbstractJdbcStore.java", "license": "apache-2.0", "size": 70347 }
[ "java.sql.Connection", "java.sql.SQLException", "javax.cache.CacheException", "org.apache.ignite.cache.store.jdbc.dialect.BasicJdbcDialect", "org.apache.ignite.cache.store.jdbc.dialect.DB2Dialect", "org.apache.ignite.cache.store.jdbc.dialect.H2Dialect", "org.apache.ignite.cache.store.jdbc.dialect.JdbcDialect", "org.apache.ignite.cache.store.jdbc.dialect.MySQLDialect", "org.apache.ignite.cache.store.jdbc.dialect.OracleDialect", "org.apache.ignite.cache.store.jdbc.dialect.SQLServerDialect", "org.apache.ignite.internal.util.typedef.internal.U" ]
import java.sql.Connection; import java.sql.SQLException; import javax.cache.CacheException; import org.apache.ignite.cache.store.jdbc.dialect.BasicJdbcDialect; import org.apache.ignite.cache.store.jdbc.dialect.DB2Dialect; import org.apache.ignite.cache.store.jdbc.dialect.H2Dialect; import org.apache.ignite.cache.store.jdbc.dialect.JdbcDialect; import org.apache.ignite.cache.store.jdbc.dialect.MySQLDialect; import org.apache.ignite.cache.store.jdbc.dialect.OracleDialect; import org.apache.ignite.cache.store.jdbc.dialect.SQLServerDialect; import org.apache.ignite.internal.util.typedef.internal.U;
import java.sql.*; import javax.cache.*; import org.apache.ignite.cache.store.jdbc.dialect.*; import org.apache.ignite.internal.util.typedef.internal.*;
[ "java.sql", "javax.cache", "org.apache.ignite" ]
java.sql; javax.cache; org.apache.ignite;
1,509,488
interface WithRules { Update withRules(List<FirewallPolicyRule> rules); } }
interface WithRules { Update withRules(List<FirewallPolicyRule> rules); } }
/** * Specifies rules. * @param rules Group of Firewall Policy rules * @return the next update stage */
Specifies rules
withRules
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/network/mgmt-v2019_11_01/src/main/java/com/microsoft/azure/management/network/v2019_11_01/FirewallPolicyRuleGroup.java", "license": "mit", "size": 6707 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
993,709
public boolean scoutSettlement(Unit unit, Direction direction) { return ask(new ScoutIndianSettlementMessage(unit, direction)); }
boolean function(Unit unit, Direction direction) { return ask(new ScoutIndianSettlementMessage(unit, direction)); }
/** * Server query-response for the dialog on scouting a native * settlement, *before* choosing to speak to the chief, attack, et * al. * * @param unit The {@code Unit} that is speaking. * @param direction The direction to a settlement to ask. * @return True if the server interaction succeeded. */
Server query-response for the dialog on scouting a native settlement, *before* choosing to speak to the chief, attack, et al
scoutSettlement
{ "repo_name": "FreeCol/freecol", "path": "src/net/sf/freecol/common/networking/ServerAPI.java", "license": "gpl-2.0", "size": 36415 }
[ "net.sf.freecol.common.model.Direction", "net.sf.freecol.common.model.Unit" ]
import net.sf.freecol.common.model.Direction; import net.sf.freecol.common.model.Unit;
import net.sf.freecol.common.model.*;
[ "net.sf.freecol" ]
net.sf.freecol;
2,313,395
@Override public void onClientConnectionError(final Object client, final SynchronizeFXException e) { serverCallback.onClientConnectionError(client, e); }
void function(final Object client, final SynchronizeFXException e) { serverCallback.onClientConnectionError(client, e); }
/** * Logs the unexpected disconnection of an client. * * Connection errors to single clients are usually non fatal. The server can still work correctly for the other * clients. Because of that this type of error is just logged here and not passed to the user. * * @param client An object that represent the client where the error occurred. * @param e an exception that describes the problem. * @see NetworkToTopologyCallbackServer#onClientConnectionError(SynchronizeFXException) */
Logs the unexpected disconnection of an client. Connection errors to single clients are usually non fatal. The server can still work correctly for the other clients. Because of that this type of error is just logged here and not passed to the user
onClientConnectionError
{ "repo_name": "saxsys/SynchronizeFX", "path": "synchronizefx-core/src/main/java/de/saxsys/synchronizefx/core/clientserver/DomainModelServer.java", "license": "lgpl-3.0", "size": 9457 }
[ "de.saxsys.synchronizefx.core.exceptions.SynchronizeFXException" ]
import de.saxsys.synchronizefx.core.exceptions.SynchronizeFXException;
import de.saxsys.synchronizefx.core.exceptions.*;
[ "de.saxsys.synchronizefx" ]
de.saxsys.synchronizefx;
1,218,824
public ApiResponse<Void> updateCompanyWithHttpInfo(String authorization, UUID companyId, Company body) throws ApiException { com.squareup.okhttp.Call call = updateCompanyValidateBeforeCall(authorization, companyId, body, null, null); return apiClient.execute(call); }
ApiResponse<Void> function(String authorization, UUID companyId, Company body) throws ApiException { com.squareup.okhttp.Call call = updateCompanyValidateBeforeCall(authorization, companyId, body, null, null); return apiClient.execute(call); }
/** * Update company information and your data configuration * This method operation create a company for a account * @param authorization Bearer {auth} (required) * @param companyId Company ID (required) * @param body Transaction Message (required) * @return ApiResponse&lt;Void&gt; * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body */
Update company information and your data configuration This method operation create a company for a account
updateCompanyWithHttpInfo
{ "repo_name": "Avalara/avataxbr-clients", "path": "java-client/src/main/java/io/swagger/client/api/CompanyApi.java", "license": "gpl-3.0", "size": 39656 }
[ "io.swagger.client.ApiException", "io.swagger.client.ApiResponse", "io.swagger.client.model.Company" ]
import io.swagger.client.ApiException; import io.swagger.client.ApiResponse; import io.swagger.client.model.Company;
import io.swagger.client.*; import io.swagger.client.model.*;
[ "io.swagger.client" ]
io.swagger.client;
2,261,326
@Override public Object handleException(RuntimeException exception) throws RuntimeException { if ((exception instanceof EclipseLinkException)) { EclipseLinkException eclipseLinkException = (EclipseLinkException)exception; if (eclipseLinkException.getSession() == null) { eclipseLinkException.setSession(this); } //Bug#3559280 Avoid logging an exception twice if (!eclipseLinkException.hasBeenLogged()) { logThrowable(SessionLog.WARNING, null, exception); eclipseLinkException.setHasBeenLogged(true); } } else { logThrowable(SessionLog.WARNING, null, exception); } if (hasExceptionHandler()) { if (this.broker != null && this.broker.hasExceptionHandler()) { try { return getExceptionHandler().handleException(exception); } catch (RuntimeException ex) { // handle the original exception return this.broker.getExceptionHandler().handleException(exception); } } else { return getExceptionHandler().handleException(exception); } } else { if (this.broker != null && this.broker.hasExceptionHandler()) { return this.broker.getExceptionHandler().handleException(exception); } else { throw exception; } } }
Object function(RuntimeException exception) throws RuntimeException { if ((exception instanceof EclipseLinkException)) { EclipseLinkException eclipseLinkException = (EclipseLinkException)exception; if (eclipseLinkException.getSession() == null) { eclipseLinkException.setSession(this); } if (!eclipseLinkException.hasBeenLogged()) { logThrowable(SessionLog.WARNING, null, exception); eclipseLinkException.setHasBeenLogged(true); } } else { logThrowable(SessionLog.WARNING, null, exception); } if (hasExceptionHandler()) { if (this.broker != null && this.broker.hasExceptionHandler()) { try { return getExceptionHandler().handleException(exception); } catch (RuntimeException ex) { return this.broker.getExceptionHandler().handleException(exception); } } else { return getExceptionHandler().handleException(exception); } } else { if (this.broker != null && this.broker.hasExceptionHandler()) { return this.broker.getExceptionHandler().handleException(exception); } else { throw exception; } } }
/** * PUBLIC: * Allow any WARNING level exceptions that occur within EclipseLink to be logged and handled by the exception handler. */
Allow any WARNING level exceptions that occur within EclipseLink to be logged and handled by the exception handler
handleException
{ "repo_name": "gameduell/eclipselink.runtime", "path": "foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/sessions/AbstractSession.java", "license": "epl-1.0", "size": 198170 }
[ "org.eclipse.persistence.exceptions.EclipseLinkException", "org.eclipse.persistence.logging.SessionLog" ]
import org.eclipse.persistence.exceptions.EclipseLinkException; import org.eclipse.persistence.logging.SessionLog;
import org.eclipse.persistence.exceptions.*; import org.eclipse.persistence.logging.*;
[ "org.eclipse.persistence" ]
org.eclipse.persistence;
1,015,729
public void skipTranslogRecovery() throws IOException { assert getEngineOrNull() == null : "engine was already created"; internalPerformTranslogRecovery(true, true); assert recoveryState.getTranslog().recoveredOperations() == 0; }
void function() throws IOException { assert getEngineOrNull() == null : STR; internalPerformTranslogRecovery(true, true); assert recoveryState.getTranslog().recoveredOperations() == 0; }
/** * After the store has been recovered, we need to start the engine. This method starts a new engine but skips * the replay of the transaction log which is required in cases where we restore a previous index or recover from * a remote peer. */
After the store has been recovered, we need to start the engine. This method starts a new engine but skips the replay of the transaction log which is required in cases where we restore a previous index or recover from a remote peer
skipTranslogRecovery
{ "repo_name": "polyfractal/elasticsearch", "path": "core/src/main/java/org/elasticsearch/index/shard/IndexShard.java", "license": "apache-2.0", "size": 75969 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,122,083
String lstr; int setNum; int i; // create the reader of input-data AQBufferedReader aqbr = new AQBufferedReader(dataPath); // get the size of data-set lstr = aqbr.readLine(); setNum = Integer.parseInt(lstr); // create the cases of games gameCases = new GameBean[setNum]; for (i = 0; setNum > 0; i++, setNum--) { lstr = aqbr.readLine(); String[] m = lstr.split(" "); if (m != null && m.length == 3) { gameCases[i] = new GameBean((i + 1), m[0], m[1], m[2]); } } // close the reader of input-data aqbr.close(); }
String lstr; int setNum; int i; AQBufferedReader aqbr = new AQBufferedReader(dataPath); lstr = aqbr.readLine(); setNum = Integer.parseInt(lstr); gameCases = new GameBean[setNum]; for (i = 0; setNum > 0; i++, setNum--) { lstr = aqbr.readLine(); String[] m = lstr.split(" "); if (m != null && m.length == 3) { gameCases[i] = new GameBean((i + 1), m[0], m[1], m[2]); } } aqbr.close(); }
/** * parse the input-data and create the game objects * * @param dataPath * the path of the input-data */
parse the input-data and create the game objects
parseData
{ "repo_name": "webos21/algorithm", "path": "src/com/gmail/webos21/aquiz/gcj/c2014/qr/MinesweeperMaster.java", "license": "apache-2.0", "size": 6066 }
[ "com.gmail.webos21.aquiz.util.AQBufferedReader" ]
import com.gmail.webos21.aquiz.util.AQBufferedReader;
import com.gmail.webos21.aquiz.util.*;
[ "com.gmail.webos21" ]
com.gmail.webos21;
1,023,191
public static ExpectedCondition<Boolean> urlMatches(final String regex) { return new ExpectedCondition<Boolean>() { private String currentUrl; private Pattern pattern; private Matcher matcher;
static ExpectedCondition<Boolean> function(final String regex) { return new ExpectedCondition<Boolean>() { private String currentUrl; private Pattern pattern; private Matcher matcher;
/** * Expectation for the URL to match a specific regular expression * * @param regex the regular expression that the URL should match * @return <code>true</code> if the URL matches the specified regular expression */
Expectation for the URL to match a specific regular expression
urlMatches
{ "repo_name": "xmhubj/selenium", "path": "java/client/src/org/openqa/selenium/support/ui/ExpectedConditions.java", "license": "apache-2.0", "size": 50692 }
[ "java.util.regex.Matcher", "java.util.regex.Pattern" ]
import java.util.regex.Matcher; import java.util.regex.Pattern;
import java.util.regex.*;
[ "java.util" ]
java.util;
1,260,865
return (Integer) parameters.get( Names.interactionChoiceSetID ); }
return (Integer) parameters.get( Names.interactionChoiceSetID ); }
/** * Gets the Choice Set unique ID * * @return Integer -an Integer representing the Choice Set ID */
Gets the Choice Set unique ID
getInteractionChoiceSetID
{ "repo_name": "Luxoft/SDLP2", "path": "SDL_Android/SmartDeviceLinkProxyAndroid/src/com/smartdevicelink/proxy/rpc/CreateInteractionChoiceSet.java", "license": "lgpl-2.1", "size": 3118 }
[ "com.smartdevicelink.proxy.constants.Names" ]
import com.smartdevicelink.proxy.constants.Names;
import com.smartdevicelink.proxy.constants.*;
[ "com.smartdevicelink.proxy" ]
com.smartdevicelink.proxy;
807,445
private TypeReference getRefTypeOf(Operand op) { if (VM.VerifyAssertions) VM._assert(!op.isDefinitelyNull()); return op.getType(); }
TypeReference function(Operand op) { if (VM.VerifyAssertions) VM._assert(!op.isDefinitelyNull()); return op.getType(); }
/** * Return the data type of the given operand, assuming that the operand is * a reference. (and not a null constant.) * * @param op operand to get type of */
Return the data type of the given operand, assuming that the operand is a reference. (and not a null constant.)
getRefTypeOf
{ "repo_name": "ut-osa/laminar", "path": "jikesrvm-3.0.0/rvm/src/org/jikesrvm/compilers/opt/bc2ir/BC2IR.java", "license": "bsd-3-clause", "size": 233116 }
[ "org.jikesrvm.classloader.TypeReference", "org.jikesrvm.compilers.opt.ir.operand.Operand" ]
import org.jikesrvm.classloader.TypeReference; import org.jikesrvm.compilers.opt.ir.operand.Operand;
import org.jikesrvm.classloader.*; import org.jikesrvm.compilers.opt.ir.operand.*;
[ "org.jikesrvm.classloader", "org.jikesrvm.compilers" ]
org.jikesrvm.classloader; org.jikesrvm.compilers;
1,813,263
protected QuadTree findIndex(INDArray coordinates) { // Compute the sector for the coordinates boolean left = (coordinates.getDouble(0) <= (boundary.getX() + boundary.getHw() / 2)); boolean top = (coordinates.getDouble(1) <= (boundary.getY() + boundary.getHh() / 2)); // top left QuadTree index = getNorthWest(); if (left) { // left side if (!top) { // bottom left index = getSouthWest(); } } else { // right side if (top) { // top right index = getNorthEast(); } else { // bottom right index = getSouthEast(); } } return index; }
QuadTree function(INDArray coordinates) { boolean left = (coordinates.getDouble(0) <= (boundary.getX() + boundary.getHw() / 2)); boolean top = (coordinates.getDouble(1) <= (boundary.getY() + boundary.getHh() / 2)); QuadTree index = getNorthWest(); if (left) { if (!top) { index = getSouthWest(); } } else { if (top) { index = getNorthEast(); } else { index = getSouthEast(); } } return index; }
/** * Returns the cell of this element * * @param coordinates * @return */
Returns the cell of this element
findIndex
{ "repo_name": "xuzhongxing/deeplearning4j", "path": "deeplearning4j-core/src/main/java/org/deeplearning4j/clustering/quadtree/QuadTree.java", "license": "apache-2.0", "size": 11124 }
[ "org.nd4j.linalg.api.ndarray.INDArray" ]
import org.nd4j.linalg.api.ndarray.INDArray;
import org.nd4j.linalg.api.ndarray.*;
[ "org.nd4j.linalg" ]
org.nd4j.linalg;
1,337,084
public ProvisioningState provisioningState() { return this.provisioningState; }
ProvisioningState function() { return this.provisioningState; }
/** * Get the provisioning state of the authorization resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'. * * @return the provisioningState value */
Get the provisioning state of the authorization resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed'
provisioningState
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/network/mgmt-v2019_08_01/src/main/java/com/microsoft/azure/management/network/v2019_08_01/implementation/ExpressRouteCircuitAuthorizationInner.java", "license": "mit", "size": 4990 }
[ "com.microsoft.azure.management.network.v2019_08_01.ProvisioningState" ]
import com.microsoft.azure.management.network.v2019_08_01.ProvisioningState;
import com.microsoft.azure.management.network.v2019_08_01.*;
[ "com.microsoft.azure" ]
com.microsoft.azure;
595,509
void show(final String title, final String inlineNotificationMessage, final InlineNotification.InlineNotificationType inlineNotificationType, final String yesButtonText, final String noButtonText, final Button.ButtonStyleType yesButtonType, final Button.ButtonStyleType noButtonType, final String confirmMessage, final Command yesCommand, final Command noCommand);
void show(final String title, final String inlineNotificationMessage, final InlineNotification.InlineNotificationType inlineNotificationType, final String yesButtonText, final String noButtonText, final Button.ButtonStyleType yesButtonType, final Button.ButtonStyleType noButtonType, final String confirmMessage, final Command yesCommand, final Command noCommand);
/** * Makes the YesNoConfirmPopupView visible with YES/NO/Cancel buttons. * * @param title * @param inlineNotificationMessage * @param inlineNotificationType * @param yesButtonText * @param noButtonText * @param yesButtonType * @param noButtonType * @param confirmMessage * @param yesCommand * @param noCommand */
Makes the YesNoConfirmPopupView visible with YES/NO/Cancel buttons
show
{ "repo_name": "mbiarnes/drools-wb", "path": "drools-wb-screens/drools-wb-scenario-simulation-editor/drools-wb-scenario-simulation-editor-client/src/main/java/org/drools/workbench/screens/scenariosimulation/client/popup/YesNoConfirmPopup.java", "license": "apache-2.0", "size": 6351 }
[ "org.uberfire.client.views.pfly.widgets.Button", "org.uberfire.client.views.pfly.widgets.InlineNotification", "org.uberfire.mvp.Command" ]
import org.uberfire.client.views.pfly.widgets.Button; import org.uberfire.client.views.pfly.widgets.InlineNotification; import org.uberfire.mvp.Command;
import org.uberfire.client.views.pfly.widgets.*; import org.uberfire.mvp.*;
[ "org.uberfire.client", "org.uberfire.mvp" ]
org.uberfire.client; org.uberfire.mvp;
1,041,465
public static byte[] toBytes(BigDecimal val) { byte[] valueBytes = val.unscaledValue().toByteArray(); byte[] result = new byte[valueBytes.length + SIZEOF_INT]; int offset = putInt(result, 0, val.scale()); putBytes(result, offset, valueBytes, 0, valueBytes.length); return result; }
static byte[] function(BigDecimal val) { byte[] valueBytes = val.unscaledValue().toByteArray(); byte[] result = new byte[valueBytes.length + SIZEOF_INT]; int offset = putInt(result, 0, val.scale()); putBytes(result, offset, valueBytes, 0, valueBytes.length); return result; }
/** * Convert a BigDecimal value to a byte array * * @param val input value * @return the byte array */
Convert a BigDecimal value to a byte array
toBytes
{ "repo_name": "dbs-leipzig/gradoop", "path": "gradoop-common/src/main/java/org/gradoop/common/model/impl/properties/bytes/Bytes.java", "license": "apache-2.0", "size": 32962 }
[ "java.math.BigDecimal" ]
import java.math.BigDecimal;
import java.math.*;
[ "java.math" ]
java.math;
1,418,412
private static Class<?> declaringClassOf(TypeVariable<?> typeVariable) { GenericDeclaration genericDeclaration = typeVariable.getGenericDeclaration(); return genericDeclaration instanceof Class ? (Class<?>) genericDeclaration : null; }
static Class<?> function(TypeVariable<?> typeVariable) { GenericDeclaration genericDeclaration = typeVariable.getGenericDeclaration(); return genericDeclaration instanceof Class ? (Class<?>) genericDeclaration : null; }
/** * Returns the declaring class of {@code typeVariable}, or {@code null} if it was not declared by * a class. */
Returns the declaring class of typeVariable, or null if it was not declared by a class
declaringClassOf
{ "repo_name": "jooby-project/jooby", "path": "jooby/src/main/java/io/jooby/internal/reflect/$Types.java", "license": "apache-2.0", "size": 20746 }
[ "java.lang.reflect.GenericDeclaration", "java.lang.reflect.TypeVariable" ]
import java.lang.reflect.GenericDeclaration; import java.lang.reflect.TypeVariable;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
1,922,668
@Override public ResourceLocator getResourceLocator() { return ConferenceEditPlugin.INSTANCE; }
ResourceLocator function() { return ConferenceEditPlugin.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": "ObeoNetwork/Conference-Designer", "path": "plugins/fr.obeo.conference.edit/src/conference/makingOf/provider/StoryItemProvider.java", "license": "epl-1.0", "size": 6286 }
[ "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;
1,084,328
Source getGlobalToolchainsSource();
Source getGlobalToolchainsSource();
/** * Gets the global toolchains source. * * @return The global toolchains source or {@code null} if none. */
Gets the global toolchains source
getGlobalToolchainsSource
{ "repo_name": "Tibor17/maven", "path": "maven-core/src/main/java/org/apache/maven/toolchain/building/ToolchainsBuildingRequest.java", "license": "apache-2.0", "size": 2253 }
[ "org.apache.maven.building.Source" ]
import org.apache.maven.building.Source;
import org.apache.maven.building.*;
[ "org.apache.maven" ]
org.apache.maven;
2,285,597
public static ExpressionResolverBuilder resolverFor( TableConfig config, TableReferenceLookup tableCatalog, FunctionLookup functionLookup, DataTypeFactory typeFactory, SqlExpressionResolver sqlExpressionResolver, QueryOperation... inputs) { return new ExpressionResolverBuilder( inputs, config, tableCatalog, functionLookup, typeFactory, sqlExpressionResolver); }
static ExpressionResolverBuilder function( TableConfig config, TableReferenceLookup tableCatalog, FunctionLookup functionLookup, DataTypeFactory typeFactory, SqlExpressionResolver sqlExpressionResolver, QueryOperation... inputs) { return new ExpressionResolverBuilder( inputs, config, tableCatalog, functionLookup, typeFactory, sqlExpressionResolver); }
/** * Creates a builder for {@link ExpressionResolver}. One can add additional properties to the * resolver like e.g. {@link GroupWindow} or {@link OverWindow}. You can also add additional * {@link ResolverRule}. * * @param config general configuration * @param tableCatalog a way to lookup a table reference by name * @param functionLookup a way to lookup call by name * @param typeFactory a way to lookup and create data types * @param inputs inputs to use for field resolution * @return builder for resolver */
Creates a builder for <code>ExpressionResolver</code>. One can add additional properties to the resolver like e.g. <code>GroupWindow</code> or <code>OverWindow</code>. You can also add additional <code>ResolverRule</code>
resolverFor
{ "repo_name": "lincoln-lil/flink", "path": "flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/expressions/resolver/ExpressionResolver.java", "license": "apache-2.0", "size": 21176 }
[ "org.apache.flink.table.api.TableConfig", "org.apache.flink.table.catalog.DataTypeFactory", "org.apache.flink.table.catalog.FunctionLookup", "org.apache.flink.table.expressions.resolver.lookups.TableReferenceLookup", "org.apache.flink.table.operations.QueryOperation" ]
import org.apache.flink.table.api.TableConfig; import org.apache.flink.table.catalog.DataTypeFactory; import org.apache.flink.table.catalog.FunctionLookup; import org.apache.flink.table.expressions.resolver.lookups.TableReferenceLookup; import org.apache.flink.table.operations.QueryOperation;
import org.apache.flink.table.api.*; import org.apache.flink.table.catalog.*; import org.apache.flink.table.expressions.resolver.lookups.*; import org.apache.flink.table.operations.*;
[ "org.apache.flink" ]
org.apache.flink;
2,526,885
private static <T> List<T> filterSelection(Class<T> clazz, IStructuredSelection selection) { List<T> list = new ArrayList<T>(); for (Object obj : selection.toList()) { if (clazz.isAssignableFrom(obj.getClass())) { list.add((T) obj); } } return list; }
static <T> List<T> function(Class<T> clazz, IStructuredSelection selection) { List<T> list = new ArrayList<T>(); for (Object obj : selection.toList()) { if (clazz.isAssignableFrom(obj.getClass())) { list.add((T) obj); } } return list; }
/** * Extract the list of <T> from the structured selection * * @param clazz the class T * @param selection the structured selection * @return the list of <T> it contains */
Extract the list of from the structured selection
filterSelection
{ "repo_name": "ZhangXFeng/hadoop", "path": "src/hadoop-mapreduce1-project/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/actions/DFSActionImpl.java", "license": "apache-2.0", "size": 14017 }
[ "java.util.ArrayList", "java.util.List", "org.eclipse.jface.viewers.IStructuredSelection" ]
import java.util.ArrayList; import java.util.List; import org.eclipse.jface.viewers.IStructuredSelection;
import java.util.*; import org.eclipse.jface.viewers.*;
[ "java.util", "org.eclipse.jface" ]
java.util; org.eclipse.jface;
2,175,360
public void stopThread() { photoLoaderThread.interrupt(); } //stores list of photos to download class PhotosQueue { private Stack<PhotoToLoad> photosToLoad=new Stack<PhotoToLoad>();
void function() { photoLoaderThread.interrupt(); } class PhotosQueue { private Stack<PhotoToLoad> photosToLoad=new Stack<PhotoToLoad>();
/** * Stop thread. */
Stop thread
stopThread
{ "repo_name": "buildingwatsize/TheCompressYourFiles", "path": "src/th/watsize/filebrowser/DrawableThreadLoader.java", "license": "apache-2.0", "size": 8934 }
[ "java.util.Stack" ]
import java.util.Stack;
import java.util.*;
[ "java.util" ]
java.util;
1,498,452
public static List<String> asLines(String aName, Class<?> aClass) { List<String> result = new ArrayList<>(); // can't use Path with URI here, since it doesn't work in Web Start try ( // uses the class loader search mechanism: InputStream input = aClass.getResourceAsStream(aName); InputStreamReader isr = new InputStreamReader(input, ENCODING); BufferedReader reader = new BufferedReader(isr);) { String line = null; while ((line = reader.readLine()) != null) { result.add(line); } } catch (IOException ex) { ex.printStackTrace(); } return Collections.unmodifiableList(result); } // PRIVATE private final static Charset ENCODING = StandardCharsets.UTF_8;
static List<String> function(String aName, Class<?> aClass) { List<String> result = new ArrayList<>(); try ( InputStream input = aClass.getResourceAsStream(aName); InputStreamReader isr = new InputStreamReader(input, ENCODING); BufferedReader reader = new BufferedReader(isr);) { String line = null; while ((line = reader.readLine()) != null) { result.add(line); } } catch (IOException ex) { ex.printStackTrace(); } return Collections.unmodifiableList(result); } private final static Charset ENCODING = StandardCharsets.UTF_8;
/** * Return a whole text file as an unmodifiable list of lines. * * @param aName * name of a file, relative to the location of the given class. * Usually, the file is in the same directory as the class that * is using it; in that case, the file name is just the simple * file name. */
Return a whole text file as an unmodifiable list of lines
asLines
{ "repo_name": "hiepst/TrendingDemo", "path": "TrendingApp/src/main/java/com/cs/client/util/FileUtil.java", "license": "lgpl-3.0", "size": 2179 }
[ "java.io.BufferedReader", "java.io.IOException", "java.io.InputStream", "java.io.InputStreamReader", "java.nio.charset.Charset", "java.nio.charset.StandardCharsets", "java.util.ArrayList", "java.util.Collections", "java.util.List" ]
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collections; import java.util.List;
import java.io.*; import java.nio.charset.*; import java.util.*;
[ "java.io", "java.nio", "java.util" ]
java.io; java.nio; java.util;
1,053,770
private void initStatusBar() { // Instantiate the status bar statusBar = new JLabel("Ready"); // Set the color and border statusBar.setForeground(Color.black); statusBar.setBorder(new CompoundBorder(new EmptyBorder(2, 2, 2, 2), new SoftBevelBorder(SoftBevelBorder.LOWERED))); // Add to the content pane frame.getContentPane().add(statusBar, BorderLayout.SOUTH); }
void function() { statusBar = new JLabel("Ready"); statusBar.setForeground(Color.black); statusBar.setBorder(new CompoundBorder(new EmptyBorder(2, 2, 2, 2), new SoftBevelBorder(SoftBevelBorder.LOWERED))); frame.getContentPane().add(statusBar, BorderLayout.SOUTH); }
/** * Initialize the status bar. */
Initialize the status bar
initStatusBar
{ "repo_name": "argonium/diesel", "path": "src/io/miti/diesel/app/DieselConsole.java", "license": "mit", "size": 5299 }
[ "java.awt.BorderLayout", "java.awt.Color", "javax.swing.JLabel", "javax.swing.border.CompoundBorder", "javax.swing.border.EmptyBorder", "javax.swing.border.SoftBevelBorder" ]
import java.awt.BorderLayout; import java.awt.Color; import javax.swing.JLabel; import javax.swing.border.CompoundBorder; import javax.swing.border.EmptyBorder; import javax.swing.border.SoftBevelBorder;
import java.awt.*; import javax.swing.*; import javax.swing.border.*;
[ "java.awt", "javax.swing" ]
java.awt; javax.swing;
2,687,985
@Override public void writeVectorUInt(Vector<Long> vector) { log.debug("writeVectorUInt: {}", vector); writeAMF3(); buf.put(AMF3.TYPE_VECTOR_UINT); if (hasReference(vector)) { putInteger(getReferenceId(vector) << 1); return; } storeReference(vector); putInteger(vector.size() << 1 | 1); buf.put((byte) 0x00); for (Long v : vector) { // update this class to implement valueOf like Long.valueOf UnsignedInt uint = new UnsignedInt(v); byte[] arr = uint.getBytes(); buf.put(arr); } }
void function(Vector<Long> vector) { log.debug(STR, vector); writeAMF3(); buf.put(AMF3.TYPE_VECTOR_UINT); if (hasReference(vector)) { putInteger(getReferenceId(vector) << 1); return; } storeReference(vector); putInteger(vector.size() << 1 1); buf.put((byte) 0x00); for (Long v : vector) { UnsignedInt uint = new UnsignedInt(v); byte[] arr = uint.getBytes(); buf.put(arr); } }
/** * Write a Vector&lt;uint&gt;. * * @param vector * vector */
Write a Vector&lt;uint&gt;
writeVectorUInt
{ "repo_name": "maritelle/red5-io", "path": "src/main/java/org/red5/io/amf3/Output.java", "license": "apache-2.0", "size": 20848 }
[ "java.util.Vector", "org.red5.io.object.UnsignedInt" ]
import java.util.Vector; import org.red5.io.object.UnsignedInt;
import java.util.*; import org.red5.io.object.*;
[ "java.util", "org.red5.io" ]
java.util; org.red5.io;
1,028,060
public String getBaseColumnName(int column) throws SQLException;
String function(int column) throws SQLException;
/** * Returns the underlying column name of a query result, or "" * if it is unable to be determined. * * @since 8.0 */
Returns the underlying column name of a query result, or "" if it is unable to be determined
getBaseColumnName
{ "repo_name": "bocap/pgjdbc", "path": "org/postgresql/PGResultSetMetaData.java", "license": "bsd-3-clause", "size": 1203 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
2,298,718
public static List<String> readLines(InputStream input) throws IOException { return readLines(input, Charset.defaultCharset()); }
static List<String> function(InputStream input) throws IOException { return readLines(input, Charset.defaultCharset()); }
/** * Get the contents of an <code>InputStream</code> as a list of Strings, * one entry per line, using the default character encoding of the platform. * <p/> * This method buffers the input internally, so there is no need to use a * <code>BufferedInputStream</code>. * * @param input the <code>InputStream</code> to read from, not null * @return the list of Strings, never null * @throws NullPointerException if the input is null * @throws IOException if an I/O error occurs * @since 1.1 */
Get the contents of an <code>InputStream</code> as a list of Strings, one entry per line, using the default character encoding of the platform. This method buffers the input internally, so there is no need to use a <code>BufferedInputStream</code>
readLines
{ "repo_name": "solaris0403/SeleneDemo", "path": "common_lib/src/main/java/com/tony/selene/common/trinea/android/common/io/IOUtil.java", "license": "gpl-2.0", "size": 95443 }
[ "java.io.IOException", "java.io.InputStream", "java.nio.charset.Charset", "java.util.List" ]
import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charset; import java.util.List;
import java.io.*; import java.nio.charset.*; import java.util.*;
[ "java.io", "java.nio", "java.util" ]
java.io; java.nio; java.util;
347,743