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 Character getCharacterByIdx(int index) { if (index < 0) { return null; } else if (index < firstParty.getNumMembers()) { return firstParty.getMember(index); } else { index -= firstParty.getNumMembers(); return secondParty.getMember(index); } }
Character function(int index) { if (index < 0) { return null; } else if (index < firstParty.getNumMembers()) { return firstParty.getMember(index); } else { index -= firstParty.getNumMembers(); return secondParty.getMember(index); } }
/** * Return character with the given index. This index is * in the range -1..5. For -1, null is returned. * * @param index Index of the character to retrieve * @return The respective member of one of the parties or null */
Return character with the given index. This index is in the range -1..5. For -1, null is returned
getCharacterByIdx
{ "repo_name": "chock-mostlyharmless/mostlyharmless", "path": "eclipse/Bravery Run/src/de/badlegrunners/braveryrun/userinterface/Battle.java", "license": "bsd-3-clause", "size": 9567 }
[ "de.badlegrunners.braveryrun.gamelogic.Character" ]
import de.badlegrunners.braveryrun.gamelogic.Character;
import de.badlegrunners.braveryrun.gamelogic.*;
[ "de.badlegrunners.braveryrun" ]
de.badlegrunners.braveryrun;
2,816,383
@Override public Status metaDataChanged(DsEvent evnt, DsMetaData meta) { Status rval; if (shutdown) { LOG.error("metadataChanged(): shutting down"); rval = shutdownStatus; clientCleanup(); } else { rval = super.metaDataChanged(evnt, meta); //client.metaDataChanged(meta); client.metaDataChanged((TableMetaData) evnt.getEventSource()); } return rval; }
Status function(DsEvent evnt, DsMetaData meta) { Status rval; if (shutdown) { LOG.error(STR); rval = shutdownStatus; clientCleanup(); } else { rval = super.metaDataChanged(evnt, meta); client.metaDataChanged((TableMetaData) evnt.getEventSource()); } return rval; }
/** * New metadata received for an object. This event fires when * processing an operation for a table that has not yet been seen. * <p> * It could also fire if the metadata were to change. * Going forward in GoldenGate for Big Data 12.2 and onward, dynamic * schema changes will be supported. * * @param evnt type of datasource event (transaction, operation, metadata) * @param meta datasource metadata * @return GGDataSource.Status (abend, ok; abort, redo, unknown unused) */
New metadata received for an object. This event fires when processing an operation for a table that has not yet been seen. It could also fire if the metadata were to change. Going forward in GoldenGate for Big Data 12.2 and onward, dynamic schema changes will be supported
metaDataChanged
{ "repo_name": "johnneal3/bdglue2", "path": "bdg-core/src/main/java/bdglue2/source/gghadoop/GG12Handler.java", "license": "apache-2.0", "size": 11762 }
[ "oracle.goldengate.datasource.DsEvent", "oracle.goldengate.datasource.GGDataSource", "oracle.goldengate.datasource.meta.DsMetaData", "oracle.goldengate.datasource.meta.TableMetaData" ]
import oracle.goldengate.datasource.DsEvent; import oracle.goldengate.datasource.GGDataSource; import oracle.goldengate.datasource.meta.DsMetaData; import oracle.goldengate.datasource.meta.TableMetaData;
import oracle.goldengate.datasource.*; import oracle.goldengate.datasource.meta.*;
[ "oracle.goldengate.datasource" ]
oracle.goldengate.datasource;
1,049,265
public void removeInputPort() throws GraphException { List<DataPort> inputPorts = getInputPorts(); // Remove the last one. DataPort inputPort = inputPorts.get(inputPorts.size() - 1); removeInputPort(inputPort); }
void function() throws GraphException { List<DataPort> inputPorts = getInputPorts(); DataPort inputPort = inputPorts.get(inputPorts.size() - 1); removeInputPort(inputPort); }
/** * Removes the last input port. * * @throws GraphException */
Removes the last input port
removeInputPort
{ "repo_name": "gouravshenoy/airavata", "path": "modules/workflow-model/workflow-model-core/src/main/java/org/apache/airavata/workflow/model/graph/system/EndBlockNode.java", "license": "apache-2.0", "size": 8529 }
[ "java.util.List", "org.apache.airavata.workflow.model.graph.DataPort", "org.apache.airavata.workflow.model.graph.GraphException" ]
import java.util.List; import org.apache.airavata.workflow.model.graph.DataPort; import org.apache.airavata.workflow.model.graph.GraphException;
import java.util.*; import org.apache.airavata.workflow.model.graph.*;
[ "java.util", "org.apache.airavata" ]
java.util; org.apache.airavata;
1,238,540
SourceFolder addSourceFolder(@NotNull VirtualFile file, boolean isTestSource);
SourceFolder addSourceFolder(@NotNull VirtualFile file, boolean isTestSource);
/** * Adds a source or test source root under the content root. * * @param file the directory to add as a source root. * @param isTestSource true if the directory is added as a test source root. * @return the object representing the added root. */
Adds a source or test source root under the content root
addSourceFolder
{ "repo_name": "jexp/idea2", "path": "platform/lang-api/src/com/intellij/openapi/roots/ContentEntry.java", "license": "apache-2.0", "size": 4442 }
[ "com.intellij.openapi.vfs.VirtualFile", "org.jetbrains.annotations.NotNull" ]
import com.intellij.openapi.vfs.VirtualFile; import org.jetbrains.annotations.NotNull;
import com.intellij.openapi.vfs.*; import org.jetbrains.annotations.*;
[ "com.intellij.openapi", "org.jetbrains.annotations" ]
com.intellij.openapi; org.jetbrains.annotations;
2,814,595
public void testGetByObjectIdVersionCorrection() { final DynamicDelegatingConfigMaster master = registerDelegates(); final ConfigDocument doc1 = master.add(UID_SCHEME_1, new ConfigDocument(_cfg1Scheme1)); final ConfigDocument doc2 = master.add(UID_SCHEME_2, new ConfigDocument(_cfg2Scheme2)); final ConfigDocument doc3 = master.add(UID_SCHEME_3, new ConfigDocument(_cfg3Scheme3)); final ConfigDocument doc4 = master.add(UID_SCHEME_1, new ConfigDocument(_cfg4Scheme1)); final ConfigDocument doc5 = master.add(UID_SCHEME_2, new ConfigDocument(_cfg5Scheme2)); final ConfigDocument doc6 = master.add(UID_SCHEME_2, new ConfigDocument(_cfg6Scheme2)); final VersionCorrection vc = VersionCorrection.of(Instant.ofEpochSecond(1000), Instant.ofEpochSecond(1500)); assertEquals(master.get(doc1.getObjectId(), vc), doc1); assertEquals(master.get(doc2.getObjectId(), vc), doc2); assertEquals(master.get(doc3.getObjectId(), vc), doc3); assertEquals(master.get(doc4.getObjectId(), vc), doc4); assertEquals(master.get(doc5.getObjectId(), vc), doc5); assertEquals(master.get(doc6.getObjectId(), vc), doc6); }
void function() { final DynamicDelegatingConfigMaster master = registerDelegates(); final ConfigDocument doc1 = master.add(UID_SCHEME_1, new ConfigDocument(_cfg1Scheme1)); final ConfigDocument doc2 = master.add(UID_SCHEME_2, new ConfigDocument(_cfg2Scheme2)); final ConfigDocument doc3 = master.add(UID_SCHEME_3, new ConfigDocument(_cfg3Scheme3)); final ConfigDocument doc4 = master.add(UID_SCHEME_1, new ConfigDocument(_cfg4Scheme1)); final ConfigDocument doc5 = master.add(UID_SCHEME_2, new ConfigDocument(_cfg5Scheme2)); final ConfigDocument doc6 = master.add(UID_SCHEME_2, new ConfigDocument(_cfg6Scheme2)); final VersionCorrection vc = VersionCorrection.of(Instant.ofEpochSecond(1000), Instant.ofEpochSecond(1500)); assertEquals(master.get(doc1.getObjectId(), vc), doc1); assertEquals(master.get(doc2.getObjectId(), vc), doc2); assertEquals(master.get(doc3.getObjectId(), vc), doc3); assertEquals(master.get(doc4.getObjectId(), vc), doc4); assertEquals(master.get(doc5.getObjectId(), vc), doc5); assertEquals(master.get(doc6.getObjectId(), vc), doc6); }
/** * Tests getting documents by object id / version correction. The underlying * master in this case does not track versions. */
Tests getting documents by object id / version correction. The underlying master in this case does not track versions
testGetByObjectIdVersionCorrection
{ "repo_name": "McLeodMoores/starling", "path": "projects/master/src/test/java/com/opengamma/master/config/impl/DynamicDelegatingConfigMasterTest.java", "license": "apache-2.0", "size": 49632 }
[ "com.opengamma.id.VersionCorrection", "com.opengamma.master.config.ConfigDocument", "org.testng.Assert", "org.threeten.bp.Instant" ]
import com.opengamma.id.VersionCorrection; import com.opengamma.master.config.ConfigDocument; import org.testng.Assert; import org.threeten.bp.Instant;
import com.opengamma.id.*; import com.opengamma.master.config.*; import org.testng.*; import org.threeten.bp.*;
[ "com.opengamma.id", "com.opengamma.master", "org.testng", "org.threeten.bp" ]
com.opengamma.id; com.opengamma.master; org.testng; org.threeten.bp;
2,655,967
public Builder setAutomaticEntriesInfoplistInput(Artifact automaticEntriesInfoplist) { this.automaticEntriesInfoplistInput = automaticEntriesInfoplist; return this; } /** * Adds any info plists specified in the given rule's {@code infoplist} or {@code infoplists} * attribute as well as from its {@code options} as inputs to this bundle's {@code Info.plist}
Builder function(Artifact automaticEntriesInfoplist) { this.automaticEntriesInfoplistInput = automaticEntriesInfoplist; return this; } /** * Adds any info plists specified in the given rule's {@code infoplist} or {@code infoplists} * attribute as well as from its {@code options} as inputs to this bundle's {@code Info.plist}
/** * Adds an artifact representing an {@code Info.plist} that contains automatic entries * generated by xcode. */
Adds an artifact representing an Info.plist that contains automatic entries generated by xcode
setAutomaticEntriesInfoplistInput
{ "repo_name": "hhclam/bazel", "path": "src/main/java/com/google/devtools/build/lib/rules/objc/Bundling.java", "license": "apache-2.0", "size": 19706 }
[ "com.google.devtools.build.lib.actions.Artifact" ]
import com.google.devtools.build.lib.actions.Artifact;
import com.google.devtools.build.lib.actions.*;
[ "com.google.devtools" ]
com.google.devtools;
2,486,421
protected void execute(HttpServletRequest request, HttpServletResponse response, RequestContext context) throws Exception { // process the request LOGGER.finer("Returning openSearchDescription XML ...."); String xml = readXml(request,context); String contentType = "application/opensearchdescription+xml; charset=UTF-8"; LOGGER.finer("openSearchDescription.xml:\n"+xml); writeCharacterResponse(response,xml,"UTF-8",contentType); }
void function(HttpServletRequest request, HttpServletResponse response, RequestContext context) throws Exception { LOGGER.finer(STR); String xml = readXml(request,context); String contentType = STR; LOGGER.finer(STR+xml); writeCharacterResponse(response,xml,"UTF-8",contentType); }
/** * Executes a request. * @param request the servlet request * @param response the servlet response * @param context the request context * @throws Exception if an exception occurs */
Executes a request
execute
{ "repo_name": "usgin/usgin-geoportal", "path": "src/com/esri/gpt/control/rest/OpenSearchDescriptionServlet.java", "license": "apache-2.0", "size": 4602 }
[ "com.esri.gpt.framework.context.RequestContext", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse" ]
import com.esri.gpt.framework.context.RequestContext; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;
import com.esri.gpt.framework.context.*; import javax.servlet.http.*;
[ "com.esri.gpt", "javax.servlet" ]
com.esri.gpt; javax.servlet;
2,245,308
static <M, P1, P2, P3, P4, P5> TypedModeledFramework5<M, P1, P2, P3, P4, P5> from(ModeledFrameworkBuilder<M> frameworkBuilder, ModelSpecBuilder<M> modelSpecBuilder, String pathWithIds) { TypedModelSpec5<M, P1, P2, P3, P4, P5> typedModelSpec = TypedModelSpec5.from(modelSpecBuilder, pathWithIds); return (client, p1, p2, p3, p4, p5) -> frameworkBuilder.withClient(client).withModelSpec(typedModelSpec.resolved(p1, p2, p3, p4, p5)).build(); }
static <M, P1, P2, P3, P4, P5> TypedModeledFramework5<M, P1, P2, P3, P4, P5> from(ModeledFrameworkBuilder<M> frameworkBuilder, ModelSpecBuilder<M> modelSpecBuilder, String pathWithIds) { TypedModelSpec5<M, P1, P2, P3, P4, P5> typedModelSpec = TypedModelSpec5.from(modelSpecBuilder, pathWithIds); return (client, p1, p2, p3, p4, p5) -> frameworkBuilder.withClient(client).withModelSpec(typedModelSpec.resolved(p1, p2, p3, p4, p5)).build(); }
/** * Return a new TypedModeledFramework using the given modeled framework builder, model spec builder and a path with ids. * When {@link #resolved(AsyncCuratorFramework, Object, Object, Object, Object, Object)} is called the actual ModeledFramework is generated with the * resolved model spec and resolved path * * @param frameworkBuilder ModeledFrameworkBuilder * @param modelSpecBuilder model spec builder * @param pathWithIds path with {XXXX} parameters * @return new TypedModeledFramework */
Return a new TypedModeledFramework using the given modeled framework builder, model spec builder and a path with ids. When <code>#resolved(AsyncCuratorFramework, Object, Object, Object, Object, Object)</code> is called the actual ModeledFramework is generated with the resolved model spec and resolved path
from
{ "repo_name": "mosoft521/curator", "path": "curator-x-async/src/main/java/org/apache/curator/x/async/modeled/typed/TypedModeledFramework5.java", "license": "apache-2.0", "size": 3205 }
[ "org.apache.curator.x.async.modeled.ModelSpecBuilder", "org.apache.curator.x.async.modeled.ModeledFrameworkBuilder" ]
import org.apache.curator.x.async.modeled.ModelSpecBuilder; import org.apache.curator.x.async.modeled.ModeledFrameworkBuilder;
import org.apache.curator.x.async.modeled.*;
[ "org.apache.curator" ]
org.apache.curator;
1,173,445
public EnvironmentInstanceDto toDto() { EnvironmentInstanceDto envInstanceDto = new EnvironmentInstanceDto(); envInstanceDto.setEnvironmentInstanceName(getName()); envInstanceDto.setDescription(this.getDescription()); envInstanceDto.setBlueprintName(this.getBlueprintName()); if (this.getStatus() != null) { envInstanceDto.setStatus(this.getStatus()); } List<TierInstanceDto> lTierInstanceDto = new ArrayList<TierInstanceDto>(); if (getTierInstances() != null) { for (TierInstance tierInstance : getTierInstances()) { lTierInstanceDto.add(tierInstance.toDto()); } envInstanceDto.setTierInstances(lTierInstanceDto); } if (getVdc() != null) { envInstanceDto.setVdc(getVdc()); } if (getPrivateAttributes() != null) { envInstanceDto.setAttributes(getPrivateAttributes()); } return envInstanceDto; }
EnvironmentInstanceDto function() { EnvironmentInstanceDto envInstanceDto = new EnvironmentInstanceDto(); envInstanceDto.setEnvironmentInstanceName(getName()); envInstanceDto.setDescription(this.getDescription()); envInstanceDto.setBlueprintName(this.getBlueprintName()); if (this.getStatus() != null) { envInstanceDto.setStatus(this.getStatus()); } List<TierInstanceDto> lTierInstanceDto = new ArrayList<TierInstanceDto>(); if (getTierInstances() != null) { for (TierInstance tierInstance : getTierInstances()) { lTierInstanceDto.add(tierInstance.toDto()); } envInstanceDto.setTierInstances(lTierInstanceDto); } if (getVdc() != null) { envInstanceDto.setVdc(getVdc()); } if (getPrivateAttributes() != null) { envInstanceDto.setAttributes(getPrivateAttributes()); } return envInstanceDto; }
/** * the dto specification. * * @return the dto */
the dto specification
toDto
{ "repo_name": "hmunfru/fiware-paas", "path": "model/src/main/java/com/telefonica/euro_iaas/paasmanager/model/EnvironmentInstance.java", "license": "apache-2.0", "size": 11953 }
[ "com.telefonica.euro_iaas.paasmanager.model.dto.EnvironmentInstanceDto", "com.telefonica.euro_iaas.paasmanager.model.dto.TierInstanceDto", "java.util.ArrayList", "java.util.List" ]
import com.telefonica.euro_iaas.paasmanager.model.dto.EnvironmentInstanceDto; import com.telefonica.euro_iaas.paasmanager.model.dto.TierInstanceDto; import java.util.ArrayList; import java.util.List;
import com.telefonica.euro_iaas.paasmanager.model.dto.*; import java.util.*;
[ "com.telefonica.euro_iaas", "java.util" ]
com.telefonica.euro_iaas; java.util;
291,266
public void startShell() throws IOException { synchronized (this) { if (flag_closed) throw new IOException("This session is closed."); if (flag_execution_started) throw new IOException("A remote execution has already started."); flag_execution_started = true; } cm.requestShell(cn); }
void function() throws IOException { synchronized (this) { if (flag_closed) throw new IOException(STR); if (flag_execution_started) throw new IOException(STR); flag_execution_started = true; } cm.requestShell(cn); }
/** * Start a shell on the remote machine. * * @throws IOException */
Start a shell on the remote machine
startShell
{ "repo_name": "MonALISA-CIT/fdt", "path": "src/ch/ethz/ssh2/Session.java", "license": "apache-2.0", "size": 16087 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,106,565
private FlowToken finishEndUserDefinedEnvironment(final UserDefinedEnvironment environment) throws SnuggleParseException { int endEndIndex = position; ErrorToken errorToken = makeSubstitutionAndRewind( startTokenIndex, endEndIndex, environment.getEndDefinitionSlice().extract()); return errorToken == null ? readNextToken() : errorToken; }
FlowToken function(final UserDefinedEnvironment environment) throws SnuggleParseException { int endEndIndex = position; ErrorToken errorToken = makeSubstitutionAndRewind( startTokenIndex, endEndIndex, environment.getEndDefinitionSlice().extract()); return errorToken == null ? readNextToken() : errorToken; }
/** * Finishes the handling of the end of a user-defined environment. This replaces the * <tt>\\end{envName}</tt> with the appropriate substitution and reparses. * * <p>PRE-CONDITION: position will point to the character immediately after * <tt>\\begin{envName}</tt>. */
Finishes the handling of the end of a user-defined environment. This replaces the \\end{envName} with the appropriate substitution and reparses. \\begin{envName}
finishEndUserDefinedEnvironment
{ "repo_name": "axkr/symja_android_library", "path": "symja_android_library/matheclipse-external/src/main/java/uk/ac/ed/ph/snuggletex/internal/LaTeXTokeniser.java", "license": "gpl-3.0", "size": 99213 }
[ "uk.ac.ed.ph.snuggletex.definitions.UserDefinedEnvironment", "uk.ac.ed.ph.snuggletex.tokens.ErrorToken", "uk.ac.ed.ph.snuggletex.tokens.FlowToken" ]
import uk.ac.ed.ph.snuggletex.definitions.UserDefinedEnvironment; import uk.ac.ed.ph.snuggletex.tokens.ErrorToken; import uk.ac.ed.ph.snuggletex.tokens.FlowToken;
import uk.ac.ed.ph.snuggletex.definitions.*; import uk.ac.ed.ph.snuggletex.tokens.*;
[ "uk.ac.ed" ]
uk.ac.ed;
1,551,983
default Optional<V> get(K key, QueryOptions opts) throws IOException { opts = opts.withStart(0).withLimit(2); List<V> results; try { results = getSource(keyPredicate(key), opts).read().toList(); } catch (QueryParseException e) { throw new IOException("Unexpected QueryParseException during get()", e); } catch (OrmException e) { throw new IOException(e); } switch (results.size()) { case 0: return Optional.empty(); case 1: return Optional.of(results.get(0)); default: throw new IOException("Multiple results found in index for key " + key + ": " + results); } }
default Optional<V> get(K key, QueryOptions opts) throws IOException { opts = opts.withStart(0).withLimit(2); List<V> results; try { results = getSource(keyPredicate(key), opts).read().toList(); } catch (QueryParseException e) { throw new IOException(STR, e); } catch (OrmException e) { throw new IOException(e); } switch (results.size()) { case 0: return Optional.empty(); case 1: return Optional.of(results.get(0)); default: throw new IOException(STR + key + STR + results); } }
/** * Get a single document from the index. * * @param key document key. * @param opts query options. Options that do not make sense in the context of a single document, * such as start, will be ignored. * @return a single document if present. * @throws IOException */
Get a single document from the index
get
{ "repo_name": "gerrit-review/gerrit", "path": "java/com/google/gerrit/index/Index.java", "license": "apache-2.0", "size": 4567 }
[ "com.google.gerrit.index.query.QueryParseException", "com.google.gwtorm.server.OrmException", "java.io.IOException", "java.util.List", "java.util.Optional" ]
import com.google.gerrit.index.query.QueryParseException; import com.google.gwtorm.server.OrmException; import java.io.IOException; import java.util.List; import java.util.Optional;
import com.google.gerrit.index.query.*; import com.google.gwtorm.server.*; import java.io.*; import java.util.*;
[ "com.google.gerrit", "com.google.gwtorm", "java.io", "java.util" ]
com.google.gerrit; com.google.gwtorm; java.io; java.util;
2,555,467
public void closedUpdate() { final List<Packet> packets = new ArrayList<>(); collectHotbarSlotChange(packets); for (int i = EQUIPMENT_START_INDEX; i <= OFFHAND_SLOT_INDEX; i++) { collectSlotChangeMessages(packets, i, true); } if (!packets.isEmpty()) { // Stream the messages to the player getPlayer().getConnection().send(packets); } }
void function() { final List<Packet> packets = new ArrayList<>(); collectHotbarSlotChange(packets); for (int i = EQUIPMENT_START_INDEX; i <= OFFHAND_SLOT_INDEX; i++) { collectSlotChangeMessages(packets, i, true); } if (!packets.isEmpty()) { getPlayer().getConnection().send(packets); } }
/** * Update for changes while a other {@link ClientContainer} is opened. */
Update for changes while a other <code>ClientContainer</code> is opened
closedUpdate
{ "repo_name": "LanternPowered/LanternServer", "path": "src/main/java/org/lanternpowered/server/inventory/client/PlayerClientContainer.java", "license": "mit", "size": 7411 }
[ "java.util.ArrayList", "java.util.List", "org.lanternpowered.server.network.packet.Packet" ]
import java.util.ArrayList; import java.util.List; import org.lanternpowered.server.network.packet.Packet;
import java.util.*; import org.lanternpowered.server.network.packet.*;
[ "java.util", "org.lanternpowered.server" ]
java.util; org.lanternpowered.server;
780,810
void getPositionRelativeToContainer(View containerView, int[] position);
void getPositionRelativeToContainer(View containerView, int[] position);
/** * Calculate the relative position wrt to the given container view. * @param containerView The container view to be used. * @param position The position array to be used for returning the calculated position. */
Calculate the relative position wrt to the given container view
getPositionRelativeToContainer
{ "repo_name": "mogoweb/365browser", "path": "app/src/main/java/org/chromium/chrome/browser/toolbar/Toolbar.java", "license": "apache-2.0", "size": 4345 }
[ "android.view.View" ]
import android.view.View;
import android.view.*;
[ "android.view" ]
android.view;
457,839
private String annotationToString() { StringBuilder sb = new StringBuilder("@").append(annotationType().getName()).append("("); Iterator<Method> iterator = AnnotationUtils.getAttributeMethods(annotationType()).iterator(); while (iterator.hasNext()) { Method attributeMethod = iterator.next(); sb.append(attributeMethod.getName()); sb.append('='); sb.append(attributeValueToString(getAttributeValue(attributeMethod))); sb.append(iterator.hasNext() ? ", " : ""); } return sb.append(")").toString(); }
String function() { StringBuilder sb = new StringBuilder("@").append(annotationType().getName()).append("("); Iterator<Method> iterator = AnnotationUtils.getAttributeMethods(annotationType()).iterator(); while (iterator.hasNext()) { Method attributeMethod = iterator.next(); sb.append(attributeMethod.getName()); sb.append('='); sb.append(attributeValueToString(getAttributeValue(attributeMethod))); sb.append(iterator.hasNext() ? STR : STR)").toString(); }
/** * See {@link Annotation#toString()} for guidelines on the recommended format. */
See <code>Annotation#toString()</code> for guidelines on the recommended format
annotationToString
{ "repo_name": "boggad/jdk9-sample", "path": "sample-catalog/spring-jdk9/src/spring.core/org/springframework/core/annotation/SynthesizedAnnotationInvocationHandler.java", "license": "mit", "size": 7993 }
[ "java.lang.reflect.Method", "java.util.Iterator" ]
import java.lang.reflect.Method; import java.util.Iterator;
import java.lang.reflect.*; import java.util.*;
[ "java.lang", "java.util" ]
java.lang; java.util;
1,329,799
return DefaultSetHolder.DEFAULT_STOP_SET; } private static class DefaultSetHolder { static final CharArraySet DEFAULT_STOP_SET; static { try { DEFAULT_STOP_SET = WordlistLoader.getSnowballWordSet(IOUtils.getDecodingReader(SnowballFilter.class, DEFAULT_STOPWORD_FILE, IOUtils.CHARSET_UTF_8), Version.LUCENE_CURRENT); } catch (IOException ex) { // default set should always be present as it is part of the // distribution (JAR) throw new RuntimeException("Unable to load default stopword set"); } } } public DanishAnalyzer(Version matchVersion) { this(matchVersion, DefaultSetHolder.DEFAULT_STOP_SET); } public DanishAnalyzer(Version matchVersion, CharArraySet stopwords) { this(matchVersion, stopwords, CharArraySet.EMPTY_SET); } public DanishAnalyzer(Version matchVersion, CharArraySet stopwords, CharArraySet stemExclusionSet) { super(matchVersion, stopwords); this.stemExclusionSet = CharArraySet.unmodifiableSet(CharArraySet.copy( matchVersion, stemExclusionSet)); } /** * Creates a * {@link org.apache.lucene.analysis.Analyzer.TokenStreamComponents} * which tokenizes all the text in the provided {@link Reader}. * * @return A * {@link org.apache.lucene.analysis.Analyzer.TokenStreamComponents} * built from an {@link StandardTokenizer} filtered with * {@link StandardFilter}, {@link LowerCaseFilter}, {@link StopFilter}
return DefaultSetHolder.DEFAULT_STOP_SET; } private static class DefaultSetHolder { static final CharArraySet DEFAULT_STOP_SET; static { try { DEFAULT_STOP_SET = WordlistLoader.getSnowballWordSet(IOUtils.getDecodingReader(SnowballFilter.class, DEFAULT_STOPWORD_FILE, IOUtils.CHARSET_UTF_8), Version.LUCENE_CURRENT); } catch (IOException ex) { throw new RuntimeException(STR); } } } public DanishAnalyzer(Version matchVersion) { this(matchVersion, DefaultSetHolder.DEFAULT_STOP_SET); } public DanishAnalyzer(Version matchVersion, CharArraySet stopwords) { this(matchVersion, stopwords, CharArraySet.EMPTY_SET); } public DanishAnalyzer(Version matchVersion, CharArraySet stopwords, CharArraySet stemExclusionSet) { super(matchVersion, stopwords); this.stemExclusionSet = CharArraySet.unmodifiableSet(CharArraySet.copy( matchVersion, stemExclusionSet)); } /** * Creates a * {@link org.apache.lucene.analysis.Analyzer.TokenStreamComponents} * which tokenizes all the text in the provided {@link Reader}. * * @return A * {@link org.apache.lucene.analysis.Analyzer.TokenStreamComponents} * built from an {@link StandardTokenizer} filtered with * {@link StandardFilter}, {@link LowerCaseFilter}, {@link StopFilter}
/** * Returns an unmodifiable instance of the default stop words set. * @return default stop words set. */
Returns an unmodifiable instance of the default stop words set
getDefaultStopSet
{ "repo_name": "fogbeam/Heceta_solr", "path": "lucene/analysis/common/src/java/org/apache/lucene/analysis/da/DanishAnalyzer.java", "license": "apache-2.0", "size": 5087 }
[ "java.io.IOException", "java.io.Reader", "org.apache.lucene.analysis.Analyzer", "org.apache.lucene.analysis.core.LowerCaseFilter", "org.apache.lucene.analysis.core.StopFilter", "org.apache.lucene.analysis.snowball.SnowballFilter", "org.apache.lucene.analysis.standard.StandardFilter", "org.apache.lucene.analysis.standard.StandardTokenizer", "org.apache.lucene.analysis.util.CharArraySet", "org.apache.lucene.analysis.util.WordlistLoader", "org.apache.lucene.util.IOUtils", "org.apache.lucene.util.Version" ]
import java.io.IOException; import java.io.Reader; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.core.LowerCaseFilter; import org.apache.lucene.analysis.core.StopFilter; import org.apache.lucene.analysis.snowball.SnowballFilter; import org.apache.lucene.analysis.standard.StandardFilter; import org.apache.lucene.analysis.standard.StandardTokenizer; import org.apache.lucene.analysis.util.CharArraySet; import org.apache.lucene.analysis.util.WordlistLoader; import org.apache.lucene.util.IOUtils; import org.apache.lucene.util.Version;
import java.io.*; import org.apache.lucene.analysis.*; import org.apache.lucene.analysis.core.*; import org.apache.lucene.analysis.snowball.*; import org.apache.lucene.analysis.standard.*; import org.apache.lucene.analysis.util.*; import org.apache.lucene.util.*;
[ "java.io", "org.apache.lucene" ]
java.io; org.apache.lucene;
502,975
File f = new File("Font\\LAIKA.otf"); FileInputStream in = new FileInputStream(f); font = Font.createFont(Font.TRUETYPE_FONT, in); } // table referencing notes data static String[] notes ={"B","C","Db","D","Eb","E","F","Gb","G","Ab","Bb","A"};
File f = new File(STR); FileInputStream in = new FileInputStream(f); font = Font.createFont(Font.TRUETYPE_FONT, in); } static String[] notes ={"B","C","Db","D","Eb","E","F","Gb","G","Ab","Bb","A"};
/** * this method create the static font * @throws Exception */
this method create the static font
createFont
{ "repo_name": "kara71/KaraOK", "path": "Content.java", "license": "gpl-2.0", "size": 3504 }
[ "java.awt.Font", "java.io.File", "java.io.FileInputStream" ]
import java.awt.Font; import java.io.File; import java.io.FileInputStream;
import java.awt.*; import java.io.*;
[ "java.awt", "java.io" ]
java.awt; java.io;
2,071,281
public GutterIconInfo addLineTrackingIcon(int line, Icon icon, String tip) throws BadLocationException { int offs = textArea.getLineStartOffset(line); return addOffsetTrackingIcon(offs, icon, tip); }
GutterIconInfo function(int line, Icon icon, String tip) throws BadLocationException { int offs = textArea.getLineStartOffset(line); return addOffsetTrackingIcon(offs, icon, tip); }
/** * Adds an icon that tracks an offset in the document, and is displayed * adjacent to the line numbers. This is useful for marking things such * as source code errors. * * @param line The line to track (zero-based). * @param icon The icon to display. This should be small (say 16x16). * @param tip An optional tool tip for the icon. * @return A tag for this icon. This can later be used in a call to * {@link #removeTrackingIcon(GutterIconInfo)} to remove this * icon. * @throws BadLocationException If <code>offs</code> is an invalid offset * into the text area. * @see #addLineTrackingIcon(int, Icon) * @see #addOffsetTrackingIcon(int, Icon) * @see #removeTrackingIcon(GutterIconInfo) */
Adds an icon that tracks an offset in the document, and is displayed adjacent to the line numbers. This is useful for marking things such as source code errors
addLineTrackingIcon
{ "repo_name": "fanruan/finereport-design", "path": "designer_base/src/com/fr/design/gui/syntax/ui/rtextarea/Gutter.java", "license": "gpl-3.0", "size": 26284 }
[ "javax.swing.Icon", "javax.swing.text.BadLocationException" ]
import javax.swing.Icon; import javax.swing.text.BadLocationException;
import javax.swing.*; import javax.swing.text.*;
[ "javax.swing" ]
javax.swing;
2,129,734
protected static void processRows(final Element element, final List<FormRowIFace> cellRows, final DBTableInfo tableinfo) { Element rowsElement = (Element)element.selectSingleNode("rows"); if (rowsElement != null) { byte rowNumber = 0; for ( Iterator<?> i = rowsElement.elementIterator( "row" ); i.hasNext(); ) { Element rowElement = (Element) i.next(); FormRow formRow = new FormRow(); formRow.setRowNumber(rowNumber); for ( Iterator<?> cellIter = rowElement.elementIterator( "cell" ); cellIter.hasNext(); ) { Element cellElement = (Element)cellIter.next(); String cellId = getAttr(cellElement, ID, ""); String cellName = getAttr(cellElement, NAME, cellId); // let the name default to the id if it doesn't have a name int colspan = getAttr(cellElement, "colspan", 1); int rowspan = getAttr(cellElement, "rowspan", 1); FormCell.CellType cellType = null; FormCellIFace cell = null; try { cellType = FormCellIFace.CellType.valueOf(cellElement.attributeValue(TYPE)); } catch (java.lang.IllegalArgumentException ex) { FormDevHelper.appendFormDevError(ex.toString()); FormDevHelper.appendFormDevError(String.format("Cell Name[%s] Id[%s] Type[%s]", cellName, cellId, cellElement.attributeValue(TYPE))); return; } if (doFieldVerification && fldVerTableInfo != null && cellType == FormCellIFace.CellType.field && StringUtils.isNotEmpty(cellId) && !cellName.equals("this")) { processFieldVerify(cellName, cellId, rowNumber); } switch (cellType) { case label: { cell = formRow.addCell(new FormCellLabel(cellId, cellName, getLabel(cellElement), getAttr(cellElement, "labelfor", ""), getAttr(cellElement, "icon", null), getAttr(cellElement, "recordobj", false), colspan)); String initialize = getAttr(cellElement, INITIALIZE, null); if (StringUtils.isNotEmpty(initialize)) { cell.setProperties(UIHelper.parseProperties(initialize)); } break; } case separator: { cell = formRow.addCell(new FormCellSeparator(cellId, cellName, getLabel(cellElement), getAttr(cellElement, "collapse", ""), colspan)); String initialize = getAttr(cellElement, INITIALIZE, null); if (StringUtils.isNotEmpty(initialize)) { cell.setProperties(UIHelper.parseProperties(initialize)); } break; } case field: { String uitypeStr = getAttr(cellElement, "uitype", ""); String format = getAttr(cellElement, "format", ""); String formatName = getAttr(cellElement, "formatname", ""); String uiFieldFormatterName = getAttr(cellElement, "uifieldformatter", ""); int cols = getAttr(cellElement, "cols", DEFAULT_COLS); // XXX PREF for default width of text field int rows = getAttr(cellElement, "rows", DEFAULT_ROWS); // XXX PREF for default heightof text area String validationType = getAttr(cellElement, "valtype", "Changed"); String validationRule = getAttr(cellElement, VALIDATION, ""); String initialize = getAttr(cellElement, INITIALIZE, ""); boolean isRequired = getAttr(cellElement, ISREQUIRED, false); String pickListName = getAttr(cellElement, "picklist", ""); if (isNotEmpty(format) && isNotEmpty(formatName)) { String msg = "Both format and formatname cannot both be set! ["+cellName+"] ignoring format"; log.error(msg); FormDevHelper.appendFormDevError(msg); format = ""; } Properties properties = UIHelper.parseProperties(initialize); if (isEmpty(uitypeStr)) { // XXX DEBUG ONLY PLease REMOVE LATER //log.debug("***************************************************************************"); //log.debug("***** Cell Id["+cellId+"] Name["+cellName+"] uitype is empty and should be 'text'. (Please Fix!)"); //log.debug("***************************************************************************"); uitypeStr = "text"; } // THis switch is used to get the "display type" and // set up other vars needed for creating the controls FormCellFieldIFace.FieldType uitype = null; try { uitype = FormCellFieldIFace.FieldType.valueOf(uitypeStr); } catch (java.lang.IllegalArgumentException ex) { FormDevHelper.appendFormDevError(ex.toString()); FormDevHelper.appendFormDevError(String.format("Cell Name[%s] Id[%s] uitype[%s] is in error", cellName, cellId, uitypeStr)); uitype = FormCellFieldIFace.FieldType.text; // default to text } String dspUITypeStr = null; switch (uitype) { case textarea: dspUITypeStr = getAttr(cellElement, DSPUITYPE, "dsptextarea"); break; case textareabrief: dspUITypeStr = getAttr(cellElement, DSPUITYPE, "textareabrief"); break; case querycbx: { dspUITypeStr = getAttr(cellElement, DSPUITYPE, "textfieldinfo"); String fmtName = TypeSearchForQueryFactory.getInstance().getDataObjFormatterName(properties.getProperty("name")); if (isEmpty(formatName) && isNotEmpty(fmtName)) { formatName = fmtName; } break; } case formattedtext: { validationRule = getAttr(cellElement, VALIDATION, "formatted"); // XXX Is this OK? dspUITypeStr = getAttr(cellElement, DSPUITYPE, "formattedtext"); //------------------------------------------------------- // This part should be moved to the ViewFactory // because it is the only part that need the Schema Information //------------------------------------------------------- if (isNotEmpty(uiFieldFormatterName)) { UIFieldFormatterIFace uiFormatter = UIFieldFormatterMgr.getInstance().getFormatter(uiFieldFormatterName); if (uiFormatter == null) { String msg = "Couldn't find formatter["+uiFieldFormatterName+"]"; log.error(msg); FormDevHelper.appendFormDevError(msg); uiFieldFormatterName = ""; uitype = FormCellFieldIFace.FieldType.text; } } else // ok now check the schema for the UI formatter { if (tableinfo != null) { DBFieldInfo fieldInfo = tableinfo.getFieldByName(cellName); if (fieldInfo != null) { if (fieldInfo.getFormatter() != null) { uiFieldFormatterName = fieldInfo.getFormatter().getName(); } else if (fieldInfo.getDataClass().isAssignableFrom(Date.class) || fieldInfo.getDataClass().isAssignableFrom(Calendar.class)) { String msg = "Missing Date Formatter for ["+cellName+"]"; log.error(msg); FormDevHelper.appendFormDevError(msg); uiFieldFormatterName = "Date"; UIFieldFormatterIFace uiFormatter = UIFieldFormatterMgr.getInstance().getFormatter(uiFieldFormatterName); if (uiFormatter == null) { uiFieldFormatterName = ""; uitype = FormCellFieldIFace.FieldType.text; } } else { uiFieldFormatterName = ""; uitype = FormCellFieldIFace.FieldType.text; } } } } break; } case url: dspUITypeStr = getAttr(cellElement, DSPUITYPE, uitypeStr); properties = UIHelper.parseProperties(initialize); break; case list: case image: case tristate: case checkbox: case password: dspUITypeStr = getAttr(cellElement, DSPUITYPE, uitypeStr); break; case plugin: case button: dspUITypeStr = getAttr(cellElement, DSPUITYPE, uitypeStr); properties = UIHelper.parseProperties(initialize); String ttl = properties.getProperty(TITLE); if (ttl != null) { properties.put(TITLE, getResourceLabel(ttl)); } break; case spinner: dspUITypeStr = getAttr(cellElement, DSPUITYPE, "dsptextfield"); properties = UIHelper.parseProperties(initialize); break; case combobox: dspUITypeStr = getAttr(cellElement, DSPUITYPE, "textpl"); if (tableinfo != null) { DBFieldInfo fieldInfo = tableinfo.getFieldByName(cellName); if (fieldInfo != null) { if (StringUtils.isNotEmpty(pickListName)) { fieldInfo.setPickListName(pickListName); } else { pickListName = fieldInfo.getPickListName(); } } } break; default: dspUITypeStr = getAttr(cellElement, DSPUITYPE, "dsptextfield"); break; } //switch FormCellFieldIFace.FieldType dspUIType = FormCellFieldIFace.FieldType.valueOf(dspUITypeStr); try { dspUIType = FormCellFieldIFace.FieldType.valueOf(dspUITypeStr); } catch (java.lang.IllegalArgumentException ex) { FormDevHelper.appendFormDevError(ex.toString()); FormDevHelper.appendFormDevError(String.format("Cell Name[%s] Id[%s] dspuitype[%s] is in error", cellName, cellId, dspUIType)); uitype = FormCellFieldIFace.FieldType.label; // default to text } // check to see see if the validation is a node in the cell if (isEmpty(validationRule)) { Element valNode = (Element)cellElement.selectSingleNode(VALIDATION); if (valNode != null) { String str = valNode.getTextTrim(); if (isNotEmpty(str)) { validationRule = str; } } } boolean isEncrypted = getAttr(cellElement, "isencrypted", false); boolean isReadOnly = uitype == FormCellFieldIFace.FieldType.dsptextfield || uitype == FormCellFieldIFace.FieldType.dsptextarea || uitype == FormCellFieldIFace.FieldType.label; FormCellField field = new FormCellField(FormCellIFace.CellType.field, cellId, cellName, uitype, dspUIType, format, formatName, uiFieldFormatterName, isRequired, cols, rows, colspan, rowspan, validationType, validationRule, isEncrypted); String labelStr = uitype == FormCellFieldIFace.FieldType.checkbox ? getLabel(cellElement) : getAttr(cellElement, "label", ""); field.setLabel(labelStr); field.setReadOnly(getAttr(cellElement, "readonly", isReadOnly)); field.setDefaultValue(getAttr(cellElement, "default", "")); field.setPickListName(pickListName); field.setChangeListenerOnly(getAttr(cellElement, "changesonly", true) && !isRequired); field.setProperties(properties); cell = formRow.addCell(field); break; } case command: { cell = formRow.addCell(new FormCellCommand(cellId, cellName, getLabel(cellElement), getAttr(cellElement, "commandtype", ""), getAttr(cellElement, "action", ""))); String initialize = getAttr(cellElement, INITIALIZE, null); if (StringUtils.isNotEmpty(initialize)) { cell.setProperties(UIHelper.parseProperties(initialize)); } break; } case panel: { FormCellPanel cellPanel = new FormCellPanel(cellId, cellName, getAttr(cellElement, "paneltype", ""), getAttr(cellElement, "coldef", "p"), getAttr(cellElement, "rowdef", "p"), colspan, rowspan); String initialize = getAttr(cellElement, INITIALIZE, null); if (StringUtils.isNotEmpty(initialize)) { cellPanel.setProperties(UIHelper.parseProperties(initialize)); } processRows(cellElement, cellPanel.getRows(), tableinfo); fixLabels(cellPanel.getName(), cellPanel.getRows(), tableinfo); cell = formRow.addCell(cellPanel); break; } case subview: { Properties properties = UIHelper.parseProperties(getAttr(cellElement, INITIALIZE, null)); String svViewSetName = cellElement.attributeValue("viewsetname"); if (isEmpty(svViewSetName)) { svViewSetName = null; } if (instance.doingResourceLabels && properties != null) { String title = properties.getProperty(TITLE); if (title != null) { properties.setProperty(TITLE, UIRegistry.getResourceString(title)); } } String viewName = getAttr(cellElement, "viewname", null); cell = formRow.addCell(new FormCellSubView(cellId, cellName, svViewSetName, viewName, cellElement.attributeValue("class"), getAttr(cellElement, "desc", ""), getAttr(cellElement, "defaulttype", null), getAttr(cellElement, "rows", DEFAULT_SUBVIEW_ROWS), colspan, rowspan, getAttr(cellElement, "single", false))); cell.setProperties(properties); break; } case iconview: { String vsName = cellElement.attributeValue("viewsetname"); if (isEmpty(vsName)) { vsName = instance.viewSetName; } String viewName = getAttr(cellElement, "viewname", null); cell = formRow.addCell(new FormCellSubView(cellId, cellName, vsName, viewName, cellElement.attributeValue("class"), getAttr(cellElement, "desc", ""), colspan, rowspan)); break; } case statusbar: { cell = formRow.addCell(new FormCell(FormCellIFace.CellType.statusbar, cellId, cellName, colspan, rowspan)); break; } default: { // what is this? log.error("Encountered unknown cell type"); continue; } } // switch cell.setIgnoreSetGet(getAttr(cellElement, "ignore", false)); } cellRows.add(formRow); rowNumber++; } } }
static void function(final Element element, final List<FormRowIFace> cellRows, final DBTableInfo tableinfo) { Element rowsElement = (Element)element.selectSingleNode("rows"); if (rowsElement != null) { byte rowNumber = 0; for ( Iterator<?> i = rowsElement.elementIterator( "row" ); i.hasNext(); ) { Element rowElement = (Element) i.next(); FormRow formRow = new FormRow(); formRow.setRowNumber(rowNumber); for ( Iterator<?> cellIter = rowElement.elementIterator( "cell" ); cellIter.hasNext(); ) { Element cellElement = (Element)cellIter.next(); String cellId = getAttr(cellElement, ID, STRcolspanSTRrowspanSTRCell Name[%s] Id[%s] Type[%s]STRthisSTRlabelforSTRSTRiconSTRrecordobjSTRcollapseSTRSTRuitypeSTRSTRformatSTRSTRformatnameSTRSTRuifieldformatterSTRSTRcolsSTRrowsSTRvaltypeSTRChangedSTRSTRSTRpicklistSTRSTRBoth format and formatname cannot both be set! [STR] ignoring formatSTRSTRtextSTRCell Name[%s] Id[%s] uitype[%s] is in errorSTRdsptextareaSTRtextareabriefSTRtextfieldinfoSTRnameSTRformattedSTRformattedtextSTRCouldn't find formatter[STR]STRSTRMissing Date Formatter for [STR]STRDateSTRSTRSTRdsptextfieldSTRtextplSTRdsptextfieldSTRCell Name[%s] Id[%s] dspuitype[%s] is in errorSTRisencryptedSTRlabelSTRSTRreadonlySTRdefaultSTRSTRchangesonlySTRcommandtypeSTRSTRactionSTRSTRpaneltypeSTRSTRcoldefSTRpSTRrowdefSTRpSTRviewsetnameSTRviewnameSTRclassSTRdescSTRSTRdefaulttypeSTRrowsSTRsingleSTRviewsetnameSTRviewnameSTRclassSTRdescSTRSTREncountered unknown cell typeSTRignore", false)); } cellRows.add(formRow); rowNumber++; } } }
/** * Processes all the rows * @param element the parent DOM element of the rows * @param cellRows the list the rows are to be added to */
Processes all the rows
processRows
{ "repo_name": "specify/specify6", "path": "src/edu/ku/brc/af/ui/forms/persist/ViewLoader.java", "license": "gpl-2.0", "size": 72771 }
[ "edu.ku.brc.af.core.db.DBTableInfo", "edu.ku.brc.helpers.XMLHelper", "java.util.Date", "java.util.Iterator", "java.util.List", "org.dom4j.Element" ]
import edu.ku.brc.af.core.db.DBTableInfo; import edu.ku.brc.helpers.XMLHelper; import java.util.Date; import java.util.Iterator; import java.util.List; import org.dom4j.Element;
import edu.ku.brc.af.core.db.*; import edu.ku.brc.helpers.*; import java.util.*; import org.dom4j.*;
[ "edu.ku.brc", "java.util", "org.dom4j" ]
edu.ku.brc; java.util; org.dom4j;
1,284,325
private void notifyErrorToAllWatchers(NdefError error) { if (mWatchIds.size() != 0) mClient.onError(error); }
void function(NdefError error) { if (mWatchIds.size() != 0) mClient.onError(error); }
/** * Notify all active watchers that an error happened when trying to read the tag coming nearby. */
Notify all active watchers that an error happened when trying to read the tag coming nearby
notifyErrorToAllWatchers
{ "repo_name": "scheib/chromium", "path": "services/device/nfc/android/java/src/org/chromium/device/nfc/NfcImpl.java", "license": "bsd-3-clause", "size": 20977 }
[ "org.chromium.device.mojom.NdefError" ]
import org.chromium.device.mojom.NdefError;
import org.chromium.device.mojom.*;
[ "org.chromium.device" ]
org.chromium.device;
411,171
public String getServiceDateRange() { String ret = "0"; java.util.Date dt = null; try { java.text.DateFormat formatter = new java.text.SimpleDateFormat( "yyyyMMdd"); dt = formatter.parse(this.serviceDate); } catch (Exception e) { MiscUtils.getLogger().error("Error", e); } oscar.util.DateUtils ut = new oscar.util.DateUtils(); long daysOld = DateUtils.getDifDays(new Date(), dt); if (daysOld >= 0 && daysOld <= 30) { ret = "1"; } else if (daysOld >= 31 && daysOld <= 60) { ret = "2"; } else if (daysOld >= 61 && daysOld <= 90) { ret = "3"; } else if (daysOld > 91) { ret = "4"; } return ret; }
String function() { String ret = "0"; java.util.Date dt = null; try { java.text.DateFormat formatter = new java.text.SimpleDateFormat( STR); dt = formatter.parse(this.serviceDate); } catch (Exception e) { MiscUtils.getLogger().error("Error", e); } oscar.util.DateUtils ut = new oscar.util.DateUtils(); long daysOld = DateUtils.getDifDays(new Date(), dt); if (daysOld >= 0 && daysOld <= 30) { ret = "1"; } else if (daysOld >= 31 && daysOld <= 60) { ret = "2"; } else if (daysOld >= 61 && daysOld <= 90) { ret = "3"; } else if (daysOld > 91) { ret = "4"; } return ret; }
/** * Returns an int value representing the date range of a bill's age in days * since its initial service date * @return int */
Returns an int value representing the date range of a bill's age in days since its initial service date
getServiceDateRange
{ "repo_name": "hexbinary/landing", "path": "src/main/java/oscar/entities/MSPBill.java", "license": "gpl-2.0", "size": 13630 }
[ "java.util.Date", "org.oscarehr.util.MiscUtils" ]
import java.util.Date; import org.oscarehr.util.MiscUtils;
import java.util.*; import org.oscarehr.util.*;
[ "java.util", "org.oscarehr.util" ]
java.util; org.oscarehr.util;
2,298,567
public CsvConfiguration suggestCsvConfiguration() throws IllegalStateException { final byte[] sample = getSampleBuffer(); final String encoding = suggestEncoding(sample); return suggestCsvConfiguration(sample, encoding); }
CsvConfiguration function() throws IllegalStateException { final byte[] sample = getSampleBuffer(); final String encoding = suggestEncoding(sample); return suggestCsvConfiguration(sample, encoding); }
/** * Auto-detects the {@link CsvConfiguration} of a CSV style data file. * * @return * @throws IllegalStateException * if an error occurs during auto-detection */
Auto-detects the <code>CsvConfiguration</code> of a CSV style data file
suggestCsvConfiguration
{ "repo_name": "anandswarupv/DataCleaner", "path": "engine/utils/src/main/java/org/datacleaner/util/CsvConfigurationDetection.java", "license": "lgpl-3.0", "size": 9967 }
[ "org.apache.metamodel.csv.CsvConfiguration" ]
import org.apache.metamodel.csv.CsvConfiguration;
import org.apache.metamodel.csv.*;
[ "org.apache.metamodel" ]
org.apache.metamodel;
218,306
@SuppressWarnings("unchecked") public <N, V> List<HColumn<N, V>> getColumns(Keyspace ko, Object columnFamily, Object key, Set<String> columnNames, Serializer<N> nameSerializer, Serializer<V> valueSerializer) throws Exception { if (db_logger.isInfoEnabled()) { db_logger.info("getColumns cf=" + columnFamily + " key=" + key + " names=" + columnNames); } SliceQuery<ByteBuffer, N, V> q = createSliceQuery(ko, be, nameSerializer, valueSerializer); q.setColumnFamily(columnFamily.toString()); q.setKey(bytebuffer(key)); // q.setColumnNames(columnNames.toArray(new String[0])); q.setColumnNames((N[]) nameSerializer.fromBytesSet( se.toBytesSet(new ArrayList<String>(columnNames))).toArray()); QueryResult<ColumnSlice<N, V>> r = q.execute(); ColumnSlice<N, V> slice = r.get(); List<HColumn<N, V>> results = slice.getColumns(); if (db_logger.isInfoEnabled()) { if (results == null) { db_logger.info("getColumns returned null"); } else { db_logger.info("getColumns returned " + results.size() + " columns"); } } return results; }
@SuppressWarnings(STR) <N, V> List<HColumn<N, V>> function(Keyspace ko, Object columnFamily, Object key, Set<String> columnNames, Serializer<N> nameSerializer, Serializer<V> valueSerializer) throws Exception { if (db_logger.isInfoEnabled()) { db_logger.info(STR + columnFamily + STR + key + STR + columnNames); } SliceQuery<ByteBuffer, N, V> q = createSliceQuery(ko, be, nameSerializer, valueSerializer); q.setColumnFamily(columnFamily.toString()); q.setKey(bytebuffer(key)); q.setColumnNames((N[]) nameSerializer.fromBytesSet( se.toBytesSet(new ArrayList<String>(columnNames))).toArray()); QueryResult<ColumnSlice<N, V>> r = q.execute(); ColumnSlice<N, V> slice = r.get(); List<HColumn<N, V>> results = slice.getColumns(); if (db_logger.isInfoEnabled()) { if (results == null) { db_logger.info(STR); } else { db_logger.info(STR + results.size() + STR); } } return results; }
/** * Gets the columns. * * @param keyspace * the keyspace * @param columnFamily * the column family * @param key * the key * @param columnNames * the column names * @return columns * @throws Exception * the exception */
Gets the columns
getColumns
{ "repo_name": "jendap/usergrid-stack", "path": "core/src/main/java/org/usergrid/persistence/cassandra/CassandraService.java", "license": "apache-2.0", "size": 80319 }
[ "java.nio.ByteBuffer", "java.util.ArrayList", "java.util.List", "java.util.Set", "me.prettyprint.hector.api.Keyspace", "me.prettyprint.hector.api.Serializer", "me.prettyprint.hector.api.beans.ColumnSlice", "me.prettyprint.hector.api.beans.HColumn", "me.prettyprint.hector.api.factory.HFactory", "me.prettyprint.hector.api.query.QueryResult", "me.prettyprint.hector.api.query.SliceQuery" ]
import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.List; import java.util.Set; import me.prettyprint.hector.api.Keyspace; import me.prettyprint.hector.api.Serializer; import me.prettyprint.hector.api.beans.ColumnSlice; import me.prettyprint.hector.api.beans.HColumn; import me.prettyprint.hector.api.factory.HFactory; import me.prettyprint.hector.api.query.QueryResult; import me.prettyprint.hector.api.query.SliceQuery;
import java.nio.*; import java.util.*; import me.prettyprint.hector.api.*; import me.prettyprint.hector.api.beans.*; import me.prettyprint.hector.api.factory.*; import me.prettyprint.hector.api.query.*;
[ "java.nio", "java.util", "me.prettyprint.hector" ]
java.nio; java.util; me.prettyprint.hector;
2,809,036
public void processAllocation(RoutingAllocation allocation) { for (String ignoreNode : ignoreNodes) { allocation.addIgnoreShardForNode(shardId, ignoreNode); } } } static class NodeEntry<T> { private final String nodeId; private boolean fetching; @Nullable private T value; private boolean valueSet; private Throwable failure; public NodeEntry(String nodeId) { this.nodeId = nodeId; }
void function(RoutingAllocation allocation) { for (String ignoreNode : ignoreNodes) { allocation.addIgnoreShardForNode(shardId, ignoreNode); } } } static class NodeEntry<T> { private final String nodeId; private boolean fetching; private T value; private boolean valueSet; private Throwable failure; public NodeEntry(String nodeId) { this.nodeId = nodeId; }
/** * Process any changes needed to the allocation based on this fetch result. */
Process any changes needed to the allocation based on this fetch result
processAllocation
{ "repo_name": "weipinghe/elasticsearch", "path": "core/src/main/java/org/elasticsearch/gateway/AsyncShardFetch.java", "license": "apache-2.0", "size": 17264 }
[ "org.elasticsearch.cluster.routing.allocation.RoutingAllocation" ]
import org.elasticsearch.cluster.routing.allocation.RoutingAllocation;
import org.elasticsearch.cluster.routing.allocation.*;
[ "org.elasticsearch.cluster" ]
org.elasticsearch.cluster;
2,802,058
public List<String> getRolesForPath(String path) { buildTreeWithCacheCheck(); if (getSecureNodes().containsKey(path)) return getSecureNodes().get(path).getRequiredRoles(); return null; }
List<String> function(String path) { buildTreeWithCacheCheck(); if (getSecureNodes().containsKey(path)) return getSecureNodes().get(path).getRequiredRoles(); return null; }
/** * find out requires roles for given path * * @param path * @return */
find out requires roles for given path
getRolesForPath
{ "repo_name": "0x006EA1E5/oo6", "path": "src/main/java/org/otherobjects/cms/site/NavigationServiceImpl.java", "license": "gpl-3.0", "size": 11732 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,690,362
public int breakScript(String fileName, int lineNumber, PyObject locals) { final int ACTION_STOP = 0; final int ACTION_STEP = 1; final int ACTION_CONTINUE = 2; final int ACTION_STEPINTO = 3; try { mLocals = locals; // inform the listeners that breakpoint has been reached File file = new File(fileName); if (file.exists()) { String filePathName = fileName; try { filePathName = file.getCanonicalPath(); } catch (Exception e) { // ???? } testScriptBreakPointEventHandler.break_(filePathName, lineNumber); // retrieve the variable pythonResultEventHandler.pythonResult(getPythonVariablesDump()); logger.info("Test case stopped at file " + fileName + " line " + lineNumber); // Stop the script executioncanonicalName until the Condition 'startCondition' has been reached // Actually, this startCondition is set by the GUI breakpointMgr.stop(); logger.debug("beakpoint start is called with action " + action.toString()); switch (action) { case CONTINUE: try { // TODO: should be better to only add/remove modified breakpoints engine.eval("__debugger.clear_all_breaks()"); for (Breakpoint b : breakPointEventHandler.getBreakpoints()) { engine.eval("__debugger.set_break(r'" + b.getFileName() + "', " + b.getLineIndex() + ")"); } } catch (ScriptException e) { logger.error("Couldn't reset breakpoints !"); } logger.debug("Jython test script: CONTINUE"); testScriptBreakPointEventHandler.continue_(); // Inform the GUI that the script has been continued logger.info("Test case continued at line " + lineNumber); return ACTION_CONTINUE; case STEP: testScriptBreakPointEventHandler.step(); // Inform the GUI that the script has been continued logger.info("Test case continued at line " + lineNumber); return ACTION_STEP; case STEPINTO: testScriptBreakPointEventHandler.stepInto(); // Inform the GUI that the script has been continued logger.info("Test case continued at line " + lineNumber); return ACTION_STEPINTO; case STOP: testScriptBreakPointEventHandler.stop(); // Inform the GUI that the script has been continued logger.info("Test case stopped at line " + lineNumber); return ACTION_STOP; default: logger.error("Implementation error: action should be CONTINUE, STEP or STOP but is " + action); throw new RuntimeException( "Implementation error: action should be CONTINUE, STEP or STOP but is " + action); } } else { return ACTION_STEPINTO; } } catch (InterruptedException ex) { logger.error("Interrupted Exception occured\n:" + ex.getMessage() + "\nat line " + lineNumber); } return ACTION_STOP; }
int function(String fileName, int lineNumber, PyObject locals) { final int ACTION_STOP = 0; final int ACTION_STEP = 1; final int ACTION_CONTINUE = 2; final int ACTION_STEPINTO = 3; try { mLocals = locals; File file = new File(fileName); if (file.exists()) { String filePathName = fileName; try { filePathName = file.getCanonicalPath(); } catch (Exception e) { } testScriptBreakPointEventHandler.break_(filePathName, lineNumber); pythonResultEventHandler.pythonResult(getPythonVariablesDump()); logger.info(STR + fileName + STR + lineNumber); breakpointMgr.stop(); logger.debug(STR + action.toString()); switch (action) { case CONTINUE: try { engine.eval(STR); for (Breakpoint b : breakPointEventHandler.getBreakpoints()) { engine.eval(STR + b.getFileName() + STR + b.getLineIndex() + ")"); } } catch (ScriptException e) { logger.error(STR); } logger.debug(STR); testScriptBreakPointEventHandler.continue_(); logger.info(STR + lineNumber); return ACTION_CONTINUE; case STEP: testScriptBreakPointEventHandler.step(); logger.info(STR + lineNumber); return ACTION_STEP; case STEPINTO: testScriptBreakPointEventHandler.stepInto(); logger.info(STR + lineNumber); return ACTION_STEPINTO; case STOP: testScriptBreakPointEventHandler.stop(); logger.info(STR + lineNumber); return ACTION_STOP; default: logger.error(STR + action); throw new RuntimeException( STR + action); } } else { return ACTION_STEPINTO; } } catch (InterruptedException ex) { logger.error(STR + ex.getMessage() + STR + lineNumber); } return ACTION_STOP; }
/** * breakScript method is called from the Python Script in order to stop its execution * * @param lineNumber script line number * @param locals giving the local variables if any * @return <ul> * <li>0 if script execution must be stopped</li> * <li>1 if script execution must be stopped at next executed line</li> * <li>2 if script execution must be continued</li> * </ul> */
breakScript method is called from the Python Script in order to stop its execution
breakScript
{ "repo_name": "qspin/qtaste", "path": "kernel/src/main/java/com/qspin/qtaste/testsuite/impl/JythonTestScript.java", "license": "lgpl-3.0", "size": 65709 }
[ "com.qspin.qtaste.debug.Breakpoint", "java.io.File", "javax.script.ScriptException", "org.python.core.PyObject" ]
import com.qspin.qtaste.debug.Breakpoint; import java.io.File; import javax.script.ScriptException; import org.python.core.PyObject;
import com.qspin.qtaste.debug.*; import java.io.*; import javax.script.*; import org.python.core.*;
[ "com.qspin.qtaste", "java.io", "javax.script", "org.python.core" ]
com.qspin.qtaste; java.io; javax.script; org.python.core;
2,427,965
@ApiModelProperty(example = "null", value = "") public String getFriendlyName() { return friendlyName; }
@ApiModelProperty(example = "null", value = "") String function() { return friendlyName; }
/** * Get friendlyName * @return friendlyName **/
Get friendlyName
getFriendlyName
{ "repo_name": "ixaris/ope-applicationclients", "path": "java-client/src/main/java/com/ixaris/ope/applications/client/model/ExternalAccountFilter.java", "license": "mit", "size": 4727 }
[ "io.swagger.annotations.ApiModelProperty" ]
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.*;
[ "io.swagger.annotations" ]
io.swagger.annotations;
768,226
public final boolean isActive() throws BuildException { return CUtil.isActive(getProject(), ifCond, unlessCond); }
final boolean function() throws BuildException { return CUtil.isActive(getProject(), ifCond, unlessCond); }
/** * Returns true if the define's if and unless conditions (if any) are * satisfied. * * @exception BuildException * throws build exception if name is not set */
Returns true if the define's if and unless conditions (if any) are satisfied
isActive
{ "repo_name": "cniweb/ant-contrib", "path": "cpptasks/src/main/java/net/sf/antcontrib/cpptasks/VersionInfo.java", "license": "apache-2.0", "size": 20040 }
[ "org.apache.tools.ant.BuildException" ]
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.*;
[ "org.apache.tools" ]
org.apache.tools;
764,214
protected void destroyMBeans(ContextResourceLink resourceLink) throws Exception { // Destroy the MBean for the ContextResourceLink itself if (debug >= 3) { log("Destroying MBean for ContextResourceLink " + resourceLink); } MBeanUtils.destroyMBean(resourceLink); }
void function(ContextResourceLink resourceLink) throws Exception { if (debug >= 3) { log(STR + resourceLink); } MBeanUtils.destroyMBean(resourceLink); }
/** * Deregister the MBeans for the specified ContextResourceLink entry. * * @param resourceLink ContextResourceLink for which to destroy MBeans * @throws Exception if an exception is thrown during MBean destruction */
Deregister the MBeans for the specified ContextResourceLink entry
destroyMBeans
{ "repo_name": "NorthFacing/step-by-Java", "path": "fra-tomcat/fra-tomcat-analysis/source/book01/HowTomcatWorks/src/org/apache/catalina/mbeans/ServerLifecycleListener.java", "license": "gpl-2.0", "size": 51276 }
[ "org.apache.catalina.deploy.ContextResourceLink" ]
import org.apache.catalina.deploy.ContextResourceLink;
import org.apache.catalina.deploy.*;
[ "org.apache.catalina" ]
org.apache.catalina;
1,587,810
public void setBulkUploads(final Set<BulkUpload> bulkUpload) { this.bulkUploads = bulkUpload; }
void function(final Set<BulkUpload> bulkUpload) { this.bulkUploads = bulkUpload; }
/** * Set the value related to the column: bulkUpload. * @param bulkUpload the bulkUpload value you wish to set */
Set the value related to the column: bulkUpload
setBulkUploads
{ "repo_name": "servinglynk/hmis-lynk-open-source", "path": "hmis-model-v2017/src/main/java/com/servinglynk/hmis/warehouse/model/v2017/Export.java", "license": "mpl-2.0", "size": 53361 }
[ "com.servinglynk.hmis.warehouse.model.base.BulkUpload", "java.util.Set" ]
import com.servinglynk.hmis.warehouse.model.base.BulkUpload; import java.util.Set;
import com.servinglynk.hmis.warehouse.model.base.*; import java.util.*;
[ "com.servinglynk.hmis", "java.util" ]
com.servinglynk.hmis; java.util;
455,213
public static MatchResult assertMatchesRegex( String expectedRegex, String actual) { return assertMatchesRegex(null, expectedRegex, actual); } /** * Asserts that {@code expectedRegex} matches any substring of {@code actual}
static MatchResult function( String expectedRegex, String actual) { return assertMatchesRegex(null, expectedRegex, actual); } /** * Asserts that {@code expectedRegex} matches any substring of {@code actual}
/** * Variant of {@link #assertMatchesRegex(String,String,String)} using a * generic message. */
Variant of <code>#assertMatchesRegex(String,String,String)</code> using a generic message
assertMatchesRegex
{ "repo_name": "zorzella/test-libraries-for-java", "path": "src/main/java/com/google/common/testing/junit4/JUnitAsserts.java", "license": "apache-2.0", "size": 8069 }
[ "java.util.regex.MatchResult" ]
import java.util.regex.MatchResult;
import java.util.regex.*;
[ "java.util" ]
java.util;
1,287,105
Map<MetricName, ? extends Metric> metrics();
Map<MetricName, ? extends Metric> metrics();
/** * Return the metrics kept by the consumer * @return metrics */
Return the metrics kept by the consumer
metrics
{ "repo_name": "prasannapramod/apex-malhar", "path": "kafka/kafka-common/src/main/java/org/apache/apex/malhar/kafka/AbstractKafkaConsumer.java", "license": "apache-2.0", "size": 3791 }
[ "java.util.Map", "org.apache.kafka.common.Metric", "org.apache.kafka.common.MetricName" ]
import java.util.Map; import org.apache.kafka.common.Metric; import org.apache.kafka.common.MetricName;
import java.util.*; import org.apache.kafka.common.*;
[ "java.util", "org.apache.kafka" ]
java.util; org.apache.kafka;
1,742,734
protected synchronized void parse(short[] inBuf, int inBufLen) throws IOException { if (log.isLoggable(Level.FINEST)) { StringBuffer inBufStr = new StringBuffer("parsing buffer: "); for (int i = 0; i < inBufLen; i++) { // prepending the hex digit with 0x prefix for // convenience of putting dumped data into tests inBufStr.append("0x").append(Integer.toHexString(inBuf[i])) .append(", "); } log.finest(inBufStr.toString()); } else if (log.isLoggable(Level.FINE)) { log.fine("parsing buffer"); } bufferAddr = rw.getCursorPosition(); fields = rw.getFields(); chars = rw.getDataBuffer(); dataIn = inBuf; dataInLen = inBufLen; //is the first byte an EBCDIC cmd, if so convert it switch (dataIn[0]) { case CMD_W_EBCDIC: dataIn[0] = CMD_W; break; case CMD_EW_EBCDIC: dataIn[0] = CMD_EW; break; case CMD_EWA_EBCDIC: dataIn[0] = CMD_EWA; break; case CMD_EAU_EBCDIC: dataIn[0] = CMD_EAU; break; case CMD_WSF_EBCDIC: dataIn[0] = CMD_WSF; break; case CMD_RB_EBCDIC: dataIn[0] = CMD_RB; break; case CMD_RM_EBCDIC: dataIn[0] = CMD_RM; break; case CMD_RMA_EBCDIC: dataIn[0] = CMD_RMA; break; } //now let's send the commands off to their appropriate methods: switch (dataIn[0]) { case CMD_W: case CMD_EW: case CMD_EWA: case CMD_EAU: log.finest("write operation"); lastWasCommand = true; writeOperation(); buildFields(); client.incomingData(); break; case CMD_WSF: lastWasCommand = true; log.finest("WSF"); writeStructuredField(dataIn); break; case CMD_RB: lastWasCommand = true; //System.out.println("Read Buffer..."); readBuffer(); break; case CMD_RM: lastWasCommand = true; //System.out.println("Read Modified..."); readModified(); break; case CMD_RMA: lastWasCommand = true; //System.out.println("Read Modified All..."); readModifiedAll(); break; default: throw new IOException("Invalid 3270 Command"); } rw.resumeParentThread(); }
synchronized void function(short[] inBuf, int inBufLen) throws IOException { if (log.isLoggable(Level.FINEST)) { StringBuffer inBufStr = new StringBuffer(STR); for (int i = 0; i < inBufLen; i++) { inBufStr.append("0x").append(Integer.toHexString(inBuf[i])) .append(STR); } log.finest(inBufStr.toString()); } else if (log.isLoggable(Level.FINE)) { log.fine(STR); } bufferAddr = rw.getCursorPosition(); fields = rw.getFields(); chars = rw.getDataBuffer(); dataIn = inBuf; dataInLen = inBufLen; switch (dataIn[0]) { case CMD_W_EBCDIC: dataIn[0] = CMD_W; break; case CMD_EW_EBCDIC: dataIn[0] = CMD_EW; break; case CMD_EWA_EBCDIC: dataIn[0] = CMD_EWA; break; case CMD_EAU_EBCDIC: dataIn[0] = CMD_EAU; break; case CMD_WSF_EBCDIC: dataIn[0] = CMD_WSF; break; case CMD_RB_EBCDIC: dataIn[0] = CMD_RB; break; case CMD_RM_EBCDIC: dataIn[0] = CMD_RM; break; case CMD_RMA_EBCDIC: dataIn[0] = CMD_RMA; break; } switch (dataIn[0]) { case CMD_W: case CMD_EW: case CMD_EWA: case CMD_EAU: log.finest(STR); lastWasCommand = true; writeOperation(); buildFields(); client.incomingData(); break; case CMD_WSF: lastWasCommand = true; log.finest("WSF"); writeStructuredField(dataIn); break; case CMD_RB: lastWasCommand = true; readBuffer(); break; case CMD_RM: lastWasCommand = true; readModified(); break; case CMD_RMA: lastWasCommand = true; readModifiedAll(); break; default: throw new IOException(STR); } rw.resumeParentThread(); }
/** * This method takes an input buffer and executes the appropriate * tn3270 commands and orders. */
This method takes an input buffer and executes the appropriate tn3270 commands and orders
parse
{ "repo_name": "AlanKrueger/freehost3270", "path": "client/src/main/java/net/sf/freehost3270/client/RWTn3270StreamParser.java", "license": "lgpl-2.1", "size": 58825 }
[ "java.io.IOException", "java.util.logging.Level" ]
import java.io.IOException; import java.util.logging.Level;
import java.io.*; import java.util.logging.*;
[ "java.io", "java.util" ]
java.io; java.util;
2,543,475
@Experimental(Kind.SCHEMAS) <T> OutputReceiver<Row> getRowReceiver(TupleTag<T> tag); } ///////////////////////////////////////////////////////////////////////////// @Documented @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.FIELD, ElementType.PARAMETER}) @Experimental(Kind.STATE) public @interface StateId { String value(); } @Documented @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.FIELD, ElementType.PARAMETER}) @Experimental(Kind.TIMERS) public @interface TimerId { String value(); } @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.FIELD, ElementType.PARAMETER}) @Experimental(Kind.SCHEMAS) public @interface FieldAccess { String value(); } @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) @Experimental(Kind.TIMERS) public @interface OnTimer { String value(); } @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) @Experimental(Kind.STATE) public @interface OnWindowExpiration {} @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface Setup {} // TODO: Add support for bundle finalization parameter. @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface StartBundle {} @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface ProcessElement {} @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.PARAMETER) public @interface Element {} @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.PARAMETER) public @interface Timestamp {} @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.PARAMETER) public @interface SideInput { String value(); } @Documented @Experimental @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface RequiresStableInput {} @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface FinishBundle {} @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface Teardown {} // TODO: Make the InputT parameter optional. @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) @Experimental(Kind.SPLITTABLE_DO_FN) public @interface GetInitialRestriction {} @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) @Experimental(Kind.SPLITTABLE_DO_FN) public @interface GetSize {} @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) @Experimental(Kind.SPLITTABLE_DO_FN) public @interface GetRestrictionCoder {} // TODO: Make the InputT parameter optional. @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) @Experimental(Kind.SPLITTABLE_DO_FN) public @interface SplitRestriction {} @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) @Experimental(Kind.SPLITTABLE_DO_FN) public @interface NewTracker {} @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) @Experimental(Kind.SPLITTABLE_DO_FN) public @interface BoundedPerElement {} @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) @Experimental(Kind.SPLITTABLE_DO_FN) public @interface UnboundedPerElement {} // This can't be put into ProcessContinuation itself due to the following problem: // http://ternarysearch.blogspot.com/2013/07/static-initialization-deadlock.html private static final ProcessContinuation PROCESS_CONTINUATION_STOP = new AutoValue_DoFn_ProcessContinuation(false, Duration.ZERO);
@Experimental(Kind.SCHEMAS) <T> OutputReceiver<Row> getRowReceiver(TupleTag<T> tag); } @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.FIELD, ElementType.PARAMETER}) @Experimental(Kind.STATE) public @interface StateId { String value(); } @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.FIELD, ElementType.PARAMETER}) @Experimental(Kind.TIMERS) public @interface TimerId { String value(); } @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.FIELD, ElementType.PARAMETER}) @Experimental(Kind.SCHEMAS) public @interface FieldAccess { String value(); } @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) @Experimental(Kind.TIMERS) public @interface OnTimer { String value(); } @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) @Experimental(Kind.STATE) public @interface OnWindowExpiration {} @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface Setup {} @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface StartBundle {} @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface ProcessElement {} @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.PARAMETER) public @interface Element {} @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.PARAMETER) public @interface Timestamp {} @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.PARAMETER) public @interface SideInput { String value(); } @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface RequiresStableInput {} @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface FinishBundle {} @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface Teardown {} @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) @Experimental(Kind.SPLITTABLE_DO_FN) public @interface GetInitialRestriction {} @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) @Experimental(Kind.SPLITTABLE_DO_FN) public @interface GetSize {} @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) @Experimental(Kind.SPLITTABLE_DO_FN) public @interface GetRestrictionCoder {} @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) @Experimental(Kind.SPLITTABLE_DO_FN) public @interface SplitRestriction {} @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) @Experimental(Kind.SPLITTABLE_DO_FN) public @interface NewTracker {} @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) @Experimental(Kind.SPLITTABLE_DO_FN) public @interface BoundedPerElement {} @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE) @Experimental(Kind.SPLITTABLE_DO_FN) public @interface UnboundedPerElement {} private static final ProcessContinuation PROCESS_CONTINUATION_STOP = new AutoValue_DoFn_ProcessContinuation(false, Duration.ZERO);
/** * Returns a {@link OutputReceiver} for publishing {@link Row} objects to the given tag. * * <p>The {@link PCollection} representing this tag must have a schema registered in order to * call this function. */
Returns a <code>OutputReceiver</code> for publishing <code>Row</code> objects to the given tag. The <code>PCollection</code> representing this tag must have a schema registered in order to call this function
getRowReceiver
{ "repo_name": "RyanSkraba/beam", "path": "sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/DoFn.java", "license": "apache-2.0", "size": 42945 }
[ "com.google.auto.value.AutoValue", "java.lang.annotation.ElementType", "java.lang.annotation.Retention", "java.lang.annotation.RetentionPolicy", "java.lang.annotation.Target", "org.apache.beam.sdk.annotations.Experimental", "org.apache.beam.sdk.values.Row", "org.apache.beam.sdk.values.TupleTag", "org.joda.time.Duration" ]
import com.google.auto.value.AutoValue; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import org.apache.beam.sdk.annotations.Experimental; import org.apache.beam.sdk.values.Row; import org.apache.beam.sdk.values.TupleTag; import org.joda.time.Duration;
import com.google.auto.value.*; import java.lang.annotation.*; import org.apache.beam.sdk.annotations.*; import org.apache.beam.sdk.values.*; import org.joda.time.*;
[ "com.google.auto", "java.lang", "org.apache.beam", "org.joda.time" ]
com.google.auto; java.lang; org.apache.beam; org.joda.time;
2,519,325
public static HashFunction hmacSha256(Key key) { return new MacHashFunction("HmacSHA256", key, hmacToString("hmacSha256", key)); }
static HashFunction function(Key key) { return new MacHashFunction(STR, key, hmacToString(STR, key)); }
/** * Returns a hash function implementing the Message Authentication Code (MAC) algorithm, using the * SHA-256 (256 hash bits) hash function and the given secret key. * * * @param key the secret key * @throws IllegalArgumentException if the given key is inappropriate for initializing this MAC * @since 20.0 */
Returns a hash function implementing the Message Authentication Code (MAC) algorithm, using the SHA-256 (256 hash bits) hash function and the given secret key
hmacSha256
{ "repo_name": "migue/voltdb", "path": "third_party/java/src/com/google_voltpatches/common/hash/Hashing.java", "license": "agpl-3.0", "size": 26322 }
[ "java.security.Key" ]
import java.security.Key;
import java.security.*;
[ "java.security" ]
java.security;
646,067
private boolean checkPredicatesDeclaration() { List<NamedTypedList> predicates = this.domain.getPredicates(); Set<String> set = new HashSet<>(); boolean checked = true; for (NamedTypedList predicate : predicates) { for (TypedSymbol variable : predicate.getArguments()) { for (Symbol type : variable.getTypes()) { if (!this.domain.isDeclaredType(type)) { this.mgr.logParserError("type \"" + type.getImage() + "\" of the variable \"" + variable.getImage() + "\" is undefined", this.lexer.getFile(), variable .getBeginLine(), variable.getBeginColumn()); checked = false; } } } Symbol predicateSymbol = predicate.getName(); String str = predicateSymbol.getImage() + "/" + predicate.getArguments().size(); if (!set.add(str)) { this.mgr.logParserError("predicate \"" + str + "\" declared twice", this.lexer .getFile(), predicateSymbol.getBeginLine(), predicateSymbol .getBeginColumn()); checked = false; } } return checked; }
boolean function() { List<NamedTypedList> predicates = this.domain.getPredicates(); Set<String> set = new HashSet<>(); boolean checked = true; for (NamedTypedList predicate : predicates) { for (TypedSymbol variable : predicate.getArguments()) { for (Symbol type : variable.getTypes()) { if (!this.domain.isDeclaredType(type)) { this.mgr.logParserError(STRSTR\STRSTR\STR, this.lexer.getFile(), variable .getBeginLine(), variable.getBeginColumn()); checked = false; } } } Symbol predicateSymbol = predicate.getName(); String str = predicateSymbol.getImage() + "/" + predicate.getArguments().size(); if (!set.add(str)) { this.mgr.logParserError(STRSTR\STR, this.lexer .getFile(), predicateSymbol.getBeginLine(), predicateSymbol .getBeginColumn()); checked = false; } } return checked; }
/** * Checks the predicates declaration. More precisely, this method checks, if the domain is * typed, if each types of the variables used in the predicates declaration are defined, if * there is no duplicated predicate. * * @return <code>true</code> if the predicates declaration are well formed; <code>false</code> otherwise. */
Checks the predicates declaration. More precisely, this method checks, if the domain is typed, if each types of the variables used in the predicates declaration are defined, if there is no duplicated predicate
checkPredicatesDeclaration
{ "repo_name": "pellierd/pddl4j", "path": "src/main/java/fr/uga/pddl4j/parser/Parser.java", "license": "lgpl-3.0", "size": 53966 }
[ "java.util.HashSet", "java.util.List", "java.util.Set" ]
import java.util.HashSet; import java.util.List; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
26,139
private synchronized void rebuildJournal() throws IOException { if (journalWriter != null) { journalWriter.close(); } Writer writer = new BufferedWriter(new FileWriter(journalFileTmp), IO_BUFFER_SIZE); writer.write(MAGIC); writer.write("\n"); writer.write(VERSION_1); writer.write("\n"); writer.write(Integer.toString(appVersion)); writer.write("\n"); writer.write(Integer.toString(valueCount)); writer.write("\n"); writer.write("\n"); for (Entry entry : lruEntries.values()) { if (entry.currentEditor != null) { writer.write(DIRTY + ' ' + entry.key + '\n'); } else { writer.write(CLEAN + ' ' + entry.key + entry.getLengths() + '\n'); } } writer.close(); journalFileTmp.renameTo(journalFile); journalWriter = new BufferedWriter(new FileWriter(journalFile, true), IO_BUFFER_SIZE); }
synchronized void function() throws IOException { if (journalWriter != null) { journalWriter.close(); } Writer writer = new BufferedWriter(new FileWriter(journalFileTmp), IO_BUFFER_SIZE); writer.write(MAGIC); writer.write("\n"); writer.write(VERSION_1); writer.write("\n"); writer.write(Integer.toString(appVersion)); writer.write("\n"); writer.write(Integer.toString(valueCount)); writer.write("\n"); writer.write("\n"); for (Entry entry : lruEntries.values()) { if (entry.currentEditor != null) { writer.write(DIRTY + ' ' + entry.key + '\n'); } else { writer.write(CLEAN + ' ' + entry.key + entry.getLengths() + '\n'); } } writer.close(); journalFileTmp.renameTo(journalFile); journalWriter = new BufferedWriter(new FileWriter(journalFile, true), IO_BUFFER_SIZE); }
/** * Creates a new journal that omits redundant information. This replaces the * current journal if it exists. */
Creates a new journal that omits redundant information. This replaces the current journal if it exists
rebuildJournal
{ "repo_name": "pvkarthik87/HeyBeach", "path": "HeyBeach/app/src/main/java/com/karcompany/heybeach/cache/DiskLruCache.java", "license": "apache-2.0", "size": 33901 }
[ "java.io.BufferedWriter", "java.io.FileWriter", "java.io.IOException", "java.io.Writer" ]
import java.io.BufferedWriter; import java.io.FileWriter; import java.io.IOException; import java.io.Writer;
import java.io.*;
[ "java.io" ]
java.io;
1,794,839
List<Polyfill> getPolyfills(String uaString);
List<Polyfill> getPolyfills(String uaString);
/** * Return a list of polyfills containing all sources of polyfills using default query setting * Alias polyfill will expand into specific polyfills. * @param uaString user agent string; can be in normalized format e.g. chrome/53.0.0 * @return list of polyfills */
Return a list of polyfills containing all sources of polyfills using default query setting Alias polyfill will expand into specific polyfills
getPolyfills
{ "repo_name": "reiniergs/polyfill-service", "path": "polyfill-service-api/src/main/java/org/polyfillservice/api/interfaces/PolyfillService.java", "license": "mit", "size": 2186 }
[ "java.util.List", "org.polyfillservice.api.components.Polyfill" ]
import java.util.List; import org.polyfillservice.api.components.Polyfill;
import java.util.*; import org.polyfillservice.api.components.*;
[ "java.util", "org.polyfillservice.api" ]
java.util; org.polyfillservice.api;
1,365,018
public UserGroupRestRep update(URI id, UserGroupUpdateParam input) { return client.put(UserGroupRestRep.class, input, getIdUrl(), id); }
UserGroupRestRep function(URI id, UserGroupUpdateParam input) { return client.put(UserGroupRestRep.class, input, getIdUrl(), id); }
/** * Updates an user group. * <p> * API Call: <tt>PUT /vdc/admin/user-groups</tt> * * @param input * the update configuration. * @return the updated user group. */
Updates an user group. API Call: PUT /vdc/admin/user-groups
update
{ "repo_name": "emcvipr/controller-client-java", "path": "client/src/main/java/com/emc/vipr/client/core/UserGroup.java", "license": "apache-2.0", "size": 2893 }
[ "com.emc.storageos.model.usergroup.UserGroupRestRep", "com.emc.storageos.model.usergroup.UserGroupUpdateParam" ]
import com.emc.storageos.model.usergroup.UserGroupRestRep; import com.emc.storageos.model.usergroup.UserGroupUpdateParam;
import com.emc.storageos.model.usergroup.*;
[ "com.emc.storageos" ]
com.emc.storageos;
1,722,480
public CcCompilationHelper addPublicHeaders(Collection<Artifact> headers) { for (Artifact header : headers) { addHeader(header, label); } return this; }
CcCompilationHelper function(Collection<Artifact> headers) { for (Artifact header : headers) { addHeader(header, label); } return this; }
/** * Adds {@code headers} as public header files. These files will be made visible to dependent * rules. They may be parsed/preprocessed or compiled into a header module depending on the * configuration. */
Adds headers as public header files. These files will be made visible to dependent rules. They may be parsed/preprocessed or compiled into a header module depending on the configuration
addPublicHeaders
{ "repo_name": "davidzchen/bazel", "path": "src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationHelper.java", "license": "apache-2.0", "size": 89666 }
[ "com.google.devtools.build.lib.actions.Artifact", "java.util.Collection" ]
import com.google.devtools.build.lib.actions.Artifact; import java.util.Collection;
import com.google.devtools.build.lib.actions.*; import java.util.*;
[ "com.google.devtools", "java.util" ]
com.google.devtools; java.util;
1,727,573
@Override public long deleteFiles(String sessionId, long projectId, String directory) throws InvalidSessionException { validateSessionId(sessionId); final String userId = userInfoProvider.getUserId(); return getProjectRpcImpl(userId, projectId).deleteFiles(userId, projectId, directory); }
long function(String sessionId, long projectId, String directory) throws InvalidSessionException { validateSessionId(sessionId); final String userId = userInfoProvider.getUserId(); return getProjectRpcImpl(userId, projectId).deleteFiles(userId, projectId, directory); }
/** * Deletes all files that are contained directly in the given directory. Files * in subdirectories are not deleted. * @param sessionId session id * @param projectId project ID * @param directory path of the directory * @return modification date for project */
Deletes all files that are contained directly in the given directory. Files in subdirectories are not deleted
deleteFiles
{ "repo_name": "be1be1/appinventor-polyu", "path": "appinventor/appengine/src/com/google/appinventor/server/ProjectServiceImpl.java", "license": "apache-2.0", "size": 25003 }
[ "com.google.appinventor.shared.rpc.InvalidSessionException" ]
import com.google.appinventor.shared.rpc.InvalidSessionException;
import com.google.appinventor.shared.rpc.*;
[ "com.google.appinventor" ]
com.google.appinventor;
237,726
public static <E extends Throwable> void assertThrows(ActionFuture future, Class<E> exceptionClass, String extraInfo) { assertThrows(future, exceptionClass, null, extraInfo); }
static <E extends Throwable> void function(ActionFuture future, Class<E> exceptionClass, String extraInfo) { assertThrows(future, exceptionClass, null, extraInfo); }
/** * Run future.actionGet() and check that it throws an exception of the right type * * @param extraInfo extra information to add to the failure message */
Run future.actionGet() and check that it throws an exception of the right type
assertThrows
{ "repo_name": "cwurm/elasticsearch", "path": "test/framework/src/main/java/org/elasticsearch/test/hamcrest/ElasticsearchAssertions.java", "license": "apache-2.0", "size": 34269 }
[ "org.elasticsearch.action.ActionFuture" ]
import org.elasticsearch.action.ActionFuture;
import org.elasticsearch.action.*;
[ "org.elasticsearch.action" ]
org.elasticsearch.action;
2,155,023
void writeInformation(PrintWriter writer) { for (URI uri : superClasses) { if (!uri.equals(parameterURI)) { writer.println(" <superType uri=\"" + uri + "\"/>"); } } for (URI uri : subClasses) { if (!uri.equals(parameterURI)) { writer.println(" <subType uri=\"" + uri + "\"/>"); } } }
void writeInformation(PrintWriter writer) { for (URI uri : superClasses) { if (!uri.equals(parameterURI)) { writer.println(STRSTR\"/>"); } } for (URI uri : subClasses) { if (!uri.equals(parameterURI)) { writer.println(STRSTR\"/>"); } } }
/** * Writes the information stored in this class as an XML fragment to the given writer. * @param writer used to write the XML. */
Writes the information stored in this class as an XML fragment to the given writer
writeInformation
{ "repo_name": "ilke-zilci/serviceMatchingUsingCP", "path": "lib/dino-0.2.2-src/dino-broker/src/uk/ac/ucl/cs/sse/dino/matchmaker/owls/ParameterData.java", "license": "gpl-2.0", "size": 3308 }
[ "java.io.PrintWriter" ]
import java.io.PrintWriter;
import java.io.*;
[ "java.io" ]
java.io;
632,101
public SchemaDescriptor getDeclaredGlobalTemporaryTablesSchemaDescriptor() throws StandardException;
SchemaDescriptor function() throws StandardException;
/** * Get the descriptor for the declared global temporary table schema which is always named "SESSION". * * SQL92 allows a schema to specify a default character set - we will * not support this. * * @return The descriptor for the schema. * * @exception StandardException Thrown on failure */
Get the descriptor for the declared global temporary table schema which is always named "SESSION". SQL92 allows a schema to specify a default character set - we will not support this
getDeclaredGlobalTemporaryTablesSchemaDescriptor
{ "repo_name": "kavin256/Derby", "path": "java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java", "license": "apache-2.0", "size": 79425 }
[ "org.apache.derby.iapi.error.StandardException" ]
import org.apache.derby.iapi.error.StandardException;
import org.apache.derby.iapi.error.*;
[ "org.apache.derby" ]
org.apache.derby;
2,336,064
public static boolean hasAnyFavorites(IUserLayout layout) { Validate.notNull(layout, "Cannot determine whether a null layout contains favorites."); // (premature) performance optimization: short circuit returns true if nonzero favorite portlets return (!getFavoritePortlets(layout).isEmpty() || !getFavoriteCollections(layout).isEmpty() ); }
static boolean function(IUserLayout layout) { Validate.notNull(layout, STR); return (!getFavoritePortlets(layout).isEmpty() !getFavoriteCollections(layout).isEmpty() ); }
/** * True if the layout contains any favorited collections or favorited individual portlets, false otherwise. * @param layout non-null user layout that might contain favorite portlets and/or collections * @return true if the layout contains at least one favorited portlet or collection, false otherwise * @throws IllegalArgumentException if layout is null */
True if the layout contains any favorited collections or favorited individual portlets, false otherwise
hasAnyFavorites
{ "repo_name": "timlevett/uPortal", "path": "uportal-war/src/main/java/org/jasig/portal/portlets/favorites/FavoritesUtils.java", "license": "apache-2.0", "size": 9698 }
[ "org.apache.commons.lang3.Validate", "org.jasig.portal.layout.IUserLayout" ]
import org.apache.commons.lang3.Validate; import org.jasig.portal.layout.IUserLayout;
import org.apache.commons.lang3.*; import org.jasig.portal.layout.*;
[ "org.apache.commons", "org.jasig.portal" ]
org.apache.commons; org.jasig.portal;
1,867,367
public Expression[] getArgs() { return m_args; }
Expression[] function() { return m_args; }
/** * Return an expression array containing arguments at index 3 or greater. * * @return An array that contains the arguments at index 3 or greater. */
Return an expression array containing arguments at index 3 or greater
getArgs
{ "repo_name": "itgeeker/jdk", "path": "src/com/sun/org/apache/xpath/internal/functions/FunctionMultiArgs.java", "license": "apache-2.0", "size": 6504 }
[ "com.sun.org.apache.xpath.internal.Expression" ]
import com.sun.org.apache.xpath.internal.Expression;
import com.sun.org.apache.xpath.internal.*;
[ "com.sun.org" ]
com.sun.org;
1,002,883
@Test public void appendNullVaragsQueryParams() throws Exception { assertEquals("http://test.com/1", KieRemoteHttpRequest.appendQueryParameters("http://test.com/1", (Object[]) null)); }
void function() throws Exception { assertEquals("http: }
/** * Append null params * * @throws Exception */
Append null params
appendNullVaragsQueryParams
{ "repo_name": "jiripetrlik/droolsjbpm-integration", "path": "kie-remote/kie-remote-common/src/test/java/org/kie/remote/common/rest/KieRemoteHttpRequestTest.java", "license": "apache-2.0", "size": 77298 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
1,765,925
public static List<Expression> expressions (Expression... rgExpressions) { List<Expression> list = new ArrayList<> (rgExpressions.length); for (Expression expr : rgExpressions) if (expr != null) list.add (expr); return list; }
static List<Expression> function (Expression... rgExpressions) { List<Expression> list = new ArrayList<> (rgExpressions.length); for (Expression expr : rgExpressions) if (expr != null) list.add (expr); return list; }
/** * Creates a list of expressions from <code>rgExpressions</code>. * * @param rgSpecifiers * The expressions * @return A list of expressions */
Creates a list of expressions from <code>rgExpressions</code>
expressions
{ "repo_name": "intersense/patus-gw", "path": "src/ch/unibas/cs/hpwc/patus/util/CodeGeneratorUtil.java", "license": "lgpl-2.1", "size": 17902 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,079,755
public Object next() throws NoSuchElementException { if( nextList == null ){ throw new NoSuchElementException(); } Object ret = nextList; increment(); return ret; } public void remove(){ throw new UnsupportedOperationException(); }
Object function() throws NoSuchElementException { if( nextList == null ){ throw new NoSuchElementException(); } Object ret = nextList; increment(); return ret; } public void remove(){ throw new UnsupportedOperationException(); }
/** * Returns the next permutation in the iteration. * @return the next permutation in the iteration * @throws NoSuchElementException there are no more permutations */
Returns the next permutation in the iteration
next
{ "repo_name": "boompieman/iim_project", "path": "nxt_1.4.4/src/net/sourceforge/nite/search/ListPermuteIterator.java", "license": "gpl-3.0", "size": 3192 }
[ "java.util.NoSuchElementException" ]
import java.util.NoSuchElementException;
import java.util.*;
[ "java.util" ]
java.util;
2,088,101
private String getWhereClause (Object[] rowData) { int size = m_fields.size(); StringBuffer singleRowWHERE = null; StringBuffer multiRowWHERE = null; for (int col = 0; col < size; col++) { GridField field = (GridField)m_fields.get (col); if (field.isKey()) { String columnName = field.getColumnName(); Object value = rowData[col]; if (value == null) { log.log(Level.WARNING, "PK data is null - " + columnName); return null; } if (columnName.endsWith ("_ID")) singleRowWHERE = new StringBuffer(columnName) .append ("=").append (value); else singleRowWHERE = new StringBuffer(columnName) .append ("=").append (DB.TO_STRING(value.toString())); } else if (field.isParentColumn()) { String columnName = field.getColumnName(); Object value = rowData[col]; if (value == null) { log.log(Level.INFO, "FK data is null - " + columnName); continue; } if (multiRowWHERE == null) multiRowWHERE = new StringBuffer(); else multiRowWHERE.append(" AND "); if (columnName.endsWith ("_ID")) multiRowWHERE.append (columnName) .append ("=").append (value); else multiRowWHERE.append (columnName) .append ("=").append (DB.TO_STRING(value.toString())); } } // for all columns if (singleRowWHERE != null) return singleRowWHERE.toString(); if (multiRowWHERE != null) return multiRowWHERE.toString(); log.log(Level.WARNING, "No key Found"); return null; } // getWhereClause private ArrayList<String> m_createSqlColumn = new ArrayList<String>(); private ArrayList<String> m_createSqlValue = new ArrayList<String>();
String function (Object[] rowData) { int size = m_fields.size(); StringBuffer singleRowWHERE = null; StringBuffer multiRowWHERE = null; for (int col = 0; col < size; col++) { GridField field = (GridField)m_fields.get (col); if (field.isKey()) { String columnName = field.getColumnName(); Object value = rowData[col]; if (value == null) { log.log(Level.WARNING, STR + columnName); return null; } if (columnName.endsWith ("_ID")) singleRowWHERE = new StringBuffer(columnName) .append ("=").append (value); else singleRowWHERE = new StringBuffer(columnName) .append ("=").append (DB.TO_STRING(value.toString())); } else if (field.isParentColumn()) { String columnName = field.getColumnName(); Object value = rowData[col]; if (value == null) { log.log(Level.INFO, STR + columnName); continue; } if (multiRowWHERE == null) multiRowWHERE = new StringBuffer(); else multiRowWHERE.append(STR); if (columnName.endsWith ("_ID")) multiRowWHERE.append (columnName) .append ("=").append (value); else multiRowWHERE.append (columnName) .append ("=").append (DB.TO_STRING(value.toString())); } } if (singleRowWHERE != null) return singleRowWHERE.toString(); if (multiRowWHERE != null) return multiRowWHERE.toString(); log.log(Level.WARNING, STR); return null; } private ArrayList<String> m_createSqlColumn = new ArrayList<String>(); private ArrayList<String> m_createSqlValue = new ArrayList<String>();
/** * Get Record Where Clause from data (single key or multi-parent) * @param rowData data * @return where clause or null */
Get Record Where Clause from data (single key or multi-parent)
getWhereClause
{ "repo_name": "mgrigioni/oseb", "path": "base/src/org/compiere/model/GridTable.java", "license": "gpl-2.0", "size": 97286 }
[ "java.util.ArrayList", "java.util.logging.Level" ]
import java.util.ArrayList; import java.util.logging.Level;
import java.util.*; import java.util.logging.*;
[ "java.util" ]
java.util;
441,329
public static <T> T loadSpringBean(URL springXmlUrl, String beanName) throws IgniteException { try { return IgnitionEx.loadSpringBean(springXmlUrl, beanName); } catch (IgniteCheckedException e) { throw U.convertException(e); } }
static <T> T function(URL springXmlUrl, String beanName) throws IgniteException { try { return IgnitionEx.loadSpringBean(springXmlUrl, beanName); } catch (IgniteCheckedException e) { throw U.convertException(e); } }
/** * Loads Spring bean by its name from given Spring XML configuration file. If bean * with such name doesn't exist, exception is thrown. * * @param springXmlUrl Spring XML configuration file URL (cannot be {@code null}). * @param beanName Bean name (cannot be {@code null}). * @return Loaded bean instance. * @throws IgniteException If bean with provided name was not found or in case any other error. */
Loads Spring bean by its name from given Spring XML configuration file. If bean with such name doesn't exist, exception is thrown
loadSpringBean
{ "repo_name": "nizhikov/ignite", "path": "modules/core/src/main/java/org/apache/ignite/Ignition.java", "license": "apache-2.0", "size": 26588 }
[ "org.apache.ignite.internal.IgnitionEx", "org.apache.ignite.internal.util.typedef.internal.U" ]
import org.apache.ignite.internal.IgnitionEx; import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.internal.*; import org.apache.ignite.internal.util.typedef.internal.*;
[ "org.apache.ignite" ]
org.apache.ignite;
867,625
public void verifyGatewayEqualsBlankWithServiceWithTgt() throws IOException { final String service = "http://www.yale.edu"; final String encodedService = URLEncoder.encode(service, "UTF-8"); final String establishSsoUrl = "/login?service=" + encodedService; beginAt(establishSsoUrl); setFormElement(FORM_USERNAME, getUsername()); setFormElement(FORM_PASSWORD, getGoodPassword()); submit(); final String gatewayUrl = "/login?service=" + encodedService + "&gateway="; beginAt(gatewayUrl); // extract the service ticket final String st = LoginHelper.serviceTicketFromResponse(getDialog().getResponse()); // be sure it's valid assertNotNull(st); beginAt("/validate?ticket=" + st + "&service=" + encodedService); final HttpUnitDialog htDialog = getDialog(); final String validateOutput = htDialog.getResponseText(); final String expected = "yes\n" + getUsername() + "\n"; assertEquals(expected, validateOutput); }
void function() throws IOException { final String service = STRUTF-8STR/login?service=STR/login?service=STR&gateway=STR/validate?ticket=STR&service=STRyes\nSTR\n"; assertEquals(expected, validateOutput); }
/** * Test that /login?gateway=&service=whatever is the same as /login?gateway=true&service=whatever. * @throws IOException */
Test that /login?gateway=&service=whatever is the same as /login?gateway=true&service=whatever
verifyGatewayEqualsBlankWithServiceWithTgt
{ "repo_name": "keshvari/cas", "path": "cas-server-compatibility/src/test/java/org/jasig/cas/login/LoginAsCredentialsRequestorCompatibilityTests.java", "license": "apache-2.0", "size": 10053 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
628,109
public static void updateDrinkCategory(DrinkLibrary library, long id, DrinkCategory category, GUIActivity parent) { LogUtil.INSTANCE.i(TAG, "Editing category: %s (%d)", category, id); library.updateCategory(id, category); if (parent != null) { parent.updateUI(); } }
static void function(DrinkLibrary library, long id, DrinkCategory category, GUIActivity parent) { LogUtil.INSTANCE.i(TAG, STR, category, id); library.updateCategory(id, category); if (parent != null) { parent.updateUI(); } }
/** * Modifies an existing drink category. */
Modifies an existing drink category
updateDrinkCategory
{ "repo_name": "thaapasa/jalkametri-android", "path": "app/src/main/java/fi/tuska/jalkametri/data/DrinkActions.java", "license": "mit", "size": 9831 }
[ "fi.tuska.jalkametri.activity.GUIActivity", "fi.tuska.jalkametri.dao.DrinkCategory", "fi.tuska.jalkametri.dao.DrinkLibrary", "fi.tuska.jalkametri.util.LogUtil" ]
import fi.tuska.jalkametri.activity.GUIActivity; import fi.tuska.jalkametri.dao.DrinkCategory; import fi.tuska.jalkametri.dao.DrinkLibrary; import fi.tuska.jalkametri.util.LogUtil;
import fi.tuska.jalkametri.activity.*; import fi.tuska.jalkametri.dao.*; import fi.tuska.jalkametri.util.*;
[ "fi.tuska.jalkametri" ]
fi.tuska.jalkametri;
1,084,218
private String getString(String old, String column) { int index = mCursor.getColumnIndexOrThrow(column); if (old == null) { return mCursor.getString(index); } if (mNewChars == null) { mNewChars = new CharArrayBuffer(128); } mCursor.copyStringToBuffer(index, mNewChars); int length = mNewChars.sizeCopied; if (length != old.length()) { return new String(mNewChars.data, 0, length); } if (mOldChars == null || mOldChars.sizeCopied < length) { mOldChars = new CharArrayBuffer(length); } char[] oldArray = mOldChars.data; char[] newArray = mNewChars.data; old.getChars(0, length, oldArray, 0); for (int i = length - 1; i >= 0; --i) { if (oldArray[i] != newArray[i]) { return new String(newArray, 0, length); } } return old; }
String function(String old, String column) { int index = mCursor.getColumnIndexOrThrow(column); if (old == null) { return mCursor.getString(index); } if (mNewChars == null) { mNewChars = new CharArrayBuffer(128); } mCursor.copyStringToBuffer(index, mNewChars); int length = mNewChars.sizeCopied; if (length != old.length()) { return new String(mNewChars.data, 0, length); } if (mOldChars == null mOldChars.sizeCopied < length) { mOldChars = new CharArrayBuffer(length); } char[] oldArray = mOldChars.data; char[] newArray = mNewChars.data; old.getChars(0, length, oldArray, 0); for (int i = length - 1; i >= 0; --i) { if (oldArray[i] != newArray[i]) { return new String(newArray, 0, length); } } return old; }
/** * Returns a String that holds the current value of the column, * optimizing for the case where the value hasn't changed. */
Returns a String that holds the current value of the column, optimizing for the case where the value hasn't changed
getString
{ "repo_name": "79144876/WordReviewProject", "path": "src/com/coleman/providers/downloads/DownloadInfo.java", "license": "apache-2.0", "size": 21953 }
[ "android.database.CharArrayBuffer" ]
import android.database.CharArrayBuffer;
import android.database.*;
[ "android.database" ]
android.database;
68,219
EList<Unit> getUnits();
EList<Unit> getUnits();
/** * Returns the value of the '<em><b>Units</b></em>' containment reference list. * The list contents are of type {@link org.eclipse.xtext.testlanguages.backtracking.beeLangTestLanguage.Unit}. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Units</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>Units</em>' containment reference list. * @see org.eclipse.xtext.testlanguages.backtracking.beeLangTestLanguage.BeeLangTestLanguagePackage#getModel_Units() * @model containment="true" * @generated */
Returns the value of the 'Units' containment reference list. The list contents are of type <code>org.eclipse.xtext.testlanguages.backtracking.beeLangTestLanguage.Unit</code>. If the meaning of the 'Units' containment reference list isn't clear, there really should be more of a description here...
getUnits
{ "repo_name": "miklossy/xtext-core", "path": "org.eclipse.xtext.testlanguages/src-gen/org/eclipse/xtext/testlanguages/backtracking/beeLangTestLanguage/Model.java", "license": "epl-1.0", "size": 2234 }
[ "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;
773,511
EReference getActivity_Inputs();
EReference getActivity_Inputs();
/** * Returns the meta object for the containment reference list '{@link activitydiagram.Activity#getInputs <em>Inputs</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the containment reference list '<em>Inputs</em>'. * @see activitydiagram.Activity#getInputs() * @see #getActivity() * @generated */
Returns the meta object for the containment reference list '<code>activitydiagram.Activity#getInputs Inputs</code>'.
getActivity_Inputs
{ "repo_name": "gemoc/activitydiagram", "path": "dev/gemoc_sequential/language_workbench/org.gemoc.activitydiagram.sequential.model/src/activitydiagram/ActivitydiagramPackage.java", "license": "epl-1.0", "size": 91129 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,770,878
public CurrentStateBuilder sessionId(SessionId sessionId) { _sessionId = sessionId; return this; }
CurrentStateBuilder function(SessionId sessionId) { _sessionId = sessionId; return this; }
/** * Set the session id for this current state * @param sessionId session identifier * @return CurrentStateBuilder */
Set the session id for this current state
sessionId
{ "repo_name": "Teino1978-Corp/Teino1978-Corp-helix", "path": "helix-core/src/main/java/org/apache/helix/model/builder/CurrentStateBuilder.java", "license": "apache-2.0", "size": 4230 }
[ "org.apache.helix.api.id.SessionId" ]
import org.apache.helix.api.id.SessionId;
import org.apache.helix.api.id.*;
[ "org.apache.helix" ]
org.apache.helix;
2,000,567
EReference getCopier_Objects();
EReference getCopier_Objects();
/** * Returns the meta object for the containment reference list '{@link org.eclectic.frontend.qool.facilities.Copier#getObjects <em>Objects</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the containment reference list '<em>Objects</em>'. * @see org.eclectic.frontend.qool.facilities.Copier#getObjects() * @see #getCopier() * @generated */
Returns the meta object for the containment reference list '<code>org.eclectic.frontend.qool.facilities.Copier#getObjects Objects</code>'.
getCopier_Objects
{ "repo_name": "jesusc/eclectic", "path": "plugins/org.eclectic.frontend.asm/src-gen/org/eclectic/frontend/qool/facilities/FacilitiesPackage.java", "license": "gpl-3.0", "size": 11222 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,263,793
public boolean validateSignature(final Assertion assertion, final WsFederationConfiguration wsFederationConfiguration) { if (assertion == null) { LOGGER.warn("No assertion was provided to validate signatures"); return false; } boolean valid = false; if (assertion.getSignature() != null) { final SignaturePrevalidator validator = new SAMLSignatureProfileValidator(); try { validator.validate(assertion.getSignature()); final CriteriaSet criteriaSet = new CriteriaSet(); criteriaSet.add(new UsageCriterion(UsageType.SIGNING)); criteriaSet.add(new EntityRoleCriterion(IDPSSODescriptor.DEFAULT_ELEMENT_NAME)); criteriaSet.add(new ProtocolCriterion(SAMLConstants.SAML20P_NS)); criteriaSet.add(new EntityIdCriterion(wsFederationConfiguration.getIdentityProviderIdentifier())); try { final SignatureTrustEngine engine = buildSignatureTrustEngine(wsFederationConfiguration); valid = engine.validate(assertion.getSignature(), criteriaSet); } catch (final SecurityException e) { LOGGER.warn(e.getMessage(), e); } finally { if (!valid) { LOGGER.warn("Signature doesn't match any signing credential."); } } } catch (final SignatureException e) { LOGGER.warn("Failed to validate assertion signature", e); } } SamlUtils.logSamlObject(this.configBean, assertion); return valid; }
boolean function(final Assertion assertion, final WsFederationConfiguration wsFederationConfiguration) { if (assertion == null) { LOGGER.warn(STR); return false; } boolean valid = false; if (assertion.getSignature() != null) { final SignaturePrevalidator validator = new SAMLSignatureProfileValidator(); try { validator.validate(assertion.getSignature()); final CriteriaSet criteriaSet = new CriteriaSet(); criteriaSet.add(new UsageCriterion(UsageType.SIGNING)); criteriaSet.add(new EntityRoleCriterion(IDPSSODescriptor.DEFAULT_ELEMENT_NAME)); criteriaSet.add(new ProtocolCriterion(SAMLConstants.SAML20P_NS)); criteriaSet.add(new EntityIdCriterion(wsFederationConfiguration.getIdentityProviderIdentifier())); try { final SignatureTrustEngine engine = buildSignatureTrustEngine(wsFederationConfiguration); valid = engine.validate(assertion.getSignature(), criteriaSet); } catch (final SecurityException e) { LOGGER.warn(e.getMessage(), e); } finally { if (!valid) { LOGGER.warn(STR); } } } catch (final SignatureException e) { LOGGER.warn(STR, e); } } SamlUtils.logSamlObject(this.configBean, assertion); return valid; }
/** * validateSignature checks to see if the signature on an assertion is valid. * * @param assertion a provided assertion * @param wsFederationConfiguration WS-Fed configuration provided. * @return true if the assertion's signature is valid, otherwise false */
validateSignature checks to see if the signature on an assertion is valid
validateSignature
{ "repo_name": "creamer/cas", "path": "support/cas-server-support-wsfederation/src/main/java/org/apereo/cas/support/wsfederation/WsFederationHelper.java", "license": "apache-2.0", "size": 16550 }
[ "net.shibboleth.utilities.java.support.resolver.CriteriaSet", "org.apereo.cas.support.saml.SamlUtils", "org.opensaml.core.criterion.EntityIdCriterion", "org.opensaml.saml.common.xml.SAMLConstants", "org.opensaml.saml.criterion.EntityRoleCriterion", "org.opensaml.saml.criterion.ProtocolCriterion", "org.opensaml.saml.saml1.core.Assertion", "org.opensaml.saml.saml2.metadata.IDPSSODescriptor", "org.opensaml.saml.security.impl.SAMLSignatureProfileValidator", "org.opensaml.security.SecurityException", "org.opensaml.security.credential.UsageType", "org.opensaml.security.criteria.UsageCriterion", "org.opensaml.xmlsec.signature.support.SignatureException", "org.opensaml.xmlsec.signature.support.SignaturePrevalidator", "org.opensaml.xmlsec.signature.support.SignatureTrustEngine" ]
import net.shibboleth.utilities.java.support.resolver.CriteriaSet; import org.apereo.cas.support.saml.SamlUtils; import org.opensaml.core.criterion.EntityIdCriterion; import org.opensaml.saml.common.xml.SAMLConstants; import org.opensaml.saml.criterion.EntityRoleCriterion; import org.opensaml.saml.criterion.ProtocolCriterion; import org.opensaml.saml.saml1.core.Assertion; import org.opensaml.saml.saml2.metadata.IDPSSODescriptor; import org.opensaml.saml.security.impl.SAMLSignatureProfileValidator; import org.opensaml.security.SecurityException; import org.opensaml.security.credential.UsageType; import org.opensaml.security.criteria.UsageCriterion; import org.opensaml.xmlsec.signature.support.SignatureException; import org.opensaml.xmlsec.signature.support.SignaturePrevalidator; import org.opensaml.xmlsec.signature.support.SignatureTrustEngine;
import net.shibboleth.utilities.java.support.resolver.*; import org.apereo.cas.support.saml.*; import org.opensaml.core.criterion.*; import org.opensaml.saml.common.xml.*; import org.opensaml.saml.criterion.*; import org.opensaml.saml.saml1.core.*; import org.opensaml.saml.saml2.metadata.*; import org.opensaml.saml.security.impl.*; import org.opensaml.security.*; import org.opensaml.security.credential.*; import org.opensaml.security.criteria.*; import org.opensaml.xmlsec.signature.support.*;
[ "net.shibboleth.utilities", "org.apereo.cas", "org.opensaml.core", "org.opensaml.saml", "org.opensaml.security", "org.opensaml.xmlsec" ]
net.shibboleth.utilities; org.apereo.cas; org.opensaml.core; org.opensaml.saml; org.opensaml.security; org.opensaml.xmlsec;
936,830
default Criterion filterWithPeriod(TimePeriod time, AbstractTimePrimitiveFieldDescriptor r, boolean periodFromReducedPrecisionInstant) throws UnsupportedTimeException { return r instanceof TimePrimitiveFieldDescriptor ? createFilterWithPeriod(time, r, periodFromReducedPrecisionInstant) : filterWithPeriod(time, (TimePrimitiveNullableFieldDescriptor) r, periodFromReducedPrecisionInstant); }
default Criterion filterWithPeriod(TimePeriod time, AbstractTimePrimitiveFieldDescriptor r, boolean periodFromReducedPrecisionInstant) throws UnsupportedTimeException { return r instanceof TimePrimitiveFieldDescriptor ? createFilterWithPeriod(time, r, periodFromReducedPrecisionInstant) : filterWithPeriod(time, (TimePrimitiveNullableFieldDescriptor) r, periodFromReducedPrecisionInstant); }
/** * Create a filter for the specified period and fields. If the period is no * real period but a instance, the method will call * {@link #filterWithInstant(TimeInstant, AbstractTimePrimitiveFieldDescriptor)}. * * @param time * the time * @param r * the property name(s) * * @return the {@code Criterion} that describes this restriction * @throws UnsupportedTimeException If the filter is not supported! */
Create a filter for the specified period and fields. If the period is no real period but a instance, the method will call <code>#filterWithInstant(TimeInstant, AbstractTimePrimitiveFieldDescriptor)</code>
filterWithPeriod
{ "repo_name": "EHJ-52n/SOS", "path": "hibernate/utils/src/main/java/org/n52/sos/ds/hibernate/util/TemporalRestriction.java", "license": "gpl-2.0", "size": 23669 }
[ "org.hibernate.criterion.Criterion", "org.n52.shetland.ogc.gml.time.TimePeriod", "org.n52.sos.exception.ows.concrete.UnsupportedTimeException" ]
import org.hibernate.criterion.Criterion; import org.n52.shetland.ogc.gml.time.TimePeriod; import org.n52.sos.exception.ows.concrete.UnsupportedTimeException;
import org.hibernate.criterion.*; import org.n52.shetland.ogc.gml.time.*; import org.n52.sos.exception.ows.concrete.*;
[ "org.hibernate.criterion", "org.n52.shetland", "org.n52.sos" ]
org.hibernate.criterion; org.n52.shetland; org.n52.sos;
756,440
public Collection<OriginEntryGroup> getAllScrubbableBackupGroups();
Collection<OriginEntryGroup> function();
/** * Gets a collection of all backup groups that are scrubbable (i.e. valid, process, scrub indicators all set to true) * * @return a Collection of scrubbable origin entry groups */
Gets a collection of all backup groups that are scrubbable (i.e. valid, process, scrub indicators all set to true)
getAllScrubbableBackupGroups
{ "repo_name": "quikkian-ua-devops/will-financials", "path": "kfs-core/src/main/java/org/kuali/kfs/gl/dataaccess/OriginEntryGroupDao.java", "license": "agpl-3.0", "size": 3854 }
[ "java.util.Collection", "org.kuali.kfs.gl.businessobject.OriginEntryGroup" ]
import java.util.Collection; import org.kuali.kfs.gl.businessobject.OriginEntryGroup;
import java.util.*; import org.kuali.kfs.gl.businessobject.*;
[ "java.util", "org.kuali.kfs" ]
java.util; org.kuali.kfs;
2,125,312
public final MetaProperty<TradeHeader> tradeHeader() { return _tradeHeader; }
final MetaProperty<TradeHeader> function() { return _tradeHeader; }
/** * The meta-property for the {@code tradeHeader} property. * @return the meta-property, not null */
The meta-property for the tradeHeader property
tradeHeader
{ "repo_name": "McLeodMoores/starling", "path": "projects/starling-client/src/main/java/com/mcleodmoores/starling/client/portfolio/fpml5_8/FxSpotTrade.java", "license": "apache-2.0", "size": 24945 }
[ "org.joda.beans.MetaProperty" ]
import org.joda.beans.MetaProperty;
import org.joda.beans.*;
[ "org.joda.beans" ]
org.joda.beans;
1,949,656
public void setPlainProviders(Object... theProv) { setPlainProviders(Arrays.asList(theProv)); }
void function(Object... theProv) { setPlainProviders(Arrays.asList(theProv)); }
/** * Sets the non-resource specific providers which implement method calls on this server. * * @see #setResourceProviders(Collection) */
Sets the non-resource specific providers which implement method calls on this server
setPlainProviders
{ "repo_name": "steve1medix/hapi-fhir", "path": "hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java", "license": "apache-2.0", "size": 52651 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
1,448,082
@Path( "getPomSnippet/{repositoryId}" ) @GET @Produces( { MediaType.TEXT_PLAIN } ) @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION ) String getPomSnippet( @PathParam( "repositoryId" ) String repositoryId ) throws ArchivaRestServiceException;
@Path( STR ) @Produces( { MediaType.TEXT_PLAIN } ) @RedbackAuthorization( permissions = ArchivaRoleConstants.OPERATION_MANAGE_CONFIGURATION ) String getPomSnippet( @PathParam( STR ) String repositoryId ) throws ArchivaRestServiceException;
/** * return a pom snippet to use this repository with entities escaped (&lt; &gt;) * @since 1.4-M3 */
return a pom snippet to use this repository with entities escaped (&lt; &gt;)
getPomSnippet
{ "repo_name": "olamy/archiva", "path": "archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/services/ManagedRepositoriesService.java", "license": "apache-2.0", "size": 4897 }
[ "javax.ws.rs.Path", "javax.ws.rs.PathParam", "javax.ws.rs.Produces", "javax.ws.rs.core.MediaType", "org.apache.archiva.redback.authorization.RedbackAuthorization", "org.apache.archiva.security.common.ArchivaRoleConstants" ]
import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import org.apache.archiva.redback.authorization.RedbackAuthorization; import org.apache.archiva.security.common.ArchivaRoleConstants;
import javax.ws.rs.*; import javax.ws.rs.core.*; import org.apache.archiva.redback.authorization.*; import org.apache.archiva.security.common.*;
[ "javax.ws", "org.apache.archiva" ]
javax.ws; org.apache.archiva;
2,563,854
public Optional<Closeable> startListeningPeers() { final Collection<Peer> configPeers = getConfigPeersWithGchangeApi(); if (CollectionUtils.isEmpty(configPeers)) { if (logger.isWarnEnabled()) { logger.warn(String.format("No compatible endpoints found in config option '%s'. Cannot listening peers from network", "duniter.p2p.includes.endpoints")); } return Optional.empty(); } // Update peers, using endpoints found in config ScheduledActionFuture<?> future = threadPool.scheduleAtFixedRate(() -> { // Index config peers configPeers.forEach(peerService::indexPeers); }, pluginSettings.getScanPeerInterval(), pluginSettings.getScanPeerInterval(), TimeUnit.SECONDS); // Tear down logic return Optional.of(() -> future.cancel(true)); }
Optional<Closeable> function() { final Collection<Peer> configPeers = getConfigPeersWithGchangeApi(); if (CollectionUtils.isEmpty(configPeers)) { if (logger.isWarnEnabled()) { logger.warn(String.format(STR, STR)); } return Optional.empty(); } ScheduledActionFuture<?> future = threadPool.scheduleAtFixedRate(() -> { configPeers.forEach(peerService::indexPeers); }, pluginSettings.getScanPeerInterval(), pluginSettings.getScanPeerInterval(), TimeUnit.SECONDS); return Optional.of(() -> future.cancel(true)); }
/** * Watch network peers, from endpoints found in config * @return a tear down logic, to call to stop the listener */
Watch network peers, from endpoints found in config
startListeningPeers
{ "repo_name": "duniter-gchange/gchange-pod", "path": "gchange-pod-es-plugin/src/main/java/org/duniter/elasticsearch/gchange/service/NetworkService.java", "license": "agpl-3.0", "size": 3765 }
[ "java.io.Closeable", "java.util.Collection", "java.util.Optional", "java.util.concurrent.TimeUnit", "org.apache.commons.collections4.CollectionUtils", "org.duniter.core.client.model.local.Peer", "org.duniter.elasticsearch.threadpool.ScheduledActionFuture" ]
import java.io.Closeable; import java.util.Collection; import java.util.Optional; import java.util.concurrent.TimeUnit; import org.apache.commons.collections4.CollectionUtils; import org.duniter.core.client.model.local.Peer; import org.duniter.elasticsearch.threadpool.ScheduledActionFuture;
import java.io.*; import java.util.*; import java.util.concurrent.*; import org.apache.commons.collections4.*; import org.duniter.core.client.model.local.*; import org.duniter.elasticsearch.threadpool.*;
[ "java.io", "java.util", "org.apache.commons", "org.duniter.core", "org.duniter.elasticsearch" ]
java.io; java.util; org.apache.commons; org.duniter.core; org.duniter.elasticsearch;
1,483,668
@Generated @CVariable() public static native CFStringRef kCVImageBufferChromaLocation_Bottom();
@CVariable() static native CFStringRef function();
/** * Chroma sample is horizontally centered, but co-sited with the bottom row of luma samples. */
Chroma sample is horizontally centered, but co-sited with the bottom row of luma samples
kCVImageBufferChromaLocation_Bottom
{ "repo_name": "multi-os-engine/moe-core", "path": "moe.apple/moe.platform.ios/src/main/java/apple/corevideo/c/CoreVideo.java", "license": "apache-2.0", "size": 85217 }
[ "org.moe.natj.c.ann.CVariable" ]
import org.moe.natj.c.ann.CVariable;
import org.moe.natj.c.ann.*;
[ "org.moe.natj" ]
org.moe.natj;
812,183
public int getNumberOfErrorStatementsInLog(String[] excludeExpList) throws IOException { DaemonProtocol proxy = getProxy(); String pattern = "ERROR"; return proxy.getNumberOfMatchesInLogFile(pattern, excludeExpList); }
int function(String[] excludeExpList) throws IOException { DaemonProtocol proxy = getProxy(); String pattern = "ERROR"; return proxy.getNumberOfMatchesInLogFile(pattern, excludeExpList); }
/** * Gets number of times ERROR log messages where logged in Daemon logs. * <br/> * Pattern used for searching is ERROR. <br/> * @param excludeExpList list of exception to exclude * @return number of occurrence of error message. * @throws IOException is thrown on RPC error. */
Gets number of times ERROR log messages where logged in Daemon logs. Pattern used for searching is ERROR.
getNumberOfErrorStatementsInLog
{ "repo_name": "Shmuma/hadoop", "path": "src/test/system/java/org/apache/hadoop/test/system/AbstractDaemonClient.java", "license": "apache-2.0", "size": 13265 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,639,938
public static Cursor getAlarmsCursor(ContentResolver contentResolver) { return contentResolver.query( Alarm.Columns.CONTENT_URI, Alarm.Columns.ALARM_QUERY_COLUMNS, null, null, Alarm.Columns.DEFAULT_SORT_ORDER); }
static Cursor function(ContentResolver contentResolver) { return contentResolver.query( Alarm.Columns.CONTENT_URI, Alarm.Columns.ALARM_QUERY_COLUMNS, null, null, Alarm.Columns.DEFAULT_SORT_ORDER); }
/** * Queries all alarms * @return cursor over all alarms */
Queries all alarms
getAlarmsCursor
{ "repo_name": "rex-xxx/mt6572_x201", "path": "mediatek/frameworks-ext/base/policy/java/com/android/internal/policy/impl/keyguard/Alarms.java", "license": "gpl-2.0", "size": 25201 }
[ "android.content.ContentResolver", "android.database.Cursor" ]
import android.content.ContentResolver; import android.database.Cursor;
import android.content.*; import android.database.*;
[ "android.content", "android.database" ]
android.content; android.database;
407,512
public void createProfile ( String proFileName , byte[] password) throws ProtocolNotSupportedException,ProfileKeyValueLimitException;
void function ( String proFileName , byte[] password) throws ProtocolNotSupportedException,ProfileKeyValueLimitException;
/** * Create profile. * * @param proFileName the pro file name * @param password the password * @throws ProtocolNotSupportedException the protocol not supported exception * @throws ProfileKeyValueLimitException the profile key value limit exception */
Create profile
createProfile
{ "repo_name": "NeoSmartpen/AndroidSDK2.0", "path": "NASDK2.0_Studio/app/src/main/java/kr/neolab/sdk/pen/IPenAdt.java", "license": "gpl-3.0", "size": 22799 }
[ "kr.neolab.sdk.pen.bluetooth.lib.ProfileKeyValueLimitException", "kr.neolab.sdk.pen.bluetooth.lib.ProtocolNotSupportedException" ]
import kr.neolab.sdk.pen.bluetooth.lib.ProfileKeyValueLimitException; import kr.neolab.sdk.pen.bluetooth.lib.ProtocolNotSupportedException;
import kr.neolab.sdk.pen.bluetooth.lib.*;
[ "kr.neolab.sdk" ]
kr.neolab.sdk;
2,681,630
public Analyzer getAnalyzer() { return analyzer; }
Analyzer function() { return analyzer; }
/** * Returns an analyzer that will be used to parse source doc with. The default analyzer * is the {@link #DEFAULT_ANALYZER}. * * @return the analyzer that will be used to parse source doc with. * @see #DEFAULT_ANALYZER */
Returns an analyzer that will be used to parse source doc with. The default analyzer is the <code>#DEFAULT_ANALYZER</code>
getAnalyzer
{ "repo_name": "apache/jackrabbit", "path": "jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/MoreLikeThis.java", "license": "apache-2.0", "size": 30464 }
[ "org.apache.lucene.analysis.Analyzer" ]
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.*;
[ "org.apache.lucene" ]
org.apache.lucene;
278,780
protected static EventVO createDemoExam() { ExamVO exameDemo = getExame(); List<PessoaVO> pessoasSelecionadas = getPessoas(); EventVO eventVO = new EventVO(); Long ppk=1l; for (PessoaVO pessoaVO : pessoasSelecionadas) { ParticipationVO participationVO = new ParticipationVO(); participationVO.setPK(ppk++); participationVO.setPessoaVO(pessoaVO); participationVO.setExamVO(exameDemo); eventVO.getParticipations().put(participationVO.getPK(), participationVO); } eventVO.setDescription("Prova Bimestral"); return eventVO; }
static EventVO function() { ExamVO exameDemo = getExame(); List<PessoaVO> pessoasSelecionadas = getPessoas(); EventVO eventVO = new EventVO(); Long ppk=1l; for (PessoaVO pessoaVO : pessoasSelecionadas) { ParticipationVO participationVO = new ParticipationVO(); participationVO.setPK(ppk++); participationVO.setPessoaVO(pessoaVO); participationVO.setExamVO(exameDemo); eventVO.getParticipations().put(participationVO.getPK(), participationVO); } eventVO.setDescription(STR); return eventVO; }
/** * Cria demo de exame * @param pessoaVO * @param empresaVO * @return * @throws JazzBusinessException */
Cria demo de exame
createDemoExam
{ "repo_name": "darciopacifico/omr", "path": "modulesOMR/trunk/JazzOMRParser/parser/src/main/java/br/com/dlp/jazzomr/jasper/JazzOMRJRDataSourceProviderForDesign.java", "license": "apache-2.0", "size": 7954 }
[ "br.com.dlp.jazzomr.event.EventVO", "br.com.dlp.jazzomr.event.ParticipationVO", "br.com.dlp.jazzomr.exam.ExamVO", "br.com.dlp.jazzomr.person.PessoaVO", "java.util.List" ]
import br.com.dlp.jazzomr.event.EventVO; import br.com.dlp.jazzomr.event.ParticipationVO; import br.com.dlp.jazzomr.exam.ExamVO; import br.com.dlp.jazzomr.person.PessoaVO; import java.util.List;
import br.com.dlp.jazzomr.event.*; import br.com.dlp.jazzomr.exam.*; import br.com.dlp.jazzomr.person.*; import java.util.*;
[ "br.com.dlp", "java.util" ]
br.com.dlp; java.util;
1,108,910
public void addCertificates( Store certStore) { certs.addAll(certStore.getMatches(null)); }
void function( Store certStore) { certs.addAll(certStore.getMatches(null)); }
/** * Add the store of X509 Certificates to the generator. * * @param certStore a Store containing X509CertificateHolder objects */
Add the store of X509 Certificates to the generator
addCertificates
{ "repo_name": "thedrummeraki/Aki-SSL", "path": "src/org/bouncycastle/tsp/TimeStampTokenGenerator.java", "license": "apache-2.0", "size": 14746 }
[ "org.bouncycastle.util.Store" ]
import org.bouncycastle.util.Store;
import org.bouncycastle.util.*;
[ "org.bouncycastle.util" ]
org.bouncycastle.util;
1,605,630
public AxisLocation getDomainAxisLocation(int index) { AxisLocation result = this.domainAxisLocations.get(index); if (result == null) { result = AxisLocation.getOpposite(getDomainAxisLocation(0)); } return result; } /** * Sets the location of the domain axis and sends a {@link PlotChangeEvent}
AxisLocation function(int index) { AxisLocation result = this.domainAxisLocations.get(index); if (result == null) { result = AxisLocation.getOpposite(getDomainAxisLocation(0)); } return result; } /** * Sets the location of the domain axis and sends a {@link PlotChangeEvent}
/** * Returns the location for a domain axis. * * @param index the axis index. * * @return The location. * * @see #setDomainAxisLocation(int, AxisLocation) */
Returns the location for a domain axis
getDomainAxisLocation
{ "repo_name": "oskopek/jfreechart-fse", "path": "src/main/java/org/jfree/chart/plot/CategoryPlot.java", "license": "lgpl-2.1", "size": 170549 }
[ "org.jfree.chart.axis.AxisLocation", "org.jfree.chart.event.PlotChangeEvent" ]
import org.jfree.chart.axis.AxisLocation; import org.jfree.chart.event.PlotChangeEvent;
import org.jfree.chart.axis.*; import org.jfree.chart.event.*;
[ "org.jfree.chart" ]
org.jfree.chart;
2,686,790
public E getFirst(){ if(this.sval==null || this.sval.size()==0){ return null; } if(this.sval instanceof List){ return ((List<E>)this.sval).get(0); } if(this.sval instanceof Set){ for(E elem : (Set<E>)this.sval){ return elem; } } return null; }
E function(){ if(this.sval==null this.sval.size()==0){ return null; } if(this.sval instanceof List){ return ((List<E>)this.sval).get(0); } if(this.sval instanceof Set){ for(E elem : (Set<E>)this.sval){ return elem; } } return null; }
/** * Returns the first value of the collection. * @return first value if there is one, null otherwise */
Returns the first value of the collection
getFirst
{ "repo_name": "vdmeer/skb-java-commons", "path": "src/main/java/de/vandermeer/skb/commons/collections/ComCollection.java", "license": "apache-2.0", "size": 6543 }
[ "java.util.List", "java.util.Set" ]
import java.util.List; import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
996,622
public Executable getActiveScriptOrModule() { if (executable != DefaultExecutable.INSTANCE) { return executable; } ExecutionContext scriptContext = getRealm().getWorld().getScriptContext(); if (scriptContext != null && scriptContext.executable != DefaultExecutable.INSTANCE) { return scriptContext.executable; } return null; }
Executable function() { if (executable != DefaultExecutable.INSTANCE) { return executable; } ExecutionContext scriptContext = getRealm().getWorld().getScriptContext(); if (scriptContext != null && scriptContext.executable != DefaultExecutable.INSTANCE) { return scriptContext.executable; } return null; }
/** * 8.3.1 GetActiveScriptOrModule ( ) * * @return the active executable or {@code null} if none found */
8.3.1 GetActiveScriptOrModule ( )
getActiveScriptOrModule
{ "repo_name": "anba/es6draft", "path": "src/main/java/com/github/anba/es6draft/runtime/ExecutionContext.java", "license": "mit", "size": 17730 }
[ "com.github.anba.es6draft.Executable" ]
import com.github.anba.es6draft.Executable;
import com.github.anba.es6draft.*;
[ "com.github.anba" ]
com.github.anba;
366,546
public SpoutDeclarer setSpout(String id, SerializableSupplier<?> supplier) throws IllegalArgumentException { return setSpout(id, supplier, null); }
SpoutDeclarer function(String id, SerializableSupplier<?> supplier) throws IllegalArgumentException { return setSpout(id, supplier, null); }
/** * Define a new spout in this topology. * * @param id the id of this component. This id is referenced by other components that want to consume this spout's outputs. * @param supplier lambda expression that implements tuple generating for this spout * @throws IllegalArgumentException if {@code parallelism_hint} is not positive */
Define a new spout in this topology
setSpout
{ "repo_name": "0x726d77/storm", "path": "storm-client/src/jvm/org/apache/storm/topology/TopologyBuilder.java", "license": "apache-2.0", "size": 36445 }
[ "org.apache.storm.lambda.SerializableSupplier" ]
import org.apache.storm.lambda.SerializableSupplier;
import org.apache.storm.lambda.*;
[ "org.apache.storm" ]
org.apache.storm;
695,290
public void onActivityResult(int requestCode, int resultCode, Intent data) { _facebook.authorizeCallback(requestCode, resultCode, data); }
void function(int requestCode, int resultCode, Intent data) { _facebook.authorizeCallback(requestCode, resultCode, data); }
/** * Authorization for facebook */
Authorization for facebook
onActivityResult
{ "repo_name": "Pillowdrift/MegaDrillerMole", "path": "MegaDrillerMole/MDMWorkspace/DrillerGameAndroid/src/com/pillowdrift/drillergame/crossinterfaces/android/AndroidMDMFacebookAccessServiceApi.java", "license": "bsd-2-clause", "size": 4924 }
[ "android.content.Intent" ]
import android.content.Intent;
import android.content.*;
[ "android.content" ]
android.content;
380,445
default CompletableFuture<Boolean> isEmpty() { return size().thenApply(s -> s == 0); }
default CompletableFuture<Boolean> isEmpty() { return size().thenApply(s -> s == 0); }
/** * Returns true if the map is empty. * * @return a future whose value will be true if map has no entries, false otherwise. */
Returns true if the map is empty
isEmpty
{ "repo_name": "LorenzReinhart/ONOSnew", "path": "core/api/src/main/java/org/onosproject/store/service/AsyncConsistentMap.java", "license": "apache-2.0", "size": 15961 }
[ "java.util.concurrent.CompletableFuture" ]
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
211,588
protected Pair<List<RecordInfo>, List<PreparedTransactionInfo>> loadMessageJournal(Configuration config) throws Exception { JournalImpl messagesJournal = null; try { SequentialFileFactory messagesFF = new NIOSequentialFileFactory(new File(getJournalDir()), null, 1); messagesJournal = new JournalImpl(config.getJournalFileSize(), config.getJournalMinFiles(), config.getJournalPoolFiles(), 0, 0, messagesFF, "activemq-data", "amq", 1); final List<RecordInfo> committedRecords = new LinkedList<>(); final List<PreparedTransactionInfo> preparedTransactions = new LinkedList<>(); messagesJournal.start(); messagesJournal.load(committedRecords, preparedTransactions, null, false); return new Pair<>(committedRecords, preparedTransactions); } finally { try { if (messagesJournal != null) { messagesJournal.stop(); } } catch (Throwable ignored) { } } }
Pair<List<RecordInfo>, List<PreparedTransactionInfo>> function(Configuration config) throws Exception { JournalImpl messagesJournal = null; try { SequentialFileFactory messagesFF = new NIOSequentialFileFactory(new File(getJournalDir()), null, 1); messagesJournal = new JournalImpl(config.getJournalFileSize(), config.getJournalMinFiles(), config.getJournalPoolFiles(), 0, 0, messagesFF, STR, "amq", 1); final List<RecordInfo> committedRecords = new LinkedList<>(); final List<PreparedTransactionInfo> preparedTransactions = new LinkedList<>(); messagesJournal.start(); messagesJournal.load(committedRecords, preparedTransactions, null, false); return new Pair<>(committedRecords, preparedTransactions); } finally { try { if (messagesJournal != null) { messagesJournal.stop(); } } catch (Throwable ignored) { } } }
/** * Reads a journal system and returns a Map<Integer,AtomicInteger> of recordTypes and the number of records per type, * independent of being deleted or not * * @param config * @return * @throws Exception */
Reads a journal system and returns a Map of recordTypes and the number of records per type, independent of being deleted or not
loadMessageJournal
{ "repo_name": "tabish121/activemq-artemis", "path": "artemis-server/src/test/java/org/apache/activemq/artemis/tests/util/ActiveMQTestBase.java", "license": "apache-2.0", "size": 98832 }
[ "java.io.File", "java.util.LinkedList", "java.util.List", "org.apache.activemq.artemis.api.core.Pair", "org.apache.activemq.artemis.core.config.Configuration", "org.apache.activemq.artemis.core.io.SequentialFileFactory", "org.apache.activemq.artemis.core.io.nio.NIOSequentialFileFactory", "org.apache.activemq.artemis.core.journal.PreparedTransactionInfo", "org.apache.activemq.artemis.core.journal.RecordInfo", "org.apache.activemq.artemis.core.journal.impl.JournalImpl" ]
import java.io.File; import java.util.LinkedList; import java.util.List; import org.apache.activemq.artemis.api.core.Pair; import org.apache.activemq.artemis.core.config.Configuration; import org.apache.activemq.artemis.core.io.SequentialFileFactory; import org.apache.activemq.artemis.core.io.nio.NIOSequentialFileFactory; import org.apache.activemq.artemis.core.journal.PreparedTransactionInfo; import org.apache.activemq.artemis.core.journal.RecordInfo; import org.apache.activemq.artemis.core.journal.impl.JournalImpl;
import java.io.*; import java.util.*; import org.apache.activemq.artemis.api.core.*; import org.apache.activemq.artemis.core.config.*; import org.apache.activemq.artemis.core.io.*; import org.apache.activemq.artemis.core.io.nio.*; import org.apache.activemq.artemis.core.journal.*; import org.apache.activemq.artemis.core.journal.impl.*;
[ "java.io", "java.util", "org.apache.activemq" ]
java.io; java.util; org.apache.activemq;
579,721
private IRegion caseReplace(String replacer, int index, boolean all) throws BadLocationException { IRegion result = null; IDocumentUndoManager undoer = DocumentUndoManagerRegistry.getDocumentUndoManager(getDocument()); try { if (!isReplaceAll() && undoer != null) { undoer.beginCompoundChange(); } IFindReplaceTarget target = getTarget(); // first replace with (possible regexp) string ((IFindReplaceTargetExtension3)target).replaceSelection(replacer, isRegexp()); // adjust case of actual replacement string replacer = target.getSelectionText(); String caseReplacer = replacer; if (all) { caseReplacer = caseReplacer.toUpperCase(); } else { caseReplacer = caseReplacer.trim(); caseReplacer = Character.toUpperCase(caseReplacer.charAt(0)) + caseReplacer.substring(1,caseReplacer.length()).toString(); // now update the replacement string with the re-cased part caseReplacer = replacer.replaceFirst(replacer.trim(), caseReplacer); } int ind = target.findAndSelect(index, replacer, true, false, false); if (ind > -1) { target.replaceSelection(caseReplacer); } } finally { if (!isReplaceAll() && undoer != null) { undoer.endCompoundChange(); } } return result; }
IRegion function(String replacer, int index, boolean all) throws BadLocationException { IRegion result = null; IDocumentUndoManager undoer = DocumentUndoManagerRegistry.getDocumentUndoManager(getDocument()); try { if (!isReplaceAll() && undoer != null) { undoer.beginCompoundChange(); } IFindReplaceTarget target = getTarget(); ((IFindReplaceTargetExtension3)target).replaceSelection(replacer, isRegexp()); replacer = target.getSelectionText(); String caseReplacer = replacer; if (all) { caseReplacer = caseReplacer.toUpperCase(); } else { caseReplacer = caseReplacer.trim(); caseReplacer = Character.toUpperCase(caseReplacer.charAt(0)) + caseReplacer.substring(1,caseReplacer.length()).toString(); caseReplacer = replacer.replaceFirst(replacer.trim(), caseReplacer); } int ind = target.findAndSelect(index, replacer, true, false, false); if (ind > -1) { target.replaceSelection(caseReplacer); } } finally { if (!isReplaceAll() && undoer != null) { undoer.endCompoundChange(); } } return result; }
/** * Case-based replacement - after the initial find has already happened * * @param replacer - the replacement string (may be regexp) * @param index - offset of find * @param all - all if true, else initial * @return - the replacement region * * @throws BadLocationException */
Case-based replacement - after the initial find has already happened
caseReplace
{ "repo_name": "MulgaSoft/e4macs", "path": "Emacs+/src/com/mulgasoft/emacsplus/minibuffer/SearchReplaceMinibuffer.java", "license": "epl-1.0", "size": 23274 }
[ "org.eclipse.jface.text.BadLocationException", "org.eclipse.jface.text.IFindReplaceTarget", "org.eclipse.jface.text.IFindReplaceTargetExtension3", "org.eclipse.jface.text.IRegion", "org.eclipse.text.undo.DocumentUndoManagerRegistry", "org.eclipse.text.undo.IDocumentUndoManager" ]
import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.IFindReplaceTarget; import org.eclipse.jface.text.IFindReplaceTargetExtension3; import org.eclipse.jface.text.IRegion; import org.eclipse.text.undo.DocumentUndoManagerRegistry; import org.eclipse.text.undo.IDocumentUndoManager;
import org.eclipse.jface.text.*; import org.eclipse.text.undo.*;
[ "org.eclipse.jface", "org.eclipse.text" ]
org.eclipse.jface; org.eclipse.text;
331,269
public void unregister(SelectableChannel channel) { unregisterInternal(channel); }
void function(SelectableChannel channel) { unregisterInternal(channel); }
/** * Unregister a Channel for polling on the specified events. * * @param socket the Channel to be unregistered */
Unregister a Channel for polling on the specified events
unregister
{ "repo_name": "Shopify/jzmq", "path": "src/org/zeromq/ZMQ.java", "license": "gpl-3.0", "size": 63328 }
[ "java.nio.channels.SelectableChannel" ]
import java.nio.channels.SelectableChannel;
import java.nio.channels.*;
[ "java.nio" ]
java.nio;
2,207,742
private void validateOrderItem(SqlSelect select, SqlNode orderItem) { switch (orderItem.getKind()) { case DESCENDING: validateFeature( RESOURCE.sQLConformance_OrderByDesc(), orderItem.getParserPosition()); validateOrderItem(select, ((SqlCall) orderItem).operand(0)); return; } final SqlValidatorScope orderScope = getOrderScope(select); validateExpr(orderItem, orderScope); }
void function(SqlSelect select, SqlNode orderItem) { switch (orderItem.getKind()) { case DESCENDING: validateFeature( RESOURCE.sQLConformance_OrderByDesc(), orderItem.getParserPosition()); validateOrderItem(select, ((SqlCall) orderItem).operand(0)); return; } final SqlValidatorScope orderScope = getOrderScope(select); validateExpr(orderItem, orderScope); }
/** * Validates an item in the ORDER BY clause of a SELECT statement. * * @param select Select statement * @param orderItem ORDER BY clause item */
Validates an item in the ORDER BY clause of a SELECT statement
validateOrderItem
{ "repo_name": "clarkyzl/flink", "path": "flink-table/flink-table-planner/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java", "license": "apache-2.0", "size": 272849 }
[ "org.apache.calcite.sql.SqlCall", "org.apache.calcite.sql.SqlNode", "org.apache.calcite.sql.SqlSelect" ]
import org.apache.calcite.sql.SqlCall; import org.apache.calcite.sql.SqlNode; import org.apache.calcite.sql.SqlSelect;
import org.apache.calcite.sql.*;
[ "org.apache.calcite" ]
org.apache.calcite;
2,267,318
private static void waitForStreamState(AmazonKinesisClient kinesisClient, String streamName, @Nullable StreamStatus expectedStatus) { StreamStatus streamStatus = getStreamState(kinesisClient, streamName); long waitTime = System.currentTimeMillis() + TIMEOUT; while (streamStatus != expectedStatus && waitTime > System.currentTimeMillis()) { Uninterruptibles.sleepUninterruptibly(SLEEP_INTERVAL, TimeUnit.MILLISECONDS); streamStatus = getStreamState(kinesisClient, streamName); } if (!(streamStatus == expectedStatus)) { throw new IllegalStateException(String.format("Timed out waiting for stream to be in %s state", expectedStatus)); } }
static void function(AmazonKinesisClient kinesisClient, String streamName, @Nullable StreamStatus expectedStatus) { StreamStatus streamStatus = getStreamState(kinesisClient, streamName); long waitTime = System.currentTimeMillis() + TIMEOUT; while (streamStatus != expectedStatus && waitTime > System.currentTimeMillis()) { Uninterruptibles.sleepUninterruptibly(SLEEP_INTERVAL, TimeUnit.MILLISECONDS); streamStatus = getStreamState(kinesisClient, streamName); } if (!(streamStatus == expectedStatus)) { throw new IllegalStateException(String.format(STR, expectedStatus)); } }
/** * waits for the stream to be in the expected state * * @param kinesisClient * @param streamName * @param expectedStatus * @throws IllegalStateException */
waits for the stream to be in the expected state
waitForStreamState
{ "repo_name": "romy-khetan/hydrator-plugins", "path": "core-plugins/src/main/java/co/cask/hydrator/plugin/common/KinesisUtil.java", "license": "apache-2.0", "size": 4760 }
[ "com.amazonaws.services.kinesis.AmazonKinesisClient", "com.amazonaws.services.kinesis.model.StreamStatus", "com.google.common.util.concurrent.Uninterruptibles", "java.util.concurrent.TimeUnit", "javax.annotation.Nullable" ]
import com.amazonaws.services.kinesis.AmazonKinesisClient; import com.amazonaws.services.kinesis.model.StreamStatus; import com.google.common.util.concurrent.Uninterruptibles; import java.util.concurrent.TimeUnit; import javax.annotation.Nullable;
import com.amazonaws.services.kinesis.*; import com.amazonaws.services.kinesis.model.*; import com.google.common.util.concurrent.*; import java.util.concurrent.*; import javax.annotation.*;
[ "com.amazonaws.services", "com.google.common", "java.util", "javax.annotation" ]
com.amazonaws.services; com.google.common; java.util; javax.annotation;
799,399
protected void populateContext(Collection context) { }
void function(Collection context) { }
/** * Populates the context collection with information representing * this connection (such as the client host). * * This method should be overridden by subclasses to implement the * desired behavior of the populateContext method for * InboundRequest instances generated for this connection. **/
Populates the context collection with information representing this connection (such as the client host). This method should be overridden by subclasses to implement the desired behavior of the populateContext method for InboundRequest instances generated for this connection
populateContext
{ "repo_name": "pfirmstone/JGDMS", "path": "JGDMS/jgdms-jeri/src/main/java/org/apache/river/jeri/internal/mux/MuxServer.java", "license": "apache-2.0", "size": 8966 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
131,242
public static Config config(ConverterRule converterRule, RelBuilderFactory relBuilderFactory) { final RelOptRuleOperand operand = converterRule.getOperand(); assert operand.childPolicy == RelOptRuleOperandChildPolicy.ANY; return Config.EMPTY.withRelBuilderFactory(relBuilderFactory) .withDescription("TraitMatchingRule: " + converterRule) .withOperandSupplier(b0 -> b0.operand(operand.getMatchedClass()).oneInput(b1 -> b1.operand(RelNode.class).anyInputs())) .as(Config.class) .withConverterRule(converterRule); } //~ Constructors ----------------------------------------------------------- protected TraitMatchingRule(Config config) { super(config); } @Deprecated // to be removed before 2.0 public TraitMatchingRule(ConverterRule converterRule) { this(config(converterRule, RelFactories.LOGICAL_BUILDER)); } @Deprecated // to be removed before 2.0 public TraitMatchingRule(ConverterRule converterRule, RelBuilderFactory relBuilderFactory) { this(config(converterRule, relBuilderFactory)); } //~ Methods ----------------------------------------------------------------
static Config function(ConverterRule converterRule, RelBuilderFactory relBuilderFactory) { final RelOptRuleOperand operand = converterRule.getOperand(); assert operand.childPolicy == RelOptRuleOperandChildPolicy.ANY; return Config.EMPTY.withRelBuilderFactory(relBuilderFactory) .withDescription(STR + converterRule) .withOperandSupplier(b0 -> b0.operand(operand.getMatchedClass()).oneInput(b1 -> b1.operand(RelNode.class).anyInputs())) .as(Config.class) .withConverterRule(converterRule); } TraitMatchingRule(Config function) { super(config); } @Deprecated public TraitMatchingRule(ConverterRule converterRule) { this(config(converterRule, RelFactories.LOGICAL_BUILDER)); } @Deprecated public TraitMatchingRule(ConverterRule converterRule, RelBuilderFactory relBuilderFactory) { this(config(converterRule, relBuilderFactory)); }
/** * Creates a configuration for a TraitMatchingRule. * * @param converterRule Rule to be restricted; rule must take a single * operand expecting a single input * @param relBuilderFactory Builder for relational expressions */
Creates a configuration for a TraitMatchingRule
config
{ "repo_name": "datametica/calcite", "path": "core/src/main/java/org/apache/calcite/rel/convert/TraitMatchingRule.java", "license": "apache-2.0", "size": 4080 }
[ "org.apache.calcite.plan.RelOptRuleOperand", "org.apache.calcite.plan.RelOptRuleOperandChildPolicy", "org.apache.calcite.rel.RelNode", "org.apache.calcite.rel.core.RelFactories", "org.apache.calcite.tools.RelBuilderFactory" ]
import org.apache.calcite.plan.RelOptRuleOperand; import org.apache.calcite.plan.RelOptRuleOperandChildPolicy; import org.apache.calcite.rel.RelNode; import org.apache.calcite.rel.core.RelFactories; import org.apache.calcite.tools.RelBuilderFactory;
import org.apache.calcite.plan.*; import org.apache.calcite.rel.*; import org.apache.calcite.rel.core.*; import org.apache.calcite.tools.*;
[ "org.apache.calcite" ]
org.apache.calcite;
219,409
public Set<Object> keySet() { return map.keySet(); }
Set<Object> function() { return map.keySet(); }
/** * Returns a Set view of the attribute names (keys) contained in this Map. */
Returns a Set view of the attribute names (keys) contained in this Map
keySet
{ "repo_name": "AdmireTheDistance/android_libcore", "path": "ojluni/src/main/java/java/util/jar/Attributes.java", "license": "gpl-2.0", "size": 24560 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
2,782,890
public synchronized boolean startUpgrade() throws IOException { if(!upgradeState) { initializeUpgrade(); if(!upgradeState) return false; // write new upgrade state into disk FSNamesystem.getFSNamesystem().getFSImage().writeAll(); } assert currentUpgrades != null : "currentUpgrades is null"; this.broadcastCommand = currentUpgrades.first().startUpgrade(); NameNode.LOG.info("\n Distributed upgrade for NameNodeFBT version " + getUpgradeVersion() + " to current LV " + FSConstants.LAYOUT_VERSION + " is started."); return true; }
synchronized boolean function() throws IOException { if(!upgradeState) { initializeUpgrade(); if(!upgradeState) return false; FSNamesystem.getFSNamesystem().getFSImage().writeAll(); } assert currentUpgrades != null : STR; this.broadcastCommand = currentUpgrades.first().startUpgrade(); NameNode.LOG.info(STR + getUpgradeVersion() + STR + FSConstants.LAYOUT_VERSION + STR); return true; }
/** * Start distributed upgrade. * Instantiates distributed upgrade objects. * * @return true if distributed upgrade is required or false otherwise * @throws IOException */
Start distributed upgrade. Instantiates distributed upgrade objects
startUpgrade
{ "repo_name": "hanhlh/hadoop-0.20.2_FatBTree", "path": "src/hdfs/org/apache/hadoop/hdfs/server/namenode/UpgradeManagerNamenode.java", "license": "apache-2.0", "size": 6034 }
[ "java.io.IOException", "org.apache.hadoop.hdfs.protocol.FSConstants" ]
import java.io.IOException; import org.apache.hadoop.hdfs.protocol.FSConstants;
import java.io.*; import org.apache.hadoop.hdfs.protocol.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
1,005,076
public void openRegion(final HRegionInfo region) throws IOException;
void function(final HRegionInfo region) throws IOException;
/** * Opens the specified region. * @param region region to open * @throws IOException */
Opens the specified region
openRegion
{ "repo_name": "Shmuma/hbase", "path": "src/main/java/org/apache/hadoop/hbase/ipc/HRegionInterface.java", "license": "apache-2.0", "size": 13285 }
[ "java.io.IOException", "org.apache.hadoop.hbase.HRegionInfo" ]
import java.io.IOException; import org.apache.hadoop.hbase.HRegionInfo;
import java.io.*; import org.apache.hadoop.hbase.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
2,856,927
public ActionForward recalculateAmountToDraw(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { ContractsGrantsLetterOfCreditReviewForm contractsGrantsLetterOfCreditReviewForm = (ContractsGrantsLetterOfCreditReviewForm) form; ContractsGrantsLetterOfCreditReviewDocument contractsGrantsLetterOfCreditReviewDocument = (ContractsGrantsLetterOfCreditReviewDocument) contractsGrantsLetterOfCreditReviewForm.getDocument(); int indexOfLineToRecalculate = getSelectedLine(request); ContractsGrantsLetterOfCreditReviewDetail contractsGrantsLetterOfCreditReviewDetail = contractsGrantsLetterOfCreditReviewDocument.getHeaderReviewDetails().get(indexOfLineToRecalculate); contractsGrantsLetterOfCreditReviewDetail.setAmountToDraw(KualiDecimal.ZERO); // clear the cca amount to draw. contractsGrantsLetterOfCreditReviewDetail.setClaimOnCashBalance(KualiDecimal.ZERO); // clear the cca claim on cash balance for (ContractsGrantsLetterOfCreditReviewDetail detail : contractsGrantsLetterOfCreditReviewDocument.getAccountReviewDetails()) { // To set amount to Draw to 0 if there are blank values, to avoid exceptions. if (ObjectUtils.isNull(detail.getAmountToDraw())) { detail.setAmountToDraw(KualiDecimal.ZERO); } if (detail.getProposalNumber().equals(contractsGrantsLetterOfCreditReviewDetail.getProposalNumber())) { // To get the appropriate individual award account rows. contractsGrantsLetterOfCreditReviewDetail.setAmountToDraw(contractsGrantsLetterOfCreditReviewDetail.getAmountToDraw().add(detail.getAmountToDraw())); contractsGrantsLetterOfCreditReviewDetail.setClaimOnCashBalance(contractsGrantsLetterOfCreditReviewDetail.getClaimOnCashBalance().add(detail.getClaimOnCashBalance())); } // Now to set funds Not Drawn as a difference betwen amountToDraw and hiddenAmountToDraw. detail.setFundsNotDrawn(detail.getHiddenAmountToDraw().subtract(detail.getAmountToDraw())); if (detail.getFundsNotDrawn().isNegative()) { GlobalVariables.getMessageMap().putError(ArPropertyConstants.FUNDS_NOT_DRAWN, ArKeyConstants.ContractsGrantsInvoiceConstants.ERROR_DOCUMENT_AMOUNT_TO_DRAW_INVALID); detail.setFundsNotDrawn(KualiDecimal.ZERO); detail.setAmountToDraw(detail.getHiddenAmountToDraw().subtract(detail.getFundsNotDrawn())); } } return mapping.findForward(KFSConstants.MAPPING_BASIC); }
ActionForward function(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { ContractsGrantsLetterOfCreditReviewForm contractsGrantsLetterOfCreditReviewForm = (ContractsGrantsLetterOfCreditReviewForm) form; ContractsGrantsLetterOfCreditReviewDocument contractsGrantsLetterOfCreditReviewDocument = (ContractsGrantsLetterOfCreditReviewDocument) contractsGrantsLetterOfCreditReviewForm.getDocument(); int indexOfLineToRecalculate = getSelectedLine(request); ContractsGrantsLetterOfCreditReviewDetail contractsGrantsLetterOfCreditReviewDetail = contractsGrantsLetterOfCreditReviewDocument.getHeaderReviewDetails().get(indexOfLineToRecalculate); contractsGrantsLetterOfCreditReviewDetail.setAmountToDraw(KualiDecimal.ZERO); contractsGrantsLetterOfCreditReviewDetail.setClaimOnCashBalance(KualiDecimal.ZERO); for (ContractsGrantsLetterOfCreditReviewDetail detail : contractsGrantsLetterOfCreditReviewDocument.getAccountReviewDetails()) { if (ObjectUtils.isNull(detail.getAmountToDraw())) { detail.setAmountToDraw(KualiDecimal.ZERO); } if (detail.getProposalNumber().equals(contractsGrantsLetterOfCreditReviewDetail.getProposalNumber())) { contractsGrantsLetterOfCreditReviewDetail.setAmountToDraw(contractsGrantsLetterOfCreditReviewDetail.getAmountToDraw().add(detail.getAmountToDraw())); contractsGrantsLetterOfCreditReviewDetail.setClaimOnCashBalance(contractsGrantsLetterOfCreditReviewDetail.getClaimOnCashBalance().add(detail.getClaimOnCashBalance())); } detail.setFundsNotDrawn(detail.getHiddenAmountToDraw().subtract(detail.getAmountToDraw())); if (detail.getFundsNotDrawn().isNegative()) { GlobalVariables.getMessageMap().putError(ArPropertyConstants.FUNDS_NOT_DRAWN, ArKeyConstants.ContractsGrantsInvoiceConstants.ERROR_DOCUMENT_AMOUNT_TO_DRAW_INVALID); detail.setFundsNotDrawn(KualiDecimal.ZERO); detail.setAmountToDraw(detail.getHiddenAmountToDraw().subtract(detail.getFundsNotDrawn())); } } return mapping.findForward(KFSConstants.MAPPING_BASIC); }
/** * To recalculate the amount to Draw for every contract control account * * @param mapping An ActionMapping * @param form An ActionForm * @param request The HttpServletRequest * @param response The HttpServletResponse * @return An ActionForward * @throws Exception */
To recalculate the amount to Draw for every contract control account
recalculateAmountToDraw
{ "repo_name": "quikkian-ua-devops/will-financials", "path": "kfs-ar/src/main/java/org/kuali/kfs/module/ar/document/web/struts/ContractsGrantsLetterOfCreditReviewAction.java", "license": "agpl-3.0", "size": 16714 }
[ "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse", "org.apache.struts.action.ActionForm", "org.apache.struts.action.ActionForward", "org.apache.struts.action.ActionMapping", "org.kuali.kfs.krad.util.GlobalVariables", "org.kuali.kfs.krad.util.ObjectUtils", "org.kuali.kfs.module.ar.ArKeyConstants", "org.kuali.kfs.module.ar.ArPropertyConstants", "org.kuali.kfs.module.ar.businessobject.ContractsGrantsLetterOfCreditReviewDetail", "org.kuali.kfs.module.ar.document.ContractsGrantsLetterOfCreditReviewDocument", "org.kuali.kfs.sys.KFSConstants", "org.kuali.rice.core.api.util.type.KualiDecimal" ]
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.kuali.kfs.krad.util.GlobalVariables; import org.kuali.kfs.krad.util.ObjectUtils; import org.kuali.kfs.module.ar.ArKeyConstants; import org.kuali.kfs.module.ar.ArPropertyConstants; import org.kuali.kfs.module.ar.businessobject.ContractsGrantsLetterOfCreditReviewDetail; import org.kuali.kfs.module.ar.document.ContractsGrantsLetterOfCreditReviewDocument; import org.kuali.kfs.sys.KFSConstants; import org.kuali.rice.core.api.util.type.KualiDecimal;
import javax.servlet.http.*; import org.apache.struts.action.*; import org.kuali.kfs.krad.util.*; import org.kuali.kfs.module.ar.*; import org.kuali.kfs.module.ar.businessobject.*; import org.kuali.kfs.module.ar.document.*; import org.kuali.kfs.sys.*; import org.kuali.rice.core.api.util.type.*;
[ "javax.servlet", "org.apache.struts", "org.kuali.kfs", "org.kuali.rice" ]
javax.servlet; org.apache.struts; org.kuali.kfs; org.kuali.rice;
988,158
public static Double getSum( List<Double> values ) { Double sum = 0.0; for ( Double value : values ) { if ( value != null ) { sum += value; } } return sum; }
static Double function( List<Double> values ) { Double sum = 0.0; for ( Double value : values ) { if ( value != null ) { sum += value; } } return sum; }
/** * Returns the sum of the given values. * * @param values the values. * @return the sum. */
Returns the sum of the given values
getSum
{ "repo_name": "vietnguyen/dhis2-core", "path": "dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/util/MathUtils.java", "license": "bsd-3-clause", "size": 24287 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,623,871
static JSONObject invalidFeatureNoGeometry() throws Exception { return new JSONObject( "{\n" + " \"type\": \"Feature\",\n" + " \"properties\": {\n" + " \"name\": \"Dinagat Islands\"\n" + " }\n" + "}"); }
static JSONObject invalidFeatureNoGeometry() throws Exception { return new JSONObject( "{\n" + STRtype\STRFeature\",\n" + STRproperties\STR + STRname\STRDinagat Islands\"\n" + STR + "}"); }
/** * Feature missing its geometry member, should be created with null geometry * * @return feature missing its geometry */
Feature missing its geometry member, should be created with null geometry
invalidFeatureNoGeometry
{ "repo_name": "googlemaps/android-maps-utils", "path": "library/src/test/java/com/google/maps/android/data/geojson/GeoJsonTestUtil.java", "license": "apache-2.0", "size": 25191 }
[ "org.json.JSONObject" ]
import org.json.JSONObject;
import org.json.*;
[ "org.json" ]
org.json;
583,286
@Test public void testPlus() { RoundedMoney m = RoundedMoney.of(100, "CHF"); assertEquals(RoundedMoney.of(100, "CHF"), m.plus()); m = RoundedMoney.of(123.234, "CHF"); assertEquals(RoundedMoney.of(123.234, "CHF"), m.plus()); } /** * Test method for * {@link RoundedMoney#subtract(javax.money.MonetaryAmount)}
void function() { RoundedMoney m = RoundedMoney.of(100, "CHF"); assertEquals(RoundedMoney.of(100, "CHF"), m.plus()); m = RoundedMoney.of(123.234, "CHF"); assertEquals(RoundedMoney.of(123.234, "CHF"), m.plus()); } /** * Test method for * {@link RoundedMoney#subtract(javax.money.MonetaryAmount)}
/** * Test method for {@link RoundedMoney#plus()}. */
Test method for <code>RoundedMoney#plus()</code>
testPlus
{ "repo_name": "JavaMoney/jsr354-ri-bp", "path": "src/test/java/org/javamoney/moneta/RoundedMoneyTest.java", "license": "apache-2.0", "size": 52126 }
[ "javax.money.MonetaryAmount", "org.testng.Assert", "org.testng.annotations.Test" ]
import javax.money.MonetaryAmount; import org.testng.Assert; import org.testng.annotations.Test;
import javax.money.*; import org.testng.*; import org.testng.annotations.*;
[ "javax.money", "org.testng", "org.testng.annotations" ]
javax.money; org.testng; org.testng.annotations;
72,385
public static void applyTraversalRecursively(final Consumer<Traversal.Admin<?, ?>> consumer, final Traversal.Admin<?, ?> traversal) { consumer.accept(traversal); for (final Step<?, ?> step : traversal.getSteps()) { if (step instanceof TraversalParent) { for (final Traversal.Admin<?, ?> local : ((TraversalParent) step).getLocalChildren()) { applyTraversalRecursively(consumer, local); } for (final Traversal.Admin<?, ?> global : ((TraversalParent) step).getGlobalChildren()) { applyTraversalRecursively(consumer, global); } } } }
static void function(final Consumer<Traversal.Admin<?, ?>> consumer, final Traversal.Admin<?, ?> traversal) { consumer.accept(traversal); for (final Step<?, ?> step : traversal.getSteps()) { if (step instanceof TraversalParent) { for (final Traversal.Admin<?, ?> local : ((TraversalParent) step).getLocalChildren()) { applyTraversalRecursively(consumer, local); } for (final Traversal.Admin<?, ?> global : ((TraversalParent) step).getGlobalChildren()) { applyTraversalRecursively(consumer, global); } } } }
/** * Apply the provider {@link Consumer} function to the provided {@link Traversal} and all of its children. * * @param consumer the function to apply to the each traversal in the tree * @param traversal the root traversal to start application */
Apply the provider <code>Consumer</code> function to the provided <code>Traversal</code> and all of its children
applyTraversalRecursively
{ "repo_name": "jorgebay/tinkerpop", "path": "gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/TraversalHelper.java", "license": "apache-2.0", "size": 33065 }
[ "java.util.function.Consumer", "org.apache.tinkerpop.gremlin.process.traversal.Step", "org.apache.tinkerpop.gremlin.process.traversal.Traversal", "org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent" ]
import java.util.function.Consumer; import org.apache.tinkerpop.gremlin.process.traversal.Step; import org.apache.tinkerpop.gremlin.process.traversal.Traversal; import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent;
import java.util.function.*; import org.apache.tinkerpop.gremlin.process.traversal.*; import org.apache.tinkerpop.gremlin.process.traversal.step.*;
[ "java.util", "org.apache.tinkerpop" ]
java.util; org.apache.tinkerpop;
1,056,851
private void addChangeEventHook(WebElement element) { if (!isFirefox) { return; } checkState(!isChangeEventHookAdded(), "The `%1$s` event hook can only be added once in the document.", CHANGE_EVENT); executeScript(ADD_CHANGE_EVENT_HOOK, element, CHANGE_EVENT, HOOK_ATTRIBUTE); }
void function(WebElement element) { if (!isFirefox) { return; } checkState(!isChangeEventHookAdded(), STR, CHANGE_EVENT); executeScript(ADD_CHANGE_EVENT_HOOK, element, CHANGE_EVENT, HOOK_ATTRIBUTE); }
/** * Adds a {@value CHANGE_EVENT} event hook for the element. * The hook allows detection of the event required for {@link FirefoxChangeHandler#fireChangeEventIfNotFired}. * * @param element the element for which the hook will track whether the event is fired on the element * * @throws IllegalStateException if there is already a hook in the document */
Adds a CHANGE_EVENT event hook for the element. The hook allows detection of the event required for <code>FirefoxChangeHandler#fireChangeEventIfNotFired</code>
addChangeEventHook
{ "repo_name": "xpdavid/teammates", "path": "src/e2e/java/teammates/e2e/pageobjects/AppPage.java", "license": "gpl-2.0", "size": 32036 }
[ "com.google.common.base.Preconditions", "org.openqa.selenium.WebElement" ]
import com.google.common.base.Preconditions; import org.openqa.selenium.WebElement;
import com.google.common.base.*; import org.openqa.selenium.*;
[ "com.google.common", "org.openqa.selenium" ]
com.google.common; org.openqa.selenium;
473,451
public void testAddDependencyJars() throws Exception { Job job = new Job(); TableMapReduceUtil.addDependencyJars(job); String tmpjars = job.getConfiguration().get("tmpjars"); System.err.println("tmpjars: " + tmpjars); assertTrue(tmpjars.contains("zookeeper")); assertFalse(tmpjars.contains("guava")); System.err.println("appending guava jar"); TableMapReduceUtil.addDependencyJars(job.getConfiguration(), com.google.common.base.Function.class); tmpjars = job.getConfiguration().get("tmpjars"); assertTrue(tmpjars.contains("guava")); }
void function() throws Exception { Job job = new Job(); TableMapReduceUtil.addDependencyJars(job); String tmpjars = job.getConfiguration().get(STR); System.err.println(STR + tmpjars); assertTrue(tmpjars.contains(STR)); assertFalse(tmpjars.contains("guava")); System.err.println(STR); TableMapReduceUtil.addDependencyJars(job.getConfiguration(), com.google.common.base.Function.class); tmpjars = job.getConfiguration().get(STR); assertTrue(tmpjars.contains("guava")); }
/** * Test that we add tmpjars correctly including the ZK jar. */
Test that we add tmpjars correctly including the ZK jar
testAddDependencyJars
{ "repo_name": "bcopeland/hbase-thrift", "path": "src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableMapReduce.java", "license": "apache-2.0", "size": 9936 }
[ "org.apache.hadoop.mapreduce.Job", "org.junit.Assert" ]
import org.apache.hadoop.mapreduce.Job; import org.junit.Assert;
import org.apache.hadoop.mapreduce.*; import org.junit.*;
[ "org.apache.hadoop", "org.junit" ]
org.apache.hadoop; org.junit;
1,725,223
private EnumOutline generateEnumDef(CEnumLeafInfo e) { JDefinedClass type; type = getClassFactory().createClass( getContainer(e.parent, EXPOSED), e.shortName, e.getLocator(), ClassType.ENUM); type.javadoc().append(e.javadoc); return new EnumOutline(e, type) {
EnumOutline function(CEnumLeafInfo e) { JDefinedClass type; type = getClassFactory().createClass( getContainer(e.parent, EXPOSED), e.shortName, e.getLocator(), ClassType.ENUM); type.javadoc().append(e.javadoc); return new EnumOutline(e, type) {
/** * Generates the minimum {@link JDefinedClass} skeleton * without filling in its body. */
Generates the minimum <code>JDefinedClass</code> skeleton without filling in its body
generateEnumDef
{ "repo_name": "YouDiSN/OpenJDK-Research", "path": "jdk9/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/BeanGenerator.java", "license": "gpl-2.0", "size": 31882 }
[ "com.sun.codemodel.internal.ClassType", "com.sun.codemodel.internal.JDefinedClass", "com.sun.tools.internal.xjc.model.CEnumLeafInfo", "com.sun.tools.internal.xjc.outline.EnumOutline" ]
import com.sun.codemodel.internal.ClassType; import com.sun.codemodel.internal.JDefinedClass; import com.sun.tools.internal.xjc.model.CEnumLeafInfo; import com.sun.tools.internal.xjc.outline.EnumOutline;
import com.sun.codemodel.internal.*; import com.sun.tools.internal.xjc.model.*; import com.sun.tools.internal.xjc.outline.*;
[ "com.sun.codemodel", "com.sun.tools" ]
com.sun.codemodel; com.sun.tools;
1,740,310
public void paintEditorPaneBackground(SynthContext context, Graphics g, int x, int y, int w, int h) { paintBackground(context, g, x, y, w, h, null); }
void function(SynthContext context, Graphics g, int x, int y, int w, int h) { paintBackground(context, g, x, y, w, h, null); }
/** * Paints the background of an editor pane. * * @param context SynthContext identifying the <code>JComponent</code> and * <code>Region</code> to paint to * @param g <code>Graphics</code> to paint to * @param x X coordinate of the area to paint to * @param y Y coordinate of the area to paint to * @param w Width of the area to paint to * @param h Height of the area to paint to */
Paints the background of an editor pane
paintEditorPaneBackground
{ "repo_name": "anhtu1995ok/seaglass", "path": "src/main/java/com/seaglasslookandfeel/SeaGlassSynthPainterImpl.java", "license": "apache-2.0", "size": 119406 }
[ "java.awt.Graphics", "javax.swing.plaf.synth.SynthContext" ]
import java.awt.Graphics; import javax.swing.plaf.synth.SynthContext;
import java.awt.*; import javax.swing.plaf.synth.*;
[ "java.awt", "javax.swing" ]
java.awt; javax.swing;
1,401,351
public PersonalAddress storePersonalAddress(PersonalAddress personalAddress);
PersonalAddress function(PersonalAddress personalAddress);
/** * Store the given <code>PersonalAddress</code>. * * @param personalAddress */
Store the given <code>PersonalAddress</code>
storePersonalAddress
{ "repo_name": "iservport/helianto", "path": "helianto-classic/src/main/java/org/helianto/classic/IdentityMgr.java", "license": "apache-2.0", "size": 2095 }
[ "org.helianto.core.domain.PersonalAddress" ]
import org.helianto.core.domain.PersonalAddress;
import org.helianto.core.domain.*;
[ "org.helianto.core" ]
org.helianto.core;
1,534,329
@Authorized(PrivilegeConstants.SQL_LEVEL_ACCESS) public List<List<Object>> executeSQL(String sql, boolean selectOnly) throws APIException;
@Authorized(PrivilegeConstants.SQL_LEVEL_ACCESS) List<List<Object>> function(String sql, boolean selectOnly) throws APIException;
/** * Runs the <code>sql</code> on the database. If <code>selectOnly</code> is flagged then any * non-select sql statements will be rejected. * * @param sql * @param selectOnly * @return ResultSet * @throws APIException * @should execute sql containing group by */
Runs the <code>sql</code> on the database. If <code>selectOnly</code> is flagged then any non-select sql statements will be rejected
executeSQL
{ "repo_name": "Winbobob/openmrs-core", "path": "api/src/main/java/org/openmrs/api/AdministrationService.java", "license": "mpl-2.0", "size": 24849 }
[ "java.util.List", "org.openmrs.annotation.Authorized", "org.openmrs.util.PrivilegeConstants" ]
import java.util.List; import org.openmrs.annotation.Authorized; import org.openmrs.util.PrivilegeConstants;
import java.util.*; import org.openmrs.annotation.*; import org.openmrs.util.*;
[ "java.util", "org.openmrs.annotation", "org.openmrs.util" ]
java.util; org.openmrs.annotation; org.openmrs.util;
670,760
public void bind(final int port) { try { server = new ServerSocket(port); } catch (final Exception ex) { handleException(ex); } }
void function(final int port) { try { server = new ServerSocket(port); } catch (final Exception ex) { handleException(ex); } }
/** * Binds the server to the given port. * @param port The port the server should be bound to */
Binds the server to the given port
bind
{ "repo_name": "Sogomn/Sogomn-engine", "path": "src/de/sogomn/spjgl/net/TCPServer.java", "license": "apache-2.0", "size": 3889 }
[ "java.net.ServerSocket" ]
import java.net.ServerSocket;
import java.net.*;
[ "java.net" ]
java.net;
156,019