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
@Query("DELETE FROM video WHERE sequence_id = :sequenceId") int deleteBySequenceId(String sequenceId);
@Query(STR) int deleteBySequenceId(String sequenceId);
/** * Remove a {@code VideoEntity} which match the given parameter. * @param sequenceId the identifier for a {@code SequenceEntity} by which the {@code VideoEntity} will match in order to be removed. */
Remove a VideoEntity which match the given parameter
deleteBySequenceId
{ "repo_name": "openstreetview/android", "path": "app/src/main/java/com/telenav/osv/data/video/database/dao/VideoDao.java", "license": "lgpl-3.0", "size": 4275 }
[ "androidx.room.Query" ]
import androidx.room.Query;
import androidx.room.*;
[ "androidx.room" ]
androidx.room;
2,037,920
public void setUsername(String username) { for (Authentication auth : authentications.values()) { if (auth instanceof HttpBasicAuth) { ((HttpBasicAuth) auth).setUsername(username); return; } } throw new RuntimeException("No HTTP basic authentication configured!"); }
void function(String username) { for (Authentication auth : authentications.values()) { if (auth instanceof HttpBasicAuth) { ((HttpBasicAuth) auth).setUsername(username); return; } } throw new RuntimeException(STR); }
/** * Helper method to set username for the first HTTP basic authentication. * * @param username Username */
Helper method to set username for the first HTTP basic authentication
setUsername
{ "repo_name": "ScsApiTribe/payments-api-java-sdk", "path": "src/main/java/com/swisscom/api/sdk/payments/ApiClient.java", "license": "apache-2.0", "size": 46277 }
[ "com.swisscom.api.sdk.payments.auth.Authentication", "com.swisscom.api.sdk.payments.auth.HttpBasicAuth" ]
import com.swisscom.api.sdk.payments.auth.Authentication; import com.swisscom.api.sdk.payments.auth.HttpBasicAuth;
import com.swisscom.api.sdk.payments.auth.*;
[ "com.swisscom.api" ]
com.swisscom.api;
65,249
public void removeAll(Principal caller) throws NotOwnerException { if (!isOwner(caller)) throw new NotOwnerException(); entryList.removeAllElements(); }
void function(Principal caller) throws NotOwnerException { if (!isOwner(caller)) throw new NotOwnerException(); entryList.removeAllElements(); }
/** * Removes all ACL entries from this ACL. * * @param caller the principal invoking this method. It must be an owner * of this ACL. * @exception NotOwnerException if the caller principal is not an owner of * this Acl. * @see java.security.Principal */
Removes all ACL entries from this ACL
removeAll
{ "repo_name": "shun634501730/java_source_cn", "path": "src_en/com/sun/jmx/snmp/IPAcl/AclImpl.java", "license": "apache-2.0", "size": 9734 }
[ "java.security.Principal", "java.security.acl.NotOwnerException" ]
import java.security.Principal; import java.security.acl.NotOwnerException;
import java.security.*; import java.security.acl.*;
[ "java.security" ]
java.security;
1,171,259
private void addInstance(String classValue, List featureNumbers, List featureValues) { java.util.List attributeValues = new java.util.ArrayList(); // We might get to the end of the list, and we don't want to get an error, // when we try to access an item that doesn't exist, so add a fake entry to // the end of the list with a feature number so high that we will never // get past it. featureNumbers.add(new Integer(Integer.MAX_VALUE)); // The value that the double is set to is completely arbitrary, so long as // it's not zero. featureValues.add(new Double(1.0)); int indexInFeatureNumbersList=0; // Each GATE attribute might map to many SVM Light attributes, so we need to // keep track of what SVM Light attribute we're up to separately. SVM Light // attributes are numbered from 1. int firstIndexOfSVMLightAttributeForCurrentGATEAttribute=1; for (int attributeIndex=0; attributeIndex<datasetDefinition.getAttributes().size(); ++attributeIndex) { // First make sure that we're at the right place in the list of SVM Light // features by skipping over any features with value zero (that is the // default value, so we don't need to have it specified), and over any // features that have (or should have) already been used, that is ones // that specify values for GATE attributes that we've already processed. while (((Integer)featureNumbers.get(indexInFeatureNumbersList)).intValue() <firstIndexOfSVMLightAttributeForCurrentGATEAttribute || ((Double)featureValues .get(indexInFeatureNumbersList)).doubleValue()==0.0) ++indexInFeatureNumbersList; // If we've got to the class attribute, add it in. if (attributeIndex==datasetDefinition.getClassIndex()) attributeValues.add( getGATEClassAttributeValue(attributeIndex, classValue)); else { // If we've got to a regular attribute, add that in. // If the feature is in the list, move on the index in the list of // regular attributes. attributeValues.add(getGATEAttributeValue(attributeIndex, ((Double)featureValues.get(indexInFeatureNumbersList)).doubleValue(), firstIndexOfSVMLightAttributeForCurrentGATEAttribute, ((Integer)featureNumbers.get(indexInFeatureNumbersList)).intValue())); firstIndexOfSVMLightAttributeForCurrentGATEAttribute+= numberOfSVMLightAttributesUsedForGATEAttribute(attributeIndex); } } // Finally actually add the list of attribute values we've just made to the // training data. addTrainingInstance(attributeValues); }
void function(String classValue, List featureNumbers, List featureValues) { java.util.List attributeValues = new java.util.ArrayList(); featureNumbers.add(new Integer(Integer.MAX_VALUE)); featureValues.add(new Double(1.0)); int indexInFeatureNumbersList=0; int firstIndexOfSVMLightAttributeForCurrentGATEAttribute=1; for (int attributeIndex=0; attributeIndex<datasetDefinition.getAttributes().size(); ++attributeIndex) { while (((Integer)featureNumbers.get(indexInFeatureNumbersList)).intValue() <firstIndexOfSVMLightAttributeForCurrentGATEAttribute ((Double)featureValues .get(indexInFeatureNumbersList)).doubleValue()==0.0) ++indexInFeatureNumbersList; if (attributeIndex==datasetDefinition.getClassIndex()) attributeValues.add( getGATEClassAttributeValue(attributeIndex, classValue)); else { attributeValues.add(getGATEAttributeValue(attributeIndex, ((Double)featureValues.get(indexInFeatureNumbersList)).doubleValue(), firstIndexOfSVMLightAttributeForCurrentGATEAttribute, ((Integer)featureNumbers.get(indexInFeatureNumbersList)).intValue())); firstIndexOfSVMLightAttributeForCurrentGATEAttribute+= numberOfSVMLightAttributesUsedForGATEAttribute(attributeIndex); } } addTrainingInstance(attributeValues); }
/** * Take data read in from an SVM Light format file, and convert it into data * in the format passed from GATE. Then add it as a new training instance * to the training data. * * @param classValue The value of the class attribute in SVM Light format. * @param featureNumbers A list of feature numbers, as in SVM Light format * files. * @param featureValues A list of feature values, corresponding to the feature * numbers list, as they appear in an SVM Light format file. */
Take data read in from an SVM Light format file, and convert it into data in the format passed from GATE. Then add it as a new training instance to the training data
addInstance
{ "repo_name": "SONIAGroup/S.O.N.I.A.", "path": "GATE_Developer_8.0/plugins/Machine_Learning/src/gate/creole/ml/svmlight/SVMLightWrapper.java", "license": "gpl-2.0", "size": 58593 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
848,664
private void assertOutputSymlinkExists( Path symlinkPath, Path expectedLinkedToPath, String expectedContents) throws IOException { AbsPath fullPath = tmpFolder.getRoot().resolve(symlinkPath); if (Platform.detect() != Platform.WINDOWS) { Assert.assertTrue( String.format("Expected %s to be a symlink", fullPath), Files.isSymbolicLink(fullPath.getPath())); Path linkedToPath = Files.readSymbolicLink(fullPath.getPath()); Assert.assertEquals( String.format( "Expected symlink at %s to point to %s, not %s", symlinkPath, expectedLinkedToPath, linkedToPath), expectedLinkedToPath, linkedToPath); } AbsPath realExpectedLinkedToPath = filesystem .getRootPath() .resolve(symlinkPath.getParent().resolve(expectedLinkedToPath).normalize()); Assert.assertTrue( String.format( "Expected link %s to be the same file as %s", fullPath, realExpectedLinkedToPath), Files.isSameFile(fullPath.getPath(), realExpectedLinkedToPath.getPath())); String contents = Joiner.on('\n').join(Files.readAllLines(fullPath.getPath())); Assert.assertEquals(expectedContents, contents); }
void function( Path symlinkPath, Path expectedLinkedToPath, String expectedContents) throws IOException { AbsPath fullPath = tmpFolder.getRoot().resolve(symlinkPath); if (Platform.detect() != Platform.WINDOWS) { Assert.assertTrue( String.format(STR, fullPath), Files.isSymbolicLink(fullPath.getPath())); Path linkedToPath = Files.readSymbolicLink(fullPath.getPath()); Assert.assertEquals( String.format( STR, symlinkPath, expectedLinkedToPath, linkedToPath), expectedLinkedToPath, linkedToPath); } AbsPath realExpectedLinkedToPath = filesystem .getRootPath() .resolve(symlinkPath.getParent().resolve(expectedLinkedToPath).normalize()); Assert.assertTrue( String.format( STR, fullPath, realExpectedLinkedToPath), Files.isSameFile(fullPath.getPath(), realExpectedLinkedToPath.getPath())); String contents = Joiner.on('\n').join(Files.readAllLines(fullPath.getPath())); Assert.assertEquals(expectedContents, contents); }
/** * Assert that a symlink exists inside of the temp directory with given contents and that links to * the right file */
Assert that a symlink exists inside of the temp directory with given contents and that links to the right file
assertOutputSymlinkExists
{ "repo_name": "JoelMarcey/buck", "path": "test/com/facebook/buck/util/unarchive/UntarTest.java", "license": "apache-2.0", "size": 30564 }
[ "com.facebook.buck.core.filesystems.AbsPath", "com.facebook.buck.util.environment.Platform", "com.google.common.base.Joiner", "java.io.IOException", "java.nio.file.Files", "java.nio.file.Path", "org.junit.Assert" ]
import com.facebook.buck.core.filesystems.AbsPath; import com.facebook.buck.util.environment.Platform; import com.google.common.base.Joiner; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import org.junit.Assert;
import com.facebook.buck.core.filesystems.*; import com.facebook.buck.util.environment.*; import com.google.common.base.*; import java.io.*; import java.nio.file.*; import org.junit.*;
[ "com.facebook.buck", "com.google.common", "java.io", "java.nio", "org.junit" ]
com.facebook.buck; com.google.common; java.io; java.nio; org.junit;
1,087,383
public void endTest(final Test test) { final String testDescription = createDescription(test); // Fix for bug #5637 - if a junit.extensions.TestSetup is // used and throws an exception during setUp then startTest // would never have been called if (!testStarts.containsKey(testDescription)) { startTest(test); } Element currentTest; if (!failedTests.containsKey(test) && !skippedTests.containsKey(testDescription) && !ignoredTests.containsKey(testDescription)) { currentTest = doc.createElement(TESTCASE); String n = JUnitVersionHelper.getTestCaseName(test); if (n != null && !tag.isEmpty()) n = n + "-" + tag; currentTest.setAttribute(ATTR_NAME, n == null ? UNKNOWN : n); // a TestSuite can contain Tests from multiple classes, // even tests with the same name - disambiguate them. currentTest.setAttribute(ATTR_CLASSNAME, JUnitVersionHelper.getTestCaseClassName(test)); rootElement.appendChild(currentTest); testElements.put(createDescription(test), currentTest); } else { currentTest = testElements.get(testDescription); } final Long l = testStarts.get(createDescription(test)); currentTest.setAttribute(ATTR_TIME, "" + ((System.currentTimeMillis() - l) / ONE_SECOND)); }
void function(final Test test) { final String testDescription = createDescription(test); if (!testStarts.containsKey(testDescription)) { startTest(test); } Element currentTest; if (!failedTests.containsKey(test) && !skippedTests.containsKey(testDescription) && !ignoredTests.containsKey(testDescription)) { currentTest = doc.createElement(TESTCASE); String n = JUnitVersionHelper.getTestCaseName(test); if (n != null && !tag.isEmpty()) n = n + "-" + tag; currentTest.setAttribute(ATTR_NAME, n == null ? UNKNOWN : n); currentTest.setAttribute(ATTR_CLASSNAME, JUnitVersionHelper.getTestCaseClassName(test)); rootElement.appendChild(currentTest); testElements.put(createDescription(test), currentTest); } else { currentTest = testElements.get(testDescription); } final Long l = testStarts.get(createDescription(test)); currentTest.setAttribute(ATTR_TIME, "" + ((System.currentTimeMillis() - l) / ONE_SECOND)); }
/** * Interface TestListener. * * <p>A Test is finished. * @param test the test. */
Interface TestListener. A Test is finished
endTest
{ "repo_name": "mourao666/cassandra-sim", "path": "test/unit/org/apache/cassandra/CassandraXMLJUnitResultFormatter.java", "license": "apache-2.0", "size": 12942 }
[ "junit.framework.Test", "org.apache.tools.ant.taskdefs.optional.junit.JUnitVersionHelper", "org.w3c.dom.Element" ]
import junit.framework.Test; import org.apache.tools.ant.taskdefs.optional.junit.JUnitVersionHelper; import org.w3c.dom.Element;
import junit.framework.*; import org.apache.tools.ant.taskdefs.optional.junit.*; import org.w3c.dom.*;
[ "junit.framework", "org.apache.tools", "org.w3c.dom" ]
junit.framework; org.apache.tools; org.w3c.dom;
1,319,530
@Deprecated public List<String> projection() { return getProjection(); }
List<String> function() { return getProjection(); }
/** * Returns the projection for this query. */
Returns the projection for this query
projection
{ "repo_name": "jabubake/google-cloud-java", "path": "google-cloud-datastore/src/main/java/com/google/cloud/datastore/StructuredQuery.java", "license": "apache-2.0", "size": 33477 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,010,314
public Object create(Class<?>[] paramTypes, Object[] args, MethodHandler mh) throws NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException { Object obj = create(paramTypes, args); ((Proxy)obj).setHandler(mh); return obj; }
Object function(Class<?>[] paramTypes, Object[] args, MethodHandler mh) throws NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException { Object obj = create(paramTypes, args); ((Proxy)obj).setHandler(mh); return obj; }
/** * Creates a proxy class and returns an instance of that class. * * @param paramTypes parameter types for a constructor. * @param args arguments passed to a constructor. * @param mh the method handler for the proxy class. * @since 3.4 */
Creates a proxy class and returns an instance of that class
create
{ "repo_name": "HotswapProjects/HotswapAgent", "path": "hotswap-agent-core/src/main/java/org/hotswap/agent/javassist/util/proxy/ProxyFactory.java", "license": "gpl-2.0", "size": 61851 }
[ "java.lang.reflect.InvocationTargetException" ]
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
2,275,283
private void store() { HashSet<String> enabledModuleNames = new HashSet<>(); HashSet<String> disabledModuleNames = new HashSet<>(); for (IngestModuleTemplate moduleTemplate : moduleTemplates) { saveModuleSettings(moduleTemplate.getModuleFactory(), moduleTemplate.getModuleSettings()); String moduleName = moduleTemplate.getModuleName(); if (moduleTemplate.isEnabled()) { enabledModuleNames.add(moduleName); } else { disabledModuleNames.add(moduleName); } } ModuleSettings.setConfigSetting(this.context, ENABLED_MODULES_KEY, makeCommaSeparatedValuesList(enabledModuleNames)); ModuleSettings.setConfigSetting(this.context, DISABLED_MODULES_KEY, makeCommaSeparatedValuesList(disabledModuleNames)); String processUnalloc = Boolean.toString(this.processUnallocatedSpace); ModuleSettings.setConfigSetting(this.context, PARSE_UNALLOC_SPACE_KEY, processUnalloc); }
void function() { HashSet<String> enabledModuleNames = new HashSet<>(); HashSet<String> disabledModuleNames = new HashSet<>(); for (IngestModuleTemplate moduleTemplate : moduleTemplates) { saveModuleSettings(moduleTemplate.getModuleFactory(), moduleTemplate.getModuleSettings()); String moduleName = moduleTemplate.getModuleName(); if (moduleTemplate.isEnabled()) { enabledModuleNames.add(moduleName); } else { disabledModuleNames.add(moduleName); } } ModuleSettings.setConfigSetting(this.context, ENABLED_MODULES_KEY, makeCommaSeparatedValuesList(enabledModuleNames)); ModuleSettings.setConfigSetting(this.context, DISABLED_MODULES_KEY, makeCommaSeparatedValuesList(disabledModuleNames)); String processUnalloc = Boolean.toString(this.processUnallocatedSpace); ModuleSettings.setConfigSetting(this.context, PARSE_UNALLOC_SPACE_KEY, processUnalloc); }
/** * Saves the ingest job settings for this context. */
Saves the ingest job settings for this context
store
{ "repo_name": "maxrp/autopsy", "path": "Core/src/org/sleuthkit/autopsy/ingest/IngestJobSettings.java", "license": "apache-2.0", "size": 18774 }
[ "java.util.HashSet", "org.sleuthkit.autopsy.coreutils.ModuleSettings" ]
import java.util.HashSet; import org.sleuthkit.autopsy.coreutils.ModuleSettings;
import java.util.*; import org.sleuthkit.autopsy.coreutils.*;
[ "java.util", "org.sleuthkit.autopsy" ]
java.util; org.sleuthkit.autopsy;
1,911,459
public Time getTime(int columnIndex) throws SQLException { TimeData t = (TimeData) getColumnInType(columnIndex, Type.SQL_TIME); if (t == null) { return null; } return (Time) Type.SQL_TIME.convertSQLToJava(session, t); }
Time function(int columnIndex) throws SQLException { TimeData t = (TimeData) getColumnInType(columnIndex, Type.SQL_TIME); if (t == null) { return null; } return (Time) Type.SQL_TIME.convertSQLToJava(session, t); }
/** * <!-- start generic documentation --> * Retrieves the value of the designated column in the current row * of this <code>ResultSet</code> object as * a <code>java.sql.Time</code> object in the Java programming language. * <!-- end generic documentation --> * * @param columnIndex the first column is 1, the second is 2, ... * @return the column value; if the value is SQL <code>NULL</code>, the * value returned is <code>null</code> * @exception SQLException if a database access error occurs or this method is * called on a closed result set */
Retrieves the value of the designated column in the current row of this <code>ResultSet</code> object as a <code>java.sql.Time</code> object in the Java programming language.
getTime
{ "repo_name": "apavlo/h-store", "path": "src/hsqldb19b3/org/hsqldb/jdbc/JDBCResultSet.java", "license": "gpl-3.0", "size": 304688 }
[ "java.sql.SQLException", "java.sql.Time", "org.hsqldb.types.TimeData", "org.hsqldb.types.Type" ]
import java.sql.SQLException; import java.sql.Time; import org.hsqldb.types.TimeData; import org.hsqldb.types.Type;
import java.sql.*; import org.hsqldb.types.*;
[ "java.sql", "org.hsqldb.types" ]
java.sql; org.hsqldb.types;
2,170,903
public AllocationCommands add(AllocationCommand... commands) { if (commands != null) { this.commands.addAll(Arrays.asList(commands)); } return this; }
AllocationCommands function(AllocationCommand... commands) { if (commands != null) { this.commands.addAll(Arrays.asList(commands)); } return this; }
/** * Adds a set of commands to this collection * @param commands Array of commands to add to this instance * @return {@link AllocationCommands} with the given commands added */
Adds a set of commands to this collection
add
{ "repo_name": "jimczi/elasticsearch", "path": "core/src/main/java/org/elasticsearch/cluster/routing/allocation/command/AllocationCommands.java", "license": "apache-2.0", "size": 7875 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
2,344,544
private void unpush( char token ) { if ( undo == null ) undo = new ArrayList<Character>(); undo.add(0,token); } // private char nextChar() // { // if ( undo != null && undo.size() > 0 ) // return undo.remove(0); // else if ( offset == text.length() ) // return (char)-1; // else if ( offset < text.length() ) // return text.charAt(offset++); // else // return (char)-1; // }
void function( char token ) { if ( undo == null ) undo = new ArrayList<Character>(); undo.add(0,token); }
/** * When going backwards we need to "push" to the front of the queue * @param token the token to unpush */
When going backwards we need to "push" to the front of the queue
unpush
{ "repo_name": "Ecdosis/NMergeNew", "path": "src/edu/luc/nmerge/mvd/navigator/TextNavigator.java", "license": "gpl-2.0", "size": 17023 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
2,052,228
public boolean isExpired() { return System.currentTimeMillis() - timeLastSeen > arpEntryTimeoutConfig; } } public ArpCache() { arpCache = new ConcurrentHashMap<InetAddress, ArpCacheEntry>(); kvArpCache = new KVArpCache(); }
boolean function() { return System.currentTimeMillis() - timeLastSeen > arpEntryTimeoutConfig; } } public ArpCache() { arpCache = new ConcurrentHashMap<InetAddress, ArpCacheEntry>(); kvArpCache = new KVArpCache(); }
/** * Returns whether the entry has timed out or not. * * @return true if the entry has timed out. */
Returns whether the entry has timed out or not
isExpired
{ "repo_name": "opennetworkinglab/spring-open", "path": "src/main/java/net/onrc/onos/apps/proxyarp/ArpCache.java", "license": "apache-2.0", "size": 6657 }
[ "java.net.InetAddress", "java.util.concurrent.ConcurrentHashMap", "net.onrc.onos.core.datastore.KVArpCache" ]
import java.net.InetAddress; import java.util.concurrent.ConcurrentHashMap; import net.onrc.onos.core.datastore.KVArpCache;
import java.net.*; import java.util.concurrent.*; import net.onrc.onos.core.datastore.*;
[ "java.net", "java.util", "net.onrc.onos" ]
java.net; java.util; net.onrc.onos;
2,471,278
public void setGitRepo(Git gitRepo) throws DeploymentException { this.gitRepo = gitRepo; try { StoredConfig config = gitRepo.getRepository().getConfig(); config.setBoolean(ConfigConstants.CONFIG_CORE_SECTION, null, ConfigConstants.CONFIG_KEY_FILEMODE, true); config.save(); } catch (IOException e) { log.error("There was an error saving the git configuration to disk", e); throw new DeploymentException("Could not save git configuration: " + e.getMessage()); } }
void function(Git gitRepo) throws DeploymentException { this.gitRepo = gitRepo; try { StoredConfig config = gitRepo.getRepository().getConfig(); config.setBoolean(ConfigConstants.CONFIG_CORE_SECTION, null, ConfigConstants.CONFIG_KEY_FILEMODE, true); config.save(); } catch (IOException e) { log.error(STR, e); throw new DeploymentException(STR + e.getMessage()); } }
/** * Sets the git repository object. Probably not useful but here for Java Bean completeness * * @param gitRepo - git repository to set it to */
Sets the git repository object. Probably not useful but here for Java Bean completeness
setGitRepo
{ "repo_name": "infochimps-forks/ezbake-platform-services", "path": "deployer/service/src/main/java/ezbake/deployer/publishers/openShift/RhcApplication.java", "license": "apache-2.0", "size": 21242 }
[ "java.io.IOException", "org.eclipse.jgit.api.Git", "org.eclipse.jgit.lib.ConfigConstants", "org.eclipse.jgit.lib.StoredConfig" ]
import java.io.IOException; import org.eclipse.jgit.api.Git; import org.eclipse.jgit.lib.ConfigConstants; import org.eclipse.jgit.lib.StoredConfig;
import java.io.*; import org.eclipse.jgit.api.*; import org.eclipse.jgit.lib.*;
[ "java.io", "org.eclipse.jgit" ]
java.io; org.eclipse.jgit;
1,530,711
protected ModelAndView handleAsyncRequestTimeoutException(AsyncRequestTimeoutException ex, HttpServletRequest request, HttpServletResponse response, Object handler) throws IOException { if (!response.isCommitted()) { response.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE); } else if (logger.isErrorEnabled()) { logger.error("Async timeout for " + request.getMethod() + " [" + request.getRequestURI() + "]"); } return new ModelAndView(); }
ModelAndView function(AsyncRequestTimeoutException ex, HttpServletRequest request, HttpServletResponse response, Object handler) throws IOException { if (!response.isCommitted()) { response.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE); } else if (logger.isErrorEnabled()) { logger.error(STR + request.getMethod() + STR + request.getRequestURI() + "]"); } return new ModelAndView(); }
/** * Handle the case where an async request timed out. * <p>The default implementation sends an HTTP 503 error. * @param ex the {@link AsyncRequestTimeoutException }to be handled * @param request current HTTP request * @param response current HTTP response * @param handler the executed handler, or {@code null} if none chosen * at the time of the exception (for example, if multipart resolution failed) * @return an empty ModelAndView indicating the exception was handled * @throws IOException potentially thrown from response.sendError() * @since 4.2.8 */
Handle the case where an async request timed out. The default implementation sends an HTTP 503 error
handleAsyncRequestTimeoutException
{ "repo_name": "boggad/jdk9-sample", "path": "sample-catalog/spring-jdk9/src/spring.webmvc/org/springframework/web/servlet/mvc/support/DefaultHandlerExceptionResolver.java", "license": "mit", "size": 22772 }
[ "java.io.IOException", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse", "org.springframework.web.context.request.async.AsyncRequestTimeoutException", "org.springframework.web.servlet.ModelAndView" ]
import java.io.IOException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.springframework.web.context.request.async.AsyncRequestTimeoutException; import org.springframework.web.servlet.ModelAndView;
import java.io.*; import javax.servlet.http.*; import org.springframework.web.context.request.async.*; import org.springframework.web.servlet.*;
[ "java.io", "javax.servlet", "org.springframework.web" ]
java.io; javax.servlet; org.springframework.web;
1,594,684
private ParserFromHTML<Chord> getSoloChordParser() { return new SoloChordParser(); }
ParserFromHTML<Chord> function() { return new SoloChordParser(); }
/** * Used as method for fast and harmless changing of SongChords parser. * * @return song chords summary parser */
Used as method for fast and harmless changing of SongChords parser
getSoloChordParser
{ "repo_name": "programmerr47/guitar-chords", "path": "app/src/main/java/com/github/programmerr47/chords/api/parsers/html/ChordsParser.java", "license": "mit", "size": 2031 }
[ "com.github.programmerr47.chords.api.objects.Chord" ]
import com.github.programmerr47.chords.api.objects.Chord;
import com.github.programmerr47.chords.api.objects.*;
[ "com.github.programmerr47" ]
com.github.programmerr47;
2,149,282
public static boolean isBracketing(UnivariateFunction function, final double lower, final double upper) throws NullArgumentException { if (function == null) { throw new NullArgumentException(LocalizedFormats.FUNCTION); } final double fLo = function.value(lower); final double fHi = function.value(upper); return (fLo >= 0 && fHi <= 0) || (fLo <= 0 && fHi >= 0); }
static boolean function(UnivariateFunction function, final double lower, final double upper) throws NullArgumentException { if (function == null) { throw new NullArgumentException(LocalizedFormats.FUNCTION); } final double fLo = function.value(lower); final double fHi = function.value(upper); return (fLo >= 0 && fHi <= 0) (fLo <= 0 && fHi >= 0); }
/** * Check whether the interval bounds bracket a root. That is, if the * values at the endpoints are not equal to zero, then the function takes * opposite signs at the endpoints. * * @param function Function. * @param lower Lower endpoint. * @param upper Upper endpoint. * @return {@code true} if the function values have opposite signs at the * given points. * @throws NullArgumentException if {@code function} is {@code null}. */
Check whether the interval bounds bracket a root. That is, if the values at the endpoints are not equal to zero, then the function takes opposite signs at the endpoints
isBracketing
{ "repo_name": "SpoonLabs/astor", "path": "examples/math_5/src/main/java/org/apache/commons/math3/analysis/solvers/UnivariateSolverUtils.java", "license": "gpl-2.0", "size": 16630 }
[ "org.apache.commons.math3.analysis.UnivariateFunction", "org.apache.commons.math3.exception.NullArgumentException", "org.apache.commons.math3.exception.util.LocalizedFormats" ]
import org.apache.commons.math3.analysis.UnivariateFunction; import org.apache.commons.math3.exception.NullArgumentException; import org.apache.commons.math3.exception.util.LocalizedFormats;
import org.apache.commons.math3.analysis.*; import org.apache.commons.math3.exception.*; import org.apache.commons.math3.exception.util.*;
[ "org.apache.commons" ]
org.apache.commons;
811,339
@CanIgnoreReturnValue @NonNullDecl public static <T extends Object> T checkNotNull( @NonNullDecl T obj, @NullableDecl String errorMessageTemplate, char p1) { if (obj == null) { throw new NullPointerException(lenientFormat(errorMessageTemplate, p1)); } return obj; }
static <T extends Object> T function( @NonNullDecl T obj, @NullableDecl String errorMessageTemplate, char p1) { if (obj == null) { throw new NullPointerException(lenientFormat(errorMessageTemplate, p1)); } return obj; }
/** * Ensures that an object reference passed as a parameter to the calling method is not null. * * <p>See {@link #checkNotNull(Object, String, Object...)} for details. * * @since 20.0 (varargs overload since 2.0) */
Ensures that an object reference passed as a parameter to the calling method is not null. See <code>#checkNotNull(Object, String, Object...)</code> for details
checkNotNull
{ "repo_name": "typetools/guava", "path": "android/guava/src/com/google/common/base/Preconditions.java", "license": "apache-2.0", "size": 53950 }
[ "org.checkerframework.checker.nullness.compatqual.NonNullDecl", "org.checkerframework.checker.nullness.compatqual.NullableDecl" ]
import org.checkerframework.checker.nullness.compatqual.NonNullDecl; import org.checkerframework.checker.nullness.compatqual.NullableDecl;
import org.checkerframework.checker.nullness.compatqual.*;
[ "org.checkerframework.checker" ]
org.checkerframework.checker;
1,562,487
@Override public Request onInit( ) { RetrieveCmd rc = ( RetrieveCmd )CommandFactory.create( RetrieveCmd.class, this ); retrieveCmd = rc; setArgs( ( Data )getFormConfig( ).getAttribute( FormConfig.ARGS ) ); return( rc.getRequest( ) ); }
Request function( ) { RetrieveCmd rc = ( RetrieveCmd )CommandFactory.create( RetrieveCmd.class, this ); retrieveCmd = rc; setArgs( ( Data )getFormConfig( ).getAttribute( FormConfig.ARGS ) ); return( rc.getRequest( ) ); }
/** * Default implementation sets retrieval arguments and filtering condition (if necessary) * * @see org.homedns.mkh.dataservice.client.view.View#onInit() */
Default implementation sets retrieval arguments and filtering condition (if necessary)
onInit
{ "repo_name": "khomisha/ui", "path": "src/main/java/org/homedns/mkh/ui/client/form/BoundForm.java", "license": "apache-2.0", "size": 15080 }
[ "org.homedns.mkh.dataservice.shared.Data", "org.homedns.mkh.dataservice.shared.Request", "org.homedns.mkh.ui.client.command.CommandFactory", "org.homedns.mkh.ui.client.command.RetrieveCmd" ]
import org.homedns.mkh.dataservice.shared.Data; import org.homedns.mkh.dataservice.shared.Request; import org.homedns.mkh.ui.client.command.CommandFactory; import org.homedns.mkh.ui.client.command.RetrieveCmd;
import org.homedns.mkh.dataservice.shared.*; import org.homedns.mkh.ui.client.command.*;
[ "org.homedns.mkh" ]
org.homedns.mkh;
776,994
public synchronized boolean updateCurrentValueOnDisk( Long oldValue, Long newValue ) throws StandardException { LanguageConnectionContext lcc = getLCC(); // // Not having an LCC should mean that we are in the middle of engine // shutdown. We get here only to flush the current value to disk so that // we don't leak unused sequence numbers. See DERBY-5398. // if ( lcc == null ) { if (SanityManager.DEBUG) { SanityManager.ASSERT( oldValue == null, "We should be flushing unused sequence values here." ); } ContextService csf = getContextService(); ContextManager cm = csf.getCurrentContextManager(); AccessFactory af = _dd.af; TransactionController dummyTransaction = af.getTransaction( cm ); boolean retval = updateCurrentValueOnDisk( dummyTransaction, oldValue, newValue, false ); dummyTransaction.commit(); dummyTransaction.destroy(); return retval; } TransactionController executionTransaction = lcc.getTransactionExecute(); TransactionController nestedTransaction = executionTransaction.startNestedUserTransaction( false, true ); if ( nestedTransaction != null ) { boolean retval = false; boolean escalateToParentTransaction = false; try { retval = updateCurrentValueOnDisk( nestedTransaction, oldValue, newValue, false ); } catch (StandardException se) { if ( !se.isLockTimeout() ) { if ( se.isSelfDeadlock() ) { // We're blocked by a lock held by our parent transaction. // Escalate into the parent transaction now. See DERBY-6554. escalateToParentTransaction = true; } else { Monitor.logThrowable( se ); throw se; } } } finally { // DERBY-5494, if this commit does not flush log then an // unorderly shutdown could lose the update. Do not use // commitNoSync(), and store needs to flush user nested update // transaction commits by default. nestedTransaction.commit(); nestedTransaction.destroy(); if ( escalateToParentTransaction ) { retval = updateCurrentValueOnDisk( executionTransaction, oldValue, newValue, false ); } return retval; } } // If we get here, we failed to do the work in the nested transaction. // We might be self-deadlocking if the user has selected from SYSSEQUENCES // contrary to our advice. throw tooMuchContentionException(); } /////////////////////////////////////////////////////////////////////////////////// // // UTILITY MINIONS // ///////////////////////////////////////////////////////////////////////////////////
synchronized boolean function( Long oldValue, Long newValue ) throws StandardException { LanguageConnectionContext lcc = getLCC(); { if (SanityManager.DEBUG) { SanityManager.ASSERT( oldValue == null, STR ); } ContextService csf = getContextService(); ContextManager cm = csf.getCurrentContextManager(); AccessFactory af = _dd.af; TransactionController dummyTransaction = af.getTransaction( cm ); boolean retval = updateCurrentValueOnDisk( dummyTransaction, oldValue, newValue, false ); dummyTransaction.commit(); dummyTransaction.destroy(); return retval; } TransactionController executionTransaction = lcc.getTransactionExecute(); TransactionController nestedTransaction = executionTransaction.startNestedUserTransaction( false, true ); if ( nestedTransaction != null ) { boolean retval = false; boolean escalateToParentTransaction = false; try { retval = updateCurrentValueOnDisk( nestedTransaction, oldValue, newValue, false ); } catch (StandardException se) { if ( !se.isLockTimeout() ) { if ( se.isSelfDeadlock() ) { escalateToParentTransaction = true; } else { Monitor.logThrowable( se ); throw se; } } } finally { nestedTransaction.commit(); nestedTransaction.destroy(); if ( escalateToParentTransaction ) { retval = updateCurrentValueOnDisk( executionTransaction, oldValue, newValue, false ); } return retval; } } throw tooMuchContentionException(); }
/** * <p> * Update the value on disk. Does its work in a subtransaction of the user's * execution transaction. If that fails, raises a TOO MUCH CONTENTION exception. * </p> * * @return Returns true if the value was successfully updated, false if we lost a race with another session. * */
Update the value on disk. Does its work in a subtransaction of the user's execution transaction. If that fails, raises a TOO MUCH CONTENTION exception.
updateCurrentValueOnDisk
{ "repo_name": "apache/derby", "path": "java/org.apache.derby.engine/org/apache/derby/impl/sql/catalog/SequenceUpdater.java", "license": "apache-2.0", "size": 27815 }
[ "org.apache.derby.iapi.services.context.ContextManager", "org.apache.derby.iapi.services.context.ContextService", "org.apache.derby.iapi.services.monitor.Monitor", "org.apache.derby.iapi.sql.conn.LanguageConnectionContext", "org.apache.derby.iapi.store.access.AccessFactory", "org.apache.derby.iapi.store.access.TransactionController", "org.apache.derby.shared.common.error.StandardException", "org.apache.derby.shared.common.sanity.SanityManager" ]
import org.apache.derby.iapi.services.context.ContextManager; import org.apache.derby.iapi.services.context.ContextService; import org.apache.derby.iapi.services.monitor.Monitor; import org.apache.derby.iapi.sql.conn.LanguageConnectionContext; import org.apache.derby.iapi.store.access.AccessFactory; import org.apache.derby.iapi.store.access.TransactionController; import org.apache.derby.shared.common.error.StandardException; import org.apache.derby.shared.common.sanity.SanityManager;
import org.apache.derby.iapi.services.context.*; import org.apache.derby.iapi.services.monitor.*; import org.apache.derby.iapi.sql.conn.*; import org.apache.derby.iapi.store.access.*; import org.apache.derby.shared.common.error.*; import org.apache.derby.shared.common.sanity.*;
[ "org.apache.derby" ]
org.apache.derby;
216,720
public void addPage(WizardPage page);
void function(WizardPage page);
/** * adds a page to the stack. used for dynamic adding * * @param page * the page to be added */
adds a page to the stack. used for dynamic adding
addPage
{ "repo_name": "VT-Visionarium/osnap", "path": "src/main/java/edu/vt/arc/vis/osnap/gui/wizards/IWizard.java", "license": "apache-2.0", "size": 3344 }
[ "edu.vt.arc.vis.osnap.gui.wizards.pages.WizardPage" ]
import edu.vt.arc.vis.osnap.gui.wizards.pages.WizardPage;
import edu.vt.arc.vis.osnap.gui.wizards.pages.*;
[ "edu.vt.arc" ]
edu.vt.arc;
709,307
USqlTableType getTableType(String accountName, String databaseName, String schemaName, String tableTypeName);
USqlTableType getTableType(String accountName, String databaseName, String schemaName, String tableTypeName);
/** * Retrieves the specified table type from the Data Lake Analytics catalog. * * @param accountName The Azure Data Lake Analytics account upon which to execute catalog operations. * @param databaseName The name of the database containing the table type. * @param schemaName The name of the schema containing the table type. * @param tableTypeName The name of the table type to retrieve. * @return the USqlTableType object if successful. */
Retrieves the specified table type from the Data Lake Analytics catalog
getTableType
{ "repo_name": "anudeepsharma/azure-sdk-for-java", "path": "azure-mgmt-datalake-analytics/src/main/java/com/microsoft/azure/management/datalake/analytics/Catalogs.java", "license": "mit", "size": 188313 }
[ "com.microsoft.azure.management.datalake.analytics.models.USqlTableType" ]
import com.microsoft.azure.management.datalake.analytics.models.USqlTableType;
import com.microsoft.azure.management.datalake.analytics.models.*;
[ "com.microsoft.azure" ]
com.microsoft.azure;
41,331
private static FrameBlock convertToTransformMetaDataFrame(int rows, String[] colnames, List<Integer> rcIDs, List<Integer> binIDs, HashMap<String,String> meta, HashMap<String,String> mvmeta) throws IOException { //create frame block w/ pure string schema ValueType[] schema = UtilFunctions.nCopies(colnames.length, ValueType.STRING); FrameBlock ret = new FrameBlock(schema, colnames); ret.ensureAllocatedColumns(rows); //encode recode maps (recoding/dummycoding) into frame for( Integer colID : rcIDs ) { String name = colnames[colID-1]; String map = meta.get(name); if( map == null ) throw new IOException("Recode map for column '"+name+"' (id="+colID+") not existing."); InputStream is = new ByteArrayInputStream(map.getBytes("UTF-8")); BufferedReader br = new BufferedReader(new InputStreamReader(is)); Pair<String,String> pair = new Pair<>(); String line; int rpos = 0; while( (line = br.readLine()) != null ) { DecoderRecode.parseRecodeMapEntry(line, pair); String tmp = pair.getKey() + Lop.DATATYPE_PREFIX + pair.getValue(); ret.set(rpos++, colID-1, tmp); } ret.getColumnMetadata(colID-1).setNumDistinct((long)rpos); } //encode bin maps (binning) into frame for( Integer colID : binIDs ) { String name = colnames[colID-1]; String map = meta.get(name); if( map == null ) throw new IOException("Binning map for column '"+name+"' (id="+colID+") not existing."); String[] fields = map.split(TfUtils.TXMTD_SEP); double min = UtilFunctions.parseToDouble(fields[1]); double binwidth = UtilFunctions.parseToDouble(fields[3]); int nbins = UtilFunctions.parseToInt(fields[4]); //materialize bins to support equi-width/equi-height for( int i=0; i<nbins; i++ ) { String lbound = String.valueOf(min+i*binwidth); String ubound = String.valueOf(min+(i+1)*binwidth); ret.set(i, colID-1, lbound+Lop.DATATYPE_PREFIX+ubound); } ret.getColumnMetadata(colID-1).setNumDistinct((long)nbins); } //encode impute meta data into frame for( Entry<String, String> e : mvmeta.entrySet() ) { int colID = ArrayUtils.indexOf(colnames, e.getKey()) + 1; String mvVal = e.getValue().split(TfUtils.TXMTD_SEP)[1]; ret.getColumnMetadata(colID-1).setMvValue(mvVal); } return ret; }
static FrameBlock function(int rows, String[] colnames, List<Integer> rcIDs, List<Integer> binIDs, HashMap<String,String> meta, HashMap<String,String> mvmeta) throws IOException { ValueType[] schema = UtilFunctions.nCopies(colnames.length, ValueType.STRING); FrameBlock ret = new FrameBlock(schema, colnames); ret.ensureAllocatedColumns(rows); for( Integer colID : rcIDs ) { String name = colnames[colID-1]; String map = meta.get(name); if( map == null ) throw new IOException(STR+name+STR+colID+STR); InputStream is = new ByteArrayInputStream(map.getBytes("UTF-8")); BufferedReader br = new BufferedReader(new InputStreamReader(is)); Pair<String,String> pair = new Pair<>(); String line; int rpos = 0; while( (line = br.readLine()) != null ) { DecoderRecode.parseRecodeMapEntry(line, pair); String tmp = pair.getKey() + Lop.DATATYPE_PREFIX + pair.getValue(); ret.set(rpos++, colID-1, tmp); } ret.getColumnMetadata(colID-1).setNumDistinct((long)rpos); } for( Integer colID : binIDs ) { String name = colnames[colID-1]; String map = meta.get(name); if( map == null ) throw new IOException(STR+name+STR+colID+STR); String[] fields = map.split(TfUtils.TXMTD_SEP); double min = UtilFunctions.parseToDouble(fields[1]); double binwidth = UtilFunctions.parseToDouble(fields[3]); int nbins = UtilFunctions.parseToInt(fields[4]); for( int i=0; i<nbins; i++ ) { String lbound = String.valueOf(min+i*binwidth); String ubound = String.valueOf(min+(i+1)*binwidth); ret.set(i, colID-1, lbound+Lop.DATATYPE_PREFIX+ubound); } ret.getColumnMetadata(colID-1).setNumDistinct((long)nbins); } for( Entry<String, String> e : mvmeta.entrySet() ) { int colID = ArrayUtils.indexOf(colnames, e.getKey()) + 1; String mvVal = e.getValue().split(TfUtils.TXMTD_SEP)[1]; ret.getColumnMetadata(colID-1).setMvValue(mvVal); } return ret; }
/** * Converts transform meta data into an in-memory FrameBlock object. * * @param rows number of rows * @param colnames column names * @param rcIDs recode IDs * @param binIDs binning IDs * @param meta ? * @param mvmeta ? * @return frame block * @throws IOException if IOException occurs */
Converts transform meta data into an in-memory FrameBlock object
convertToTransformMetaDataFrame
{ "repo_name": "asurve/systemml", "path": "src/main/java/org/apache/sysml/runtime/transform/meta/TfMetaUtils.java", "license": "apache-2.0", "size": 14651 }
[ "java.io.BufferedReader", "java.io.ByteArrayInputStream", "java.io.IOException", "java.io.InputStream", "java.io.InputStreamReader", "java.util.HashMap", "java.util.List", "java.util.Map", "org.apache.commons.lang.ArrayUtils", "org.apache.sysml.lops.Lop", "org.apache.sysml.parser.Expression", "org.apache.sysml.runtime.matrix.data.FrameBlock", "org.apache.sysml.runtime.matrix.data.Pair", "org.apache.sysml.runtime.transform.TfUtils", "org.apache.sysml.runtime.transform.decode.DecoderRecode", "org.apache.sysml.runtime.util.UtilFunctions" ]
import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.commons.lang.ArrayUtils; import org.apache.sysml.lops.Lop; import org.apache.sysml.parser.Expression; import org.apache.sysml.runtime.matrix.data.FrameBlock; import org.apache.sysml.runtime.matrix.data.Pair; import org.apache.sysml.runtime.transform.TfUtils; import org.apache.sysml.runtime.transform.decode.DecoderRecode; import org.apache.sysml.runtime.util.UtilFunctions;
import java.io.*; import java.util.*; import org.apache.commons.lang.*; import org.apache.sysml.lops.*; import org.apache.sysml.parser.*; import org.apache.sysml.runtime.matrix.data.*; import org.apache.sysml.runtime.transform.*; import org.apache.sysml.runtime.transform.decode.*; import org.apache.sysml.runtime.util.*;
[ "java.io", "java.util", "org.apache.commons", "org.apache.sysml" ]
java.io; java.util; org.apache.commons; org.apache.sysml;
2,305,400
@FIXVersion(introduced = "4.2", retired = "4.3") @TagNumRef(tagNum = TagNum.SymbolSfx) public void setSymbolSfx(String symbolSfx) { getSafeInstrument().setSymbolSfx(symbolSfx); }
@FIXVersion(introduced = "4.2", retired = "4.3") @TagNumRef(tagNum = TagNum.SymbolSfx) void function(String symbolSfx) { getSafeInstrument().setSymbolSfx(symbolSfx); }
/** * Message field setter. * @param symbolSfx field value */
Message field setter
setSymbolSfx
{ "repo_name": "marvisan/HadesFIX", "path": "Model/src/main/java/net/hades/fix/message/SecurityDefinitionMsg.java", "license": "gpl-3.0", "size": 67355 }
[ "net.hades.fix.message.anno.FIXVersion", "net.hades.fix.message.anno.TagNumRef", "net.hades.fix.message.type.TagNum" ]
import net.hades.fix.message.anno.FIXVersion; import net.hades.fix.message.anno.TagNumRef; import net.hades.fix.message.type.TagNum;
import net.hades.fix.message.anno.*; import net.hades.fix.message.type.*;
[ "net.hades.fix" ]
net.hades.fix;
2,122,426
public void begin() { // jpa/1522 if (isActiveTransaction()) throw new IllegalStateException("begin() cannot be called when the entity transaction is already active."); _rollbackOnly = false; try { AmberConnection.this.beginTransaction(); } catch (SQLException e) { throw new PersistenceException(e); } }
void function() { if (isActiveTransaction()) throw new IllegalStateException(STR); _rollbackOnly = false; try { AmberConnection.this.beginTransaction(); } catch (SQLException e) { throw new PersistenceException(e); } }
/** * Starts a resource transaction. */
Starts a resource transaction
begin
{ "repo_name": "mdaniel/svn-caucho-com-resin", "path": "modules/resin/src/com/caucho/amber/manager/AmberConnection.java", "license": "gpl-2.0", "size": 89822 }
[ "java.sql.SQLException", "javax.persistence.PersistenceException" ]
import java.sql.SQLException; import javax.persistence.PersistenceException;
import java.sql.*; import javax.persistence.*;
[ "java.sql", "javax.persistence" ]
java.sql; javax.persistence;
2,569,578
@GwtCompatible(serializable = true) public static Ordering<Object> usingToString() { return UsingToStringOrdering.INSTANCE; }
@GwtCompatible(serializable = true) static Ordering<Object> function() { return UsingToStringOrdering.INSTANCE; }
/** * Returns an ordering that compares objects by the natural ordering of their string * representations as returned by {@code toString()}. It does not support null values. * * <p>The comparator is serializable. * * <p><b>Java 8 users:</b> Use {@code Comparator.comparing(Object::toString)} instead. */
Returns an ordering that compares objects by the natural ordering of their string representations as returned by toString(). It does not support null values. The comparator is serializable. Java 8 users: Use Comparator.comparing(Object::toString) instead
usingToString
{ "repo_name": "DavesMan/guava", "path": "guava/src/com/google/common/collect/Ordering.java", "license": "apache-2.0", "size": 40052 }
[ "com.google.common.annotations.GwtCompatible" ]
import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.*;
[ "com.google.common" ]
com.google.common;
767,066
EReference getDatabaseModel_DataTypes();
EReference getDatabaseModel_DataTypes();
/** * Returns the meta object for the containment reference list '{@link com.dbdesigner.model.relationaldatabase.DatabaseModel#getDataTypes <em>Data Types</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the containment reference list '<em>Data Types</em>'. * @see com.dbdesigner.model.relationaldatabase.DatabaseModel#getDataTypes() * @see #getDatabaseModel() * @generated */
Returns the meta object for the containment reference list '<code>com.dbdesigner.model.relationaldatabase.DatabaseModel#getDataTypes Data Types</code>'.
getDatabaseModel_DataTypes
{ "repo_name": "cadorca/rdb-designer", "path": "com.dbdesigner.design/src/com/dbdesigner/model/relationaldatabase/RelationalDatabasePackage.java", "license": "mit", "size": 40573 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
1,208,858
Connection vtDial(String dialString, UUSInfo uusInfo) throws CallStateException;
Connection vtDial(String dialString, UUSInfo uusInfo) throws CallStateException;
/** * Initiate a new video connection with supplementary User to User * Information. This happens asynchronously, so you cannot assume the audio * path is connected (or a call index has been assigned) until * PhoneStateChanged notification has occurred. * * @exception CallStateException if a new outgoing call is not currently * possible because no more call slots exist or a call exists * that is dialing, alerting, ringing, or waiting. Other * errors are handled asynchronously. */
Initiate a new video connection with supplementary User to User Information. This happens asynchronously, so you cannot assume the audio path is connected (or a call index has been assigned) until PhoneStateChanged notification has occurred
vtDial
{ "repo_name": "rex-xxx/mt6572_x201", "path": "packages/apps/Mms/src/com/mediatek/encapsulation/com/android/internal/telephony/EncapsulatedPhone.java", "license": "gpl-2.0", "size": 35666 }
[ "com.android.internal.telephony.CallStateException", "com.android.internal.telephony.Connection", "com.android.internal.telephony.UUSInfo" ]
import com.android.internal.telephony.CallStateException; import com.android.internal.telephony.Connection; import com.android.internal.telephony.UUSInfo;
import com.android.internal.telephony.*;
[ "com.android.internal" ]
com.android.internal;
2,710,211
private void extractRowKeyAndData(String line, DefaultCategoryDataset dataset, List columnKeys) { Comparable rowKey = null; int fieldIndex = 0; int start = 0; for (int i = 0; i < line.length(); i++) { if (line.charAt(i) == this.fieldDelimiter) { if (fieldIndex == 0) { // first field contains the row key String key = line.substring(start, i); rowKey = removeStringDelimiters(key); } else { // remaining fields contain values Double value = Double.valueOf( removeStringDelimiters(line.substring(start, i)) ); dataset.addValue( value, rowKey, (Comparable) columnKeys.get(fieldIndex - 1) ); } start = i + 1; fieldIndex++; } } Double value = Double.valueOf( removeStringDelimiters(line.substring(start, line.length())) ); dataset.addValue( value, rowKey, (Comparable) columnKeys.get(fieldIndex - 1) ); }
void function(String line, DefaultCategoryDataset dataset, List columnKeys) { Comparable rowKey = null; int fieldIndex = 0; int start = 0; for (int i = 0; i < line.length(); i++) { if (line.charAt(i) == this.fieldDelimiter) { if (fieldIndex == 0) { String key = line.substring(start, i); rowKey = removeStringDelimiters(key); } else { Double value = Double.valueOf( removeStringDelimiters(line.substring(start, i)) ); dataset.addValue( value, rowKey, (Comparable) columnKeys.get(fieldIndex - 1) ); } start = i + 1; fieldIndex++; } } Double value = Double.valueOf( removeStringDelimiters(line.substring(start, line.length())) ); dataset.addValue( value, rowKey, (Comparable) columnKeys.get(fieldIndex - 1) ); }
/** * Extracts the row key and data for a single line from the input source. * * @param line the line from the input source. * @param dataset the dataset to be populated. * @param columnKeys the column keys. */
Extracts the row key and data for a single line from the input source
extractRowKeyAndData
{ "repo_name": "fluidware/Eastwood-Charts", "path": "source/org/jfree/data/io/CSV.java", "license": "lgpl-2.1", "size": 6912 }
[ "java.util.List", "org.jfree.data.category.DefaultCategoryDataset" ]
import java.util.List; import org.jfree.data.category.DefaultCategoryDataset;
import java.util.*; import org.jfree.data.category.*;
[ "java.util", "org.jfree.data" ]
java.util; org.jfree.data;
1,721,324
@GwtIncompatible("reflection") public static Method getSubListOriginalListSetAffectsSubListLargeListMethod() { return getMethod(ListSubListTester.class, "testSubList_originalListSetAffectsSubListLargeList"); }
@GwtIncompatible(STR) static Method function() { return getMethod(ListSubListTester.class, STR); }
/** * Returns the {@link Method} instance for * {@link #testSubList_originalListSetAffectsSubListLargeList()} ()} so that * tests of {@link CopyOnWriteArrayList} can suppress them with * {@code FeatureSpecificTestSuiteBuilder.suppressing()} until <a * href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6570631">Sun bug * 6570631</a> is fixed. */
Returns the <code>Method</code> instance for <code>#testSubList_originalListSetAffectsSubListLargeList()</code> ()} so that tests of <code>CopyOnWriteArrayList</code> can suppress them with FeatureSpecificTestSuiteBuilder.suppressing() until Sun bug 6570631 is fixed
getSubListOriginalListSetAffectsSubListLargeListMethod
{ "repo_name": "npvincent/guava", "path": "guava-testlib/src/com/google/common/collect/testing/testers/ListSubListTester.java", "license": "apache-2.0", "size": 13990 }
[ "com.google.common.annotations.GwtIncompatible", "com.google.common.collect.testing.Helpers", "java.lang.reflect.Method" ]
import com.google.common.annotations.GwtIncompatible; import com.google.common.collect.testing.Helpers; import java.lang.reflect.Method;
import com.google.common.annotations.*; import com.google.common.collect.testing.*; import java.lang.reflect.*;
[ "com.google.common", "java.lang" ]
com.google.common; java.lang;
299,181
private void grantRoleInDepth(Node node, String role, String property) throws ValueFormatException, PathNotFoundException, javax.jcr.RepositoryException { if (node.isNodeType(Document.TYPE)) { grantRole(node, role, property); } else if (node.isNodeType(Folder.TYPE)) { grantRole(node, role, property); for (NodeIterator it = node.getNodes(); it.hasNext();) { Node child = it.nextNode(); grantRoleInDepth(child, role, property); } } else if (node.isNodeType(Mail.TYPE)) { grantRole(node, role, property); } else if (node.isNodeType(Note.LIST_TYPE)) { // Note nodes has no security } }
void function(Node node, String role, String property) throws ValueFormatException, PathNotFoundException, javax.jcr.RepositoryException { if (node.isNodeType(Document.TYPE)) { grantRole(node, role, property); } else if (node.isNodeType(Folder.TYPE)) { grantRole(node, role, property); for (NodeIterator it = node.getNodes(); it.hasNext();) { Node child = it.nextNode(); grantRoleInDepth(child, role, property); } } else if (node.isNodeType(Mail.TYPE)) { grantRole(node, role, property); } else if (node.isNodeType(Note.LIST_TYPE)) { } }
/** * Grant role recursively */
Grant role recursively
grantRoleInDepth
{ "repo_name": "papamas/DMS-KANGREG-XI-MANADO", "path": "src/main/java/com/openkm/module/jcr/JcrAuthModule.java", "license": "gpl-3.0", "size": 29465 }
[ "com.openkm.bean.Document", "com.openkm.bean.Folder", "com.openkm.bean.Mail", "com.openkm.bean.Note", "com.openkm.core.PathNotFoundException", "com.openkm.core.RepositoryException", "javax.jcr.Node", "javax.jcr.NodeIterator", "javax.jcr.ValueFormatException" ]
import com.openkm.bean.Document; import com.openkm.bean.Folder; import com.openkm.bean.Mail; import com.openkm.bean.Note; import com.openkm.core.PathNotFoundException; import com.openkm.core.RepositoryException; import javax.jcr.Node; import javax.jcr.NodeIterator; import javax.jcr.ValueFormatException;
import com.openkm.bean.*; import com.openkm.core.*; import javax.jcr.*;
[ "com.openkm.bean", "com.openkm.core", "javax.jcr" ]
com.openkm.bean; com.openkm.core; javax.jcr;
905,582
public List<MongoPsm> findByProjectAccession(String projectAccession) { return mongoPsmRepository.findByProjectAccession(projectAccession); }
List<MongoPsm> function(String projectAccession) { return mongoPsmRepository.findByProjectAccession(projectAccession); }
/** * Finds a PSM by a project accession. * @param projectAccession the project accession to search for * @return a list of PSMs corresponding to the provided project accession */
Finds a PSM by a project accession
findByProjectAccession
{ "repo_name": "PRIDE-Archive/mongo-psm-index-search", "path": "src/main/java/uk/ac/ebi/pride/psmindex/mongo/search/service/MongoPsmSearchService.java", "license": "apache-2.0", "size": 3124 }
[ "java.util.List", "uk.ac.ebi.pride.psmindex.mongo.search.model.MongoPsm" ]
import java.util.List; import uk.ac.ebi.pride.psmindex.mongo.search.model.MongoPsm;
import java.util.*; import uk.ac.ebi.pride.psmindex.mongo.search.model.*;
[ "java.util", "uk.ac.ebi" ]
java.util; uk.ac.ebi;
2,318,941
private void drawTextArea(final Graphics g) { g.setFont(GuiStatics.getFontCubellan()); if (title == null && planet != null) { StringBuilder sb = new StringBuilder(planet.generateInfoText(true, player)); if (player != null && planet.getPlanetPlayerInfo() != player && !planet.isGasGiant()) { if (planet.getTotalRadiationLevel() > player.getRace().getMaxRad()) { sb.append("High radiation! Maximum radiation is "); sb.append(player.getRace().getMaxRad()); } else { sb.append(player.getRace().getName()); sb.append(" can colonize this planet."); sb.append(" Planet has total value of "); sb.append(player.getWorldTypeValue( planet.getPlanetType().getWorldType())); sb.append("%."); } } int lastSpace = -1; int rowLen = 0; int maxRowLen = this.getWidth() / 12; if (maxRowLen == 0) { maxRowLen = 15; } for (int i = 0; i < sb.length(); i++) { if (sb.charAt(i) == ' ') { lastSpace = i; } if (sb.charAt(i) == '\n') { lastSpace = -1; rowLen = 0; } else { rowLen++; } if (rowLen > maxRowLen) { if (lastSpace != -1) { sb.setCharAt(lastSpace, '\n'); rowLen = i - lastSpace; lastSpace = -1; } else { sb.setCharAt(i, '\n'); lastSpace = -1; rowLen = 0; } } } String[] texts = sb.toString().split("\n"); int offsetX = (PLANET_X_OFFSET - backgroundImg.getWidth()) / 2 - GuiStatics.getTextWidth(GuiStatics.getFontCubellanBold(), texts[0]) / 2 + backgroundImg.getWidth() / 2; int offsetY = (PLANET_Y_OFFSET - backgroundImg.getHeight()) / 2; if (planet.isGasGiant()) { offsetY = offsetY + 200; } if (offsetY < 75) { offsetY = 75; } g.setFont(GuiStatics.getFontCubellanBold()); drawBoldText(g, GuiStatics.COLOR_COOL_SPACE_BLUE_DARK_TRANS, GuiStatics.COLOR_COOL_SPACE_BLUE_TRANS, offsetX, offsetY, texts[0]); if (planet.getPlanetPlayerInfo() != null) { offsetX = (PLANET_X_OFFSET - backgroundImg.getWidth()) / 2 - GuiStatics.getTextWidth(GuiStatics.getFontCubellanBold(), planet.getPlanetPlayerInfo().getEmpireName()) / 2 + backgroundImg.getWidth() / 2; drawBoldText(g, GuiStatics.COLOR_COOL_SPACE_BLUE_DARK_TRANS, GuiStatics.COLOR_COOL_SPACE_BLUE_TRANS, offsetX, offsetY + 25, planet.getPlanetPlayerInfo().getEmpireName()); } g.setFont(GuiStatics.getFontCubellan()); for (int i = 1; i < texts.length; i++) { drawBoldText(g, GuiStatics.COLOR_COOL_SPACE_BLUE_DARK_TRANS, GuiStatics.COLOR_COOL_SPACE_BLUE_TRANS, 25, this.getHeight() / 2 + i * 15, texts[i]); } if (planet.getOrbital() != null) { texts = planet.getOrbital().getDescription().split("\n"); g.setFont(GuiStatics.getFontCubellan()); offsetX = 0; for (int i = 0; i < texts.length; i++) { int value = GuiStatics.getTextWidth(GuiStatics.getFontCubellan(), texts[i]); if (value > offsetX) { offsetX = value; } } for (int i = 0; i < texts.length; i++) { drawBoldText(g, GuiStatics.COLOR_COOL_SPACE_BLUE_DARK_TRANS, GuiStatics.COLOR_COOL_SPACE_BLUE_TRANS, this.getWidth() / 2 - offsetX - 20, this.getHeight() / 2 - (texts.length + 2) * 15 + i * 15, texts[i]); } } } else { if (title == null) { title = "In Deep Space..."; } g.setFont(GuiStatics.getFontCubellanBoldBig()); int offsetX = 50; int offsetY = 75; if (backgroundImg != null) { offsetX = (this.getWidth() - backgroundImg.getWidth()) / 2 - GuiStatics .getTextWidth(GuiStatics.getFontCubellanBoldBig(), title) / 2 + backgroundImg.getWidth() / 2; offsetY = (PLANET_Y_OFFSET - backgroundImg.getHeight()) / 2; if (planet.isGasGiant()) { offsetY = offsetY + 100; } if (offsetY < 75) { offsetY = 75; } if (textInMiddle) { offsetY = (this.getHeight() - backgroundImg.getHeight()) / 2 - GuiStatics.getTextHeight(GuiStatics.getFontCubellanBoldBig(), title) / 2; } } drawBoldText(g, GuiStatics.COLOR_COOL_SPACE_BLUE_DARK, GuiStatics.COLOR_COOL_SPACE_BLUE, offsetX, offsetY, title); } if (textInformation != null) { String[] texts = textInformation.split("\n"); g.setFont(GuiStatics.getFontCubellan()); int offsetX = 0; for (int i = 0; i < texts.length; i++) { int value = GuiStatics.getTextWidth(GuiStatics.getFontCubellan(), texts[i]); if (value > offsetX) { offsetX = value; } } for (int i = 0; i < texts.length; i++) { drawBoldText(g, GuiStatics.COLOR_COOL_SPACE_BLUE_DARK_TRANS, GuiStatics.COLOR_COOL_SPACE_BLUE_TRANS, this.getWidth() - offsetX - 20, this.getHeight() - (texts.length + 2) * 15 + i * 15, texts[i]); } } } private static final int SHIP_OFFSET_X = 332; private static final int SHIP_OFFSET_Y = 332;
void function(final Graphics g) { g.setFont(GuiStatics.getFontCubellan()); if (title == null && planet != null) { StringBuilder sb = new StringBuilder(planet.generateInfoText(true, player)); if (player != null && planet.getPlanetPlayerInfo() != player && !planet.isGasGiant()) { if (planet.getTotalRadiationLevel() > player.getRace().getMaxRad()) { sb.append(STR); sb.append(player.getRace().getMaxRad()); } else { sb.append(player.getRace().getName()); sb.append(STR); sb.append(STR); sb.append(player.getWorldTypeValue( planet.getPlanetType().getWorldType())); sb.append("%."); } } int lastSpace = -1; int rowLen = 0; int maxRowLen = this.getWidth() / 12; if (maxRowLen == 0) { maxRowLen = 15; } for (int i = 0; i < sb.length(); i++) { if (sb.charAt(i) == ' ') { lastSpace = i; } if (sb.charAt(i) == '\n') { lastSpace = -1; rowLen = 0; } else { rowLen++; } if (rowLen > maxRowLen) { if (lastSpace != -1) { sb.setCharAt(lastSpace, '\n'); rowLen = i - lastSpace; lastSpace = -1; } else { sb.setCharAt(i, '\n'); lastSpace = -1; rowLen = 0; } } } String[] texts = sb.toString().split("\n"); int offsetX = (PLANET_X_OFFSET - backgroundImg.getWidth()) / 2 - GuiStatics.getTextWidth(GuiStatics.getFontCubellanBold(), texts[0]) / 2 + backgroundImg.getWidth() / 2; int offsetY = (PLANET_Y_OFFSET - backgroundImg.getHeight()) / 2; if (planet.isGasGiant()) { offsetY = offsetY + 200; } if (offsetY < 75) { offsetY = 75; } g.setFont(GuiStatics.getFontCubellanBold()); drawBoldText(g, GuiStatics.COLOR_COOL_SPACE_BLUE_DARK_TRANS, GuiStatics.COLOR_COOL_SPACE_BLUE_TRANS, offsetX, offsetY, texts[0]); if (planet.getPlanetPlayerInfo() != null) { offsetX = (PLANET_X_OFFSET - backgroundImg.getWidth()) / 2 - GuiStatics.getTextWidth(GuiStatics.getFontCubellanBold(), planet.getPlanetPlayerInfo().getEmpireName()) / 2 + backgroundImg.getWidth() / 2; drawBoldText(g, GuiStatics.COLOR_COOL_SPACE_BLUE_DARK_TRANS, GuiStatics.COLOR_COOL_SPACE_BLUE_TRANS, offsetX, offsetY + 25, planet.getPlanetPlayerInfo().getEmpireName()); } g.setFont(GuiStatics.getFontCubellan()); for (int i = 1; i < texts.length; i++) { drawBoldText(g, GuiStatics.COLOR_COOL_SPACE_BLUE_DARK_TRANS, GuiStatics.COLOR_COOL_SPACE_BLUE_TRANS, 25, this.getHeight() / 2 + i * 15, texts[i]); } if (planet.getOrbital() != null) { texts = planet.getOrbital().getDescription().split("\n"); g.setFont(GuiStatics.getFontCubellan()); offsetX = 0; for (int i = 0; i < texts.length; i++) { int value = GuiStatics.getTextWidth(GuiStatics.getFontCubellan(), texts[i]); if (value > offsetX) { offsetX = value; } } for (int i = 0; i < texts.length; i++) { drawBoldText(g, GuiStatics.COLOR_COOL_SPACE_BLUE_DARK_TRANS, GuiStatics.COLOR_COOL_SPACE_BLUE_TRANS, this.getWidth() / 2 - offsetX - 20, this.getHeight() / 2 - (texts.length + 2) * 15 + i * 15, texts[i]); } } } else { if (title == null) { title = STR; } g.setFont(GuiStatics.getFontCubellanBoldBig()); int offsetX = 50; int offsetY = 75; if (backgroundImg != null) { offsetX = (this.getWidth() - backgroundImg.getWidth()) / 2 - GuiStatics .getTextWidth(GuiStatics.getFontCubellanBoldBig(), title) / 2 + backgroundImg.getWidth() / 2; offsetY = (PLANET_Y_OFFSET - backgroundImg.getHeight()) / 2; if (planet.isGasGiant()) { offsetY = offsetY + 100; } if (offsetY < 75) { offsetY = 75; } if (textInMiddle) { offsetY = (this.getHeight() - backgroundImg.getHeight()) / 2 - GuiStatics.getTextHeight(GuiStatics.getFontCubellanBoldBig(), title) / 2; } } drawBoldText(g, GuiStatics.COLOR_COOL_SPACE_BLUE_DARK, GuiStatics.COLOR_COOL_SPACE_BLUE, offsetX, offsetY, title); } if (textInformation != null) { String[] texts = textInformation.split("\n"); g.setFont(GuiStatics.getFontCubellan()); int offsetX = 0; for (int i = 0; i < texts.length; i++) { int value = GuiStatics.getTextWidth(GuiStatics.getFontCubellan(), texts[i]); if (value > offsetX) { offsetX = value; } } for (int i = 0; i < texts.length; i++) { drawBoldText(g, GuiStatics.COLOR_COOL_SPACE_BLUE_DARK_TRANS, GuiStatics.COLOR_COOL_SPACE_BLUE_TRANS, this.getWidth() - offsetX - 20, this.getHeight() - (texts.length + 2) * 15 + i * 15, texts[i]); } } } private static final int SHIP_OFFSET_X = 332; private static final int SHIP_OFFSET_Y = 332;
/** * Draw planet text are about planet information * @param g Graphics to use for drawing */
Draw planet text are about planet information
drawTextArea
{ "repo_name": "tuomount/Open-Realms-of-Stars", "path": "src/main/java/org/openRealmOfStars/gui/panels/BigImagePanel.java", "license": "gpl-2.0", "size": 24473 }
[ "java.awt.Graphics" ]
import java.awt.Graphics;
import java.awt.*;
[ "java.awt" ]
java.awt;
610,487
public ArrayList<RuleElementLine> getOutLines() { return this.outLines; }
ArrayList<RuleElementLine> function() { return this.outLines; }
/** * Returns an ArrayList of Lines that are exiting from this Rectangle. * * @return this.outLines; ArrayList of Lines that exit from this Rectangle */
Returns an ArrayList of Lines that are exiting from this Rectangle
getOutLines
{ "repo_name": "vamaraju/shuffle-the-rules", "path": "src/main/java/view/EditorTab/RuleElementRectangle.java", "license": "mit", "size": 23083 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
2,382,732
public Account getAccount() { return mAccount; }
Account function() { return mAccount; }
/** * Getter for the ownCloud {@link Account} where the main {@link OCFile} handled by the activity * is located. * * @return OwnCloud {@link Account} where the main {@link OCFile} handled by the activity * is located. */
Getter for the ownCloud <code>Account</code> where the main <code>OCFile</code> handled by the activity is located
getAccount
{ "repo_name": "saoussenBA/android", "path": "src/com/owncloud/android/ui/activity/FileActivity.java", "license": "gpl-2.0", "size": 35032 }
[ "android.accounts.Account" ]
import android.accounts.Account;
import android.accounts.*;
[ "android.accounts" ]
android.accounts;
546,235
@Nullable public UsedInsight get() throws ClientException { return send(HttpMethod.GET, null); }
UsedInsight function() throws ClientException { return send(HttpMethod.GET, null); }
/** * Gets the UsedInsight from the service * * @return the UsedInsight from the request * @throws ClientException this exception occurs if the request was unable to complete for any reason */
Gets the UsedInsight from the service
get
{ "repo_name": "microsoftgraph/msgraph-sdk-java", "path": "src/main/java/com/microsoft/graph/requests/UsedInsightRequest.java", "license": "mit", "size": 5788 }
[ "com.microsoft.graph.core.ClientException", "com.microsoft.graph.http.HttpMethod", "com.microsoft.graph.models.UsedInsight" ]
import com.microsoft.graph.core.ClientException; import com.microsoft.graph.http.HttpMethod; import com.microsoft.graph.models.UsedInsight;
import com.microsoft.graph.core.*; import com.microsoft.graph.http.*; import com.microsoft.graph.models.*;
[ "com.microsoft.graph" ]
com.microsoft.graph;
612,586
@Override public boolean retainAll(Collection<?> coll) { throw new UnsupportedOperationException(); }
boolean function(Collection<?> coll) { throw new UnsupportedOperationException(); }
/** * Unsupported operation * * @throws UnsupportedOperationException Unsupported operation */
Unsupported operation
retainAll
{ "repo_name": "summabr/sol", "path": "src/main/java/br/com/summa/sol/data/TreeTopN.java", "license": "apache-2.0", "size": 13105 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
2,428,281
public void removePointsCategory(final String category) { Point pointToRemove = null; for (final Point point : globalPoints) { if (point.getCategory().equalsIgnoreCase(category)) { pointToRemove = point; } } if (pointToRemove != null) { globalPoints.remove(pointToRemove); } saver.add(new Record(UpdateType.REMOVE_GLOBAL_POINTS, new String[]{category})); }
void function(final String category) { Point pointToRemove = null; for (final Point point : globalPoints) { if (point.getCategory().equalsIgnoreCase(category)) { pointToRemove = point; } } if (pointToRemove != null) { globalPoints.remove(pointToRemove); } saver.add(new Record(UpdateType.REMOVE_GLOBAL_POINTS, new String[]{category})); }
/** * Removes the whole category of global_points. * * @param category name of a point category */
Removes the whole category of global_points
removePointsCategory
{ "repo_name": "Co0sh/BetonQuest", "path": "src/main/java/org/betonquest/betonquest/database/GlobalData.java", "license": "gpl-3.0", "size": 6477 }
[ "org.betonquest.betonquest.Point", "org.betonquest.betonquest.database.Connector", "org.betonquest.betonquest.database.Saver" ]
import org.betonquest.betonquest.Point; import org.betonquest.betonquest.database.Connector; import org.betonquest.betonquest.database.Saver;
import org.betonquest.betonquest.*; import org.betonquest.betonquest.database.*;
[ "org.betonquest.betonquest" ]
org.betonquest.betonquest;
781,143
public Result addAttrs(List<TypedEntry<?>> entries) { return withAttrs(attrs.putAll(entries)); }
Result function(List<TypedEntry<?>> entries) { return withAttrs(attrs.putAll(entries)); }
/** * Create a new versions of this object with the given attributes attached to it. * * @param entries The new attributes. * @return The new version of this object with the new attributes. */
Create a new versions of this object with the given attributes attached to it
addAttrs
{ "repo_name": "marcospereira/playframework", "path": "core/play/src/main/java/play/mvc/Result.java", "license": "apache-2.0", "size": 21343 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,969,789
private float[] computeAnimationTimeBoundaries(Animation animation) { int maxFrame = Integer.MIN_VALUE; float maxTime = Float.MIN_VALUE; for (Track track : animation.getTracks()) { if (track instanceof BoneTrack) { maxFrame = Math.max(maxFrame, ((BoneTrack) track).getTranslations().length); maxTime = Math.max(maxTime, ((BoneTrack) track).getTimes()[((BoneTrack) track).getTimes().length - 1]); } else if (track instanceof SpatialTrack) { maxFrame = Math.max(maxFrame, ((SpatialTrack) track).getTranslations().length); maxTime = Math.max(maxTime, ((SpatialTrack) track).getTimes()[((SpatialTrack) track).getTimes().length - 1]); } else { throw new IllegalStateException("Unsupported track type for simuation: " + track); } } return new float[] { maxFrame, maxTime }; }
float[] function(Animation animation) { int maxFrame = Integer.MIN_VALUE; float maxTime = Float.MIN_VALUE; for (Track track : animation.getTracks()) { if (track instanceof BoneTrack) { maxFrame = Math.max(maxFrame, ((BoneTrack) track).getTranslations().length); maxTime = Math.max(maxTime, ((BoneTrack) track).getTimes()[((BoneTrack) track).getTimes().length - 1]); } else if (track instanceof SpatialTrack) { maxFrame = Math.max(maxFrame, ((SpatialTrack) track).getTranslations().length); maxTime = Math.max(maxTime, ((SpatialTrack) track).getTimes()[((SpatialTrack) track).getTimes().length - 1]); } else { throw new IllegalStateException(STR + track); } } return new float[] { maxFrame, maxTime }; }
/** * Computes the maximum frame and time for the animation. Different tracks * can have different lengths so here the maximum one is being found. * * @param animation * the animation * @return maximum frame and time of the animation */
Computes the maximum frame and time for the animation. Different tracks can have different lengths so here the maximum one is being found
computeAnimationTimeBoundaries
{ "repo_name": "chototsu/MikuMikuStudio", "path": "engine/src/blender/com/jme3/scene/plugins/blender/constraints/SimulationNode.java", "license": "bsd-2-clause", "size": 18661 }
[ "com.jme3.animation.Animation", "com.jme3.animation.BoneTrack", "com.jme3.animation.SpatialTrack", "com.jme3.animation.Track" ]
import com.jme3.animation.Animation; import com.jme3.animation.BoneTrack; import com.jme3.animation.SpatialTrack; import com.jme3.animation.Track;
import com.jme3.animation.*;
[ "com.jme3.animation" ]
com.jme3.animation;
938,789
public static int compare(Calendar firstCalendar, Calendar secondCalendar) { if (firstCalendar == null && secondCalendar == null) return 0; if (firstCalendar == null) return -1; if (secondCalendar == null) return 1; return firstCalendar.compareTo(secondCalendar); }
static int function(Calendar firstCalendar, Calendar secondCalendar) { if (firstCalendar == null && secondCalendar == null) return 0; if (firstCalendar == null) return -1; if (secondCalendar == null) return 1; return firstCalendar.compareTo(secondCalendar); }
/** * Compares two datetimes. * * @param firstCalendar The first calendar to compare. * @param secondCalendar The second calendar to compare. * @return Zero if both calendars represent that same instant in time, less than zero if the * firstCalendar is an earlier instant in time than the secondCalendar, or greater than * zero if the firstCalendar is greater than the secondCalendar. */
Compares two datetimes
compare
{ "repo_name": "Permafrost/Tundra.java", "path": "src/main/java/permafrost/tundra/time/DateTimeHelper.java", "license": "mit", "size": 53382 }
[ "java.util.Calendar" ]
import java.util.Calendar;
import java.util.*;
[ "java.util" ]
java.util;
648,963
void assemble(AssemblerConfig config) throws UtilityException;
void assemble(AssemblerConfig config) throws UtilityException;
/** * Assemble a web application into a portlet web application which is * deployable into the pluto-1.1 portlet container. The specified web * application will be overwritten with the new application. */
Assemble a web application into a portlet web application which is deployable into the pluto-1.1 portlet container. The specified web application will be overwritten with the new application
assemble
{ "repo_name": "apache/portals-pluto", "path": "pluto-util/src/main/java/org/apache/pluto/util/assemble/Assembler.java", "license": "apache-2.0", "size": 2016 }
[ "org.apache.pluto.util.UtilityException" ]
import org.apache.pluto.util.UtilityException;
import org.apache.pluto.util.*;
[ "org.apache.pluto" ]
org.apache.pluto;
1,161,435
@Override @DoesServiceRequest public void write(final byte[] data) throws IOException { this.write(data, 0, data.length); }
void function(final byte[] data) throws IOException { this.write(data, 0, data.length); }
/** * Writes <code>b.length</code> bytes from the specified byte array to this output stream. * * @param data * A <code>byte</code> array which represents the data to write. * * @throws IOException * If an I/O error occurs. In particular, an IOException may be thrown if the output stream has been * closed. */
Writes <code>b.length</code> bytes from the specified byte array to this output stream
write
{ "repo_name": "esummers-msft/azure-storage-java", "path": "microsoft-azure-storage/src/com/microsoft/azure/storage/file/FileOutputStream.java", "license": "apache-2.0", "size": 16738 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,267,514
@Override void write (RecordOutputStream s) throws IOException { s.startRecord (ModuleSerializationTags.EXPRESSION_VAR, serializationSchema); boolean flags[] = new boolean [3]; flags[0] = name != null; flags[1] = functionalAgent != null; flags[2] = errorInfo != null; s.writeByte(RecordOutputStream.booleanArrayToBitArray(flags)[0]); if (flags[0]) { s.writeQualifiedName(name); } if (flags[1]) { s.writeQualifiedName(functionalAgent.getName()); } if (flags[2]) { errorInfo.write(s); } s.endRecord (); }
void write (RecordOutputStream s) throws IOException { s.startRecord (ModuleSerializationTags.EXPRESSION_VAR, serializationSchema); boolean flags[] = new boolean [3]; flags[0] = name != null; flags[1] = functionalAgent != null; flags[2] = errorInfo != null; s.writeByte(RecordOutputStream.booleanArrayToBitArray(flags)[0]); if (flags[0]) { s.writeQualifiedName(name); } if (flags[1]) { s.writeQualifiedName(functionalAgent.getName()); } if (flags[2]) { errorInfo.write(s); } s.endRecord (); }
/** * Write this instance of Var to the RecordOutputStream. * @param s * @throws IOException */
Write this instance of Var to the RecordOutputStream
write
{ "repo_name": "levans/Open-Quark", "path": "src/CAL_Platform/src/org/openquark/cal/compiler/Expression.java", "license": "bsd-3-clause", "size": 130740 }
[ "java.io.IOException", "org.openquark.cal.internal.serialization.ModuleSerializationTags", "org.openquark.cal.internal.serialization.RecordOutputStream" ]
import java.io.IOException; import org.openquark.cal.internal.serialization.ModuleSerializationTags; import org.openquark.cal.internal.serialization.RecordOutputStream;
import java.io.*; import org.openquark.cal.internal.serialization.*;
[ "java.io", "org.openquark.cal" ]
java.io; org.openquark.cal;
1,966,330
protected void saveSelectedOption( Encoders.Type type ) { p.set( "encoders." +fileType, type.name() ); p.save(); }
void function( Encoders.Type type ) { p.set( STR +fileType, type.name() ); p.save(); }
/** * saves the currently selected options. all the fields will handle their * own saving, so we just need to do the radio options (until i create a * properties control for them to) * * @param type * */
saves the currently selected options. all the fields will handle their own saving, so we just need to do the radio options (until i create a properties control for them to)
saveSelectedOption
{ "repo_name": "rodnaph/sockso", "path": "src/com/pugh/sockso/gui/EncoderPanel.java", "license": "gpl-2.0", "size": 7892 }
[ "com.pugh.sockso.music.encoders.Encoders" ]
import com.pugh.sockso.music.encoders.Encoders;
import com.pugh.sockso.music.encoders.*;
[ "com.pugh.sockso" ]
com.pugh.sockso;
2,425,534
public SubAccount getSubAccount() { return subAccount; }
SubAccount function() { return subAccount; }
/** * Gets the subAccount attribute. * * @return Returns the subAccount. */
Gets the subAccount attribute
getSubAccount
{ "repo_name": "quikkian-ua-devops/kfs", "path": "kfs-bc/src/main/java/org/kuali/kfs/module/bc/businessobject/PendingBudgetConstructionAppointmentFunding.java", "license": "agpl-3.0", "size": 35064 }
[ "org.kuali.kfs.coa.businessobject.SubAccount" ]
import org.kuali.kfs.coa.businessobject.SubAccount;
import org.kuali.kfs.coa.businessobject.*;
[ "org.kuali.kfs" ]
org.kuali.kfs;
2,823,826
@Override public void updateNString(int columnIndex, String nString) throws SQLException { throw new BQSQLFeatureNotSupportedException(); }
void function(int columnIndex, String nString) throws SQLException { throw new BQSQLFeatureNotSupportedException(); }
/** * <p> * <h1>Implementation Details:</h1><br> * Throws BQSQLFeatureNotSupportedException * </p> * * @throws BQSQLFeatureNotSupportedException */
Implementation Details: Throws BQSQLFeatureNotSupportedException
updateNString
{ "repo_name": "jonathanswenson/starschema-bigquery-jdbc", "path": "src/main/java/net/starschema/clouddb/jdbc/ScrollableResultset.java", "license": "bsd-2-clause", "size": 73793 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
2,020,356
public MetadataTableRelated setSolutions(List<String> solutions) { this.solutions = solutions; return this; }
MetadataTableRelated function(List<String> solutions) { this.solutions = solutions; return this; }
/** * Set the solutions property: The related Log Analytics solutions for the table. * * @param solutions the solutions value to set. * @return the MetadataTableRelated object itself. */
Set the solutions property: The related Log Analytics solutions for the table
setSolutions
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/logs/models/MetadataTableRelated.java", "license": "mit", "size": 4854 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,394,195
public boolean isEmpty() { if (m_hold != null ) return false; return super.isEmpty(); } } public Scheduler(String parent, int maxSize) { m_name = parent + "Scheduler-" + maxSize; m_status = START_PENDING; m_runner = new RunnableConsumerThreadPool(m_name + " Pool", 0.6f, 1.0f, maxSize); m_queues = Collections.synchronizedMap(new TreeMap<Long,PeekableFifoQueue<ReadyRunnable>>()); m_scheduled = 0; m_worker = null; } public Scheduler(String parent, int maxSize, float lowMark, float hiMark) { m_name = parent + "Scheduler-" + maxSize; m_status = START_PENDING; m_runner = new RunnableConsumerThreadPool(m_name + " Pool", lowMark, hiMark, maxSize); m_queues = Collections.synchronizedMap(new TreeMap<Long,PeekableFifoQueue<ReadyRunnable>>()); m_scheduled = 0; m_worker = null; }
boolean function() { if (m_hold != null ) return false; return super.isEmpty(); } } public Scheduler(String parent, int maxSize) { m_name = parent + STR + maxSize; m_status = START_PENDING; m_runner = new RunnableConsumerThreadPool(m_name + STR, 0.6f, 1.0f, maxSize); m_queues = Collections.synchronizedMap(new TreeMap<Long,PeekableFifoQueue<ReadyRunnable>>()); m_scheduled = 0; m_worker = null; } public Scheduler(String parent, int maxSize, float lowMark, float hiMark) { m_name = parent + STR + maxSize; m_status = START_PENDING; m_runner = new RunnableConsumerThreadPool(m_name + STR, lowMark, hiMark, maxSize); m_queues = Collections.synchronizedMap(new TreeMap<Long,PeekableFifoQueue<ReadyRunnable>>()); m_scheduled = 0; m_worker = null; }
/** * Used to test if the current queue has no stored elements. * * @return True if the queue is empty. */
Used to test if the current queue has no stored elements
isEmpty
{ "repo_name": "vishwaAbhinav/OpenNMS", "path": "opennms-services/src/main/java/org/opennms/netmgt/linkd/scheduler/Scheduler.java", "license": "gpl-2.0", "size": 21386 }
[ "java.util.Collections", "java.util.TreeMap", "org.opennms.core.concurrent.RunnableConsumerThreadPool" ]
import java.util.Collections; import java.util.TreeMap; import org.opennms.core.concurrent.RunnableConsumerThreadPool;
import java.util.*; import org.opennms.core.concurrent.*;
[ "java.util", "org.opennms.core" ]
java.util; org.opennms.core;
1,350,869
Collection<String> getPropertyNames();
Collection<String> getPropertyNames();
/** * Get all property names defined on this BlockState * * @return Collection of property names */
Get all property names defined on this BlockState
getPropertyNames
{ "repo_name": "Fozie/SpongeAPI", "path": "src/main/java/org/spongepowered/api/block/BlockState.java", "license": "mit", "size": 4396 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
1,912,071
@SuppressWarnings("unchecked") @JsonIgnore public Map<String, Object> getParams() { return getMetadataField(METADATA_FIELD_PARAMS, Map.class); }
@SuppressWarnings(STR) Map<String, Object> function() { return getMetadataField(METADATA_FIELD_PARAMS, Map.class); }
/** * Gets job's parameters. * * @return */
Gets job's parameters
getParams
{ "repo_name": "DDTH/djs-commons", "path": "src/main/java/com/github/ddth/djs/bo/job/JobInfoBo.java", "license": "mit", "size": 9439 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,479,837
public static CandidateEntry fetchByUuid_Last(java.lang.String uuid, OrderByComparator<CandidateEntry> orderByComparator) { return getPersistence().fetchByUuid_Last(uuid, orderByComparator); }
static CandidateEntry function(java.lang.String uuid, OrderByComparator<CandidateEntry> orderByComparator) { return getPersistence().fetchByUuid_Last(uuid, orderByComparator); }
/** * Returns the last candidate entry in the ordered set where uuid = &#63;. * * @param uuid the uuid * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) * @return the last matching candidate entry, or <code>null</code> if a matching candidate entry could not be found */
Returns the last candidate entry in the ordered set where uuid = &#63;
fetchByUuid_Last
{ "repo_name": "moltam89/OWXP", "path": "modules/micro-maintainance-candidate/micro-maintainance-candidate-api/src/main/java/com/liferay/micro/maintainance/candidate/service/persistence/CandidateEntryUtil.java", "license": "gpl-3.0", "size": 103522 }
[ "com.liferay.micro.maintainance.candidate.model.CandidateEntry", "com.liferay.portal.kernel.util.OrderByComparator" ]
import com.liferay.micro.maintainance.candidate.model.CandidateEntry; import com.liferay.portal.kernel.util.OrderByComparator;
import com.liferay.micro.maintainance.candidate.model.*; import com.liferay.portal.kernel.util.*;
[ "com.liferay.micro", "com.liferay.portal" ]
com.liferay.micro; com.liferay.portal;
1,684,244
public Observable<ServiceResponse<RemediationInner>> getAtManagementGroupWithServiceResponseAsync(String managementGroupId, String remediationName) { if (managementGroupId == null) { throw new IllegalArgumentException("Parameter managementGroupId is required and cannot be null."); } if (remediationName == null) { throw new IllegalArgumentException("Parameter remediationName is required and cannot be null."); }
Observable<ServiceResponse<RemediationInner>> function(String managementGroupId, String remediationName) { if (managementGroupId == null) { throw new IllegalArgumentException(STR); } if (remediationName == null) { throw new IllegalArgumentException(STR); }
/** * Gets an existing remediation at management group scope. * * @param managementGroupId Management group ID. * @param remediationName The name of the remediation. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the RemediationInner object */
Gets an existing remediation at management group scope
getAtManagementGroupWithServiceResponseAsync
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/policyinsights/mgmt-v2018_07_01_preview/src/main/java/com/microsoft/azure/management/policyinsights/v2018_07_01_preview/implementation/RemediationsInner.java", "license": "mit", "size": 261004 }
[ "com.microsoft.rest.ServiceResponse" ]
import com.microsoft.rest.ServiceResponse;
import com.microsoft.rest.*;
[ "com.microsoft.rest" ]
com.microsoft.rest;
2,336,693
public String[] getServlets() { String[] result = null; Container[] children = findChildren(); if (children != null) { result = new String[children.length]; for( int i=0; i< children.length; i++ ) { result[i] = children[i].getObjectName().toString(); } } return result; }
String[] function() { String[] result = null; Container[] children = findChildren(); if (children != null) { result = new String[children.length]; for( int i=0; i< children.length; i++ ) { result[i] = children[i].getObjectName().toString(); } } return result; }
/** * JSR77 servlets attribute * * @return list of all servlets ( we know about ) */
JSR77 servlets attribute
getServlets
{ "repo_name": "pistolove/sourcecode4junit", "path": "Source4Tomcat/src/org/apache/catalina/core/StandardContext.java", "license": "apache-2.0", "size": 202235 }
[ "org.apache.catalina.Container" ]
import org.apache.catalina.Container;
import org.apache.catalina.*;
[ "org.apache.catalina" ]
org.apache.catalina;
1,872,396
public void keyReleased(KeyEvent e) { log.finest("Key=" + e.getKeyCode() + " - " + e.getKeyChar() + " -> " + m_text.getText()); // ESC if (e.getKeyCode() == KeyEvent.VK_ESCAPE) m_text.setText(m_initialText); m_modified = true; m_setting = true; try { if (e.getKeyCode() == KeyEvent.VK_ENTER) // 10 { fireVetoableChange (m_columnName, m_oldText, getValue()); fireActionPerformed(); } // else // { // indicate change // fireVetoableChange (m_columnName, m_oldText, null); // } } catch (PropertyVetoException pve) {} m_setting = false; } // keyReleased
void function(KeyEvent e) { log.finest("Key=" + e.getKeyCode() + STR + e.getKeyChar() + STR + m_text.getText()); if (e.getKeyCode() == KeyEvent.VK_ESCAPE) m_text.setText(m_initialText); m_modified = true; m_setting = true; try { if (e.getKeyCode() == KeyEvent.VK_ENTER) { fireVetoableChange (m_columnName, m_oldText, getValue()); fireActionPerformed(); } } catch (PropertyVetoException pve) {} m_setting = false; }
/** * Key Listener. * - Escape - Restore old Text * - firstChange - signal change * @param e event */
Key Listener. - Escape - Restore old Text - firstChange - signal change
keyReleased
{ "repo_name": "arthurmelo88/palmetalADP", "path": "adempiereTrunk/client/src/org/compiere/grid/ed/VNumber.java", "license": "gpl-2.0", "size": 21469 }
[ "java.awt.event.KeyEvent", "java.beans.PropertyVetoException" ]
import java.awt.event.KeyEvent; import java.beans.PropertyVetoException;
import java.awt.event.*; import java.beans.*;
[ "java.awt", "java.beans" ]
java.awt; java.beans;
1,875,775
public static Properties getProperties() { return globalProperties; }
static Properties function() { return globalProperties; }
/** * Returns all InterMine properties * * @return the global properties for InterMine */
Returns all InterMine properties
getProperties
{ "repo_name": "zebrafishmine/intermine", "path": "intermine/objectstore/main/src/org/intermine/util/PropertiesUtil.java", "license": "lgpl-2.1", "size": 6006 }
[ "java.util.Properties" ]
import java.util.Properties;
import java.util.*;
[ "java.util" ]
java.util;
2,760,979
public AssertionWrapper newAssertion() throws WSSecurityException { if (LOG.isDebugEnabled()) { LOG.debug( "Entering AssertionWrapper.newAssertion() ... creating SAML token" ); } if (callbackHandler == null && properties != null) { try { String samlCallbackClassname = properties.getProperty("org.apache.ws.security.saml.callback"); Class<? extends CallbackHandler> callbackClass = null; try { callbackClass = Loader.loadClass(samlCallbackClassname, CallbackHandler.class); } catch (ClassNotFoundException ex) { throw new WSSecurityException(ex.getMessage(), ex); } callbackHandler = callbackClass.newInstance(); } catch (InstantiationException ex) { throw new WSSecurityException(ex.getMessage(), ex); } catch (IllegalAccessException ex) { throw new WSSecurityException(ex.getMessage(), ex); } } // Create a new SAMLParms with all of the information from the properties file. SAMLParms samlParms = new SAMLParms(); samlParms.setIssuer(issuer); samlParms.setCallbackHandler(callbackHandler); AssertionWrapper sa = new AssertionWrapper(samlParms); if (signAssertion) { sa.signAssertion(issuerKeyName, issuerKeyPassword, issuerCrypto, sendKeyValue); } return sa; }
AssertionWrapper function() throws WSSecurityException { if (LOG.isDebugEnabled()) { LOG.debug( STR ); } if (callbackHandler == null && properties != null) { try { String samlCallbackClassname = properties.getProperty(STR); Class<? extends CallbackHandler> callbackClass = null; try { callbackClass = Loader.loadClass(samlCallbackClassname, CallbackHandler.class); } catch (ClassNotFoundException ex) { throw new WSSecurityException(ex.getMessage(), ex); } callbackHandler = callbackClass.newInstance(); } catch (InstantiationException ex) { throw new WSSecurityException(ex.getMessage(), ex); } catch (IllegalAccessException ex) { throw new WSSecurityException(ex.getMessage(), ex); } } SAMLParms samlParms = new SAMLParms(); samlParms.setIssuer(issuer); samlParms.setCallbackHandler(callbackHandler); AssertionWrapper sa = new AssertionWrapper(samlParms); if (signAssertion) { sa.signAssertion(issuerKeyName, issuerKeyPassword, issuerCrypto, sendKeyValue); } return sa; }
/** * Creates a new AssertionWrapper. * * @return a new AssertionWrapper. */
Creates a new AssertionWrapper
newAssertion
{ "repo_name": "fatfredyy/wss4j-ecc", "path": "src/main/java/org/apache/ws/security/saml/SAMLIssuerImpl.java", "license": "apache-2.0", "size": 8348 }
[ "javax.security.auth.callback.CallbackHandler", "org.apache.ws.security.WSSecurityException", "org.apache.ws.security.saml.ext.AssertionWrapper", "org.apache.ws.security.saml.ext.SAMLParms", "org.apache.ws.security.util.Loader" ]
import javax.security.auth.callback.CallbackHandler; import org.apache.ws.security.WSSecurityException; import org.apache.ws.security.saml.ext.AssertionWrapper; import org.apache.ws.security.saml.ext.SAMLParms; import org.apache.ws.security.util.Loader;
import javax.security.auth.callback.*; import org.apache.ws.security.*; import org.apache.ws.security.saml.ext.*; import org.apache.ws.security.util.*;
[ "javax.security", "org.apache.ws" ]
javax.security; org.apache.ws;
567,211
public void sendNotification(Notification notification);
void function(Notification notification);
/** * send the notification to registered clients * @param notification */
send the notification to registered clients
sendNotification
{ "repo_name": "SnappyDataInc/snappy-store", "path": "gemfire-core/src/main/java/com/gemstone/gemfire/management/internal/NotificationBroadCasterProxy.java", "license": "apache-2.0", "size": 1278 }
[ "javax.management.Notification" ]
import javax.management.Notification;
import javax.management.*;
[ "javax.management" ]
javax.management;
1,314,680
// ! Initializes the local code node comments. public void initializeLocalComment(final List<IComment> comments) { m_node.getComments().initializeLocalCodeNodeComment(comments); }
void function(final List<IComment> comments) { m_node.getComments().initializeLocalCodeNodeComment(comments); }
/** * Initializes the local code node comments. * * @param comments The List of {@link IComment} to associate to the code node. */
Initializes the local code node comments
initializeLocalComment
{ "repo_name": "crowell/binnavi", "path": "src/main/java/com/google/security/zynamics/binnavi/API/disassembly/CodeNode.java", "license": "apache-2.0", "size": 20009 }
[ "com.google.security.zynamics.binnavi.Gui", "java.util.List" ]
import com.google.security.zynamics.binnavi.Gui; import java.util.List;
import com.google.security.zynamics.binnavi.*; import java.util.*;
[ "com.google.security", "java.util" ]
com.google.security; java.util;
2,337,552
protected JsonObject getNullJsonObject() { LOG.debug("Return NULL Json Object"); return null; }
JsonObject function() { LOG.debug(STR); return null; }
/** * Return a Null Json Object * * @return */
Return a Null Json Object
getNullJsonObject
{ "repo_name": "opendaylight/vtn", "path": "coordinator/java/vtn-javaapi/src/org/opendaylight/vtn/javaapi/resources/AbstractResource.java", "license": "epl-1.0", "size": 23968 }
[ "com.google.gson.JsonObject" ]
import com.google.gson.JsonObject;
import com.google.gson.*;
[ "com.google.gson" ]
com.google.gson;
791,391
private Map<String, String> computeVarList( ReferenceCollection referenceInfo) { Map<String, String> varmap = new LinkedHashMap<>(); for (Reference ref : referenceInfo.references) { if (ref.isLvalue() || ref.isInitializingDeclaration()) { Node val = ref.getAssignedValue(); if (val != null) { Preconditions.checkState(val.isObjectLit()); for (Node child = val.getFirstChild(); child != null; child = child.getNext()) { String varname = child.getString(); if (varmap.containsKey(varname)) { continue; } String var = VAR_PREFIX + varname + "_" + safeNameIdSupplier.get(); varmap.put(varname, var); } } } else if (ref.getParent().isVar()) { // This is the var. There is no value. } else { Node getprop = ref.getParent(); Preconditions.checkState(getprop.isGetProp()); // The key being looked up in the original map. String varname = getprop.getLastChild().getString(); if (varmap.containsKey(varname)) { continue; } String var = VAR_PREFIX + varname + "_" + safeNameIdSupplier.get(); varmap.put(varname, var); } } return varmap; }
Map<String, String> function( ReferenceCollection referenceInfo) { Map<String, String> varmap = new LinkedHashMap<>(); for (Reference ref : referenceInfo.references) { if (ref.isLvalue() ref.isInitializingDeclaration()) { Node val = ref.getAssignedValue(); if (val != null) { Preconditions.checkState(val.isObjectLit()); for (Node child = val.getFirstChild(); child != null; child = child.getNext()) { String varname = child.getString(); if (varmap.containsKey(varname)) { continue; } String var = VAR_PREFIX + varname + "_" + safeNameIdSupplier.get(); varmap.put(varname, var); } } } else if (ref.getParent().isVar()) { } else { Node getprop = ref.getParent(); Preconditions.checkState(getprop.isGetProp()); String varname = getprop.getLastChild().getString(); if (varmap.containsKey(varname)) { continue; } String var = VAR_PREFIX + varname + "_" + safeNameIdSupplier.get(); varmap.put(varname, var); } } return varmap; }
/** * Computes a list of ever-referenced keys in the object being * inlined, and returns a mapping of key name -> generated * variable name. */
Computes a list of ever-referenced keys in the object being inlined, and returns a mapping of key name -> generated variable name
computeVarList
{ "repo_name": "dushmis/closure-compiler", "path": "src/com/google/javascript/jscomp/InlineObjectLiterals.java", "license": "apache-2.0", "size": 16911 }
[ "com.google.common.base.Preconditions", "com.google.javascript.jscomp.ReferenceCollectingCallback", "com.google.javascript.rhino.Node", "java.util.LinkedHashMap", "java.util.Map" ]
import com.google.common.base.Preconditions; import com.google.javascript.jscomp.ReferenceCollectingCallback; import com.google.javascript.rhino.Node; import java.util.LinkedHashMap; import java.util.Map;
import com.google.common.base.*; import com.google.javascript.jscomp.*; import com.google.javascript.rhino.*; import java.util.*;
[ "com.google.common", "com.google.javascript", "java.util" ]
com.google.common; com.google.javascript; java.util;
2,549,621
public static Optional<String> getDescription(UUID conceptUUID, TaxonomyCoordinate taxonomyCoordinate) { return getDescription(conceptUUID, taxonomyCoordinate == null ? null : taxonomyCoordinate.getStampCoordinate(), taxonomyCoordinate == null ? null : taxonomyCoordinate.getLanguageCoordinate()); }
static Optional<String> function(UUID conceptUUID, TaxonomyCoordinate taxonomyCoordinate) { return getDescription(conceptUUID, taxonomyCoordinate == null ? null : taxonomyCoordinate.getStampCoordinate(), taxonomyCoordinate == null ? null : taxonomyCoordinate.getLanguageCoordinate()); }
/** * Utility method to get the best text value description for a concept, according to the passed in options, * or the user preferences. Calls {@link #getDescription(UUID, LanguageCoordinate, StampCoordinate)} with values * extracted from the taxonomyCoordinate, or null. * @param conceptUUID - identifier for a concept * @param tc - optional - if not provided, defaults to user preferences values * @return */
Utility method to get the best text value description for a concept, according to the passed in options, or the user preferences. Calls <code>#getDescription(UUID, LanguageCoordinate, StampCoordinate)</code> with values extracted from the taxonomyCoordinate, or null
getDescription
{ "repo_name": "Apelon-VA/va-isaac-gui", "path": "otf-util/src/main/java/gov/va/isaac/util/OchreUtility.java", "license": "apache-2.0", "size": 26380 }
[ "gov.vha.isaac.ochre.api.coordinate.TaxonomyCoordinate", "java.util.Optional" ]
import gov.vha.isaac.ochre.api.coordinate.TaxonomyCoordinate; import java.util.Optional;
import gov.vha.isaac.ochre.api.coordinate.*; import java.util.*;
[ "gov.vha.isaac", "java.util" ]
gov.vha.isaac; java.util;
981,660
Composite parent = getFieldEditorParent(); PathEditor dir = new PathEditor(TexlipseProperties.BIB_DIR, TexlipsePlugin.getResourceString("preferenceBibDirLabel"), "", parent); addField(dir); dir.getButtonBoxControl(parent).setToolTipText(TexlipsePlugin.getResourceString("preferenceBibDirTooltip")); dir.getLabelControl(parent).setToolTipText(TexlipsePlugin.getResourceString("preferenceBibDirTooltip")); dir.getListControl(parent).setToolTipText(TexlipsePlugin.getResourceString("preferenceBibDirTooltip")); }
Composite parent = getFieldEditorParent(); PathEditor dir = new PathEditor(TexlipseProperties.BIB_DIR, TexlipsePlugin.getResourceString(STR), STRpreferenceBibDirTooltipSTRpreferenceBibDirTooltipSTRpreferenceBibDirTooltip")); }
/** * Creates the property editing UI components of this page. */
Creates the property editing UI components of this page
createFieldEditors
{ "repo_name": "kolovos/texlipse", "path": "net.sourceforge.texlipse/src/net/sourceforge/texlipse/properties/BibDirectoriesPreferencePage.java", "license": "epl-1.0", "size": 2020 }
[ "net.sourceforge.texlipse.TexlipsePlugin", "org.eclipse.jface.preference.PathEditor", "org.eclipse.swt.widgets.Composite" ]
import net.sourceforge.texlipse.TexlipsePlugin; import org.eclipse.jface.preference.PathEditor; import org.eclipse.swt.widgets.Composite;
import net.sourceforge.texlipse.*; import org.eclipse.jface.preference.*; import org.eclipse.swt.widgets.*;
[ "net.sourceforge.texlipse", "org.eclipse.jface", "org.eclipse.swt" ]
net.sourceforge.texlipse; org.eclipse.jface; org.eclipse.swt;
807,049
public void deleteTag() { for (final ITagListener listener : m_listeners) { // ESCA-JAVA0166: try { listener.deletedTag(this); } catch (final Exception exception) { CUtilityFunctions.logException(exception); } } }
void function() { for (final ITagListener listener : m_listeners) { try { listener.deletedTag(this); } catch (final Exception exception) { CUtilityFunctions.logException(exception); } } }
/** * Deletes a tag from the database. */
Deletes a tag from the database
deleteTag
{ "repo_name": "mayl8822/binnavi", "path": "src/main/java/com/google/security/zynamics/binnavi/Tagging/CTag.java", "license": "apache-2.0", "size": 6422 }
[ "com.google.security.zynamics.binnavi.CUtilityFunctions" ]
import com.google.security.zynamics.binnavi.CUtilityFunctions;
import com.google.security.zynamics.binnavi.*;
[ "com.google.security" ]
com.google.security;
1,879,489
public FileReference lookupFileName(int fileId) throws HyracksDataException;
FileReference function(int fileId) throws HyracksDataException;
/** * Lookup the file name for a file id * * @param fileId * - The file id whose name should be looked up. * @return The file reference * @throws HyracksDataException * - If the file id is not mapped currently in this manager. */
Lookup the file name for a file id
lookupFileName
{ "repo_name": "lwhay/hyracks", "path": "hyracks/hyracks-storage-common/src/main/java/edu/uci/ics/hyracks/storage/common/file/IFileMapProvider.java", "license": "apache-2.0", "size": 2118 }
[ "edu.uci.ics.hyracks.api.exceptions.HyracksDataException", "edu.uci.ics.hyracks.api.io.FileReference" ]
import edu.uci.ics.hyracks.api.exceptions.HyracksDataException; import edu.uci.ics.hyracks.api.io.FileReference;
import edu.uci.ics.hyracks.api.exceptions.*; import edu.uci.ics.hyracks.api.io.*;
[ "edu.uci.ics" ]
edu.uci.ics;
1,279,573
private boolean notifyListenerResponseReceive(HttpMessage httpMessage) { if (parentServer.excludeUrl(httpMessage.getRequestHeader().getURI())) { return true; } ProxyListener listener = null; List<ProxyListener> listenerList = parentServer.getListenerList(); for (int i=0;i<listenerList.size();i++) { listener = listenerList.get(i); try { if (!listener.onHttpResponseReceive(httpMessage)) { return false; } } catch (Exception e) { log.error("An error occurred while notifying listener:", e); } } return true; }
boolean function(HttpMessage httpMessage) { if (parentServer.excludeUrl(httpMessage.getRequestHeader().getURI())) { return true; } ProxyListener listener = null; List<ProxyListener> listenerList = parentServer.getListenerList(); for (int i=0;i<listenerList.size();i++) { listener = listenerList.get(i); try { if (!listener.onHttpResponseReceive(httpMessage)) { return false; } } catch (Exception e) { log.error(STR, e); } } return true; }
/** * Go thru each observers and process the http message in each observers. * The msg can be changed by each observers. * @param msg */
Go thru each observers and process the http message in each observers. The msg can be changed by each observers
notifyListenerResponseReceive
{ "repo_name": "j4nnis/bproxy", "path": "src/org/parosproxy/paros/core/proxy/ProxyThread.java", "license": "apache-2.0", "size": 32772 }
[ "java.util.List", "org.parosproxy.paros.network.HttpMessage" ]
import java.util.List; import org.parosproxy.paros.network.HttpMessage;
import java.util.*; import org.parosproxy.paros.network.*;
[ "java.util", "org.parosproxy.paros" ]
java.util; org.parosproxy.paros;
1,420,541
public ServiceFuture<Void> powerOffAsync(String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(powerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown), serviceCallback); }
ServiceFuture<Void> function(String resourceGroupName, String vmScaleSetName, String instanceId, Boolean skipShutdown, final ServiceCallback<Void> serviceCallback) { return ServiceFuture.fromResponse(powerOffWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId, skipShutdown), serviceCallback); }
/** * Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. * * @param resourceGroupName The name of the resource group. * @param vmScaleSetName The name of the VM scale set. * @param instanceId The instance ID of the virtual machine. * @param skipShutdown The parameter to request non-graceful VM shutdown. True value for this flag indicates non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not specified * @param serviceCallback the async ServiceCallback to handle successful and failed responses. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */
Power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges
powerOffAsync
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/VirtualMachineScaleSetVMsInner.java", "license": "mit", "size": 208201 }
[ "com.microsoft.rest.ServiceCallback", "com.microsoft.rest.ServiceFuture" ]
import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture;
import com.microsoft.rest.*;
[ "com.microsoft.rest" ]
com.microsoft.rest;
336,004
public static void createScheduler(URI rmURL, String policyFullClassName, SchedulerStatus initialStatus) throws AdminSchedulerException { logger.debug("Starting new Scheduler"); //check arguments... if (rmURL == null) { String msg = "The Resource Manager URL must not be null"; logger.error(msg); throw new AdminSchedulerException(msg); } try { // creating the scheduler // if this fails then it will not continue. logger.debug("Creating scheduler frontend..."); PAActiveObject.newActive(SchedulerFrontend.class, new Object[] { rmURL, policyFullClassName, initialStatus }); //ready logger.debug("Scheduler is now ready to be started!"); ServerJobAndTaskLogs.getInstance().configure(); } catch (Exception e) { logger.fatal(e); e.printStackTrace(); throw new AdminSchedulerException(e.getMessage()); } }
static void function(URI rmURL, String policyFullClassName, SchedulerStatus initialStatus) throws AdminSchedulerException { logger.debug(STR); if (rmURL == null) { String msg = STR; logger.error(msg); throw new AdminSchedulerException(msg); } try { logger.debug(STR); PAActiveObject.newActive(SchedulerFrontend.class, new Object[] { rmURL, policyFullClassName, initialStatus }); logger.debug(STR); ServerJobAndTaskLogs.getInstance().configure(); } catch (Exception e) { logger.fatal(e); e.printStackTrace(); throw new AdminSchedulerException(e.getMessage()); } }
/** * Create a new scheduler on the local host plugged on the given resource manager.<br> * This will provide a connection interface to allow the access to a restricted number of user.<br> * Use {@link SchedulerConnection} class to join the Scheduler. * * @param rmURL the resource manager URL on which the scheduler will connect * @param policyFullClassName the full policy class name for the scheduler. * @throws AdminSchedulerException If an error occurred during creation process */
Create a new scheduler on the local host plugged on the given resource manager. This will provide a connection interface to allow the access to a restricted number of user. Use <code>SchedulerConnection</code> class to join the Scheduler
createScheduler
{ "repo_name": "mbenguig/scheduling", "path": "scheduler/scheduler-server/src/main/java/org/ow2/proactive/scheduler/SchedulerFactory.java", "license": "agpl-3.0", "size": 12512 }
[ "org.objectweb.proactive.api.PAActiveObject", "org.ow2.proactive.scheduler.common.SchedulerStatus", "org.ow2.proactive.scheduler.core.SchedulerFrontend", "org.ow2.proactive.scheduler.exception.AdminSchedulerException", "org.ow2.proactive.scheduler.util.ServerJobAndTaskLogs" ]
import org.objectweb.proactive.api.PAActiveObject; import org.ow2.proactive.scheduler.common.SchedulerStatus; import org.ow2.proactive.scheduler.core.SchedulerFrontend; import org.ow2.proactive.scheduler.exception.AdminSchedulerException; import org.ow2.proactive.scheduler.util.ServerJobAndTaskLogs;
import org.objectweb.proactive.api.*; import org.ow2.proactive.scheduler.common.*; import org.ow2.proactive.scheduler.core.*; import org.ow2.proactive.scheduler.exception.*; import org.ow2.proactive.scheduler.util.*;
[ "org.objectweb.proactive", "org.ow2.proactive" ]
org.objectweb.proactive; org.ow2.proactive;
968,392
void addIndexEntries(Transaction tx, ObjId id, SimpleField<?> subField) { Preconditions.checkArgument(subField.indexed, "not indexed"); final byte[] prefix = this.buildKey(id); final byte[] prefixEnd = ByteUtil.getKeyAfterPrefix(prefix); final Iterator<KVPair> i = tx.kvt.getRange(prefix, prefixEnd, false); while (i.hasNext()) { final KVPair pair = i.next(); assert KeyRange.forPrefix(prefix).contains(pair.getKey()); this.addIndexEntry(tx, id, subField, pair.getKey(), pair.getValue()); } Database.closeIfPossible(i); }
void addIndexEntries(Transaction tx, ObjId id, SimpleField<?> subField) { Preconditions.checkArgument(subField.indexed, STR); final byte[] prefix = this.buildKey(id); final byte[] prefixEnd = ByteUtil.getKeyAfterPrefix(prefix); final Iterator<KVPair> i = tx.kvt.getRange(prefix, prefixEnd, false); while (i.hasNext()) { final KVPair pair = i.next(); assert KeyRange.forPrefix(prefix).contains(pair.getKey()); this.addIndexEntry(tx, id, subField, pair.getKey(), pair.getValue()); } Database.closeIfPossible(i); }
/** * Add all index entries for the given object and sub-field. * * @param tx transaction * @param id object id * @param subField sub-field of this field */
Add all index entries for the given object and sub-field
addIndexEntries
{ "repo_name": "tempbottle/jsimpledb", "path": "src/java/org/jsimpledb/core/ComplexField.java", "license": "apache-2.0", "size": 9248 }
[ "com.google.common.base.Preconditions", "java.util.Iterator", "org.jsimpledb.kv.KVPair", "org.jsimpledb.kv.KeyRange", "org.jsimpledb.util.ByteUtil" ]
import com.google.common.base.Preconditions; import java.util.Iterator; import org.jsimpledb.kv.KVPair; import org.jsimpledb.kv.KeyRange; import org.jsimpledb.util.ByteUtil;
import com.google.common.base.*; import java.util.*; import org.jsimpledb.kv.*; import org.jsimpledb.util.*;
[ "com.google.common", "java.util", "org.jsimpledb.kv", "org.jsimpledb.util" ]
com.google.common; java.util; org.jsimpledb.kv; org.jsimpledb.util;
1,598,063
//@PDA jdbc40 public void updateNClob(String columnName, NClob nClob) throws SQLException { updateNClob (findColumn (columnName), nClob); }
void function(String columnName, NClob nClob) throws SQLException { updateNClob (findColumn (columnName), nClob); }
/** * Updates the designated column with a <code>java.sql.NClob</code> value. * The updater methods are used to update column values in the * current row or the insert row. The updater methods do not * update the underlying database; instead the <code>updateRow</code> or * <code>insertRow</code> methods are called to update the database. * * @param columnName name of the column * @param nClob the value for the column to be updated * @throws SQLException if the driver does not support national * character sets; if the driver can detect that a data conversion * error could occur; or if a database access error occurs */
Updates the designated column with a <code>java.sql.NClob</code> value. The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database; instead the <code>updateRow</code> or <code>insertRow</code> methods are called to update the database
updateNClob
{ "repo_name": "piguangming/jt400", "path": "cvsroot/jdbc40/com/ibm/as400/access/AS400JDBCResultSet.java", "license": "epl-1.0", "size": 288211 }
[ "java.sql.NClob", "java.sql.SQLException" ]
import java.sql.NClob; import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,117,302
public void flush(CacheModel cacheModel) { cache.clear(); keyList.clear(); }
void function(CacheModel cacheModel) { cache.clear(); keyList.clear(); }
/** * Flushes the cache. * * @param cacheModel The cache model */
Flushes the cache
flush
{ "repo_name": "ahwxl/ads", "path": "ads/src/main/java/com/ibatis/sqlmap/engine/cache/lru/LruCacheController.java", "license": "apache-2.0", "size": 3204 }
[ "com.ibatis.sqlmap.engine.cache.CacheModel" ]
import com.ibatis.sqlmap.engine.cache.CacheModel;
import com.ibatis.sqlmap.engine.cache.*;
[ "com.ibatis.sqlmap" ]
com.ibatis.sqlmap;
158,107
public static SpriteSheet LoadSpriteSheet (final TextureAtlas atlas, final String path, final int spritesPerRow, final int rowsPerSheet) { SpriteSheet tileSheet = null; Gdx.app.log("info", "Loading sprite sheet on " + path); tileSheet = new SpriteSheet(atlas, path, spritesPerRow, rowsPerSheet); return tileSheet; }
static SpriteSheet function (final TextureAtlas atlas, final String path, final int spritesPerRow, final int rowsPerSheet) { SpriteSheet tileSheet = null; Gdx.app.log("info", STR + path); tileSheet = new SpriteSheet(atlas, path, spritesPerRow, rowsPerSheet); return tileSheet; }
/** * Load sprite sheet. * * @param atlas the texture atlas * @param path the path * @param spritesPerRow the sprites per row * @param rowsPerSheet the rows per sheet * @return the sprite sheet */
Load sprite sheet
LoadSpriteSheet
{ "repo_name": "sabarjp/VictusLudus", "path": "victusludus/src/com/teamderpy/victusludus/engine/graphics/BitmapHandler.java", "license": "mit", "size": 3072 }
[ "com.badlogic.gdx.Gdx", "com.badlogic.gdx.graphics.g2d.TextureAtlas" ]
import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.*; import com.badlogic.gdx.graphics.g2d.*;
[ "com.badlogic.gdx" ]
com.badlogic.gdx;
2,249,197
public void sendMessage(Message message) throws XMPPException { connection.sendPacket(message); }
void function(Message message) throws XMPPException { connection.sendPacket(message); }
/** * Sends a Message to the chat room. * * @param message the message. * @throws XMPPException if sending the message fails. */
Sends a Message to the chat room
sendMessage
{ "repo_name": "s20121035/rk3288_android5.1_repo", "path": "external/smack/src/org/jivesoftware/smackx/muc/MultiUserChat.java", "license": "gpl-3.0", "size": 122710 }
[ "org.jivesoftware.smack.XMPPException", "org.jivesoftware.smack.packet.Message" ]
import org.jivesoftware.smack.XMPPException; import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.*; import org.jivesoftware.smack.packet.*;
[ "org.jivesoftware.smack" ]
org.jivesoftware.smack;
2,794,262
private int hashCodeImpl() { int result = 0; for (Map.Entry<String, Object> e : memberValues.entrySet()) { result += (127 * e.getKey().hashCode()) ^ memberValueHashCode(e.getValue()); } return result; }
int function() { int result = 0; for (Map.Entry<String, Object> e : memberValues.entrySet()) { result += (127 * e.getKey().hashCode()) ^ memberValueHashCode(e.getValue()); } return result; }
/** * Implementation of dynamicProxy.hashCode() */
Implementation of dynamicProxy.hashCode()
hashCodeImpl
{ "repo_name": "GeeQuery/cxf-plus", "path": "src/main/java/com/github/cxfplus/core/reflect/AnnotationInvocationHandler.java", "license": "apache-2.0", "size": 10800 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
820,854
public ArrayList<AmberExpr> getResultList() { return _resultList; }
ArrayList<AmberExpr> function() { return _resultList; }
/** * Returns the result list. */
Returns the result list
getResultList
{ "repo_name": "dlitz/resin", "path": "modules/resin/src/com/caucho/amber/query/AmberSelectQuery.java", "license": "gpl-2.0", "size": 15115 }
[ "com.caucho.amber.expr.AmberExpr", "java.util.ArrayList" ]
import com.caucho.amber.expr.AmberExpr; import java.util.ArrayList;
import com.caucho.amber.expr.*; import java.util.*;
[ "com.caucho.amber", "java.util" ]
com.caucho.amber; java.util;
1,299,476
public static void main(String[] args) { String template = DEFAULT_TEMPLATE; final TextToPpt program = new TextToPpt(); BufferedReader is; try { if (args.length > 0) { for (String arg : args) { is = getReaderFor(arg); saveShow(program.readAndProcessOneFile(is, template), generateFileName(arg)); is.close(); } } else { InputStream bis = program.getClass().getResourceAsStream("/demoshow.txt"); if (bis == null) { System.err.println("Usage: " + TextToPpt.class.getSimpleName() + " textFile [...]"); System.exit(1); } is = new BufferedReader(new InputStreamReader(bis)); saveShow(program.readAndProcessOneFile(is, template), generateFileName("/tmp/demoshow.txt")); is.close(); } } catch (IOException e) { System.err.println("Unexpected exception " + e); } }
static void function(String[] args) { String template = DEFAULT_TEMPLATE; final TextToPpt program = new TextToPpt(); BufferedReader is; try { if (args.length > 0) { for (String arg : args) { is = getReaderFor(arg); saveShow(program.readAndProcessOneFile(is, template), generateFileName(arg)); is.close(); } } else { InputStream bis = program.getClass().getResourceAsStream(STR); if (bis == null) { System.err.println(STR + TextToPpt.class.getSimpleName() + STR); System.exit(1); } is = new BufferedReader(new InputStreamReader(bis)); saveShow(program.readAndProcessOneFile(is, template), generateFileName(STR)); is.close(); } } catch (IOException e) { System.err.println(STR + e); } }
/** Main program * @param args One or more input filenames; if none, a built-in demo file is processed. */
Main program
main
{ "repo_name": "IanDarwin/TextToPpt", "path": "src/main/java/com/darwinsys/txt2ppt/TextToPpt.java", "license": "apache-2.0", "size": 10887 }
[ "java.io.BufferedReader", "java.io.IOException", "java.io.InputStream", "java.io.InputStreamReader" ]
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader;
import java.io.*;
[ "java.io" ]
java.io;
2,502,495
public static boolean setAttribute(Document document, String xPath, String attribute, String value) { Node node = document.selectSingleNode(xPath); Element e = (Element)node; @SuppressWarnings("unchecked") List<Attribute> attributes = e.attributes(); for (Attribute a : attributes) { if (a.getName().equals(attribute)) { a.setValue(value); return true; } } return false; }
static boolean function(Document document, String xPath, String attribute, String value) { Node node = document.selectSingleNode(xPath); Element e = (Element)node; @SuppressWarnings(STR) List<Attribute> attributes = e.attributes(); for (Attribute a : attributes) { if (a.getName().equals(attribute)) { a.setValue(value); return true; } } return false; }
/** * Replaces a attibute's value in the given node addressed by the xPath.<p> * * @param document the document to replace the node attribute * @param xPath the xPath to the node * @param attribute the attribute to replace the value of * @param value the new value to set * * @return <code>true</code> if successful <code>false</code> otherwise */
Replaces a attibute's value in the given node addressed by the xPath
setAttribute
{ "repo_name": "it-tavis/opencms-core", "path": "src-setup/org/opencms/setup/xml/CmsSetupXmlHelper.java", "license": "lgpl-2.1", "size": 19207 }
[ "java.util.List", "org.dom4j.Attribute", "org.dom4j.Document", "org.dom4j.Element", "org.dom4j.Node" ]
import java.util.List; import org.dom4j.Attribute; import org.dom4j.Document; import org.dom4j.Element; import org.dom4j.Node;
import java.util.*; import org.dom4j.*;
[ "java.util", "org.dom4j" ]
java.util; org.dom4j;
2,859,661
public static java.util.List extractNtfyApptCancConvList(ims.domain.ILightweightDomainFactory domainFactory, ims.chooseandbook.vo.NtpfApptCancConvVoCollection voCollection) { return extractNtfyApptCancConvList(domainFactory, voCollection, null, new HashMap()); }
static java.util.List function(ims.domain.ILightweightDomainFactory domainFactory, ims.chooseandbook.vo.NtpfApptCancConvVoCollection voCollection) { return extractNtfyApptCancConvList(domainFactory, voCollection, null, new HashMap()); }
/** * Create the ims.choose_book.domain.objects.NtfyApptCancConv list from the value object collection. * @param domainFactory - used to create existing (persistent) domain objects. * @param voCollection - the collection of value objects */
Create the ims.choose_book.domain.objects.NtfyApptCancConv list from the value object collection
extractNtfyApptCancConvList
{ "repo_name": "open-health-hub/openmaxims-linux", "path": "openmaxims_workspace/ValueObjects/src/ims/chooseandbook/vo/domain/NtpfApptCancConvVoAssembler.java", "license": "agpl-3.0", "size": 18022 }
[ "java.util.HashMap" ]
import java.util.HashMap;
import java.util.*;
[ "java.util" ]
java.util;
1,293,640
public MessageProducer createProducer(final String subject, final boolean isQueue, final boolean durable) { // if (subject != null) { // this.subject = subject; // } MessageProducer producer = null; try { if (isQueue) { destination = producerSession.createQueue(subject); logger.debug("Creating a producer Queue"); } else { destination = producerSession.createTopic(subject); logger.debug("Creating a producer Topic"); } producer = producerSession.createProducer(destination); if (durable) { producer.setDeliveryMode(DeliveryMode.PERSISTENT); } else { producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT); } if (timeToLive != 0) producer.setTimeToLive(timeToLive); } catch (final JMSException e) { logger.error("Error creating destination: ", subject); logger.error("Stacktrace.", e); } return producer; }
MessageProducer function(final String subject, final boolean isQueue, final boolean durable) { MessageProducer producer = null; try { if (isQueue) { destination = producerSession.createQueue(subject); logger.debug(STR); } else { destination = producerSession.createTopic(subject); logger.debug(STR); } producer = producerSession.createProducer(destination); if (durable) { producer.setDeliveryMode(DeliveryMode.PERSISTENT); } else { producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT); } if (timeToLive != 0) producer.setTimeToLive(timeToLive); } catch (final JMSException e) { logger.error(STR, subject); logger.error(STR, e); } return producer; }
/** * This method will create a MessageProducer for you with the destination being the Subject that you hand in. The * MessageProducer will be either a TopicProducer or a QueueSender. * * @param subject * The name of the Topic/Queue that you want to connect to. The Topic/Queue will be created if it does * not already exist * @param isQueue * True if Queue, false if Topic * @param durable * True if you want the Topic/Queue to be durable/persistent * @return MessageProducer */
This method will create a MessageProducer for you with the destination being the Subject that you hand in. The MessageProducer will be either a TopicProducer or a QueueSender
createProducer
{ "repo_name": "chadbeaudin/DataRecorder", "path": "src/main/java/com/datarecorder/util/MessagingUtils.java", "license": "mit", "size": 16034 }
[ "javax.jms.DeliveryMode", "javax.jms.JMSException", "javax.jms.MessageProducer" ]
import javax.jms.DeliveryMode; import javax.jms.JMSException; import javax.jms.MessageProducer;
import javax.jms.*;
[ "javax.jms" ]
javax.jms;
2,217,384
@Override public void processNullSessionPacket(Packet packet, NonAuthUserRepository repo, Queue<Packet> results, Map<String, Object> settings) throws PacketErrorTypeException { results.offer(Authorization.RECIPIENT_UNAVAILABLE.getResponseMessage(packet, "The target is unavailable at this time.", true)); }
void function(Packet packet, NonAuthUserRepository repo, Queue<Packet> results, Map<String, Object> settings) throws PacketErrorTypeException { results.offer(Authorization.RECIPIENT_UNAVAILABLE.getResponseMessage(packet, STR, true)); }
/** * Method description * * * @param packet * @param repo * @param results * @param settings * * @throws PacketErrorTypeException */
Method description
processNullSessionPacket
{ "repo_name": "DanielYao/tigase-server", "path": "src/main/java/tigase/xmpp/impl/ServiceDiscovery.java", "license": "agpl-3.0", "size": 4700 }
[ "java.util.Map", "java.util.Queue" ]
import java.util.Map; import java.util.Queue;
import java.util.*;
[ "java.util" ]
java.util;
738,356
protected void doFlood(IOFSwitch sw, OFPacketIn pi, FloodlightContext cntx) { if (topology.isIncomingBroadcastAllowed(sw.getId(), pi.getInPort()) == false) { if (log.isTraceEnabled()) { log.trace("doFlood, drop broadcast packet, pi={}, " + "from a blocked port, srcSwitch=[{},{}], linkInfo={}", new Object[] {pi, sw.getId(),pi.getInPort()}); } return; } // Set Action to flood OFPacketOut po = (OFPacketOut) floodlightProvider.getOFMessageFactory().getMessage(OFType.PACKET_OUT); List<OFAction> actions = new ArrayList<OFAction>(); if (sw.hasAttribute(IOFSwitch.PROP_SUPPORTS_OFPP_FLOOD)) { actions.add(new OFActionOutput(OFPort.OFPP_FLOOD.getValue(), (short)0)); } else { actions.add(new OFActionOutput(OFPort.OFPP_ALL.getValue(), (short)0)); } po.setActions(actions); po.setActionsLength((short) OFActionOutput.MINIMUM_LENGTH); // set buffer-id, in-port and packet-data based on packet-in short poLength = (short)(po.getActionsLength() + OFPacketOut.MINIMUM_LENGTH); po.setBufferId(pi.getBufferId()); po.setInPort(pi.getInPort()); if (pi.getBufferId() == OFPacketOut.BUFFER_ID_NONE) { byte[] packetData = pi.getPacketData(); poLength += packetData.length; po.setPacketData(packetData); } po.setLength(poLength); try { if (log.isTraceEnabled()) { log.trace("Writing flood PacketOut switch={} packet-in={} packet-out={}", new Object[] {sw, pi, po}); } sw.write(po, cntx); } catch (IOException e) { log.error("Failure writing PacketOut switch={} packet-in={} packet-out={}", new Object[] {sw, pi, po}, e); } return; }
void function(IOFSwitch sw, OFPacketIn pi, FloodlightContext cntx) { if (topology.isIncomingBroadcastAllowed(sw.getId(), pi.getInPort()) == false) { if (log.isTraceEnabled()) { log.trace(STR + STR, new Object[] {pi, sw.getId(),pi.getInPort()}); } return; } OFPacketOut po = (OFPacketOut) floodlightProvider.getOFMessageFactory().getMessage(OFType.PACKET_OUT); List<OFAction> actions = new ArrayList<OFAction>(); if (sw.hasAttribute(IOFSwitch.PROP_SUPPORTS_OFPP_FLOOD)) { actions.add(new OFActionOutput(OFPort.OFPP_FLOOD.getValue(), (short)0)); } else { actions.add(new OFActionOutput(OFPort.OFPP_ALL.getValue(), (short)0)); } po.setActions(actions); po.setActionsLength((short) OFActionOutput.MINIMUM_LENGTH); short poLength = (short)(po.getActionsLength() + OFPacketOut.MINIMUM_LENGTH); po.setBufferId(pi.getBufferId()); po.setInPort(pi.getInPort()); if (pi.getBufferId() == OFPacketOut.BUFFER_ID_NONE) { byte[] packetData = pi.getPacketData(); poLength += packetData.length; po.setPacketData(packetData); } po.setLength(poLength); try { if (log.isTraceEnabled()) { log.trace(STR, new Object[] {sw, pi, po}); } sw.write(po, cntx); } catch (IOException e) { log.error(STR, new Object[] {sw, pi, po}, e); } return; }
/** * Creates a OFPacketOut with the OFPacketIn data that is flooded on all ports unless * the port is blocked, in which case the packet will be dropped. * @param sw The switch that receives the OFPacketIn * @param pi The OFPacketIn that came to the switch * @param cntx The FloodlightContext associated with this OFPacketIn */
Creates a OFPacketOut with the OFPacketIn data that is flooded on all ports unless the port is blocked, in which case the packet will be dropped
doFlood
{ "repo_name": "floodlight/ubuntu-packaging-floodlight", "path": "src/main/java/net/floodlightcontroller/forwarding/Forwarding.java", "license": "apache-2.0", "size": 13252 }
[ "java.io.IOException", "java.util.ArrayList", "java.util.List", "net.floodlightcontroller.core.FloodlightContext", "net.floodlightcontroller.core.IOFSwitch", "org.openflow.protocol.OFPacketIn", "org.openflow.protocol.OFPacketOut", "org.openflow.protocol.OFPort", "org.openflow.protocol.OFType", "org.openflow.protocol.action.OFAction", "org.openflow.protocol.action.OFActionOutput" ]
import java.io.IOException; import java.util.ArrayList; import java.util.List; import net.floodlightcontroller.core.FloodlightContext; import net.floodlightcontroller.core.IOFSwitch; import org.openflow.protocol.OFPacketIn; import org.openflow.protocol.OFPacketOut; import org.openflow.protocol.OFPort; import org.openflow.protocol.OFType; import org.openflow.protocol.action.OFAction; import org.openflow.protocol.action.OFActionOutput;
import java.io.*; import java.util.*; import net.floodlightcontroller.core.*; import org.openflow.protocol.*; import org.openflow.protocol.action.*;
[ "java.io", "java.util", "net.floodlightcontroller.core", "org.openflow.protocol" ]
java.io; java.util; net.floodlightcontroller.core; org.openflow.protocol;
710,316
public static TableState convert(TableName tableName, HBaseProtos.TableState tableState) { TableState.State state = State.convert(tableState.getState()); return new TableState(tableName, state); }
static TableState function(TableName tableName, HBaseProtos.TableState tableState) { TableState.State state = State.convert(tableState.getState()); return new TableState(tableName, state); }
/** * Covert from PB version of TableState * * @param tableName table this state of * @param tableState convert from * @return POJO */
Covert from PB version of TableState
convert
{ "repo_name": "andrewmains12/hbase", "path": "hbase-client/src/main/java/org/apache/hadoop/hbase/client/TableState.java", "license": "apache-2.0", "size": 5607 }
[ "org.apache.hadoop.hbase.TableName", "org.apache.hadoop.hbase.protobuf.generated.HBaseProtos" ]
import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos;
import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.protobuf.generated.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
2,286,555
void checkMemoryRequirements(JobInProgress job) throws IOException { if (!perTaskMemoryConfigurationSetOnJT()) { if (LOG.isDebugEnabled()) { LOG.debug("Per-Task memory configuration is not set on JT. " + "Not checking the job for invalid memory requirements."); } return; } boolean invalidJob = false; String msg = ""; long maxMemForMapTask = job.getMemoryForMapTask(); long maxMemForReduceTask = job.getMemoryForReduceTask(); if (maxMemForMapTask == JobConf.DISABLED_MEMORY_LIMIT || maxMemForReduceTask == JobConf.DISABLED_MEMORY_LIMIT) { invalidJob = true; msg = "Invalid job requirements."; } if (maxMemForMapTask > limitMaxMemForMapTasks || maxMemForReduceTask > limitMaxMemForReduceTasks) { invalidJob = true; msg = "Exceeds the cluster's max-memory-limit."; } if (invalidJob) { StringBuilder jobStr = new StringBuilder().append(job.getJobID().toString()).append("(") .append(maxMemForMapTask).append(" memForMapTasks ").append( maxMemForReduceTask).append(" memForReduceTasks): "); LOG.warn(jobStr.toString() + msg); throw new IOException(jobStr.toString() + msg); } }
void checkMemoryRequirements(JobInProgress job) throws IOException { if (!perTaskMemoryConfigurationSetOnJT()) { if (LOG.isDebugEnabled()) { LOG.debug(STR + STR); } return; } boolean invalidJob = false; String msg = STRInvalid job requirements.STRExceeds the cluster's max-memory-limit.STR(STR memForMapTasks STR memForReduceTasks): "); LOG.warn(jobStr.toString() + msg); throw new IOException(jobStr.toString() + msg); } }
/** * Check the job if it has invalid requirements and throw and IOException if does have. * * @param job * @throws IOException */
Check the job if it has invalid requirements and throw and IOException if does have
checkMemoryRequirements
{ "repo_name": "steveloughran/hadoop-mapreduce", "path": "src/java/org/apache/hadoop/mapred/JobTracker.java", "license": "apache-2.0", "size": 169624 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
348,427
public void onCreateNode(ChildAssociationRef childAssocRef) { homeFolderManager.homeFolderCreateAndSetPermissions(v2Adaptor, childAssocRef.getChildRef()); }
void function(ChildAssociationRef childAssocRef) { homeFolderManager.homeFolderCreateAndSetPermissions(v2Adaptor, childAssocRef.getChildRef()); }
/** * The implementation of the policy binding. Run as the system user for auditing. */
The implementation of the policy binding. Run as the system user for auditing
onCreateNode
{ "repo_name": "daniel-he/community-edition", "path": "projects/repository/source/java/org/alfresco/repo/security/person/AbstractHomeFolderProvider.java", "license": "lgpl-3.0", "size": 9664 }
[ "org.alfresco.service.cmr.repository.ChildAssociationRef" ]
import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.*;
[ "org.alfresco.service" ]
org.alfresco.service;
1,749,768
@Override protected int compareRowKey(final Cell l, final Cell r) { byte[] left = l.getRowArray(); int loffset = l.getRowOffset(); int llength = l.getRowLength(); byte[] right = r.getRowArray(); int roffset = r.getRowOffset(); int rlength = r.getRowLength(); return compareRows(left, loffset, llength, right, roffset, rlength); } } public static class KVComparator implements RawComparator<Cell>, SamePrefixComparator<byte[]> {
int function(final Cell l, final Cell r) { byte[] left = l.getRowArray(); int loffset = l.getRowOffset(); int llength = l.getRowLength(); byte[] right = r.getRowArray(); int roffset = r.getRowOffset(); int rlength = r.getRowLength(); return compareRows(left, loffset, llength, right, roffset, rlength); } } public static class KVComparator implements RawComparator<Cell>, SamePrefixComparator<byte[]> {
/** * Override the row key comparison to parse and compare the meta row key parts. */
Override the row key comparison to parse and compare the meta row key parts
compareRowKey
{ "repo_name": "grokcoder/pbase", "path": "hbase-common/src/main/java/org/apache/hadoop/hbase/KeyValue.java", "license": "apache-2.0", "size": 96655 }
[ "org.apache.hadoop.io.RawComparator" ]
import org.apache.hadoop.io.RawComparator;
import org.apache.hadoop.io.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
2,872,505
public Optional<Date> getPublicationDate() { return getFieldOrAlias(StandardField.DATE).flatMap(Date::parse); }
Optional<Date> function() { return getFieldOrAlias(StandardField.DATE).flatMap(Date::parse); }
/** * Will return the publication date of the given bibtex entry conforming to ISO 8601, i.e. either YYYY or YYYY-MM. * * @return will return the publication date of the entry or null if no year was found. */
Will return the publication date of the given bibtex entry conforming to ISO 8601, i.e. either YYYY or YYYY-MM
getPublicationDate
{ "repo_name": "JabRef/jabref", "path": "src/main/java/org/jabref/model/entry/BibEntry.java", "license": "mit", "size": 38993 }
[ "java.util.Optional", "org.jabref.model.entry.field.StandardField" ]
import java.util.Optional; import org.jabref.model.entry.field.StandardField;
import java.util.*; import org.jabref.model.entry.field.*;
[ "java.util", "org.jabref.model" ]
java.util; org.jabref.model;
336,092
public static boolean identical(final Collection<?> first, final Collection<?> second) { //MvDMvDMvD : add testcase for {A,B,B} and {A,A,B} if ((first == null) && (second == null)) { return true; } if ((first == null) || (second == null)) { return false; } if (first.size() != second.size()) { return false; } return first.stream().allMatch(element -> nbExplicitOccurrences(element, first) == nbExplicitOccurrences(element, second)); }
static boolean function(final Collection<?> first, final Collection<?> second) { if ((first == null) && (second == null)) { return true; } if ((first == null) (second == null)) { return false; } if (first.size() != second.size()) { return false; } return first.stream().allMatch(element -> nbExplicitOccurrences(element, first) == nbExplicitOccurrences(element, second)); }
/** * Check whether the two given collections contain the same elements. * Test are done with == * * @param first * The first collection * @param second * The second collection */
Check whether the two given collections contain the same elements. Test are done with ==
identical
{ "repo_name": "markovandooren/rejuse", "path": "src/main/java/org/aikodi/rejuse/java/collections/Collections.java", "license": "mit", "size": 3879 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
2,368,364
LevelConstraint getTLWellSignedConstraint();
LevelConstraint getTLWellSignedConstraint();
/** * Returns TLWellSigned constraint if present in the policy, null otherwise * * @return {@code TimeConstraint} if TLWellSigned element is present * in the constraint file, null otherwise. */
Returns TLWellSigned constraint if present in the policy, null otherwise
getTLWellSignedConstraint
{ "repo_name": "esig/dss", "path": "dss-policy-jaxb/src/main/java/eu/europa/esig/dss/policy/ValidationPolicy.java", "license": "lgpl-2.1", "size": 47405 }
[ "eu.europa.esig.dss.policy.jaxb.LevelConstraint" ]
import eu.europa.esig.dss.policy.jaxb.LevelConstraint;
import eu.europa.esig.dss.policy.jaxb.*;
[ "eu.europa.esig" ]
eu.europa.esig;
590,026
public ScriptSortBuilder setNestedFilter(QueryBuilder nestedFilter) { this.nestedFilter = nestedFilter; return this; }
ScriptSortBuilder function(QueryBuilder nestedFilter) { this.nestedFilter = nestedFilter; return this; }
/** * Sets the nested filter that the nested objects should match with in order to be taken into account * for sorting. */
Sets the nested filter that the nested objects should match with in order to be taken into account for sorting
setNestedFilter
{ "repo_name": "strapdata/elassandra5-rc", "path": "core/src/main/java/org/elasticsearch/search/sort/ScriptSortBuilder.java", "license": "apache-2.0", "size": 14714 }
[ "org.elasticsearch.index.query.QueryBuilder" ]
import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.index.query.*;
[ "org.elasticsearch.index" ]
org.elasticsearch.index;
1,274,412
Dimension getSizeChange();
Dimension getSizeChange();
/** * Gets the change to the size of the bounding rectangle of the attribute that was made. * @return the change to the size of the bounding rectangle of the affected attribute. */
Gets the change to the size of the bounding rectangle of the attribute that was made
getSizeChange
{ "repo_name": "stumoodie/VisualLanguageToolkit", "path": "src/org/pathwayeditor/businessobjects/drawingprimitives/listeners/ICanvasAttributeResizedEvent.java", "license": "apache-2.0", "size": 1843 }
[ "org.pathwayeditor.figure.geometry.Dimension" ]
import org.pathwayeditor.figure.geometry.Dimension;
import org.pathwayeditor.figure.geometry.*;
[ "org.pathwayeditor.figure" ]
org.pathwayeditor.figure;
755,973
List<IProtectionEntry> getEntries();
List<IProtectionEntry> getEntries();
/** * Gets the list of protection entries. * * @return the list of protection entries */
Gets the list of protection entries
getEntries
{ "repo_name": "paulseawa/p4ic4idea", "path": "p4java/src/com/perforce/p4java/admin/IProtectionsTable.java", "license": "apache-2.0", "size": 530 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,644,986
public Object peek() throws InterruptedException { Object object = null; while (true) { if (takeWhenPeekInProgress) { try { this.take(); } catch (CacheException ce) { throw new RuntimeException(ce) {}; } this.takeWhenPeekInProgress = false; } object = super.peek(); if (object == null) { synchronized (forWaiting) { object = super.peek(); if (object == null) { boolean interrupted = Thread.interrupted(); try { forWaiting.wait(); } catch (InterruptedException e) { interrupted = true; if (logger.isDebugEnabled()) { logger.debug("Interrupted exception while wait for peek", e); } } finally { if (interrupted) { Thread.currentThread().interrupt(); } } } else { break; } } } else { break; } } return object; }
Object function() throws InterruptedException { Object object = null; while (true) { if (takeWhenPeekInProgress) { try { this.take(); } catch (CacheException ce) { throw new RuntimeException(ce) {}; } this.takeWhenPeekInProgress = false; } object = super.peek(); if (object == null) { synchronized (forWaiting) { object = super.peek(); if (object == null) { boolean interrupted = Thread.interrupted(); try { forWaiting.wait(); } catch (InterruptedException e) { interrupted = true; if (logger.isDebugEnabled()) { logger.debug(STR, e); } } finally { if (interrupted) { Thread.currentThread().interrupt(); } } } else { break; } } } else { break; } } return object; }
/** * blocking peek. This method will not return till it has acquired a legitimate object from teh * queue. * * @throws InterruptedException */
blocking peek. This method will not return till it has acquired a legitimate object from teh queue
peek
{ "repo_name": "charliemblack/geode", "path": "geode-core/src/test/java/org/apache/geode/internal/cache/ha/TestBlockingHARegionQueue.java", "license": "apache-2.0", "size": 3617 }
[ "org.apache.geode.cache.CacheException" ]
import org.apache.geode.cache.CacheException;
import org.apache.geode.cache.*;
[ "org.apache.geode" ]
org.apache.geode;
1,702,969
void deleteMetrics(Date timestamp);
void deleteMetrics(Date timestamp);
/** * Deletes all metrics events which are older than the specified timestamp. * If the timestamp is null, all metrics will be deleted * * @param timestamp or null * @since 7.3 */
Deletes all metrics events which are older than the specified timestamp. If the timestamp is null, all metrics will be deleted
deleteMetrics
{ "repo_name": "xasx/camunda-bpm-platform", "path": "engine/src/main/java/org/camunda/bpm/engine/ManagementService.java", "license": "apache-2.0", "size": 53258 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
421,610
public String getNameFromResolveInfo(ResolveInfo ri) throws NameNotFoundException { String name = ri.resolvePackageName; if (ri.activityInfo != null) { Resources res = mContext.getPackageManager().getResourcesForApplication(ri.activityInfo.applicationInfo); Resources engRes = getEnglishRessources(res); if (ri.activityInfo.labelRes != 0) { name = engRes.getString(ri.activityInfo.labelRes); if (name == null || name.equals("")) { name = res.getString(ri.activityInfo.labelRes); } } else { name = ri.activityInfo.applicationInfo.loadLabel(mContext.getPackageManager()).toString(); } } return name; }
String function(ResolveInfo ri) throws NameNotFoundException { String name = ri.resolvePackageName; if (ri.activityInfo != null) { Resources res = mContext.getPackageManager().getResourcesForApplication(ri.activityInfo.applicationInfo); Resources engRes = getEnglishRessources(res); if (ri.activityInfo.labelRes != 0) { name = engRes.getString(ri.activityInfo.labelRes); if (name == null name.equals("")) { name = res.getString(ri.activityInfo.labelRes); } } else { name = ri.activityInfo.applicationInfo.loadLabel(mContext.getPackageManager()).toString(); } } return name; }
/** * Helper method to get an applications name! */
Helper method to get an applications name
getNameFromResolveInfo
{ "repo_name": "Manabu-GT/RXJava-Essentials", "path": "app/src/main/java/com/packtpub/apps/rxjava_essentials/apps/AppInfoRich.java", "license": "apache-2.0", "size": 5035 }
[ "android.content.pm.PackageManager", "android.content.pm.ResolveInfo", "android.content.res.Resources" ]
import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.content.res.Resources;
import android.content.pm.*; import android.content.res.*;
[ "android.content" ]
android.content;
362,438
public static String getOutputEncoding(FacesContext context) { return context.getResponseWriter().getCharacterEncoding(); }
static String function(FacesContext context) { return context.getResponseWriter().getCharacterEncoding(); }
/** * Gets the character encoding of the output. */
Gets the character encoding of the output
getOutputEncoding
{ "repo_name": "adamrduffy/trinidad-1.0.x", "path": "trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/core/xhtml/OutputUtils.java", "license": "apache-2.0", "size": 12983 }
[ "javax.faces.context.FacesContext" ]
import javax.faces.context.FacesContext;
import javax.faces.context.*;
[ "javax.faces" ]
javax.faces;
86,150
currentRequest.set(req); try { // check to OpenCms runlevel int runlevel = OpenCmsCore.getInstance().getRunLevel(); // write OpenCms server identification in the response header res.setHeader(CmsRequestUtil.HEADER_SERVER, OpenCmsCore.getInstance().getSystemInfo().getVersion()); if (runlevel != OpenCms.RUNLEVEL_4_SERVLET_ACCESS) { // not the "normal" servlet runlevel if (runlevel == OpenCms.RUNLEVEL_3_SHELL_ACCESS) { // we have shell runlevel only, upgrade to servlet runlevel (required after setup wizard) init(getServletConfig()); } else { // illegal runlevel, we can't process requests // sending status code 403, indicating the server understood the request but refused to fulfill it res.sendError(HttpServletResponse.SC_FORBIDDEN); // goodbye return; } } String path = OpenCmsCore.getInstance().getPathInfo(req); if (path.startsWith(HANDLE_PATH)) { // this is a request to an OpenCms handler URI invokeHandler(req, res); } else if (path.endsWith(HANDLE_GWT)) { // handle GWT rpc services String serviceName = CmsResource.getName(path); serviceName = serviceName.substring(0, serviceName.length() - HANDLE_GWT.length()); OpenCmsCore.getInstance().invokeGwtService(serviceName, req, res, getServletConfig()); } else { // standard request to a URI in the OpenCms VFS OpenCmsCore.getInstance().showResource(req, res); } } finally { currentRequest.remove(); } }
currentRequest.set(req); try { int runlevel = OpenCmsCore.getInstance().getRunLevel(); res.setHeader(CmsRequestUtil.HEADER_SERVER, OpenCmsCore.getInstance().getSystemInfo().getVersion()); if (runlevel != OpenCms.RUNLEVEL_4_SERVLET_ACCESS) { if (runlevel == OpenCms.RUNLEVEL_3_SHELL_ACCESS) { init(getServletConfig()); } else { res.sendError(HttpServletResponse.SC_FORBIDDEN); return; } } String path = OpenCmsCore.getInstance().getPathInfo(req); if (path.startsWith(HANDLE_PATH)) { invokeHandler(req, res); } else if (path.endsWith(HANDLE_GWT)) { String serviceName = CmsResource.getName(path); serviceName = serviceName.substring(0, serviceName.length() - HANDLE_GWT.length()); OpenCmsCore.getInstance().invokeGwtService(serviceName, req, res, getServletConfig()); } else { OpenCmsCore.getInstance().showResource(req, res); } } finally { currentRequest.remove(); } }
/** * OpenCms servlet main request handling method.<p> * * @see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) */
OpenCms servlet main request handling method
doGet
{ "repo_name": "ggiudetti/opencms-core", "path": "src/org/opencms/main/OpenCmsServlet.java", "license": "lgpl-2.1", "size": 18970 }
[ "javax.servlet.http.HttpServletResponse", "org.opencms.file.CmsResource", "org.opencms.util.CmsRequestUtil" ]
import javax.servlet.http.HttpServletResponse; import org.opencms.file.CmsResource; import org.opencms.util.CmsRequestUtil;
import javax.servlet.http.*; import org.opencms.file.*; import org.opencms.util.*;
[ "javax.servlet", "org.opencms.file", "org.opencms.util" ]
javax.servlet; org.opencms.file; org.opencms.util;
1,660,201
private static String getName(String player) { String input, response; Scanner sc = new Scanner(System.in); println(); while (true) { print(player + " please enter your tag: "); input = sc.nextLine(); print("Is \"" + input + "\" good?\n> "); response = sc.nextLine(); response = response.toLowerCase().trim(); for (String comparator : POS_RESPONSES) { if (response.equals(comparator)) { return input; } } } }
static String function(String player) { String input, response; Scanner sc = new Scanner(System.in); println(); while (true) { print(player + STR); input = sc.nextLine(); print(STRSTR\STR); response = sc.nextLine(); response = response.toLowerCase().trim(); for (String comparator : POS_RESPONSES) { if (response.equals(comparator)) { return input; } } } }
/** * Helper method, gets player tag, and returns it. * * @param player Player number choosing their tag. * @return The returned tag. */
Helper method, gets player tag, and returns it
getName
{ "repo_name": "DarrienG/RockPaperSmash", "path": "src/main/java/RockPaperSmash/Driver.java", "license": "agpl-3.0", "size": 40902 }
[ "java.util.Scanner" ]
import java.util.Scanner;
import java.util.*;
[ "java.util" ]
java.util;
2,427,881
public static LocksManager authenticate(RestClient restClient, String subscriptionId) { return new LocksManager(restClient, subscriptionId); }
static LocksManager function(RestClient restClient, String subscriptionId) { return new LocksManager(restClient, subscriptionId); }
/** * Creates an instance of LocksManager that exposes Authorization resource management API entry points. * * @param restClient the RestClient to be used for API calls. * @param subscriptionId the subscription UUID * @return the LocksManager */
Creates an instance of LocksManager that exposes Authorization resource management API entry points
authenticate
{ "repo_name": "hovsepm/azure-sdk-for-java", "path": "locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/LocksManager.java", "license": "mit", "size": 4149 }
[ "com.microsoft.rest.RestClient" ]
import com.microsoft.rest.RestClient;
import com.microsoft.rest.*;
[ "com.microsoft.rest" ]
com.microsoft.rest;
1,520,406
public Configuration addResource(String resourceName, ClassLoader classLoader) throws MappingException { log.info( "Reading mappings from resource: " + resourceName ); InputStream resourceInputStream = classLoader.getResourceAsStream( resourceName ); if ( resourceInputStream == null ) { throw new MappingNotFoundException( "resource", resourceName ); } add( resourceInputStream, "resource", resourceName ); return this; }
Configuration function(String resourceName, ClassLoader classLoader) throws MappingException { log.info( STR + resourceName ); InputStream resourceInputStream = classLoader.getResourceAsStream( resourceName ); if ( resourceInputStream == null ) { throw new MappingNotFoundException( STR, resourceName ); } add( resourceInputStream, STR, resourceName ); return this; }
/** * Read mappings as a application resource (i.e. classpath lookup). * * @param resourceName The resource name * @param classLoader The class loader to use. * @return this (for method chaining purposes) * @throws MappingException Indicates problems locating the resource or * processing the contained mapping document. */
Read mappings as a application resource (i.e. classpath lookup)
addResource
{ "repo_name": "codeApeFromChina/resource", "path": "frame_packages/java_libs/hibernate-distribution-3.6.10.Final/project/hibernate-core/src/main/java/org/hibernate/cfg/Configuration.java", "license": "unlicense", "size": 141059 }
[ "java.io.InputStream", "org.hibernate.MappingException", "org.hibernate.MappingNotFoundException" ]
import java.io.InputStream; import org.hibernate.MappingException; import org.hibernate.MappingNotFoundException;
import java.io.*; import org.hibernate.*;
[ "java.io", "org.hibernate" ]
java.io; org.hibernate;
1,451,871
@Deprecated public static XContentType xContentType(byte[] bytes, int offset, int length) { int totalLength = bytes.length; if (totalLength == 0 || length == 0) { return null; } else if ((offset + length) > totalLength) { return null; } byte first = bytes[offset]; if (first == '{') { return XContentType.JSON; } if (length > 2 && first == SmileConstants.HEADER_BYTE_1 && bytes[offset + 1] == SmileConstants.HEADER_BYTE_2 && bytes[offset + 2] == SmileConstants.HEADER_BYTE_3) { return XContentType.SMILE; } if (length > 2 && first == '-' && bytes[offset + 1] == '-' && bytes[offset + 2] == '-') { return XContentType.YAML; } // CBOR logic similar to CBORFactory#hasCBORFormat if (first == CBORConstants.BYTE_OBJECT_INDEFINITE && length > 1){ return XContentType.CBOR; } if (CBORConstants.hasMajorType(CBORConstants.MAJOR_TYPE_TAG, first) && length > 2) { // Actually, specific "self-describe tag" is a very good indicator if (first == (byte) 0xD9 && bytes[offset + 1] == (byte) 0xD9 && bytes[offset + 2] == (byte) 0xF7) { return XContentType.CBOR; } } // for small objects, some encoders just encode as major type object, we can safely // say its CBOR since it doesn't contradict SMILE or JSON, and its a last resort if (CBORConstants.hasMajorType(CBORConstants.MAJOR_TYPE_OBJECT, first)) { return XContentType.CBOR; } int jsonStart = 0; // JSON may be preceded by UTF-8 BOM if (length > 3 && first == (byte) 0xEF && bytes[offset + 1] == (byte) 0xBB && bytes[offset + 2] == (byte) 0xBF) { jsonStart = 3; } // a last chance for JSON for (int i = jsonStart; i < length; i++) { byte b = bytes[offset + i]; if (b == '{') { return XContentType.JSON; } if (Character.isWhitespace(b) == false) { break; } } return null; }
static XContentType function(byte[] bytes, int offset, int length) { int totalLength = bytes.length; if (totalLength == 0 length == 0) { return null; } else if ((offset + length) > totalLength) { return null; } byte first = bytes[offset]; if (first == '{') { return XContentType.JSON; } if (length > 2 && first == SmileConstants.HEADER_BYTE_1 && bytes[offset + 1] == SmileConstants.HEADER_BYTE_2 && bytes[offset + 2] == SmileConstants.HEADER_BYTE_3) { return XContentType.SMILE; } if (length > 2 && first == '-' && bytes[offset + 1] == '-' && bytes[offset + 2] == '-') { return XContentType.YAML; } if (first == CBORConstants.BYTE_OBJECT_INDEFINITE && length > 1){ return XContentType.CBOR; } if (CBORConstants.hasMajorType(CBORConstants.MAJOR_TYPE_TAG, first) && length > 2) { if (first == (byte) 0xD9 && bytes[offset + 1] == (byte) 0xD9 && bytes[offset + 2] == (byte) 0xF7) { return XContentType.CBOR; } } if (CBORConstants.hasMajorType(CBORConstants.MAJOR_TYPE_OBJECT, first)) { return XContentType.CBOR; } int jsonStart = 0; if (length > 3 && first == (byte) 0xEF && bytes[offset + 1] == (byte) 0xBB && bytes[offset + 2] == (byte) 0xBF) { jsonStart = 3; } for (int i = jsonStart; i < length; i++) { byte b = bytes[offset + i]; if (b == '{') { return XContentType.JSON; } if (Character.isWhitespace(b) == false) { break; } } return null; }
/** * Guesses the content type based on the provided bytes. * * @deprecated the content type should not be guessed except for few cases where we effectively don't know the content type. * The REST layer should move to reading the Content-Type header instead. There are other places where auto-detection may be needed. * This method is deprecated to prevent usages of it from spreading further without specific reasons. */
Guesses the content type based on the provided bytes
xContentType
{ "repo_name": "s1monw/elasticsearch", "path": "server/src/main/java/org/elasticsearch/common/xcontent/XContentFactory.java", "license": "apache-2.0", "size": 13613 }
[ "com.fasterxml.jackson.dataformat.cbor.CBORConstants", "com.fasterxml.jackson.dataformat.smile.SmileConstants" ]
import com.fasterxml.jackson.dataformat.cbor.CBORConstants; import com.fasterxml.jackson.dataformat.smile.SmileConstants;
import com.fasterxml.jackson.dataformat.cbor.*; import com.fasterxml.jackson.dataformat.smile.*;
[ "com.fasterxml.jackson" ]
com.fasterxml.jackson;
2,486,317