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
sequence
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
sequence
libraries_info
stringlengths
6
661
id
int64
0
2.92M
AdHocCommandData getData() { return data; }
AdHocCommandData getData() { return data; }
/** * Gets the data of the current stage. This should not used. * * @return the data. */
Gets the data of the current stage. This should not used
getData
{ "repo_name": "Flowdalic/Smack", "path": "smack-extensions/src/main/java/org/jivesoftware/smackx/commands/AdHocCommand.java", "license": "apache-2.0", "size": 17119 }
[ "org.jivesoftware.smackx.commands.packet.AdHocCommandData" ]
import org.jivesoftware.smackx.commands.packet.AdHocCommandData;
import org.jivesoftware.smackx.commands.packet.*;
[ "org.jivesoftware.smackx" ]
org.jivesoftware.smackx;
1,401,275
boolean doCreateToken(@Nonnull Credentials credentials);
boolean doCreateToken(@Nonnull Credentials credentials);
/** * Returns {@code true} if the given credentials indicate that a new token * needs to be issued. * * @param credentials The current credentials. * @return {@code true} if a new login token needs to be created, {@code false} otherwise. */
Returns true if the given credentials indicate that a new token needs to be issued
doCreateToken
{ "repo_name": "mduerig/jackrabbit-oak", "path": "oak-security-spi/src/main/java/org/apache/jackrabbit/oak/spi/security/authentication/token/TokenProvider.java", "license": "apache-2.0", "size": 3493 }
[ "javax.annotation.Nonnull", "javax.jcr.Credentials" ]
import javax.annotation.Nonnull; import javax.jcr.Credentials;
import javax.annotation.*; import javax.jcr.*;
[ "javax.annotation", "javax.jcr" ]
javax.annotation; javax.jcr;
1,123,300
public void createTable(Database database, Table table) throws IOException { createTable(database, table, null); }
void function(Database database, Table table) throws IOException { createTable(database, table, null); }
/** * Outputs the DDL to create the table along with any non-external constraints as well * as with external primary keys and indices (but not foreign keys). * * @param database The database model * @param table The table */
Outputs the DDL to create the table along with any non-external constraints as well as with external primary keys and indices (but not foreign keys)
createTable
{ "repo_name": "etiago/apache-ddlutils", "path": "src/java/org/apache/ddlutils/platform/SqlBuilder.java", "license": "apache-2.0", "size": 99834 }
[ "java.io.IOException", "org.apache.ddlutils.model.Database", "org.apache.ddlutils.model.Table" ]
import java.io.IOException; import org.apache.ddlutils.model.Database; import org.apache.ddlutils.model.Table;
import java.io.*; import org.apache.ddlutils.model.*;
[ "java.io", "org.apache.ddlutils" ]
java.io; org.apache.ddlutils;
1,417,586
public static PageParameters getPageParameters(final String reportId) { return getPageParameters(reportId, null); }
static PageParameters function(final String reportId) { return getPageParameters(reportId, null); }
/** * Gets the page parameters for calling the list page only for displaying accounting records of the given report. * @param reportId The id of the report of the ReportStorage of ReportObjectivesPage. */
Gets the page parameters for calling the list page only for displaying accounting records of the given report
getPageParameters
{ "repo_name": "micromata/projectforge-webapp", "path": "src/main/java/org/projectforge/web/fibu/AccountingRecordListPage.java", "license": "gpl-3.0", "size": 11540 }
[ "org.apache.wicket.request.mapper.parameter.PageParameters" ]
import org.apache.wicket.request.mapper.parameter.PageParameters;
import org.apache.wicket.request.mapper.parameter.*;
[ "org.apache.wicket" ]
org.apache.wicket;
1,997,570
public List<ExtendedCampaign> getExtendedCampaignsByStatus(CampaignStatus campaignStatus) throws RemoteException { return ExtendedCampaign.as( delegateLocator.getCampaignDelegate().getByStatus(campaignStatus), delegateLocator); }
List<ExtendedCampaign> function(CampaignStatus campaignStatus) throws RemoteException { return ExtendedCampaign.as( delegateLocator.getCampaignDelegate().getByStatus(campaignStatus), delegateLocator); }
/** * Gets the ExtendedCampaigns for the ExtendedManagedCustomer's ManagedCustomer * by campaignStatus. * @param campaignStatus the status of the Campign * @return all the ExtendedCampaigns for the ExtendedManagedCustomer's * ManagedCustomer that match the campaignStatus * @throws RemoteException for communication-related exceptions */
Gets the ExtendedCampaigns for the ExtendedManagedCustomer's ManagedCustomer by campaignStatus
getExtendedCampaignsByStatus
{ "repo_name": "raja15792/googleads-java-lib", "path": "modules/adwords_axis_utility_extension/src/main/java/com/google/api/ads/adwords/axis/utility/extension/ExtendedManagedCustomer.java", "license": "apache-2.0", "size": 39864 }
[ "com.google.api.ads.adwords.axis.v201506.cm.CampaignStatus", "java.rmi.RemoteException", "java.util.List" ]
import com.google.api.ads.adwords.axis.v201506.cm.CampaignStatus; import java.rmi.RemoteException; import java.util.List;
import com.google.api.ads.adwords.axis.v201506.cm.*; import java.rmi.*; import java.util.*;
[ "com.google.api", "java.rmi", "java.util" ]
com.google.api; java.rmi; java.util;
1,423,906
public static <V, C extends Collection<? super V>> C addAll(C c, V... vals) { Collections.addAll(c, vals); return c; }
static <V, C extends Collection<? super V>> C function(C c, V... vals) { Collections.addAll(c, vals); return c; }
/** * Adds values to collection and returns the same collection to allow chaining. * * @param c Collection to add values to. * @param vals Values. * @param <V> Value type. * @return Passed in collection. */
Adds values to collection and returns the same collection to allow chaining
addAll
{ "repo_name": "NSAmelchev/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java", "license": "apache-2.0", "size": 388551 }
[ "java.util.Collection", "java.util.Collections" ]
import java.util.Collection; import java.util.Collections;
import java.util.*;
[ "java.util" ]
java.util;
1,549,736
EList<String> getDefaults();
EList<String> getDefaults();
/** * Returns the value of the '<em><b>Defaults</b></em>' attribute list. * The list contents are of type {@link java.lang.String}. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Defaults</em>' attribute list isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Defaults</em>' attribute list. * @see de.unidue.ecg.characterScript.characterScript.CharacterScriptPackage#getTemplate_Defaults() * @model unique="false" * @generated */
Returns the value of the 'Defaults' attribute list. The list contents are of type <code>java.lang.String</code>. If the meaning of the 'Defaults' attribute list isn't clear, there really should be more of a description here...
getDefaults
{ "repo_name": "RobertWalter83/DialogScriptDSL", "path": "plugins/de.unidue.ecg.characterScript/src-gen/de/unidue/ecg/characterScript/characterScript/Template.java", "license": "apache-2.0", "size": 2953 }
[ "org.eclipse.emf.common.util.EList" ]
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
613,742
EClass getXMLTypeDocumentRoot();
EClass getXMLTypeDocumentRoot();
/** * Returns the meta object for class '{@link org.eclipse.emf.ecore.xml.type.XMLTypeDocumentRoot <em>Document Root</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for class '<em>Document Root</em>'. * @see org.eclipse.emf.ecore.xml.type.XMLTypeDocumentRoot * @generated */
Returns the meta object for class '<code>org.eclipse.emf.ecore.xml.type.XMLTypeDocumentRoot Document Root</code>'.
getXMLTypeDocumentRoot
{ "repo_name": "LangleyStudios/eclipse-avro", "path": "test/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/xml/type/XMLTypePackage.java", "license": "epl-1.0", "size": 81687 }
[ "org.eclipse.emf.ecore.EClass" ]
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
458,478
@Test public void testWriteNewUrlsFilev22() { Exception exceptionCaught = null; try { File testFile = TestUtil.copyAudioToTmp("testV1.mp3", new File("test1032.mp3")); //Add a v24Tag AudioFile af = AudioFileIO.read(testFile); MP3File mp3File = (MP3File)af; //Checking not overwriting audio when have to pad to fix data long mp3AudioLength = testFile.length() - mp3File.getMP3AudioHeader().getMp3StartByte(); mp3File.setID3v2Tag(new ID3v22Tag()); mp3File.saveMp3(); af = AudioFileIO.read(testFile); mp3File = (MP3File)af; Assert.assertEquals(mp3AudioLength, testFile.length() - mp3File.getMP3AudioHeader().getMp3StartByte()); //Check mapped okay ands empty Assert.assertEquals(0, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_OFFICIAL_RELEASE_SITE).size()); Assert.assertEquals(0, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_OFFICIAL_ARTIST_SITE).size()); Assert.assertEquals(0, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_DISCOGS_RELEASE_SITE).size()); Assert.assertEquals(0, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_DISCOGS_ARTIST_SITE).size()); Assert.assertEquals(0, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_WIKIPEDIA_RELEASE_SITE).size()); Assert.assertEquals(0, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_WIKIPEDIA_ARTIST_SITE).size()); Assert.assertEquals(0, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_LYRICS_SITE).size()); //Now write these fields mp3File.getTag().or(NullTag.INSTANCE).setField(FieldKey.URL_OFFICIAL_RELEASE_SITE, "http://test1"); mp3File.getTag().or(NullTag.INSTANCE).setField(FieldKey.URL_DISCOGS_RELEASE_SITE, "http://test2"); mp3File.getTag().or(NullTag.INSTANCE).setField(FieldKey.URL_DISCOGS_ARTIST_SITE, "http://test3"); mp3File.getTag().or(NullTag.INSTANCE).setField(FieldKey.URL_WIKIPEDIA_RELEASE_SITE, "http://test4"); mp3File.getTag().or(NullTag.INSTANCE).setField(FieldKey.URL_WIKIPEDIA_ARTIST_SITE, "http://test5"); mp3File.getTag().or(NullTag.INSTANCE).setField(FieldKey.URL_OFFICIAL_ARTIST_SITE, "http://test6"); mp3File.getTag().or(NullTag.INSTANCE).setField(FieldKey.URL_LYRICS_SITE, "http://test7"); mp3File.saveMp3(); af = AudioFileIO.read(testFile); mp3File = (MP3File)af; //Check mapped okay ands empty Assert.assertEquals(1, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_OFFICIAL_RELEASE_SITE).size()); Assert.assertEquals(1, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_DISCOGS_RELEASE_SITE).size()); Assert.assertEquals(1, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_DISCOGS_ARTIST_SITE).size()); Assert.assertEquals(1, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_WIKIPEDIA_RELEASE_SITE).size()); Assert.assertEquals(1, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_WIKIPEDIA_ARTIST_SITE).size()); Assert.assertEquals(1, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_OFFICIAL_ARTIST_SITE).size()); Assert.assertEquals(1, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_LYRICS_SITE).size()); //Delete Fields mp3File.getTag().or(NullTag.INSTANCE).deleteField(FieldKey.URL_OFFICIAL_RELEASE_SITE); mp3File.getTag().or(NullTag.INSTANCE).deleteField(FieldKey.URL_DISCOGS_RELEASE_SITE); mp3File.getTag().or(NullTag.INSTANCE).deleteField(FieldKey.URL_DISCOGS_ARTIST_SITE); mp3File.getTag().or(NullTag.INSTANCE).deleteField(FieldKey.URL_WIKIPEDIA_RELEASE_SITE); mp3File.getTag().or(NullTag.INSTANCE).deleteField(FieldKey.URL_WIKIPEDIA_ARTIST_SITE); mp3File.getTag().or(NullTag.INSTANCE).deleteField(FieldKey.URL_OFFICIAL_ARTIST_SITE); mp3File.getTag().or(NullTag.INSTANCE).deleteField(FieldKey.URL_LYRICS_SITE); mp3File.saveMp3(); af = AudioFileIO.read(testFile); mp3File = (MP3File)af; Assert.assertEquals(0, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_OFFICIAL_RELEASE_SITE).size()); Assert.assertEquals(0, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_OFFICIAL_ARTIST_SITE).size()); Assert.assertEquals(0, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_DISCOGS_RELEASE_SITE).size()); Assert.assertEquals(0, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_DISCOGS_ARTIST_SITE).size()); Assert.assertEquals(0, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_WIKIPEDIA_RELEASE_SITE).size()); Assert.assertEquals(0, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_WIKIPEDIA_ARTIST_SITE).size()); Assert.assertEquals(0, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_LYRICS_SITE).size()); } catch (Exception e) { exceptionCaught = e; e.printStackTrace(); } Assert.assertNull(exceptionCaught); }
@Test void function() { Exception exceptionCaught = null; try { File testFile = TestUtil.copyAudioToTmp(STR, new File(STR)); AudioFile af = AudioFileIO.read(testFile); MP3File mp3File = (MP3File)af; long mp3AudioLength = testFile.length() - mp3File.getMP3AudioHeader().getMp3StartByte(); mp3File.setID3v2Tag(new ID3v22Tag()); mp3File.saveMp3(); af = AudioFileIO.read(testFile); mp3File = (MP3File)af; Assert.assertEquals(mp3AudioLength, testFile.length() - mp3File.getMP3AudioHeader().getMp3StartByte()); Assert.assertEquals(0, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_OFFICIAL_RELEASE_SITE).size()); Assert.assertEquals(0, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_OFFICIAL_ARTIST_SITE).size()); Assert.assertEquals(0, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_DISCOGS_RELEASE_SITE).size()); Assert.assertEquals(0, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_DISCOGS_ARTIST_SITE).size()); Assert.assertEquals(0, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_WIKIPEDIA_RELEASE_SITE).size()); Assert.assertEquals(0, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_WIKIPEDIA_ARTIST_SITE).size()); Assert.assertEquals(0, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_LYRICS_SITE).size()); mp3File.getTag().or(NullTag.INSTANCE).setField(FieldKey.URL_OFFICIAL_RELEASE_SITE, STRhttp: mp3File.getTag().or(NullTag.INSTANCE).setField(FieldKey.URL_DISCOGS_ARTIST_SITE, STRhttp: mp3File.getTag().or(NullTag.INSTANCE).setField(FieldKey.URL_WIKIPEDIA_ARTIST_SITE, STRhttp: mp3File.getTag().or(NullTag.INSTANCE).setField(FieldKey.URL_LYRICS_SITE, "http: mp3File.saveMp3(); af = AudioFileIO.read(testFile); mp3File = (MP3File)af; Assert.assertEquals(1, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_OFFICIAL_RELEASE_SITE).size()); Assert.assertEquals(1, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_DISCOGS_RELEASE_SITE).size()); Assert.assertEquals(1, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_DISCOGS_ARTIST_SITE).size()); Assert.assertEquals(1, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_WIKIPEDIA_RELEASE_SITE).size()); Assert.assertEquals(1, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_WIKIPEDIA_ARTIST_SITE).size()); Assert.assertEquals(1, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_OFFICIAL_ARTIST_SITE).size()); Assert.assertEquals(1, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_LYRICS_SITE).size()); mp3File.getTag().or(NullTag.INSTANCE).deleteField(FieldKey.URL_OFFICIAL_RELEASE_SITE); mp3File.getTag().or(NullTag.INSTANCE).deleteField(FieldKey.URL_DISCOGS_RELEASE_SITE); mp3File.getTag().or(NullTag.INSTANCE).deleteField(FieldKey.URL_DISCOGS_ARTIST_SITE); mp3File.getTag().or(NullTag.INSTANCE).deleteField(FieldKey.URL_WIKIPEDIA_RELEASE_SITE); mp3File.getTag().or(NullTag.INSTANCE).deleteField(FieldKey.URL_WIKIPEDIA_ARTIST_SITE); mp3File.getTag().or(NullTag.INSTANCE).deleteField(FieldKey.URL_OFFICIAL_ARTIST_SITE); mp3File.getTag().or(NullTag.INSTANCE).deleteField(FieldKey.URL_LYRICS_SITE); mp3File.saveMp3(); af = AudioFileIO.read(testFile); mp3File = (MP3File)af; Assert.assertEquals(0, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_OFFICIAL_RELEASE_SITE).size()); Assert.assertEquals(0, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_OFFICIAL_ARTIST_SITE).size()); Assert.assertEquals(0, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_DISCOGS_RELEASE_SITE).size()); Assert.assertEquals(0, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_DISCOGS_ARTIST_SITE).size()); Assert.assertEquals(0, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_WIKIPEDIA_RELEASE_SITE).size()); Assert.assertEquals(0, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_WIKIPEDIA_ARTIST_SITE).size()); Assert.assertEquals(0, mp3File.getTag().or(NullTag.INSTANCE).getFields(FieldKey.URL_LYRICS_SITE).size()); } catch (Exception e) { exceptionCaught = e; e.printStackTrace(); } Assert.assertNull(exceptionCaught); }
/** * Test New Urls ID3v24 */
Test New Urls ID3v24
testWriteNewUrlsFilev22
{ "repo_name": "pandasys/ealvatag", "path": "ealvatag/src/test/java/ealvatag/issues/Issue242Test.java", "license": "lgpl-3.0", "size": 17079 }
[ "java.io.File", "org.junit.Assert", "org.junit.Test" ]
import java.io.File; import org.junit.Assert; import org.junit.Test;
import java.io.*; import org.junit.*;
[ "java.io", "org.junit" ]
java.io; org.junit;
2,836,441
int updateByPrimaryKeySelective(ItemTimeLogging record);
int updateByPrimaryKeySelective(ItemTimeLogging record);
/** * This method was generated by MyBatis Generator. * This method corresponds to the database table m_prj_time_logging * * @mbggenerated Thu Jul 16 10:50:12 ICT 2015 */
This method was generated by MyBatis Generator. This method corresponds to the database table m_prj_time_logging
updateByPrimaryKeySelective
{ "repo_name": "uniteddiversity/mycollab", "path": "mycollab-services/src/main/java/com/esofthead/mycollab/module/project/dao/ItemTimeLoggingMapper.java", "license": "agpl-3.0", "size": 5778 }
[ "com.esofthead.mycollab.module.project.domain.ItemTimeLogging" ]
import com.esofthead.mycollab.module.project.domain.ItemTimeLogging;
import com.esofthead.mycollab.module.project.domain.*;
[ "com.esofthead.mycollab" ]
com.esofthead.mycollab;
1,294,907
public String toJson(Map<String, Object> map) { StringBuilder builder = new StringBuilder(); serializeObject(map, builder, 0); return builder.toString(); }
String function(Map<String, Object> map) { StringBuilder builder = new StringBuilder(); serializeObject(map, builder, 0); return builder.toString(); }
/** * Converts the map to a JSON string. * @param map The map to be converted to a JSON string. * @return A JSON string that represents the map. */
Converts the map to a JSON string
toJson
{ "repo_name": "rollbar/rollbar-java", "path": "rollbar-java/src/main/java/com/rollbar/notifier/sender/json/JsonSerializerImpl.java", "license": "mit", "size": 7295 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,343,613
public void setUpperBound(double max) { if (this.range.getLowerBound() < max) { setRange(new Range(this.range.getLowerBound(), max)); } else { setRange(max - 1.0, max); } }
void function(double max) { if (this.range.getLowerBound() < max) { setRange(new Range(this.range.getLowerBound(), max)); } else { setRange(max - 1.0, max); } }
/** * Sets the upper bound for the axis range, and sends an * {@link AxisChangeEvent} to all registered listeners. * * @param max the new maximum. * * @see #getUpperBound() */
Sets the upper bound for the axis range, and sends an <code>AxisChangeEvent</code> to all registered listeners
setUpperBound
{ "repo_name": "simeshev/parabuild-ci", "path": "3rdparty/jfreechart-1.0.5/source/org/jfree/chart/axis/ValueAxis.java", "license": "lgpl-3.0", "size": 57055 }
[ "org.jfree.data.Range" ]
import org.jfree.data.Range;
import org.jfree.data.*;
[ "org.jfree.data" ]
org.jfree.data;
360,867
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); this.backgroundPaint = SerialUtilities.readPaint(stream); this.foregroundPaint = SerialUtilities.readPaint(stream); this.stroke = SerialUtilities.readStroke(stream); }
void function(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); this.backgroundPaint = SerialUtilities.readPaint(stream); this.foregroundPaint = SerialUtilities.readPaint(stream); this.stroke = SerialUtilities.readStroke(stream); }
/** * Provides serialization support. * * @param stream the input stream. * * @throws IOException if there is an I/O error. * @throws ClassNotFoundException if there is a classpath problem. */
Provides serialization support
readObject
{ "repo_name": "JSansalone/JFreeChart", "path": "source/org/jfree/chart/plot/dial/StandardDialFrame.java", "license": "lgpl-2.1", "size": 11009 }
[ "java.io.IOException", "java.io.ObjectInputStream", "org.jfree.io.SerialUtilities" ]
import java.io.IOException; import java.io.ObjectInputStream; import org.jfree.io.SerialUtilities;
import java.io.*; import org.jfree.io.*;
[ "java.io", "org.jfree.io" ]
java.io; org.jfree.io;
1,075,952
@Override public final MarkupElement nextElement() throws ParseException { HttpTagType type; while ((type = parser.next()) != HttpTagType.NOT_INITIALIZED) { if (type == HttpTagType.BODY) { continue; } else if (type == HttpTagType.TAG) { return new ComponentTag(parser.getElement()); } else { return new HtmlSpecialTag(parser.getElement(), type); } } return null; }
final MarkupElement function() throws ParseException { HttpTagType type; while ((type = parser.next()) != HttpTagType.NOT_INITIALIZED) { if (type == HttpTagType.BODY) { continue; } else if (type == HttpTagType.TAG) { return new ComponentTag(parser.getElement()); } else { return new HtmlSpecialTag(parser.getElement(), type); } } return null; }
/** * Skip all xml elements until the next tag. */
Skip all xml elements until the next tag
nextElement
{ "repo_name": "mafulafunk/wicket", "path": "wicket-core/src/main/java/org/apache/wicket/markup/parser/filter/RootMarkupFilter.java", "license": "apache-2.0", "size": 3413 }
[ "java.text.ParseException", "org.apache.wicket.markup.ComponentTag", "org.apache.wicket.markup.HtmlSpecialTag", "org.apache.wicket.markup.MarkupElement", "org.apache.wicket.markup.parser.IXmlPullParser" ]
import java.text.ParseException; import org.apache.wicket.markup.ComponentTag; import org.apache.wicket.markup.HtmlSpecialTag; import org.apache.wicket.markup.MarkupElement; import org.apache.wicket.markup.parser.IXmlPullParser;
import java.text.*; import org.apache.wicket.markup.*; import org.apache.wicket.markup.parser.*;
[ "java.text", "org.apache.wicket" ]
java.text; org.apache.wicket;
2,584,927
public void sortImagesToShow(final List<CidsBean> sortedStatdbilder) { if ((sortedStatdbilder != null) && !sortedStatdbilder.isEmpty()) { imagesToShow = sortedStatdbilder; } else { LOG.info("Sb_stadtbildserieGridObject.sortImagesToShow() got an empty list."); imagesToShow = imagesToShow = stadtbildserie.getBeanCollectionProperty("stadtbilder_arr"); } }
void function(final List<CidsBean> sortedStatdbilder) { if ((sortedStatdbilder != null) && !sortedStatdbilder.isEmpty()) { imagesToShow = sortedStatdbilder; } else { LOG.info(STR); imagesToShow = imagesToShow = stadtbildserie.getBeanCollectionProperty(STR); } }
/** * Modifies the order of the shown images. * * @param sortedStatdbilder DOCUMENT ME! */
Modifies the order of the shown images
sortImagesToShow
{ "repo_name": "cismet/cids-custom-wuppertal", "path": "src/main/java/de/cismet/cids/custom/objectrenderer/wunda_blau/Sb_stadtbildserieGridObject.java", "license": "lgpl-3.0", "size": 14235 }
[ "de.cismet.cids.dynamics.CidsBean", "java.util.List" ]
import de.cismet.cids.dynamics.CidsBean; import java.util.List;
import de.cismet.cids.dynamics.*; import java.util.*;
[ "de.cismet.cids", "java.util" ]
de.cismet.cids; java.util;
644,859
T getOne(EntityCriteria entityCriteria);
T getOne(EntityCriteria entityCriteria);
/** * Get entity object based on search condition and search keyword. * * @param entityCriteria * @return */
Get entity object based on search condition and search keyword
getOne
{ "repo_name": "Rocky-Hu/jecstore", "path": "base-main/base-service/src/main/java/net/oxmall/base/service/GenericService.java", "license": "gpl-2.0", "size": 2704 }
[ "net.oxmall.base.dal.mybatis.criteria.EntityCriteria" ]
import net.oxmall.base.dal.mybatis.criteria.EntityCriteria;
import net.oxmall.base.dal.mybatis.criteria.*;
[ "net.oxmall.base" ]
net.oxmall.base;
1,568,316
private void attributeProcessingTime(Duration duration, long snapshot) { // TODO: This algorithm is used to compute "per-element-processing-time" counter // values, but a slightly different algorithm is used for msec counters. Values for both // counters should be derived from the same algorithm to avoid unexpected discrepancies. // Calculate total execution counts int totalExecutions = 0; Map<ElementExecution, Integer> executionsPerElement = new HashMap<>(); for (ElementExecution execution : sharedState.executionJournal.readUntil(snapshot)) { totalExecutions++; if (execution != ElementExecution.IDLE) { executionsPerElement.compute(execution, (unused, count) -> count == null ? 1 : count + 1); } } // Attribute processing time final int totalExecutionsFinal = totalExecutions; for (Map.Entry<ElementExecution, Integer> executionCount : executionsPerElement.entrySet()) { executionTimes.compute( executionCount.getKey(), (unused, total) -> { int numExecutions = executionCount.getValue(); Duration attributedSampleTime = duration.dividedBy(totalExecutionsFinal).multipliedBy(numExecutions); return total == null ? attributedSampleTime : total.plus(attributedSampleTime); }); } }
void function(Duration duration, long snapshot) { int totalExecutions = 0; Map<ElementExecution, Integer> executionsPerElement = new HashMap<>(); for (ElementExecution execution : sharedState.executionJournal.readUntil(snapshot)) { totalExecutions++; if (execution != ElementExecution.IDLE) { executionsPerElement.compute(execution, (unused, count) -> count == null ? 1 : count + 1); } } final int totalExecutionsFinal = totalExecutions; for (Map.Entry<ElementExecution, Integer> executionCount : executionsPerElement.entrySet()) { executionTimes.compute( executionCount.getKey(), (unused, total) -> { int numExecutions = executionCount.getValue(); Duration attributedSampleTime = duration.dividedBy(totalExecutionsFinal).multipliedBy(numExecutions); return total == null ? attributedSampleTime : total.plus(attributedSampleTime); }); } }
/** * Attribute processing time to elements from {@code executionJournal} up to the specified * snapshot. */
Attribute processing time to elements from executionJournal up to the specified snapshot
attributeProcessingTime
{ "repo_name": "mxm/incubator-beam", "path": "runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/DataflowElementExecutionTracker.java", "license": "apache-2.0", "size": 18121 }
[ "java.time.Duration", "java.util.HashMap", "java.util.Map" ]
import java.time.Duration; import java.util.HashMap; import java.util.Map;
import java.time.*; import java.util.*;
[ "java.time", "java.util" ]
java.time; java.util;
2,317,625
public static Range toRange(Object object, String typeClass) { if (object instanceof Range) { return (Range) object; } else if (object instanceof Map) { Map map = (Map) object; Object min = parse(map.get("min"), typeClass); Object max = parse(map.get("max"), typeClass); return new Range(min, max); } else if (object instanceof String) { // we parse Strings in the format of 'X..Y' to ranges String objectAsStr = (String) object; String minStr = null; String maxStr = null; if (objectAsStr.endsWith("..")) { minStr = objectAsStr.substring(0, objectAsStr.length() - 2); } else if (objectAsStr.startsWith("..")) { maxStr = objectAsStr.substring(2, objectAsStr.length()); } else { String[] split = objectAsStr.split("\\.\\."); if (split.length != 2) { throw unableToParseException(object, Range.class); } minStr = split[0]; maxStr = split[1]; } Object min = parse(minStr, typeClass); Object max = parse(maxStr, typeClass); return new Range(min, max); } else { throw unableToParseException(object, Range.class); } } /** * Parses given {@link java.util.Collection} class into {@link java.util.Set}. If given value is * not a subtype of {@link java.util.Collection} it throws {@link java.lang.IllegalArgumentException}. * * @param object value to parse * @param typeClass type of the values that should be placed in {@link java.util.Set}
static Range function(Object object, String typeClass) { if (object instanceof Range) { return (Range) object; } else if (object instanceof Map) { Map map = (Map) object; Object min = parse(map.get("min"), typeClass); Object max = parse(map.get("max"), typeClass); return new Range(min, max); } else if (object instanceof String) { String objectAsStr = (String) object; String minStr = null; String maxStr = null; if (objectAsStr.endsWith("..")) { minStr = objectAsStr.substring(0, objectAsStr.length() - 2); } else if (objectAsStr.startsWith("..")) { maxStr = objectAsStr.substring(2, objectAsStr.length()); } else { String[] split = objectAsStr.split(STR); if (split.length != 2) { throw unableToParseException(object, Range.class); } minStr = split[0]; maxStr = split[1]; } Object min = parse(minStr, typeClass); Object max = parse(maxStr, typeClass); return new Range(min, max); } else { throw unableToParseException(object, Range.class); } } /** * Parses given {@link java.util.Collection} class into {@link java.util.Set}. If given value is * not a subtype of {@link java.util.Collection} it throws {@link java.lang.IllegalArgumentException}. * * @param object value to parse * @param typeClass type of the values that should be placed in {@link java.util.Set}
/** * Parses given value to {@link org.motechproject.commons.api.Range}. If passed value is assignable * neither to range nor to map, it throws {@link java.lang.IllegalArgumentException}. If value is a map, * it should contain keys "min" and "max". * * @param object value to parse * @param typeClass fully qualified class name of the range values * @return {@link org.motechproject.commons.api.Range} value */
Parses given value to <code>org.motechproject.commons.api.Range</code>. If passed value is assignable neither to range nor to map, it throws <code>java.lang.IllegalArgumentException</code>. If value is a map, it should contain keys "min" and "max"
toRange
{ "repo_name": "sebbrudzinski/motech", "path": "platform/mds/mds/src/main/java/org/motechproject/mds/util/TypeHelper.java", "license": "bsd-3-clause", "size": 40887 }
[ "java.util.Collection", "java.util.Map", "java.util.Set", "org.apache.commons.lang.StringUtils", "org.motechproject.commons.api.Range" ]
import java.util.Collection; import java.util.Map; import java.util.Set; import org.apache.commons.lang.StringUtils; import org.motechproject.commons.api.Range;
import java.util.*; import org.apache.commons.lang.*; import org.motechproject.commons.api.*;
[ "java.util", "org.apache.commons", "org.motechproject.commons" ]
java.util; org.apache.commons; org.motechproject.commons;
260,839
public RelationshipType getNullRelation() { return this.getRelationshipType(Constants.RELATIONSHIP_TYPE_NULL); } protected RelationshipTypeList(final GameData data) { super(data); try { createDefaultRelationship(Constants.RELATIONSHIP_TYPE_SELF, RelationshipTypeAttachment.ARCHETYPE_ALLIED, data); createDefaultRelationship(Constants.RELATIONSHIP_TYPE_NULL, RelationshipTypeAttachment.ARCHETYPE_WAR, data); createDefaultRelationship(Constants.RELATIONSHIP_TYPE_DEFAULT_WAR, RelationshipTypeAttachment.ARCHETYPE_WAR, data); createDefaultRelationship(Constants.RELATIONSHIP_TYPE_DEFAULT_ALLIED, RelationshipTypeAttachment.ARCHETYPE_ALLIED, data); } catch (final GameParseException e) { // this should never happen, createDefaultRelationship only throws a GameParseException when the wrong ArcheType // is supplied, but we // never do that throw new IllegalStateException(e); } }
RelationshipType function() { return this.getRelationshipType(Constants.RELATIONSHIP_TYPE_NULL); } protected RelationshipTypeList(final GameData data) { super(data); try { createDefaultRelationship(Constants.RELATIONSHIP_TYPE_SELF, RelationshipTypeAttachment.ARCHETYPE_ALLIED, data); createDefaultRelationship(Constants.RELATIONSHIP_TYPE_NULL, RelationshipTypeAttachment.ARCHETYPE_WAR, data); createDefaultRelationship(Constants.RELATIONSHIP_TYPE_DEFAULT_WAR, RelationshipTypeAttachment.ARCHETYPE_WAR, data); createDefaultRelationship(Constants.RELATIONSHIP_TYPE_DEFAULT_ALLIED, RelationshipTypeAttachment.ARCHETYPE_ALLIED, data); } catch (final GameParseException e) { throw new IllegalStateException(e); } }
/** * convenience method to return the RELATIONSHIP_TYPE_NULL relation (the relation you have with the Neutral Player) * * @return the relation one has with the Neutral. */
convenience method to return the RELATIONSHIP_TYPE_NULL relation (the relation you have with the Neutral Player)
getNullRelation
{ "repo_name": "simon33-2/triplea", "path": "src/games/strategy/engine/data/RelationshipTypeList.java", "license": "gpl-2.0", "size": 4695 }
[ "games.strategy.triplea.Constants", "games.strategy.triplea.attachments.RelationshipTypeAttachment" ]
import games.strategy.triplea.Constants; import games.strategy.triplea.attachments.RelationshipTypeAttachment;
import games.strategy.triplea.*; import games.strategy.triplea.attachments.*;
[ "games.strategy.triplea" ]
games.strategy.triplea;
2,032,704
private void notifyConnState( int w ) { // TDLog.v( "notify conn state" ); if ( mConnListener == null ) return; for ( Handler hdl : mConnListener ) { try { Message msg = Message.obtain(); msg.what = w; new Messenger( hdl ).send( msg ); } catch ( RemoteException e ) { } } } // --------------------------------------------------------------- // survey/calib info //
void function( int w ) { if ( mConnListener == null ) return; for ( Handler hdl : mConnListener ) { try { Message msg = Message.obtain(); msg.what = w; new Messenger( hdl ).send( msg ); } catch ( RemoteException e ) { } } } //
/** send a notification to the commention listeners * @param w notification (value) */
send a notification to the commention listeners
notifyConnState
{ "repo_name": "marcocorvi/topodroid", "path": "src/com/topodroid/DistoX/TopoDroidApp.java", "license": "gpl-3.0", "size": 106607 }
[ "android.os.Handler", "android.os.Message", "android.os.Messenger", "android.os.RemoteException" ]
import android.os.Handler; import android.os.Message; import android.os.Messenger; import android.os.RemoteException;
import android.os.*;
[ "android.os" ]
android.os;
2,521,100
@NonNull public ListBuilder addGridRow(@NonNull GridRowBuilder builder) { mImpl.addGridRow(builder); return this; }
ListBuilder function(@NonNull GridRowBuilder builder) { mImpl.addGridRow(builder); return this; }
/** * Add a grid row to the list builder. * <p> * Note that grid rows cannot be the first row in your slice. Adding a grid row first without * calling {@link #setHeader(HeaderBuilder)} will result in {@link IllegalStateException} when * the slice is built. */
Add a grid row to the list builder. Note that grid rows cannot be the first row in your slice. Adding a grid row first without calling <code>#setHeader(HeaderBuilder)</code> will result in <code>IllegalStateException</code> when the slice is built
addGridRow
{ "repo_name": "AndroidX/androidx", "path": "slice/slice-builders/src/main/java/androidx/slice/builders/ListBuilder.java", "license": "apache-2.0", "size": 74588 }
[ "androidx.annotation.NonNull" ]
import androidx.annotation.NonNull;
import androidx.annotation.*;
[ "androidx.annotation" ]
androidx.annotation;
1,530,943
boolean addPartition(Partition part) throws InvalidObjectException, MetaException;
boolean addPartition(Partition part) throws InvalidObjectException, MetaException;
/** * Add a partition. * @param part partition to add * @return true if the partition was successfully added. * @throws InvalidObjectException the provided partition object is not valid. * @throws MetaException error writing to the RDBMS. */
Add a partition
addPartition
{ "repo_name": "lirui-apache/hive", "path": "standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/RawStore.java", "license": "apache-2.0", "size": 94780 }
[ "org.apache.hadoop.hive.metastore.api.InvalidObjectException", "org.apache.hadoop.hive.metastore.api.MetaException", "org.apache.hadoop.hive.metastore.api.Partition" ]
import org.apache.hadoop.hive.metastore.api.InvalidObjectException; import org.apache.hadoop.hive.metastore.api.MetaException; import org.apache.hadoop.hive.metastore.api.Partition;
import org.apache.hadoop.hive.metastore.api.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
2,483,062
Map<String, Object> retrieveValue = new HashMap<>(); retrieveValue.put("datasize", getSize()); retrieveValue.put("iata_freq", getFreqs()); retrieveValue.put("radius_freq", getHits()); return GSON.toJson(retrieveValue); }
Map<String, Object> retrieveValue = new HashMap<>(); retrieveValue.put(STR, getSize()); retrieveValue.put(STR, getFreqs()); retrieveValue.put(STR, getHits()); return GSON.toJson(retrieveValue); }
/** * Retrieve service health including total size of valid data points and * request frequency information. * * @return health stats for the service as a string */
Retrieve service health including total size of valid data points and request frequency information
ping
{ "repo_name": "luisfsosa/airport-weather", "path": "weather-dist/src/main/java/com/crossover/trial/weather/controller/WeatherQueryController.java", "license": "apache-2.0", "size": 8232 }
[ "java.util.HashMap", "java.util.Map" ]
import java.util.HashMap; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,412,602
void write(final DataOutputStream out) throws IOException { HFileProtos.FileInfoProto.Builder builder = HFileProtos.FileInfoProto.newBuilder(); for (Map.Entry<byte [], byte[]> e: this.map.entrySet()) { HBaseProtos.BytesBytesPair.Builder bbpBuilder = HBaseProtos.BytesBytesPair.newBuilder(); bbpBuilder.setFirst(ByteStringer.wrap(e.getKey())); bbpBuilder.setSecond(ByteStringer.wrap(e.getValue())); builder.addMapEntry(bbpBuilder.build()); } out.write(ProtobufMagic.PB_MAGIC); builder.build().writeDelimitedTo(out); }
void write(final DataOutputStream out) throws IOException { HFileProtos.FileInfoProto.Builder builder = HFileProtos.FileInfoProto.newBuilder(); for (Map.Entry<byte [], byte[]> e: this.map.entrySet()) { HBaseProtos.BytesBytesPair.Builder bbpBuilder = HBaseProtos.BytesBytesPair.newBuilder(); bbpBuilder.setFirst(ByteStringer.wrap(e.getKey())); bbpBuilder.setSecond(ByteStringer.wrap(e.getValue())); builder.addMapEntry(bbpBuilder.build()); } out.write(ProtobufMagic.PB_MAGIC); builder.build().writeDelimitedTo(out); }
/** * Write out this instance on the passed in <code>out</code> stream. * We write it as a protobuf. * @param out * @throws IOException * @see #read(DataInputStream) */
Write out this instance on the passed in <code>out</code> stream. We write it as a protobuf
write
{ "repo_name": "lshmouse/hbase", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java", "license": "apache-2.0", "size": 33561 }
[ "java.io.DataOutputStream", "java.io.IOException", "java.util.Map", "org.apache.hadoop.hbase.protobuf.ProtobufMagic", "org.apache.hadoop.hbase.protobuf.generated.HBaseProtos", "org.apache.hadoop.hbase.protobuf.generated.HFileProtos", "org.apache.hadoop.hbase.util.ByteStringer" ]
import java.io.DataOutputStream; import java.io.IOException; import java.util.Map; import org.apache.hadoop.hbase.protobuf.ProtobufMagic; import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos; import org.apache.hadoop.hbase.protobuf.generated.HFileProtos; import org.apache.hadoop.hbase.util.ByteStringer;
import java.io.*; import java.util.*; import org.apache.hadoop.hbase.protobuf.*; import org.apache.hadoop.hbase.protobuf.generated.*; import org.apache.hadoop.hbase.util.*;
[ "java.io", "java.util", "org.apache.hadoop" ]
java.io; java.util; org.apache.hadoop;
232,626
private int createAndLinkProgram(final int vertexShaderHandle, final int fragmentShaderHandle, final String[] attributes) { int programHandle = GLES20.glCreateProgram(); if (programHandle != 0) { // Bind the vertex shader to the program. GLES20.glAttachShader(programHandle, vertexShaderHandle); // Bind the fragment shader to the program. GLES20.glAttachShader(programHandle, fragmentShaderHandle); // Bind attributes if (attributes != null) { final int size = attributes.length; for (int i = 0; i < size; i++) { GLES20.glBindAttribLocation(programHandle, i, attributes[i]); } } // Link the two shaders together into a program. GLES20.glLinkProgram(programHandle); // Get the link status. final int[] linkStatus = new int[1]; GLES20.glGetProgramiv(programHandle, GLES20.GL_LINK_STATUS, linkStatus, 0); // If the link failed, delete the program. if (linkStatus[0] == 0) { Log.e(TAG, "Error compiling program: " + GLES20.glGetProgramInfoLog(programHandle)); GLES20.glDeleteProgram(programHandle); programHandle = 0; } } if (programHandle == 0) { throw new RuntimeException("Error creating program."); } return programHandle; }
int function(final int vertexShaderHandle, final int fragmentShaderHandle, final String[] attributes) { int programHandle = GLES20.glCreateProgram(); if (programHandle != 0) { GLES20.glAttachShader(programHandle, vertexShaderHandle); GLES20.glAttachShader(programHandle, fragmentShaderHandle); if (attributes != null) { final int size = attributes.length; for (int i = 0; i < size; i++) { GLES20.glBindAttribLocation(programHandle, i, attributes[i]); } } GLES20.glLinkProgram(programHandle); final int[] linkStatus = new int[1]; GLES20.glGetProgramiv(programHandle, GLES20.GL_LINK_STATUS, linkStatus, 0); if (linkStatus[0] == 0) { Log.e(TAG, STR + GLES20.glGetProgramInfoLog(programHandle)); GLES20.glDeleteProgram(programHandle); programHandle = 0; } } if (programHandle == 0) { throw new RuntimeException(STR); } return programHandle; }
/** * Helper function to compile and link a program. * * @param vertexShaderHandle An OpenGL handle to an already-compiled vertex shader. * @param fragmentShaderHandle An OpenGL handle to an already-compiled fragment shader. * @param attributes Attributes that need to be bound to the program. * @return An OpenGL handle to the program. */
Helper function to compile and link a program
createAndLinkProgram
{ "repo_name": "learnopengles/GLWallpaperService", "path": "GLWallpaperTest/src/com/learnopengles/android/lesson2/LessonTwoRenderer.java", "license": "apache-2.0", "size": 23446 }
[ "android.util.Log" ]
import android.util.Log;
import android.util.*;
[ "android.util" ]
android.util;
569,539
public boolean process(ElementListener listener) { try { for (Iterator i = iterator(); i.hasNext(); ) { listener.add((Element) i.next()); } return true; } catch(DocumentException de) { return false; } }
boolean function(ElementListener listener) { try { for (Iterator i = iterator(); i.hasNext(); ) { listener.add((Element) i.next()); } return true; } catch(DocumentException de) { return false; } }
/** * Processes the element by adding it (or the different parts) to an * <CODE>ElementListener</CODE>. * * @param listener the <CODE>ElementListener</CODE> * @return <CODE>true</CODE> if the element was processed successfully */
Processes the element by adding it (or the different parts) to an <code>ElementListener</code>
process
{ "repo_name": "MesquiteProject/MesquiteArchive", "path": "trunk/Mesquite Project/LibrarySource/com/lowagie/text/Section.java", "license": "lgpl-3.0", "size": 20887 }
[ "java.util.Iterator" ]
import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
2,263,237
public synchronized BaseType createAtomicType(final String name, final int size, final boolean signed) throws CouldntSaveDataException { Preconditions.checkNotNull(name, "IE02778: Type name can not be null."); Preconditions.checkArgument(size >= 0, "Size can not be negative."); final BaseType newType = instantiateType(name, size, signed, null, BaseTypeCategory.ATOMIC); notifyTypeAdded(newType); return newType; }
synchronized BaseType function(final String name, final int size, final boolean signed) throws CouldntSaveDataException { Preconditions.checkNotNull(name, STR); Preconditions.checkArgument(size >= 0, STR); final BaseType newType = instantiateType(name, size, signed, null, BaseTypeCategory.ATOMIC); notifyTypeAdded(newType); return newType; }
/** * Creates a new base atomic base type instance. * * @param name The name of the new base type. * @param size The size of the base type in bits. * @param signed Specifies whether the type can represent signed numbers. * @return The newly created base types. * @throws CouldntSaveDataException Thrown if the type could not be written to the backend. */
Creates a new base atomic base type instance
createAtomicType
{ "repo_name": "AmesianX/binnavi", "path": "src/main/java/com/google/security/zynamics/binnavi/disassembly/types/TypeManager.java", "license": "apache-2.0", "size": 69583 }
[ "com.google.common.base.Preconditions", "com.google.security.zynamics.binnavi.Database" ]
import com.google.common.base.Preconditions; import com.google.security.zynamics.binnavi.Database;
import com.google.common.base.*; import com.google.security.zynamics.binnavi.*;
[ "com.google.common", "com.google.security" ]
com.google.common; com.google.security;
1,314,062
public String getName(Locale locale) { return Messages.getInstance().getText(locale, "resources.editMaterialResource.pageTitle"); }
String function(Locale locale) { return Messages.getInstance().getText(locale, STR); }
/** * Returns the localized name of this page. Used e.g. for breadcrumb navigation. * * @param locale The locale to be used for the name * * @return The localized name of this page */
Returns the localized name of this page. Used e.g. for breadcrumb navigation
getName
{ "repo_name": "otavanopisto/pyramus", "path": "pyramus/src/main/java/fi/otavanopisto/pyramus/views/resources/EditMaterialResourceViewController.java", "license": "gpl-3.0", "size": 2829 }
[ "fi.otavanopisto.pyramus.I18N", "java.util.Locale" ]
import fi.otavanopisto.pyramus.I18N; import java.util.Locale;
import fi.otavanopisto.pyramus.*; import java.util.*;
[ "fi.otavanopisto.pyramus", "java.util" ]
fi.otavanopisto.pyramus; java.util;
2,299,184
private void maybeShowPopup(MouseEvent e, boolean pressed) { // If this is the right mouse button if (e.isPopupTrigger()) { int selRow = tree.getRowForLocation(e.getX(), e.getY()); if (selRow != -1) { popup.show(e.getComponent(), e.getX(), e.getY()); TreePath selPath = tree.getPathForLocation(e.getX(), e.getY()); DefaultMutableTreeNode node = (DefaultMutableTreeNode) selPath.getLastPathComponent(); deleteFolder = (Folder)node.getUserObject(); deleteRow = selRow; } } } }
void function(MouseEvent e, boolean pressed) { if (e.isPopupTrigger()) { int selRow = tree.getRowForLocation(e.getX(), e.getY()); if (selRow != -1) { popup.show(e.getComponent(), e.getX(), e.getY()); TreePath selPath = tree.getPathForLocation(e.getX(), e.getY()); DefaultMutableTreeNode node = (DefaultMutableTreeNode) selPath.getLastPathComponent(); deleteFolder = (Folder)node.getUserObject(); deleteRow = selRow; } } } }
/** * Method to display the menu and if the user clicks a button * * @param e * @param pressed */
Method to display the menu and if the user clicks a button
maybeShowPopup
{ "repo_name": "GabrielGhe/MailClient", "path": "src/cs516/gabrielGheorghian/tree/MailTree.java", "license": "mit", "size": 8936 }
[ "java.awt.event.MouseEvent", "javax.swing.tree.DefaultMutableTreeNode", "javax.swing.tree.TreePath" ]
import java.awt.event.MouseEvent; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.TreePath;
import java.awt.event.*; import javax.swing.tree.*;
[ "java.awt", "javax.swing" ]
java.awt; javax.swing;
2,561,248
@ServiceMethod(returns = ReturnType.SINGLE) Mono<EncryptionScopeInner> patchAsync( String resourceGroupName, String accountName, String encryptionScopeName, EncryptionScopeInner encryptionScope);
@ServiceMethod(returns = ReturnType.SINGLE) Mono<EncryptionScopeInner> patchAsync( String resourceGroupName, String accountName, String encryptionScopeName, EncryptionScopeInner encryptionScope);
/** * Update encryption scope properties as specified in the request body. Update fails if the specified encryption * scope does not already exist. * * @param resourceGroupName The name of the resource group within the user's subscription. The name is case * insensitive. * @param accountName The name of the storage account within the specified resource group. Storage account names * must be between 3 and 24 characters in length and use numbers and lower-case letters only. * @param encryptionScopeName The name of the encryption scope within the specified storage account. Encryption * scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) * only. Every dash (-) character must be immediately preceded and followed by a letter or number. * @param encryptionScope Encryption scope properties to be used for the update. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the Encryption Scope resource. */
Update encryption scope properties as specified in the request body. Update fails if the specified encryption scope does not already exist
patchAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanagerhybrid/azure-resourcemanager-storage/src/main/java/com/azure/resourcemanager/storage/fluent/EncryptionScopesClient.java", "license": "mit", "size": 22245 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.resourcemanager.storage.fluent.models.EncryptionScopeInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.storage.fluent.models.EncryptionScopeInner;
import com.azure.core.annotation.*; import com.azure.resourcemanager.storage.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
2,258,742
public Team findTeam(VariableInstance instance) { if (instance.getScope() instanceof PlayerScope) { return playerFacade.find(instance.getPlayer().getId()).getTeam(); } else if (instance.getScope() instanceof TeamScope) { return teamFacade.find(instance.getTeam().getId()); } else if (instance.getScope() instanceof GameScope) { throw new UnsupportedOperationException(); // Should never be called } else if (instance.getScope() instanceof GameModelScope) { throw new UnsupportedOperationException();// Should never be called //return instance.getDescriptor().getGameModel().getGames().get(0); } else { throw new UnsupportedOperationException(); // Should never occur } } /** * Such a method should in a so-called GameFacade, nope ? Something like * {@link GameFacade#find(java.lang.Long) GameFacade.find()}
Team function(VariableInstance instance) { if (instance.getScope() instanceof PlayerScope) { return playerFacade.find(instance.getPlayer().getId()).getTeam(); } else if (instance.getScope() instanceof TeamScope) { return teamFacade.find(instance.getTeam().getId()); } else if (instance.getScope() instanceof GameScope) { throw new UnsupportedOperationException(); } else if (instance.getScope() instanceof GameModelScope) { throw new UnsupportedOperationException(); } else { throw new UnsupportedOperationException(); } } /** * Such a method should in a so-called GameFacade, nope ? Something like * {@link GameFacade#find(java.lang.Long) GameFacade.find()}
/** * * From an instance, retrieve the team it is part f * * @param instance * * @return the team the instance belongs to * * @throws UnsupportedOperationException when instance is a default * instance, a gameModel scoped or * game scoped one */
From an instance, retrieve the team it is part f
findTeam
{ "repo_name": "ghiringh/Wegas", "path": "wegas-core/src/main/java/com/wegas/core/ejb/VariableInstanceFacade.java", "license": "mit", "size": 15637 }
[ "com.wegas.core.persistence.game.Team", "com.wegas.core.persistence.variable.VariableInstance", "com.wegas.core.persistence.variable.scope.GameModelScope", "com.wegas.core.persistence.variable.scope.GameScope", "com.wegas.core.persistence.variable.scope.PlayerScope", "com.wegas.core.persistence.variable.scope.TeamScope" ]
import com.wegas.core.persistence.game.Team; import com.wegas.core.persistence.variable.VariableInstance; import com.wegas.core.persistence.variable.scope.GameModelScope; import com.wegas.core.persistence.variable.scope.GameScope; import com.wegas.core.persistence.variable.scope.PlayerScope; import com.wegas.core.persistence.variable.scope.TeamScope;
import com.wegas.core.persistence.game.*; import com.wegas.core.persistence.variable.*; import com.wegas.core.persistence.variable.scope.*;
[ "com.wegas.core" ]
com.wegas.core;
2,747,689
private Collection<Query> getInserts(TaskConfiguration configuration){ if(configuration.json().has(TASK_LOADER_MUTATIONS)){ return configuration.json().at(TASK_LOADER_MUTATIONS).asJsonList().stream() .map(Json::asString) .map(builder::<Query<?>>parse) .map(query -> { if (query.isReadOnly()) { throw new IllegalArgumentException(READ_ONLY_QUERY.getMessage(query.toString())); } return query; }) .collect(Collectors.toList()); } throw new IllegalArgumentException(ILLEGAL_ARGUMENT_EXCEPTION.getMessage("No inserts", configuration)); }
Collection<Query> function(TaskConfiguration configuration){ if(configuration.json().has(TASK_LOADER_MUTATIONS)){ return configuration.json().at(TASK_LOADER_MUTATIONS).asJsonList().stream() .map(Json::asString) .map(builder::<Query<?>>parse) .map(query -> { if (query.isReadOnly()) { throw new IllegalArgumentException(READ_ONLY_QUERY.getMessage(query.toString())); } return query; }) .collect(Collectors.toList()); } throw new IllegalArgumentException(ILLEGAL_ARGUMENT_EXCEPTION.getMessage(STR, configuration)); }
/** * Extract mutate queries from a configuration object * @param configuration JSONObject containing configuration * @return graql queries from the configuration */
Extract mutate queries from a configuration object
getInserts
{ "repo_name": "burukuru/grakn", "path": "grakn-engine/src/main/java/ai/grakn/engine/loader/MutatorTask.java", "license": "gpl-3.0", "size": 5584 }
[ "ai.grakn.engine.tasks.manager.TaskConfiguration", "ai.grakn.graql.Query", "java.util.Collection", "java.util.stream.Collectors" ]
import ai.grakn.engine.tasks.manager.TaskConfiguration; import ai.grakn.graql.Query; import java.util.Collection; import java.util.stream.Collectors;
import ai.grakn.engine.tasks.manager.*; import ai.grakn.graql.*; import java.util.*; import java.util.stream.*;
[ "ai.grakn.engine", "ai.grakn.graql", "java.util" ]
ai.grakn.engine; ai.grakn.graql; java.util;
2,138,609
public ConnectionFactoryBuilder setWriteOpQueueFactory(OperationQueueFactory q) { writeQueueFactory = q; return this; }
ConnectionFactoryBuilder function(OperationQueueFactory q) { writeQueueFactory = q; return this; }
/** * Set the write queue factory. */
Set the write queue factory
setWriteOpQueueFactory
{ "repo_name": "haisamido/SFDaaS", "path": "src/net/spy/memcached/ConnectionFactoryBuilder.java", "license": "lgpl-3.0", "size": 9563 }
[ "net.spy.memcached.ops.OperationQueueFactory" ]
import net.spy.memcached.ops.OperationQueueFactory;
import net.spy.memcached.ops.*;
[ "net.spy.memcached" ]
net.spy.memcached;
2,109,190
public static void setFileBlockSize(Class<?> implementingClass, Configuration conf, long fileBlockSize) { setAccumuloProperty(implementingClass, conf, Property.TABLE_FILE_BLOCK_SIZE, fileBlockSize); }
static void function(Class<?> implementingClass, Configuration conf, long fileBlockSize) { setAccumuloProperty(implementingClass, conf, Property.TABLE_FILE_BLOCK_SIZE, fileBlockSize); }
/** * Sets the size for file blocks in the file system; file blocks are managed, and replicated, by the underlying file system. * * @param implementingClass * the class whose name will be used as a prefix for the property configuration key * @param conf * the Hadoop configuration object to configure * @param fileBlockSize * the block size, in bytes * @since 1.5.0 */
Sets the size for file blocks in the file system; file blocks are managed, and replicated, by the underlying file system
setFileBlockSize
{ "repo_name": "phrocker/accumulo", "path": "core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/util/FileOutputConfigurator.java", "license": "apache-2.0", "size": 7947 }
[ "org.apache.accumulo.core.conf.Property", "org.apache.hadoop.conf.Configuration" ]
import org.apache.accumulo.core.conf.Property; import org.apache.hadoop.conf.Configuration;
import org.apache.accumulo.core.conf.*; import org.apache.hadoop.conf.*;
[ "org.apache.accumulo", "org.apache.hadoop" ]
org.apache.accumulo; org.apache.hadoop;
1,314,127
@Override public synchronized ImageDatum createImageDatum(final String code) throws FactoryException { final ImageDatum datum; final String key = trimAuthority(code); final Object cached = get(key); if (cached instanceof ImageDatum) { datum = (ImageDatum) cached; } else { datum = getBackingStore().createImageDatum(code); } put(key, datum); return datum; }
synchronized ImageDatum function(final String code) throws FactoryException { final ImageDatum datum; final String key = trimAuthority(code); final Object cached = get(key); if (cached instanceof ImageDatum) { datum = (ImageDatum) cached; } else { datum = getBackingStore().createImageDatum(code); } put(key, datum); return datum; }
/** * Returns an image datum from a code. * * @throws FactoryException if the object creation failed. */
Returns an image datum from a code
createImageDatum
{ "repo_name": "geotools/geotools", "path": "modules/library/referencing/src/main/java/org/geotools/referencing/factory/BufferedAuthorityFactory.java", "license": "lgpl-2.1", "size": 44519 }
[ "org.opengis.referencing.FactoryException", "org.opengis.referencing.datum.ImageDatum" ]
import org.opengis.referencing.FactoryException; import org.opengis.referencing.datum.ImageDatum;
import org.opengis.referencing.*; import org.opengis.referencing.datum.*;
[ "org.opengis.referencing" ]
org.opengis.referencing;
2,407,000
@Override public List<Period> generatePeriods( DateTimeUnit dateTimeUnit ) { org.hisp.dhis.calendar.Calendar cal = getCalendar(); dateTimeUnit.setMonth( 1 ); dateTimeUnit.setDay( 1 ); int year = dateTimeUnit.getYear(); List<Period> periods = Lists.newArrayList(); while ( year == dateTimeUnit.getYear() ) { periods.add( createPeriod( dateTimeUnit, cal ) ); dateTimeUnit = cal.plusMonths( dateTimeUnit, 3 ); } return periods; }
List<Period> function( DateTimeUnit dateTimeUnit ) { org.hisp.dhis.calendar.Calendar cal = getCalendar(); dateTimeUnit.setMonth( 1 ); dateTimeUnit.setDay( 1 ); int year = dateTimeUnit.getYear(); List<Period> periods = Lists.newArrayList(); while ( year == dateTimeUnit.getYear() ) { periods.add( createPeriod( dateTimeUnit, cal ) ); dateTimeUnit = cal.plusMonths( dateTimeUnit, 3 ); } return periods; }
/** * Generates quarterly Periods for the whole year in which the given * Period's startDate exists. */
Generates quarterly Periods for the whole year in which the given Period's startDate exists
generatePeriods
{ "repo_name": "jason-p-pickering/dhis2-core", "path": "dhis-2/dhis-api/src/main/java/org/hisp/dhis/period/QuarterlyPeriodType.java", "license": "bsd-3-clause", "size": 7909 }
[ "com.google.common.collect.Lists", "java.util.List", "org.hisp.dhis.calendar.DateTimeUnit" ]
import com.google.common.collect.Lists; import java.util.List; import org.hisp.dhis.calendar.DateTimeUnit;
import com.google.common.collect.*; import java.util.*; import org.hisp.dhis.calendar.*;
[ "com.google.common", "java.util", "org.hisp.dhis" ]
com.google.common; java.util; org.hisp.dhis;
81,974
void checkGroupName(String groupName) throws CmsIllegalArgumentException;
void checkGroupName(String groupName) throws CmsIllegalArgumentException;
/** * Checks if the provided group name is a valid group name.<p> * * @param groupName the group name to check * * @throws CmsIllegalArgumentException if the given group name is not valid */
Checks if the provided group name is a valid group name
checkGroupName
{ "repo_name": "it-tavis/opencms-core", "path": "src/org/opencms/security/I_CmsValidationHandler.java", "license": "lgpl-2.1", "size": 3105 }
[ "org.opencms.main.CmsIllegalArgumentException" ]
import org.opencms.main.CmsIllegalArgumentException;
import org.opencms.main.*;
[ "org.opencms.main" ]
org.opencms.main;
1,129,456
public static boolean isSameType(SeriesData s1, SeriesData s2) { Log.debug("Comparing SeriesData " + s1.getName() + " and SeriesData " + s2.getName()); if (s1.getRuns().size() != s2.getRuns().size()) { Log.warn("different amount of runs on series " + s1.getName() + " and series " + s2.getName()); return false; } for (int i = 0; i < s1.getRuns().size(); i++) { RunData.isSameType(s1.getRun(i), s2.getRun(i)); } return true; }
static boolean function(SeriesData s1, SeriesData s2) { Log.debug(STR + s1.getName() + STR + s2.getName()); if (s1.getRuns().size() != s2.getRuns().size()) { Log.warn(STR + s1.getName() + STR + s2.getName()); return false; } for (int i = 0; i < s1.getRuns().size(); i++) { RunData.isSameType(s1.getRun(i), s2.getRun(i)); } return true; }
/** * This method tests if two different SeriesData objects are from the same * type and can be compared. Checks: - same amount of runs - same runs (uses * RunData.sameType()) * * @author Rwilmes * @date 15.07.2013 */
This method tests if two different SeriesData objects are from the same type and can be compared. Checks: - same amount of runs - same runs (uses RunData.sameType())
isSameType
{ "repo_name": "marcel-stud/DNA", "path": "src/dna/series/data/SeriesData.java", "license": "gpl-3.0", "size": 8005 }
[ "dna.util.Log" ]
import dna.util.Log;
import dna.util.*;
[ "dna.util" ]
dna.util;
824,341
public byte[] getValue(byte[] key) { return getValue(new ImmutableBytesWritable(key)); }
byte[] function(byte[] key) { return getValue(new ImmutableBytesWritable(key)); }
/** * Getter for accessing the metadata associated with the key * * @param key The key. * @return The value. * @see #values */
Getter for accessing the metadata associated with the key
getValue
{ "repo_name": "mapr/hbase", "path": "hbase-client/src/main/java/org/apache/hadoop/hbase/HTableDescriptor.java", "license": "apache-2.0", "size": 51244 }
[ "org.apache.hadoop.hbase.io.ImmutableBytesWritable" ]
import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
import org.apache.hadoop.hbase.io.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,172,712
public static void notEmpty(Collection collection, CharSequence message) { if (collection == null || collection.isEmpty()) { throw new IllegalArgumentException("[FOSS-0005][notEmpty][" + message + "]"); } }
static void function(Collection collection, CharSequence message) { if (collection == null collection.isEmpty()) { throw new IllegalArgumentException(STR + message + "]"); } }
/** * Assert that a collection has elements; that is, it must not be * <code>null</code> and must have at least one element. * * <pre class="code"> * Assert.notEmpty(collection, &quot;Collection must have elements&quot;); * </pre> * * @param collection * the collection to check * @param message * the exception message to use if the assertion fails * @throws IllegalArgumentException * if the collection is <code>null</code> or has no elements */
Assert that a collection has elements; that is, it must not be <code>null</code> and must have at least one element. Assert.notEmpty(collection, &quot;Collection must have elements&quot;); </code>
notEmpty
{ "repo_name": "tylerchen/springmvc-mybatis-modules-project", "path": "common/src/main/java/com/foreveross/infra/util/Assert.java", "license": "apache-2.0", "size": 20063 }
[ "java.util.Collection" ]
import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
2,264,305
public void addChangeListener(ChangeListener l) { listenerList.add(ChangeListener.class, l); } /** * Removes a ChangeListener from the slider. * * @param l the ChangeListener to remove * @see #fireStateChanged * @see #addChangeListener
void function(ChangeListener l) { listenerList.add(ChangeListener.class, l); } /** * Removes a ChangeListener from the slider. * * @param l the ChangeListener to remove * @see #fireStateChanged * @see #addChangeListener
/** * Adds a ChangeListener to the slider. * * @param l the ChangeListener to add * @see #fireStateChanged * @see #removeChangeListener */
Adds a ChangeListener to the slider
addChangeListener
{ "repo_name": "mirkosertic/Bytecoder", "path": "classlib/java.desktop/src/main/resources/META-INF/modules/java.desktop/classes/javax/swing/JSlider.java", "license": "apache-2.0", "size": 55707 }
[ "javax.swing.event.ChangeListener" ]
import javax.swing.event.ChangeListener;
import javax.swing.event.*;
[ "javax.swing" ]
javax.swing;
1,026,264
public static Long getSecondsLeft(long toolContentId, int userId) { LearningWebsocketServer instance = LearningWebsocketServer.getInstance(); return AbstractTimeLimitWebsocketServer.getSecondsLeft(instance, toolContentId, userId, true); }
static Long function(long toolContentId, int userId) { LearningWebsocketServer instance = LearningWebsocketServer.getInstance(); return AbstractTimeLimitWebsocketServer.getSecondsLeft(instance, toolContentId, userId, true); }
/** * Fetches or creates a singleton of this websocket server. */
Fetches or creates a singleton of this websocket server
getSecondsLeft
{ "repo_name": "lamsfoundation/lams", "path": "lams_tool_assessment/src/java/org/lamsfoundation/lams/tool/assessment/web/controller/LearningWebsocketServer.java", "license": "gpl-2.0", "size": 3946 }
[ "org.lamsfoundation.lams.web.controller.AbstractTimeLimitWebsocketServer" ]
import org.lamsfoundation.lams.web.controller.AbstractTimeLimitWebsocketServer;
import org.lamsfoundation.lams.web.controller.*;
[ "org.lamsfoundation.lams" ]
org.lamsfoundation.lams;
2,099,005
public boolean hasBeenModifiedSince(long lastModifiedTime){ Long modified = (Long) get(MODIFIED_IN_SECS); return modified != null && modified > TimeUnit.MILLISECONDS.toSeconds(lastModifiedTime); }
boolean function(long lastModifiedTime){ Long modified = (Long) get(MODIFIED_IN_SECS); return modified != null && modified > TimeUnit.MILLISECONDS.toSeconds(lastModifiedTime); }
/** * Checks if this document has been modified after the given lastModifiedTime * * @param lastModifiedTime time to compare against in millis * @return <tt>true</tt> if this document was modified after the given * lastModifiedTime */
Checks if this document has been modified after the given lastModifiedTime
hasBeenModifiedSince
{ "repo_name": "afilimonov/jackrabbit-oak", "path": "oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/NodeDocument.java", "license": "apache-2.0", "size": 87554 }
[ "java.util.concurrent.TimeUnit" ]
import java.util.concurrent.TimeUnit;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
2,435,409
public MockMvcRequestSpecBuilder addHeader(Header header) { spec.header(header); return this; }
MockMvcRequestSpecBuilder function(Header header) { spec.header(header); return this; }
/** * Add a header to be sent with the request. * * @param header The header * @return The request specification builder */
Add a header to be sent with the request
addHeader
{ "repo_name": "paweld2/rest-assured", "path": "modules/spring-mock-mvc/src/main/java/io/restassured/module/mockmvc/specification/MockMvcRequestSpecBuilder.java", "license": "apache-2.0", "size": 28410 }
[ "io.restassured.http.Header" ]
import io.restassured.http.Header;
import io.restassured.http.*;
[ "io.restassured.http" ]
io.restassured.http;
1,982,181
public void setCurrentState(final double[] s) { this.currentState = new BiPolarNeuralData(s.length); EngineArray.arrayCopy(s, this.currentState.getData()); }
void function(final double[] s) { this.currentState = new BiPolarNeuralData(s.length); EngineArray.arrayCopy(s, this.currentState.getData()); }
/** * Set the current state. * <p/> * @param s The current state array. */
Set the current state.
setCurrentState
{ "repo_name": "ladygagapowerbot/bachelor-thesis-implementation", "path": "lib/Encog/src/main/java/org/encog/neural/thermal/ThermalNetwork.java", "license": "mit", "size": 6801 }
[ "org.encog.ml.data.specific.BiPolarNeuralData", "org.encog.util.EngineArray" ]
import org.encog.ml.data.specific.BiPolarNeuralData; import org.encog.util.EngineArray;
import org.encog.ml.data.specific.*; import org.encog.util.*;
[ "org.encog.ml", "org.encog.util" ]
org.encog.ml; org.encog.util;
2,190,537
ArrayList<ListBlobsEntry> result = new ArrayList<ListBlobsEntry>(); result.addAll(this.blobPrefixes); result.addAll(this.blobs); return result; }
ArrayList<ListBlobsEntry> result = new ArrayList<ListBlobsEntry>(); result.addAll(this.blobPrefixes); result.addAll(this.blobs); return result; }
/** * Gets the list of <code>ListBlobsEntry</code> entries generated from the * server response to the list blobs request. * * @return The {@link List} of {@link ListBlobsEntry} entries generated from * the server response to the list blobs request. */
Gets the list of <code>ListBlobsEntry</code> entries generated from the server response to the list blobs request
getEntries
{ "repo_name": "flydream2046/azure-sdk-for-java", "path": "services/azure-media/src/main/java/com/microsoft/windowsazure/services/blob/models/ListBlobsResult.java", "license": "apache-2.0", "size": 24835 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
2,382,507
@ServiceMethod(returns = ReturnType.SINGLE) TimeseriesInner getTimeseries( String resourceGroupName, String profileName, String experimentName, OffsetDateTime startDateTimeUtc, OffsetDateTime endDateTimeUtc, TimeseriesAggregationInterval aggregationInterval, TimeseriesType timeseriesType);
@ServiceMethod(returns = ReturnType.SINGLE) TimeseriesInner getTimeseries( String resourceGroupName, String profileName, String experimentName, OffsetDateTime startDateTimeUtc, OffsetDateTime endDateTimeUtc, TimeseriesAggregationInterval aggregationInterval, TimeseriesType timeseriesType);
/** * Gets a Timeseries for a given Experiment. * * @param resourceGroupName Name of the Resource group within the Azure subscription. * @param profileName The Profile identifier associated with the Tenant and Partner. * @param experimentName The Experiment identifier associated with the Experiment. * @param startDateTimeUtc The start DateTime of the Timeseries in UTC. * @param endDateTimeUtc The end DateTime of the Timeseries in UTC. * @param aggregationInterval The aggregation interval of the Timeseries. * @param timeseriesType The type of Timeseries. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a Timeseries for a given Experiment. */
Gets a Timeseries for a given Experiment
getTimeseries
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/frontdoor/azure-resourcemanager-frontdoor/src/main/java/com/azure/resourcemanager/frontdoor/fluent/ReportsClient.java", "license": "mit", "size": 6488 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.resourcemanager.frontdoor.fluent.models.TimeseriesInner", "com.azure.resourcemanager.frontdoor.models.TimeseriesAggregationInterval", "com.azure.resourcemanager.frontdoor.models.TimeseriesType", "java.time.OffsetDateTime" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.frontdoor.fluent.models.TimeseriesInner; import com.azure.resourcemanager.frontdoor.models.TimeseriesAggregationInterval; import com.azure.resourcemanager.frontdoor.models.TimeseriesType; import java.time.OffsetDateTime;
import com.azure.core.annotation.*; import com.azure.resourcemanager.frontdoor.fluent.models.*; import com.azure.resourcemanager.frontdoor.models.*; import java.time.*;
[ "com.azure.core", "com.azure.resourcemanager", "java.time" ]
com.azure.core; com.azure.resourcemanager; java.time;
566,096
public String formatMessage(Locale locale, String key, Object[] arguments) throws MissingResourceException { if (fResourceBundle == null || locale != fLocale) { if (locale != null) { fResourceBundle = PropertyResourceBundle.getBundle("org.apache.xerces.impl.msg.XMLSchemaMessages", locale); // memorize the most-recent locale fLocale = locale; } if (fResourceBundle == null) fResourceBundle = PropertyResourceBundle.getBundle("org.apache.xerces.impl.msg.XMLSchemaMessages"); } String msg = fResourceBundle.getString(key); if (arguments != null) { try { msg = java.text.MessageFormat.format(msg, arguments); } catch (Exception e) { msg = fResourceBundle.getString("FormatFailed"); msg += " " + fResourceBundle.getString(key); } } if (msg == null) { msg = fResourceBundle.getString("BadMessageKey"); throw new MissingResourceException(msg, "org.apache.xerces.impl.msg.SchemaMessages", key); } return msg; }
String function(Locale locale, String key, Object[] arguments) throws MissingResourceException { if (fResourceBundle == null locale != fLocale) { if (locale != null) { fResourceBundle = PropertyResourceBundle.getBundle(STR, locale); fLocale = locale; } if (fResourceBundle == null) fResourceBundle = PropertyResourceBundle.getBundle(STR); } String msg = fResourceBundle.getString(key); if (arguments != null) { try { msg = java.text.MessageFormat.format(msg, arguments); } catch (Exception e) { msg = fResourceBundle.getString(STR); msg += " " + fResourceBundle.getString(key); } } if (msg == null) { msg = fResourceBundle.getString(STR); throw new MissingResourceException(msg, STR, key); } return msg; }
/** * Formats a message with the specified arguments using the given * locale information. * * @param locale The locale of the message. * @param key The message key. * @param arguments The message replacement text arguments. The order * of the arguments must match that of the placeholders * in the actual message. * * @return Returns the formatted message. * * @throws MissingResourceException Thrown if the message with the * specified key cannot be found. */
Formats a message with the specified arguments using the given locale information
formatMessage
{ "repo_name": "BIORIMP/biorimp", "path": "BIO-RIMP/test_data/code/xerces/src/org/apache/xerces/impl/xs/XSMessageFormatter.java", "license": "gpl-2.0", "size": 3370 }
[ "java.util.Locale", "java.util.MissingResourceException", "java.util.PropertyResourceBundle" ]
import java.util.Locale; import java.util.MissingResourceException; import java.util.PropertyResourceBundle;
import java.util.*;
[ "java.util" ]
java.util;
1,411,867
protected String getRefererBaseURI(Element ref) { return ((AbstractNode) ref).getBaseURI(); }
String function(Element ref) { return ((AbstractNode) ref).getBaseURI(); }
/** * Returns the base URI of the referer element. */
Returns the base URI of the referer element
getRefererBaseURI
{ "repo_name": "Squeegee/batik", "path": "sources/org/apache/batik/bridge/URIResolver.java", "license": "apache-2.0", "size": 5264 }
[ "org.apache.batik.dom.AbstractNode", "org.w3c.dom.Element" ]
import org.apache.batik.dom.AbstractNode; import org.w3c.dom.Element;
import org.apache.batik.dom.*; import org.w3c.dom.*;
[ "org.apache.batik", "org.w3c.dom" ]
org.apache.batik; org.w3c.dom;
3,988
public InstructionHandle getPredecessorOf(InstructionHandle handle) { if (VERIFY_INTEGRITY) { if (!containsInstruction(handle)) throw new IllegalStateException(); } return handle == firstInstruction ? null : handle.getPrev(); }
InstructionHandle function(InstructionHandle handle) { if (VERIFY_INTEGRITY) { if (!containsInstruction(handle)) throw new IllegalStateException(); } return handle == firstInstruction ? null : handle.getPrev(); }
/** * Get the predecessor of given instruction within the basic block. * * @param handle * the instruction * @return the instruction's predecessor, or null if the instruction is the * first in the basic block */
Get the predecessor of given instruction within the basic block
getPredecessorOf
{ "repo_name": "jesusaplsoft/FindAllBugs", "path": "findbugs/src/java/edu/umd/cs/findbugs/ba/BasicBlock.java", "license": "gpl-2.0", "size": 14377 }
[ "org.apache.bcel.generic.InstructionHandle" ]
import org.apache.bcel.generic.InstructionHandle;
import org.apache.bcel.generic.*;
[ "org.apache.bcel" ]
org.apache.bcel;
2,495,036
@Deprecated public InputStream getLocalizedInputStream(InputStream stream) { String encoding = System.getProperty("file.encoding", "UTF-8"); if (!encoding.equals("UTF-8")) { throw new UnsupportedOperationException("Cannot localize " + encoding); } return stream; }
InputStream function(InputStream stream) { String encoding = System.getProperty(STR, "UTF-8"); if (!encoding.equals("UTF-8")) { throw new UnsupportedOperationException(STR + encoding); } return stream; }
/** * Returns the localized version of the specified input stream. The input * stream that is returned automatically converts all characters from the * local character set to Unicode after reading them from the underlying * stream. * * @param stream * the input stream to localize. * @return the localized input stream. * @deprecated Use {@link InputStreamReader}. */
Returns the localized version of the specified input stream. The input stream that is returned automatically converts all characters from the local character set to Unicode after reading them from the underlying stream
getLocalizedInputStream
{ "repo_name": "rex-xxx/mt6572_x201", "path": "libcore/luni/src/main/java/java/lang/Runtime.java", "license": "gpl-2.0", "size": 22173 }
[ "java.io.InputStream" ]
import java.io.InputStream;
import java.io.*;
[ "java.io" ]
java.io;
1,442,698
public static Calendar parseDividendDate(String date) { if (!Utils.isParseable(date)) { return null; } date = date.trim(); SimpleDateFormat format = new SimpleDateFormat(Utils.getDividendDateFormat(date), Locale.US); format.setTimeZone(TimeZone.getTimeZone(YahooFinance.TIMEZONE)); try { Calendar today = Calendar.getInstance(TimeZone.getTimeZone(YahooFinance.TIMEZONE)); Calendar parsedDate = Calendar.getInstance(TimeZone.getTimeZone(YahooFinance.TIMEZONE)); parsedDate.setTime(format.parse(date)); if (parsedDate.get(Calendar.YEAR) == 1970) { // Not really clear which year the dividend date is... making a reasonable guess. int monthDiff = parsedDate.get(Calendar.MONTH) - today.get(Calendar.MONTH); int year = today.get(Calendar.YEAR); if (monthDiff > 6) { year -= 1; } else if (monthDiff < -6) { year += 1; } parsedDate.set(Calendar.YEAR, year); } return parsedDate; } catch (ParseException ex) { YahooFinance.logger.log(Level.SEVERE, ex.getMessage(), ex); return null; } }
static Calendar function(String date) { if (!Utils.isParseable(date)) { return null; } date = date.trim(); SimpleDateFormat format = new SimpleDateFormat(Utils.getDividendDateFormat(date), Locale.US); format.setTimeZone(TimeZone.getTimeZone(YahooFinance.TIMEZONE)); try { Calendar today = Calendar.getInstance(TimeZone.getTimeZone(YahooFinance.TIMEZONE)); Calendar parsedDate = Calendar.getInstance(TimeZone.getTimeZone(YahooFinance.TIMEZONE)); parsedDate.setTime(format.parse(date)); if (parsedDate.get(Calendar.YEAR) == 1970) { int monthDiff = parsedDate.get(Calendar.MONTH) - today.get(Calendar.MONTH); int year = today.get(Calendar.YEAR); if (monthDiff > 6) { year -= 1; } else if (monthDiff < -6) { year += 1; } parsedDate.set(Calendar.YEAR, year); } return parsedDate; } catch (ParseException ex) { YahooFinance.logger.log(Level.SEVERE, ex.getMessage(), ex); return null; } }
/** * Used to parse the dividend dates. Returns null if the date cannot be * parsed. * * @param date String received that represents the date * @return Calendar object representing the parsed date */
Used to parse the dividend dates. Returns null if the date cannot be parsed
parseDividendDate
{ "repo_name": "moremeds/livewire-storm", "path": "src/main/java/chenxi/livewire/yahoo/Utils.java", "license": "mit", "size": 11067 }
[ "java.text.ParseException", "java.text.SimpleDateFormat", "java.util.Calendar", "java.util.Locale", "java.util.TimeZone", "java.util.logging.Level" ]
import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Locale; import java.util.TimeZone; import java.util.logging.Level;
import java.text.*; import java.util.*; import java.util.logging.*;
[ "java.text", "java.util" ]
java.text; java.util;
1,556,438
@Override public void visit(BeginForInNode n) { Value v1 = c.getState().readRegister(n.getObjectRegister()); c.getState().writeRegister(n.getObjectRegister(), v1.makeExtendedScope()); // preserve the register value v1 = UnknownValueResolver.getRealValue(v1, c.getState()); v1 = v1.restrictToNotNullNotUndef(); // ES5: "If experValue is null or undefined, return (normal, empty, empty)." Set<ObjectLabel> objs = Conversion.toObjectLabels(n, v1, c); ObjProperties p = c.getState().getProperties(objs, ObjProperties.PropertyQuery.makeQuery().onlyEnumerable().usePrototypes()); if (Options.get().isForInSpecializationEnabled()) { // 1. Find properties to iterate through Collection<Value> propertyNameValues = newList(p.getGroupedPropertyNames()); // Add the no-iteration case propertyNameValues.add(Value.makeNull().makeExtendedScope()); // 2. Make specialized context for each iteration int it = n.getPropertyListRegister(); // List<Context> specialized_contexts = newList(); BasicBlock successor = n.getBlock().getSingleSuccessor(); for (Value k : propertyNameValues) { m.visitPropertyRead(n, objs, k, c.getState(), true); if (!c.isScanning()) { // 2.1 Make specialized context State specialized_state = c.getState().clone(); specialized_state.writeRegister(it, k); Context specialized_context = c.getAnalysis().getContextSensitivityStrategy().makeForInEntryContext(c.getState().getContext(), n, k); // specialized_contexts.add(specialized_context); // 2.2 Propagate specialized context c.propagateToFunctionEntry(n, c.getState().getContext(), new CallEdge(specialized_state, null), specialized_context, successor, CallKind.ORDINARY); } } if (!c.isScanning()) { // TODO: could kill flow to specializations if covered by other context // List<Context> previousSpecializations = c.getAnalysis().getForInSpecializations(n, s.getContext()); // if (previousSpecializations != null && (p.isArray() || p.isNonArray())) { // previousSpecializations.forEach(c -> { // // covered.setToNone(); // }); // } // TODO: could kill null flow unless all iterations has reached at least one EndForInNode } c.getState().setToBottom(); } else { // fall back to simple mode without context specialization Value proplist = Value.join(p.getGroupedPropertyNames()); m.visitPropertyRead(n, objs, proplist, c.getState(), true); c.getState().writeRegister(n.getPropertyListRegister(), proplist.joinNull()); } }
void function(BeginForInNode n) { Value v1 = c.getState().readRegister(n.getObjectRegister()); c.getState().writeRegister(n.getObjectRegister(), v1.makeExtendedScope()); v1 = UnknownValueResolver.getRealValue(v1, c.getState()); v1 = v1.restrictToNotNullNotUndef(); Set<ObjectLabel> objs = Conversion.toObjectLabels(n, v1, c); ObjProperties p = c.getState().getProperties(objs, ObjProperties.PropertyQuery.makeQuery().onlyEnumerable().usePrototypes()); if (Options.get().isForInSpecializationEnabled()) { Collection<Value> propertyNameValues = newList(p.getGroupedPropertyNames()); propertyNameValues.add(Value.makeNull().makeExtendedScope()); int it = n.getPropertyListRegister(); BasicBlock successor = n.getBlock().getSingleSuccessor(); for (Value k : propertyNameValues) { m.visitPropertyRead(n, objs, k, c.getState(), true); if (!c.isScanning()) { State specialized_state = c.getState().clone(); specialized_state.writeRegister(it, k); Context specialized_context = c.getAnalysis().getContextSensitivityStrategy().makeForInEntryContext(c.getState().getContext(), n, k); c.propagateToFunctionEntry(n, c.getState().getContext(), new CallEdge(specialized_state, null), specialized_context, successor, CallKind.ORDINARY); } } if (!c.isScanning()) { } c.getState().setToBottom(); } else { Value proplist = Value.join(p.getGroupedPropertyNames()); m.visitPropertyRead(n, objs, proplist, c.getState(), true); c.getState().writeRegister(n.getPropertyListRegister(), proplist.joinNull()); } }
/** * 12.6.4 begin 'for-in' statement. */
12.6.4 begin 'for-in' statement
visit
{ "repo_name": "cs-au-dk/TAJS", "path": "src/dk/brics/tajs/analysis/js/NodeTransfer.java", "license": "apache-2.0", "size": 57579 }
[ "dk.brics.tajs.analysis.Conversion", "dk.brics.tajs.flowgraph.BasicBlock", "dk.brics.tajs.flowgraph.jsnodes.BeginForInNode", "dk.brics.tajs.lattice.CallEdge", "dk.brics.tajs.lattice.Context", "dk.brics.tajs.lattice.ObjProperties", "dk.brics.tajs.lattice.ObjectLabel", "dk.brics.tajs.lattice.State", "dk.brics.tajs.lattice.UnknownValueResolver", "dk.brics.tajs.lattice.Value", "dk.brics.tajs.options.Options", "dk.brics.tajs.solver.CallKind", "dk.brics.tajs.util.Collections", "java.util.Collection", "java.util.Set" ]
import dk.brics.tajs.analysis.Conversion; import dk.brics.tajs.flowgraph.BasicBlock; import dk.brics.tajs.flowgraph.jsnodes.BeginForInNode; import dk.brics.tajs.lattice.CallEdge; import dk.brics.tajs.lattice.Context; import dk.brics.tajs.lattice.ObjProperties; import dk.brics.tajs.lattice.ObjectLabel; import dk.brics.tajs.lattice.State; import dk.brics.tajs.lattice.UnknownValueResolver; import dk.brics.tajs.lattice.Value; import dk.brics.tajs.options.Options; import dk.brics.tajs.solver.CallKind; import dk.brics.tajs.util.Collections; import java.util.Collection; import java.util.Set;
import dk.brics.tajs.analysis.*; import dk.brics.tajs.flowgraph.*; import dk.brics.tajs.flowgraph.jsnodes.*; import dk.brics.tajs.lattice.*; import dk.brics.tajs.options.*; import dk.brics.tajs.solver.*; import dk.brics.tajs.util.*; import java.util.*;
[ "dk.brics.tajs", "java.util" ]
dk.brics.tajs; java.util;
636,498
public static Response handleIntercept(Chain chain, Tmdb tmdb) throws IOException { Request request = chain.request(); if (!Tmdb.API_HOST.equals(request.url().host())) { // do not intercept requests for other hosts // this allows the interceptor to be used on a shared okhttp client return chain.proceed(request); } AuthenticationType type = null; // add (or replace) the API key query parameter HttpUrl.Builder urlBuilder = request.url().newBuilder(); urlBuilder.setEncodedQueryParameter(Tmdb.PARAM_API_KEY, tmdb.apiKey()); if (request.url().pathSegments().get(1).equals("account") || request.url().pathSegments().get(request.url().pathSegments().size() - 1).equals("account_states")) { type = AuthenticationType.ACCOUNT; } else if (request.url().pathSegments().get(request.url().pathSegments().size() - 1).equals("rating") || !request.method().toLowerCase().equals("get")) { type = determineAuthenticationType(urlBuilder, tmdb); } addSessionToQuery(urlBuilder, type, tmdb); urlBuilder.removeAllEncodedQueryParameters("authentication"); // adds fragment identifier on the link, with the desired authentication strategy, so authenticator will know how to proceed. if (type != null) { urlBuilder.fragment(type.toString()); } Request.Builder builder = request.newBuilder(); builder.url(urlBuilder.build()); Response response = chain.proceed(builder.build()); if (!response.isSuccessful()) { String retryAfter = response.header("Retry-After"); if (retryAfter != null) { try { Integer retry = Integer.parseInt(retryAfter); Thread.sleep((int) ((retry + 0.5) * 1000)); response = chain.proceed(builder.build()); } catch (Exception exc) { } } } handleErrors(response, tmdb); return response; }
static Response function(Chain chain, Tmdb tmdb) throws IOException { Request request = chain.request(); if (!Tmdb.API_HOST.equals(request.url().host())) { return chain.proceed(request); } AuthenticationType type = null; HttpUrl.Builder urlBuilder = request.url().newBuilder(); urlBuilder.setEncodedQueryParameter(Tmdb.PARAM_API_KEY, tmdb.apiKey()); if (request.url().pathSegments().get(1).equals(STR) request.url().pathSegments().get(request.url().pathSegments().size() - 1).equals(STR)) { type = AuthenticationType.ACCOUNT; } else if (request.url().pathSegments().get(request.url().pathSegments().size() - 1).equals(STR) !request.method().toLowerCase().equals("get")) { type = determineAuthenticationType(urlBuilder, tmdb); } addSessionToQuery(urlBuilder, type, tmdb); urlBuilder.removeAllEncodedQueryParameters(STR); if (type != null) { urlBuilder.fragment(type.toString()); } Request.Builder builder = request.newBuilder(); builder.url(urlBuilder.build()); Response response = chain.proceed(builder.build()); if (!response.isSuccessful()) { String retryAfter = response.header(STR); if (retryAfter != null) { try { Integer retry = Integer.parseInt(retryAfter); Thread.sleep((int) ((retry + 0.5) * 1000)); response = chain.proceed(builder.build()); } catch (Exception exc) { } } } handleErrors(response, tmdb); return response; }
/** * If the host matches {@link Tmdb#API_HOST} adds a query parameter with the API key. */
If the host matches <code>Tmdb#API_HOST</code> adds a query parameter with the API key
handleIntercept
{ "repo_name": "ProIcons/tmdb-java", "path": "src/main/java/com/uwetrottmann/tmdb2/TmdbInterceptor.java", "license": "unlicense", "size": 6677 }
[ "com.uwetrottmann.tmdb2.enumerations.AuthenticationType", "java.io.IOException" ]
import com.uwetrottmann.tmdb2.enumerations.AuthenticationType; import java.io.IOException;
import com.uwetrottmann.tmdb2.enumerations.*; import java.io.*;
[ "com.uwetrottmann.tmdb2", "java.io" ]
com.uwetrottmann.tmdb2; java.io;
2,226,314
public static ContainerStatus createAbnormalContainerStatus( ContainerId containerId, String diagnostics) { return createAbnormalContainerStatus(containerId, ContainerExitStatus.ABORTED, diagnostics); }
static ContainerStatus function( ContainerId containerId, String diagnostics) { return createAbnormalContainerStatus(containerId, ContainerExitStatus.ABORTED, diagnostics); }
/** * Utility to create a {@link ContainerStatus} during exceptional * circumstances. * * @param containerId {@link ContainerId} of returned/released/lost container. * @param diagnostics diagnostic message * @return <code>ContainerStatus</code> for an returned/released/lost * container */
Utility to create a <code>ContainerStatus</code> during exceptional circumstances
createAbnormalContainerStatus
{ "repo_name": "messi49/hadoop", "path": "hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/SchedulerUtils.java", "license": "apache-2.0", "size": 13478 }
[ "org.apache.hadoop.yarn.api.records.ContainerExitStatus", "org.apache.hadoop.yarn.api.records.ContainerId", "org.apache.hadoop.yarn.api.records.ContainerStatus" ]
import org.apache.hadoop.yarn.api.records.ContainerExitStatus; import org.apache.hadoop.yarn.api.records.ContainerId; import org.apache.hadoop.yarn.api.records.ContainerStatus;
import org.apache.hadoop.yarn.api.records.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,461,874
private Collection<D> orFilter( Collection<D> list ) throws FilterException { Collection<D> results = new ArrayList<D>(); Collection<D> tempList; //temporary list for( IFilter<D> filter: this.filterChain ){ tempList = filter.doFilter( list ); for( D t: tempList ){ if( results.contains( t ) == false ) results.add( t ); } } return results; }
Collection<D> function( Collection<D> list ) throws FilterException { Collection<D> results = new ArrayList<D>(); Collection<D> tempList; for( IFilter<D> filter: this.filterChain ){ tempList = filter.doFilter( list ); for( D t: tempList ){ if( results.contains( t ) == false ) results.add( t ); } } return results; }
/** * Perform a logical OR on the filter chain. This means traversing all * the filters one by one adding all the elements that pass the filter * to a result set * * @param list List * @return List * @throws FilterException */
Perform a logical OR on the filter chain. This means traversing all the filters one by one adding all the elements that pass the filter to a result set
orFilter
{ "repo_name": "condast/AieonF", "path": "Workspace/org.aieonf.commons/src/org/aieonf/commons/filter/FilterChain.java", "license": "apache-2.0", "size": 5498 }
[ "java.util.ArrayList", "java.util.Collection" ]
import java.util.ArrayList; import java.util.Collection;
import java.util.*;
[ "java.util" ]
java.util;
2,543,658
public void deleteTable(byte[] tableName) throws IOException { deleteTable(TableName.valueOf(tableName)); }
void function(byte[] tableName) throws IOException { deleteTable(TableName.valueOf(tableName)); }
/** * Drop an existing table * @param tableName existing table */
Drop an existing table
deleteTable
{ "repo_name": "narendragoyal/hbase", "path": "hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtility.java", "license": "apache-2.0", "size": 144216 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
671,041
@DesignerProperty(editorType = PropertyTypeConstants.PROPERTY_TYPE_BOOLEAN, defaultValue = "False") @SimpleProperty public void ShowZoom(boolean zoom) { mapController.setZoomControlEnabled(zoom); }
@DesignerProperty(editorType = PropertyTypeConstants.PROPERTY_TYPE_BOOLEAN, defaultValue = "False") void function(boolean zoom) { mapController.setZoomControlEnabled(zoom); }
/** * Show the zoom controls on the map. * * @param zoom True if the controls should be shown, otherwise false. */
Show the zoom controls on the map
ShowZoom
{ "repo_name": "farxinu/appinventor-sources", "path": "appinventor/components/src/com/google/appinventor/components/runtime/Map.java", "license": "apache-2.0", "size": 25536 }
[ "com.google.appinventor.components.annotations.DesignerProperty", "com.google.appinventor.components.common.PropertyTypeConstants" ]
import com.google.appinventor.components.annotations.DesignerProperty; import com.google.appinventor.components.common.PropertyTypeConstants;
import com.google.appinventor.components.annotations.*; import com.google.appinventor.components.common.*;
[ "com.google.appinventor" ]
com.google.appinventor;
1,545,370
protected void checkAuthorization( ActionForm form, String methodToCall) throws AuthorizationException { String principalId = GlobalVariables.getUserSession().getPrincipalId(); Map<String, String> roleQualifier = new HashMap<String, String>(getRoleQualification(form, methodToCall)); Map<String, String> permissionDetails = KRADUtils.getNamespaceAndActionClass(this.getClass()); if (!KimApiServiceLocator.getPermissionService().isAuthorizedByTemplateName(principalId, KRADConstants.KRAD_NAMESPACE, KimConstants.PermissionTemplateNames.USE_SCREEN, permissionDetails, roleQualifier )) { throw new AuthorizationException(GlobalVariables.getUserSession().getPerson().getPrincipalName(), methodToCall, this.getClass().getSimpleName()); } }
void function( ActionForm form, String methodToCall) throws AuthorizationException { String principalId = GlobalVariables.getUserSession().getPrincipalId(); Map<String, String> roleQualifier = new HashMap<String, String>(getRoleQualification(form, methodToCall)); Map<String, String> permissionDetails = KRADUtils.getNamespaceAndActionClass(this.getClass()); if (!KimApiServiceLocator.getPermissionService().isAuthorizedByTemplateName(principalId, KRADConstants.KRAD_NAMESPACE, KimConstants.PermissionTemplateNames.USE_SCREEN, permissionDetails, roleQualifier )) { throw new AuthorizationException(GlobalVariables.getUserSession().getPerson().getPrincipalName(), methodToCall, this.getClass().getSimpleName()); } }
/** * Override this method to provide action-level access controls to the application. * * @param form * @throws AuthorizationException */
Override this method to provide action-level access controls to the application
checkAuthorization
{ "repo_name": "sbower/kuali-rice-1", "path": "kns/src/main/java/org/kuali/rice/kns/web/struts/action/KualiAction.java", "license": "apache-2.0", "size": 53121 }
[ "java.util.HashMap", "java.util.Map", "org.apache.struts.action.ActionForm", "org.kuali.rice.kim.api.KimConstants", "org.kuali.rice.kim.api.services.KimApiServiceLocator", "org.kuali.rice.krad.exception.AuthorizationException", "org.kuali.rice.krad.util.GlobalVariables", "org.kuali.rice.krad.util.KRADConstants", "org.kuali.rice.krad.util.KRADUtils" ]
import java.util.HashMap; import java.util.Map; import org.apache.struts.action.ActionForm; import org.kuali.rice.kim.api.KimConstants; import org.kuali.rice.kim.api.services.KimApiServiceLocator; import org.kuali.rice.krad.exception.AuthorizationException; import org.kuali.rice.krad.util.GlobalVariables; import org.kuali.rice.krad.util.KRADConstants; import org.kuali.rice.krad.util.KRADUtils;
import java.util.*; import org.apache.struts.action.*; import org.kuali.rice.kim.api.*; import org.kuali.rice.kim.api.services.*; import org.kuali.rice.krad.exception.*; import org.kuali.rice.krad.util.*;
[ "java.util", "org.apache.struts", "org.kuali.rice" ]
java.util; org.apache.struts; org.kuali.rice;
1,101,824
private static PsiElement backup(PsiElement leaf) { do { leaf = PsiTreeUtil.prevLeaf(leaf); } while (leaf != null && (isComment(leaf) || isWhitespace(leaf))); return leaf; }
static PsiElement function(PsiElement leaf) { do { leaf = PsiTreeUtil.prevLeaf(leaf); } while (leaf != null && (isComment(leaf) isWhitespace(leaf))); return leaf; }
/** * Starting at the given element, back up until the first non-whitespace, non-comment token is * found. Returns null if the start of the file is reached. */
Starting at the given element, back up until the first non-whitespace, non-comment token is found. Returns null if the start of the file is reached
backup
{ "repo_name": "google/intellij-protocol-buffer-editor", "path": "core/src/main/java/com/google/devtools/intellij/protoeditor/lang/psi/util/PbCommentUtil.java", "license": "apache-2.0", "size": 11969 }
[ "com.google.devtools.intellij.protoeditor.lang.psi.util.PbPsiUtil", "com.intellij.psi.PsiElement", "com.intellij.psi.util.PsiTreeUtil" ]
import com.google.devtools.intellij.protoeditor.lang.psi.util.PbPsiUtil; import com.intellij.psi.PsiElement; import com.intellij.psi.util.PsiTreeUtil;
import com.google.devtools.intellij.protoeditor.lang.psi.util.*; import com.intellij.psi.*; import com.intellij.psi.util.*;
[ "com.google.devtools", "com.intellij.psi" ]
com.google.devtools; com.intellij.psi;
2,500,117
public List<Vertex> parseSET(URL url, String name, boolean pin, String encoding, Network network) { try { String text = Utils.loadTextFile(Utils.openStream(url), encoding, MAX_FILE_SIZE); return parseSET(text, name, pin, network); } catch (IOException exception) { throw new SelfParseException("Parsing error occurred", exception); } }
List<Vertex> function(URL url, String name, boolean pin, String encoding, Network network) { try { String text = Utils.loadTextFile(Utils.openStream(url), encoding, MAX_FILE_SIZE); return parseSET(text, name, pin, network); } catch (IOException exception) { throw new SelfParseException(STR, exception); } }
/** * Get the contents of the URL to a .set file and parse it. */
Get the contents of the URL to a .set file and parse it
parseSET
{ "repo_name": "BOTlibre/BOTlibre", "path": "ai-engine/source/org/botlibre/aiml/AIMLParser.java", "license": "epl-1.0", "size": 66448 }
[ "java.io.IOException", "java.util.List", "org.botlibre.api.knowledge.Network", "org.botlibre.api.knowledge.Vertex", "org.botlibre.self.SelfParseException", "org.botlibre.util.Utils" ]
import java.io.IOException; import java.util.List; import org.botlibre.api.knowledge.Network; import org.botlibre.api.knowledge.Vertex; import org.botlibre.self.SelfParseException; import org.botlibre.util.Utils;
import java.io.*; import java.util.*; import org.botlibre.api.knowledge.*; import org.botlibre.self.*; import org.botlibre.util.*;
[ "java.io", "java.util", "org.botlibre.api", "org.botlibre.self", "org.botlibre.util" ]
java.io; java.util; org.botlibre.api; org.botlibre.self; org.botlibre.util;
2,635,447
public void displayImage(String uri, ImageView imageView, DisplayImageOptions options, ImageLoadingListener listener, ImageLoadingProgressListener progressListener) { displayImage(uri, new ImageViewAware(imageView), options, listener, progressListener); }
void function(String uri, ImageView imageView, DisplayImageOptions options, ImageLoadingListener listener, ImageLoadingProgressListener progressListener) { displayImage(uri, new ImageViewAware(imageView), options, listener, progressListener); }
/** * Adds display image task to execution pool. Image will be set to ImageView when it's turn.<br /> * <b>NOTE:</b> {@link #init(ImageLoaderConfiguration)} method must be called before this method call * * @param uri Image URI (i.e. "http://site.com/image.png", "file:///mnt/sdcard/image.png") * @param imageView {@link ImageView} which should display image * @param options {@linkplain com.nostra13.universalimageloader.core.DisplayImageOptions Options} for image * decoding and displaying. If <b>null</b> - default display image options * {@linkplain ImageLoaderConfiguration.Builder#defaultDisplayImageOptions(DisplayImageOptions) * from configuration} will be used. * @param listener {@linkplain ImageLoadingListener Listener} for image loading process. Listener fires * events on UI thread if this method is called on UI thread. * @param progressListener {@linkplain ImageLoadingProgressListener * Listener} for image loading progress. Listener fires events on UI thread if this method * is called on UI thread. Caching on disk should be enabled in * {@linkplain com.nostra13.universalimageloader.core.DisplayImageOptions options} to make * this listener work. * @throws IllegalStateException if {@link #init(ImageLoaderConfiguration)} method wasn't called before * @throws IllegalArgumentException if passed <b>imageView</b> is null */
Adds display image task to execution pool. Image will be set to ImageView when it's turn
displayImage
{ "repo_name": "nilesh14/FMC", "path": "FMC/app/src/main/java/com/nostra13/universalimageloader/core/ImageLoader.java", "license": "apache-2.0", "size": 37788 }
[ "android.widget.ImageView", "com.nostra13.universalimageloader.core.imageaware.ImageViewAware", "com.nostra13.universalimageloader.core.listener.ImageLoadingListener", "com.nostra13.universalimageloader.core.listener.ImageLoadingProgressListener" ]
import android.widget.ImageView; import com.nostra13.universalimageloader.core.imageaware.ImageViewAware; import com.nostra13.universalimageloader.core.listener.ImageLoadingListener; import com.nostra13.universalimageloader.core.listener.ImageLoadingProgressListener;
import android.widget.*; import com.nostra13.universalimageloader.core.imageaware.*; import com.nostra13.universalimageloader.core.listener.*;
[ "android.widget", "com.nostra13.universalimageloader" ]
android.widget; com.nostra13.universalimageloader;
460,065
public LexBIGServiceMetadataResource getAddressedResource() throws Exception { LexBIGServiceMetadataResource thisResource; thisResource = (LexBIGServiceMetadataResource) ResourceContext.getResourceContext().getResource(); return thisResource; }
LexBIGServiceMetadataResource function() throws Exception { LexBIGServiceMetadataResource thisResource; thisResource = (LexBIGServiceMetadataResource) ResourceContext.getResourceContext().getResource(); return thisResource; }
/** * Get the resouce that is being addressed in this current context */
Get the resouce that is being addressed in this current context
getAddressedResource
{ "repo_name": "NCIP/lexevs-grid", "path": "LexEVSAnalyiticalService/src/org/LexGrid/LexBIG/cagrid/LexEVSGridService/LexBIGServiceMetadata/service/globus/resource/LexBIGServiceMetadataResourceHome.java", "license": "bsd-3-clause", "size": 4264 }
[ "org.globus.wsrf.ResourceContext" ]
import org.globus.wsrf.ResourceContext;
import org.globus.wsrf.*;
[ "org.globus.wsrf" ]
org.globus.wsrf;
1,043,114
private final Stack attStack = new Stack(); private AttributesImpl currentAtts;
private final Stack attStack = new Stack(); private AttributesImpl currentAtts;
/** * Gets the source location of the current event. * * <p> * One can call this method from RelaxNGCC handlers to access * the line number information. Note that to */
Gets the source location of the current event. One can call this method from RelaxNGCC handlers to access the line number information. Note that to
getLocator
{ "repo_name": "FauxFaux/jdk9-jaxws", "path": "src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/gen/config/NGCCRuntime.java", "license": "gpl-2.0", "size": 18257 }
[ "java.util.Stack" ]
import java.util.Stack;
import java.util.*;
[ "java.util" ]
java.util;
732,957
@SuppressWarnings("unchecked") @Override public <T extends Entity> T createEntity(T entity, String activityId) throws SynapseException { ValidateArgument.required(entity, "entity"); entity.setConcreteType(entity.getClass().getName()); String uri = ENTITY_URI_PATH; if (activityId != null) { uri += "?" + PARAM_GENERATED_BY + "=" + activityId; } return (T) postJSONEntity(getRepoEndpoint(), uri, entity, entity.getClass()); }
@SuppressWarnings(STR) <T extends Entity> T function(T entity, String activityId) throws SynapseException { ValidateArgument.required(entity, STR); entity.setConcreteType(entity.getClass().getName()); String uri = ENTITY_URI_PATH; if (activityId != null) { uri += "?" + PARAM_GENERATED_BY + "=" + activityId; } return (T) postJSONEntity(getRepoEndpoint(), uri, entity, entity.getClass()); }
/** * Create a new Entity. * * @param <T> * @param entity * @param activityId * set generatedBy relationship to the new entity * @return the newly created entity * @throws SynapseException */
Create a new Entity
createEntity
{ "repo_name": "xschildw/Synapse-Repository-Services", "path": "client/synapseJavaClient/src/main/java/org/sagebionetworks/client/SynapseClientImpl.java", "license": "apache-2.0", "size": 223652 }
[ "org.sagebionetworks.client.exceptions.SynapseException", "org.sagebionetworks.repo.model.Entity", "org.sagebionetworks.util.ValidateArgument" ]
import org.sagebionetworks.client.exceptions.SynapseException; import org.sagebionetworks.repo.model.Entity; import org.sagebionetworks.util.ValidateArgument;
import org.sagebionetworks.client.exceptions.*; import org.sagebionetworks.repo.model.*; import org.sagebionetworks.util.*;
[ "org.sagebionetworks.client", "org.sagebionetworks.repo", "org.sagebionetworks.util" ]
org.sagebionetworks.client; org.sagebionetworks.repo; org.sagebionetworks.util;
1,581,427
public Stroke getItemOutlineStroke(int row, int column) { return lookupSeriesOutlineStroke(row); }
Stroke function(int row, int column) { return lookupSeriesOutlineStroke(row); }
/** * Returns the stroke used to outline data items. The default * implementation passes control to the * {@link #lookupSeriesOutlineStroke(int)} method. You can override this * method if you require different behaviour. * * @param row the row (or series) index (zero-based). * @param column the column (or category) index (zero-based). * * @return The stroke (never <code>null</code>). */
Returns the stroke used to outline data items. The default implementation passes control to the <code>#lookupSeriesOutlineStroke(int)</code> method. You can override this method if you require different behaviour
getItemOutlineStroke
{ "repo_name": "sternze/CurrentTopics_JFreeChart", "path": "source/org/jfree/chart/renderer/AbstractRenderer.java", "license": "lgpl-2.1", "size": 142562 }
[ "java.awt.Stroke" ]
import java.awt.Stroke;
import java.awt.*;
[ "java.awt" ]
java.awt;
1,194,940
public boolean hasAlignedTerminal(int targetIndex, HierarchicalPhrases sourcePhrases, int sourcePhraseIndex) { int phraseLength = sourcePhrases.getNumberOfTerminalSequences(); if (alignedSourceIndices[targetIndex]!=null) { for (int alignedSourceIndex : alignedSourceIndices[targetIndex]) { // for (int i=0; i<sourcePhrase.terminalSequenceStartIndices.length; i++) { for (int i=0; i<phraseLength; i++) { int sourceStart = sourcePhrases.getStartPosition(sourcePhraseIndex, i); int sourceEnd = sourcePhrases.getEndPosition(sourcePhraseIndex, i); // if (alignedSourceIndex >= sourcePhrase.terminalSequenceStartIndices[i] && if (alignedSourceIndex >= sourceStart && // alignedSourceIndex < sourcePhrase.terminalSequenceEndIndices[i]) { alignedSourceIndex < sourceEnd) { // if (logger.isLoggable(Level.FINEST)) logger.finest("Target index " + targetIndex + ", source index " + alignedSourceIndex + " is in source phrase at range ["+sourcePhrase.terminalSequenceStartIndices[i] + "-" + sourcePhrase.terminalSequenceEndIndices[i] + ")"); if (logger.isLoggable(Level.FINEST)) logger.finest("Target index " + targetIndex + ", source index " + alignedSourceIndex + " is in source phrase at range ["+sourceStart + "-" + sourceEnd + ")"); return true; } } } } if (logger.isLoggable(Level.FINEST)) logger.warning("No aligned point"); return false; } //=========================================================== // Methods //=========================================================== //=============================================================== // Protected //=============================================================== //=============================================================== // Methods //=============================================================== //=============================================================== // Private //=============================================================== //=============================================================== // Methods //===============================================================
boolean function(int targetIndex, HierarchicalPhrases sourcePhrases, int sourcePhraseIndex) { int phraseLength = sourcePhrases.getNumberOfTerminalSequences(); if (alignedSourceIndices[targetIndex]!=null) { for (int alignedSourceIndex : alignedSourceIndices[targetIndex]) { for (int i=0; i<phraseLength; i++) { int sourceStart = sourcePhrases.getStartPosition(sourcePhraseIndex, i); int sourceEnd = sourcePhrases.getEndPosition(sourcePhraseIndex, i); if (alignedSourceIndex >= sourceStart && alignedSourceIndex < sourceEnd) { if (logger.isLoggable(Level.FINEST)) logger.finest(STR + targetIndex + STR + alignedSourceIndex + STR+sourceStart + "-" + sourceEnd + ")"); return true; } } } } if (logger.isLoggable(Level.FINEST)) logger.warning(STR); return false; }
/** * Determines if any terminal in the source phrase aligns with the provided index into the target corpus. * * @param targetIndex * @param sourcePhrase * @return */
Determines if any terminal in the source phrase aligns with the provided index into the target corpus
hasAlignedTerminal
{ "repo_name": "dowobeha/joshua-multilingual", "path": "src/joshua/sarray/AlignmentArray.java", "license": "lgpl-2.1", "size": 16375 }
[ "java.util.logging.Level" ]
import java.util.logging.Level;
import java.util.logging.*;
[ "java.util" ]
java.util;
516,514
public void setSelection(ISelection selection) { editorSelection = selection; for (ISelectionChangedListener listener : selectionChangedListeners) { listener.selectionChanged(new SelectionChangedEvent(this, selection)); } setStatusLineManager(selection); }
void function(ISelection selection) { editorSelection = selection; for (ISelectionChangedListener listener : selectionChangedListeners) { listener.selectionChanged(new SelectionChangedEvent(this, selection)); } setStatusLineManager(selection); }
/** * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to set this editor's overall selection. * Calling this result will notify the listeners. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This implements <code>org.eclipse.jface.viewers.ISelectionProvider</code> to set this editor's overall selection. Calling this result will notify the listeners.
setSelection
{ "repo_name": "ujhelyiz/EMF-IncQuery-Examples", "path": "papyrus-uml/hu.bme.mit.examples.uml.trace.model.editor/src/UmlTrace/presentation/UmlTraceEditor.java", "license": "epl-1.0", "size": 66822 }
[ "org.eclipse.jface.viewers.ISelection", "org.eclipse.jface.viewers.ISelectionChangedListener", "org.eclipse.jface.viewers.SelectionChangedEvent" ]
import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.*;
[ "org.eclipse.jface" ]
org.eclipse.jface;
1,049,850
private void doUpdate() throws OntologyErrorException { // setInvalid waitForTicket(); // targetControler.setVersionInvalid(); boolean status = true; int selectedRow = versionTable.getSelectedRow(); int rowCount = versionTable.getRowCount(); if (rowCount - 1 >= selectedRow) { for (int i = rowCount - 1; i >= selectedRow; i--) { final VersionLabelID labelID = (VersionLabelID) versionTable.getModel().getValueAt(i, 0); final UpdateWork updateWork = sourceControler.getUpdateWork(labelID.id); status = targetControler.executeUpdate(updateWork, this.targetServer.getText()); if ( !status) { LOG.error(updateWork.getUpdateScript()); JOptionPane.showMessageDialog(this, "Ein Fehler ist aufgetreten bei der Aktualisierung des item : " + updateWork.getUpdateScript(), "Fehler", JOptionPane.ERROR_MESSAGE); break; } } } // setValid if the status ok // if (status) // targetControler.setVersionValid(); removeTicket(); }
void function() throws OntologyErrorException { waitForTicket(); boolean status = true; int selectedRow = versionTable.getSelectedRow(); int rowCount = versionTable.getRowCount(); if (rowCount - 1 >= selectedRow) { for (int i = rowCount - 1; i >= selectedRow; i--) { final VersionLabelID labelID = (VersionLabelID) versionTable.getModel().getValueAt(i, 0); final UpdateWork updateWork = sourceControler.getUpdateWork(labelID.id); status = targetControler.executeUpdate(updateWork, this.targetServer.getText()); if ( !status) { LOG.error(updateWork.getUpdateScript()); JOptionPane.showMessageDialog(this, STR + updateWork.getUpdateScript(), STR, JOptionPane.ERROR_MESSAGE); break; } } } removeTicket(); }
/** * do update. * * @throws OntologyErrorException if an error occurs in ontology back end */
do update
doUpdate
{ "repo_name": "prowim/prowim", "path": "prowim-tools/src/de/ebcot/prowim/tools/MigrationFrame.java", "license": "gpl-3.0", "size": 22743 }
[ "javax.swing.JOptionPane", "org.prowim.datamodel.prowim.UpdateWork", "org.prowim.jca.connector.algernon.OntologyErrorException" ]
import javax.swing.JOptionPane; import org.prowim.datamodel.prowim.UpdateWork; import org.prowim.jca.connector.algernon.OntologyErrorException;
import javax.swing.*; import org.prowim.datamodel.prowim.*; import org.prowim.jca.connector.algernon.*;
[ "javax.swing", "org.prowim.datamodel", "org.prowim.jca" ]
javax.swing; org.prowim.datamodel; org.prowim.jca;
165,875
public static void verifySignedInWithAccount(Context context, Account account) { if (account == null) return; Assert.assertEquals( account.name, ChromeSigninController.get(context).getSignedInAccountName()); }
static void function(Context context, Account account) { if (account == null) return; Assert.assertEquals( account.name, ChromeSigninController.get(context).getSignedInAccountName()); }
/** * Makes sure that sync is enabled with the correct account. */
Makes sure that sync is enabled with the correct account
verifySignedInWithAccount
{ "repo_name": "mogoweb/chromium-crosswalk", "path": "chrome/test/android/javatests/src/org/chromium/chrome/test/util/browser/sync/SyncTestUtil.java", "license": "bsd-3-clause", "size": 14849 }
[ "android.accounts.Account", "android.content.Context", "junit.framework.Assert", "org.chromium.sync.signin.ChromeSigninController" ]
import android.accounts.Account; import android.content.Context; import junit.framework.Assert; import org.chromium.sync.signin.ChromeSigninController;
import android.accounts.*; import android.content.*; import junit.framework.*; import org.chromium.sync.signin.*;
[ "android.accounts", "android.content", "junit.framework", "org.chromium.sync" ]
android.accounts; android.content; junit.framework; org.chromium.sync;
1,981,721
@Override public final DirectPosition getDirectPosition() { return this; }
final DirectPosition function() { return this; }
/** * Returns the direct position, which is itself. */
Returns the direct position, which is itself
getDirectPosition
{ "repo_name": "Geomatys/sis", "path": "core/sis-referencing-by-identifiers/src/main/java/org/apache/sis/referencing/gazetteer/SimpleLocation.java", "license": "apache-2.0", "size": 19684 }
[ "org.opengis.geometry.DirectPosition" ]
import org.opengis.geometry.DirectPosition;
import org.opengis.geometry.*;
[ "org.opengis.geometry" ]
org.opengis.geometry;
1,663,920
protected static String getPropertyAsString(final GoraAttribute attr, final Map<String, ?> propertiesMap) { return String.valueOf(getProperty(attr, propertiesMap)); }
static String function(final GoraAttribute attr, final Map<String, ?> propertiesMap) { return String.valueOf(getProperty(attr, propertiesMap)); }
/** * Utility method to extract value of a map as String * * @param attr * @param propertiesMap * @return */
Utility method to extract value of a map as String
getPropertyAsString
{ "repo_name": "logzio/camel", "path": "components/camel-gora/src/main/java/org/apache/camel/component/gora/utils/GoraUtils.java", "license": "apache-2.0", "size": 11450 }
[ "java.util.Map", "org.apache.camel.component.gora.GoraAttribute" ]
import java.util.Map; import org.apache.camel.component.gora.GoraAttribute;
import java.util.*; import org.apache.camel.component.gora.*;
[ "java.util", "org.apache.camel" ]
java.util; org.apache.camel;
224,879
void invokeAceCallback(JavaScriptObject obj);
void invokeAceCallback(JavaScriptObject obj);
/** * Callback method. * * @param obj the event object: for example, an onChange event if this callback is receiving onChange events */
Callback method
invokeAceCallback
{ "repo_name": "apruden/opal", "path": "opal-gwt-client/src/main/java/org/obiba/opal/web/gwt/ace/client/AceEditorCallback.java", "license": "gpl-3.0", "size": 788 }
[ "com.google.gwt.core.client.JavaScriptObject" ]
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.*;
[ "com.google.gwt" ]
com.google.gwt;
1,419,850
public synchronized void stop() { stop = true; if (ss!=null) { try { ss.close(); } catch (IOException e) { e.printStackTrace(); } } }
synchronized void function() { stop = true; if (ss!=null) { try { ss.close(); } catch (IOException e) { e.printStackTrace(); } } }
/** * Stop redirecting the connection */
Stop redirecting the connection
stop
{ "repo_name": "cdegroot/river", "path": "qa/src/com/sun/jini/test/spec/jeri/mux/util/Redirector.java", "license": "apache-2.0", "size": 6849 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,676,272
public void replace(Player p, int slot, ItemStack item) { try { ItemStack last = p.getInventory().getItem(slot); p.getInventory().setItem(slot, item); if (last.equals(item)) return; p.getInventory().addItem(last); } catch (NullPointerException ignore) { p.getInventory().setItem(slot, item); } }
void function(Player p, int slot, ItemStack item) { try { ItemStack last = p.getInventory().getItem(slot); p.getInventory().setItem(slot, item); if (last.equals(item)) return; p.getInventory().addItem(last); } catch (NullPointerException ignore) { p.getInventory().setItem(slot, item); } }
/** * Replace the item in the Player's hand with * @param p Player whose inventory to manipulate. * @param slot Slot to put the item in. * @param item Item to replace. */
Replace the item in the Player's hand with
replace
{ "repo_name": "xBlazeTECH/xBlazeCore", "path": "src/net/xblaze/xBlazeCore/api/util/InventoryManager.java", "license": "mit", "size": 1115 }
[ "org.bukkit.entity.Player", "org.bukkit.inventory.ItemStack" ]
import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack;
import org.bukkit.entity.*; import org.bukkit.inventory.*;
[ "org.bukkit.entity", "org.bukkit.inventory" ]
org.bukkit.entity; org.bukkit.inventory;
210,474
@SuppressWarnings("unchecked") @PublicEvolving public static <IN1, IN2, OUT> TypeInformation<OUT> getBinaryOperatorReturnType( Function function, Class<?> baseClass, int inputTypeArgumentIndex, int outputTypeArgumentIndex, TypeInformation<IN1> in1Type, TypeInformation<IN2> in2Type, String functionName, boolean allowMissing) { try { final LambdaExecutable exec; try { exec = checkAndExtractLambda(function); } catch (TypeExtractionException e) { throw new InvalidTypesException("Internal error occurred.", e); } if (exec != null) { // check for lambda type erasure validateLambdaGenericParameters(exec); // parameters must be accessed from behind, since JVM can add additional parameters e.g. when using local variables inside lambda function final int paramLen = exec.getParameterTypes().length - 1; final Type input1 = (outputTypeArgumentIndex >= 0) ? exec.getParameterTypes()[paramLen - 2] : exec.getParameterTypes()[paramLen - 1]; final Type input2 = (outputTypeArgumentIndex >= 0 ) ? exec.getParameterTypes()[paramLen - 1] : exec.getParameterTypes()[paramLen]; validateInputType((inputTypeArgumentIndex >= 0) ? extractTypeArgument(input1, inputTypeArgumentIndex) : input1, in1Type); validateInputType((inputTypeArgumentIndex >= 0) ? extractTypeArgument(input2, inputTypeArgumentIndex) : input2, in2Type); if(function instanceof ResultTypeQueryable) { return ((ResultTypeQueryable<OUT>) function).getProducedType(); } return new TypeExtractor().privateCreateTypeInfo( (outputTypeArgumentIndex >= 0) ? extractTypeArgument(exec.getParameterTypes()[paramLen], outputTypeArgumentIndex) : exec.getReturnType(), in1Type, in2Type); } else { validateInputType(baseClass, function.getClass(), 0, in1Type); validateInputType(baseClass, function.getClass(), 1, in2Type); if(function instanceof ResultTypeQueryable) { return ((ResultTypeQueryable<OUT>) function).getProducedType(); } return new TypeExtractor().privateCreateTypeInfo(baseClass, function.getClass(), 2, in1Type, in2Type); } } catch (InvalidTypesException e) { if (allowMissing) { return (TypeInformation<OUT>) new MissingTypeInfo(functionName != null ? functionName : function.toString(), e); } else { throw e; } } } // -------------------------------------------------------------------------------------------- // Create type information // --------------------------------------------------------------------------------------------
@SuppressWarnings(STR) static <IN1, IN2, OUT> TypeInformation<OUT> function( Function function, Class<?> baseClass, int inputTypeArgumentIndex, int outputTypeArgumentIndex, TypeInformation<IN1> in1Type, TypeInformation<IN2> in2Type, String functionName, boolean allowMissing) { try { final LambdaExecutable exec; try { exec = checkAndExtractLambda(function); } catch (TypeExtractionException e) { throw new InvalidTypesException(STR, e); } if (exec != null) { validateLambdaGenericParameters(exec); final int paramLen = exec.getParameterTypes().length - 1; final Type input1 = (outputTypeArgumentIndex >= 0) ? exec.getParameterTypes()[paramLen - 2] : exec.getParameterTypes()[paramLen - 1]; final Type input2 = (outputTypeArgumentIndex >= 0 ) ? exec.getParameterTypes()[paramLen - 1] : exec.getParameterTypes()[paramLen]; validateInputType((inputTypeArgumentIndex >= 0) ? extractTypeArgument(input1, inputTypeArgumentIndex) : input1, in1Type); validateInputType((inputTypeArgumentIndex >= 0) ? extractTypeArgument(input2, inputTypeArgumentIndex) : input2, in2Type); if(function instanceof ResultTypeQueryable) { return ((ResultTypeQueryable<OUT>) function).getProducedType(); } return new TypeExtractor().privateCreateTypeInfo( (outputTypeArgumentIndex >= 0) ? extractTypeArgument(exec.getParameterTypes()[paramLen], outputTypeArgumentIndex) : exec.getReturnType(), in1Type, in2Type); } else { validateInputType(baseClass, function.getClass(), 0, in1Type); validateInputType(baseClass, function.getClass(), 1, in2Type); if(function instanceof ResultTypeQueryable) { return ((ResultTypeQueryable<OUT>) function).getProducedType(); } return new TypeExtractor().privateCreateTypeInfo(baseClass, function.getClass(), 2, in1Type, in2Type); } } catch (InvalidTypesException e) { if (allowMissing) { return (TypeInformation<OUT>) new MissingTypeInfo(functionName != null ? functionName : function.toString(), e); } else { throw e; } } }
/** * Returns the binary operator's return type. * * @param function Function to extract the return type from * @param baseClass Base class of the function * @param inputTypeArgumentIndex Index of the type argument of function's first parameter * specifying the input type if it is wrapped (Iterable, Map, * etc.). Otherwise -1. * @param outputTypeArgumentIndex Index of the type argument of functions second parameter * specifying the output type if it is wrapped in a Collector. * Otherwise -1. * @param in1Type Type of the left side input elements (In case of an iterable, it is the element type) * @param in2Type Type of the right side input elements (In case of an iterable, it is the element type) * @param functionName Function name * @param allowMissing Can the type information be missing * @param <IN1> Left side input type * @param <IN2> Right side input type * @param <OUT> Output type * @return TypeInformation of the return type of the function */
Returns the binary operator's return type
getBinaryOperatorReturnType
{ "repo_name": "Xpray/flink", "path": "flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractor.java", "license": "apache-2.0", "size": 81770 }
[ "java.lang.reflect.Type", "org.apache.flink.api.common.functions.Function", "org.apache.flink.api.common.functions.InvalidTypesException", "org.apache.flink.api.common.typeinfo.TypeInformation", "org.apache.flink.api.java.typeutils.TypeExtractionUtils" ]
import java.lang.reflect.Type; import org.apache.flink.api.common.functions.Function; import org.apache.flink.api.common.functions.InvalidTypesException; import org.apache.flink.api.common.typeinfo.TypeInformation; import org.apache.flink.api.java.typeutils.TypeExtractionUtils;
import java.lang.reflect.*; import org.apache.flink.api.common.functions.*; import org.apache.flink.api.common.typeinfo.*; import org.apache.flink.api.java.typeutils.*;
[ "java.lang", "org.apache.flink" ]
java.lang; org.apache.flink;
2,691,485
public static void validatePlateBigDecimal(PlateBigDecimal plate1, PlateBigDecimal plate2) { Preconditions.checkNotNull(plate1, "Plates cannot be null."); Preconditions.checkNotNull(plate2, "Plates cannot be null."); Preconditions.checkArgument(plate1.rows() == plate2.rows() || plate1.columns() == plate2.columns(), "Unequal plate dimensions."); }
static void function(PlateBigDecimal plate1, PlateBigDecimal plate2) { Preconditions.checkNotNull(plate1, STR); Preconditions.checkNotNull(plate2, STR); Preconditions.checkArgument(plate1.rows() == plate2.rows() plate1.columns() == plate2.columns(), STR); }
/** * Validates the plate by checking for null values and invalid dimensions. * @param PlateBigDecimal the first plate * @param PlateBigDecimal the second plate */
Validates the plate by checking for null values and invalid dimensions
validatePlateBigDecimal
{ "repo_name": "jessemull/MicroFlex", "path": "src/main/java/com/github/jessemull/microflex/util/ValUtil.java", "license": "apache-2.0", "size": 22431 }
[ "com.github.jessemull.microflex.bigdecimalflex.plate.PlateBigDecimal", "com.google.common.base.Preconditions" ]
import com.github.jessemull.microflex.bigdecimalflex.plate.PlateBigDecimal; import com.google.common.base.Preconditions;
import com.github.jessemull.microflex.bigdecimalflex.plate.*; import com.google.common.base.*;
[ "com.github.jessemull", "com.google.common" ]
com.github.jessemull; com.google.common;
500,992
private void updateSessionViews(final String youtubeUrl, final String title, final String sessionAbstract, final String hashTag, final String captionsUrl) { if (youtubeUrl == null) { // Get out, nothing to do here finish(); return; } mCaptionsUrl = captionsUrl; String youtubeVideoId = getVideoIdFromUrl(youtubeUrl); // Play the video playVideo(youtubeVideoId); if (mTrackPlay) { AnalyticsManager.sendScreenView("Live Streaming: " + title); LOGD("Tracker", "Live Streaming: " + title); }
void function(final String youtubeUrl, final String title, final String sessionAbstract, final String hashTag, final String captionsUrl) { if (youtubeUrl == null) { finish(); return; } mCaptionsUrl = captionsUrl; String youtubeVideoId = getVideoIdFromUrl(youtubeUrl); playVideo(youtubeVideoId); if (mTrackPlay) { AnalyticsManager.sendScreenView(STR + title); LOGD(STR, STR + title); }
/** * Updates views that rely on session data from explicit strings. */
Updates views that rely on session data from explicit strings
updateSessionViews
{ "repo_name": "ramonrabello/devfestnorte-app", "path": "android/src/main/java/br/com/devfest/norte/ui/SessionLivestreamActivity.java", "license": "apache-2.0", "size": 40778 }
[ "br.com.devfest.norte.util.AnalyticsManager" ]
import br.com.devfest.norte.util.AnalyticsManager;
import br.com.devfest.norte.util.*;
[ "br.com.devfest" ]
br.com.devfest;
262,669
@Generated("This method was generated using jOOQ-tools") static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Seq<Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>> crossJoin(Iterable<T1> i1, Iterable<T2> i2, Iterable<T3> i3, Iterable<T4> i4, Iterable<T5> i5, Iterable<T6> i6, Iterable<T7> i7, Iterable<T8> i8, Iterable<T9> i9, Iterable<T10> i10, Iterable<T11> i11, Iterable<T12> i12, Iterable<T13> i13, Iterable<T14> i14) { return crossJoin(seq(i1), seq(i2), seq(i3), seq(i4), seq(i5), seq(i6), seq(i7), seq(i8), seq(i9), seq(i10), seq(i11), seq(i12), seq(i13), seq(i14)); }
@Generated(STR) static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Seq<Tuple14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>> crossJoin(Iterable<T1> i1, Iterable<T2> i2, Iterable<T3> i3, Iterable<T4> i4, Iterable<T5> i5, Iterable<T6> i6, Iterable<T7> i7, Iterable<T8> i8, Iterable<T9> i9, Iterable<T10> i10, Iterable<T11> i11, Iterable<T12> i12, Iterable<T13> i13, Iterable<T14> i14) { return crossJoin(seq(i1), seq(i2), seq(i3), seq(i4), seq(i5), seq(i6), seq(i7), seq(i8), seq(i9), seq(i10), seq(i11), seq(i12), seq(i13), seq(i14)); }
/** * Cross join 14 streams into one. * <p> * <code><pre> * // (tuple(1, "a"), tuple(1, "b"), tuple(2, "a"), tuple(2, "b")) * Seq.of(1, 2).crossJoin(Seq.of("a", "b")) * </pre></code> */
Cross join 14 streams into one. <code><code> (tuple(1, "a"), tuple(1, "b"), tuple(2, "a"), tuple(2, "b")) Seq.of(1, 2).crossJoin(Seq.of("a", "b")) </code></code>
crossJoin
{ "repo_name": "stephenh/jOOL", "path": "src/main/java/org/jooq/lambda/Seq.java", "license": "apache-2.0", "size": 198501 }
[ "javax.annotation.Generated", "org.jooq.lambda.tuple.Tuple14" ]
import javax.annotation.Generated; import org.jooq.lambda.tuple.Tuple14;
import javax.annotation.*; import org.jooq.lambda.tuple.*;
[ "javax.annotation", "org.jooq.lambda" ]
javax.annotation; org.jooq.lambda;
424,301
public void testInnerClassExtracted() { List<AbstractTypeDeclaration> types = translateClassBody("class Foo { }"); assertEquals(2, types.size()); assertEquals("Test", types.get(0).getName().getIdentifier()); assertEquals("Foo", types.get(1).getName().getIdentifier()); }
void function() { List<AbstractTypeDeclaration> types = translateClassBody(STR); assertEquals(2, types.size()); assertEquals("Test", types.get(0).getName().getIdentifier()); assertEquals("Foo", types.get(1).getName().getIdentifier()); }
/** * Verify that an inner class is moved to the compilation unit's types list. */
Verify that an inner class is moved to the compilation unit's types list
testInnerClassExtracted
{ "repo_name": "groschovskiy/j2objc", "path": "translator/src/test/java/com/google/devtools/j2objc/translate/InnerClassExtractorTest.java", "license": "apache-2.0", "size": 35574 }
[ "com.google.devtools.j2objc.ast.AbstractTypeDeclaration", "java.util.List" ]
import com.google.devtools.j2objc.ast.AbstractTypeDeclaration; import java.util.List;
import com.google.devtools.j2objc.ast.*; import java.util.*;
[ "com.google.devtools", "java.util" ]
com.google.devtools; java.util;
265,654
public T ognl(String text) { return expression(new OgnlExpression(text)); }
T function(String text) { return expression(new OgnlExpression(text)); }
/** * Evaluates an <a href="http://camel.apache.org/ognl.html">OGNL * expression</a> * * @param text the expression to be evaluated * @return the builder to continue processing the DSL */
Evaluates an OGNL expression
ognl
{ "repo_name": "cexbrayat/camel", "path": "camel-core/src/main/java/org/apache/camel/builder/ExpressionClauseSupport.java", "license": "apache-2.0", "size": 23576 }
[ "org.apache.camel.model.language.OgnlExpression" ]
import org.apache.camel.model.language.OgnlExpression;
import org.apache.camel.model.language.*;
[ "org.apache.camel" ]
org.apache.camel;
2,146,675
public void setRevocationReason(boolean isCritical, byte reason, String description) { list.add(new RevocationReason(isCritical, reason, description)); }
void function(boolean isCritical, byte reason, String description) { list.add(new RevocationReason(isCritical, reason, description)); }
/** * Sets revocation reason sub packet */
Sets revocation reason sub packet
setRevocationReason
{ "repo_name": "xdv/ripple-lib-java", "path": "ripple-bouncycastle/src/main/java/org/ripple/bouncycastle/openpgp/PGPSignatureSubpacketGenerator.java", "license": "isc", "size": 6322 }
[ "org.ripple.bouncycastle.bcpg.sig.RevocationReason" ]
import org.ripple.bouncycastle.bcpg.sig.RevocationReason;
import org.ripple.bouncycastle.bcpg.sig.*;
[ "org.ripple.bouncycastle" ]
org.ripple.bouncycastle;
1,746,023
public static byte[] hash(String text) { try { MessageDigest md = MessageDigest.getInstance("SHA-256"); md.update(text.getBytes("UTF-8")); return md.digest(); } catch (Exception e) { throw new RuntimeException("Unable to compute hash while signing request: " + e.getMessage(), e); } }
static byte[] function(String text) { try { MessageDigest md = MessageDigest.getInstance(STR); md.update(text.getBytes("UTF-8")); return md.digest(); } catch (Exception e) { throw new RuntimeException(STR + e.getMessage(), e); } }
/** * Hashes the string contents (assumed to be UTF-8) using the SHA-256 * algorithm. */
Hashes the string contents (assumed to be UTF-8) using the SHA-256 algorithm
hash
{ "repo_name": "TarantulaTechnology/JGroups", "path": "src/org/jgroups/protocols/aws/v4/requests/AWS4Signer.java", "license": "apache-2.0", "size": 28877 }
[ "java.security.MessageDigest" ]
import java.security.MessageDigest;
import java.security.*;
[ "java.security" ]
java.security;
108,018
IRawGrammar lookup(String scopeName);
IRawGrammar lookup(String scopeName);
/** * Lookup a raw grammar. */
Lookup a raw grammar
lookup
{ "repo_name": "ControlSystemStudio/org.csstudio.iter", "path": "plugins/org.brainwy.liclipsetext.editor/src/org/eclipse/tm4e/core/grammar/IGrammarRepository.java", "license": "epl-1.0", "size": 1219 }
[ "org.eclipse.tm4e.core.internal.types.IRawGrammar" ]
import org.eclipse.tm4e.core.internal.types.IRawGrammar;
import org.eclipse.tm4e.core.internal.types.*;
[ "org.eclipse.tm4e" ]
org.eclipse.tm4e;
1,038,257
public void bindInteger(Property<Integer, ? extends Object> prop, TextArea ta) { bind(prop, ta); }
void function(Property<Integer, ? extends Object> prop, TextArea ta) { bind(prop, ta); }
/** * Changes to the text area are automatically reflected to the given property and visa versa * @param prop the property value * @param ta the text area * @deprecated this code was experimental we will use the more generic Adapter/bind framework */
Changes to the text area are automatically reflected to the given property and visa versa
bindInteger
{ "repo_name": "shannah/CodenameOne", "path": "CodenameOne/src/com/codename1/properties/UiBinding.java", "license": "gpl-2.0", "size": 29304 }
[ "com.codename1.ui.TextArea" ]
import com.codename1.ui.TextArea;
import com.codename1.ui.*;
[ "com.codename1.ui" ]
com.codename1.ui;
2,874,001
public CrawlPath getCurrentCrawlPath() { CrawlPath path = this.crawlPath.get(); if (path == null) { return new CrawlPath(); } return path; }
CrawlPath function() { CrawlPath path = this.crawlPath.get(); if (path == null) { return new CrawlPath(); } return path; }
/** * Get the current crawl path. * * @return the current current crawl path. */
Get the current crawl path
getCurrentCrawlPath
{ "repo_name": "saltlab/crawljax-graphdb", "path": "core/src/main/java/com/crawljax/core/CrawlSession.java", "license": "apache-2.0", "size": 6013 }
[ "com.crawljax.core.state.CrawlPath" ]
import com.crawljax.core.state.CrawlPath;
import com.crawljax.core.state.*;
[ "com.crawljax.core" ]
com.crawljax.core;
2,641,511
private static List<XMLNode> toXMLNodes(RootDoc root) { List<XMLNode> nodes = new ArrayList<XMLNode>(); // Iterate over the classes for (ClassDoc doc : root.classes()) { if (options.filter(doc)) { nodes.add(toClassNode(doc)); } } // Iterate over packages if (!options.hasFilter()) { for (PackageDoc doc : root.specifiedPackages()) { nodes.add(toPackageNode(doc)); } } return nodes; }
static List<XMLNode> function(RootDoc root) { List<XMLNode> nodes = new ArrayList<XMLNode>(); for (ClassDoc doc : root.classes()) { if (options.filter(doc)) { nodes.add(toClassNode(doc)); } } if (!options.hasFilter()) { for (PackageDoc doc : root.specifiedPackages()) { nodes.add(toPackageNode(doc)); } } return nodes; }
/** * Returns the XML nodes for all the selected classes in the specified RootDoc. * * @param root The RootDoc from which the XML should be built. * @return The list of XML nodes which represents the RootDoc. */
Returns the XML nodes for all the selected classes in the specified RootDoc
toXMLNodes
{ "repo_name": "pageseeder/xmldoclet", "path": "src/main/java/org/pageseeder/xmldoclet/XMLDoclet.java", "license": "apache-2.0", "size": 26477 }
[ "com.sun.javadoc.ClassDoc", "com.sun.javadoc.PackageDoc", "com.sun.javadoc.RootDoc", "java.util.ArrayList", "java.util.List" ]
import com.sun.javadoc.ClassDoc; import com.sun.javadoc.PackageDoc; import com.sun.javadoc.RootDoc; import java.util.ArrayList; import java.util.List;
import com.sun.javadoc.*; import java.util.*;
[ "com.sun.javadoc", "java.util" ]
com.sun.javadoc; java.util;
10,322
public void updateWithConferenceForm(ConferenceForm conferenceForm) { this.name = conferenceForm.getName(); this.description = conferenceForm.getDescription(); List<String> topics = conferenceForm.getTopics(); this.topics = topics == null || topics.isEmpty() ? DEFAULT_TOPICS : topics; this.city = conferenceForm.getCity() == null ? DEFAULT_CITY : conferenceForm.getCity(); Date startDate = conferenceForm.getStartDate(); this.startDate = startDate == null ? null : new Date(startDate.getTime()); Date endDate = conferenceForm.getEndDate(); this.endDate = endDate == null ? null : new Date(endDate.getTime()); if (this.startDate != null) { // Getting the starting month for a composite query. Calendar calendar = Calendar.getInstance(); calendar.setTime(this.startDate); // Calendar.MONTH is zero based, so adding 1. this.month = calendar.get(calendar.MONTH) + 1; } // Check maxAttendees value against the number of already allocated seats. int seatsAllocated = maxAttendees - seatsAvailable; if (conferenceForm.getMaxAttendees() < seatsAllocated) { throw new IllegalArgumentException(seatsAllocated + " seats are already allocated, " + "but you tried to set maxAttendees to " + conferenceForm.getMaxAttendees()); } // The initial number of seatsAvailable is the same as maxAttendees. // However, if there are already some seats allocated, we should subtract that numbers. this.maxAttendees = conferenceForm.getMaxAttendees(); this.seatsAvailable = this.maxAttendees - seatsAllocated; }
void function(ConferenceForm conferenceForm) { this.name = conferenceForm.getName(); this.description = conferenceForm.getDescription(); List<String> topics = conferenceForm.getTopics(); this.topics = topics == null topics.isEmpty() ? DEFAULT_TOPICS : topics; this.city = conferenceForm.getCity() == null ? DEFAULT_CITY : conferenceForm.getCity(); Date startDate = conferenceForm.getStartDate(); this.startDate = startDate == null ? null : new Date(startDate.getTime()); Date endDate = conferenceForm.getEndDate(); this.endDate = endDate == null ? null : new Date(endDate.getTime()); if (this.startDate != null) { Calendar calendar = Calendar.getInstance(); calendar.setTime(this.startDate); this.month = calendar.get(calendar.MONTH) + 1; } int seatsAllocated = maxAttendees - seatsAvailable; if (conferenceForm.getMaxAttendees() < seatsAllocated) { throw new IllegalArgumentException(seatsAllocated + STR + STR + conferenceForm.getMaxAttendees()); } this.maxAttendees = conferenceForm.getMaxAttendees(); this.seatsAvailable = this.maxAttendees - seatsAllocated; }
/** * Updates the Conference with ConferenceForm. * This method is used upon object creation as well as updating existing Conferences. * * @param conferenceForm contains form data sent from the client. */
Updates the Conference with ConferenceForm. This method is used upon object creation as well as updating existing Conferences
updateWithConferenceForm
{ "repo_name": "Ollichka/conf", "path": "src/main/java/com/google/devrel/training/conference/domain/Conference.java", "license": "apache-2.0", "size": 8566 }
[ "com.google.devrel.training.conference.form.ConferenceForm", "java.util.Calendar", "java.util.Date", "java.util.List" ]
import com.google.devrel.training.conference.form.ConferenceForm; import java.util.Calendar; import java.util.Date; import java.util.List;
import com.google.devrel.training.conference.form.*; import java.util.*;
[ "com.google.devrel", "java.util" ]
com.google.devrel; java.util;
1,812,612
public ODEServer getODEServer() { return _odeServer; }
ODEServer function() { return _odeServer; }
/** * Returns the ODEServer instance which has been created by the servlet. * Must be called after init() has been called by the servlet engine or null * will be returned. * * @return the ODEServer instance being used by the servlet or null if * init() has not yet been called by the servlet engine */
Returns the ODEServer instance which has been created by the servlet. Must be called after init() has been called by the servlet engine or null will be returned
getODEServer
{ "repo_name": "TheRingbearer/HAWKS", "path": "ode/axis2/src/main/java/org/apache/ode/axis2/hooks/ODEAxisServlet.java", "license": "apache-2.0", "size": 2840 }
[ "org.apache.ode.axis2.ODEServer" ]
import org.apache.ode.axis2.ODEServer;
import org.apache.ode.axis2.*;
[ "org.apache.ode" ]
org.apache.ode;
535,494
@NotNull @Nls(capitalization = Nls.Capitalization.Sentence) String getFamilyName();
@Nls(capitalization = Nls.Capitalization.Sentence) String getFamilyName();
/** * Returns the name of the family of intentions. It is used to externalize * "auto-show" state of intentions. When user clicks on a lightbulb in intention list, * all intentions with the same family name get enabled/disabled. * The name is also shown in settings tree. * * @return the intention family name. * @see IntentionManager#registerIntentionAndMetaData(IntentionAction, String...) */
Returns the name of the family of intentions. It is used to externalize "auto-show" state of intentions. When user clicks on a lightbulb in intention list, all intentions with the same family name get enabled/disabled. The name is also shown in settings tree
getFamilyName
{ "repo_name": "youdonghai/intellij-community", "path": "platform/analysis-api/src/com/intellij/codeInsight/intention/IntentionAction.java", "license": "apache-2.0", "size": 3969 }
[ "org.jetbrains.annotations.Nls" ]
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.*;
[ "org.jetbrains.annotations" ]
org.jetbrains.annotations;
709,368
static String getSQLWhere(TypeFilter typeFilter) { if (typeFilter.isSelected() == false) { return "0"; } else if (typeFilter.getEventType() instanceof RootEventType) { if (typeFilter.getSubFilters().stream() .allMatch(subFilter -> subFilter.isSelected() && subFilter.getSubFilters().stream().allMatch(Filter::isSelected))) { return "1"; //then collapse clause to true } } return "(sub_type IN (" + StringUtils.join(getActiveSubTypes(typeFilter), ",") + "))"; }
static String getSQLWhere(TypeFilter typeFilter) { if (typeFilter.isSelected() == false) { return "0"; } else if (typeFilter.getEventType() instanceof RootEventType) { if (typeFilter.getSubFilters().stream() .allMatch(subFilter -> subFilter.isSelected() && subFilter.getSubFilters().stream().allMatch(Filter::isSelected))) { return "1"; } } return STR + StringUtils.join(getActiveSubTypes(typeFilter), ",") + "))"; }
/** * generate a sql where clause for the given type filter, while trying to be * as simple as possible to improve performance. * * @param typeFilter * * @return */
generate a sql where clause for the given type filter, while trying to be as simple as possible to improve performance
getSQLWhere
{ "repo_name": "maxrp/autopsy", "path": "Core/src/org/sleuthkit/autopsy/timeline/events/db/SQLHelper.java", "license": "apache-2.0", "size": 6646 }
[ "org.apache.commons.lang3.StringUtils", "org.sleuthkit.autopsy.timeline.events.type.RootEventType", "org.sleuthkit.autopsy.timeline.filters.Filter", "org.sleuthkit.autopsy.timeline.filters.TypeFilter" ]
import org.apache.commons.lang3.StringUtils; import org.sleuthkit.autopsy.timeline.events.type.RootEventType; import org.sleuthkit.autopsy.timeline.filters.Filter; import org.sleuthkit.autopsy.timeline.filters.TypeFilter;
import org.apache.commons.lang3.*; import org.sleuthkit.autopsy.timeline.events.type.*; import org.sleuthkit.autopsy.timeline.filters.*;
[ "org.apache.commons", "org.sleuthkit.autopsy" ]
org.apache.commons; org.sleuthkit.autopsy;
657,344
StreamDefinitionResource createStream(String name, String definition, String description, boolean deploy);
StreamDefinitionResource createStream(String name, String definition, String description, boolean deploy);
/** * Create a new stream, optionally deploying it. * * @param name the name of the stream * @param definition the stream definition DSL * @param description the description of the stream * @param deploy whether to deploy the stream after creating its definition * @return the new stream definition */
Create a new stream, optionally deploying it
createStream
{ "repo_name": "trisberg/spring-cloud-dataflow", "path": "spring-cloud-dataflow-rest-client/src/main/java/org/springframework/cloud/dataflow/rest/client/StreamOperations.java", "license": "apache-2.0", "size": 5705 }
[ "org.springframework.cloud.dataflow.rest.resource.StreamDefinitionResource" ]
import org.springframework.cloud.dataflow.rest.resource.StreamDefinitionResource;
import org.springframework.cloud.dataflow.rest.resource.*;
[ "org.springframework.cloud" ]
org.springframework.cloud;
2,408,216
@SmallTest public void testAddStylesheetToTransitionCalled() throws Throwable { TestWebServer webServer = TestWebServer.start(); try { final String url2 = webServer.setResponse(URL_2, URL_2_DATA, null); ContentShellActivity activity = launchContentShellWithUrl(url2); waitForActiveShellToBeDoneLoading(); ContentViewCore contentViewCore = activity.getActiveContentViewCore(); TestCallbackHelperContainer testCallbackHelperContainer = new TestCallbackHelperContainer(contentViewCore); contentViewCore.getWebContents().setHasPendingNavigationTransitionForTesting(); TestNavigationTransitionDelegate delegate = new TestNavigationTransitionDelegate(contentViewCore, true); contentViewCore.getWebContents().setNavigationTransitionDelegate(delegate); int currentCallCount = testCallbackHelperContainer .getOnPageFinishedHelper().getCallCount(); String[] headers = { "link", "<transition0.css>;rel=transition-entering-stylesheet;scope=*", "link", "<transition1.css>;rel=transition-entering-stylesheet;scope=*", "link", "<transition2.css>;rel=transition-entering-stylesheet;scope=*" }; final String url3 = webServer.setResponse(URL_3, URL_3_DATA, createHeadersList(headers)); LoadUrlParams url3_params = new LoadUrlParams(url3); loadUrl(contentViewCore, testCallbackHelperContainer, url3_params); testCallbackHelperContainer.getOnPageFinishedHelper().waitForCallback( currentCallCount, 1, 10000, TimeUnit.MILLISECONDS); assertTrue("addStylesheetToTransition called.", delegate.getDidCallAddStylesheet()); assertTrue("Three stylesheets are added", delegate.getTransitionStylesheets().size() == 3); } finally { webServer.shutdown(); } }
void function() throws Throwable { TestWebServer webServer = TestWebServer.start(); try { final String url2 = webServer.setResponse(URL_2, URL_2_DATA, null); ContentShellActivity activity = launchContentShellWithUrl(url2); waitForActiveShellToBeDoneLoading(); ContentViewCore contentViewCore = activity.getActiveContentViewCore(); TestCallbackHelperContainer testCallbackHelperContainer = new TestCallbackHelperContainer(contentViewCore); contentViewCore.getWebContents().setHasPendingNavigationTransitionForTesting(); TestNavigationTransitionDelegate delegate = new TestNavigationTransitionDelegate(contentViewCore, true); contentViewCore.getWebContents().setNavigationTransitionDelegate(delegate); int currentCallCount = testCallbackHelperContainer .getOnPageFinishedHelper().getCallCount(); String[] headers = { "link", STR, "link", STR, "link", STR }; final String url3 = webServer.setResponse(URL_3, URL_3_DATA, createHeadersList(headers)); LoadUrlParams url3_params = new LoadUrlParams(url3); loadUrl(contentViewCore, testCallbackHelperContainer, url3_params); testCallbackHelperContainer.getOnPageFinishedHelper().waitForCallback( currentCallCount, 1, 10000, TimeUnit.MILLISECONDS); assertTrue(STR, delegate.getDidCallAddStylesheet()); assertTrue(STR, delegate.getTransitionStylesheets().size() == 3); } finally { webServer.shutdown(); } }
/** * Tests that the listener receives addStylesheetToTransition if we specify * that there are entering transition stylesheet. */
Tests that the listener receives addStylesheetToTransition if we specify that there are entering transition stylesheet
testAddStylesheetToTransitionCalled
{ "repo_name": "hgl888/chromium-crosswalk-efl", "path": "content/public/android/javatests/src/org/chromium/content/browser/TransitionTest.java", "license": "bsd-3-clause", "size": 13207 }
[ "java.util.concurrent.TimeUnit", "org.chromium.content.browser.test.util.TestCallbackHelperContainer", "org.chromium.content_public.browser.LoadUrlParams", "org.chromium.content_shell_apk.ContentShellActivity", "org.chromium.net.test.util.TestWebServer" ]
import java.util.concurrent.TimeUnit; import org.chromium.content.browser.test.util.TestCallbackHelperContainer; import org.chromium.content_public.browser.LoadUrlParams; import org.chromium.content_shell_apk.ContentShellActivity; import org.chromium.net.test.util.TestWebServer;
import java.util.concurrent.*; import org.chromium.content.browser.test.util.*; import org.chromium.content_public.browser.*; import org.chromium.content_shell_apk.*; import org.chromium.net.test.util.*;
[ "java.util", "org.chromium.content", "org.chromium.content_public", "org.chromium.content_shell_apk", "org.chromium.net" ]
java.util; org.chromium.content; org.chromium.content_public; org.chromium.content_shell_apk; org.chromium.net;
676,806
private static void deleteRow(ScannerOpts scanOpts, Text row) throws AccumuloException, AccumuloSecurityException, TableNotFoundException { deleteRow(getRow(scanOpts, row)); }
static void function(ScannerOpts scanOpts, Text row) throws AccumuloException, AccumuloSecurityException, TableNotFoundException { deleteRow(getRow(scanOpts, row)); }
/** * Deletes a row given a text object * * @param opts * * @param row * @throws TableNotFoundException * @throws AccumuloSecurityException * @throws AccumuloException */
Deletes a row given a text object
deleteRow
{ "repo_name": "joshelser/accumulo", "path": "examples/simple/src/main/java/org/apache/accumulo/examples/simple/client/RowOperations.java", "license": "apache-2.0", "size": 8416 }
[ "org.apache.accumulo.core.cli.ScannerOpts", "org.apache.accumulo.core.client.AccumuloException", "org.apache.accumulo.core.client.AccumuloSecurityException", "org.apache.accumulo.core.client.TableNotFoundException", "org.apache.hadoop.io.Text" ]
import org.apache.accumulo.core.cli.ScannerOpts; import org.apache.accumulo.core.client.AccumuloException; import org.apache.accumulo.core.client.AccumuloSecurityException; import org.apache.accumulo.core.client.TableNotFoundException; import org.apache.hadoop.io.Text;
import org.apache.accumulo.core.cli.*; import org.apache.accumulo.core.client.*; import org.apache.hadoop.io.*;
[ "org.apache.accumulo", "org.apache.hadoop" ]
org.apache.accumulo; org.apache.hadoop;
528,130
public Path getSourceFile() { return this.sourceFile; }
Path function() { return this.sourceFile; }
/** * The java source file containing the matches. * * @return The java source file. */
The java source file containing the matches
getSourceFile
{ "repo_name": "skuzzle/restrict-imports-enforcer-rule", "path": "src/main/java/de/skuzzle/enforcer/restrictimports/analyze/MatchedFile.java", "license": "mit", "size": 4249 }
[ "java.nio.file.Path" ]
import java.nio.file.Path;
import java.nio.file.*;
[ "java.nio" ]
java.nio;
59,346
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); this.minorTickMarkStroke = SerialUtilities.readStroke(stream); this.minorTickMarkPaint = SerialUtilities.readPaint(stream); }
void function(ObjectInputStream stream) throws IOException, ClassNotFoundException { stream.defaultReadObject(); this.minorTickMarkStroke = SerialUtilities.readStroke(stream); this.minorTickMarkPaint = SerialUtilities.readPaint(stream); }
/** * Provides serialization support. * * @param stream the input stream. * * @throws IOException if there is an I/O error. * @throws ClassNotFoundException if there is a classpath problem. */
Provides serialization support
readObject
{ "repo_name": "integrated/jfreechart", "path": "source/org/jfree/chart/axis/PeriodAxis.java", "license": "lgpl-2.1", "size": 44043 }
[ "java.io.IOException", "java.io.ObjectInputStream", "org.jfree.io.SerialUtilities" ]
import java.io.IOException; import java.io.ObjectInputStream; import org.jfree.io.SerialUtilities;
import java.io.*; import org.jfree.io.*;
[ "java.io", "org.jfree.io" ]
java.io; org.jfree.io;
2,532,643
ImmutableTerm subTerm = terms.get(0); return subTerm.inferType() .filter(i -> i.getTermType() .filter(t -> t.isA(xsdStringDatatype)) .isPresent()); }
ImmutableTerm subTerm = terms.get(0); return subTerm.inferType() .filter(i -> i.getTermType() .filter(t -> t.isA(xsdStringDatatype)) .isPresent()); }
/** * If the child type is xsd:string or a language tag, then returns it. * */
If the child type is xsd:string or a language tag, then returns it
inferType
{ "repo_name": "ontop/ontop", "path": "core/model/src/main/java/it/unibz/inf/ontop/model/term/functionsymbol/impl/AbstractUnaryStringSPARQLFunctionSymbol.java", "license": "apache-2.0", "size": 1748 }
[ "it.unibz.inf.ontop.model.term.ImmutableTerm" ]
import it.unibz.inf.ontop.model.term.ImmutableTerm;
import it.unibz.inf.ontop.model.term.*;
[ "it.unibz.inf" ]
it.unibz.inf;
2,573,323
public static @NonNull ProfileName asGiven(@Nullable String givenName) { return fromParts(givenName, null); }
static @NonNull ProfileName function(@Nullable String givenName) { return fromParts(givenName, null); }
/** * Creates a profile name that only contains a given name. */
Creates a profile name that only contains a given name
asGiven
{ "repo_name": "cascheberg/Signal-Android", "path": "app/src/main/java/org/thoughtcrime/securesms/profiles/ProfileName.java", "license": "gpl-3.0", "size": 5199 }
[ "androidx.annotation.NonNull", "androidx.annotation.Nullable" ]
import androidx.annotation.NonNull; import androidx.annotation.Nullable;
import androidx.annotation.*;
[ "androidx.annotation" ]
androidx.annotation;
1,073,588
// build a single pattern so only parse once. StringBuilder patterns = new StringBuilder(); for (String s : logHadoopIdPatterns) { patterns.append(s).append("|"); } patterns.deleteCharAt(patterns.length() - 1); Pattern hadoopJobIdPattern = Pattern.compile(patterns.toString()); Matcher matcher = hadoopJobIdPattern.matcher(log); Set<String> listMatches = new HashSet<>(); while (matcher.find()) { for (int i = 1; i <= logHadoopIdPatterns.size(); i++) { if (matcher.group(i) != null) { listMatches.add(matcher.group(i)); } } } return listMatches; }
StringBuilder patterns = new StringBuilder(); for (String s : logHadoopIdPatterns) { patterns.append(s).append(" "); } patterns.deleteCharAt(patterns.length() - 1); Pattern hadoopJobIdPattern = Pattern.compile(patterns.toString()); Matcher matcher = hadoopJobIdPattern.matcher(log); Set<String> listMatches = new HashSet<>(); while (matcher.find()) { for (int i = 1; i <= logHadoopIdPatterns.size(); i++) { if (matcher.group(i) != null) { listMatches.add(matcher.group(i)); } } } return listMatches; }
/** * Parse the hadoop job id from the log. * @param log * @return A list of hadoop job id */
Parse the hadoop job id from the log
getHadoopJobIdFromLog
{ "repo_name": "SunZhaonan/WhereHows-1", "path": "metadata-etl/src/main/java/metadata/etl/lineage/AzLogParser.java", "license": "apache-2.0", "size": 7471 }
[ "java.util.HashSet", "java.util.Set", "java.util.regex.Matcher", "java.util.regex.Pattern" ]
import java.util.HashSet; import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern;
import java.util.*; import java.util.regex.*;
[ "java.util" ]
java.util;
65,933
@Test public void testIteratorNonEmptyStoreNext() throws Exception { this.store = new FakeStore(this.getTestStoreEntries()); final InternalCache<String, String> ehcache = this.getEhcache(); final Iterator<Cache.Entry<String, String>> iterator = ehcache.iterator(); assertThat(iterator.next(), is(notNullValue())); }
void function() throws Exception { this.store = new FakeStore(this.getTestStoreEntries()); final InternalCache<String, String> ehcache = this.getEhcache(); final Iterator<Cache.Entry<String, String>> iterator = ehcache.iterator(); assertThat(iterator.next(), is(notNullValue())); }
/** * Tests {@link java.util.Iterator#next()} from {@link Ehcache#iterator()} on a non-empty cache. */
Tests <code>java.util.Iterator#next()</code> from <code>Ehcache#iterator()</code> on a non-empty cache
testIteratorNonEmptyStoreNext
{ "repo_name": "anthonydahanne/ehcache3", "path": "core/src/test/java/org/ehcache/core/EhcacheBasicIteratorTest.java", "license": "apache-2.0", "size": 10531 }
[ "java.util.Iterator", "org.ehcache.Cache", "org.hamcrest.Matchers", "org.junit.Assert" ]
import java.util.Iterator; import org.ehcache.Cache; import org.hamcrest.Matchers; import org.junit.Assert;
import java.util.*; import org.ehcache.*; import org.hamcrest.*; import org.junit.*;
[ "java.util", "org.ehcache", "org.hamcrest", "org.junit" ]
java.util; org.ehcache; org.hamcrest; org.junit;
2,528,406