method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public void setLineStyle( int lineStyle ) { CTShapeProperties props = getShapeProperties(); CTLineProperties ln = props.isSetLn() ? props.getLn() : props.addNewLn(); CTPresetLineDashProperties dashStyle = CTPresetLineDashProperties.Factory.newInstance(); dashStyle.setVal(STPresetLineDashVal.Enum.forInt(lineStyle+1)); ln.setPrstDash(dashStyle); }
void function( int lineStyle ) { CTShapeProperties props = getShapeProperties(); CTLineProperties ln = props.isSetLn() ? props.getLn() : props.addNewLn(); CTPresetLineDashProperties dashStyle = CTPresetLineDashProperties.Factory.newInstance(); dashStyle.setVal(STPresetLineDashVal.Enum.forInt(lineStyle+1)); ln.setPrstDash(dashStyle); }
/** * Sets the line style. * * @param lineStyle */
Sets the line style
setLineStyle
{ "repo_name": "tobyclemson/msci-project", "path": "vendor/poi-3.6/src/ooxml/java/org/apache/poi/xssf/usermodel/XSSFShape.java", "license": "mit", "size": 5355 }
[ "org.openxmlformats.schemas.drawingml.x2006.main.CTLineProperties", "org.openxmlformats.schemas.drawingml.x2006.main.CTPresetLineDashProperties", "org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties", "org.openxmlformats.schemas.drawingml.x2006.main.STPresetLineDashVal" ]
import org.openxmlformats.schemas.drawingml.x2006.main.CTLineProperties; import org.openxmlformats.schemas.drawingml.x2006.main.CTPresetLineDashProperties; import org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties; import org.openxmlformats.schemas.drawingml.x2006.main.STPresetLineDashVal;
import org.openxmlformats.schemas.drawingml.x2006.main.*;
[ "org.openxmlformats.schemas" ]
org.openxmlformats.schemas;
1,127,921
final URL url = createUrl(resource); try { final int contentLength = url.openConnection().getContentLength(); final InputStream rawInputStream = url.openStream(); final InputStream progressMonitoringInputStream = new ProgressMonitoringInputStream(rawInputStream, contentLength, handler); final MessageDigest messageDigest = getSha1Digest(); final InputStream digestInputStream = new DigestInputStream(progressMonitoringInputStream, messageDigest); final InputStream gzipInputStream = new GZIPInputStream(digestInputStream); IoUtil.copy(gzipInputStream, out); this.verifyChecksum(resource, messageDigest.digest()); } catch (final IOException e) { throw new DictionaryResourceDownloaderException(e); } }
final URL url = createUrl(resource); try { final int contentLength = url.openConnection().getContentLength(); final InputStream rawInputStream = url.openStream(); final InputStream progressMonitoringInputStream = new ProgressMonitoringInputStream(rawInputStream, contentLength, handler); final MessageDigest messageDigest = getSha1Digest(); final InputStream digestInputStream = new DigestInputStream(progressMonitoringInputStream, messageDigest); final InputStream gzipInputStream = new GZIPInputStream(digestInputStream); IoUtil.copy(gzipInputStream, out); this.verifyChecksum(resource, messageDigest.digest()); } catch (final IOException e) { throw new DictionaryResourceDownloaderException(e); } }
/** * Download a compressed dictionary resource, verify its SHA1 hash code and * uncompress it into the given output stream. * * @param resource a {@link DictionaryResource} to download. * @param out the output stream to write the downloaded data to. * @param handler the {@link DownloadProgressHandler} to receive events for * download progress. * @throws DictionaryResourceDownloaderException if download fails or a hash * code does not match. */
Download a compressed dictionary resource, verify its SHA1 hash code and uncompress it into the given output stream
download
{ "repo_name": "ncjones/juzidian", "path": "org.juzidian.dataload/src/main/java/org/juzidian/dataload/DictionaryResourceDownloader.java", "license": "gpl-3.0", "size": 3534 }
[ "java.io.IOException", "java.io.InputStream", "java.security.DigestInputStream", "java.security.MessageDigest", "java.util.zip.GZIPInputStream", "org.juzidian.util.IoUtil" ]
import java.io.IOException; import java.io.InputStream; import java.security.DigestInputStream; import java.security.MessageDigest; import java.util.zip.GZIPInputStream; import org.juzidian.util.IoUtil;
import java.io.*; import java.security.*; import java.util.zip.*; import org.juzidian.util.*;
[ "java.io", "java.security", "java.util", "org.juzidian.util" ]
java.io; java.security; java.util; org.juzidian.util;
774,911
values().put(Constants.DB.ACTIVITY.START_TIME, value); }
values().put(Constants.DB.ACTIVITY.START_TIME, value); }
/** * Start time of the activity */
Start time of the activity
setStartTime
{ "repo_name": "netmackan/runnerup", "path": "app/src/org/runnerup/db/entities/ActivityValues.java", "license": "gpl-3.0", "size": 5320 }
[ "org.runnerup.common.util.Constants" ]
import org.runnerup.common.util.Constants;
import org.runnerup.common.util.*;
[ "org.runnerup.common" ]
org.runnerup.common;
461,244
public static InstrumentedFilesProvider collect( RuleContext ruleContext, InstrumentationSpec spec, LocalMetadataCollector localMetadataCollector, Iterable<Artifact> rootFiles, NestedSet<Artifact> coverageSupportFiles, boolean withBaselineCoverage) { Preconditions.checkNotNull(ruleContext); Preconditions.checkNotNull(spec); if (!ruleContext.getConfiguration().isCodeCoverageEnabled()) { return InstrumentedFilesProviderImpl.EMPTY; } NestedSetBuilder<Artifact> instrumentedFilesBuilder = NestedSetBuilder.stableOrder(); NestedSetBuilder<Artifact> metadataFilesBuilder = NestedSetBuilder.stableOrder(); NestedSetBuilder<Artifact> baselineCoverageInstrumentedFilesBuilder = NestedSetBuilder.stableOrder(); NestedSetBuilder<Artifact> coverageSupportFilesBuilder = NestedSetBuilder.<Artifact>stableOrder() .addTransitive(coverageSupportFiles); // Transitive instrumentation data. for (TransitiveInfoCollection dep : getAllPrerequisites(ruleContext, spec.dependencyAttributes)) { InstrumentedFilesProvider provider = dep.getProvider(InstrumentedFilesProvider.class); if (provider != null) { instrumentedFilesBuilder.addTransitive(provider.getInstrumentedFiles()); metadataFilesBuilder.addTransitive(provider.getInstrumentationMetadataFiles()); baselineCoverageInstrumentedFilesBuilder.addTransitive( provider.getBaselineCoverageInstrumentedFiles()); coverageSupportFilesBuilder.addTransitive(provider.getCoverageSupportFiles()); } } // Local sources. NestedSet<Artifact> localSources = NestedSetBuilder.emptySet(Order.STABLE_ORDER); if (shouldIncludeLocalSources(ruleContext)) { NestedSetBuilder<Artifact> localSourcesBuilder = NestedSetBuilder.stableOrder(); for (TransitiveInfoCollection dep : getAllPrerequisites(ruleContext, spec.sourceAttributes)) { if (!spec.splitLists && dep.getProvider(InstrumentedFilesProvider.class) != null) { continue; } for (Artifact artifact : dep.getProvider(FileProvider.class).getFilesToBuild()) { if (artifact.isSourceArtifact() && spec.instrumentedFileTypes.matches(artifact.getFilename())) { localSourcesBuilder.add(artifact); } } } localSources = localSourcesBuilder.build(); } instrumentedFilesBuilder.addTransitive(localSources); if (withBaselineCoverage) { // Also add the local sources to the baseline coverage instrumented sources, if the current // rule supports baseline coverage. // TODO(ulfjack): Generate a local baseline coverage action, and then merge at the leaves. baselineCoverageInstrumentedFilesBuilder.addTransitive(localSources); } // Local metadata files. if (localMetadataCollector != null) { localMetadataCollector.collectMetadataArtifacts(rootFiles, ruleContext.getAnalysisEnvironment(), metadataFilesBuilder); } // Baseline coverage actions. NestedSet<Artifact> baselineCoverageFiles = baselineCoverageInstrumentedFilesBuilder.build(); // Create one baseline coverage action per target, but for the transitive closure of files. NestedSet<Artifact> baselineCoverageArtifacts = BaselineCoverageAction.create(ruleContext, baselineCoverageFiles); return new InstrumentedFilesProviderImpl( instrumentedFilesBuilder.build(), metadataFilesBuilder.build(), baselineCoverageFiles, baselineCoverageArtifacts, coverageSupportFilesBuilder.build()); }
static InstrumentedFilesProvider function( RuleContext ruleContext, InstrumentationSpec spec, LocalMetadataCollector localMetadataCollector, Iterable<Artifact> rootFiles, NestedSet<Artifact> coverageSupportFiles, boolean withBaselineCoverage) { Preconditions.checkNotNull(ruleContext); Preconditions.checkNotNull(spec); if (!ruleContext.getConfiguration().isCodeCoverageEnabled()) { return InstrumentedFilesProviderImpl.EMPTY; } NestedSetBuilder<Artifact> instrumentedFilesBuilder = NestedSetBuilder.stableOrder(); NestedSetBuilder<Artifact> metadataFilesBuilder = NestedSetBuilder.stableOrder(); NestedSetBuilder<Artifact> baselineCoverageInstrumentedFilesBuilder = NestedSetBuilder.stableOrder(); NestedSetBuilder<Artifact> coverageSupportFilesBuilder = NestedSetBuilder.<Artifact>stableOrder() .addTransitive(coverageSupportFiles); for (TransitiveInfoCollection dep : getAllPrerequisites(ruleContext, spec.dependencyAttributes)) { InstrumentedFilesProvider provider = dep.getProvider(InstrumentedFilesProvider.class); if (provider != null) { instrumentedFilesBuilder.addTransitive(provider.getInstrumentedFiles()); metadataFilesBuilder.addTransitive(provider.getInstrumentationMetadataFiles()); baselineCoverageInstrumentedFilesBuilder.addTransitive( provider.getBaselineCoverageInstrumentedFiles()); coverageSupportFilesBuilder.addTransitive(provider.getCoverageSupportFiles()); } } NestedSet<Artifact> localSources = NestedSetBuilder.emptySet(Order.STABLE_ORDER); if (shouldIncludeLocalSources(ruleContext)) { NestedSetBuilder<Artifact> localSourcesBuilder = NestedSetBuilder.stableOrder(); for (TransitiveInfoCollection dep : getAllPrerequisites(ruleContext, spec.sourceAttributes)) { if (!spec.splitLists && dep.getProvider(InstrumentedFilesProvider.class) != null) { continue; } for (Artifact artifact : dep.getProvider(FileProvider.class).getFilesToBuild()) { if (artifact.isSourceArtifact() && spec.instrumentedFileTypes.matches(artifact.getFilename())) { localSourcesBuilder.add(artifact); } } } localSources = localSourcesBuilder.build(); } instrumentedFilesBuilder.addTransitive(localSources); if (withBaselineCoverage) { baselineCoverageInstrumentedFilesBuilder.addTransitive(localSources); } if (localMetadataCollector != null) { localMetadataCollector.collectMetadataArtifacts(rootFiles, ruleContext.getAnalysisEnvironment(), metadataFilesBuilder); } NestedSet<Artifact> baselineCoverageFiles = baselineCoverageInstrumentedFilesBuilder.build(); NestedSet<Artifact> baselineCoverageArtifacts = BaselineCoverageAction.create(ruleContext, baselineCoverageFiles); return new InstrumentedFilesProviderImpl( instrumentedFilesBuilder.build(), metadataFilesBuilder.build(), baselineCoverageFiles, baselineCoverageArtifacts, coverageSupportFilesBuilder.build()); }
/** * Collects transitive instrumentation data from dependencies, collects local source files from * dependencies, collects local metadata files by traversing the action graph of the current * configured target, collect rule-specific instrumentation support file sand creates baseline * coverage actions for the transitive closure of source files (if * <code>withBaselineCoverage</code> is true). */
Collects transitive instrumentation data from dependencies, collects local source files from dependencies, collects local metadata files by traversing the action graph of the current configured target, collect rule-specific instrumentation support file sand creates baseline coverage actions for the transitive closure of source files (if <code>withBaselineCoverage</code> is true)
collect
{ "repo_name": "mikelalcon/bazel", "path": "src/main/java/com/google/devtools/build/lib/rules/test/InstrumentedFilesCollector.java", "license": "apache-2.0", "size": 13037 }
[ "com.google.devtools.build.lib.actions.Artifact", "com.google.devtools.build.lib.analysis.FileProvider", "com.google.devtools.build.lib.analysis.RuleContext", "com.google.devtools.build.lib.analysis.TransitiveInfoCollection", "com.google.devtools.build.lib.collect.nestedset.NestedSet", "com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder", "com.google.devtools.build.lib.collect.nestedset.Order", "com.google.devtools.build.lib.util.Preconditions" ]
import com.google.devtools.build.lib.actions.Artifact; import com.google.devtools.build.lib.analysis.FileProvider; import com.google.devtools.build.lib.analysis.RuleContext; import com.google.devtools.build.lib.analysis.TransitiveInfoCollection; import com.google.devtools.build.lib.collect.nestedset.NestedSet; import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder; import com.google.devtools.build.lib.collect.nestedset.Order; import com.google.devtools.build.lib.util.Preconditions;
import com.google.devtools.build.lib.actions.*; import com.google.devtools.build.lib.analysis.*; import com.google.devtools.build.lib.collect.nestedset.*; import com.google.devtools.build.lib.util.*;
[ "com.google.devtools" ]
com.google.devtools;
600,328
protected String readInput(InputStream input) { StringBuilder builder = new StringBuilder(); byte[] tmp = new byte[DEFAULT_BUF_SIZE]; try { while (input.available() > 0) { int i = input.read(tmp, 0, DEFAULT_BUF_SIZE); if (i < 0) break; builder.append(new String(tmp, 0, i)); } } catch (Exception e) { throw new RuntimeException(e); } return builder.toString(); }
String function(InputStream input) { StringBuilder builder = new StringBuilder(); byte[] tmp = new byte[DEFAULT_BUF_SIZE]; try { while (input.available() > 0) { int i = input.read(tmp, 0, DEFAULT_BUF_SIZE); if (i < 0) break; builder.append(new String(tmp, 0, i)); } } catch (Exception e) { throw new RuntimeException(e); } return builder.toString(); }
/*** * Consume data from input stream and convert is into a String * * @param input * An input stream. * @return A string object representing the contents of the given stream. */
Consume data from input stream and convert is into a String
readInput
{ "repo_name": "anjalshireesh/gluster-ovirt-poc", "path": "backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/hostinstall/MinaInstallWrapper.java", "license": "apache-2.0", "size": 44054 }
[ "java.io.InputStream" ]
import java.io.InputStream;
import java.io.*;
[ "java.io" ]
java.io;
404,162
public static TasksEntry findByPrimaryKey(long tasksEntryId) throws com.liferay.tasks.exception.NoSuchTasksEntryException { return getPersistence().findByPrimaryKey(tasksEntryId); }
static TasksEntry function(long tasksEntryId) throws com.liferay.tasks.exception.NoSuchTasksEntryException { return getPersistence().findByPrimaryKey(tasksEntryId); }
/** * Returns the tasks entry with the primary key or throws a {@link NoSuchTasksEntryException} if it could not be found. * * @param tasksEntryId the primary key of the tasks entry * @return the tasks entry * @throws NoSuchTasksEntryException if a tasks entry with the primary key could not be found */
Returns the tasks entry with the primary key or throws a <code>NoSuchTasksEntryException</code> if it could not be found
findByPrimaryKey
{ "repo_name": "gamerson/blade", "path": "test-resources/projects/tasks-plugins-sdk/portlets/tasks-portlet/docroot/WEB-INF/service/com/liferay/tasks/service/persistence/TasksEntryUtil.java", "license": "apache-2.0", "size": 94635 }
[ "com.liferay.tasks.model.TasksEntry" ]
import com.liferay.tasks.model.TasksEntry;
import com.liferay.tasks.model.*;
[ "com.liferay.tasks" ]
com.liferay.tasks;
75,585
protected ArrayList<HashMap<String, String>> reportError(final Map<String, String> errors) { return reportError(errors, null); }
ArrayList<HashMap<String, String>> function(final Map<String, String> errors) { return reportError(errors, null); }
/** * Utility method used to report errors. * * @param errors A simple map containing errors. * * @return The list of errors that will be reported back to the user. */
Utility method used to report errors
reportError
{ "repo_name": "dotCMS/core", "path": "dotCMS/src/main/java/com/dotcms/rendering/velocity/viewtools/SQLResultsViewTool.java", "license": "gpl-3.0", "size": 13173 }
[ "java.util.ArrayList", "java.util.HashMap", "java.util.Map" ]
import java.util.ArrayList; import java.util.HashMap; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,787,748
private void createTables (final Connection jdbc) throws IOException, SQLException { final Set<String> tableNames = db.getTableNames(); for (String tableName : tableNames) { Table table = db.getTable(tableName); createTable(table, jdbc); createIndexes(table, jdbc); } }
void function (final Connection jdbc) throws IOException, SQLException { final Set<String> tableNames = db.getTableNames(); for (String tableName : tableNames) { Table table = db.getTable(tableName); createTable(table, jdbc); createIndexes(table, jdbc); } }
/** * Iterate over and create SQLite tables for every table defined * in the MS Access database. * * @param jdbc The SQLite database JDBC connection */
Iterate over and create SQLite tables for every table defined in the MS Access database
createTables
{ "repo_name": "landonf/mdb-sqlite", "path": "src/java/com/plausiblelabs/mdb/AccessExporter.java", "license": "bsd-3-clause", "size": 12389 }
[ "com.healthmarketscience.jackcess.Table", "java.io.IOException", "java.sql.Connection", "java.sql.SQLException", "java.util.Set" ]
import com.healthmarketscience.jackcess.Table; import java.io.IOException; import java.sql.Connection; import java.sql.SQLException; import java.util.Set;
import com.healthmarketscience.jackcess.*; import java.io.*; import java.sql.*; import java.util.*;
[ "com.healthmarketscience.jackcess", "java.io", "java.sql", "java.util" ]
com.healthmarketscience.jackcess; java.io; java.sql; java.util;
1,714,523
private void doChangedSet( ChangeLogSet set, ResourceBundle bundle, Sink sink ) { sink.section2(); doChangeSetTitle( set, bundle, sink ); doSummary( set, bundle, sink ); doChangedSetTable( set.getChangeSets(), bundle, sink ); sink.section2_(); }
void function( ChangeLogSet set, ResourceBundle bundle, Sink sink ) { sink.section2(); doChangeSetTitle( set, bundle, sink ); doSummary( set, bundle, sink ); doChangedSetTable( set.getChangeSets(), bundle, sink ); sink.section2_(); }
/** * generates a section of the report referring to a changeset * * @param set the current ChangeSet to generate this section of the report * @param bundle the resource bundle to retrieve report phrases from * @param sink the report formatting tool */
generates a section of the report referring to a changeset
doChangedSet
{ "repo_name": "apache/maven-plugins", "path": "maven-changelog-plugin/src/main/java/org/apache/maven/plugin/changelog/ChangeLogReport.java", "license": "apache-2.0", "size": 60011 }
[ "java.util.ResourceBundle", "org.apache.maven.doxia.sink.Sink", "org.apache.maven.scm.command.changelog.ChangeLogSet" ]
import java.util.ResourceBundle; import org.apache.maven.doxia.sink.Sink; import org.apache.maven.scm.command.changelog.ChangeLogSet;
import java.util.*; import org.apache.maven.doxia.sink.*; import org.apache.maven.scm.command.changelog.*;
[ "java.util", "org.apache.maven" ]
java.util; org.apache.maven;
2,716,700
private boolean isDirectory(OzoneKey key) { LOG.trace("key name:{} size:{}", key.getName(), key.getDataSize()); return key.getName().endsWith(OZONE_URI_DELIMITER) && (key.getDataSize() == 0); }
boolean function(OzoneKey key) { LOG.trace(STR, key.getName(), key.getDataSize()); return key.getName().endsWith(OZONE_URI_DELIMITER) && (key.getDataSize() == 0); }
/** * Helper method to check if an Ozone key is representing a directory. * @param key key to be checked as a directory * @return true if key is a directory, false otherwise */
Helper method to check if an Ozone key is representing a directory
isDirectory
{ "repo_name": "ucare-uchicago/hadoop", "path": "hadoop-ozone/ozonefs/src/main/java/org/apache/hadoop/fs/ozone/OzoneFileSystem.java", "license": "apache-2.0", "size": 23268 }
[ "org.apache.hadoop.ozone.client.OzoneKey" ]
import org.apache.hadoop.ozone.client.OzoneKey;
import org.apache.hadoop.ozone.client.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
197,592
public Iterator<String> iterator() { return this; }
Iterator<String> function() { return this; }
/** * Returns this object. */
Returns this object
iterator
{ "repo_name": "sleepydragonsw/capacitive-buttons-android", "path": "CapButnBrightness/src/org/sleepydragon/capbutnbrightness/debug/DebugLinesGenerator.java", "license": "gpl-3.0", "size": 16250 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
298,653
public void removeChartDataListener(@Nullable ChartDataListener l) { dataListeners.remove(l); }
void function(@Nullable ChartDataListener l) { dataListeners.remove(l); }
/** * Removes the given listener from the list of parties interested in data * change events. If the given listener was registered multiple times, this * call only removes one of the registrations. If the given listener is not * currently registered, this method has no effect. * * @param l * the listener to remove. Null is silently ignored. */
Removes the given listener from the list of parties interested in data change events. If the given listener was registered multiple times, this call only removes one of the registrations. If the given listener is not currently registered, this method has no effect
removeChartDataListener
{ "repo_name": "iyerdude/wabit", "path": "src/main/java/ca/sqlpower/wabit/report/chart/Chart.java", "license": "gpl-3.0", "size": 33570 }
[ "javax.annotation.Nullable" ]
import javax.annotation.Nullable;
import javax.annotation.*;
[ "javax.annotation" ]
javax.annotation;
1,865,692
public static boolean isIsolatedSuite(ExtensionContext extensionContext) { return CONTAINS_ANNOTATION.apply(ISOLATED_SUITE, extensionContext); }
static boolean function(ExtensionContext extensionContext) { return CONTAINS_ANNOTATION.apply(ISOLATED_SUITE, extensionContext); }
/** * Checking if test case contains annotation IsolatedSuite * @param extensionContext context of the test case * @return true if test case contains annotation IsolatedSuite, otherwise false */
Checking if test case contains annotation IsolatedSuite
isIsolatedSuite
{ "repo_name": "ppatierno/kaas", "path": "systemtest/src/main/java/io/strimzi/systemtest/utils/StUtils.java", "license": "apache-2.0", "size": 20498 }
[ "org.junit.jupiter.api.extension.ExtensionContext" ]
import org.junit.jupiter.api.extension.ExtensionContext;
import org.junit.jupiter.api.extension.*;
[ "org.junit.jupiter" ]
org.junit.jupiter;
1,049,195
public static void readFully(Reader input, char[] buffer) throws IOException { readFully(input, buffer, 0, buffer.length); }
static void function(Reader input, char[] buffer) throws IOException { readFully(input, buffer, 0, buffer.length); }
/** * Read the requested number of characters or fail if there are not enough left. * <p/> * This allows for the possibility that {@link Reader#read(char[], int, int)} may * not read as many characters as requested (most likely because of reaching EOF). * * @param input where to read input from * @param buffer destination * @throws IOException if there is a problem reading the file * @throws IllegalArgumentException if length is negative * @throws EOFException if the number of characters read was incorrect * @since 2.2 */
Read the requested number of characters or fail if there are not enough left. This allows for the possibility that <code>Reader#read(char[], int, int)</code> may not read as many characters as requested (most likely because of reaching EOF)
readFully
{ "repo_name": "pengjianbo/ToolsFinal", "path": "toolsfinal/src/main/java/cn/finalteam/toolsfinal/io/IOUtils.java", "license": "apache-2.0", "size": 95391 }
[ "java.io.IOException", "java.io.Reader" ]
import java.io.IOException; import java.io.Reader;
import java.io.*;
[ "java.io" ]
java.io;
992,824
public Graph loop_one( int executionCount ){ GraphImpl graph = new GraphImpl( "loop_one", 1 ); Node node100 = new SetAttributeActivity( 100, "executionCount", 0 ); XorJoin join = new XorJoin( -2 ); Node node101 = new SetAttributeActivity( 101, "executionCount", "${executionCount + 1}" ); Node node1 = createRecordPathNode( 1 ); XorFork fork = new XorFork( 2 ); fork.addCondition( new ExpressionLanguageCondition( "executionCount < " + executionCount ), "2_-2" ); graph.setStartNode( node100 ); graph.addNode( join ); graph.addNode( node101 ); graph.addNode( node1 ); graph.addNode( fork ); graph.addTransition( new TransitionImpl( node100, join ) ); graph.addTransition( new TransitionImpl( join, node101 ) ); graph.addTransition( new TransitionImpl( node101, node1 ) ); graph.addTransition( new TransitionImpl( node1, fork ) ); graph.addTransition( new TransitionImpl( "2_-2", fork, join ) ); return graph; }
Graph function( int executionCount ){ GraphImpl graph = new GraphImpl( STR, 1 ); Node node100 = new SetAttributeActivity( 100, STR, 0 ); XorJoin join = new XorJoin( -2 ); Node node101 = new SetAttributeActivity( 101, STR, STR ); Node node1 = createRecordPathNode( 1 ); XorFork fork = new XorFork( 2 ); fork.addCondition( new ExpressionLanguageCondition( STR + executionCount ), "2_-2" ); graph.setStartNode( node100 ); graph.addNode( join ); graph.addNode( node101 ); graph.addNode( node1 ); graph.addNode( fork ); graph.addTransition( new TransitionImpl( node100, join ) ); graph.addTransition( new TransitionImpl( join, node101 ) ); graph.addTransition( new TransitionImpl( node101, node1 ) ); graph.addTransition( new TransitionImpl( node1, fork ) ); graph.addTransition( new TransitionImpl( "2_-2", fork, join ) ); return graph; }
/** * <pre> * [1]--[XOR] * | |(ExecutionCountCondition) * +--<--+ * </pre> */
<code> [1]--[XOR] | |(ExecutionCountCondition) +--
loop_one
{ "repo_name": "zutnop/telekom-workflow-engine", "path": "telekom-workflow-engine/src/test/java/ee/telekom/workflow/graph/GraphFactory.java", "license": "mit", "size": 74501 }
[ "ee.telekom.workflow.graph.core.GraphImpl", "ee.telekom.workflow.graph.core.TransitionImpl", "ee.telekom.workflow.graph.node.activity.SetAttributeActivity", "ee.telekom.workflow.graph.node.gateway.XorFork", "ee.telekom.workflow.graph.node.gateway.XorJoin", "ee.telekom.workflow.graph.node.gateway.condition.ExpressionLanguageCondition" ]
import ee.telekom.workflow.graph.core.GraphImpl; import ee.telekom.workflow.graph.core.TransitionImpl; import ee.telekom.workflow.graph.node.activity.SetAttributeActivity; import ee.telekom.workflow.graph.node.gateway.XorFork; import ee.telekom.workflow.graph.node.gateway.XorJoin; import ee.telekom.workflow.graph.node.gateway.condition.ExpressionLanguageCondition;
import ee.telekom.workflow.graph.core.*; import ee.telekom.workflow.graph.node.activity.*; import ee.telekom.workflow.graph.node.gateway.*; import ee.telekom.workflow.graph.node.gateway.condition.*;
[ "ee.telekom.workflow" ]
ee.telekom.workflow;
2,092,255
public RandomAccessStream openRandomAccess() throws IOException { return openFileRandomAccess(); }
RandomAccessStream function() throws IOException { return openFileRandomAccess(); }
/** * Opens a random-access stream. */
Opens a random-access stream
openRandomAccess
{ "repo_name": "dlitz/resin", "path": "modules/kernel/src/com/caucho/vfs/Path.java", "license": "gpl-2.0", "size": 35830 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,277,920
public boolean canDropFromExplosion(Explosion explosionIn) { return false; }
boolean function(Explosion explosionIn) { return false; }
/** * Return whether this block can drop from an explosion. */
Return whether this block can drop from an explosion
canDropFromExplosion
{ "repo_name": "danielyc/test-1.9.4", "path": "build/tmp/recompileMc/sources/net/minecraft/block/BlockTNT.java", "license": "gpl-3.0", "size": 6214 }
[ "net.minecraft.world.Explosion" ]
import net.minecraft.world.Explosion;
import net.minecraft.world.*;
[ "net.minecraft.world" ]
net.minecraft.world;
2,112,025
public void paste(byte[][] img, boolean flatten) { paste(img, new Rectangle(img.length, img[0].length), flatten); }
void function(byte[][] img, boolean flatten) { paste(img, new Rectangle(img.length, img[0].length), flatten); }
/** * Pastes a given selection in the top-left corner. If flatten is false, it * stays as a selection until the user flattens it. * * @param img byte[][] to paste, must fit exactly in sel * @param flatten Immediately flatten image */
Pastes a given selection in the top-left corner. If flatten is false, it stays as a selection until the user flattens it
paste
{ "repo_name": "dperelman/jhack", "path": "src/net/starmen/pkhack/IntArrDrawingArea.java", "license": "gpl-3.0", "size": 33395 }
[ "java.awt.Rectangle" ]
import java.awt.Rectangle;
import java.awt.*;
[ "java.awt" ]
java.awt;
2,345,114
public void cleanupSelf() { if (log.isInfoEnabled()) { log.info(String.format("cleanupSelf(%s).", this)); } cleanServants(false); } /** * Performs the actual cleanup operation on all the resources shared between * this and other {@link ome.services.blitz.impl.ServiceFactoryI} instances in the * same {@link Session}. Since {@link #destroy(Current)} is called regardless by the * router, even when a client has just died, we have this internal method * for handling the actual closing of resources. * * This method must take precautions to not throw a {@link SessionException}
void function() { if (log.isInfoEnabled()) { log.info(String.format(STR, this)); } cleanServants(false); } /** * Performs the actual cleanup operation on all the resources shared between * this and other {@link ome.services.blitz.impl.ServiceFactoryI} instances in the * same {@link Session}. Since {@link #destroy(Current)} is called regardless by the * router, even when a client has just died, we have this internal method * for handling the actual closing of resources. * * This method must take precautions to not throw a {@link SessionException}
/** * Called if this isn't a kill-everything event. * @see <a href="https://trac.openmicroscopy.org/ome/ticket/9330">Trac ticket #9330</a> */
Called if this isn't a kill-everything event
cleanupSelf
{ "repo_name": "knabar/openmicroscopy", "path": "components/blitz/src/omero/cmd/SessionI.java", "license": "gpl-2.0", "size": 28016 }
[ "org.hibernate.Session" ]
import org.hibernate.Session;
import org.hibernate.*;
[ "org.hibernate" ]
org.hibernate;
128,458
@Deprecated public Read withProjection(final String... fieldNames) { checkArgument(fieldNames.length > 0, "projection can not be null"); checkArgument( this.queryFn().getClass() != FindQuery.class, "withFilter is only supported for FindQuery API"); FindQuery findQuery = (FindQuery) queryFn(); FindQuery queryWithProjection = findQuery.toBuilder().setProjection(Arrays.asList(fieldNames)).build(); return builder().setQueryFn(queryWithProjection).build(); }
Read function(final String... fieldNames) { checkArgument(fieldNames.length > 0, STR); checkArgument( this.queryFn().getClass() != FindQuery.class, STR); FindQuery findQuery = (FindQuery) queryFn(); FindQuery queryWithProjection = findQuery.toBuilder().setProjection(Arrays.asList(fieldNames)).build(); return builder().setQueryFn(queryWithProjection).build(); }
/** * Sets a projection on the documents in a collection. * * @deprecated Use {@link #withQueryFn(SerializableFunction) with {@link * FindQuery#withProjection(List)} as an argument to set up the projection}. */
Sets a projection on the documents in a collection
withProjection
{ "repo_name": "iemejia/incubator-beam", "path": "sdks/java/io/mongodb/src/main/java/org/apache/beam/sdk/io/mongodb/MongoDbIO.java", "license": "apache-2.0", "size": 37430 }
[ "java.util.Arrays", "org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions" ]
import java.util.Arrays; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.Preconditions;
import java.util.*; import org.apache.beam.vendor.guava.v26_0_jre.com.google.common.base.*;
[ "java.util", "org.apache.beam" ]
java.util; org.apache.beam;
945,324
private void initialize() { setTitle("WindMill "+WindMill.VERSION); setIconImage(Toolkit.getDefaultToolkit().getImage(MainFrame.class.getResource("/com/prezerak/windmill/gui/resources/rotor_icon.gif"))); //setSize(new Dimension(1280,800)); GridBagLayout gridBagLayout = new GridBagLayout(); gridBagLayout.columnWidths = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 258, 331, 0}; gridBagLayout.rowHeights = new int[]{0, 0, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; gridBagLayout.columnWeights = new double[]{1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE}; gridBagLayout.rowWeights = new double[]{1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, Double.MIN_VALUE}; getContentPane().setLayout(gridBagLayout); JPanel controlsPanel = new JPanel(); controlsPanel.setBorder(new LineBorder(new Color(0, 0, 0))); GridBagConstraints gbc_controlsPanel = new GridBagConstraints(); gbc_controlsPanel.anchor = GridBagConstraints.NORTHEAST; gbc_controlsPanel.gridheight = 23; gbc_controlsPanel.gridx = 26; gbc_controlsPanel.gridy = 0; getContentPane().add(controlsPanel, gbc_controlsPanel); controlsPanel.setLayout(new BoxLayout(controlsPanel, BoxLayout.Y_AXIS)); menuPanel = new JPanel(); menuPanel.setAlignmentY(Component.TOP_ALIGNMENT); menuPanel.setBorder(BorderFactory.createLineBorder(Color.BLACK)); menuBar = new JMenuBar(); menuBar.setFont(new Font("Tahoma", Font.BOLD, 12)); menuBar.setLayout(new BorderLayout()); mnMenu = new JMenu("Menu"); mnMenu.setFont(new Font("Tahoma", Font.BOLD, 11)); mnMenu.setHorizontalAlignment(SwingConstants.CENTER); JMenuItem mntmOptions_1 = new JMenuItem("Options"); mntmOptions_1.setActionCommand("Options"); mntmOptions_1.addActionListener(this); menuPanel.setLayout(new FormLayout(new ColumnSpec[] { ColumnSpec.decode("307px:grow"),}, new RowSpec[] { RowSpec.decode("fill:30px"),})); mntmOptions_1.setFont(new Font("Tahoma", Font.PLAIN, 11)); mnMenu.add(mntmOptions_1); mntmErase = new JMenuItem("Erase DB"); mntmErase.setFont(new Font("Tahoma", Font.PLAIN, 11)); mntmErase.setActionCommand("Erase"); mntmErase.addActionListener(this); mnMenu.add(mntmErase); mntmAbout = new JMenuItem("About"); mntmAbout.setFont(new Font("Tahoma", Font.PLAIN, 11)); mntmAbout.setActionCommand("About"); mntmAbout.addActionListener(this); mnMenu.add(mntmAbout); mntmExit = new JMenuItem("Exit"); mntmExit.setActionCommand("Exit"); mntmExit.addActionListener(this); mntmExit.setFont(new Font("Tahoma", Font.PLAIN, 11)); mnMenu.add(mntmExit); menuBar.add(mnMenu, BorderLayout.CENTER); menuPanel.add(menuBar, "1, 1, fill, fill"); controlsPanel.add(menuPanel); JPanel unitsPanel = new JPanel(); unitsPanel.setBorder(new TitledBorder(null, "Units", TitledBorder.LEADING, TitledBorder.TOP, new Font("Tahoma", Font.BOLD, 11))); unitsPanel.setAlignmentY(Component.TOP_ALIGNMENT); unitsPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 5)); rdbtnMSec = new JRadioButton("m/sec"); rdbtnMSec.setFont(new Font("Tahoma", Font.PLAIN, 11)); rdbtnMSec.setSelected(true); rdbtnMSec.setActionCommand("m/sec"); rdbtnMSec.addActionListener(this); buttonGroupUnits.add(rdbtnMSec); unitsPanel.add(rdbtnMSec); rdbtnKmHr = new JRadioButton("km/hr"); rdbtnKmHr.setFont(new Font("Tahoma", Font.PLAIN, 11)); rdbtnKmHr.setActionCommand("km/hr"); rdbtnKmHr.addActionListener(this); buttonGroupUnits.add(rdbtnKmHr); unitsPanel.add(rdbtnKmHr); rdbtnKnots = new JRadioButton("knots"); rdbtnKnots.setFont(new Font("Tahoma", Font.PLAIN, 11)); rdbtnKnots.setActionCommand("knots"); rdbtnKnots.addActionListener(this); buttonGroupUnits.add(rdbtnKnots); unitsPanel.add(rdbtnKnots); rdbtnMilesHr = new JRadioButton("miles/hr"); rdbtnMilesHr.setFont(new Font("Tahoma", Font.PLAIN, 11)); rdbtnMilesHr.setActionCommand("miles/hr"); rdbtnMilesHr.addActionListener(this); buttonGroupUnits.add(rdbtnMilesHr); unitsPanel.add(rdbtnMilesHr); rdbtnBft = new JRadioButton("Bft"); rdbtnBft.setFont(new Font("Tahoma", Font.PLAIN, 11)); rdbtnBft.addActionListener(this); rdbtnBft.setActionCommand("Bft"); buttonGroupUnits.add(rdbtnBft); unitsPanel.add(rdbtnBft); controlsPanel.add(unitsPanel); //displayPanel = new RealTimePanel(); displayPanel = new JPanel(); displayPanel.setLayout(new CardLayout()); realTimePanel = new RealTimePanel(); displayPanel.add(realTimePanel, REALTIMEPANEL); MODE = MainFrameModes.REAL_TIME_MODE; GridBagConstraints gbc_displayPanel = new GridBagConstraints(); gbc_displayPanel.fill = GridBagConstraints.BOTH; gbc_displayPanel.gridheight = 23; gbc_displayPanel.gridwidth = 26; gbc_displayPanel.insets = new Insets(0, 0, 0, 5); gbc_displayPanel.gridx = 0; gbc_displayPanel.gridy = 0; getContentPane().add(displayPanel, gbc_displayPanel); periodPanel = new JPanel(); periodPanel.setAlignmentY(Component.TOP_ALIGNMENT); periodPanel.setBorder(new TitledBorder(null, "Time period", TitledBorder.LEADING, TitledBorder.TOP, new Font("Tahoma", Font.BOLD, 11))); controlsPanel.add(periodPanel); periodPanel.setLayout(new FormLayout(new ColumnSpec[] { ColumnSpec.decode("max(5dlu;default)"), FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("left:max(56dlu;default)"), ColumnSpec.decode("left:18dlu"), ColumnSpec.decode("left:max(12dlu;default)"), ColumnSpec.decode("left:max(21dlu;default)"), ColumnSpec.decode("left:max(17dlu;default)"), FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC,}, new RowSpec[] { RowSpec.decode("25px"), FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, RowSpec.decode("top:23px"),})); lblStartdate = new JLabel("Start Date"); lblStartdate.setFont(new Font("Tahoma", Font.PLAIN, 11)); periodPanel.add(lblStartdate, "3, 1, left, default"); lblStartTime = new JLabel("Start Time (GMT)"); lblStartTime.setFont(new Font("Tahoma", Font.PLAIN, 11)); periodPanel.add(lblStartTime, "5, 1, 3, 1, left, default"); SpinnerListener sListener = new SpinnerListener(); dateChooserStart = new MyDateChooser("dd/MM/yy", "##/##/##", '_'); dateChooserStart.setLocale(Locale.ENGLISH); GregorianCalendar gc = (GregorianCalendar) Calendar.getInstance(); gc.set(gc.get(Calendar.YEAR), gc.get(Calendar.MONTH), gc.get(Calendar.DAY_OF_MONTH), 0, 0, 0); dateChooserStart.setDate(gc.getTime()); ((JTextFieldDateEditor)dateChooserStart.getDateEditor()).addActionListener(sListener); periodPanel.add(dateChooserStart, "3, 2, left, fill"); spinnerStartMins = new JSpinner(new RolloverSpinnerNumberModel(0, 0, 59,1)); spinnerStartMins.setEditor(new JSpinner.NumberEditor(spinnerStartMins,"00")); spinnerStartMins.setFont(new Font("Tahoma", Font.PLAIN, 11)); spinnerStartMins.addChangeListener(sListener); spinnerStartHrs = new JSpinner(new RolloverSpinnerNumberModel(12, 0, 23,1)); spinnerStartHrs.setFont(new Font("Tahoma", Font.PLAIN, 11)); spinnerStartHrs.addChangeListener(sListener); periodPanel.add(spinnerStartHrs, "5, 2, left, default"); lblHrs = new JLabel("hrs"); lblHrs.setFont(new Font("Tahoma", Font.PLAIN, 11)); periodPanel.add(lblHrs, "6, 2, center, default"); periodPanel.add(spinnerStartMins, "7, 2, right, default"); lblMins = new JLabel("mins"); lblMins.setFont(new Font("Tahoma", Font.PLAIN, 11)); periodPanel.add(lblMins, "9, 2, center, default"); lblEndDate = new JLabel("End Date"); lblEndDate.setFont(new Font("Tahoma", Font.PLAIN, 11)); periodPanel.add(lblEndDate, "3, 4, left, default"); lblEndTime = new JLabel("End Time (GMT)"); lblEndTime.setFont(new Font("Tahoma", Font.PLAIN, 11)); periodPanel.add(lblEndTime, "5, 4, 3, 1, left, default"); dateChooserEnd = new MyDateChooser("dd/MM/yy", "##/##/##", '_'); dateChooserEnd.setLocale(Locale.ENGLISH); gc.set(gc.get(Calendar.YEAR), gc.get(Calendar.MONTH), gc.get(Calendar.DAY_OF_MONTH), 0, 0, 0); dateChooserEnd.setDate(gc.getTime()); ((JTextFieldDateEditor)dateChooserEnd.getDateEditor()).addActionListener(sListener); periodPanel.add(dateChooserEnd, "3, 6, left, fill"); spinnerEndMins = new JSpinner(new RolloverSpinnerNumberModel(1, 0, 59,1)); spinnerEndMins.setEditor(new JSpinner.NumberEditor(spinnerEndMins,"00")); spinnerEndMins.setFont(new Font("Tahoma", Font.PLAIN, 11)); spinnerEndMins.addChangeListener(sListener); spinnerEndHrs = new JSpinner(new RolloverSpinnerNumberModel(12, 0, 23,1)); spinnerEndHrs.setFont(new Font("Tahoma", Font.PLAIN, 11)); spinnerEndHrs.addChangeListener(sListener); periodPanel.add(spinnerEndHrs, "5, 6, left, default"); lblHrs_1 = new JLabel("hrs"); lblHrs_1.setFont(new Font("Tahoma", Font.PLAIN, 11)); periodPanel.add(lblHrs_1, "6, 6, center, center"); periodPanel.add(spinnerEndMins, "7, 6, right, default"); lblMins_1 = new JLabel("mins"); lblMins_1.setHorizontalAlignment(SwingConstants.LEFT); lblMins_1.setFont(new Font("Tahoma", Font.PLAIN, 11)); periodPanel.add(lblMins_1, "9, 6, center, center"); statsPanel2 = new JPanel(); statsPanel2.setBorder(new TitledBorder(null, "Wind stats", TitledBorder.LEADING, TitledBorder.TOP, new Font("Tahoma", Font.BOLD, 11))); controlsPanel.add(statsPanel2); statsPanel2.setLayout(new FormLayout(new ColumnSpec[] { FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("right:default"), FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("left:default"), FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("left:default"), FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("left:default"), FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC,}, new RowSpec[] { FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,})); rdbtnActual = new JRadioButton("Actual"); rdbtnActual.setSelected(true); statsPanel2.add(rdbtnActual, "2, 2, left, default"); rdbtnActual.setFont(new Font("Tahoma", Font.PLAIN, 11)); rdbtnActual.setActionCommand("0"); rdbtnActual.addActionListener(this); buttonGroupAvgs.add(rdbtnActual); rdbtnMins2 = new JRadioButton("2 mins"); statsPanel2.add(rdbtnMins2, "4, 2"); rdbtnMins2.setFont(new Font("Tahoma", Font.PLAIN, 11)); rdbtnMins2.setActionCommand("120"); rdbtnMins2.addActionListener(this); buttonGroupAvgs.add(rdbtnMins2); userSpinner = new JSpinner(new RolloverSpinnerNumberModel(1, 0, 60, 1)); statsPanel2.add(userSpinner, "8, 2"); userSpinner.setEnabled(false); userSpinner.addChangeListener(sListener); Double d = (Double) userSpinner.getModel().getValue(); rdbtnUserDefined = new JRadioButton("user defined"); statsPanel2.add(rdbtnUserDefined, "6, 2"); rdbtnUserDefined.setFont(new Font("Tahoma", Font.PLAIN, 11)); rdbtnUserDefined.setActionCommand(String.valueOf(d.intValue())); rdbtnUserDefined.addChangeListener(new UserDefinedRdbtnListener()); buttonGroupAvgs.add(rdbtnUserDefined); lblMins_2 = new JLabel("mins"); lblMins_2.setFont(new Font("Tahoma", Font.PLAIN, 11)); statsPanel2.add(lblMins_2, "10, 2"); rdbtnMins10 = new JRadioButton("10 mins"); statsPanel2.add(rdbtnMins10, "2, 4, left, default"); rdbtnMins10.setFont(new Font("Tahoma", Font.PLAIN, 11)); rdbtnMins10.setActionCommand("600"); rdbtnMins10.addActionListener(this); buttonGroupAvgs.add(rdbtnMins10); rdbtnMins30 = new JRadioButton("30 mins"); statsPanel2.add(rdbtnMins30, "4, 4"); rdbtnMins30.setFont(new Font("Tahoma", Font.PLAIN, 11)); rdbtnMins30.setActionCommand("1800"); rdbtnMins30.addActionListener(this); buttonGroupAvgs.add(rdbtnMins30); btnGo = new JButton("Graph"); btnGo.setFont(new Font("Tahoma", Font.PLAIN, 11)); btnGo.setActionCommand("Go"); btnGo.addActionListener(this); statsPanel2.add(btnGo, "6, 4, 5, 1"); alarmsPanel = new JPanel(); controlsPanel.add(alarmsPanel); alarmsPanel.setBorder(new TitledBorder(null, "Alarms", TitledBorder.LEADING, TitledBorder.TOP, new Font("Tahoma", Font.BOLD, 11))); alarmsPanel.setLayout(new BoxLayout(alarmsPanel, BoxLayout.Y_AXIS)); gustPanel = new JPanel(); gustPanel.setBorder(new TitledBorder(null, "Gust", TitledBorder.LEADING, TitledBorder.TOP, new Font("Tahoma", Font.PLAIN, 11))); gustPanel.setBackground(Color.GREEN); alarmsPanel.add(gustPanel); verticalStrut = Box.createVerticalStrut(20); gustPanel.add(verticalStrut); rigidArea = Box.createRigidArea(new Dimension(20, 20)); alarmsPanel.add(rigidArea); highPanel = new JPanel(); highPanel.setBorder(new TitledBorder(null, "High", TitledBorder.LEADING, TitledBorder.TOP, new Font("Tahoma", Font.PLAIN, 11))); highPanel.setBackground(Color.GREEN); alarmsPanel.add(highPanel); verticalStrut_1 = Box.createVerticalStrut(20); highPanel.add(verticalStrut_1); rigidArea_1 = Box.createRigidArea(new Dimension(20, 20)); alarmsPanel.add(rigidArea_1); higherPanel = new JPanel(); higherPanel.setBorder(new TitledBorder(null, "Higher", TitledBorder.LEADING, TitledBorder.TOP, new Font("Tahoma", Font.PLAIN, 11))); higherPanel.setBackground(Color.GREEN); alarmsPanel.add(higherPanel); verticalStrut_2 = Box.createVerticalStrut(20); higherPanel.add(verticalStrut_2); panelReport = new JPanel(); controlsPanel.add(panelReport); panelReport.setLayout(new BorderLayout(0, 0)); }
void function() { setTitle(STR+WindMill.VERSION); setIconImage(Toolkit.getDefaultToolkit().getImage(MainFrame.class.getResource(STR))); GridBagLayout gridBagLayout = new GridBagLayout(); gridBagLayout.columnWidths = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 258, 331, 0}; gridBagLayout.rowHeights = new int[]{0, 0, 79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; gridBagLayout.columnWeights = new double[]{1.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE}; gridBagLayout.rowWeights = new double[]{1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, Double.MIN_VALUE}; getContentPane().setLayout(gridBagLayout); JPanel controlsPanel = new JPanel(); controlsPanel.setBorder(new LineBorder(new Color(0, 0, 0))); GridBagConstraints gbc_controlsPanel = new GridBagConstraints(); gbc_controlsPanel.anchor = GridBagConstraints.NORTHEAST; gbc_controlsPanel.gridheight = 23; gbc_controlsPanel.gridx = 26; gbc_controlsPanel.gridy = 0; getContentPane().add(controlsPanel, gbc_controlsPanel); controlsPanel.setLayout(new BoxLayout(controlsPanel, BoxLayout.Y_AXIS)); menuPanel = new JPanel(); menuPanel.setAlignmentY(Component.TOP_ALIGNMENT); menuPanel.setBorder(BorderFactory.createLineBorder(Color.BLACK)); menuBar = new JMenuBar(); menuBar.setFont(new Font(STR, Font.BOLD, 12)); menuBar.setLayout(new BorderLayout()); mnMenu = new JMenu("Menu"); mnMenu.setFont(new Font(STR, Font.BOLD, 11)); mnMenu.setHorizontalAlignment(SwingConstants.CENTER); JMenuItem mntmOptions_1 = new JMenuItem(STR); mntmOptions_1.setActionCommand(STR); mntmOptions_1.addActionListener(this); menuPanel.setLayout(new FormLayout(new ColumnSpec[] { ColumnSpec.decode(STR),}, new RowSpec[] { RowSpec.decode(STR),})); mntmOptions_1.setFont(new Font(STR, Font.PLAIN, 11)); mnMenu.add(mntmOptions_1); mntmErase = new JMenuItem(STR); mntmErase.setFont(new Font(STR, Font.PLAIN, 11)); mntmErase.setActionCommand("Erase"); mntmErase.addActionListener(this); mnMenu.add(mntmErase); mntmAbout = new JMenuItem("About"); mntmAbout.setFont(new Font(STR, Font.PLAIN, 11)); mntmAbout.setActionCommand("About"); mntmAbout.addActionListener(this); mnMenu.add(mntmAbout); mntmExit = new JMenuItem("Exit"); mntmExit.setActionCommand("Exit"); mntmExit.addActionListener(this); mntmExit.setFont(new Font(STR, Font.PLAIN, 11)); mnMenu.add(mntmExit); menuBar.add(mnMenu, BorderLayout.CENTER); menuPanel.add(menuBar, STR); controlsPanel.add(menuPanel); JPanel unitsPanel = new JPanel(); unitsPanel.setBorder(new TitledBorder(null, "Units", TitledBorder.LEADING, TitledBorder.TOP, new Font(STR, Font.BOLD, 11))); unitsPanel.setAlignmentY(Component.TOP_ALIGNMENT); unitsPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 5)); rdbtnMSec = new JRadioButton("m/sec"); rdbtnMSec.setFont(new Font(STR, Font.PLAIN, 11)); rdbtnMSec.setSelected(true); rdbtnMSec.setActionCommand("m/sec"); rdbtnMSec.addActionListener(this); buttonGroupUnits.add(rdbtnMSec); unitsPanel.add(rdbtnMSec); rdbtnKmHr = new JRadioButton("km/hr"); rdbtnKmHr.setFont(new Font(STR, Font.PLAIN, 11)); rdbtnKmHr.setActionCommand("km/hr"); rdbtnKmHr.addActionListener(this); buttonGroupUnits.add(rdbtnKmHr); unitsPanel.add(rdbtnKmHr); rdbtnKnots = new JRadioButton("knots"); rdbtnKnots.setFont(new Font(STR, Font.PLAIN, 11)); rdbtnKnots.setActionCommand("knots"); rdbtnKnots.addActionListener(this); buttonGroupUnits.add(rdbtnKnots); unitsPanel.add(rdbtnKnots); rdbtnMilesHr = new JRadioButton(STR); rdbtnMilesHr.setFont(new Font(STR, Font.PLAIN, 11)); rdbtnMilesHr.setActionCommand(STR); rdbtnMilesHr.addActionListener(this); buttonGroupUnits.add(rdbtnMilesHr); unitsPanel.add(rdbtnMilesHr); rdbtnBft = new JRadioButton("Bft"); rdbtnBft.setFont(new Font(STR, Font.PLAIN, 11)); rdbtnBft.addActionListener(this); rdbtnBft.setActionCommand("Bft"); buttonGroupUnits.add(rdbtnBft); unitsPanel.add(rdbtnBft); controlsPanel.add(unitsPanel); displayPanel = new JPanel(); displayPanel.setLayout(new CardLayout()); realTimePanel = new RealTimePanel(); displayPanel.add(realTimePanel, REALTIMEPANEL); MODE = MainFrameModes.REAL_TIME_MODE; GridBagConstraints gbc_displayPanel = new GridBagConstraints(); gbc_displayPanel.fill = GridBagConstraints.BOTH; gbc_displayPanel.gridheight = 23; gbc_displayPanel.gridwidth = 26; gbc_displayPanel.insets = new Insets(0, 0, 0, 5); gbc_displayPanel.gridx = 0; gbc_displayPanel.gridy = 0; getContentPane().add(displayPanel, gbc_displayPanel); periodPanel = new JPanel(); periodPanel.setAlignmentY(Component.TOP_ALIGNMENT); periodPanel.setBorder(new TitledBorder(null, STR, TitledBorder.LEADING, TitledBorder.TOP, new Font(STR, Font.BOLD, 11))); controlsPanel.add(periodPanel); periodPanel.setLayout(new FormLayout(new ColumnSpec[] { ColumnSpec.decode(STR), FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode(STR), ColumnSpec.decode(STR), ColumnSpec.decode(STR), ColumnSpec.decode(STR), ColumnSpec.decode(STR), FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC,}, new RowSpec[] { RowSpec.decode("25px"), FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, RowSpec.decode(STR),})); lblStartdate = new JLabel(STR); lblStartdate.setFont(new Font(STR, Font.PLAIN, 11)); periodPanel.add(lblStartdate, STR); lblStartTime = new JLabel(STR); lblStartTime.setFont(new Font(STR, Font.PLAIN, 11)); periodPanel.add(lblStartTime, STR); SpinnerListener sListener = new SpinnerListener(); dateChooserStart = new MyDateChooser(STR, STR, '_'); dateChooserStart.setLocale(Locale.ENGLISH); GregorianCalendar gc = (GregorianCalendar) Calendar.getInstance(); gc.set(gc.get(Calendar.YEAR), gc.get(Calendar.MONTH), gc.get(Calendar.DAY_OF_MONTH), 0, 0, 0); dateChooserStart.setDate(gc.getTime()); ((JTextFieldDateEditor)dateChooserStart.getDateEditor()).addActionListener(sListener); periodPanel.add(dateChooserStart, STR); spinnerStartMins = new JSpinner(new RolloverSpinnerNumberModel(0, 0, 59,1)); spinnerStartMins.setEditor(new JSpinner.NumberEditor(spinnerStartMins,"00")); spinnerStartMins.setFont(new Font(STR, Font.PLAIN, 11)); spinnerStartMins.addChangeListener(sListener); spinnerStartHrs = new JSpinner(new RolloverSpinnerNumberModel(12, 0, 23,1)); spinnerStartHrs.setFont(new Font(STR, Font.PLAIN, 11)); spinnerStartHrs.addChangeListener(sListener); periodPanel.add(spinnerStartHrs, STR); lblHrs = new JLabel("hrs"); lblHrs.setFont(new Font(STR, Font.PLAIN, 11)); periodPanel.add(lblHrs, STR); periodPanel.add(spinnerStartMins, STR); lblMins = new JLabel("mins"); lblMins.setFont(new Font(STR, Font.PLAIN, 11)); periodPanel.add(lblMins, STR); lblEndDate = new JLabel(STR); lblEndDate.setFont(new Font(STR, Font.PLAIN, 11)); periodPanel.add(lblEndDate, STR); lblEndTime = new JLabel(STR); lblEndTime.setFont(new Font(STR, Font.PLAIN, 11)); periodPanel.add(lblEndTime, STR); dateChooserEnd = new MyDateChooser(STR, STR, '_'); dateChooserEnd.setLocale(Locale.ENGLISH); gc.set(gc.get(Calendar.YEAR), gc.get(Calendar.MONTH), gc.get(Calendar.DAY_OF_MONTH), 0, 0, 0); dateChooserEnd.setDate(gc.getTime()); ((JTextFieldDateEditor)dateChooserEnd.getDateEditor()).addActionListener(sListener); periodPanel.add(dateChooserEnd, STR); spinnerEndMins = new JSpinner(new RolloverSpinnerNumberModel(1, 0, 59,1)); spinnerEndMins.setEditor(new JSpinner.NumberEditor(spinnerEndMins,"00")); spinnerEndMins.setFont(new Font(STR, Font.PLAIN, 11)); spinnerEndMins.addChangeListener(sListener); spinnerEndHrs = new JSpinner(new RolloverSpinnerNumberModel(12, 0, 23,1)); spinnerEndHrs.setFont(new Font(STR, Font.PLAIN, 11)); spinnerEndHrs.addChangeListener(sListener); periodPanel.add(spinnerEndHrs, STR); lblHrs_1 = new JLabel("hrs"); lblHrs_1.setFont(new Font(STR, Font.PLAIN, 11)); periodPanel.add(lblHrs_1, STR); periodPanel.add(spinnerEndMins, STR); lblMins_1 = new JLabel("mins"); lblMins_1.setHorizontalAlignment(SwingConstants.LEFT); lblMins_1.setFont(new Font(STR, Font.PLAIN, 11)); periodPanel.add(lblMins_1, STR); statsPanel2 = new JPanel(); statsPanel2.setBorder(new TitledBorder(null, STR, TitledBorder.LEADING, TitledBorder.TOP, new Font(STR, Font.BOLD, 11))); controlsPanel.add(statsPanel2); statsPanel2.setLayout(new FormLayout(new ColumnSpec[] { FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode(STR), FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode(STR), FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode(STR), FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode(STR), FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC,}, new RowSpec[] { FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC,})); rdbtnActual = new JRadioButton(STR); rdbtnActual.setSelected(true); statsPanel2.add(rdbtnActual, STR); rdbtnActual.setFont(new Font(STR, Font.PLAIN, 11)); rdbtnActual.setActionCommand("0"); rdbtnActual.addActionListener(this); buttonGroupAvgs.add(rdbtnActual); rdbtnMins2 = new JRadioButton(STR); statsPanel2.add(rdbtnMins2, STR); rdbtnMins2.setFont(new Font(STR, Font.PLAIN, 11)); rdbtnMins2.setActionCommand("120"); rdbtnMins2.addActionListener(this); buttonGroupAvgs.add(rdbtnMins2); userSpinner = new JSpinner(new RolloverSpinnerNumberModel(1, 0, 60, 1)); statsPanel2.add(userSpinner, STR); userSpinner.setEnabled(false); userSpinner.addChangeListener(sListener); Double d = (Double) userSpinner.getModel().getValue(); rdbtnUserDefined = new JRadioButton(STR); statsPanel2.add(rdbtnUserDefined, STR); rdbtnUserDefined.setFont(new Font(STR, Font.PLAIN, 11)); rdbtnUserDefined.setActionCommand(String.valueOf(d.intValue())); rdbtnUserDefined.addChangeListener(new UserDefinedRdbtnListener()); buttonGroupAvgs.add(rdbtnUserDefined); lblMins_2 = new JLabel("mins"); lblMins_2.setFont(new Font(STR, Font.PLAIN, 11)); statsPanel2.add(lblMins_2, STR); rdbtnMins10 = new JRadioButton(STR); statsPanel2.add(rdbtnMins10, STR); rdbtnMins10.setFont(new Font(STR, Font.PLAIN, 11)); rdbtnMins10.setActionCommand("600"); rdbtnMins10.addActionListener(this); buttonGroupAvgs.add(rdbtnMins10); rdbtnMins30 = new JRadioButton(STR); statsPanel2.add(rdbtnMins30, STR); rdbtnMins30.setFont(new Font(STR, Font.PLAIN, 11)); rdbtnMins30.setActionCommand("1800"); rdbtnMins30.addActionListener(this); buttonGroupAvgs.add(rdbtnMins30); btnGo = new JButton("Graph"); btnGo.setFont(new Font(STR, Font.PLAIN, 11)); btnGo.setActionCommand("Go"); btnGo.addActionListener(this); statsPanel2.add(btnGo, STR); alarmsPanel = new JPanel(); controlsPanel.add(alarmsPanel); alarmsPanel.setBorder(new TitledBorder(null, STR, TitledBorder.LEADING, TitledBorder.TOP, new Font(STR, Font.BOLD, 11))); alarmsPanel.setLayout(new BoxLayout(alarmsPanel, BoxLayout.Y_AXIS)); gustPanel = new JPanel(); gustPanel.setBorder(new TitledBorder(null, "Gust", TitledBorder.LEADING, TitledBorder.TOP, new Font(STR, Font.PLAIN, 11))); gustPanel.setBackground(Color.GREEN); alarmsPanel.add(gustPanel); verticalStrut = Box.createVerticalStrut(20); gustPanel.add(verticalStrut); rigidArea = Box.createRigidArea(new Dimension(20, 20)); alarmsPanel.add(rigidArea); highPanel = new JPanel(); highPanel.setBorder(new TitledBorder(null, "High", TitledBorder.LEADING, TitledBorder.TOP, new Font(STR, Font.PLAIN, 11))); highPanel.setBackground(Color.GREEN); alarmsPanel.add(highPanel); verticalStrut_1 = Box.createVerticalStrut(20); highPanel.add(verticalStrut_1); rigidArea_1 = Box.createRigidArea(new Dimension(20, 20)); alarmsPanel.add(rigidArea_1); higherPanel = new JPanel(); higherPanel.setBorder(new TitledBorder(null, STR, TitledBorder.LEADING, TitledBorder.TOP, new Font(STR, Font.PLAIN, 11))); higherPanel.setBackground(Color.GREEN); alarmsPanel.add(higherPanel); verticalStrut_2 = Box.createVerticalStrut(20); higherPanel.add(verticalStrut_2); panelReport = new JPanel(); controlsPanel.add(panelReport); panelReport.setLayout(new BorderLayout(0, 0)); }
/** * Initialize the contents of the frame. */
Initialize the contents of the frame
initialize
{ "repo_name": "c0deb0y/windmill", "path": "src/com/prezerak/windmill/gui/MainFrame.java", "license": "apache-2.0", "size": 25841 }
[ "com.jgoodies.forms.factories.FormFactory", "com.jgoodies.forms.layout.ColumnSpec", "com.jgoodies.forms.layout.FormLayout", "com.jgoodies.forms.layout.RowSpec", "com.prezerak.windmill.main.WindMill", "com.prezerak.windmill.model.Gust", "com.prezerak.windmill.model.High", "com.toedter.calendar.JTextFieldDateEditor", "java.awt.BorderLayout", "java.awt.CardLayout", "java.awt.Color", "java.awt.Component", "java.awt.Dimension", "java.awt.FlowLayout", "java.awt.Font", "java.awt.GridBagConstraints", "java.awt.GridBagLayout", "java.awt.Insets", "java.awt.Toolkit", "java.util.Calendar", "java.util.GregorianCalendar", "java.util.Locale", "javax.swing.BorderFactory", "javax.swing.Box", "javax.swing.BoxLayout", "javax.swing.JButton", "javax.swing.JLabel", "javax.swing.JMenu", "javax.swing.JMenuBar", "javax.swing.JMenuItem", "javax.swing.JPanel", "javax.swing.JRadioButton", "javax.swing.JSpinner", "javax.swing.SwingConstants", "javax.swing.border.LineBorder", "javax.swing.border.TitledBorder" ]
import com.jgoodies.forms.factories.FormFactory; import com.jgoodies.forms.layout.ColumnSpec; import com.jgoodies.forms.layout.FormLayout; import com.jgoodies.forms.layout.RowSpec; import com.prezerak.windmill.main.WindMill; import com.prezerak.windmill.model.Gust; import com.prezerak.windmill.model.High; import com.toedter.calendar.JTextFieldDateEditor; import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.Color; import java.awt.Component; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Font; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import java.awt.Toolkit; import java.util.Calendar; import java.util.GregorianCalendar; import java.util.Locale; import javax.swing.BorderFactory; import javax.swing.Box; import javax.swing.BoxLayout; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JPanel; import javax.swing.JRadioButton; import javax.swing.JSpinner; import javax.swing.SwingConstants; import javax.swing.border.LineBorder; import javax.swing.border.TitledBorder;
import com.jgoodies.forms.factories.*; import com.jgoodies.forms.layout.*; import com.prezerak.windmill.main.*; import com.prezerak.windmill.model.*; import com.toedter.calendar.*; import java.awt.*; import java.util.*; import javax.swing.*; import javax.swing.border.*;
[ "com.jgoodies.forms", "com.prezerak.windmill", "com.toedter.calendar", "java.awt", "java.util", "javax.swing" ]
com.jgoodies.forms; com.prezerak.windmill; com.toedter.calendar; java.awt; java.util; javax.swing;
1,718,416
public void testMPP8Flags2() throws Exception { File in = new File(m_basedir + "/mpp8flags2.mpp"); ProjectFile mpp = new MPPReader().read(in); int index = 0; boolean[] flags; for (Task task : mpp.getAllTasks()) { if (task.getName().startsWith("Parent") == false) { flags = getFlagArray(task); assertTrue("Incorrect flag set in task " + task.getName(), testSingleFlagTrue(flags, index)); ++index; if (index == 20) { index = 0; } } } }
void function() throws Exception { File in = new File(m_basedir + STR); ProjectFile mpp = new MPPReader().read(in); int index = 0; boolean[] flags; for (Task task : mpp.getAllTasks()) { if (task.getName().startsWith(STR) == false) { flags = getFlagArray(task); assertTrue(STR + task.getName(), testSingleFlagTrue(flags, index)); ++index; if (index == 20) { index = 0; } } } }
/** * This test reads flags from an MPP8 file where each set of 20 tasks has * a single flag from 1-20 set. The next set of 20 tasks increases by * one outline level. * * @throws Exception */
This test reads flags from an MPP8 file where each set of 20 tasks has a single flag from 1-20 set. The next set of 20 tasks increases by one outline level
testMPP8Flags2
{ "repo_name": "tmyroadctfig/mpxj", "path": "net/sf/mpxj/junit/BasicTest.java", "license": "lgpl-2.1", "size": 75163 }
[ "java.io.File", "net.sf.mpxj.ProjectFile", "net.sf.mpxj.Task", "net.sf.mpxj.mpp.MPPReader" ]
import java.io.File; import net.sf.mpxj.ProjectFile; import net.sf.mpxj.Task; import net.sf.mpxj.mpp.MPPReader;
import java.io.*; import net.sf.mpxj.*; import net.sf.mpxj.mpp.*;
[ "java.io", "net.sf.mpxj" ]
java.io; net.sf.mpxj;
1,724,531
public File[] listFiles(String pathRelativeToProjectRoot) { return getFileForRelativePath(pathRelativeToProjectRoot).listFiles(); }
File[] function(String pathRelativeToProjectRoot) { return getFileForRelativePath(pathRelativeToProjectRoot).listFiles(); }
/** * Allows {@link java.io.File#listFiles} to be faked in tests. */
Allows <code>java.io.File#listFiles</code> to be faked in tests
listFiles
{ "repo_name": "denizt/buck", "path": "src/com/facebook/buck/util/ProjectFilesystem.java", "license": "apache-2.0", "size": 11970 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
195,668
public static String getMimeType(final String aFileUrl) { return URLConnection.getFileNameMap().getContentTypeFor(aFileUrl); }
static String function(final String aFileUrl) { return URLConnection.getFileNameMap().getContentTypeFor(aFileUrl); }
/** * Gets the MIME type of the supplied file URL. It gets MIME type from {@link URLConnection}'s file name map. * * @param aFileUrl A file-based URL * @return The MIME-type name for the supplied file */
Gets the MIME type of the supplied file URL. It gets MIME type from <code>URLConnection</code>'s file name map
getMimeType
{ "repo_name": "ksclarke/freelib-utils", "path": "src/main/java/info/freelibrary/util/FileUtils.java", "license": "lgpl-3.0", "size": 22000 }
[ "java.net.URLConnection" ]
import java.net.URLConnection;
import java.net.*;
[ "java.net" ]
java.net;
574,153
public RectangleEdge getPosition() { return this.position; }
RectangleEdge function() { return this.position; }
/** * Returns the position of the title. * * @return The title position (never <code>null</code>). */
Returns the position of the title
getPosition
{ "repo_name": "ibestvina/multithread-centiscape", "path": "CentiScaPe2.1/src/main/java/org/jfree/chart/title/Title.java", "license": "mit", "size": 15155 }
[ "org.jfree.ui.RectangleEdge" ]
import org.jfree.ui.RectangleEdge;
import org.jfree.ui.*;
[ "org.jfree.ui" ]
org.jfree.ui;
855,342
public OffsetDateTime creationTime() { return this.creationTime; }
OffsetDateTime function() { return this.creationTime; }
/** * Get the creationTime property: Gets the creation date and time of the encryption scope in UTC. * * @return the creationTime value. */
Get the creationTime property: Gets the creation date and time of the encryption scope in UTC
creationTime
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/models/EncryptionScopeInner.java", "license": "mit", "size": 5218 }
[ "java.time.OffsetDateTime" ]
import java.time.OffsetDateTime;
import java.time.*;
[ "java.time" ]
java.time;
1,723,899
public void testPRWithGatewaySenderPersistenceEnabled_Restart() { //create locator on local site Integer lnPort = (Integer)vm0.invoke(WANTestBase.class, "createFirstLocatorWithDSId", new Object[] { 1 }); //create locator on remote site Integer nyPort = (Integer)vm1.invoke(WANTestBase.class, "createFirstRemoteLocator", new Object[] { 2, lnPort }); //create receiver on remote site vm2.invoke(WANTestBase.class, "createReceiver", new Object[] { nyPort }); vm3.invoke(WANTestBase.class, "createReceiver", new Object[] { nyPort }); //create cache in local site vm4.invoke(WANTestBase.class, "createCache", new Object[] { lnPort }); vm5.invoke(WANTestBase.class, "createCache", new Object[] { lnPort }); vm6.invoke(WANTestBase.class, "createCache", new Object[] { lnPort }); vm7.invoke(WANTestBase.class, "createCache", new Object[] { lnPort }); //create senders with disk store String diskStore1 = (String) vm4.invoke(WANTestBase.class, "createSenderWithDiskStore", new Object[] { "ln", 2, true, 100, 10, false, true, null, null, true }); String diskStore2 = (String) vm5.invoke(WANTestBase.class, "createSenderWithDiskStore", new Object[] { "ln", 2, true, 100, 10, false, true, null, null, true }); String diskStore3 = (String) vm6.invoke(WANTestBase.class, "createSenderWithDiskStore", new Object[] { "ln", 2, true, 100, 10, false, true, null, null, true }); String diskStore4 = (String) vm7.invoke(WANTestBase.class, "createSenderWithDiskStore", new Object[] { "ln", 2, true, 100, 10, false, true, null, null, true }); getLogWriter().info("The DS are: " + diskStore1 + "," + diskStore2 + "," + diskStore3 + "," + diskStore4); //create PR on remote site vm2.invoke(WANTestBase.class, "createPartitionedRegion", new Object[] { testName, null, 1, 100, isOffHeap() }); vm3.invoke(WANTestBase.class, "createPartitionedRegion", new Object[] { testName, null, 1, 100, isOffHeap() }); //create PR on local site vm4.invoke(WANTestBase.class, "createPartitionedRegion", new Object[] { testName, "ln", 1, 100, isOffHeap() }); vm5.invoke(WANTestBase.class, "createPartitionedRegion", new Object[] { testName, "ln", 1, 100, isOffHeap() }); vm6.invoke(WANTestBase.class, "createPartitionedRegion", new Object[] { testName, "ln", 1, 100, isOffHeap() }); vm7.invoke(WANTestBase.class, "createPartitionedRegion", new Object[] { testName, "ln", 1, 100, isOffHeap() }); //start the senders on local site vm4.invoke(WANTestBase.class, "startSender", new Object[] { "ln" }); vm5.invoke(WANTestBase.class, "startSender", new Object[] { "ln" }); vm6.invoke(WANTestBase.class, "startSender", new Object[] { "ln" }); vm7.invoke(WANTestBase.class, "startSender", new Object[] { "ln" }); //wait for senders to become running vm4.invoke(WANTestBase.class, "waitForSenderRunningState", new Object[] { "ln" }); vm5.invoke(WANTestBase.class, "waitForSenderRunningState", new Object[] { "ln" }); vm6.invoke(WANTestBase.class, "waitForSenderRunningState", new Object[] { "ln" }); vm7.invoke(WANTestBase.class, "waitForSenderRunningState", new Object[] { "ln" }); //pause the senders vm4.invoke(WANTestBase.class, "pauseSender", new Object[] { "ln" }); vm5.invoke(WANTestBase.class, "pauseSender", new Object[] { "ln" }); vm6.invoke(WANTestBase.class, "pauseSender", new Object[] { "ln" }); vm7.invoke(WANTestBase.class, "pauseSender", new Object[] { "ln" }); //start puts in region on local site vm4.invoke(WANTestBase.class, "doPuts", new Object[] { testName, 3000 }); getLogWriter().info("Completed puts in the region"); //--------------------close and rebuild local site ------------------------------------------------- //kill the senders vm4.invoke(WANTestBase.class, "killSender", new Object[] {}); vm5.invoke(WANTestBase.class, "killSender", new Object[] {}); vm6.invoke(WANTestBase.class, "killSender", new Object[] {}); vm7.invoke(WANTestBase.class, "killSender", new Object[] {}); getLogWriter().info("Killed all the senders."); //restart the vm vm4.invoke(WANTestBase.class, "createCache", new Object[] { lnPort }); vm5.invoke(WANTestBase.class, "createCache", new Object[] { lnPort }); vm6.invoke(WANTestBase.class, "createCache", new Object[] { lnPort }); vm7.invoke(WANTestBase.class, "createCache", new Object[] { lnPort }); getLogWriter().info("Created back the cache"); //create senders with disk store vm4.invoke(WANTestBase.class, "createSenderWithDiskStore", new Object[] { "ln", 2, true, 100, 10, false, true, null, diskStore1, true }); vm5.invoke(WANTestBase.class, "createSenderWithDiskStore", new Object[] { "ln", 2, true, 100, 10, false, true, null, diskStore2, true }); vm6.invoke(WANTestBase.class, "createSenderWithDiskStore", new Object[] { "ln", 2, true, 100, 10, false, true, null, diskStore3, true }); vm7.invoke(WANTestBase.class, "createSenderWithDiskStore", new Object[] { "ln", 2, true, 100, 10, false, true, null, diskStore4, true }); getLogWriter().info("Created the senders back from the disk store."); //create PR on local site AsyncInvocation inv1 = vm4.invokeAsync(WANTestBase.class, "createPartitionedRegion", new Object[] { testName, "ln", 1, 100, isOffHeap() }); AsyncInvocation inv2 = vm5.invokeAsync(WANTestBase.class, "createPartitionedRegion", new Object[] { testName, "ln", 1, 100, isOffHeap() }); AsyncInvocation inv3 = vm6.invokeAsync(WANTestBase.class, "createPartitionedRegion", new Object[] { testName, "ln", 1, 100, isOffHeap() }); AsyncInvocation inv4 = vm7.invokeAsync(WANTestBase.class, "createPartitionedRegion", new Object[] { testName, "ln", 1, 100, isOffHeap() }); try { inv1.join(); inv2.join(); inv3.join(); inv4.join(); } catch (InterruptedException e) { e.printStackTrace(); fail(); } getLogWriter().info("Created back the partitioned regions"); //start the senders in async mode. This will ensure that the //node of shadow PR that went down last will come up first vm4.invokeAsync(WANTestBase.class, "startSender", new Object[] { "ln" }); vm5.invokeAsync(WANTestBase.class, "startSender", new Object[] { "ln" }); vm6.invokeAsync(WANTestBase.class, "startSender", new Object[] { "ln" }); vm7.invokeAsync(WANTestBase.class, "startSender", new Object[] { "ln" }); getLogWriter().info("Waiting for senders running."); //wait for senders running vm4.invoke(WANTestBase.class, "waitForSenderRunningState", new Object[] { "ln" }); vm5.invoke(WANTestBase.class, "waitForSenderRunningState", new Object[] { "ln" }); vm6.invoke(WANTestBase.class, "waitForSenderRunningState", new Object[] { "ln" }); vm7.invoke(WANTestBase.class, "waitForSenderRunningState", new Object[] { "ln" }); getLogWriter().info("All the senders are now running..."); //---------------------------------------------------------------------------------------------------- vm2.invoke(WANTestBase.class, "validateRegionSize", new Object[] { testName, 3000 }); vm3.invoke(WANTestBase.class, "validateRegionSize", new Object[] { testName, 3000 }); }
void function() { Integer lnPort = (Integer)vm0.invoke(WANTestBase.class, STR, new Object[] { 1 }); Integer nyPort = (Integer)vm1.invoke(WANTestBase.class, STR, new Object[] { 2, lnPort }); vm2.invoke(WANTestBase.class, STR, new Object[] { nyPort }); vm3.invoke(WANTestBase.class, STR, new Object[] { nyPort }); vm4.invoke(WANTestBase.class, STR, new Object[] { lnPort }); vm5.invoke(WANTestBase.class, STR, new Object[] { lnPort }); vm6.invoke(WANTestBase.class, STR, new Object[] { lnPort }); vm7.invoke(WANTestBase.class, STR, new Object[] { lnPort }); String diskStore1 = (String) vm4.invoke(WANTestBase.class, STR, new Object[] { "ln", 2, true, 100, 10, false, true, null, null, true }); String diskStore2 = (String) vm5.invoke(WANTestBase.class, STR, new Object[] { "ln", 2, true, 100, 10, false, true, null, null, true }); String diskStore3 = (String) vm6.invoke(WANTestBase.class, STR, new Object[] { "ln", 2, true, 100, 10, false, true, null, null, true }); String diskStore4 = (String) vm7.invoke(WANTestBase.class, STR, new Object[] { "ln", 2, true, 100, 10, false, true, null, null, true }); getLogWriter().info(STR + diskStore1 + "," + diskStore2 + "," + diskStore3 + "," + diskStore4); vm2.invoke(WANTestBase.class, STR, new Object[] { testName, null, 1, 100, isOffHeap() }); vm3.invoke(WANTestBase.class, STR, new Object[] { testName, null, 1, 100, isOffHeap() }); vm4.invoke(WANTestBase.class, STR, new Object[] { testName, "ln", 1, 100, isOffHeap() }); vm5.invoke(WANTestBase.class, STR, new Object[] { testName, "ln", 1, 100, isOffHeap() }); vm6.invoke(WANTestBase.class, STR, new Object[] { testName, "ln", 1, 100, isOffHeap() }); vm7.invoke(WANTestBase.class, STR, new Object[] { testName, "ln", 1, 100, isOffHeap() }); vm4.invoke(WANTestBase.class, STR, new Object[] { "ln" }); vm5.invoke(WANTestBase.class, STR, new Object[] { "ln" }); vm6.invoke(WANTestBase.class, STR, new Object[] { "ln" }); vm7.invoke(WANTestBase.class, STR, new Object[] { "ln" }); vm4.invoke(WANTestBase.class, STR, new Object[] { "ln" }); vm5.invoke(WANTestBase.class, STR, new Object[] { "ln" }); vm6.invoke(WANTestBase.class, STR, new Object[] { "ln" }); vm7.invoke(WANTestBase.class, STR, new Object[] { "ln" }); vm4.invoke(WANTestBase.class, STR, new Object[] { "ln" }); vm5.invoke(WANTestBase.class, STR, new Object[] { "ln" }); vm6.invoke(WANTestBase.class, STR, new Object[] { "ln" }); vm7.invoke(WANTestBase.class, STR, new Object[] { "ln" }); vm4.invoke(WANTestBase.class, STR, new Object[] { testName, 3000 }); getLogWriter().info(STR); vm4.invoke(WANTestBase.class, STR, new Object[] {}); vm5.invoke(WANTestBase.class, STR, new Object[] {}); vm6.invoke(WANTestBase.class, STR, new Object[] {}); vm7.invoke(WANTestBase.class, STR, new Object[] {}); getLogWriter().info(STR); vm4.invoke(WANTestBase.class, STR, new Object[] { lnPort }); vm5.invoke(WANTestBase.class, STR, new Object[] { lnPort }); vm6.invoke(WANTestBase.class, STR, new Object[] { lnPort }); vm7.invoke(WANTestBase.class, STR, new Object[] { lnPort }); getLogWriter().info(STR); vm4.invoke(WANTestBase.class, STR, new Object[] { "ln", 2, true, 100, 10, false, true, null, diskStore1, true }); vm5.invoke(WANTestBase.class, STR, new Object[] { "ln", 2, true, 100, 10, false, true, null, diskStore2, true }); vm6.invoke(WANTestBase.class, STR, new Object[] { "ln", 2, true, 100, 10, false, true, null, diskStore3, true }); vm7.invoke(WANTestBase.class, STR, new Object[] { "ln", 2, true, 100, 10, false, true, null, diskStore4, true }); getLogWriter().info(STR); AsyncInvocation inv1 = vm4.invokeAsync(WANTestBase.class, STR, new Object[] { testName, "ln", 1, 100, isOffHeap() }); AsyncInvocation inv2 = vm5.invokeAsync(WANTestBase.class, STR, new Object[] { testName, "ln", 1, 100, isOffHeap() }); AsyncInvocation inv3 = vm6.invokeAsync(WANTestBase.class, STR, new Object[] { testName, "ln", 1, 100, isOffHeap() }); AsyncInvocation inv4 = vm7.invokeAsync(WANTestBase.class, STR, new Object[] { testName, "ln", 1, 100, isOffHeap() }); try { inv1.join(); inv2.join(); inv3.join(); inv4.join(); } catch (InterruptedException e) { e.printStackTrace(); fail(); } getLogWriter().info(STR); vm4.invokeAsync(WANTestBase.class, STR, new Object[] { "ln" }); vm5.invokeAsync(WANTestBase.class, STR, new Object[] { "ln" }); vm6.invokeAsync(WANTestBase.class, STR, new Object[] { "ln" }); vm7.invokeAsync(WANTestBase.class, STR, new Object[] { "ln" }); getLogWriter().info(STR); vm4.invoke(WANTestBase.class, STR, new Object[] { "ln" }); vm5.invoke(WANTestBase.class, STR, new Object[] { "ln" }); vm6.invoke(WANTestBase.class, STR, new Object[] { "ln" }); vm7.invoke(WANTestBase.class, STR, new Object[] { "ln" }); getLogWriter().info(STR); vm2.invoke(WANTestBase.class, STR, new Object[] { testName, 3000 }); vm3.invoke(WANTestBase.class, STR, new Object[] { testName, 3000 }); }
/** * Enable persistence for GatewaySender. * Pause the sender and do some puts in local region. * Close the local site and rebuild the region and sender from disk store. * Dispatcher should not start dispatching events recovered from persistent sender. * Check if the remote site receives all the events. */
Enable persistence for GatewaySender. Pause the sender and do some puts in local region. Close the local site and rebuild the region and sender from disk store. Dispatcher should not start dispatching events recovered from persistent sender. Check if the remote site receives all the events
testPRWithGatewaySenderPersistenceEnabled_Restart
{ "repo_name": "papicella/snappy-store", "path": "tests/core/src/main/java/com/gemstone/gemfire/internal/cache/wan/parallel/ParallelWANPersistenceEnabledGatewaySenderDUnitTest.java", "license": "apache-2.0", "size": 91990 }
[ "com.gemstone.gemfire.internal.cache.wan.WANTestBase" ]
import com.gemstone.gemfire.internal.cache.wan.WANTestBase;
import com.gemstone.gemfire.internal.cache.wan.*;
[ "com.gemstone.gemfire" ]
com.gemstone.gemfire;
96,066
public Scan setFilter(Filter filter) { this.filter = filter; return this; }
Scan function(Filter filter) { this.filter = filter; return this; }
/** * Apply the specified server-side filter when performing the Scan. * @param filter filter to run on the server * @return this */
Apply the specified server-side filter when performing the Scan
setFilter
{ "repo_name": "Shmuma/hbase-trunk", "path": "src/main/java/org/apache/hadoop/hbase/client/Scan.java", "license": "apache-2.0", "size": 20442 }
[ "org.apache.hadoop.hbase.filter.Filter" ]
import org.apache.hadoop.hbase.filter.Filter;
import org.apache.hadoop.hbase.filter.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
551,992
public ResourceReference getWicketAjaxDebugReference() { return wicketAjaxDebugReference; }
ResourceReference function() { return wicketAjaxDebugReference; }
/** * The Wicket Ajax Debug Window. * * @return the reference to the implementation of wicket-ajax-debug.js */
The Wicket Ajax Debug Window
getWicketAjaxDebugReference
{ "repo_name": "klopfdreh/wicket", "path": "wicket-core/src/main/java/org/apache/wicket/settings/JavaScriptLibrarySettings.java", "license": "apache-2.0", "size": 4677 }
[ "org.apache.wicket.request.resource.ResourceReference" ]
import org.apache.wicket.request.resource.ResourceReference;
import org.apache.wicket.request.resource.*;
[ "org.apache.wicket" ]
org.apache.wicket;
1,351,314
@Override public void addAnnotation(XYAnnotation annotation) { // defer argument checking addAnnotation(annotation, Layer.FOREGROUND); }
void function(XYAnnotation annotation) { addAnnotation(annotation, Layer.FOREGROUND); }
/** * Adds an annotation and sends a {@link RendererChangeEvent} to all * registered listeners. The annotation is added to the foreground * layer. * * @param annotation the annotation (<code>null</code> not permitted). */
Adds an annotation and sends a <code>RendererChangeEvent</code> to all registered listeners. The annotation is added to the foreground layer
addAnnotation
{ "repo_name": "Mr-Steve/LTSpice_Library_Manager", "path": "libs/jfreechart-1.0.16/source/org/jfree/chart/renderer/xy/AbstractXYItemRenderer.java", "license": "gpl-2.0", "size": 74604 }
[ "org.jfree.chart.annotations.XYAnnotation", "org.jfree.ui.Layer" ]
import org.jfree.chart.annotations.XYAnnotation; import org.jfree.ui.Layer;
import org.jfree.chart.annotations.*; import org.jfree.ui.*;
[ "org.jfree.chart", "org.jfree.ui" ]
org.jfree.chart; org.jfree.ui;
564,999
public SingleLogoutService getSingleLogoutService(final String binding) { return getSingleLogoutServices().stream().filter(acs -> acs.getBinding().equalsIgnoreCase(binding)).findFirst().orElse(null); }
SingleLogoutService function(final String binding) { return getSingleLogoutServices().stream().filter(acs -> acs.getBinding().equalsIgnoreCase(binding)).findFirst().orElse(null); }
/** * Gets single logout service for the requested binding. * * @param binding the binding * @return the single logout service or null */
Gets single logout service for the requested binding
getSingleLogoutService
{ "repo_name": "fogbeam/cas_mirror", "path": "support/cas-server-support-saml-idp-core/src/main/java/org/apereo/cas/support/saml/services/idp/metadata/SamlRegisteredServiceServiceProviderMetadataFacade.java", "license": "apache-2.0", "size": 13726 }
[ "org.opensaml.saml.saml2.metadata.SingleLogoutService" ]
import org.opensaml.saml.saml2.metadata.SingleLogoutService;
import org.opensaml.saml.saml2.metadata.*;
[ "org.opensaml.saml" ]
org.opensaml.saml;
597,691
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); }
void function(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); }
/** * Handles the HTTP <code>POST</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */
Handles the HTTP <code>POST</code> method
doPost
{ "repo_name": "Beroean/SQL_WEB_SERVLET", "path": "Holds/src/java/holds/Search.java", "license": "mit", "size": 6275 }
[ "java.io.IOException", "javax.servlet.ServletException", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse" ]
import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;
import java.io.*; import javax.servlet.*; import javax.servlet.http.*;
[ "java.io", "javax.servlet" ]
java.io; javax.servlet;
2,703,115
@Override public Iterator<BirthmarkSet> iterator(){ return birthmarkSets(ExtractionTarget.TARGET_BOTH); }
Iterator<BirthmarkSet> function(){ return birthmarkSets(ExtractionTarget.TARGET_BOTH); }
/** * returns an iterator. * <code>birthmarkSets(ExtractionTarget.TARGET_BOTH)</code> */
returns an iterator. <code>birthmarkSets(ExtractionTarget.TARGET_BOTH)</code>
iterator
{ "repo_name": "tamada/stigmata", "path": "src/main/java/com/github/stigmata/result/AbstractExtractionResultSet.java", "license": "apache-2.0", "size": 6069 }
[ "com.github.stigmata.BirthmarkSet", "com.github.stigmata.ExtractionTarget", "java.util.Iterator" ]
import com.github.stigmata.BirthmarkSet; import com.github.stigmata.ExtractionTarget; import java.util.Iterator;
import com.github.stigmata.*; import java.util.*;
[ "com.github.stigmata", "java.util" ]
com.github.stigmata; java.util;
1,361,648
public void setGridBandsVisible(boolean flag) { if (this.gridBandsVisible != flag) { this.gridBandsVisible = flag; notifyListeners(new AxisChangeEvent(this)); } }
void function(boolean flag) { if (this.gridBandsVisible != flag) { this.gridBandsVisible = flag; notifyListeners(new AxisChangeEvent(this)); } }
/** * Sets the visibility of the grid bands and notifies registered * listeners that the axis has been modified. * * @param flag the new setting. * * @see #isGridBandsVisible() */
Sets the visibility of the grid bands and notifies registered listeners that the axis has been modified
setGridBandsVisible
{ "repo_name": "linuxuser586/jfreechart", "path": "source/org/jfree/chart/axis/SymbolAxis.java", "license": "lgpl-2.1", "size": 31029 }
[ "org.jfree.chart.event.AxisChangeEvent" ]
import org.jfree.chart.event.AxisChangeEvent;
import org.jfree.chart.event.*;
[ "org.jfree.chart" ]
org.jfree.chart;
1,336,130
EDataType getMTinkerforgeDevice();
EDataType getMTinkerforgeDevice();
/** * Returns the meta object for data type '{@link com.tinkerforge.Device <em>MTinkerforge Device</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for data type '<em>MTinkerforge Device</em>'. * @see com.tinkerforge.Device * @model instanceClass="com.tinkerforge.Device" * @generated */
Returns the meta object for data type '<code>com.tinkerforge.Device MTinkerforge Device</code>'.
getMTinkerforgeDevice
{ "repo_name": "gregfinley/openhab", "path": "bundles/binding/org.openhab.binding.tinkerforge/src/main/java/org/openhab/binding/tinkerforge/internal/model/ModelPackage.java", "license": "epl-1.0", "size": 665067 }
[ "org.eclipse.emf.ecore.EDataType" ]
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
64,186
Collection<FilenameFilter> filters = create(type, ListHelper.of(patterns)); return filters == null ? null : filters.toArray(new FilenameFilter[0]); }
Collection<FilenameFilter> filters = create(type, ListHelper.of(patterns)); return filters == null ? null : filters.toArray(new FilenameFilter[0]); }
/** * Creates a list of FilenameFilters given a list of patterns. * * @param type The type of pattern provided. * @param patterns A list of patterns to be used as FilenameFilter objects. * @return A list of FilenameFilter objects using the given patterns. */
Creates a list of FilenameFilters given a list of patterns
create
{ "repo_name": "Permafrost/Tundra.java", "path": "src/main/java/permafrost/tundra/io/filter/FilenameFilterHelper.java", "license": "mit", "size": 4582 }
[ "java.io.FilenameFilter", "java.util.Collection" ]
import java.io.FilenameFilter; import java.util.Collection;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
1,462,503
public int getVersion(InetAddressAndPort endpoint) { Integer v = versions.get(endpoint); if (v == null) { // we don't know the version. assume current. we'll know soon enough if that was incorrect. logger.trace("Assuming current protocol version for {}", endpoint); return MessagingService.current_version; } else return Math.min(v, MessagingService.current_version); }
int function(InetAddressAndPort endpoint) { Integer v = versions.get(endpoint); if (v == null) { logger.trace(STR, endpoint); return MessagingService.current_version; } else return Math.min(v, MessagingService.current_version); }
/** * Returns the messaging-version as announced by the given node but capped * to the min of the version as announced by the node and {@link #current_version}. */
Returns the messaging-version as announced by the given node but capped to the min of the version as announced by the node and <code>#current_version</code>
getVersion
{ "repo_name": "aureagle/cassandra", "path": "src/java/org/apache/cassandra/net/MessagingService.java", "license": "apache-2.0", "size": 67044 }
[ "org.apache.cassandra.locator.InetAddressAndPort" ]
import org.apache.cassandra.locator.InetAddressAndPort;
import org.apache.cassandra.locator.*;
[ "org.apache.cassandra" ]
org.apache.cassandra;
1,940,482
ComponentSelectionRules getComponentSelection(); /** * The componentSelection block provides rules to filter or blacklist certain components from appearing in the resolution result. * * @param action Action to be applied to the {@link ComponentSelectionRules}
ComponentSelectionRules getComponentSelection(); /** * The componentSelection block provides rules to filter or blacklist certain components from appearing in the resolution result. * * @param action Action to be applied to the {@link ComponentSelectionRules}
/** * Returns the currently configured version selection rules object. * * @return the version selection rules * @since 2.2 */
Returns the currently configured version selection rules object
getComponentSelection
{ "repo_name": "robinverduijn/gradle", "path": "subprojects/core-api/src/main/java/org/gradle/api/artifacts/ResolutionStrategy.java", "license": "apache-2.0", "size": 13309 }
[ "org.gradle.api.Action" ]
import org.gradle.api.Action;
import org.gradle.api.*;
[ "org.gradle.api" ]
org.gradle.api;
859,662
public static final Behavior getBehaviorByName(final String calledThis, final boolean exact) { if(calledThis==null) return null; Behavior B=null; for(final Enumeration<Behavior> e=behaviors();e.hasMoreElements();) { B=e.nextElement(); if(B.name().equalsIgnoreCase(calledThis)) return (Behavior)B.copyOf(); } if(exact) return null; for(final Enumeration<Behavior> e=behaviors();e.hasMoreElements();) { B=e.nextElement(); if(CMLib.english().containsString(B.name(),calledThis)) return (Behavior)B.copyOf(); } return null; }
static final Behavior function(final String calledThis, final boolean exact) { if(calledThis==null) return null; Behavior B=null; for(final Enumeration<Behavior> e=behaviors();e.hasMoreElements();) { B=e.nextElement(); if(B.name().equalsIgnoreCase(calledThis)) return (Behavior)B.copyOf(); } if(exact) return null; for(final Enumeration<Behavior> e=behaviors();e.hasMoreElements();) { B=e.nextElement(); if(CMLib.english().containsString(B.name(),calledThis)) return (Behavior)B.copyOf(); } return null; }
/** * Searches for a Behavior object using the given search term and filters. * This "finder" matches the name only, no ID. * @param calledThis the search term to use * @param exact true for whole string match, false otherwise * @return the first behavior found matching the search term */
Searches for a Behavior object using the given search term and filters. This "finder" matches the name only, no ID
getBehaviorByName
{ "repo_name": "ConsecroMUD/ConsecroMUD", "path": "com/suscipio_solutions/consecro_mud/core/CMClass.java", "license": "apache-2.0", "size": 105821 }
[ "com.suscipio_solutions.consecro_mud.Behaviors", "java.util.Enumeration" ]
import com.suscipio_solutions.consecro_mud.Behaviors; import java.util.Enumeration;
import com.suscipio_solutions.consecro_mud.*; import java.util.*;
[ "com.suscipio_solutions.consecro_mud", "java.util" ]
com.suscipio_solutions.consecro_mud; java.util;
250,944
public void runAlgorithm(String input, String output, int minAUtility) throws IOException { // reset maximum maxMemory =0; startTimestamp = System.currentTimeMillis(); writer = new BufferedWriter(new FileWriter(output)); // We create a map to store the TWU of each item mapItemToAUUB = new HashMap<Integer, Integer>(); // We scan the database a first time to calculate the TWU of each item. BufferedReader myInput = null; String thisLine; try { // prepare the object for reading the file myInput = new BufferedReader(new InputStreamReader( new FileInputStream(new File(input)))); // for each line (transaction) until the end of file while ((thisLine = myInput.readLine()) != null) { // if the line is a comment, is empty or is a // kind of metadata if (thisLine.isEmpty() == true || thisLine.charAt(0) == '#' || thisLine.charAt(0) == '%' || thisLine.charAt(0) == '@') { continue; } // split the transaction according to the : separator String split[] = thisLine.split(":"); // the first part is the list of items String items[] = split[0].split(" "); String utilityValues[] = split[2].split(" "); // find the transaction max utility Integer transactionMUtility = Integer.MIN_VALUE; for(int i = 0; i < utilityValues.length; i++){ if(transactionMUtility < Integer.parseInt(utilityValues[i])){ transactionMUtility = Integer.parseInt(utilityValues[i]); } } // for each item, we add the transaction utility to its AUUB for(int i=0; i <items.length; i++){ // convert item to integer Integer item = Integer.parseInt(items[i]); // get the current AUUB of that item Integer auub = mapItemToAUUB.get(item); // add the utility of the item in the current transaction to its AUUB auub = (auub == null)? transactionMUtility : auub + transactionMUtility; mapItemToAUUB.put(item, auub); } } } catch (Exception e) { // catches exception if error while reading the input file e.printStackTrace(); }finally { if(myInput != null){ myInput.close(); } } // CREATE A LIST TO STORE THE UTILITY LIST OF ITEMS WITH TWU >= MIN_UTILITY. List<Integer> ltemLists = new ArrayList<Integer>(); // CREATE A MAP TO STORE THE UTILITY LIST FOR EACH ITEM. // For each item for(Integer item: mapItemToAUUB.keySet()){ // if the item is promising (AUUB >= minAutility) if(mapItemToAUUB.get(item) >= minAUtility){ // create an empty Utility List that we will fill later. ltemLists.add(item); } }
void function(String input, String output, int minAUtility) throws IOException { maxMemory =0; startTimestamp = System.currentTimeMillis(); writer = new BufferedWriter(new FileWriter(output)); mapItemToAUUB = new HashMap<Integer, Integer>(); BufferedReader myInput = null; String thisLine; try { myInput = new BufferedReader(new InputStreamReader( new FileInputStream(new File(input)))); while ((thisLine = myInput.readLine()) != null) { if (thisLine.isEmpty() == true thisLine.charAt(0) == '#' thisLine.charAt(0) == '%' thisLine.charAt(0) == '@') { continue; } String split[] = thisLine.split(":"); String items[] = split[0].split(" "); String utilityValues[] = split[2].split(" "); Integer transactionMUtility = Integer.MIN_VALUE; for(int i = 0; i < utilityValues.length; i++){ if(transactionMUtility < Integer.parseInt(utilityValues[i])){ transactionMUtility = Integer.parseInt(utilityValues[i]); } } for(int i=0; i <items.length; i++){ Integer item = Integer.parseInt(items[i]); Integer auub = mapItemToAUUB.get(item); auub = (auub == null)? transactionMUtility : auub + transactionMUtility; mapItemToAUUB.put(item, auub); } } } catch (Exception e) { e.printStackTrace(); }finally { if(myInput != null){ myInput.close(); } } List<Integer> ltemLists = new ArrayList<Integer>(); for(Integer item: mapItemToAUUB.keySet()){ if(mapItemToAUUB.get(item) >= minAUtility){ ltemLists.add(item); } }
/** * Run the algorithm * @param input the input file path * @param output the output file path * @param minAUtility the minimum utility threshold * @throws IOException exception if error while writing the file */
Run the algorithm
runAlgorithm
{ "repo_name": "qualitified/qualitified-crm", "path": "qualitified-crm-core/src/main/java/ca/pfv/spmf/algorithms/frequentpatterns/haui_miner/AlgoHAUIMiner.java", "license": "gpl-3.0", "size": 18040 }
[ "java.io.BufferedReader", "java.io.BufferedWriter", "java.io.File", "java.io.FileInputStream", "java.io.FileWriter", "java.io.IOException", "java.io.InputStreamReader", "java.util.ArrayList", "java.util.HashMap", "java.util.List" ]
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; import java.io.FileWriter; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.HashMap; import java.util.List;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
2,462,033
public void format(ContentCollection x, Reference ref, HttpServletRequest req, HttpServletResponse res, ResourceLoader rb, ContentHostingService contentHostingService) { // do not allow directory listings for /attachments and its subfolders if (contentHostingService.isAttachmentResource(x.getId())) { try { res.sendError(HttpServletResponse.SC_NOT_FOUND); return; } catch ( IOException e ) { return; } } PrintWriter out = null; // don't set the writer until we verify that // getallresources is going to work. boolean printedHeader = false; boolean printedDiv = false; try { res.setContentType("text/html; charset=UTF-8"); out = res.getWriter(); ResourceProperties pl = x.getProperties(); String webappRoot = serverConfigurationService.getServerUrl(); String skinRepo = serverConfigurationService.getString("skin.repo", "/library/skin"); String siteId = null; String[] parts= StringUtils.split(x.getId(), Entity.SEPARATOR); // Is this a site folder (Resources or Dropbox)? If so, get the site skin if (x.getId().startsWith(ContentHostingService.COLLECTION_SITE) || x.getId().startsWith(ContentHostingService.COLLECTION_DROPBOX)) { if (parts.length > 1) { siteId = parts[1]; } } String skinName = siteService.getSiteSkin(siteId); // Output the headers out.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">"); out.println("<html><head>"); out.println("<title>" + rb.getFormattedMessage("colformat.pagetitle", new Object[]{ formattedText.escapeHtml(pl.getProperty(ResourceProperties.PROP_DISPLAY_NAME))}) + "</title>"); out.println("<link href=\"" + webappRoot + skinRepo+ "/" + skinName + "/access.css\" type=\"text/css\" rel=\"stylesheet\" media=\"screen\">"); out.println("<script src=\"" + webappRoot + "/library/js/jquery.js\" type=\"text/javascript\">"); out.println("</script>"); out.println("</head><body class=\"specialLink\">"); out.println("<script type=\"text/javascript\" src=\"/library/js/access.js\"></script>"); out.println("<div class=\"directoryIndex\">"); // for content listing it's best to use a real title out.println("<h3>" + formattedText.escapeHtml(pl.getProperty(ResourceProperties.PROP_DISPLAY_NAME)) + "</h3>"); out.println("<p id=\"toggle\"><a id=\"toggler\" href=\"#\">" + rb.getString("colformat.showhide") + "</a></p>"); String folderdesc = pl.getProperty(ResourceProperties.PROP_DESCRIPTION); if (folderdesc != null && !folderdesc.equals("")) out.println("<div class=\"textPanel\">" + folderdesc + "</div>"); out.println("<ul>"); out.println("<li style=\"display:none\">"); out.println("</li>"); printedHeader = true; printedDiv = true; if (parts.length > 2) { // go up a level out.println("<li class=\"upfolder\"><a href=\"../\"><img src=\"/library/image/sakai/folder-up.gif\" alt=\"" + rb.getString("colformat.uplevel.alttext") + "\"/>" + rb.getString("colformat.uplevel") + "</a></li>"); } // Sort the collection items List<ContentEntity> members = x.getMemberResources(); boolean hasCustomSort = false; try { hasCustomSort = x.getProperties().getBooleanProperty(ResourceProperties.PROP_HAS_CUSTOM_SORT); } catch (Exception e) { // use false that's already there } if (hasCustomSort) Collections.sort(members, new ContentHostingComparator(ResourceProperties.PROP_CONTENT_PRIORITY, true)); else Collections.sort(members, new ContentHostingComparator(ResourceProperties.PROP_DISPLAY_NAME, true)); // Iterate through content items URI baseUri = new URI(x.getUrl()); for (ContentEntity content : members) { ResourceProperties properties = content.getProperties(); boolean isCollection = content.isCollection(); String xs = content.getId(); String contentUrl = content.getUrl(); // These both perform the same check in the implementation but we should observe the API. // This also checks to see if a resource is hidden or time limited. if ( isCollection) { if (!contentHostingService.allowGetCollection(xs)) { continue; } } else { if (!contentHostingService.allowGetResource(xs)) { continue; } } if (isCollection) { xs = xs.substring(0, xs.length() - 1); xs = xs.substring(xs.lastIndexOf('/') + 1) + '/'; } else { xs = xs.substring(xs.lastIndexOf('/') + 1); } try { // Relativize the URL (canonical item URL relative to canonical collection URL). // Inter alias this will preserve alternate access paths via aliases, e.g. /web/ URI contentUri = new URI(contentUrl); URI relativeUri = baseUri.relativize(contentUri); contentUrl = relativeUri.toString(); if (isCollection) { // Folder String desc = properties.getProperty(ResourceProperties.PROP_DESCRIPTION); if (desc == null) desc = ""; else desc = "<div class=\"textPanel\">" + desc + "</div>"; out.println("<li class=\"folder\"><a href=\"" + contentUrl + "\">" + formattedText.escapeHtml(properties.getProperty(ResourceProperties.PROP_DISPLAY_NAME)) + "</a>" + desc + "</li>"); } else { // File String desc = properties.getProperty(ResourceProperties.PROP_DESCRIPTION); if (desc == null) desc = ""; else desc = "<div class=\"textPanel\">" + formattedText.escapeHtml(desc) + "</div>"; String resourceType = content.getResourceType().replace('.', '_'); out.println("<li class=\"file\"><a href=\"" + contentUrl + "\" target=_blank class=\"" + resourceType+"\">" + formattedText.escapeHtml(properties.getProperty(ResourceProperties.PROP_DISPLAY_NAME)) + "</a>" + desc + "</li>"); } } catch (Exception e) { M_log.info("Problem rendering item falling back to default rendering: "+ x.getId()+ ", "+ e.getMessage()); out.println("<li class=\"file\"><a href=\"" + contentUrl + "\" target=_blank>" + formattedText.escapeHtml(xs) + "</a></li>"); } } } catch (Exception e) { M_log.warn("Problem formatting HTML for collection: "+ x.getId(), e); } if (out != null && printedHeader) { out.println("</ul>"); if (printedDiv) out.println("</div>"); out.println("</body></html>"); } }
void function(ContentCollection x, Reference ref, HttpServletRequest req, HttpServletResponse res, ResourceLoader rb, ContentHostingService contentHostingService) { if (contentHostingService.isAttachmentResource(x.getId())) { try { res.sendError(HttpServletResponse.SC_NOT_FOUND); return; } catch ( IOException e ) { return; } } PrintWriter out = null; boolean printedHeader = false; boolean printedDiv = false; try { res.setContentType(STR); out = res.getWriter(); ResourceProperties pl = x.getProperties(); String webappRoot = serverConfigurationService.getServerUrl(); String skinRepo = serverConfigurationService.getString(STR, STR); String siteId = null; String[] parts= StringUtils.split(x.getId(), Entity.SEPARATOR); if (x.getId().startsWith(ContentHostingService.COLLECTION_SITE) x.getId().startsWith(ContentHostingService.COLLECTION_DROPBOX)) { if (parts.length > 1) { siteId = parts[1]; } } String skinName = siteService.getSiteSkin(siteId); out.println(STR- out.println(STR); out.println(STR + rb.getFormattedMessage(STR, new Object[]{ formattedText.escapeHtml(pl.getProperty(ResourceProperties.PROP_DISPLAY_NAME))}) + STR); out.println(STRSTR/STR/access.css\STRtext/css\STRstylesheet\STRscreen\">"); out.println(STRSTR/library/js/jquery.js\STRtext/javascript\">"); out.println(STR); out.println(STRspecialLink\">"); out.println(STRtext/javascript\STR/library/js/access.js\STR); out.println(STRdirectoryIndex\">STR<h3>" + formattedText.escapeHtml(pl.getProperty(ResourceProperties.PROP_DISPLAY_NAME)) + "</h3>"); out.println(STRtoggle\STRtoggler\STR#\">" + rb.getString(STR) + STR); String folderdesc = pl.getProperty(ResourceProperties.PROP_DESCRIPTION); if (folderdesc != null && !folderdesc.equals("")) out.println(STRtextPanel\">STR</div>STR<ul>STR<li style=\STR>STR</li>STR<li class=\STR><a href=\"../\"><img src=\STR alt=\STRcolformat.uplevel.alttextSTR\"/>" + rb.getString("colformat.uplevelSTR</a></li>"); } List<ContentEntity> members = x.getMemberResources(); boolean hasCustomSort = false; try { hasCustomSort = x.getProperties().getBooleanProperty(ResourceProperties.PROP_HAS_CUSTOM_SORT); } catch (Exception e) { } if (hasCustomSort) Collections.sort(members, new ContentHostingComparator(ResourceProperties.PROP_CONTENT_PRIORITY, true)); else Collections.sort(members, new ContentHostingComparator(ResourceProperties.PROP_DISPLAY_NAME, true)); URI baseUri = new URI(x.getUrl()); for (ContentEntity content : members) { ResourceProperties properties = content.getProperties(); boolean isCollection = content.isCollection(); String xs = content.getId(); String contentUrl = content.getUrl(); if ( isCollection) { if (!contentHostingService.allowGetCollection(xs)) { continue; } } else { if (!contentHostingService.allowGetResource(xs)) { continue; } } if (isCollection) { xs = xs.substring(0, xs.length() - 1); xs = xs.substring(xs.lastIndexOf('/') + 1) + '/'; } else { xs = xs.substring(xs.lastIndexOf('/') + 1); } try { URI contentUri = new URI(contentUrl); URI relativeUri = baseUri.relativize(contentUri); contentUrl = relativeUri.toString(); if (isCollection) { String desc = properties.getProperty(ResourceProperties.PROP_DESCRIPTION); if (desc == null) desc = ""; else desc = STRtextPanel\">STR</div>STR<li class=\STR><a href=\STR\">" + formattedText.escapeHtml(properties.getProperty(ResourceProperties.PROP_DISPLAY_NAME)) + "</a>STR</li>"); } else { String desc = properties.getProperty(ResourceProperties.PROP_DESCRIPTION); if (desc == null) desc = ""; else desc = STRtextPanel\">STR</div>STR<li class=\"file\"><a href=\STR\STRSTR\">" + formattedText.escapeHtml(properties.getProperty(ResourceProperties.PROP_DISPLAY_NAME)) + "</a>STR</li>"); } } catch (Exception e) { M_log.info(STR+ x.getId()+ STR+ e.getMessage()); out.println(STRfile\"><a href=\STR\STR + formattedText.escapeHtml(xs) + STR); } } } catch (Exception e) { M_log.warn(STR+ x.getId(), e); } if (out != null && printedHeader) { out.println("</ul>"); if (printedDiv) out.println("</div>STR</body></html>"); } }
/** * Format the collection as an HTML display. * Ths ContentHostingService is passed in here to handle the cyclic dependency between the BaseContentService * and this class. */
Format the collection as an HTML display. Ths ContentHostingService is passed in here to handle the cyclic dependency between the BaseContentService and this class
format
{ "repo_name": "marktriggs/nyu-sakai-10.4", "path": "kernel/kernel-impl/src/main/java/org/sakaiproject/content/impl/CollectionAccessFormatter.java", "license": "apache-2.0", "size": 9304 }
[ "java.io.IOException", "java.io.PrintWriter", "java.util.Collections", "java.util.List", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse", "org.apache.commons.lang.StringUtils", "org.sakaiproject.content.api.ContentCollection", "org.sakaiproject.content.api.ContentEntity", "org.sakaiproject.content.api.ContentHostingService", "org.sakaiproject.entity.api.Entity", "org.sakaiproject.entity.api.Reference", "org.sakaiproject.entity.api.ResourceProperties", "org.sakaiproject.util.ResourceLoader" ]
import java.io.IOException; import java.io.PrintWriter; import java.util.Collections; import java.util.List; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang.StringUtils; import org.sakaiproject.content.api.ContentCollection; import org.sakaiproject.content.api.ContentEntity; import org.sakaiproject.content.api.ContentHostingService; import org.sakaiproject.entity.api.Entity; import org.sakaiproject.entity.api.Reference; import org.sakaiproject.entity.api.ResourceProperties; import org.sakaiproject.util.ResourceLoader;
import java.io.*; import java.util.*; import javax.servlet.http.*; import org.apache.commons.lang.*; import org.sakaiproject.content.api.*; import org.sakaiproject.entity.api.*; import org.sakaiproject.util.*;
[ "java.io", "java.util", "javax.servlet", "org.apache.commons", "org.sakaiproject.content", "org.sakaiproject.entity", "org.sakaiproject.util" ]
java.io; java.util; javax.servlet; org.apache.commons; org.sakaiproject.content; org.sakaiproject.entity; org.sakaiproject.util;
1,441,978
public RouteDefinition routePolicy(RoutePolicy... policies) { if (routePolicies == null) { routePolicies = new ArrayList<>(); } routePolicies.addAll(Arrays.asList(policies)); return this; }
RouteDefinition function(RoutePolicy... policies) { if (routePolicies == null) { routePolicies = new ArrayList<>(); } routePolicies.addAll(Arrays.asList(policies)); return this; }
/** * Configures route policies for this route * * @param policies the route policies * @return the builder */
Configures route policies for this route
routePolicy
{ "repo_name": "CodeSmell/camel", "path": "core/camel-core-engine/src/main/java/org/apache/camel/model/RouteDefinition.java", "license": "apache-2.0", "size": 29555 }
[ "java.util.ArrayList", "java.util.Arrays", "org.apache.camel.spi.RoutePolicy" ]
import java.util.ArrayList; import java.util.Arrays; import org.apache.camel.spi.RoutePolicy;
import java.util.*; import org.apache.camel.spi.*;
[ "java.util", "org.apache.camel" ]
java.util; org.apache.camel;
1,680,000
private static List<String> getKeys(String keys) { keys = keys.replace("\\s", ""); return Arrays.asList(TOKEN_SEPARATOR.split(keys)); }
static List<String> function(String keys) { keys = keys.replace("\\s", ""); return Arrays.asList(TOKEN_SEPARATOR.split(keys)); }
/** * Method to get keys as list * * @param keys keys string * @return keys as list */
Method to get keys as list
getKeys
{ "repo_name": "Venom590/gradoop", "path": "gradoop-examples/src/main/java/org/gradoop/benchmark/grouping/GroupingBenchmark.java", "license": "gpl-3.0", "size": 16007 }
[ "java.util.Arrays", "java.util.List" ]
import java.util.Arrays; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,544,931
static <K, V> TerminalEntry<K, V> entryOf(K key, V value) { checkEntryNotNull(key, value); return new TerminalEntry<K, V>(key, value); }
static <K, V> TerminalEntry<K, V> entryOf(K key, V value) { checkEntryNotNull(key, value); return new TerminalEntry<K, V>(key, value); }
/** * Verifies that {@code key} and {@code value} are non-null, and returns a new * immutable entry with those values. * * <p>A call to {@link Map.Entry#setValue} on the returned entry will always * throw {@link UnsupportedOperationException}. */
Verifies that key and value are non-null, and returns a new immutable entry with those values. A call to <code>Map.Entry#setValue</code> on the returned entry will always throw <code>UnsupportedOperationException</code>
entryOf
{ "repo_name": "mariusj/org.openntf.domino", "path": "domino/externals/guava/src/main/java/com/google/common/collect/ImmutableMap.java", "license": "apache-2.0", "size": 18909 }
[ "com.google.common.collect.CollectPreconditions", "com.google.common.collect.ImmutableMapEntry" ]
import com.google.common.collect.CollectPreconditions; import com.google.common.collect.ImmutableMapEntry;
import com.google.common.collect.*;
[ "com.google.common" ]
com.google.common;
1,883,570
public boolean delete(String src, boolean recursive) throws IOException { if ((!recursive) && (!dir.isDirEmpty(src))) { throw new IOException(src + " is non empty"); } boolean status = deleteInternal(src, true); getEditLog().logSync(); if (status && auditLog.isInfoEnabled() && isExternalInvocation()) { logAuditEvent(UserGroupInformation.getCurrentUser(), Server.getRemoteIp(), "delete", src, null, null); } return status; }
boolean function(String src, boolean recursive) throws IOException { if ((!recursive) && (!dir.isDirEmpty(src))) { throw new IOException(src + STR); } boolean status = deleteInternal(src, true); getEditLog().logSync(); if (status && auditLog.isInfoEnabled() && isExternalInvocation()) { logAuditEvent(UserGroupInformation.getCurrentUser(), Server.getRemoteIp(), STR, src, null, null); } return status; }
/** * Remove the indicated filename from namespace. If the filename * is a directory (non empty) and recursive is set to false then throw exception. */
Remove the indicated filename from namespace. If the filename is a directory (non empty) and recursive is set to false then throw exception
delete
{ "repo_name": "davidl1/hortonworks-extension", "path": "src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java", "license": "apache-2.0", "size": 218585 }
[ "java.io.IOException", "org.apache.hadoop.ipc.Server", "org.apache.hadoop.security.UserGroupInformation" ]
import java.io.IOException; import org.apache.hadoop.ipc.Server; import org.apache.hadoop.security.UserGroupInformation;
import java.io.*; import org.apache.hadoop.ipc.*; import org.apache.hadoop.security.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
1,232,241
public static Builder star() { return new Builder().star(); } public static class Builder { private static final double DEFAULT_FILLING_FACTOR = 0.4; private static final double DEFAULT_LOADING_FACTOR = 0.7; private Optional<Integer> maxChildren = Optional.empty(); private Optional<Integer> minChildren = Optional.empty(); private Splitter splitter = new SplitterQuadratic(); private Selector selector = new SelectorMinimalAreaIncrease(); private double loadingFactor; private boolean star = false; private Factory<Object, Geometry> factory = Factories.defaultFactory(); private Builder() { loadingFactor = DEFAULT_LOADING_FACTOR; }
static Builder function() { return new Builder().star(); } static class Builder { private static final double DEFAULT_FILLING_FACTOR = 0.4; private static final double DEFAULT_LOADING_FACTOR = 0.7; private Optional<Integer> maxChildren = Optional.empty(); private Optional<Integer> minChildren = Optional.empty(); private Splitter splitter = new SplitterQuadratic(); private Selector selector = new SelectorMinimalAreaIncrease(); private double loadingFactor; private boolean function = false; private Factory<Object, Geometry> factory = Factories.defaultFactory(); private Builder() { loadingFactor = DEFAULT_LOADING_FACTOR; }
/** * Sets the splitter to {@link SplitterRStar} and selector to * {@link SelectorRStar} and defaults to minChildren=10. * * @return builder */
Sets the splitter to <code>SplitterRStar</code> and selector to <code>SelectorRStar</code> and defaults to minChildren=10
star
{ "repo_name": "davidmoten/rtree", "path": "src/main/java/com/github/davidmoten/rtree/RTree.java", "license": "apache-2.0", "size": 34613 }
[ "com.github.davidmoten.rtree.geometry.Geometry", "java.util.Optional" ]
import com.github.davidmoten.rtree.geometry.Geometry; import java.util.Optional;
import com.github.davidmoten.rtree.geometry.*; import java.util.*;
[ "com.github.davidmoten", "java.util" ]
com.github.davidmoten; java.util;
1,286,881
private Path findJar(String location) { Path path; if (location.startsWith("file:")) path = Vfs.lookup(location); else if (location.startsWith("/")) path = _resourceManager.resolvePath("." + location); else path = _resourceManager.resolvePath(location); if (path.exists()) return path; DynamicClassLoader loader; loader = (DynamicClassLoader) Thread.currentThread().getContextClassLoader(); String classPath = loader.getClassPath(); char sep = CauchoSystem.getPathSeparatorChar(); int head = 0; int tail = 0; while ((tail = classPath.indexOf(sep, head)) >= 0) { String sub = classPath.substring(head, tail); path = Vfs.lookup(sub); if (sub.endsWith(location) && path.exists()) return path; head = tail + 1; } if (classPath.length() <= head) return null; String sub = classPath.substring(head); path = Vfs.lookup(sub); if (sub.endsWith(location) && path.exists()) return path; else return null; }
Path function(String location) { Path path; if (location.startsWith("file:")) path = Vfs.lookup(location); else if (location.startsWith("/")) path = _resourceManager.resolvePath("." + location); else path = _resourceManager.resolvePath(location); if (path.exists()) return path; DynamicClassLoader loader; loader = (DynamicClassLoader) Thread.currentThread().getContextClassLoader(); String classPath = loader.getClassPath(); char sep = CauchoSystem.getPathSeparatorChar(); int head = 0; int tail = 0; while ((tail = classPath.indexOf(sep, head)) >= 0) { String sub = classPath.substring(head, tail); path = Vfs.lookup(sub); if (sub.endsWith(location) && path.exists()) return path; head = tail + 1; } if (classPath.length() <= head) return null; String sub = classPath.substring(head); path = Vfs.lookup(sub); if (sub.endsWith(location) && path.exists()) return path; else return null; }
/** * Finds the path to the jar specified by the location. * * @param appDir the webApp directory * @param location the tag-location specified in the web.xml * * @return the found jar or null */
Finds the path to the jar specified by the location
findJar
{ "repo_name": "mdaniel/svn-caucho-com-resin", "path": "modules/resin/src/com/caucho/jsp/TaglibManager.java", "license": "gpl-2.0", "size": 8259 }
[ "com.caucho.loader.DynamicClassLoader", "com.caucho.server.util.CauchoSystem", "com.caucho.vfs.Path", "com.caucho.vfs.Vfs" ]
import com.caucho.loader.DynamicClassLoader; import com.caucho.server.util.CauchoSystem; import com.caucho.vfs.Path; import com.caucho.vfs.Vfs;
import com.caucho.loader.*; import com.caucho.server.util.*; import com.caucho.vfs.*;
[ "com.caucho.loader", "com.caucho.server", "com.caucho.vfs" ]
com.caucho.loader; com.caucho.server; com.caucho.vfs;
2,307,898
private static synchronized void initCerts() { if (CA1 != null) { return; } try { CA1 = TestKeyStore.getClient().getRootCertificate("RSA"); CA2 = TestKeyStore.getClientCA2().getRootCertificate("RSA"); PRIVATE = TestKeyStore.getServer().getPrivateKey("RSA", "RSA"); CHAIN = (X509Certificate[]) PRIVATE.getCertificateChain(); CA3_WITH_CA1_SUBJECT = new TestKeyStore.Builder() .aliasPrefix("unused") .subject(CA1.getSubjectX500Principal()) .ca(true) .build().getRootCertificate("RSA"); ALIAS_SYSTEM_CA1 = alias(false, CA1, 0); ALIAS_SYSTEM_CA2 = alias(false, CA2, 0); ALIAS_USER_CA1 = alias(true, CA1, 0); ALIAS_USER_CA2 = alias(true, CA2, 0); ALIAS_SYSTEM_CHAIN0 = alias(false, getChain()[0], 0); ALIAS_SYSTEM_CHAIN1 = alias(false, getChain()[1], 0); ALIAS_SYSTEM_CHAIN2 = alias(false, getChain()[2], 0); ALIAS_USER_CHAIN0 = alias(true, getChain()[0], 0); ALIAS_USER_CHAIN1 = alias(true, getChain()[1], 0); ALIAS_USER_CHAIN2 = alias(true, getChain()[2], 0); ALIAS_SYSTEM_CA3 = alias(false, CA3_WITH_CA1_SUBJECT, 0); ALIAS_SYSTEM_CA3_COLLISION = alias(false, CA3_WITH_CA1_SUBJECT, 1); ALIAS_USER_CA3 = alias(true, CA3_WITH_CA1_SUBJECT, 0); ALIAS_USER_CA3_COLLISION = alias(true, CA3_WITH_CA1_SUBJECT, 1); } catch (Exception e) { throw new RuntimeException(e); } } private TrustedCertificateStore store;
static synchronized void function() { if (CA1 != null) { return; } try { CA1 = TestKeyStore.getClient().getRootCertificate("RSA"); CA2 = TestKeyStore.getClientCA2().getRootCertificate("RSA"); PRIVATE = TestKeyStore.getServer().getPrivateKey("RSA", "RSA"); CHAIN = (X509Certificate[]) PRIVATE.getCertificateChain(); CA3_WITH_CA1_SUBJECT = new TestKeyStore.Builder() .aliasPrefix(STR) .subject(CA1.getSubjectX500Principal()) .ca(true) .build().getRootCertificate("RSA"); ALIAS_SYSTEM_CA1 = alias(false, CA1, 0); ALIAS_SYSTEM_CA2 = alias(false, CA2, 0); ALIAS_USER_CA1 = alias(true, CA1, 0); ALIAS_USER_CA2 = alias(true, CA2, 0); ALIAS_SYSTEM_CHAIN0 = alias(false, getChain()[0], 0); ALIAS_SYSTEM_CHAIN1 = alias(false, getChain()[1], 0); ALIAS_SYSTEM_CHAIN2 = alias(false, getChain()[2], 0); ALIAS_USER_CHAIN0 = alias(true, getChain()[0], 0); ALIAS_USER_CHAIN1 = alias(true, getChain()[1], 0); ALIAS_USER_CHAIN2 = alias(true, getChain()[2], 0); ALIAS_SYSTEM_CA3 = alias(false, CA3_WITH_CA1_SUBJECT, 0); ALIAS_SYSTEM_CA3_COLLISION = alias(false, CA3_WITH_CA1_SUBJECT, 1); ALIAS_USER_CA3 = alias(true, CA3_WITH_CA1_SUBJECT, 0); ALIAS_USER_CA3_COLLISION = alias(true, CA3_WITH_CA1_SUBJECT, 1); } catch (Exception e) { throw new RuntimeException(e); } } private TrustedCertificateStore store;
/** * Lazily create shared test certificates. */
Lazily create shared test certificates
initCerts
{ "repo_name": "rex-xxx/mt6572_x201", "path": "libcore/luni/src/test/java/org/apache/harmony/xnet/provider/jsse/TrustedCertificateStoreTest.java", "license": "gpl-2.0", "size": 22825 }
[ "java.security.cert.X509Certificate" ]
import java.security.cert.X509Certificate;
import java.security.cert.*;
[ "java.security" ]
java.security;
119,717
void updateExternalStats(final String reason, final int updateFlags) { synchronized (mExternalStatsLock) { if (mContext == null) { // We haven't started yet (which means the BatteryStatsImpl object has // no power profile. Don't consume data we can't compute yet. return; } if (BatteryStatsImpl.DEBUG_ENERGY) { Slog.d(TAG, "Updating external stats: reason=" + reason); } WifiActivityEnergyInfo wifiEnergyInfo = null; if ((updateFlags & UPDATE_WIFI) != 0) { wifiEnergyInfo = pullWifiEnergyInfoLocked(); } BluetoothActivityEnergyInfo bluetoothEnergyInfo = null; if ((updateFlags & UPDATE_BT) != 0) { // We only pull bluetooth stats when we have to, as we are not distributing its // use amongst apps and the sampling frequency does not matter. bluetoothEnergyInfo = pullBluetoothEnergyInfoLocked(); } synchronized (mStats) { final long elapsedRealtime = SystemClock.elapsedRealtime(); final long uptime = SystemClock.uptimeMillis(); if (mStats.mRecordAllHistory) { mStats.addHistoryEventLocked(elapsedRealtime, uptime, BatteryStats.HistoryItem.EVENT_COLLECT_EXTERNAL_STATS, reason, 0); } if ((updateFlags & UPDATE_CPU) != 0) { mStats.updateCpuTimeLocked(); mStats.updateKernelWakelocksLocked(); } if ((updateFlags & UPDATE_RADIO) != 0) { mStats.updateMobileRadioStateLocked(elapsedRealtime); } if ((updateFlags & UPDATE_WIFI) != 0) { mStats.updateWifiStateLocked(wifiEnergyInfo); } if ((updateFlags & UPDATE_BT) != 0) { mStats.updateBluetoothStateLocked(bluetoothEnergyInfo); } } } }
void updateExternalStats(final String reason, final int updateFlags) { synchronized (mExternalStatsLock) { if (mContext == null) { return; } if (BatteryStatsImpl.DEBUG_ENERGY) { Slog.d(TAG, STR + reason); } WifiActivityEnergyInfo wifiEnergyInfo = null; if ((updateFlags & UPDATE_WIFI) != 0) { wifiEnergyInfo = pullWifiEnergyInfoLocked(); } BluetoothActivityEnergyInfo bluetoothEnergyInfo = null; if ((updateFlags & UPDATE_BT) != 0) { bluetoothEnergyInfo = pullBluetoothEnergyInfoLocked(); } synchronized (mStats) { final long elapsedRealtime = SystemClock.elapsedRealtime(); final long uptime = SystemClock.uptimeMillis(); if (mStats.mRecordAllHistory) { mStats.addHistoryEventLocked(elapsedRealtime, uptime, BatteryStats.HistoryItem.EVENT_COLLECT_EXTERNAL_STATS, reason, 0); } if ((updateFlags & UPDATE_CPU) != 0) { mStats.updateCpuTimeLocked(); mStats.updateKernelWakelocksLocked(); } if ((updateFlags & UPDATE_RADIO) != 0) { mStats.updateMobileRadioStateLocked(elapsedRealtime); } if ((updateFlags & UPDATE_WIFI) != 0) { mStats.updateWifiStateLocked(wifiEnergyInfo); } if ((updateFlags & UPDATE_BT) != 0) { mStats.updateBluetoothStateLocked(bluetoothEnergyInfo); } } } }
/** * Fetches data from external sources (WiFi controller, bluetooth chipset) and updates * batterystats with that information. * * We first grab a lock specific to this method, then once all the data has been collected, * we grab the mStats lock and update the data. * * @param reason The reason why this collection was requested. Useful for debugging. * @param updateFlags Which external stats to update. Can be a combination of * {@link #UPDATE_CPU}, {@link #UPDATE_RADIO}, {@link #UPDATE_WIFI}, * and {@link #UPDATE_BT}. */
Fetches data from external sources (WiFi controller, bluetooth chipset) and updates batterystats with that information. We first grab a lock specific to this method, then once all the data has been collected, we grab the mStats lock and update the data
updateExternalStats
{ "repo_name": "syslover33/ctank", "path": "java/android-sdk-linux_r24.4.1_src/sources/android-23/com/android/server/am/BatteryStatsService.java", "license": "gpl-3.0", "size": 50552 }
[ "android.bluetooth.BluetoothActivityEnergyInfo", "android.net.wifi.WifiActivityEnergyInfo", "android.os.BatteryStats", "android.os.SystemClock", "android.util.Slog", "com.android.internal.os.BatteryStatsImpl" ]
import android.bluetooth.BluetoothActivityEnergyInfo; import android.net.wifi.WifiActivityEnergyInfo; import android.os.BatteryStats; import android.os.SystemClock; import android.util.Slog; import com.android.internal.os.BatteryStatsImpl;
import android.bluetooth.*; import android.net.wifi.*; import android.os.*; import android.util.*; import com.android.internal.os.*;
[ "android.bluetooth", "android.net", "android.os", "android.util", "com.android.internal" ]
android.bluetooth; android.net; android.os; android.util; com.android.internal;
1,789,841
@SuppressWarnings("rawtypes") public static Collection<Code> getAllCodes() { List<Map> rawCodes = (List<Map>) immunizationSchedule.values() .stream().map(m -> (Map)m.get("code")).collect(Collectors.toList()); List<Code> convertedCodes = new ArrayList<Code>(rawCodes.size()); for (Map m : rawCodes) { Code immCode = new Code(m.get("system").toString(), m.get("code").toString(), m.get("display").toString()); convertedCodes.add(immCode); } return convertedCodes; }
@SuppressWarnings(STR) static Collection<Code> function() { List<Map> rawCodes = (List<Map>) immunizationSchedule.values() .stream().map(m -> (Map)m.get("code")).collect(Collectors.toList()); List<Code> convertedCodes = new ArrayList<Code>(rawCodes.size()); for (Map m : rawCodes) { Code immCode = new Code(m.get(STR).toString(), m.get("code").toString(), m.get(STR).toString()); convertedCodes.add(immCode); } return convertedCodes; }
/** * Get all of the Codes this module uses, for inventory purposes. * * @return Collection of all codes and concepts this module uses */
Get all of the Codes this module uses, for inventory purposes
getAllCodes
{ "repo_name": "cjduffett/synthea", "path": "src/main/java/org/mitre/synthea/modules/Immunizations.java", "license": "apache-2.0", "size": 6425 }
[ "java.util.ArrayList", "java.util.Collection", "java.util.List", "java.util.Map", "java.util.stream.Collectors", "org.mitre.synthea.world.concepts.HealthRecord" ]
import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Map; import java.util.stream.Collectors; import org.mitre.synthea.world.concepts.HealthRecord;
import java.util.*; import java.util.stream.*; import org.mitre.synthea.world.concepts.*;
[ "java.util", "org.mitre.synthea" ]
java.util; org.mitre.synthea;
1,432,335
@SideOnly(Side.CLIENT) public float getSwingProgress(float partialTickTime) { float f = this.swingProgress - this.prevSwingProgress; if (f < 0.0F) { ++f; } return this.prevSwingProgress + f * partialTickTime; }
@SideOnly(Side.CLIENT) float function(float partialTickTime) { float f = this.swingProgress - this.prevSwingProgress; if (f < 0.0F) { ++f; } return this.prevSwingProgress + f * partialTickTime; }
/** * Returns where in the swing animation the living entity is (from 0 to 1). Args: partialTickTime */
Returns where in the swing animation the living entity is (from 0 to 1). Args: partialTickTime
getSwingProgress
{ "repo_name": "tomtomtom09/CampCraft", "path": "build/tmp/recompileMc/sources/net/minecraft/entity/EntityLivingBase.java", "license": "gpl-3.0", "size": 75711 }
[ "net.minecraftforge.fml.relauncher.Side", "net.minecraftforge.fml.relauncher.SideOnly" ]
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.fml.relauncher.*;
[ "net.minecraftforge.fml" ]
net.minecraftforge.fml;
1,826,092
@ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable<MicrosoftGraphDirectoryRoleInner> listDirectoryRole();
@ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable<MicrosoftGraphDirectoryRoleInner> listDirectoryRole();
/** * Get entities from directoryRoles. * * @throws com.azure.resourcemanager.authorization.fluent.models.OdataErrorMainException thrown if the request is * rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return entities from directoryRoles. */
Get entities from directoryRoles
listDirectoryRole
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-authorization/src/main/java/com/azure/resourcemanager/authorization/fluent/DirectoryRolesDirectoryRolesClient.java", "license": "mit", "size": 17367 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.PagedIterable", "com.azure.resourcemanager.authorization.fluent.models.MicrosoftGraphDirectoryRoleInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedIterable; import com.azure.resourcemanager.authorization.fluent.models.MicrosoftGraphDirectoryRoleInner;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.resourcemanager.authorization.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
2,844,534
private static Function<List<RelNode>, RelNode> createFactoryFor( BiFunction<List<RelNode>, Boolean, RelNode> setOperationFactory, Type type) { return (List<RelNode> inputs) -> createRel(setOperationFactory, type == Type.ALL, inputs); } SetOperationScanConverter(ConversionContext context) { super(context); }
static Function<List<RelNode>, RelNode> function( BiFunction<List<RelNode>, Boolean, RelNode> setOperationFactory, Type type) { return (List<RelNode> inputs) -> createRel(setOperationFactory, type == Type.ALL, inputs); } SetOperationScanConverter(ConversionContext context) { super(context); }
/** * A little closure to wrap the invocation of the factory method (e.g. LogicalUnion::create) for * the set operation node. */
A little closure to wrap the invocation of the factory method (e.g. LogicalUnion::create) for the set operation node
createFactoryFor
{ "repo_name": "markflyhigh/incubator-beam", "path": "sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/zetasql/translation/SetOperationScanConverter.java", "license": "apache-2.0", "size": 5273 }
[ "java.util.List", "java.util.function.BiFunction", "java.util.function.Function", "org.apache.calcite.rel.RelNode" ]
import java.util.List; import java.util.function.BiFunction; import java.util.function.Function; import org.apache.calcite.rel.RelNode;
import java.util.*; import java.util.function.*; import org.apache.calcite.rel.*;
[ "java.util", "org.apache.calcite" ]
java.util; org.apache.calcite;
1,035,429
public Endpoints secondaryEndpoints() { return this.secondaryEndpoints; }
Endpoints function() { return this.secondaryEndpoints; }
/** * Get gets the URLs that are used to perform a retrieval of a public blob, queue, or table object from the secondary location of the storage account. Only available if the SKU name is Standard_RAGRS. * * @return the secondaryEndpoints value */
Get gets the URLs that are used to perform a retrieval of a public blob, queue, or table object from the secondary location of the storage account. Only available if the SKU name is Standard_RAGRS
secondaryEndpoints
{ "repo_name": "navalev/azure-sdk-for-java", "path": "sdk/storage/mgmt-v2019_06_01/src/main/java/com/microsoft/azure/management/storage/v2019_06_01/implementation/StorageAccountInner.java", "license": "mit", "size": 16912 }
[ "com.microsoft.azure.management.storage.v2019_06_01.Endpoints" ]
import com.microsoft.azure.management.storage.v2019_06_01.Endpoints;
import com.microsoft.azure.management.storage.v2019_06_01.*;
[ "com.microsoft.azure" ]
com.microsoft.azure;
1,117,093
private void readObject(ObjectInputStream s) throws ClassNotFoundException, IOException { s.defaultReadObject(); try { toGregorian();// restore transient fields } catch (IllegalArgumentException e) { throw new java.io.IOException("bad serialized BigDate"); } }// end readObject
void function(ObjectInputStream s) throws ClassNotFoundException, IOException { s.defaultReadObject(); try { toGregorian(); } catch (IllegalArgumentException e) { throw new java.io.IOException(STR); } }
/** * read back a serialized BigDate object and reconstruct the missing transient fields. readObject leaves results in * this. It does not create a new object. * * @param s stream to read from. * @throws IOException if can't read object * @throws ClassNotFoundException if unexpected class in the stream. */
read back a serialized BigDate object and reconstruct the missing transient fields. readObject leaves results in this. It does not create a new object
readObject
{ "repo_name": "zeejan/DeckPicker", "path": "src/com/mindprod/common11/BigDate.java", "license": "gpl-3.0", "size": 87496 }
[ "java.io.IOException", "java.io.ObjectInputStream" ]
import java.io.IOException; import java.io.ObjectInputStream;
import java.io.*;
[ "java.io" ]
java.io;
811,347
private static void parseObligationsOrAdvice(Object listObject, StdMutableResult stdMutableResult, boolean isObligation) throws JSONStructureException { String oaTypeName = isObligation ? "Obligations" : "AssociatedAdvice"; if (!(listObject instanceof List)) { throw new JSONStructureException(oaTypeName + " must be list"); } List<?> oaList = (List<?>)listObject; // for each element in list for (Object oa : oaList) { if (!(oa instanceof Map)) { throw new JSONStructureException(oaTypeName + " array items must all be objects"); } Map<?, ?> oaMap = (Map<?, ?>)oa; // get mandatory id Object idObject = oaMap.remove("Id"); if (idObject == null) { throw new JSONStructureException(oaTypeName + " array item must have Id"); } Identifier oaId = new IdentifierImpl(idObject.toString()); // get optional list of AttributeAssignment Object aaListObject = oaMap.remove("AttributeAssignment"); List<AttributeAssignment> attributeAssignmentList = new ArrayList<AttributeAssignment>(); if (aaListObject != null) { if (!(aaListObject instanceof List)) { throw new JSONStructureException("AttributeAssignment must be list in " + oaTypeName); } List<?> attributeAssignmentMapList = (List<?>)aaListObject; // list should contain instances of Maps which translate into AttributeAssignments for (Object aaMapObject : attributeAssignmentMapList) { if (aaMapObject == null || !(aaMapObject instanceof Map)) { throw new JSONStructureException( "AttributeAssignment list item must be non-null object in " + oaTypeName); } Map<?, ?> aaMap = (Map<?, ?>)aaMapObject; StdMutableAttributeAssignment stdMutableAttributeAssignment = new StdMutableAttributeAssignment(); // mandatory Id Object aaIdObject = aaMap.remove("AttributeId"); if (aaIdObject == null) { throw new JSONStructureException( "AttributeAssignment list item missing AttributeId in " + oaTypeName); } stdMutableAttributeAssignment.setAttributeId(new IdentifierImpl(aaIdObject.toString())); // optional Category Object categoryObject = aaMap.remove("Category"); if (categoryObject != null) { stdMutableAttributeAssignment.setCategory(new IdentifierImpl(categoryObject .toString())); } // get the optional DataType so we know what to do with the mandatory value Object dataTypeObject = aaMap.remove("DataType"); Identifier dataTypeId = null; if (dataTypeObject != null) { dataTypeId = shorthandMap.get(dataTypeObject.toString()); // if there was a DataType given it must be a real one if (dataTypeId == null) { throw new JSONStructureException( "AttributeAssignment list item has unknown DataType='" + dataTypeObject.toString() + "' in " + oaTypeName); } } else { // if DataType not given, use String dataTypeId = DataTypes.DT_STRING.getId(); } // mandatory Value Object valueObject = aaMap.remove("Value"); if (valueObject == null) { throw new JSONStructureException("AttributeAssignment list item missing Value in " + oaTypeName); } AttributeValue<?> attributeValue = null; try { DataType<?> dataType = new StdDataTypeFactory().getDataType(dataTypeId); if (dataType == DataTypes.DT_XPATHEXPRESSION) { attributeValue = convertMapToXPathExpression(valueObject); } else { // everything other than XPathExpressions are simple values that the DataTypes // know how to handle attributeValue = dataType.createAttributeValue(valueObject); } } catch (DataTypeException e) { throw new JSONStructureException("AttributeAssignment list item Value='" + valueObject.toString() + "' not of type '" + dataTypeId + "' in " + oaTypeName); } stdMutableAttributeAssignment.setAttributeValue(attributeValue); // optional Issuer Object issuerObject = aaMap.remove("Issuer"); if (issuerObject != null) { stdMutableAttributeAssignment.setIssuer(issuerObject.toString()); } checkUnknown("AttributeAssignment in " + oaTypeName, aaMap); // add to attributeAssignmentList attributeAssignmentList.add(stdMutableAttributeAssignment); } } checkUnknown(oaTypeName + " array item", oaMap); if (isObligation) { Obligation obligation = new StdObligation(oaId, attributeAssignmentList); stdMutableResult.addObligation(obligation); } else { Advice advice = new StdAdvice(oaId, attributeAssignmentList); stdMutableResult.addAdvice(advice); } } }
static void function(Object listObject, StdMutableResult stdMutableResult, boolean isObligation) throws JSONStructureException { String oaTypeName = isObligation ? STR : STR; if (!(listObject instanceof List)) { throw new JSONStructureException(oaTypeName + STR); } List<?> oaList = (List<?>)listObject; for (Object oa : oaList) { if (!(oa instanceof Map)) { throw new JSONStructureException(oaTypeName + STR); } Map<?, ?> oaMap = (Map<?, ?>)oa; Object idObject = oaMap.remove("Id"); if (idObject == null) { throw new JSONStructureException(oaTypeName + STR); } Identifier oaId = new IdentifierImpl(idObject.toString()); Object aaListObject = oaMap.remove(STR); List<AttributeAssignment> attributeAssignmentList = new ArrayList<AttributeAssignment>(); if (aaListObject != null) { if (!(aaListObject instanceof List)) { throw new JSONStructureException(STR + oaTypeName); } List<?> attributeAssignmentMapList = (List<?>)aaListObject; for (Object aaMapObject : attributeAssignmentMapList) { if (aaMapObject == null !(aaMapObject instanceof Map)) { throw new JSONStructureException( STR + oaTypeName); } Map<?, ?> aaMap = (Map<?, ?>)aaMapObject; StdMutableAttributeAssignment stdMutableAttributeAssignment = new StdMutableAttributeAssignment(); Object aaIdObject = aaMap.remove(STR); if (aaIdObject == null) { throw new JSONStructureException( STR + oaTypeName); } stdMutableAttributeAssignment.setAttributeId(new IdentifierImpl(aaIdObject.toString())); Object categoryObject = aaMap.remove(STR); if (categoryObject != null) { stdMutableAttributeAssignment.setCategory(new IdentifierImpl(categoryObject .toString())); } Object dataTypeObject = aaMap.remove(STR); Identifier dataTypeId = null; if (dataTypeObject != null) { dataTypeId = shorthandMap.get(dataTypeObject.toString()); if (dataTypeId == null) { throw new JSONStructureException( STR + dataTypeObject.toString() + STR + oaTypeName); } } else { dataTypeId = DataTypes.DT_STRING.getId(); } Object valueObject = aaMap.remove("Value"); if (valueObject == null) { throw new JSONStructureException(STR + oaTypeName); } AttributeValue<?> attributeValue = null; try { DataType<?> dataType = new StdDataTypeFactory().getDataType(dataTypeId); if (dataType == DataTypes.DT_XPATHEXPRESSION) { attributeValue = convertMapToXPathExpression(valueObject); } else { attributeValue = dataType.createAttributeValue(valueObject); } } catch (DataTypeException e) { throw new JSONStructureException(STR + valueObject.toString() + STR + dataTypeId + STR + oaTypeName); } stdMutableAttributeAssignment.setAttributeValue(attributeValue); Object issuerObject = aaMap.remove(STR); if (issuerObject != null) { stdMutableAttributeAssignment.setIssuer(issuerObject.toString()); } checkUnknown(STR + oaTypeName, aaMap); attributeAssignmentList.add(stdMutableAttributeAssignment); } } checkUnknown(oaTypeName + STR, oaMap); if (isObligation) { Obligation obligation = new StdObligation(oaId, attributeAssignmentList); stdMutableResult.addObligation(obligation); } else { Advice advice = new StdAdvice(oaId, attributeAssignmentList); stdMutableResult.addAdvice(advice); } } }
/** * Parse Obligations or AssociatedAdvice and put them into the Result. This code combines Obligations and * AssociatedAdvice because the operations are identical except for the final steps. * * @param listObject * @param stdMutableResult * @param isObligation * @throws JSONStructureException */
Parse Obligations or AssociatedAdvice and put them into the Result. This code combines Obligations and AssociatedAdvice because the operations are identical except for the final steps
parseObligationsOrAdvice
{ "repo_name": "dash-/apache-openaz", "path": "openaz-xacml/src/main/java/org/apache/openaz/xacml/std/json/JSONResponse.java", "license": "apache-2.0", "size": 96000 }
[ "java.util.ArrayList", "java.util.List", "java.util.Map", "org.apache.openaz.xacml.api.Advice", "org.apache.openaz.xacml.api.AttributeAssignment", "org.apache.openaz.xacml.api.AttributeValue", "org.apache.openaz.xacml.api.DataType", "org.apache.openaz.xacml.api.DataTypeException", "org.apache.openaz.xacml.api.Identifier", "org.apache.openaz.xacml.api.Obligation", "org.apache.openaz.xacml.std.IdentifierImpl", "org.apache.openaz.xacml.std.StdAdvice", "org.apache.openaz.xacml.std.StdDataTypeFactory", "org.apache.openaz.xacml.std.StdMutableAttributeAssignment", "org.apache.openaz.xacml.std.StdMutableResult", "org.apache.openaz.xacml.std.StdObligation", "org.apache.openaz.xacml.std.datatypes.DataTypes" ]
import java.util.ArrayList; import java.util.List; import java.util.Map; import org.apache.openaz.xacml.api.Advice; import org.apache.openaz.xacml.api.AttributeAssignment; import org.apache.openaz.xacml.api.AttributeValue; import org.apache.openaz.xacml.api.DataType; import org.apache.openaz.xacml.api.DataTypeException; import org.apache.openaz.xacml.api.Identifier; import org.apache.openaz.xacml.api.Obligation; import org.apache.openaz.xacml.std.IdentifierImpl; import org.apache.openaz.xacml.std.StdAdvice; import org.apache.openaz.xacml.std.StdDataTypeFactory; import org.apache.openaz.xacml.std.StdMutableAttributeAssignment; import org.apache.openaz.xacml.std.StdMutableResult; import org.apache.openaz.xacml.std.StdObligation; import org.apache.openaz.xacml.std.datatypes.DataTypes;
import java.util.*; import org.apache.openaz.xacml.api.*; import org.apache.openaz.xacml.std.*; import org.apache.openaz.xacml.std.datatypes.*;
[ "java.util", "org.apache.openaz" ]
java.util; org.apache.openaz;
2,489,812
return new TestSuite(DefaultIntervalCategoryDatasetTests.class); } public DefaultIntervalCategoryDatasetTests(String name) { super(name); }
return new TestSuite(DefaultIntervalCategoryDatasetTests.class); } public DefaultIntervalCategoryDatasetTests(String name) { super(name); }
/** * Returns the tests as a test suite. * * @return The test suite. */
Returns the tests as a test suite
suite
{ "repo_name": "JSansalone/JFreeChart", "path": "tests/org/jfree/data/category/junit/DefaultIntervalCategoryDatasetTests.java", "license": "lgpl-2.1", "size": 18040 }
[ "junit.framework.TestSuite" ]
import junit.framework.TestSuite;
import junit.framework.*;
[ "junit.framework" ]
junit.framework;
1,152,320
@Deprecated public static ClassLoader getURLClassLoader(URL urls[], ClassLoader parent) { try { Class<?> urlCL = Class.forName("java.net.URLClassLoader"); Class<?> paramT[] = new Class[2]; paramT[0] = urls.getClass(); paramT[1] = ClassLoader.class; Method m = findMethod(urlCL, "newInstance", paramT); if (m == null) return null; ClassLoader cl = (ClassLoader) m.invoke(urlCL, new Object[] { urls, parent }); return cl; } catch (ClassNotFoundException ex) { // jdk1.1 return null; } catch (Exception ex) { ex.printStackTrace(); return null; } }
static ClassLoader function(URL urls[], ClassLoader parent) { try { Class<?> urlCL = Class.forName(STR); Class<?> paramT[] = new Class[2]; paramT[0] = urls.getClass(); paramT[1] = ClassLoader.class; Method m = findMethod(urlCL, STR, paramT); if (m == null) return null; ClassLoader cl = (ClassLoader) m.invoke(urlCL, new Object[] { urls, parent }); return cl; } catch (ClassNotFoundException ex) { return null; } catch (Exception ex) { ex.printStackTrace(); return null; } }
/** * Construct a URLClassLoader. Will compile and work in JDK1.1 too. * @deprecated Not used */
Construct a URLClassLoader. Will compile and work in JDK1.1 too
getURLClassLoader
{ "repo_name": "mayonghui2112/helloWorld", "path": "sourceCode/apache-tomcat-7.0.82-src/java/org/apache/tomcat/util/IntrospectionUtils.java", "license": "apache-2.0", "size": 35730 }
[ "java.lang.reflect.Method" ]
import java.lang.reflect.Method;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
754,442
public static <K, StateT extends CombiningState<?, ?>, W extends BoundedWindow> void prefetchCombiningValues(MergingStateAccessor<K, W> context, StateTag<? super K, StateT> address) { for (StateT state : context.accessInEachMergingWindow(address).values()) { prefetchRead(state); } }
static <K, StateT extends CombiningState<?, ?>, W extends BoundedWindow> void function(MergingStateAccessor<K, W> context, StateTag<? super K, StateT> address) { for (StateT state : context.accessInEachMergingWindow(address).values()) { prefetchRead(state); } }
/** * Prefetch all combining value state for {@code address} across all merging windows in {@code * context}. */
Prefetch all combining value state for address across all merging windows in context
prefetchCombiningValues
{ "repo_name": "shakamunyi/beam", "path": "sdks/java/core/src/main/java/org/apache/beam/sdk/util/state/StateMerging.java", "license": "apache-2.0", "size": 9230 }
[ "org.apache.beam.sdk.transforms.windowing.BoundedWindow" ]
import org.apache.beam.sdk.transforms.windowing.BoundedWindow;
import org.apache.beam.sdk.transforms.windowing.*;
[ "org.apache.beam" ]
org.apache.beam;
705,565
public static void setPaginationParams(ApplicationListDTO applicationListDTO, String groupId, int limit, int offset, int size) { Map<String, Integer> paginatedParams = RestApiUtil.getPaginationParams(offset, limit, size); String paginatedPrevious = ""; String paginatedNext = ""; if (paginatedParams.get(RestApiConstants.PAGINATION_PREVIOUS_OFFSET) != null) { paginatedPrevious = RestApiUtil .getApplicationPaginatedURL(paginatedParams.get(RestApiConstants.PAGINATION_PREVIOUS_OFFSET), paginatedParams.get(RestApiConstants.PAGINATION_PREVIOUS_LIMIT), groupId); } if (paginatedParams.get(RestApiConstants.PAGINATION_NEXT_OFFSET) != null) { paginatedNext = RestApiUtil .getApplicationPaginatedURL(paginatedParams.get(RestApiConstants.PAGINATION_NEXT_OFFSET), paginatedParams.get(RestApiConstants.PAGINATION_NEXT_LIMIT), groupId); } applicationListDTO.setNext(paginatedNext); applicationListDTO.setPrevious(paginatedPrevious); }
static void function(ApplicationListDTO applicationListDTO, String groupId, int limit, int offset, int size) { Map<String, Integer> paginatedParams = RestApiUtil.getPaginationParams(offset, limit, size); String paginatedPrevious = STR"; if (paginatedParams.get(RestApiConstants.PAGINATION_PREVIOUS_OFFSET) != null) { paginatedPrevious = RestApiUtil .getApplicationPaginatedURL(paginatedParams.get(RestApiConstants.PAGINATION_PREVIOUS_OFFSET), paginatedParams.get(RestApiConstants.PAGINATION_PREVIOUS_LIMIT), groupId); } if (paginatedParams.get(RestApiConstants.PAGINATION_NEXT_OFFSET) != null) { paginatedNext = RestApiUtil .getApplicationPaginatedURL(paginatedParams.get(RestApiConstants.PAGINATION_NEXT_OFFSET), paginatedParams.get(RestApiConstants.PAGINATION_NEXT_LIMIT), groupId); } applicationListDTO.setNext(paginatedNext); applicationListDTO.setPrevious(paginatedPrevious); }
/** Sets pagination urls for a ApplicationListDTO object given pagination parameters and url parameters * * @param applicationListDTO a SubscriptionListDTO object * @param groupId group id of the applications to be returned * @param limit max number of objects returned * @param offset starting index * @param size max offset */
Sets pagination urls for a ApplicationListDTO object given pagination parameters and url parameters
setPaginationParams
{ "repo_name": "bhathiya/test", "path": "components/apimgt/org.wso2.carbon.apimgt.rest.api.store/src/main/java/org/wso2/carbon/apimgt/rest/api/store/utils/mappings/ApplicationMappingUtil.java", "license": "apache-2.0", "size": 6643 }
[ "java.util.Map", "org.wso2.carbon.apimgt.rest.api.store.dto.ApplicationListDTO", "org.wso2.carbon.apimgt.rest.api.util.RestApiConstants", "org.wso2.carbon.apimgt.rest.api.util.utils.RestApiUtil" ]
import java.util.Map; import org.wso2.carbon.apimgt.rest.api.store.dto.ApplicationListDTO; import org.wso2.carbon.apimgt.rest.api.util.RestApiConstants; import org.wso2.carbon.apimgt.rest.api.util.utils.RestApiUtil;
import java.util.*; import org.wso2.carbon.apimgt.rest.api.store.dto.*; import org.wso2.carbon.apimgt.rest.api.util.*; import org.wso2.carbon.apimgt.rest.api.util.utils.*;
[ "java.util", "org.wso2.carbon" ]
java.util; org.wso2.carbon;
78,283
public List<Collection<Pair<String, Double>>> getSentenceFeatures( Map<Integer, TaggedWord> sentence) { return getSentenceFeatures(sentence, false); }
List<Collection<Pair<String, Double>>> function( Map<Integer, TaggedWord> sentence) { return getSentenceFeatures(sentence, false); }
/** * Get a sentence of words' features for applying the tagger (i.e., not * training mode). */
Get a sentence of words' features for applying the tagger (i.e., not training mode)
getSentenceFeatures
{ "repo_name": "DanielCoutoVale/openccg", "path": "src/opennlp/ccg/parse/postagger/ml/POSTagFex.java", "license": "lgpl-2.1", "size": 11627 }
[ "java.util.Collection", "java.util.List", "java.util.Map" ]
import java.util.Collection; import java.util.List; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
181,521
Iterable<? extends EObject> res = null; if (object instanceof EObject) { EObject eObject = (EObject) object; res = SWITCH.doSwitch(eObject); if (res == null) res = DECLARATION_SWITCH.doSwitch(eObject); if (res == null) res = EXPRESSION_SWITCH.doSwitch(eObject); if (res == null) res = STATEMENT_SWITCH.doSwitch(eObject); if (res == null) res = CONFIGURATION_SWITCH.doSwitch(eObject); if (res == null) res = NATURE_SWITCH.doSwitch(eObject); if (res == null) res = TYPE_SWITCH.doSwitch(eObject); if (res == null) res = AMS_SWITCH.doSwitch(eObject); } else { res = Collections.emptyList(); } return res; }
Iterable<? extends EObject> res = null; if (object instanceof EObject) { EObject eObject = (EObject) object; res = SWITCH.doSwitch(eObject); if (res == null) res = DECLARATION_SWITCH.doSwitch(eObject); if (res == null) res = EXPRESSION_SWITCH.doSwitch(eObject); if (res == null) res = STATEMENT_SWITCH.doSwitch(eObject); if (res == null) res = CONFIGURATION_SWITCH.doSwitch(eObject); if (res == null) res = NATURE_SWITCH.doSwitch(eObject); if (res == null) res = TYPE_SWITCH.doSwitch(eObject); if (res == null) res = AMS_SWITCH.doSwitch(eObject); } else { res = Collections.emptyList(); } return res; }
/** * Get children. * * @param object * object to get children for the outline * @return outline children */
Get children
getChildren
{ "repo_name": "mlanoe/x-vhdl", "path": "plugins/net.mlanoe.language.vhdl.xtext.ui/src/net/mlanoe/language/vhdl/xtext/ui/outline/OutlineChildrenGenerator.java", "license": "gpl-3.0", "size": 2852 }
[ "java.util.Collections", "org.eclipse.emf.ecore.EObject" ]
import java.util.Collections; import org.eclipse.emf.ecore.EObject;
import java.util.*; import org.eclipse.emf.ecore.*;
[ "java.util", "org.eclipse.emf" ]
java.util; org.eclipse.emf;
2,175,911
public List<TokenRange> describeLocalRing(String keyspace) throws InvalidRequestException { return describeRing(keyspace, true); }
List<TokenRange> function(String keyspace) throws InvalidRequestException { return describeRing(keyspace, true); }
/** * The same as {@code describeRing(String)} but considers only the part of the ring formed by nodes in the local DC. */
The same as describeRing(String) but considers only the part of the ring formed by nodes in the local DC
describeLocalRing
{ "repo_name": "tjake/cassandra", "path": "src/java/org/apache/cassandra/service/StorageService.java", "license": "apache-2.0", "size": 199183 }
[ "java.util.List", "org.apache.cassandra.exceptions.InvalidRequestException", "org.apache.cassandra.thrift.TokenRange" ]
import java.util.List; import org.apache.cassandra.exceptions.InvalidRequestException; import org.apache.cassandra.thrift.TokenRange;
import java.util.*; import org.apache.cassandra.exceptions.*; import org.apache.cassandra.thrift.*;
[ "java.util", "org.apache.cassandra" ]
java.util; org.apache.cassandra;
736,334
@Message(id = 221, value = "An override model registration is not allowed for non-wildcard model registrations. This registration is for the non-wildcard name '%s'.") IllegalStateException cannotOverrideNonWildCardRegistration(String valueName);
@Message(id = 221, value = STR) IllegalStateException cannotOverrideNonWildCardRegistration(String valueName);
/** * Creates an exception indicating that an attempt was made to register an override model for a non-wildcard * registration. * * @param valueName the name of the non-wildcard registration that cannot be overridden * @return an {@link IllegalStateException} for the error */
Creates an exception indicating that an attempt was made to register an override model for a non-wildcard registration
cannotOverrideNonWildCardRegistration
{ "repo_name": "aloubyansky/wildfly-core", "path": "controller/src/main/java/org/jboss/as/controller/logging/ControllerLogger.java", "license": "lgpl-2.1", "size": 164970 }
[ "org.jboss.logging.annotations.Message" ]
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.*;
[ "org.jboss.logging" ]
org.jboss.logging;
79,194
public MetaProperty<Class<? extends Exception>> causeType() { return causeType; }
MetaProperty<Class<? extends Exception>> function() { return causeType; }
/** * The meta-property for the {@code causeType} property. * @return the meta-property, not null */
The meta-property for the causeType property
causeType
{ "repo_name": "jmptrader/Strata", "path": "modules/collect/src/main/java/com/opengamma/strata/collect/result/FailureItem.java", "license": "apache-2.0", "size": 18392 }
[ "org.joda.beans.MetaProperty" ]
import org.joda.beans.MetaProperty;
import org.joda.beans.*;
[ "org.joda.beans" ]
org.joda.beans;
694,154
public int parseNext() { if (_buffer==null) _buffer=_buffers.getBuffer(); int total_filled=0; int events=0; // Loop until a datagram call back or can't fill anymore while(true) { int available=_buffer.length(); // Fill buffer if we need a byte or need length while (available<(_state==State.SKIP?1:_bytesNeeded)) { // compact to mark (set at start of data) _buffer.compact(); // if no space, then the data is too big for buffer if (_buffer.space() == 0) { // Can we send a fake frame? if (_fakeFragments && _state==State.DATA) { Buffer data =_buffer.get(4*(available/4)); _buffer.compact(); if (_masked) { if (data.array()==null) data=_buffer.asMutableBuffer(); byte[] array = data.array(); final int end=data.putIndex(); for (int i=data.getIndex();i<end;i++) array[i]^=_mask[_m++%4]; } // System.err.printf("%s %s %s >>\n",TypeUtil.toHexString(_flags),TypeUtil.toHexString(_opcode),data.length()); events++; _bytesNeeded-=data.length(); _handler.onFrame((byte)(_flags&(0xff^WebSocketConnectionD08.FLAG_FIN)), _opcode, data); _opcode=WebSocketConnectionD08.OP_CONTINUATION; } if (_buffer.space() == 0) throw new IllegalStateException("FULL: "+_state+" "+_bytesNeeded+">"+_buffer.capacity()); } // catch IOExceptions (probably EOF) and try to parse what we have try { int filled=_endp.isOpen()?_endp.fill(_buffer):-1; if (filled<=0) return (total_filled+events)>0?(total_filled+events):filled; total_filled+=filled; available=_buffer.length(); } catch(IOException e) { LOG.debug(e); return (total_filled+events)>0?(total_filled+events):-1; } } // if we are here, then we have sufficient bytes to process the current state. // Parse the buffer byte by byte (unless it is STATE_DATA) byte b; while (_state!=State.DATA && available>=(_state==State.SKIP?1:_bytesNeeded)) { switch (_state) { case START: _skip=false; _state=State.OPCODE; _bytesNeeded=_state.getNeeds(); continue; case OPCODE: b=_buffer.get(); available--; _opcode=(byte)(b&0xf); _flags=(byte)(0xf&(b>>4)); if (WebSocketConnectionD08.isControlFrame(_opcode)&&!WebSocketConnectionD08.isLastFrame(_flags)) { events++; LOG.warn("Fragmented Control from "+_endp); _handler.close(WebSocketConnectionD08.CLOSE_PROTOCOL,"Fragmented control"); _skip=true; } _state=State.LENGTH_7; _bytesNeeded=_state.getNeeds(); continue; case LENGTH_7: b=_buffer.get(); available--; _masked=(b&0x80)!=0; b=(byte)(0x7f&b); switch(b) { case 0x7f: _length=0; _state=State.LENGTH_63; break; case 0x7e: _length=0; _state=State.LENGTH_16; break; default: _length=(0x7f&b); _state=_masked?State.MASK:State.PAYLOAD; } _bytesNeeded=_state.getNeeds(); continue; case LENGTH_16: b=_buffer.get(); available--; _length = _length*0x100 + (0xff&b); if (--_bytesNeeded==0) { if (_length>_buffer.capacity() && !_fakeFragments) { events++; _handler.close(WebSocketConnectionD08.CLOSE_BADDATA,"frame size "+_length+">"+_buffer.capacity()); _skip=true; } _state=_masked?State.MASK:State.PAYLOAD; _bytesNeeded=_state.getNeeds(); } continue; case LENGTH_63: b=_buffer.get(); available--; _length = _length*0x100 + (0xff&b); if (--_bytesNeeded==0) { _bytesNeeded=(int)_length; if (_length>=_buffer.capacity() && !_fakeFragments) { events++; _handler.close(WebSocketConnectionD08.CLOSE_BADDATA,"frame size "+_length+">"+_buffer.capacity()); _skip=true; } _state=_masked?State.MASK:State.PAYLOAD; _bytesNeeded=_state.getNeeds(); } continue; case MASK: _buffer.get(_mask,0,4); _m=0; available-=4; _state=State.PAYLOAD; _bytesNeeded=_state.getNeeds(); break; case PAYLOAD: _bytesNeeded=(int)_length; _state=_skip?State.SKIP:State.DATA; break; case DATA: break; case SKIP: int skip=Math.min(available,_bytesNeeded); _buffer.skip(skip); available-=skip; _bytesNeeded-=skip; if (_bytesNeeded==0) _state=State.START; } } if (_state==State.DATA && available>=_bytesNeeded) { if ( _masked!=_shouldBeMasked) { _buffer.skip(_bytesNeeded); _state=State.START; events++; _handler.close(WebSocketConnectionD08.CLOSE_PROTOCOL,"bad mask"); } else { Buffer data =_buffer.get(_bytesNeeded); if (_masked) { if (data.array()==null) data=_buffer.asMutableBuffer(); byte[] array = data.array(); final int end=data.putIndex(); for (int i=data.getIndex();i<end;i++) array[i]^=_mask[_m++%4]; } // System.err.printf("%s %s %s >>\n",TypeUtil.toHexString(_flags),TypeUtil.toHexString(_opcode),data.length()); events++; _handler.onFrame(_flags, _opcode, data); _bytesNeeded=0; _state=State.START; } return total_filled+events; } } }
int function() { if (_buffer==null) _buffer=_buffers.getBuffer(); int total_filled=0; int events=0; while(true) { int available=_buffer.length(); while (available<(_state==State.SKIP?1:_bytesNeeded)) { _buffer.compact(); if (_buffer.space() == 0) { if (_fakeFragments && _state==State.DATA) { Buffer data =_buffer.get(4*(available/4)); _buffer.compact(); if (_masked) { if (data.array()==null) data=_buffer.asMutableBuffer(); byte[] array = data.array(); final int end=data.putIndex(); for (int i=data.getIndex();i<end;i++) array[i]^=_mask[_m++%4]; } events++; _bytesNeeded-=data.length(); _handler.onFrame((byte)(_flags&(0xff^WebSocketConnectionD08.FLAG_FIN)), _opcode, data); _opcode=WebSocketConnectionD08.OP_CONTINUATION; } if (_buffer.space() == 0) throw new IllegalStateException(STR+_state+" "+_bytesNeeded+">"+_buffer.capacity()); } try { int filled=_endp.isOpen()?_endp.fill(_buffer):-1; if (filled<=0) return (total_filled+events)>0?(total_filled+events):filled; total_filled+=filled; available=_buffer.length(); } catch(IOException e) { LOG.debug(e); return (total_filled+events)>0?(total_filled+events):-1; } } byte b; while (_state!=State.DATA && available>=(_state==State.SKIP?1:_bytesNeeded)) { switch (_state) { case START: _skip=false; _state=State.OPCODE; _bytesNeeded=_state.getNeeds(); continue; case OPCODE: b=_buffer.get(); available--; _opcode=(byte)(b&0xf); _flags=(byte)(0xf&(b>>4)); if (WebSocketConnectionD08.isControlFrame(_opcode)&&!WebSocketConnectionD08.isLastFrame(_flags)) { events++; LOG.warn(STR+_endp); _handler.close(WebSocketConnectionD08.CLOSE_PROTOCOL,STR); _skip=true; } _state=State.LENGTH_7; _bytesNeeded=_state.getNeeds(); continue; case LENGTH_7: b=_buffer.get(); available--; _masked=(b&0x80)!=0; b=(byte)(0x7f&b); switch(b) { case 0x7f: _length=0; _state=State.LENGTH_63; break; case 0x7e: _length=0; _state=State.LENGTH_16; break; default: _length=(0x7f&b); _state=_masked?State.MASK:State.PAYLOAD; } _bytesNeeded=_state.getNeeds(); continue; case LENGTH_16: b=_buffer.get(); available--; _length = _length*0x100 + (0xff&b); if (--_bytesNeeded==0) { if (_length>_buffer.capacity() && !_fakeFragments) { events++; _handler.close(WebSocketConnectionD08.CLOSE_BADDATA,STR+_length+">"+_buffer.capacity()); _skip=true; } _state=_masked?State.MASK:State.PAYLOAD; _bytesNeeded=_state.getNeeds(); } continue; case LENGTH_63: b=_buffer.get(); available--; _length = _length*0x100 + (0xff&b); if (--_bytesNeeded==0) { _bytesNeeded=(int)_length; if (_length>=_buffer.capacity() && !_fakeFragments) { events++; _handler.close(WebSocketConnectionD08.CLOSE_BADDATA,STR+_length+">"+_buffer.capacity()); _skip=true; } _state=_masked?State.MASK:State.PAYLOAD; _bytesNeeded=_state.getNeeds(); } continue; case MASK: _buffer.get(_mask,0,4); _m=0; available-=4; _state=State.PAYLOAD; _bytesNeeded=_state.getNeeds(); break; case PAYLOAD: _bytesNeeded=(int)_length; _state=_skip?State.SKIP:State.DATA; break; case DATA: break; case SKIP: int skip=Math.min(available,_bytesNeeded); _buffer.skip(skip); available-=skip; _bytesNeeded-=skip; if (_bytesNeeded==0) _state=State.START; } } if (_state==State.DATA && available>=_bytesNeeded) { if ( _masked!=_shouldBeMasked) { _buffer.skip(_bytesNeeded); _state=State.START; events++; _handler.close(WebSocketConnectionD08.CLOSE_PROTOCOL,STR); } else { Buffer data =_buffer.get(_bytesNeeded); if (_masked) { if (data.array()==null) data=_buffer.asMutableBuffer(); byte[] array = data.array(); final int end=data.putIndex(); for (int i=data.getIndex();i<end;i++) array[i]^=_mask[_m++%4]; } events++; _handler.onFrame(_flags, _opcode, data); _bytesNeeded=0; _state=State.START; } return total_filled+events; } } }
/** Parse to next event. * Parse to the next {@link WebSocketParser.FrameHandler} event or until no more data is * available. Fill data from the {@link EndPoint} only as necessary. * @return An indication of progress or otherwise. -1 indicates EOF, 0 indicates * that no bytes were read and no messages parsed. A positive number indicates either * the bytes filled or the messages parsed. */
Parse to next event. Parse to the next <code>WebSocketParser.FrameHandler</code> event or until no more data is available. Fill data from the <code>EndPoint</code> only as necessary
parseNext
{ "repo_name": "jetty-project/jetty-plugin-support", "path": "jetty-websocket/src/main/java/org/eclipse/jetty/websocket/WebSocketParserD08.java", "license": "apache-2.0", "size": 14382 }
[ "java.io.IOException", "org.eclipse.jetty.io.Buffer" ]
import java.io.IOException; import org.eclipse.jetty.io.Buffer;
import java.io.*; import org.eclipse.jetty.io.*;
[ "java.io", "org.eclipse.jetty" ]
java.io; org.eclipse.jetty;
1,716,582
public interface ExprCondition { boolean test(RexNode expr);
interface ExprCondition { boolean function(RexNode expr);
/** * Evaluates a condition for a given expression. * * @param expr Expression * @return result of evaluating the condition */
Evaluates a condition for a given expression
test
{ "repo_name": "joshelser/incubator-calcite", "path": "core/src/main/java/org/apache/calcite/rel/rules/PushProjector.java", "license": "apache-2.0", "size": 26752 }
[ "org.apache.calcite.rex.RexNode" ]
import org.apache.calcite.rex.RexNode;
import org.apache.calcite.rex.*;
[ "org.apache.calcite" ]
org.apache.calcite;
1,383,120
@Auditable(parameters={"targetName"}) public NodeRef transfer(String targetName, TransferDefinition definition) throws TransferException;
@Auditable(parameters={STR}) NodeRef function(String targetName, TransferDefinition definition) throws TransferException;
/** * Transfer nodes, sync. This synchronous version of the transfer method waits for the transfer to complete * before returning to the caller. Callbacks are called in the current thread context, so will be associated with the current * transaction and user. * * @param targetName the name of the target to transfer to * The following properties must be set, nodes * @param definition, the definition of the transfer. Specifies which nodes to transfer. * @throws TransferException * @return the node reference of the transfer report */
Transfer nodes, sync. This synchronous version of the transfer method waits for the transfer to complete before returning to the caller. Callbacks are called in the current thread context, so will be associated with the current transaction and user
transfer
{ "repo_name": "daniel-he/community-edition", "path": "projects/repository/source/java/org/alfresco/service/cmr/transfer/TransferService.java", "license": "lgpl-3.0", "size": 10950 }
[ "org.alfresco.service.Auditable", "org.alfresco.service.cmr.repository.NodeRef" ]
import org.alfresco.service.Auditable; import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.*; import org.alfresco.service.cmr.repository.*;
[ "org.alfresco.service" ]
org.alfresco.service;
1,118,318
private State goTo(State state, Symbol symbol) { HashSet<Item> newItems = new HashSet<>(); for (Item item : state.items){ if(!item.atEnd()) { if (item.getCurrentSymbol().equals(symbol)) { newItems.add( new Item( item.getRule(), item.getPosition() + 1, item.lookahead ) ); } } } return closure(newItems); }
State function(State state, Symbol symbol) { HashSet<Item> newItems = new HashSet<>(); for (Item item : state.items){ if(!item.atEnd()) { if (item.getCurrentSymbol().equals(symbol)) { newItems.add( new Item( item.getRule(), item.getPosition() + 1, item.lookahead ) ); } } } return closure(newItems); }
/** * Given a State and a Symbol move the dot passed the symbol in all the * items in the state * @param state a state * @param symbol a Symbol * @return a state where the dot is moved passed the given symbol. */
Given a State and a Symbol move the dot passed the symbol in all the items in the state
goTo
{ "repo_name": "dittma75/compiler-design", "path": "lr_parser_phase/three_point_one/src/three_point_one/parser/FSM.java", "license": "mit", "size": 8400 }
[ "java.util.HashSet" ]
import java.util.HashSet;
import java.util.*;
[ "java.util" ]
java.util;
2,488,505
public void zoomToPoint( float scale, PointF imagePoint, PointF viewPoint, @LimitFlag int limitFlags, long durationMs, @Nullable Runnable onAnimationComplete) { FLog.v(getLogTag(), "zoomToPoint: duration %d ms", durationMs); calculateZoomToPointTransform( mNewTransform, scale, imagePoint, viewPoint, limitFlags); setTransform(mNewTransform, durationMs, onAnimationComplete); }
void function( float scale, PointF imagePoint, PointF viewPoint, @LimitFlag int limitFlags, long durationMs, @Nullable Runnable onAnimationComplete) { FLog.v(getLogTag(), STR, durationMs); calculateZoomToPointTransform( mNewTransform, scale, imagePoint, viewPoint, limitFlags); setTransform(mNewTransform, durationMs, onAnimationComplete); }
/** * Zooms to the desired scale and positions the image so that the given image point corresponds * to the given view point. * * <p>If this method is called while an animation or gesture is already in progress, * the current animation or gesture will be stopped first. * * @param scale desired scale, will be limited to {min, max} scale factor * @param imagePoint 2D point in image's relative coordinate system (i.e. 0 <= x, y <= 1) * @param viewPoint 2D point in view's absolute coordinate system * @param limitFlags whether to limit translation and/or scale. * @param durationMs length of animation of the zoom, or 0 if no animation desired * @param onAnimationComplete code to run when the animation completes. Ignored if durationMs=0 */
Zooms to the desired scale and positions the image so that the given image point corresponds to the given view point. If this method is called while an animation or gesture is already in progress, the current animation or gesture will be stopped first
zoomToPoint
{ "repo_name": "s1rius/fresco", "path": "samples/zoomable/src/main/java/com/facebook/samples/zoomable/AbstractAnimatedZoomableController.java", "license": "mit", "size": 6232 }
[ "android.graphics.PointF", "com.facebook.common.logging.FLog", "javax.annotation.Nullable" ]
import android.graphics.PointF; import com.facebook.common.logging.FLog; import javax.annotation.Nullable;
import android.graphics.*; import com.facebook.common.logging.*; import javax.annotation.*;
[ "android.graphics", "com.facebook.common", "javax.annotation" ]
android.graphics; com.facebook.common; javax.annotation;
1,997,887
public void generateExaminerPlan() { DataModel master = schedule[0].getTable(); DataModel masterExaminer = schedule[1].createNewTable( (TIME_END - TIME_BEGIN) / 5, examiner.size()+1);; int examinerNo = 1; for(Examiner examiner : this.examiner) { masterExaminer.setValueAt(examiner, 0, examinerNo); for(int row = 0; row < master.getRowCount(); row++) { for(int col = 0; col < master.getColumnCount(); col++) { if(master.getValueAt(row, col) != null && master.getValueAt(row, col).isExam() == true) { Exam exam = (Exam)master.getValueAt(row, col); if(exam.getExaminer()[0].equals(examiner) || exam.getExaminer()[1].equals(examiner)) { masterExaminer.setValueAt(exam, (exam.getStart()/5)+1, examinerNo); } } } } examinerNo++; } schedule[1].setTable(masterExaminer); }
void function() { DataModel master = schedule[0].getTable(); DataModel masterExaminer = schedule[1].createNewTable( (TIME_END - TIME_BEGIN) / 5, examiner.size()+1);; int examinerNo = 1; for(Examiner examiner : this.examiner) { masterExaminer.setValueAt(examiner, 0, examinerNo); for(int row = 0; row < master.getRowCount(); row++) { for(int col = 0; col < master.getColumnCount(); col++) { if(master.getValueAt(row, col) != null && master.getValueAt(row, col).isExam() == true) { Exam exam = (Exam)master.getValueAt(row, col); if(exam.getExaminer()[0].equals(examiner) exam.getExaminer()[1].equals(examiner)) { masterExaminer.setValueAt(exam, (exam.getStart()/5)+1, examinerNo); } } } } examinerNo++; } schedule[1].setTable(masterExaminer); }
/** * Generates a single table with all examiners having their own row. All contents are shifted one down, * so the first row can be the examiner which the column belongs to. */
Generates a single table with all examiners having their own row. All contents are shifted one down, so the first row can be the examiner which the column belongs to
generateExaminerPlan
{ "repo_name": "Toures/LALBaer2015", "path": "src/de/hs_mannheim/IB/SS15/OOT/Backend.java", "license": "mit", "size": 25159 }
[ "de.hs_mannheim.IB" ]
import de.hs_mannheim.IB;
import de.hs_mannheim.*;
[ "de.hs_mannheim" ]
de.hs_mannheim;
2,305,949
public Queue<Object> inboundMessages() { return inboundMessages; } /** * @deprecated use {@link #inboundMessages()}
Queue<Object> function() { return inboundMessages; } /** * @deprecated use {@link #inboundMessages()}
/** * Returns the {@link Queue} which holds all the {@link Object}s that were received by this {@link Channel}. */
Returns the <code>Queue</code> which holds all the <code>Object</code>s that were received by this <code>Channel</code>
inboundMessages
{ "repo_name": "rocketballs/netty", "path": "transport/src/main/java/io/netty/channel/embedded/EmbeddedChannel.java", "license": "apache-2.0", "size": 10032 }
[ "java.util.Queue" ]
import java.util.Queue;
import java.util.*;
[ "java.util" ]
java.util;
1,884,505
@ServiceMethod(returns = ReturnType.SINGLE) PublicIpPrefixInner updateTags(String resourceGroupName, String publicIpPrefixName);
@ServiceMethod(returns = ReturnType.SINGLE) PublicIpPrefixInner updateTags(String resourceGroupName, String publicIpPrefixName);
/** * Updates public IP prefix tags. * * @param resourceGroupName The name of the resource group. * @param publicIpPrefixName The name of the public IP prefix. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return public IP prefix resource. */
Updates public IP prefix tags
updateTags
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-network/src/main/java/com/azure/resourcemanager/network/fluent/PublicIpPrefixesClient.java", "license": "mit", "size": 23539 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.resourcemanager.network.fluent.models.PublicIpPrefixInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.network.fluent.models.PublicIpPrefixInner;
import com.azure.core.annotation.*; import com.azure.resourcemanager.network.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
285,846
public void handleAck(Ack ack) { Ack recievedAck = ack; if (recievedAck.getMsgType() == MessageType.EMAIL) { EmailBuilder mailBuilder = new EmailBuilder(); Email existingEmail = mailBuilder .withId(ack.getId()) .withParentFolder( FolderFactory.getFolder(CECConfigurator .getReference().get("Outbox"))).build(); existingEmail.move(FolderFactory.getFolder(CECConfigurator .getReference().get("Sent"))); } } static Socket clientSocket; volatile static ObjectInputStream ois; volatile static ObjectOutputStream oos; CECConfigurator config = CECConfigurator.getReference(); volatile boolean stop = false; static ExecutorService exec;
void function(Ack ack) { Ack recievedAck = ack; if (recievedAck.getMsgType() == MessageType.EMAIL) { EmailBuilder mailBuilder = new EmailBuilder(); Email existingEmail = mailBuilder .withId(ack.getId()) .withParentFolder( FolderFactory.getFolder(CECConfigurator .getReference().get(STR))).build(); existingEmail.move(FolderFactory.getFolder(CECConfigurator .getReference().get("Sent"))); } } static Socket clientSocket; volatile static ObjectInputStream ois; volatile static ObjectOutputStream oos; CECConfigurator config = CECConfigurator.getReference(); volatile boolean stop = false; static ExecutorService exec;
/** * This function is responsible of handling acknowledgment received as parameter * If the received acknowledgment from server is an email acknowledgment, the existing email is * moved from the outbox folder to the sent folder * @param ack */
This function is responsible of handling acknowledgment received as parameter If the received acknowledgment from server is an email acknowledgment, the existing email is moved from the outbox folder to the sent folder
handleAck
{ "repo_name": "amishwins/project-cec-2013", "path": "CECProject/src/cec/net/NetworkHelper.java", "license": "mit", "size": 8794 }
[ "java.io.ObjectInputStream", "java.io.ObjectOutputStream", "java.net.Socket", "java.util.concurrent.ExecutorService" ]
import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.net.Socket; import java.util.concurrent.ExecutorService;
import java.io.*; import java.net.*; import java.util.concurrent.*;
[ "java.io", "java.net", "java.util" ]
java.io; java.net; java.util;
2,014,307
public String getTrashDirectory(File blockFile) { if (isTrashAllowed(blockFile)) { Matcher matcher = BLOCK_POOL_CURRENT_PATH_PATTERN.matcher(blockFile.getParent()); String trashDirectory = matcher.replaceFirst("$1$2" + TRASH_ROOT_DIR + "$4"); return trashDirectory; } return null; }
String function(File blockFile) { if (isTrashAllowed(blockFile)) { Matcher matcher = BLOCK_POOL_CURRENT_PATH_PATTERN.matcher(blockFile.getParent()); String trashDirectory = matcher.replaceFirst("$1$2" + TRASH_ROOT_DIR + "$4"); return trashDirectory; } return null; }
/** * Get a target subdirectory under trash/ for a given block file that is being * deleted. * * The subdirectory structure under trash/ mirrors that under current/ to keep * implicit memory of where the files are to be restored (if necessary). * * @return the trash directory for a given block file that is being deleted. */
Get a target subdirectory under trash/ for a given block file that is being deleted. The subdirectory structure under trash/ mirrors that under current/ to keep implicit memory of where the files are to be restored (if necessary)
getTrashDirectory
{ "repo_name": "mix/hadoop", "path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockPoolSliceStorage.java", "license": "apache-2.0", "size": 31745 }
[ "java.io.File", "java.util.regex.Matcher" ]
import java.io.File; import java.util.regex.Matcher;
import java.io.*; import java.util.regex.*;
[ "java.io", "java.util" ]
java.io; java.util;
105,981
void setStatusCode(HttpStatus status);
void setStatusCode(HttpStatus status);
/** * Set the HTTP status code of the response. * @param status the HTTP status as an HttpStatus enum value */
Set the HTTP status code of the response
setStatusCode
{ "repo_name": "kingtang/spring-learn", "path": "spring-web/src/main/java/org/springframework/http/server/ServerHttpResponse.java", "license": "gpl-3.0", "size": 1199 }
[ "org.springframework.http.HttpStatus" ]
import org.springframework.http.HttpStatus;
import org.springframework.http.*;
[ "org.springframework.http" ]
org.springframework.http;
707,460
public static GBAuth loadAndLoginFromFile (File file) throws IOException { Properties temp = new Properties(); temp.load(new FileInputStream(file)); return loadAndLogin(temp); }
static GBAuth function (File file) throws IOException { Properties temp = new Properties(); temp.load(new FileInputStream(file)); return loadAndLogin(temp); }
/** * Load username, token and mode from properties and put them into a new auth object, then try to login. * If the token is present, check the auth object, otherwise try to login using the password * @param file File to which read the properties * @return Auth object if logged, null otherwise * @throws IOException Error while authenticating */
Load username, token and mode from properties and put them into a new auth object, then try to login. If the token is present, check the auth object, otherwise try to login using the password
loadAndLoginFromFile
{ "repo_name": "simonedegiacomi/goboxjavaapi", "path": "src/main/java/it/simonedegiacomi/goboxapi/authentication/PropertiesAuthLoader.java", "license": "gpl-2.0", "size": 2605 }
[ "java.io.File", "java.io.FileInputStream", "java.io.IOException", "java.util.Properties" ]
import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.util.Properties;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
2,472,696
private View getHeaderView(int resource, View convertView) { View view = getLayoutInflater().inflate(R.layout.device_select_item_separator_layout, null); TextView text = (TextView) view.findViewById(R.id.header_text); text.setText(resource); return view; }
View function(int resource, View convertView) { View view = getLayoutInflater().inflate(R.layout.device_select_item_separator_layout, null); TextView text = (TextView) view.findViewById(R.id.header_text); text.setText(resource); return view; }
/** * Construct titled separator for listview. * * @param resource string resource identifying title. * @param convertView currently presented view. * @return separator view. */
Construct titled separator for listview
getHeaderView
{ "repo_name": "RobertDaleSmith/chromemote-googletv-bridge", "path": "src/com/motelabs/chromemote/bridge/android/anymote/DeviceSelectDialog.java", "license": "gpl-2.0", "size": 10532 }
[ "android.view.View", "android.widget.TextView" ]
import android.view.View; import android.widget.TextView;
import android.view.*; import android.widget.*;
[ "android.view", "android.widget" ]
android.view; android.widget;
2,736,770
@Override public List<String> getStatisticNames() { return Arrays.asList(NAME); }
List<String> function() { return Arrays.asList(NAME); }
/** * Get a list of the names of the statistics that this metrics computes. E.g. * an information theoretic evaluation measure might compute total number of * bits as well as average bits/instance * * @return the names of the statistics that this metric computes */
Get a list of the names of the statistics that this metrics computes. E.g. an information theoretic evaluation measure might compute total number of bits as well as average bits/instance
getStatisticNames
{ "repo_name": "waikato-datamining/adams-base", "path": "adams-weka/src/main/java/weka/classifiers/evaluation/Bias.java", "license": "gpl-3.0", "size": 3120 }
[ "java.util.Arrays", "java.util.List" ]
import java.util.Arrays; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,381,237
public void expectedPropertyReceived(final String name, final Object value) { if (expectedPropertyValues == null) { expectedPropertyValues = new ConcurrentHashMap<String, Object>(); } if (value != null) { // ConcurrentHashMap cannot store null values expectedPropertyValues.put(name, value); }
void function(final String name, final Object value) { if (expectedPropertyValues == null) { expectedPropertyValues = new ConcurrentHashMap<String, Object>(); } if (value != null) { expectedPropertyValues.put(name, value); }
/** * Sets an expectation that the given property name & value are received by this endpoint * <p/> * You can set multiple expectations for different property names. * If you set a value of <tt>null</tt> that means we accept either the property is absent, or its value is <tt>null</tt> */
Sets an expectation that the given property name & value are received by this endpoint You can set multiple expectations for different property names. If you set a value of null that means we accept either the property is absent, or its value is null
expectedPropertyReceived
{ "repo_name": "brreitme/camel", "path": "camel-core/src/main/java/org/apache/camel/component/mock/MockEndpoint.java", "license": "apache-2.0", "size": 58954 }
[ "java.util.concurrent.ConcurrentHashMap" ]
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
2,206,957
void setSelectedBackupDownloadFormat(LoadingScope downloadType);
void setSelectedBackupDownloadFormat(LoadingScope downloadType);
/** * Sets the selected backup download type. * * @param downloadType * The backup download type. */
Sets the selected backup download type
setSelectedBackupDownloadFormat
{ "repo_name": "Raphcal/sigmah", "path": "src/main/java/org/sigmah/client/ui/presenter/admin/ParametersAdminPresenter.java", "license": "gpl-3.0", "size": 17358 }
[ "org.sigmah.shared.dto.value.FileDTO" ]
import org.sigmah.shared.dto.value.FileDTO;
import org.sigmah.shared.dto.value.*;
[ "org.sigmah.shared" ]
org.sigmah.shared;
450,478
public static void checkArgument( boolean b, @Nullable String errorMessageTemplate, @Nullable Object p1, char p2) { if (!b) { throw new IllegalArgumentException(format(errorMessageTemplate, p1, p2)); } }
static void function( boolean b, @Nullable String errorMessageTemplate, @Nullable Object p1, char p2) { if (!b) { throw new IllegalArgumentException(format(errorMessageTemplate, p1, p2)); } }
/** * Ensures the truth of an expression involving one or more parameters to the calling method. * * <p>See {@link #checkArgument(boolean, String, Object...)} for details. */
Ensures the truth of an expression involving one or more parameters to the calling method. See <code>#checkArgument(boolean, String, Object...)</code> for details
checkArgument
{ "repo_name": "jakubmalek/guava", "path": "guava/src/com/google/common/base/Preconditions.java", "license": "apache-2.0", "size": 51675 }
[ "javax.annotation.Nullable" ]
import javax.annotation.Nullable;
import javax.annotation.*;
[ "javax.annotation" ]
javax.annotation;
1,514,783
private static Pair<String, String> postIndexedReg(final long offset, final ITranslationEnvironment environment, final List<ReilInstruction> instructions, final String registerNodeValue1, final String registerNodeValue2) { final String address = environment.getNextVariableString(); final String tmpVar1 = environment.getNextVariableString(); long baseOffset = offset; instructions.add(ReilHelpers.createStr(baseOffset++, dw, registerNodeValue1, dw, address)); instructions.add(ReilHelpers.createAdd(baseOffset++, dw, registerNodeValue1, dw, registerNodeValue2, dw, tmpVar1)); instructions.add( ReilHelpers.createAnd(baseOffset++, dw, tmpVar1, dw, dWordBitMask, dw, registerNodeValue1)); return new Pair<String, String>(address, registerNodeValue1); }
static Pair<String, String> function(final long offset, final ITranslationEnvironment environment, final List<ReilInstruction> instructions, final String registerNodeValue1, final String registerNodeValue2) { final String address = environment.getNextVariableString(); final String tmpVar1 = environment.getNextVariableString(); long baseOffset = offset; instructions.add(ReilHelpers.createStr(baseOffset++, dw, registerNodeValue1, dw, address)); instructions.add(ReilHelpers.createAdd(baseOffset++, dw, registerNodeValue1, dw, registerNodeValue2, dw, tmpVar1)); instructions.add( ReilHelpers.createAnd(baseOffset++, dw, tmpVar1, dw, dWordBitMask, dw, registerNodeValue1)); return new Pair<String, String>(address, registerNodeValue1); }
/** * [<Rn>], +/-<Rm> * * Operation: * * address = Rn if ConditionPassed(cond) then if U == 1 then Rn = Rn + Rm else / U == 0 / Rn = Rn * - Rm */
[], +/- Operation: address = Rn if ConditionPassed(cond) then if U == 1 then Rn = Rn + Rm else / U == 0 / Rn = Rn - Rm
postIndexedReg
{ "repo_name": "mayl8822/binnavi", "path": "src/main/java/com/google/security/zynamics/reil/translators/arm/AddressingModeTwoGenerator.java", "license": "apache-2.0", "size": 55963 }
[ "com.google.security.zynamics.reil.ReilHelpers", "com.google.security.zynamics.reil.ReilInstruction", "com.google.security.zynamics.reil.translators.ITranslationEnvironment", "com.google.security.zynamics.zylib.general.Pair", "java.util.List" ]
import com.google.security.zynamics.reil.ReilHelpers; import com.google.security.zynamics.reil.ReilInstruction; import com.google.security.zynamics.reil.translators.ITranslationEnvironment; import com.google.security.zynamics.zylib.general.Pair; import java.util.List;
import com.google.security.zynamics.reil.*; import com.google.security.zynamics.reil.translators.*; import com.google.security.zynamics.zylib.general.*; import java.util.*;
[ "com.google.security", "java.util" ]
com.google.security; java.util;
865,209
public CompletableFuture<U> subscribeToOrderbook(NotificationListener listener, Priority priority); // // public NotificationListener subscribeToOrderbook(NotificationListener listener, String // item);
CompletableFuture<U> function(NotificationListener listener, Priority priority);
/** * Subscribe to updates for orderbooks. * * @param listener * the listener * @param priority * the priority * @return a CompletableFuture that will receive the subscribing listener when the subscription * was successful. If the subscription fails, the cause will be forwarded to the future. * That listener can later be used to unsubscribe. */
Subscribe to updates for orderbooks
subscribeToOrderbook
{ "repo_name": "125m125/ktapi-java", "path": "ktapi-core/src/main/java/de/_125m125/kt/ktapi/core/KtNotificationManager.java", "license": "mit", "size": 15635 }
[ "java.util.concurrent.CompletableFuture" ]
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
445,907
public int getStackVoltage() throws TimeoutException, NotConnectedException { ByteBuffer bb = ipcon.createRequestPacket((byte)8, FUNCTION_GET_STACK_VOLTAGE, this); byte[] response = sendRequest(bb.array()); bb = ByteBuffer.wrap(response, 8, response.length - 8); bb.order(ByteOrder.LITTLE_ENDIAN); int voltage = IPConnection.unsignedShort(bb.getShort()); return voltage; }
int function() throws TimeoutException, NotConnectedException { ByteBuffer bb = ipcon.createRequestPacket((byte)8, FUNCTION_GET_STACK_VOLTAGE, this); byte[] response = sendRequest(bb.array()); bb = ByteBuffer.wrap(response, 8, response.length - 8); bb.order(ByteOrder.LITTLE_ENDIAN); int voltage = IPConnection.unsignedShort(bb.getShort()); return voltage; }
/** * Returns the stack voltage in mV. The stack voltage is the * voltage that is supplied via the stack, i.e. it is given by a * Step-Down or Step-Up Power Supply. */
Returns the stack voltage in mV. The stack voltage is the voltage that is supplied via the stack, i.e. it is given by a Step-Down or Step-Up Power Supply
getStackVoltage
{ "repo_name": "jaggr2/ch.bfh.fbi.mobiComp.17herz", "path": "com.tinkerforge/src/com/tinkerforge/BrickMaster.java", "license": "apache-2.0", "size": 85810 }
[ "java.nio.ByteBuffer", "java.nio.ByteOrder" ]
import java.nio.ByteBuffer; import java.nio.ByteOrder;
import java.nio.*;
[ "java.nio" ]
java.nio;
2,709,319
public void discard(DurableVolume volume, Snapshot snapshot);
void function(DurableVolume volume, Snapshot snapshot);
/** * Discard a specific snapshot * * @param volume * the volume holding the snapshot to discard * @param snapshot * the snapshot to discard; if null then no snapshot will be discarded */
Discard a specific snapshot
discard
{ "repo_name": "petergeneric/ebs-snapshotd", "path": "daemon/src/main/java/com/peterphi/aws/snapshotd/service/iface/DiscardSnapshotService.java", "license": "mit", "size": 489 }
[ "com.amazonaws.services.ec2.model.Snapshot", "com.peterphi.aws.snapshotd.type.DurableVolume" ]
import com.amazonaws.services.ec2.model.Snapshot; import com.peterphi.aws.snapshotd.type.DurableVolume;
import com.amazonaws.services.ec2.model.*; import com.peterphi.aws.snapshotd.type.*;
[ "com.amazonaws.services", "com.peterphi.aws" ]
com.amazonaws.services; com.peterphi.aws;
2,873,729
public static void addDiskToVm(BaseDisk disk, Guid vmId) { DbFacade.getInstance().getBaseDiskDao().save(disk); VmDeviceUtils.addDiskDevice(vmId, disk.getId()); }
static void function(BaseDisk disk, Guid vmId) { DbFacade.getInstance().getBaseDiskDao().save(disk); VmDeviceUtils.addDiskDevice(vmId, disk.getId()); }
/** * Adds disk to vm * * @param disk * the disk to add * @param vmId * the ID of the VM to add to */
Adds disk to vm
addDiskToVm
{ "repo_name": "OpenUniversity/ovirt-engine", "path": "backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/disk/image/ImagesHandler.java", "license": "apache-2.0", "size": 39979 }
[ "org.ovirt.engine.core.bll.utils.VmDeviceUtils", "org.ovirt.engine.core.common.businessentities.storage.BaseDisk", "org.ovirt.engine.core.compat.Guid", "org.ovirt.engine.core.dal.dbbroker.DbFacade" ]
import org.ovirt.engine.core.bll.utils.VmDeviceUtils; import org.ovirt.engine.core.common.businessentities.storage.BaseDisk; import org.ovirt.engine.core.compat.Guid; import org.ovirt.engine.core.dal.dbbroker.DbFacade;
import org.ovirt.engine.core.bll.utils.*; import org.ovirt.engine.core.common.businessentities.storage.*; import org.ovirt.engine.core.compat.*; import org.ovirt.engine.core.dal.dbbroker.*;
[ "org.ovirt.engine" ]
org.ovirt.engine;
1,473,218
public static void showYesNoDialog(Context context, int icon, int title, int message, DialogInterface.OnClickListener onYes) { AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setCancelable(true); builder.setIcon(icon); builder.setTitle(context.getResources().getString(title)); builder.setMessage(context.getResources().getString(message));
static void function(Context context, int icon, int title, int message, DialogInterface.OnClickListener onYes) { AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setCancelable(true); builder.setIcon(icon); builder.setTitle(context.getResources().getString(title)); builder.setMessage(context.getResources().getString(message));
/** * Display a standard yes / no dialog. * @param context The current context. * @param icon The dialog icon. * @param title The dialog title. * @param message The dialog message. * @param onYes The dialog listener for the yes button. */
Display a standard yes / no dialog
showYesNoDialog
{ "repo_name": "vanan08/android-browser-cmcsoft", "path": "src/org/cmc/utils/ApplicationUtils.java", "license": "gpl-3.0", "size": 18427 }
[ "android.app.AlertDialog", "android.content.Context", "android.content.DialogInterface" ]
import android.app.AlertDialog; import android.content.Context; import android.content.DialogInterface;
import android.app.*; import android.content.*;
[ "android.app", "android.content" ]
android.app; android.content;
1,609,879
public static OutputStream marshal(Document document, OutputStream out, String encoding) throws Exception { OutputFormat format = OutputFormat.createPrettyPrint(); format.setEncoding(encoding); XMLWriter writer = new XMLWriter(out, format); writer.setEscapeText(false); writer.write(document); writer.close(); return out; }
static OutputStream function(Document document, OutputStream out, String encoding) throws Exception { OutputFormat format = OutputFormat.createPrettyPrint(); format.setEncoding(encoding); XMLWriter writer = new XMLWriter(out, format); writer.setEscapeText(false); writer.write(document); writer.close(); return out; }
/** * Marshals (writes) an XML document into an output stream using XML pretty-print formatting.<p> * * @param document the XML document to marshal * @param out the output stream to write to * @param encoding the encoding to use * @return the output stream with the xml content * @throws Exception if something goes wrong */
Marshals (writes) an XML document into an output stream using XML pretty-print formatting
marshal
{ "repo_name": "mediaworx/opencms-core", "path": "src-components/org/opencms/util/ant/CmsXmlUtils.java", "license": "lgpl-2.1", "size": 21421 }
[ "java.io.OutputStream", "org.dom4j.Document", "org.dom4j.io.OutputFormat", "org.dom4j.io.XMLWriter" ]
import java.io.OutputStream; import org.dom4j.Document; import org.dom4j.io.OutputFormat; import org.dom4j.io.XMLWriter;
import java.io.*; import org.dom4j.*; import org.dom4j.io.*;
[ "java.io", "org.dom4j", "org.dom4j.io" ]
java.io; org.dom4j; org.dom4j.io;
607,458
public boolean match(String host, int port, String path, boolean secure, final Cookie cookie) { LOG.trace("enter CookieSpecBase.match(" + "String, int, String, boolean, Cookie"); if (host == null) { throw new IllegalArgumentException( "Host of origin may not be null"); } if (host.trim().equals("")) { throw new IllegalArgumentException( "Host of origin may not be blank"); } if (port < 0) { throw new IllegalArgumentException("Invalid port: " + port); } if (path == null) { throw new IllegalArgumentException( "Path of origin may not be null."); } if (cookie == null) { throw new IllegalArgumentException("Cookie may not be null"); } if (path.trim().equals("")) { path = PATH_DELIM; } host = host.toLowerCase(); if (cookie.getDomain() == null) { LOG.warn("Invalid cookie state: domain not specified"); return false; } if (cookie.getPath() == null) { LOG.warn("Invalid cookie state: path not specified"); return false; } return // only add the cookie if it hasn't yet expired (cookie.getExpiryDate() == null || cookie.getExpiryDate().after(new Date())) // and the domain pattern matches && (domainMatch(host, cookie.getDomain())) // and the path is null or matching && (pathMatch(path, cookie.getPath())) // and if the secure flag is set, only if the request is // actually secure && (cookie.getSecure() ? secure : true); }
boolean function(String host, int port, String path, boolean secure, final Cookie cookie) { LOG.trace(STR + STR); if (host == null) { throw new IllegalArgumentException( STR); } if (host.trim().equals(STRHost of origin may not be blankSTRInvalid port: STRPath of origin may not be null.STRCookie may not be nullSTRSTRInvalid cookie state: domain not specifiedSTRInvalid cookie state: path not specified"); return false; } return (cookie.getExpiryDate() == null cookie.getExpiryDate().after(new Date())) && (domainMatch(host, cookie.getDomain())) && (pathMatch(path, cookie.getPath())) && (cookie.getSecure() ? secure : true); }
/** * Return <tt>true</tt> if the cookie should be submitted with a request * with given attributes, <tt>false</tt> otherwise. * @param host the host to which the request is being submitted * @param port the port to which the request is being submitted (ignored) * @param path the path to which the request is being submitted * @param secure <tt>true</tt> if the request is using a secure connection * @param cookie {@link Cookie} to be matched * @return true if the cookie matches the criterium */
Return true if the cookie should be submitted with a request with given attributes, false otherwise
match
{ "repo_name": "magneticmoon/httpclient3-ntml", "path": "src/java/org/apache/commons/httpclient/cookie/CookieSpecBase.java", "license": "apache-2.0", "size": 24314 }
[ "java.util.Date", "org.apache.commons.httpclient.Cookie" ]
import java.util.Date; import org.apache.commons.httpclient.Cookie;
import java.util.*; import org.apache.commons.httpclient.*;
[ "java.util", "org.apache.commons" ]
java.util; org.apache.commons;
2,257,956
public byte[] lookupClassData(String className) throws ClassNotFoundException { byte[] data = new byte[0]; for (int i = 0; i < fPathItems.size(); i++) { String path = (String) fPathItems.elementAt(i); String fileName = className.replace('.', '/') + ".class"; if (isJar(path)) { if (logger_.isDebugEnabled()) { logger_.debug("Trying to load file# " + fileName + " through Zip/Jar# " + path ); } data = loadJarData(path, fileName); } else { if (logger_.isDebugEnabled()) { logger_.debug("Trying to load through File System " + fileName); } try { data = loadFileData(path, fileName); } catch (IOException e) { } } if (data.length > 0) return data; } throw new ClassNotFoundException(className); }
byte[] function(String className) throws ClassNotFoundException { byte[] data = new byte[0]; for (int i = 0; i < fPathItems.size(); i++) { String path = (String) fPathItems.elementAt(i); String fileName = className.replace('.', '/') + STR; if (isJar(path)) { if (logger_.isDebugEnabled()) { logger_.debug(STR + fileName + STR + path ); } data = loadJarData(path, fileName); } else { if (logger_.isDebugEnabled()) { logger_.debug(STR + fileName); } try { data = loadFileData(path, fileName); } catch (IOException e) { } } if (data.length > 0) return data; } throw new ClassNotFoundException(className); }
/** * This method is used to load the class file from the paths or jar, zip files * associated in the java classpath. * * @param className to be loaded. * @return byte[] array of bytes. * @throws ClassNotFoundException */
This method is used to load the class file from the paths or jar, zip files associated in the java classpath
lookupClassData
{ "repo_name": "MastekLtd/JBEAM", "path": "supporting_libraries/AdvancedPRE/pre/src/main/java/stg/customclassloader/CCustomClassLoader.java", "license": "lgpl-3.0", "size": 13957 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
615,518
@JsonProperty("fuzzy_rewrite") @JsonSerialize(using = RewriteSerializer.class) Rewrite getRewrite();
@JsonProperty(STR) @JsonSerialize(using = RewriteSerializer.class) Rewrite getRewrite();
/** * get rewrite * * @return rewrite */
get rewrite
getRewrite
{ "repo_name": "nnest/sparrow", "path": "sparrow-rest/src/main/java/com/github/nnest/sparrow/rest/command/mixins/MultiMatchMixin.java", "license": "mit", "size": 3139 }
[ "com.fasterxml.jackson.annotation.JsonProperty", "com.fasterxml.jackson.databind.annotation.JsonSerialize", "com.github.nnest.sparrow.command.document.query.attrs.rewrite.Rewrite", "com.github.nnest.sparrow.rest.command.mixins.serialize.RewriteSerializer" ]
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.github.nnest.sparrow.command.document.query.attrs.rewrite.Rewrite; import com.github.nnest.sparrow.rest.command.mixins.serialize.RewriteSerializer;
import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.annotation.*; import com.github.nnest.sparrow.command.document.query.attrs.rewrite.*; import com.github.nnest.sparrow.rest.command.mixins.serialize.*;
[ "com.fasterxml.jackson", "com.github.nnest" ]
com.fasterxml.jackson; com.github.nnest;
1,651,733
public AccessPolicyResponseInner withPolicy(UserAccessPolicy policy) { this.policy = policy; return this; }
AccessPolicyResponseInner function(UserAccessPolicy policy) { this.policy = policy; return this; }
/** * Set the policy property: The user access policy. * * @param policy the policy value to set. * @return the AccessPolicyResponseInner object itself. */
Set the policy property: The user access policy
withPolicy
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/datafactory/azure-resourcemanager-datafactory/src/main/java/com/azure/resourcemanager/datafactory/fluent/models/AccessPolicyResponseInner.java", "license": "mit", "size": 2950 }
[ "com.azure.resourcemanager.datafactory.models.UserAccessPolicy" ]
import com.azure.resourcemanager.datafactory.models.UserAccessPolicy;
import com.azure.resourcemanager.datafactory.models.*;
[ "com.azure.resourcemanager" ]
com.azure.resourcemanager;
603,375
@Query(QUERY + "where reportFolder_.id = ?1 ") ReportFolder findReportFolder(int id);
@Query(QUERY + STR) ReportFolder findReportFolder(int id);
/** * Find report folder. * * @param id */
Find report folder
findReportFolder
{ "repo_name": "chmulato/helianto-plan", "path": "src/main/java/org/helianto/task/repository/ReportFolderRepository2.java", "license": "apache-2.0", "size": 2557 }
[ "org.helianto.task.domain.ReportFolder", "org.springframework.data.jpa.repository.Query" ]
import org.helianto.task.domain.ReportFolder; import org.springframework.data.jpa.repository.Query;
import org.helianto.task.domain.*; import org.springframework.data.jpa.repository.*;
[ "org.helianto.task", "org.springframework.data" ]
org.helianto.task; org.springframework.data;
2,446,575
@Override public List<HddsProtos.Node> queryNode(HddsProtos.NodeState nodeStatuses, HddsProtos.QueryScope queryScope, String poolName) throws IOException { // TODO : We support only cluster wide query right now. So ignoring checking // queryScope and poolName Preconditions.checkNotNull(nodeStatuses); NodeQueryRequestProto request = NodeQueryRequestProto.newBuilder() .setState(nodeStatuses) .setScope(queryScope).setPoolName(poolName).build(); try { NodeQueryResponseProto response = rpcProxy.queryNode(NULL_RPC_CONTROLLER, request); return response.getDatanodesList(); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } }
List<HddsProtos.Node> function(HddsProtos.NodeState nodeStatuses, HddsProtos.QueryScope queryScope, String poolName) throws IOException { Preconditions.checkNotNull(nodeStatuses); NodeQueryRequestProto request = NodeQueryRequestProto.newBuilder() .setState(nodeStatuses) .setScope(queryScope).setPoolName(poolName).build(); try { NodeQueryResponseProto response = rpcProxy.queryNode(NULL_RPC_CONTROLLER, request); return response.getDatanodesList(); } catch (ServiceException e) { throw ProtobufHelper.getRemoteException(e); } }
/** * Queries a list of Node Statuses. * * @param nodeStatuses * @return List of Datanodes. */
Queries a list of Node Statuses
queryNode
{ "repo_name": "GeLiXin/hadoop", "path": "hadoop-hdds/common/src/main/java/org/apache/hadoop/hdds/scm/protocolPB/StorageContainerLocationProtocolClientSideTranslatorPB.java", "license": "apache-2.0", "size": 12399 }
[ "com.google.common.base.Preconditions", "com.google.protobuf.ServiceException", "java.io.IOException", "java.util.List", "org.apache.hadoop.hdds.protocol.proto.HddsProtos", "org.apache.hadoop.ipc.ProtobufHelper" ]
import com.google.common.base.Preconditions; import com.google.protobuf.ServiceException; import java.io.IOException; import java.util.List; import org.apache.hadoop.hdds.protocol.proto.HddsProtos; import org.apache.hadoop.ipc.ProtobufHelper;
import com.google.common.base.*; import com.google.protobuf.*; import java.io.*; import java.util.*; import org.apache.hadoop.hdds.protocol.proto.*; import org.apache.hadoop.ipc.*;
[ "com.google.common", "com.google.protobuf", "java.io", "java.util", "org.apache.hadoop" ]
com.google.common; com.google.protobuf; java.io; java.util; org.apache.hadoop;
1,722,616
public void afterRollback(Connection conn);
void function(Connection conn);
/** * Invoked after rollback on a connection is complete. */
Invoked after rollback on a connection is complete
afterRollback
{ "repo_name": "papicella/snappy-store", "path": "gemfirexd/core/src/main/java/com/pivotal/gemfirexd/execute/QueryObserver.java", "license": "apache-2.0", "size": 5856 }
[ "java.sql.Connection" ]
import java.sql.Connection;
import java.sql.*;
[ "java.sql" ]
java.sql;
2,615,969
public @Nullable List<MediaItem2> onGetSearchResult( @NonNull MediaLibrarySession session, @NonNull ControllerInfo controllerInfo, @NonNull String query, int page, int pageSize, @Nullable Bundle extras) { return null; } } // Override all methods just to show them with the type instead of generics in Javadoc. // This workarounds javadoc issue described in the MediaSession2.BuilderBase. public static final class Builder extends MediaSession2.BuilderBase<MediaLibrarySession, Builder, MediaLibrarySessionCallback> { private MediaLibrarySessionImplBase.Builder mImpl; // Builder requires MediaLibraryService2 instead of Context just to ensure that the // builder can be only instantiated within the MediaLibraryService2. // Ideally it's better to make it inner class of service to enforce, it violates API // guideline that Builders should be the inner class of the building target. public Builder(@NonNull MediaLibraryService2 service, @NonNull Executor callbackExecutor, @NonNull MediaLibrarySessionCallback callback) { super(service); mImpl = new MediaLibrarySessionImplBase.Builder(service); setImpl(mImpl); setSessionCallback(callbackExecutor, callback); }
@Nullable List<MediaItem2> function( @NonNull MediaLibrarySession session, @NonNull ControllerInfo controllerInfo, @NonNull String query, int page, int pageSize, @Nullable Bundle extras) { return null; } } public static final class Builder extends MediaSession2.BuilderBase<MediaLibrarySession, Builder, MediaLibrarySessionCallback> { private MediaLibrarySessionImplBase.Builder mImpl; public Builder(@NonNull MediaLibraryService2 service, @NonNull Executor callbackExecutor, @NonNull MediaLibrarySessionCallback callback) { super(service); mImpl = new MediaLibrarySessionImplBase.Builder(service); setImpl(mImpl); setSessionCallback(callbackExecutor, callback); }
/** * Called to get the search result. Return search result here for the browser which has * requested search previously. * <p> * Return an empty list for no search result, and return {@code null} for the error. * * @param session the session for this event * @param controllerInfo Information of the controller requesting the search result. * @param query The search query which was previously sent through * {@link #onSearch(MediaLibrarySession, ControllerInfo, String, Bundle)}. * @param page page number. Starts from {@code 1}. * @param pageSize page size. Should be greater or equal to {@code 1}. * @param extras The bundle of service-specific arguments sent from the media browser. * @return search result. {@code null} for error. * @see SessionCommand2#COMMAND_CODE_LIBRARY_GET_SEARCH_RESULT */
Called to get the search result. Return search result here for the browser which has requested search previously. Return an empty list for no search result, and return null for the error
onGetSearchResult
{ "repo_name": "aosp-mirror/platform_frameworks_support", "path": "media/src/main/java/androidx/media/MediaLibraryService2.java", "license": "apache-2.0", "size": 25584 }
[ "android.os.Bundle", "androidx.annotation.NonNull", "androidx.annotation.Nullable", "androidx.media.MediaLibraryService2", "androidx.media.MediaSession2", "java.util.List", "java.util.concurrent.Executor" ]
import android.os.Bundle; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.media.MediaLibraryService2; import androidx.media.MediaSession2; import java.util.List; import java.util.concurrent.Executor;
import android.os.*; import androidx.annotation.*; import androidx.media.*; import java.util.*; import java.util.concurrent.*;
[ "android.os", "androidx.annotation", "androidx.media", "java.util" ]
android.os; androidx.annotation; androidx.media; java.util;
2,343,153
public void setDestdir (File dir) { mDestDir = dir; }
void function (File dir) { mDestDir = dir; }
/** * Set the destination directory into which the XSL result files * should be copied to. This parameter is required. * * @param dir the name of the destination directory. */
Set the destination directory into which the XSL result files should be copied to. This parameter is required
setDestdir
{ "repo_name": "jCoderZ/fawkez-old", "path": "src/java/org/jcoderz/commons/taskdefs/XsltBasedTask.java", "license": "bsd-3-clause", "size": 18978 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
1,144,387
public Paint.Style getPaintStyle() { return this.paintStyle; }
Paint.Style function() { return this.paintStyle; }
/** * This method is getter for stroke or fill. * * @return */
This method is getter for stroke or fill
getPaintStyle
{ "repo_name": "Nazima-Mansuri/lanetEvernote", "path": "app/src/main/java/com/example/lcom67/demoapp/CanvasView.java", "license": "apache-2.0", "size": 24623 }
[ "android.graphics.Paint" ]
import android.graphics.Paint;
import android.graphics.*;
[ "android.graphics" ]
android.graphics;
2,607,625
public void setContactUri(Uri uri, boolean sendToQuickContact) { mContactUri = uri; if (sendToQuickContact) { mPhotoView.assignContactUri(uri); } }
void function(Uri uri, boolean sendToQuickContact) { mContactUri = uri; if (sendToQuickContact) { mPhotoView.assignContactUri(uri); } }
/** * Manually set the contact uri without loading any data */
Manually set the contact uri without loading any data
setContactUri
{ "repo_name": "rex-xxx/mt6572_x201", "path": "packages/experimental/LoaderApp/src/com/android/loaderapp/ContactHeaderWidget.java", "license": "gpl-2.0", "size": 25603 }
[ "android.net.Uri" ]
import android.net.Uri;
import android.net.*;
[ "android.net" ]
android.net;
1,779,753