method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public void addPropertyChangeListener(PropertyChangeListener listener) { support.addPropertyChangeListener(listener); }
void function(PropertyChangeListener listener) { support.addPropertyChangeListener(listener); }
/** * Adds a PropertyChangeListener to the listener list. The listener will be * notified about changes in this object. * * @param listener */
Adds a PropertyChangeListener to the listener list. The listener will be notified about changes in this object
addPropertyChangeListener
{ "repo_name": "iCarto/siga", "path": "_fwAndami/src/com/iver/andami/ui/mdiManager/WindowInfo.java", "license": "gpl-3.0", "size": 33500 }
[ "java.beans.PropertyChangeListener" ]
import java.beans.PropertyChangeListener;
import java.beans.*;
[ "java.beans" ]
java.beans;
109,829
@Override public final void windowClosing(WindowEvent e) { run(); } @Override public final void windowClosed(WindowEvent e) {}
final void function(WindowEvent e) { run(); } public final void windowClosed(WindowEvent e) {}
/** * This method is defined in java.awt.event.WindowListener; (this implementation * calls this.run()) */
This method is defined in java.awt.event.WindowListener; (this implementation calls this.run())
windowClosing
{ "repo_name": "AlloyTools/org.alloytools.alloy", "path": "org.alloytools.alloy.core/src/main/java/edu/mit/csail/sdg/alloy4/Runner.java", "license": "apache-2.0", "size": 5733 }
[ "java.awt.event.WindowEvent" ]
import java.awt.event.WindowEvent;
import java.awt.event.*;
[ "java.awt" ]
java.awt;
398,797
ScheduledBlockUpdate addScheduledUpdate(int x, int y, int z, int priority, int ticks);
ScheduledBlockUpdate addScheduledUpdate(int x, int y, int z, int priority, int ticks);
/** * Adds a new {@link ScheduledBlockUpdate} to this block. * * @param x The X position * @param y The Y position * @param z The Z position * @param priority The priority of the scheduled update * @param ticks The ticks until the scheduled update should be processed * @return The newly created scheduled update */
Adds a new <code>ScheduledBlockUpdate</code> to this block
addScheduledUpdate
{ "repo_name": "SpongeHistory/SpongeAPI-History", "path": "src/main/java/org/spongepowered/api/world/extent/Extent.java", "license": "mit", "size": 18726 }
[ "org.spongepowered.api.block.ScheduledBlockUpdate" ]
import org.spongepowered.api.block.ScheduledBlockUpdate;
import org.spongepowered.api.block.*;
[ "org.spongepowered.api" ]
org.spongepowered.api;
2,542,870
public static Map calcularRangosAlgoritimicosBackType(double media, double desviacion) { Map<String, Double> rangosAlgoritimicos = new HashMap<>(); rangosAlgoritimicos.put(MUY_PEQUENIO, Math.exp(media - (2 * desviacion))); rangosAlgoritimicos.put(PEQUENIO, Math.exp(media - desviacion)); rangosAlgoritimicos.put(MEDIANO, Math.exp(media)); rangosAlgoritimicos.put(GRANDE, Math.exp(media + desviacion)); rangosAlgoritimicos.put(MUY_GRANDE, Math.exp(media + (2 * desviacion))); return rangosAlgoritimicos; }
static Map function(double media, double desviacion) { Map<String, Double> rangosAlgoritimicos = new HashMap<>(); rangosAlgoritimicos.put(MUY_PEQUENIO, Math.exp(media - (2 * desviacion))); rangosAlgoritimicos.put(PEQUENIO, Math.exp(media - desviacion)); rangosAlgoritimicos.put(MEDIANO, Math.exp(media)); rangosAlgoritimicos.put(GRANDE, Math.exp(media + desviacion)); rangosAlgoritimicos.put(MUY_GRANDE, Math.exp(media + (2 * desviacion))); return rangosAlgoritimicos; }
/** * Metodo: Retorna un Mapa con los valores de rangos algorimicos con los * valores a presentar * * @param media valor de la media * @param desviacion valor de la desviacion estandart * @return Map ocn los valores para presentar de la tarea 04 */
Metodo: Retorna un Mapa con los valores de rangos algorimicos con los valores a presentar
calcularRangosAlgoritimicosBackType
{ "repo_name": "limavi/tallerPSP6", "path": "src/main/java/Estadistica.java", "license": "mit", "size": 19543 }
[ "java.util.HashMap", "java.util.Map" ]
import java.util.HashMap; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
1,242,419
public String extractConstraintName(SQLException sqle) { String constraintName = null; int errorCode = JdbcExceptionHelper.extractErrorCode( sqle ); if ( errorCode == -8 ) { constraintName = extractUsingTemplate( "Integrity constraint violation ", " table:", sqle.getMessage() ); } else if ( errorCode == -9 ) { constraintName = extractUsingTemplate( "Violation of unique index: ", " in statement [", sqle.getMessage() ); } else if ( errorCode == -104 ) { constraintName = extractUsingTemplate( "Unique constraint violation: ", " in statement [", sqle.getMessage() ); } else if ( errorCode == -177 ) { constraintName = extractUsingTemplate( "Integrity constraint violation - no parent ", " table:", sqle.getMessage() ); } return constraintName; } }; private static ViolatedConstraintNameExtracter EXTRACTER_20 = new TemplatedViolatedConstraintNameExtracter() {
String function(SQLException sqle) { String constraintName = null; int errorCode = JdbcExceptionHelper.extractErrorCode( sqle ); if ( errorCode == -8 ) { constraintName = extractUsingTemplate( STR, STR, sqle.getMessage() ); } else if ( errorCode == -9 ) { constraintName = extractUsingTemplate( STR, STR, sqle.getMessage() ); } else if ( errorCode == -104 ) { constraintName = extractUsingTemplate( STR, STR, sqle.getMessage() ); } else if ( errorCode == -177 ) { constraintName = extractUsingTemplate( STR, STR, sqle.getMessage() ); } return constraintName; } }; private static ViolatedConstraintNameExtracter EXTRACTER_20 = new TemplatedViolatedConstraintNameExtracter() {
/** * Extract the name of the violated constraint from the given SQLException. * * @param sqle The exception that was the result of the constraint violation. * @return The extracted constraint name. */
Extract the name of the violated constraint from the given SQLException
extractConstraintName
{ "repo_name": "HerrB92/obp", "path": "OpenBeaconPackage/libraries/hibernate-release-4.2.7.SP1/project/hibernate-core/src/main/java/org/hibernate/dialect/HSQLDialect.java", "license": "mit", "size": 24748 }
[ "java.sql.SQLException", "org.hibernate.exception.spi.TemplatedViolatedConstraintNameExtracter", "org.hibernate.exception.spi.ViolatedConstraintNameExtracter", "org.hibernate.internal.util.JdbcExceptionHelper" ]
import java.sql.SQLException; import org.hibernate.exception.spi.TemplatedViolatedConstraintNameExtracter; import org.hibernate.exception.spi.ViolatedConstraintNameExtracter; import org.hibernate.internal.util.JdbcExceptionHelper;
import java.sql.*; import org.hibernate.exception.spi.*; import org.hibernate.internal.util.*;
[ "java.sql", "org.hibernate.exception", "org.hibernate.internal" ]
java.sql; org.hibernate.exception; org.hibernate.internal;
2,531,374
protected Credential getCredentialFromContext(final RequestContext context) { return WebUtils.getCredential(context); }
Credential function(final RequestContext context) { return WebUtils.getCredential(context); }
/** * Gets credential from context. * * @param context the context * @return the credential from context */
Gets credential from context
getCredentialFromContext
{ "repo_name": "leleuj/cas", "path": "core/cas-server-core-webflow-api/src/main/java/org/apereo/cas/web/flow/resolver/impl/AbstractCasWebflowEventResolver.java", "license": "apache-2.0", "size": 7026 }
[ "org.apereo.cas.authentication.Credential", "org.apereo.cas.web.support.WebUtils", "org.springframework.webflow.execution.RequestContext" ]
import org.apereo.cas.authentication.Credential; import org.apereo.cas.web.support.WebUtils; import org.springframework.webflow.execution.RequestContext;
import org.apereo.cas.authentication.*; import org.apereo.cas.web.support.*; import org.springframework.webflow.execution.*;
[ "org.apereo.cas", "org.springframework.webflow" ]
org.apereo.cas; org.springframework.webflow;
2,067,051
public void setDueDate(Date dueDate) { this.dueDate = dueDate; }
void function(Date dueDate) { this.dueDate = dueDate; }
/** * Set the dueDate from a Date object * @param dueDate The new dueDate */
Set the dueDate from a Date object
setDueDate
{ "repo_name": "suddani/plan-it", "path": "src/com/sudi/plan/it/models/Task.java", "license": "mit", "size": 7579 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
2,056,445
public int getNumberOfOutputParameters() { if (numberOfOutputValues == -1) { COSArray rangeValues = getRangeValues(); numberOfOutputValues = rangeValues.size() / 2; } return numberOfOutputValues; }
int function() { if (numberOfOutputValues == -1) { COSArray rangeValues = getRangeValues(); numberOfOutputValues = rangeValues.size() / 2; } return numberOfOutputValues; }
/** * This will get the number of output parameters that * have a range specified. A range for output parameters * is optional so this may return zero for a function * that does have output parameters, this will simply return the * number that have the range specified. * * @return The number of output parameters that have a range * specified. */
This will get the number of output parameters that have a range specified. A range for output parameters is optional so this may return zero for a function that does have output parameters, this will simply return the number that have the range specified
getNumberOfOutputParameters
{ "repo_name": "TomRoush/PdfBox-Android", "path": "library/src/main/java/com/tom_roush/pdfbox/pdmodel/common/function/PDFunction.java", "license": "apache-2.0", "size": 11088 }
[ "com.tom_roush.pdfbox.cos.COSArray" ]
import com.tom_roush.pdfbox.cos.COSArray;
import com.tom_roush.pdfbox.cos.*;
[ "com.tom_roush.pdfbox" ]
com.tom_roush.pdfbox;
343,573
public void updateDirtyMultiChunksNewDatabaseId(long newDatabaseVersionId) { try (PreparedStatement preparedStatement = getStatement("multichunk.update.dirty.updateDirtyMultiChunksNewDatabaseId.sql")) { preparedStatement.setLong(1, newDatabaseVersionId); preparedStatement.executeUpdate(); } catch (SQLException e) { throw new RuntimeException(e); } }
void function(long newDatabaseVersionId) { try (PreparedStatement preparedStatement = getStatement(STR)) { preparedStatement.setLong(1, newDatabaseVersionId); preparedStatement.executeUpdate(); } catch (SQLException e) { throw new RuntimeException(e); } }
/** * no commit */
no commit
updateDirtyMultiChunksNewDatabaseId
{ "repo_name": "syncany/syncany-plugin-dropbox", "path": "core/syncany-lib/src/main/java/org/syncany/database/dao/MultiChunkSqlDao.java", "license": "gpl-3.0", "size": 11974 }
[ "java.sql.PreparedStatement", "java.sql.SQLException" ]
import java.sql.PreparedStatement; import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
132,100
public Value evalAssignRef(Env env, Value value) { Value obj = _objExpr.eval(env); Value result = obj.setCharValueAt(_indexExpr.evalLong(env), value); _objExpr.evalAssignValue(env, result); return value; }
Value function(Env env, Value value) { Value obj = _objExpr.eval(env); Value result = obj.setCharValueAt(_indexExpr.evalLong(env), value); _objExpr.evalAssignValue(env, result); return value; }
/** * Evaluates the expression as an assignment. * * @param env the calling environment. * * @return the expression value. */
Evaluates the expression as an assignment
evalAssignRef
{ "repo_name": "dlitz/resin", "path": "modules/quercus/src/com/caucho/quercus/expr/BinaryCharAtExpr.java", "license": "gpl-2.0", "size": 3190 }
[ "com.caucho.quercus.env.Env", "com.caucho.quercus.env.Value" ]
import com.caucho.quercus.env.Env; import com.caucho.quercus.env.Value;
import com.caucho.quercus.env.*;
[ "com.caucho.quercus" ]
com.caucho.quercus;
768,336
public void backupSeen(Channel ch) throws Exception { log.debug("OSPFInterfaceChannelHandler::backupSeen "); if (((OspfInterfaceImpl) ospfInterface).state() == OspfInterfaceState.WAITING) { electRouter(ch); } }
void function(Channel ch) throws Exception { log.debug(STR); if (((OspfInterfaceImpl) ospfInterface).state() == OspfInterfaceState.WAITING) { electRouter(ch); } }
/** * Gets called when a BDR was detected before the wait timer expired. * * @param ch channel instance * @throws Exception might throws exception */
Gets called when a BDR was detected before the wait timer expired
backupSeen
{ "repo_name": "Phaneendra-Huawei/demo", "path": "protocols/ospf/ctl/src/main/java/org/onosproject/ospf/controller/impl/OspfInterfaceChannelHandler.java", "license": "apache-2.0", "size": 64749 }
[ "org.jboss.netty.channel.Channel", "org.onosproject.ospf.controller.area.OspfInterfaceImpl", "org.onosproject.ospf.protocol.util.OspfInterfaceState" ]
import org.jboss.netty.channel.Channel; import org.onosproject.ospf.controller.area.OspfInterfaceImpl; import org.onosproject.ospf.protocol.util.OspfInterfaceState;
import org.jboss.netty.channel.*; import org.onosproject.ospf.controller.area.*; import org.onosproject.ospf.protocol.util.*;
[ "org.jboss.netty", "org.onosproject.ospf" ]
org.jboss.netty; org.onosproject.ospf;
1,589,779
public void onOptionsMenuClosed(android.view.Menu menu) { } /** * Called when a context menu for the {@code view} is about to be shown. * Unlike {@link #onCreateOptionsMenu}, this will be called every * time the context menu is about to be shown and should be populated for * the view (or item inside the view for {@link AdapterView} subclasses, * this can be found in the {@code menuInfo})). * <p> * Use {@link #onContextItemSelected(android.view.MenuItem)} to know when an * item has been selected. * <p> * The default implementation calls up to * {@link Activity#onCreateContextMenu Activity.onCreateContextMenu}, though * you can not call this implementation if you don't want that behavior. * <p> * It is not safe to hold onto the context menu after this method returns. * {@inheritDoc}
void function(android.view.Menu menu) { } /** * Called when a context menu for the {@code view} is about to be shown. * Unlike {@link #onCreateOptionsMenu}, this will be called every * time the context menu is about to be shown and should be populated for * the view (or item inside the view for {@link AdapterView} subclasses, * this can be found in the {@code menuInfo})). * <p> * Use {@link #onContextItemSelected(android.view.MenuItem)} to know when an * item has been selected. * <p> * The default implementation calls up to * {@link Activity#onCreateContextMenu Activity.onCreateContextMenu}, though * you can not call this implementation if you don't want that behavior. * <p> * It is not safe to hold onto the context menu after this method returns. * {@inheritDoc}
/** * This hook is called whenever the options menu is being closed (either by the user canceling * the menu with the back/menu button, or when an item is selected). * * @param menu The options menu as last shown or first initialized by * onCreateOptionsMenu(). */
This hook is called whenever the options menu is being closed (either by the user canceling the menu with the back/menu button, or when an item is selected)
onOptionsMenuClosed
{ "repo_name": "luciofm/ActionBarSherlock", "path": "library/src/android/support/v4/app/Fragment.java", "license": "apache-2.0", "size": 49167 }
[ "android.support.v4.view.Menu", "android.support.v4.view.MenuItem" ]
import android.support.v4.view.Menu; import android.support.v4.view.MenuItem;
import android.support.v4.view.*;
[ "android.support" ]
android.support;
440,427
public static ImmutableOvernightOvernightSwapConvention.Builder builder() { return new ImmutableOvernightOvernightSwapConvention.Builder(); } private ImmutableOvernightOvernightSwapConvention( String name, OvernightRateSwapLegConvention overnightLeg1, OvernightRateSwapLegConvention overnightLeg2, DaysAdjustment spotDateOffset) { JodaBeanUtils.notNull(name, "name"); JodaBeanUtils.notNull(overnightLeg1, "overnightLeg1"); JodaBeanUtils.notNull(overnightLeg2, "overnightLeg2"); JodaBeanUtils.notNull(spotDateOffset, "spotDateOffset"); this.name = name; this.overnightLeg1 = overnightLeg1; this.overnightLeg2 = overnightLeg2; this.spotDateOffset = spotDateOffset; validate(); }
static ImmutableOvernightOvernightSwapConvention.Builder function() { return new ImmutableOvernightOvernightSwapConvention.Builder(); } private ImmutableOvernightOvernightSwapConvention( String name, OvernightRateSwapLegConvention overnightLeg1, OvernightRateSwapLegConvention overnightLeg2, DaysAdjustment spotDateOffset) { JodaBeanUtils.notNull(name, "name"); JodaBeanUtils.notNull(overnightLeg1, STR); JodaBeanUtils.notNull(overnightLeg2, STR); JodaBeanUtils.notNull(spotDateOffset, STR); this.name = name; this.overnightLeg1 = overnightLeg1; this.overnightLeg2 = overnightLeg2; this.spotDateOffset = spotDateOffset; validate(); }
/** * Returns a builder used to create an instance of the bean. * @return the builder, not null */
Returns a builder used to create an instance of the bean
builder
{ "repo_name": "marc-henrard/RisQ-ir-models", "path": "src/main/java/marc/henrard/murisq/product/swap/type/ImmutableOvernightOvernightSwapConvention.java", "license": "apache-2.0", "size": 18935 }
[ "com.opengamma.strata.basics.date.DaysAdjustment", "com.opengamma.strata.product.swap.type.OvernightRateSwapLegConvention", "org.joda.beans.JodaBeanUtils" ]
import com.opengamma.strata.basics.date.DaysAdjustment; import com.opengamma.strata.product.swap.type.OvernightRateSwapLegConvention; import org.joda.beans.JodaBeanUtils;
import com.opengamma.strata.basics.date.*; import com.opengamma.strata.product.swap.type.*; import org.joda.beans.*;
[ "com.opengamma.strata", "org.joda.beans" ]
com.opengamma.strata; org.joda.beans;
537,868
protected final void fireVetoableChange(String propertyName, Object oldValue, Object newValue) throws PropertyVetoException { VetoableChangeSupport aVetoSupport = this.vetoSupport; if (aVetoSupport == null) { return; } aVetoSupport.fireVetoableChange(propertyName, oldValue, newValue); }
final void function(String propertyName, Object oldValue, Object newValue) throws PropertyVetoException { VetoableChangeSupport aVetoSupport = this.vetoSupport; if (aVetoSupport == null) { return; } aVetoSupport.fireVetoableChange(propertyName, oldValue, newValue); }
/** * Support for reporting changes for constrained Object properties. This method can be called * before a constrained property will be changed and it will send the appropriate * PropertyChangeEvent to any registered VetoableChangeListeners. * * @param propertyName the property whose value has changed * @param oldValue the property's previous value * @param newValue the property's new value * @throws PropertyVetoException if a constrained property change is rejected */
Support for reporting changes for constrained Object properties. This method can be called before a constrained property will be changed and it will send the appropriate PropertyChangeEvent to any registered VetoableChangeListeners
fireVetoableChange
{ "repo_name": "LGoodDatePicker/LGoodDatePicker", "path": "Project/src/main/java/com/privatejgoodies/common/bean/Bean.java", "license": "mit", "size": 28580 }
[ "java.beans.PropertyVetoException", "java.beans.VetoableChangeSupport" ]
import java.beans.PropertyVetoException; import java.beans.VetoableChangeSupport;
import java.beans.*;
[ "java.beans" ]
java.beans;
135,294
public void setCampaignName(String value) { this.getIdentifier().setCampaignName(value); } public BulkAdGroupNegativeSite() { super(new BulkAdGroupNegativeSitesIdentifier()); }
void function(String value) { this.getIdentifier().setCampaignName(value); } public BulkAdGroupNegativeSite() { super(new BulkAdGroupNegativeSitesIdentifier()); }
/** * Sets the name of the ad group that the negative site is assigned. * * <p> * Corresponds to the 'Ad Group' field in the bulk file. * </p> */
Sets the name of the ad group that the negative site is assigned. Corresponds to the 'Ad Group' field in the bulk file.
setCampaignName
{ "repo_name": "bing-ads-sdk/BingAds-Java-SDK", "path": "src/main/java/com/microsoft/bingads/v12/bulk/entities/BulkAdGroupNegativeSite.java", "license": "mit", "size": 3540 }
[ "com.microsoft.bingads.v12.internal.bulk.entities.BulkAdGroupNegativeSitesIdentifier" ]
import com.microsoft.bingads.v12.internal.bulk.entities.BulkAdGroupNegativeSitesIdentifier;
import com.microsoft.bingads.v12.internal.bulk.entities.*;
[ "com.microsoft.bingads" ]
com.microsoft.bingads;
147,754
public void write(OutputStream oOut, String sCodec) throws NullPointerException,IOException,InstantiationException,InterruptedException { if (null==oImg) { throw new NullPointerException("java.awt.Image is null"); } ImageEncoder oEnc = ImageCodec.createImageEncoder(sCodec, oOut, null); if (null==oEnc) { throw new InstantiationException("ImageCodec.createImageEncoder("+sCodec+")"); } if (USE_JAI==iImagingLibrary) { RenderedImage oRImg = javax.media.jai.JAI.create("awtimage", oImg); if (null==oEnc) { throw new InstantiationException("JAI.create(awtimage, "+oImg.getClass().getName()+")"); } oEnc.encode(oRImg); } else { int iImageWidth = oImg.getWidth(null); int iImageHeight = oImg.getHeight(null); if (null==mediaTracker) { Frame awtFrame = null; try { awtFrame = new Frame(); } catch (Exception e) { throw new InstantiationException("Cannot instantiate java.awt.Frame " + (e.getMessage()!=null ? e.getMessage() : "")); } mediaTracker = new MediaTracker(awtFrame); } // fi (mediaTracker) mediaTracker.addImage(oImg, 0); mediaTracker.waitForID(0); BufferedImage oBImg = new BufferedImage(iImageWidth, iImageHeight, BufferedImage.TYPE_INT_RGB); Graphics2D graphics2D = oBImg.createGraphics(); graphics2D.drawImage(oImg, 0, 0, iImageWidth, iImageHeight, null); graphics2D.dispose(); oEnc.encode(oBImg); mediaTracker.removeImage(oImg,0); } } // ----------------------------------------------------------
void function(OutputStream oOut, String sCodec) throws NullPointerException,IOException,InstantiationException,InterruptedException { if (null==oImg) { throw new NullPointerException(STR); } ImageEncoder oEnc = ImageCodec.createImageEncoder(sCodec, oOut, null); if (null==oEnc) { throw new InstantiationException(STR+sCodec+")"); } if (USE_JAI==iImagingLibrary) { RenderedImage oRImg = javax.media.jai.JAI.create(STR, oImg); if (null==oEnc) { throw new InstantiationException(STR+oImg.getClass().getName()+")"); } oEnc.encode(oRImg); } else { int iImageWidth = oImg.getWidth(null); int iImageHeight = oImg.getHeight(null); if (null==mediaTracker) { Frame awtFrame = null; try { awtFrame = new Frame(); } catch (Exception e) { throw new InstantiationException(STR + (e.getMessage()!=null ? e.getMessage() : "")); } mediaTracker = new MediaTracker(awtFrame); } mediaTracker.addImage(oImg, 0); mediaTracker.waitForID(0); BufferedImage oBImg = new BufferedImage(iImageWidth, iImageHeight, BufferedImage.TYPE_INT_RGB); Graphics2D graphics2D = oBImg.createGraphics(); graphics2D.drawImage(oImg, 0, 0, iImageWidth, iImageHeight, null); graphics2D.dispose(); oEnc.encode(oBImg); mediaTracker.removeImage(oImg,0); } }
/** * <p>Encode Image and write it to an OutputStream</p> * @param oOut OutputStream * @throws NullPointerException If underlying java.awt.Image object is <b>null</b> * @throws IOException * @throws InstantiationException * @throws InterruptedException */
Encode Image and write it to an OutputStream
write
{ "repo_name": "sergiomt/zesped", "path": "src/java/com/zesped/util/Picture.java", "license": "agpl-3.0", "size": 17281 }
[ "com.sun.media.jai.codec.ImageCodec", "com.sun.media.jai.codec.ImageEncoder", "java.awt.Frame", "java.awt.Graphics2D", "java.awt.MediaTracker", "java.awt.image.BufferedImage", "java.awt.image.RenderedImage", "java.io.IOException", "java.io.OutputStream", "javax.media.jai.JAI" ]
import com.sun.media.jai.codec.ImageCodec; import com.sun.media.jai.codec.ImageEncoder; import java.awt.Frame; import java.awt.Graphics2D; import java.awt.MediaTracker; import java.awt.image.BufferedImage; import java.awt.image.RenderedImage; import java.io.IOException; import java.io.OutputStream; import javax.media.jai.JAI;
import com.sun.media.jai.codec.*; import java.awt.*; import java.awt.image.*; import java.io.*; import javax.media.jai.*;
[ "com.sun.media", "java.awt", "java.io", "javax.media" ]
com.sun.media; java.awt; java.io; javax.media;
2,294,448
public static class OpenURIAction extends WorkbenchWindowActionDelegate { public void run(IAction action) { LoadResourceAction.LoadResourceDialog loadResourceDialog = new LoadResourceAction.LoadResourceDialog(getWindow().getShell()); if (Window.OK == loadResourceDialog.open()) { for (URI uri : loadResourceDialog.getURIs()) { openEditor(getWindow().getWorkbench(), uri); } } } }
static class OpenURIAction extends WorkbenchWindowActionDelegate { public void function(IAction action) { LoadResourceAction.LoadResourceDialog loadResourceDialog = new LoadResourceAction.LoadResourceDialog(getWindow().getShell()); if (Window.OK == loadResourceDialog.open()) { for (URI uri : loadResourceDialog.getURIs()) { openEditor(getWindow().getWorkbench(), uri); } } } }
/** * Opens the editors for the files selected using the LoadResourceDialog. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
Opens the editors for the files selected using the LoadResourceDialog.
run
{ "repo_name": "nasa/OpenSPIFe", "path": "gov.nasa.ensemble.dictionary.editor/src/gov/nasa/ensemble/dictionary/presentation/DictionaryEditorAdvisor.java", "license": "apache-2.0", "size": 19178 }
[ "org.eclipse.emf.common.ui.action.WorkbenchWindowActionDelegate", "org.eclipse.emf.edit.ui.action.LoadResourceAction", "org.eclipse.jface.action.IAction", "org.eclipse.jface.window.Window" ]
import org.eclipse.emf.common.ui.action.WorkbenchWindowActionDelegate; import org.eclipse.emf.edit.ui.action.LoadResourceAction; import org.eclipse.jface.action.IAction; import org.eclipse.jface.window.Window;
import org.eclipse.emf.common.ui.action.*; import org.eclipse.emf.edit.ui.action.*; import org.eclipse.jface.action.*; import org.eclipse.jface.window.*;
[ "org.eclipse.emf", "org.eclipse.jface" ]
org.eclipse.emf; org.eclipse.jface;
2,148,091
@GET("/forums/listThreads.json") Response<List<Thread>> listThreads(@Query("forum") String forum, @Query("related") String[] related, @Query("include") String[] include, @QueryMap Map<String, String> optionalParams) throws ApiException;
@GET(STR) Response<List<Thread>> listThreads(@Query("forum") String forum, @Query(STR) String[] related, @Query(STR) String[] include, @QueryMap Map<String, String> optionalParams) throws ApiException;
/** * Returns a list of threads within a forum sorted by the date created * * @param forum The forum short name * @param related Specify relations to include with the response. Allows: forum, author * @param include Filter threads by status. Allows: open, closed, killed * @param optionalParams A map of optional parameters * @return A list of threads * @throws ApiException any error inccured * @see <a href="https://disqus.com/api/docs/forums/listThreads/">Documentation</a> */
Returns a list of threads within a forum sorted by the date created
listThreads
{ "repo_name": "jjhesk/DisqusSDK-Android", "path": "disqus/src/main/java/com/hkm/disqus/api/resources/Forums.java", "license": "mit", "size": 15523 }
[ "com.hkm.disqus.api.exception.ApiException", "com.hkm.disqus.api.model.Response", "java.util.List", "java.util.Map" ]
import com.hkm.disqus.api.exception.ApiException; import com.hkm.disqus.api.model.Response; import java.util.List; import java.util.Map;
import com.hkm.disqus.api.exception.*; import com.hkm.disqus.api.model.*; import java.util.*;
[ "com.hkm.disqus", "java.util" ]
com.hkm.disqus; java.util;
2,028,063
//------------------// // getStaffBarlines // //------------------// public List<StaffBarlineInter> getStaffBarlines () { return Collections.unmodifiableList(staffBarlines); }
List<StaffBarlineInter> function () { return Collections.unmodifiableList(staffBarlines); }
/** * Report the vertical sequence of StaffBarlineInter instances. * * @return list of StaffBarline instances */
Report the vertical sequence of StaffBarlineInter instances
getStaffBarlines
{ "repo_name": "Audiveris/audiveris", "path": "src/main/org/audiveris/omr/sheet/PartBarline.java", "license": "agpl-3.0", "size": 12475 }
[ "java.util.Collections", "java.util.List", "org.audiveris.omr.sig.inter.StaffBarlineInter" ]
import java.util.Collections; import java.util.List; import org.audiveris.omr.sig.inter.StaffBarlineInter;
import java.util.*; import org.audiveris.omr.sig.inter.*;
[ "java.util", "org.audiveris.omr" ]
java.util; org.audiveris.omr;
1,020,949
public void setCacheMode(CacheMode cacheMode) { getSession().setCacheMode(cacheMode); }
void function(CacheMode cacheMode) { getSession().setCacheMode(cacheMode); }
/** * Set the cache mode. * <p> * Cache mode determines the manner in which this session can interact with the second level * cache. * * @param cacheMode The new cache mode. */
Set the cache mode. Cache mode determines the manner in which this session can interact with the second level cache
setCacheMode
{ "repo_name": "koskedk/openmrs-core", "path": "api/src/main/java/org/openmrs/api/db/hibernate/DbSession.java", "license": "mpl-2.0", "size": 41239 }
[ "org.hibernate.CacheMode" ]
import org.hibernate.CacheMode;
import org.hibernate.*;
[ "org.hibernate" ]
org.hibernate;
2,131,009
static MetricCollection distributionPoints(List<DistributionPoint> metric) { return DistributionPointCollection.create(metric); }
static MetricCollection distributionPoints(List<DistributionPoint> metric) { return DistributionPointCollection.create(metric); }
/** * Create a new distribution point collection * * @param metric distribution points * @return a new collection of distribution point */
Create a new distribution point collection
distributionPoints
{ "repo_name": "spotify/heroic", "path": "heroic-component/src/main/java/com/spotify/heroic/metric/MetricCollection.java", "license": "apache-2.0", "size": 12661 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,375,307
private List<DiffEntry> blockingCompareTrees(RevTree treeA, RevTree treeB) { if (cache == null) { return blockingCompareTreesUncached(treeA, treeB, TreeFilter.ALL); } final CacheableCompareTreesCall key = new CacheableCompareTreesCall(this, treeA, treeB); CompletableFuture<List<DiffEntry>> existingFuture = cache.getIfPresent(key); if (existingFuture != null) { final List<DiffEntry> existingDiffEntries = existingFuture.getNow(null); if (existingDiffEntries != null) { // Cached already. return existingDiffEntries; } } // Not cached yet. Acquire a lock so that we do not compare the same tree pairs simultaneously. final List<DiffEntry> newDiffEntries; final Lock lock = key.coarseGrainedLock(); lock.lock(); try { existingFuture = cache.getIfPresent(key); if (existingFuture != null) { final List<DiffEntry> existingDiffEntries = existingFuture.getNow(null); if (existingDiffEntries != null) { // Other thread already put the entries to the cache before we acquire the lock. return existingDiffEntries; } } newDiffEntries = blockingCompareTreesUncached(treeA, treeB, TreeFilter.ALL); cache.put(key, newDiffEntries); } finally { lock.unlock(); } logger.debug("Cache miss: {}", key); return newDiffEntries; }
List<DiffEntry> function(RevTree treeA, RevTree treeB) { if (cache == null) { return blockingCompareTreesUncached(treeA, treeB, TreeFilter.ALL); } final CacheableCompareTreesCall key = new CacheableCompareTreesCall(this, treeA, treeB); CompletableFuture<List<DiffEntry>> existingFuture = cache.getIfPresent(key); if (existingFuture != null) { final List<DiffEntry> existingDiffEntries = existingFuture.getNow(null); if (existingDiffEntries != null) { return existingDiffEntries; } } final List<DiffEntry> newDiffEntries; final Lock lock = key.coarseGrainedLock(); lock.lock(); try { existingFuture = cache.getIfPresent(key); if (existingFuture != null) { final List<DiffEntry> existingDiffEntries = existingFuture.getNow(null); if (existingDiffEntries != null) { return existingDiffEntries; } } newDiffEntries = blockingCompareTreesUncached(treeA, treeB, TreeFilter.ALL); cache.put(key, newDiffEntries); } finally { lock.unlock(); } logger.debug(STR, key); return newDiffEntries; }
/** * Compares the two Git trees (with caching). */
Compares the two Git trees (with caching)
blockingCompareTrees
{ "repo_name": "line/centraldogma", "path": "server/src/main/java/com/linecorp/centraldogma/server/internal/storage/repository/git/GitRepository.java", "license": "apache-2.0", "size": 73585 }
[ "java.util.List", "java.util.concurrent.CompletableFuture", "java.util.concurrent.locks.Lock", "org.eclipse.jgit.diff.DiffEntry", "org.eclipse.jgit.revwalk.RevTree", "org.eclipse.jgit.treewalk.filter.TreeFilter" ]
import java.util.List; import java.util.concurrent.CompletableFuture; import java.util.concurrent.locks.Lock; import org.eclipse.jgit.diff.DiffEntry; import org.eclipse.jgit.revwalk.RevTree; import org.eclipse.jgit.treewalk.filter.TreeFilter;
import java.util.*; import java.util.concurrent.*; import java.util.concurrent.locks.*; import org.eclipse.jgit.diff.*; import org.eclipse.jgit.revwalk.*; import org.eclipse.jgit.treewalk.filter.*;
[ "java.util", "org.eclipse.jgit" ]
java.util; org.eclipse.jgit;
1,051,412
public void addSensor(VRMLKeyDeviceSensorNodeType sensor) { if(!keyNodes.contains(sensor)) { keyNodes.add(sensor); sensors.add(sensor); } }
void function(VRMLKeyDeviceSensorNodeType sensor) { if(!keyNodes.contains(sensor)) { keyNodes.add(sensor); sensors.add(sensor); } }
/** * Add a key device sensor node to the managed list. Only adds it to the * internal list if it is not already active. * * @param sensor The new sensor instance to add */
Add a key device sensor node to the managed list. Only adds it to the internal list if it is not already active
addSensor
{ "repo_name": "Norkart/NK-VirtualGlobe", "path": "Xj3D/src/java/org/xj3d/core/eventmodel/KeyDeviceSensorManager.java", "license": "gpl-2.0", "size": 6307 }
[ "org.web3d.vrml.nodes.VRMLKeyDeviceSensorNodeType" ]
import org.web3d.vrml.nodes.VRMLKeyDeviceSensorNodeType;
import org.web3d.vrml.nodes.*;
[ "org.web3d.vrml" ]
org.web3d.vrml;
816,144
public static final RetryPolicy exponentialBackoffRetry( int maxRetries, long sleepTime, TimeUnit timeUnit) { return new ExponentialBackoffRetry(maxRetries, sleepTime, timeUnit); }
static final RetryPolicy function( int maxRetries, long sleepTime, TimeUnit timeUnit) { return new ExponentialBackoffRetry(maxRetries, sleepTime, timeUnit); }
/** * <p> * Keep trying a limited number of times, waiting a growing amount of time between attempts, * and then fail by re-throwing the exception. * The time between attempts is <code>sleepTime</code> mutliplied by a random * number in the range of [0, 2 to the number of retries) * </p> */
Keep trying a limited number of times, waiting a growing amount of time between attempts, and then fail by re-throwing the exception. The time between attempts is <code>sleepTime</code> mutliplied by a random number in the range of [0, 2 to the number of retries)
exponentialBackoffRetry
{ "repo_name": "Bizyroth/hadoop", "path": "hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/retry/RetryPolicies.java", "license": "apache-2.0", "size": 23824 }
[ "java.util.concurrent.TimeUnit" ]
import java.util.concurrent.TimeUnit;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
2,828,335
@Nullable public File getGradleHomeFromEnvProperty() { String path = System.getenv(GRADLE_ENV_PROPERTY_NAME); if (path == null) { return null; } File candidate = new File(path); return isGradleSdkHome(candidate) ? candidate : null; }
File function() { String path = System.getenv(GRADLE_ENV_PROPERTY_NAME); if (path == null) { return null; } File candidate = new File(path); return isGradleSdkHome(candidate) ? candidate : null; }
/** * Tries to discover gradle installation via environment property. * * @return file handle for the gradle directory deduced from the system property (if any) */
Tries to discover gradle installation via environment property
getGradleHomeFromEnvProperty
{ "repo_name": "IllusionRom-deprecated/android_platform_tools_idea", "path": "plugins/gradle/src/org/jetbrains/plugins/gradle/service/GradleInstallationManager.java", "license": "apache-2.0", "size": 16205 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
611,810
private boolean isItemInAtLeastMinsupTransactionsWithoutFirst(List<Transaction> transactions, Integer item) { int supCount = 1; for(int i=1; i < transactions.size(); i++) { if(transactions.get(i).containsByBinarySearchOriginalTransaction(item)) { supCount++; if(supCount == minsupRelative) { return true; } } } return false; }
boolean function(List<Transaction> transactions, Integer item) { int supCount = 1; for(int i=1; i < transactions.size(); i++) { if(transactions.get(i).containsByBinarySearchOriginalTransaction(item)) { supCount++; if(supCount == minsupRelative) { return true; } } } return false; }
/** * Check if an item appears in at least minsup transactions * @param transactions a list of transactions (without the first one) * @param item an item * @return true if the item appears in > minsup-1 transactions after the first one */
Check if an item appears in at least minsup transactions
isItemInAtLeastMinsupTransactionsWithoutFirst
{ "repo_name": "dragonzhou/humor", "path": "src/ca/pfv/spmf/algorithms/frequentpatterns/lcm/AlgoLCM.java", "license": "apache-2.0", "size": 26969 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,824,891
@NonNull protected LinkedList<AlertImpl> getCurrentAlertList(@NonNull AlertType type) { switch (type) { case VIEW: return currentViews; case DIALOG: return currentDialogs; case POPUP: return currentPopups; case OTHER: return currentOthers; default: return new LinkedList<>(); } }
LinkedList<AlertImpl> function(@NonNull AlertType type) { switch (type) { case VIEW: return currentViews; case DIALOG: return currentDialogs; case POPUP: return currentPopups; case OTHER: return currentOthers; default: return new LinkedList<>(); } }
/** * Returns the current stored alerts for the given AlertType. <b>Internal use only.</b> * * @param type AlertType which is used to determine the correct list * @return List of alerts that are currently stored * @since 1.0.0 */
Returns the current stored alerts for the given AlertType. Internal use only
getCurrentAlertList
{ "repo_name": "Mordag/hitogo", "path": "core/src/main/java/org/hitogo/core/HitogoController.java", "license": "apache-2.0", "size": 38497 }
[ "androidx.annotation.NonNull", "java.util.LinkedList", "org.hitogo.alert.core.AlertImpl", "org.hitogo.alert.core.AlertType" ]
import androidx.annotation.NonNull; import java.util.LinkedList; import org.hitogo.alert.core.AlertImpl; import org.hitogo.alert.core.AlertType;
import androidx.annotation.*; import java.util.*; import org.hitogo.alert.core.*;
[ "androidx.annotation", "java.util", "org.hitogo.alert" ]
androidx.annotation; java.util; org.hitogo.alert;
1,372,700
@Test(expected = NoSuchColumnException.class) public void testCorruptQualifier() throws Exception { mTranslator.toKijiColumnName(getHBaseColumnName("inMemory", "fakeFamilyfakeQualifier")); }
@Test(expected = NoSuchColumnException.class) void function() throws Exception { mTranslator.toKijiColumnName(getHBaseColumnName(STR, STR)); }
/** * Tests that an exception is thrown when the HBase qualifier is corrupt (no separator). */
Tests that an exception is thrown when the HBase qualifier is corrupt (no separator)
testCorruptQualifier
{ "repo_name": "rpinzon/kiji-schema", "path": "kiji-schema/src/test/java/org/kiji/schema/layout/impl/hbase/TestIdentityColumnNameTranslator.java", "license": "apache-2.0", "size": 5894 }
[ "org.junit.Test", "org.kiji.schema.NoSuchColumnException" ]
import org.junit.Test; import org.kiji.schema.NoSuchColumnException;
import org.junit.*; import org.kiji.schema.*;
[ "org.junit", "org.kiji.schema" ]
org.junit; org.kiji.schema;
2,709,372
public boolean isFlagUnflagged() { return getFlag() == BioAssay.FLAG_UNFLAGGED; }
boolean function() { return getFlag() == BioAssay.FLAG_UNFLAGGED; }
/** * Test if the flag of the spot is "unflagged". * @return true if the flag of the spot is "unflagged" */
Test if the flag of the spot is "unflagged"
isFlagUnflagged
{ "repo_name": "GenomicParisCentre/nividic", "path": "src/main/java/fr/ens/transcriptome/nividic/om/impl/SpotImpl.java", "license": "lgpl-2.1", "size": 22875 }
[ "fr.ens.transcriptome.nividic.om.BioAssay" ]
import fr.ens.transcriptome.nividic.om.BioAssay;
import fr.ens.transcriptome.nividic.om.*;
[ "fr.ens.transcriptome" ]
fr.ens.transcriptome;
2,356,745
@Test public void testExecutionFailureWithFallback() { TestHystrixCommand<?> command = getCommand(ExecutionIsolationStrategy.THREAD, AbstractTestHystrixCommand.ExecutionResult.FAILURE, AbstractTestHystrixCommand.FallbackResult.SUCCESS); try { assertEquals(FlexibleTestHystrixCommand.FALLBACK_VALUE, command.execute()); } catch (Exception e) { e.printStackTrace(); fail("We should have received a response from the fallback."); } assertEquals("Execution Failure for TestHystrixCommand", command.getFailedExecutionException().getMessage()); assertTrue(command.getExecutionTimeInMilliseconds() > -1); assertTrue(command.isFailedExecution()); assertEquals(0, command.getBuilder().metrics.getRollingCount(HystrixRollingNumberEvent.SUCCESS)); assertEquals(0, command.getBuilder().metrics.getRollingCount(HystrixRollingNumberEvent.EXCEPTION_THROWN)); assertEquals(1, command.getBuilder().metrics.getRollingCount(HystrixRollingNumberEvent.FAILURE)); assertEquals(0, command.getBuilder().metrics.getRollingCount(HystrixRollingNumberEvent.BAD_REQUEST)); assertEquals(0, command.getBuilder().metrics.getRollingCount(HystrixRollingNumberEvent.FALLBACK_REJECTION)); assertEquals(0, command.getBuilder().metrics.getRollingCount(HystrixRollingNumberEvent.FALLBACK_FAILURE)); assertEquals(1, command.getBuilder().metrics.getRollingCount(HystrixRollingNumberEvent.FALLBACK_SUCCESS)); assertEquals(0, command.getBuilder().metrics.getRollingCount(HystrixRollingNumberEvent.SEMAPHORE_REJECTED)); assertEquals(0, command.getBuilder().metrics.getRollingCount(HystrixRollingNumberEvent.SHORT_CIRCUITED)); assertEquals(0, command.getBuilder().metrics.getRollingCount(HystrixRollingNumberEvent.THREAD_POOL_REJECTED)); assertEquals(0, command.getBuilder().metrics.getRollingCount(HystrixRollingNumberEvent.TIMEOUT)); assertEquals(0, command.getBuilder().metrics.getRollingCount(HystrixRollingNumberEvent.RESPONSE_FROM_CACHE)); assertEquals(100, command.getBuilder().metrics.getHealthCounts().getErrorPercentage()); assertEquals(0, command.getBuilder().metrics.getCurrentConcurrentExecutionCount()); assertEquals(1, HystrixRequestLog.getCurrentRequest().getAllExecutedCommands().size()); }
void function() { TestHystrixCommand<?> command = getCommand(ExecutionIsolationStrategy.THREAD, AbstractTestHystrixCommand.ExecutionResult.FAILURE, AbstractTestHystrixCommand.FallbackResult.SUCCESS); try { assertEquals(FlexibleTestHystrixCommand.FALLBACK_VALUE, command.execute()); } catch (Exception e) { e.printStackTrace(); fail(STR); } assertEquals(STR, command.getFailedExecutionException().getMessage()); assertTrue(command.getExecutionTimeInMilliseconds() > -1); assertTrue(command.isFailedExecution()); assertEquals(0, command.getBuilder().metrics.getRollingCount(HystrixRollingNumberEvent.SUCCESS)); assertEquals(0, command.getBuilder().metrics.getRollingCount(HystrixRollingNumberEvent.EXCEPTION_THROWN)); assertEquals(1, command.getBuilder().metrics.getRollingCount(HystrixRollingNumberEvent.FAILURE)); assertEquals(0, command.getBuilder().metrics.getRollingCount(HystrixRollingNumberEvent.BAD_REQUEST)); assertEquals(0, command.getBuilder().metrics.getRollingCount(HystrixRollingNumberEvent.FALLBACK_REJECTION)); assertEquals(0, command.getBuilder().metrics.getRollingCount(HystrixRollingNumberEvent.FALLBACK_FAILURE)); assertEquals(1, command.getBuilder().metrics.getRollingCount(HystrixRollingNumberEvent.FALLBACK_SUCCESS)); assertEquals(0, command.getBuilder().metrics.getRollingCount(HystrixRollingNumberEvent.SEMAPHORE_REJECTED)); assertEquals(0, command.getBuilder().metrics.getRollingCount(HystrixRollingNumberEvent.SHORT_CIRCUITED)); assertEquals(0, command.getBuilder().metrics.getRollingCount(HystrixRollingNumberEvent.THREAD_POOL_REJECTED)); assertEquals(0, command.getBuilder().metrics.getRollingCount(HystrixRollingNumberEvent.TIMEOUT)); assertEquals(0, command.getBuilder().metrics.getRollingCount(HystrixRollingNumberEvent.RESPONSE_FROM_CACHE)); assertEquals(100, command.getBuilder().metrics.getHealthCounts().getErrorPercentage()); assertEquals(0, command.getBuilder().metrics.getCurrentConcurrentExecutionCount()); assertEquals(1, HystrixRequestLog.getCurrentRequest().getAllExecutedCommands().size()); }
/** * Test a command execution that fails but has a fallback. */
Test a command execution that fails but has a fallback
testExecutionFailureWithFallback
{ "repo_name": "manwithharmonica/Hystrix", "path": "hystrix-core/src/test/java/com/netflix/hystrix/HystrixCommandTest.java", "license": "apache-2.0", "size": 265467 }
[ "com.netflix.hystrix.HystrixCommandProperties", "com.netflix.hystrix.util.HystrixRollingNumberEvent", "org.junit.Assert" ]
import com.netflix.hystrix.HystrixCommandProperties; import com.netflix.hystrix.util.HystrixRollingNumberEvent; import org.junit.Assert;
import com.netflix.hystrix.*; import com.netflix.hystrix.util.*; import org.junit.*;
[ "com.netflix.hystrix", "org.junit" ]
com.netflix.hystrix; org.junit;
920,167
public static byte[] readFullyAndClose(InputStream is) throws IOException { try { // Initial read byte[] buffer = new byte[1024]; int count = is.read(buffer); int nextByte = is.read(); // Did we get it all in one read? if (nextByte == -1) { return Arrays.copyOf(buffer, count); } // Requires additional reads ByteArrayOutputStream baos = new ByteArrayOutputStream(count * 2); baos.write(buffer, 0, count); baos.write(nextByte); while (true) { count = is.read(buffer); if (count == -1) { return baos.toByteArray(); } baos.write(buffer, 0, count); } } finally { is.close(); } }
static byte[] function(InputStream is) throws IOException { try { byte[] buffer = new byte[1024]; int count = is.read(buffer); int nextByte = is.read(); if (nextByte == -1) { return Arrays.copyOf(buffer, count); } ByteArrayOutputStream baos = new ByteArrayOutputStream(count * 2); baos.write(buffer, 0, count); baos.write(nextByte); while (true) { count = is.read(buffer); if (count == -1) { return baos.toByteArray(); } baos.write(buffer, 0, count); } } finally { is.close(); } }
/** * Reads all the bytes from the given input stream. * * Calls read multiple times on the given input stream until it receives an * end of file marker. Returns the combined results as a byte array. Note * that this method may block if the underlying stream read blocks. * * @param is * the input stream to be read. * @return the content of the stream as a byte array. * @throws IOException * if a read error occurs. */
Reads all the bytes from the given input stream. Calls read multiple times on the given input stream until it receives an end of file marker. Returns the combined results as a byte array. Note that this method may block if the underlying stream read blocks
readFullyAndClose
{ "repo_name": "webos21/xi", "path": "java/jcl/src/java/org/apache/harmony/luni/util/InputStreamHelper.java", "license": "apache-2.0", "size": 5616 }
[ "java.io.ByteArrayOutputStream", "java.io.IOException", "java.io.InputStream", "java.util.Arrays" ]
import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.Arrays;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
1,602,131
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj instanceof ResponseAPDU == false) { return false; } ResponseAPDU other = (ResponseAPDU)obj; return Arrays.equals(this.apdu, other.apdu); }
boolean function(Object obj) { if (this == obj) { return true; } if (obj instanceof ResponseAPDU == false) { return false; } ResponseAPDU other = (ResponseAPDU)obj; return Arrays.equals(this.apdu, other.apdu); }
/** * Compares the specified object with this response APDU for equality. * Returns true if the given object is also a ResponseAPDU and its bytes are * identical to the bytes in this ResponseAPDU. * * @param obj the object to be compared for equality with this response APDU * @return true if the specified object is equal to this response APDU */
Compares the specified object with this response APDU for equality. Returns true if the given object is also a ResponseAPDU and its bytes are identical to the bytes in this ResponseAPDU
equals
{ "repo_name": "openjdk/jdk7u", "path": "jdk/src/share/classes/javax/smartcardio/ResponseAPDU.java", "license": "gpl-2.0", "size": 5886 }
[ "java.util.Arrays" ]
import java.util.Arrays;
import java.util.*;
[ "java.util" ]
java.util;
82,039
public void set( @Name("index") int index, @Name("element") long element) { throw Util.makeJavaArrayWrapperException(); }
void function( @Name("index") int index, @Name(STR) long element) { throw Util.makeJavaArrayWrapperException(); }
/** * Set the element with the given {@code index} to the * given {@code element} value. * * @param index the index within this array * @param element the new element value * @throws ArrayIndexOutOfBoundsException if the index * does not refer to an element of this array * @throws ArrayStoreException if the given element can * not be stored in the array. */
Set the element with the given index to the given element value
set
{ "repo_name": "ceylon/ceylon", "path": "language/runtime/org/eclipse/ceylon/compiler/java/language/LongArray.java", "license": "apache-2.0", "size": 19876 }
[ "org.eclipse.ceylon.compiler.java.Util", "org.eclipse.ceylon.compiler.java.metadata.Name" ]
import org.eclipse.ceylon.compiler.java.Util; import org.eclipse.ceylon.compiler.java.metadata.Name;
import org.eclipse.ceylon.compiler.java.*; import org.eclipse.ceylon.compiler.java.metadata.*;
[ "org.eclipse.ceylon" ]
org.eclipse.ceylon;
1,226,746
public void addExternalIds(Iterable<ExternalId> exchangeIds) { ArgumentChecker.notNull(exchangeIds, "exchangeIds"); if (getExternalIdSearch() == null) { setExternalIdSearch(ExternalIdSearch.of(exchangeIds)); } else { setExternalIdSearch(getExternalIdSearch().withExternalIdsAdded(exchangeIds)); } }
void function(Iterable<ExternalId> exchangeIds) { ArgumentChecker.notNull(exchangeIds, STR); if (getExternalIdSearch() == null) { setExternalIdSearch(ExternalIdSearch.of(exchangeIds)); } else { setExternalIdSearch(getExternalIdSearch().withExternalIdsAdded(exchangeIds)); } }
/** * Adds a collection of exchange external identifiers to the collection to search for. * Unless customized, the search will match * {@link ExternalIdSearchType#ANY any} of the identifiers. * * @param exchangeIds the exchange key identifiers to add, not null */
Adds a collection of exchange external identifiers to the collection to search for. Unless customized, the search will match <code>ExternalIdSearchType#ANY any</code> of the identifiers
addExternalIds
{ "repo_name": "ChinaQuants/OG-Platform", "path": "projects/OG-Master/src/main/java/com/opengamma/master/exchange/ExchangeSearchRequest.java", "license": "apache-2.0", "size": 17411 }
[ "com.opengamma.id.ExternalId", "com.opengamma.id.ExternalIdSearch", "com.opengamma.util.ArgumentChecker" ]
import com.opengamma.id.ExternalId; import com.opengamma.id.ExternalIdSearch; import com.opengamma.util.ArgumentChecker;
import com.opengamma.id.*; import com.opengamma.util.*;
[ "com.opengamma.id", "com.opengamma.util" ]
com.opengamma.id; com.opengamma.util;
1,387,204
@Test public void testPutWithTsSlop() throws IOException { byte[] fam = Bytes.toBytes("info"); byte[][] families = { fam }; String method = this.getName(); // add data with a timestamp that is too recent for range. Ensure assert CONF.setInt("hbase.hregion.keyvalue.timestamp.slop.millisecs", 1000); this.region = initHRegion(tableName, method, CONF, families); boolean caughtExcep = false; try { try { // no TS specified == use latest. should not error region.put(new Put(row).add(fam, Bytes.toBytes("qual"), Bytes.toBytes("value"))); // TS out of range. should error region.put(new Put(row).add(fam, Bytes.toBytes("qual"), System.currentTimeMillis() + 2000, Bytes.toBytes("value"))); fail("Expected IOE for TS out of configured timerange"); } catch (FailedSanityCheckException ioe) { LOG.debug("Received expected exception", ioe); caughtExcep = true; } assertTrue("Should catch FailedSanityCheckException", caughtExcep); } finally { HBaseTestingUtility.closeRegionAndWAL(this.region); this.region = null; } }
void function() throws IOException { byte[] fam = Bytes.toBytes("info"); byte[][] families = { fam }; String method = this.getName(); CONF.setInt(STR, 1000); this.region = initHRegion(tableName, method, CONF, families); boolean caughtExcep = false; try { try { region.put(new Put(row).add(fam, Bytes.toBytes("qual"), Bytes.toBytes("value"))); region.put(new Put(row).add(fam, Bytes.toBytes("qual"), System.currentTimeMillis() + 2000, Bytes.toBytes("value"))); fail(STR); } catch (FailedSanityCheckException ioe) { LOG.debug(STR, ioe); caughtExcep = true; } assertTrue(STR, caughtExcep); } finally { HBaseTestingUtility.closeRegionAndWAL(this.region); this.region = null; } }
/** * Tests that there is server-side filtering for invalid timestamp upper * bound. Note that the timestamp lower bound is automatically handled for us * by the TTL field. */
Tests that there is server-side filtering for invalid timestamp upper bound. Note that the timestamp lower bound is automatically handled for us by the TTL field
testPutWithTsSlop
{ "repo_name": "juwi/hbase", "path": "hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestHRegion.java", "license": "apache-2.0", "size": 231780 }
[ "java.io.IOException", "org.apache.hadoop.hbase.HBaseTestingUtility", "org.apache.hadoop.hbase.client.Put", "org.apache.hadoop.hbase.exceptions.FailedSanityCheckException", "org.apache.hadoop.hbase.util.Bytes", "org.junit.Assert" ]
import java.io.IOException; import org.apache.hadoop.hbase.HBaseTestingUtility; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.exceptions.FailedSanityCheckException; import org.apache.hadoop.hbase.util.Bytes; import org.junit.Assert;
import java.io.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.client.*; import org.apache.hadoop.hbase.exceptions.*; import org.apache.hadoop.hbase.util.*; import org.junit.*;
[ "java.io", "org.apache.hadoop", "org.junit" ]
java.io; org.apache.hadoop; org.junit;
2,317,321
public static MozuClient<com.mozu.api.contracts.productadmin.LocationInventoryCollection> getLocationInventoriesClient(com.mozu.api.DataViewMode dataViewMode, String locationCode, Integer startIndex, Integer pageSize, String sortBy, String filter, AuthTicket authTicket) throws Exception { MozuUrl url = com.mozu.api.urls.commerce.catalog.admin.LocationInventoryUrl.getLocationInventoriesUrl(filter, locationCode, pageSize, sortBy, startIndex); String verb = "GET"; Class<?> clz = com.mozu.api.contracts.productadmin.LocationInventoryCollection.class; MozuClient<com.mozu.api.contracts.productadmin.LocationInventoryCollection> mozuClient = new MozuClient(clz); mozuClient.setVerb(verb); mozuClient.setResourceUrl(url); mozuClient.addHeader(Headers.X_VOL_DATAVIEW_MODE ,dataViewMode.toString()); if (authTicket != null) mozuClient.setUserAuth(authTicket); return mozuClient; }
static MozuClient<com.mozu.api.contracts.productadmin.LocationInventoryCollection> function(com.mozu.api.DataViewMode dataViewMode, String locationCode, Integer startIndex, Integer pageSize, String sortBy, String filter, AuthTicket authTicket) throws Exception { MozuUrl url = com.mozu.api.urls.commerce.catalog.admin.LocationInventoryUrl.getLocationInventoriesUrl(filter, locationCode, pageSize, sortBy, startIndex); String verb = "GET"; Class<?> clz = com.mozu.api.contracts.productadmin.LocationInventoryCollection.class; MozuClient<com.mozu.api.contracts.productadmin.LocationInventoryCollection> mozuClient = new MozuClient(clz); mozuClient.setVerb(verb); mozuClient.setResourceUrl(url); mozuClient.addHeader(Headers.X_VOL_DATAVIEW_MODE ,dataViewMode.toString()); if (authTicket != null) mozuClient.setUserAuth(authTicket); return mozuClient; }
/** * Retrieves a list of all product inventory definitions for the location code specified in the request. * <p><pre><code> * MozuClient<com.mozu.api.contracts.productadmin.LocationInventoryCollection> mozuClient=GetLocationInventoriesClient(dataViewMode, locationCode, startIndex, pageSize, sortBy, filter, authTicket); * client.setBaseAddress(url); * client.executeRequest(); * LocationInventoryCollection locationInventoryCollection = client.Result(); * </code></pre></p> * @param filter A set of expressions that consist of a field, operator, and value and represent search parameter syntax when filtering results of a query. Valid operators include equals (eq), does not equal (ne), greater than (gt), less than (lt), greater than or equal to (ge), less than or equal to (le), starts with (sw), or contains (cont). For example - "filter=IsDisplayed+eq+true" * @param locationCode User-defined code that uniquely identifies the location. * @param pageSize The number of results to display on each page when creating paged results from a query. The maximum value is 200. * @param sortBy The property by which to sort results and whether the results appear in ascending (a-z) order, represented by ASC or in descending (z-a) order, represented by DESC. The sortBy parameter follows an available property. For example: "sortBy=productCode+asc" * @param startIndex When creating paged results from a query, this value indicates the zero-based offset in the complete result set where the returned entities begin. For example, with a PageSize of 25, to get the 51st through the 75th items, use startIndex=3. * @param dataViewMode DataViewMode * @param authTicket User Auth Ticket * @return Mozu.Api.MozuClient <com.mozu.api.contracts.productadmin.LocationInventoryCollection> * @see com.mozu.api.contracts.productadmin.LocationInventoryCollection */
Retrieves a list of all product inventory definitions for the location code specified in the request. <code><code> MozuClient mozuClient=GetLocationInventoriesClient(dataViewMode, locationCode, startIndex, pageSize, sortBy, filter, authTicket); client.setBaseAddress(url); client.executeRequest(); LocationInventoryCollection locationInventoryCollection = client.Result(); </code></code>
getLocationInventoriesClient
{ "repo_name": "carsonreinke/mozu-java-sdk", "path": "src/main/java/com/mozu/api/clients/commerce/catalog/admin/LocationInventoryClient.java", "license": "mit", "size": 11462 }
[ "com.mozu.api.Headers", "com.mozu.api.MozuClient", "com.mozu.api.MozuUrl", "com.mozu.api.security.AuthTicket" ]
import com.mozu.api.Headers; import com.mozu.api.MozuClient; import com.mozu.api.MozuUrl; import com.mozu.api.security.AuthTicket;
import com.mozu.api.*; import com.mozu.api.security.*;
[ "com.mozu.api" ]
com.mozu.api;
1,112,747
//----------------------------------------------------------------------- public MetaProperty<CurveGroupName> curveGroupName() { return curveGroupName; }
MetaProperty<CurveGroupName> function() { return curveGroupName; }
/** * The meta-property for the {@code curveGroupName} property. * @return the meta-property, not null */
The meta-property for the curveGroupName property
curveGroupName
{ "repo_name": "ChinaQuants/Strata", "path": "modules/market/src/main/java/com/opengamma/strata/market/curve/CurveGroupId.java", "license": "apache-2.0", "size": 11398 }
[ "org.joda.beans.MetaProperty" ]
import org.joda.beans.MetaProperty;
import org.joda.beans.*;
[ "org.joda.beans" ]
org.joda.beans;
1,938,601
public static FileInfo fromXContent(XContentParser parser) throws IOException { XContentParser.Token token = parser.currentToken(); String name = null; String physicalName = null; long length = -1; String checksum = null; ByteSizeValue partSize = null; Version writtenBy = null; BytesRef metaHash = new BytesRef(); if (token == XContentParser.Token.START_OBJECT) { while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) { if (token == XContentParser.Token.FIELD_NAME) { String currentFieldName = parser.currentName(); token = parser.nextToken(); if (token.isValue()) { if ("name".equals(currentFieldName)) { name = parser.text(); } else if ("physical_name".equals(currentFieldName)) { physicalName = parser.text(); } else if ("length".equals(currentFieldName)) { length = parser.longValue(); } else if ("checksum".equals(currentFieldName)) { checksum = parser.text(); } else if ("part_size".equals(currentFieldName)) { partSize = new ByteSizeValue(parser.longValue()); } else if ("written_by".equals(currentFieldName)) { writtenBy = Lucene.parseVersionLenient(parser.text(), null); } else if ("meta_hash".equals(currentFieldName)) { metaHash.bytes = parser.binaryValue(); metaHash.offset = 0; metaHash.length = metaHash.bytes.length; } else { throw new ElasticsearchParseException("unknown parameter [{}]", currentFieldName); } } else { throw new ElasticsearchParseException("unexpected token [{}]", token); } } else { throw new ElasticsearchParseException("unexpected token [{}]",token); } } } // Verify that file information is complete if (name == null || Strings.validFileName(name) == false) { throw new ElasticsearchParseException("missing or invalid file name [" + name + "]"); } else if (physicalName == null || Strings.validFileName(physicalName) == false) { throw new ElasticsearchParseException("missing or invalid physical file name [" + physicalName + "]"); } else if (length < 0) { throw new ElasticsearchParseException("missing or invalid file length"); } return new FileInfo(name, new StoreFileMetaData(physicalName, length, checksum, writtenBy, metaHash), partSize); } } private final String snapshot; private final long indexVersion; private final long startTime; private final long time; private final int numberOfFiles; private final long totalSize; private final List<FileInfo> indexFiles; public BlobStoreIndexShardSnapshot(String snapshot, long indexVersion, List<FileInfo> indexFiles, long startTime, long time, int numberOfFiles, long totalSize) { assert snapshot != null; assert indexVersion >= 0; this.snapshot = snapshot; this.indexVersion = indexVersion; this.indexFiles = Collections.unmodifiableList(new ArrayList<>(indexFiles)); this.startTime = startTime; this.time = time; this.numberOfFiles = numberOfFiles; this.totalSize = totalSize; } private BlobStoreIndexShardSnapshot() { this.snapshot = ""; this.indexVersion = 0; this.indexFiles = Collections.emptyList(); this.startTime = 0; this.time = 0; this.numberOfFiles = 0; this.totalSize = 0; }
static FileInfo function(XContentParser parser) throws IOException { XContentParser.Token token = parser.currentToken(); String name = null; String physicalName = null; long length = -1; String checksum = null; ByteSizeValue partSize = null; Version writtenBy = null; BytesRef metaHash = new BytesRef(); if (token == XContentParser.Token.START_OBJECT) { while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) { if (token == XContentParser.Token.FIELD_NAME) { String currentFieldName = parser.currentName(); token = parser.nextToken(); if (token.isValue()) { if ("name".equals(currentFieldName)) { name = parser.text(); } else if (STR.equals(currentFieldName)) { physicalName = parser.text(); } else if (STR.equals(currentFieldName)) { length = parser.longValue(); } else if (STR.equals(currentFieldName)) { checksum = parser.text(); } else if (STR.equals(currentFieldName)) { partSize = new ByteSizeValue(parser.longValue()); } else if (STR.equals(currentFieldName)) { writtenBy = Lucene.parseVersionLenient(parser.text(), null); } else if (STR.equals(currentFieldName)) { metaHash.bytes = parser.binaryValue(); metaHash.offset = 0; metaHash.length = metaHash.bytes.length; } else { throw new ElasticsearchParseException(STR, currentFieldName); } } else { throw new ElasticsearchParseException(STR, token); } } else { throw new ElasticsearchParseException(STR,token); } } } if (name == null Strings.validFileName(name) == false) { throw new ElasticsearchParseException(STR + name + "]"); } else if (physicalName == null Strings.validFileName(physicalName) == false) { throw new ElasticsearchParseException(STR + physicalName + "]"); } else if (length < 0) { throw new ElasticsearchParseException(STR); } return new FileInfo(name, new StoreFileMetaData(physicalName, length, checksum, writtenBy, metaHash), partSize); } } private final String snapshot; private final long indexVersion; private final long startTime; private final long time; private final int numberOfFiles; private final long totalSize; private final List<FileInfo> indexFiles; public BlobStoreIndexShardSnapshot(String snapshot, long indexVersion, List<FileInfo> indexFiles, long startTime, long time, int numberOfFiles, long totalSize) { assert snapshot != null; assert indexVersion >= 0; this.snapshot = snapshot; this.indexVersion = indexVersion; this.indexFiles = Collections.unmodifiableList(new ArrayList<>(indexFiles)); this.startTime = startTime; this.time = time; this.numberOfFiles = numberOfFiles; this.totalSize = totalSize; } private BlobStoreIndexShardSnapshot() { this.snapshot = ""; this.indexVersion = 0; this.indexFiles = Collections.emptyList(); this.startTime = 0; this.time = 0; this.numberOfFiles = 0; this.totalSize = 0; }
/** * Parses JSON that represents file info * * @param parser parser * @return file info */
Parses JSON that represents file info
fromXContent
{ "repo_name": "jbertouch/elasticsearch", "path": "core/src/main/java/org/elasticsearch/index/snapshots/blobstore/BlobStoreIndexShardSnapshot.java", "license": "apache-2.0", "size": 20219 }
[ "java.io.IOException", "java.util.ArrayList", "java.util.Collections", "java.util.List", "org.apache.lucene.util.BytesRef", "org.apache.lucene.util.Version", "org.elasticsearch.ElasticsearchParseException", "org.elasticsearch.common.Strings", "org.elasticsearch.common.lucene.Lucene", "org.elastics...
import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.List; import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.Version; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.common.Strings; import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.store.StoreFileMetaData;
import java.io.*; import java.util.*; import org.apache.lucene.util.*; import org.elasticsearch.*; import org.elasticsearch.common.*; import org.elasticsearch.common.lucene.*; import org.elasticsearch.common.unit.*; import org.elasticsearch.common.xcontent.*; import org.elasticsearch.index.store.*;
[ "java.io", "java.util", "org.apache.lucene", "org.elasticsearch", "org.elasticsearch.common", "org.elasticsearch.index" ]
java.io; java.util; org.apache.lucene; org.elasticsearch; org.elasticsearch.common; org.elasticsearch.index;
369,379
private void registerListeners(){ getServer().getPluginManager().registerEvents(new MessageListener(this), this); getServer().getPluginManager().registerEvents(this.playerLog, this); }
void function(){ getServer().getPluginManager().registerEvents(new MessageListener(this), this); getServer().getPluginManager().registerEvents(this.playerLog, this); }
/** * Registers listeners for this plugin */
Registers listeners for this plugin
registerListeners
{ "repo_name": "bitwizeshift/MCMessenger", "path": "src/main/java/com/punchingwood/mcmessenger/McMessenger.java", "license": "gpl-2.0", "size": 5206 }
[ "com.punchingwood.mcmessenger.listeners.MessageListener" ]
import com.punchingwood.mcmessenger.listeners.MessageListener;
import com.punchingwood.mcmessenger.listeners.*;
[ "com.punchingwood.mcmessenger" ]
com.punchingwood.mcmessenger;
2,579,736
private void autoBindDLQ(final String queueName, String routingKey, String prefix, boolean autoBindDlq) { if (this.logger.isDebugEnabled()) { this.logger.debug("autoBindDLQ=" + autoBindDlq + " for: " + queueName); } if (autoBindDlq) { String dlqName = constructDLQName(queueName); Queue dlq = new Queue(dlqName); declareQueue(dlqName, dlq); final String dlxName = deadLetterExchangeName(prefix); final DirectExchange dlx = new DirectExchange(dlxName); declareExchange(dlxName, dlx); declareBinding(dlqName, BindingBuilder.bind(dlq).to(dlx).with(routingKey)); } }
void function(final String queueName, String routingKey, String prefix, boolean autoBindDlq) { if (this.logger.isDebugEnabled()) { this.logger.debug(STR + autoBindDlq + STR + queueName); } if (autoBindDlq) { String dlqName = constructDLQName(queueName); Queue dlq = new Queue(dlqName); declareQueue(dlqName, dlq); final String dlxName = deadLetterExchangeName(prefix); final DirectExchange dlx = new DirectExchange(dlxName); declareExchange(dlxName, dlx); declareBinding(dlqName, BindingBuilder.bind(dlq).to(dlx).with(routingKey)); } }
/** * If so requested, declare the DLX/DLQ and bind it. The DLQ is bound to the DLX with a routing key of the original * queue name because we use default exchange routing by queue name for the original message. * @param queueName The base name for the queue (including the binder prefix, if any). * @param routingKey The routing key for the queue. * @param autoBindDlq true if the DLQ should be bound. */
If so requested, declare the DLX/DLQ and bind it. The DLQ is bound to the DLX with a routing key of the original queue name because we use default exchange routing by queue name for the original message
autoBindDLQ
{ "repo_name": "pperalta/spring-cloud-stream", "path": "spring-cloud-stream-binders/spring-cloud-stream-binder-rabbit/src/main/java/org/springframework/cloud/stream/binder/rabbit/RabbitMessageChannelBinder.java", "license": "apache-2.0", "size": 28268 }
[ "org.springframework.amqp.core.BindingBuilder", "org.springframework.amqp.core.DirectExchange", "org.springframework.amqp.core.Queue" ]
import org.springframework.amqp.core.BindingBuilder; import org.springframework.amqp.core.DirectExchange; import org.springframework.amqp.core.Queue;
import org.springframework.amqp.core.*;
[ "org.springframework.amqp" ]
org.springframework.amqp;
1,612,169
public Vertex parseAIML(URL url, boolean parseAsStateMachine, boolean createStates, boolean pin, boolean indexStatic, Vertex stateMachine, String encoding, Network network) { try { String text = Utils.loadTextFile(Utils.openStream(url), encoding, MAX_FILE_SIZE); return parseAIML(text, parseAsStateMachine, createStates, pin, indexStatic, stateMachine, network); } catch (IOException exception) { throw new SelfParseException("Parsing error occurred", exception); } }
Vertex function(URL url, boolean parseAsStateMachine, boolean createStates, boolean pin, boolean indexStatic, Vertex stateMachine, String encoding, Network network) { try { String text = Utils.loadTextFile(Utils.openStream(url), encoding, MAX_FILE_SIZE); return parseAIML(text, parseAsStateMachine, createStates, pin, indexStatic, stateMachine, network); } catch (IOException exception) { throw new SelfParseException(STR, exception); } }
/** * Get the contents of the URL to a .aiml file and parse it. */
Get the contents of the URL to a .aiml file and parse it
parseAIML
{ "repo_name": "BOTlibre/BOTlibre", "path": "micro-ai-engine/android/source/org/botlibre/aiml/AIMLParser.java", "license": "epl-1.0", "size": 50932 }
[ "java.io.IOException", "org.botlibre.api.knowledge.Network", "org.botlibre.api.knowledge.Vertex", "org.botlibre.self.SelfParseException", "org.botlibre.util.Utils" ]
import java.io.IOException; 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 org.botlibre.api.knowledge.*; import org.botlibre.self.*; import org.botlibre.util.*;
[ "java.io", "org.botlibre.api", "org.botlibre.self", "org.botlibre.util" ]
java.io; org.botlibre.api; org.botlibre.self; org.botlibre.util;
752,850
private void verifySerialization(SegmentedTimeline a1) { SegmentedTimeline a2 = null; try { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); ObjectOutput out = new ObjectOutputStream(buffer); out.writeObject(a1); out.close(); ObjectInput in = new ObjectInputStream( new ByteArrayInputStream(buffer.toByteArray())); a2 = (SegmentedTimeline) in.readObject(); in.close(); } catch (Exception e) { e.printStackTrace(); } assertEquals(a1, a2); }
void function(SegmentedTimeline a1) { SegmentedTimeline a2 = null; try { ByteArrayOutputStream buffer = new ByteArrayOutputStream(); ObjectOutput out = new ObjectOutputStream(buffer); out.writeObject(a1); out.close(); ObjectInput in = new ObjectInputStream( new ByteArrayInputStream(buffer.toByteArray())); a2 = (SegmentedTimeline) in.readObject(); in.close(); } catch (Exception e) { e.printStackTrace(); } assertEquals(a1, a2); }
/** * Tests serialization of an instance. * @param a1 The timeline to verify the serialization */
Tests serialization of an instance
verifySerialization
{ "repo_name": "martingwhite/astor", "path": "examples/chart_11/tests/org/jfree/chart/axis/junit/SegmentedTimelineTests.java", "license": "gpl-2.0", "size": 46257 }
[ "java.io.ByteArrayInputStream", "java.io.ByteArrayOutputStream", "java.io.ObjectInput", "java.io.ObjectInputStream", "java.io.ObjectOutput", "java.io.ObjectOutputStream", "org.jfree.chart.axis.SegmentedTimeline" ]
import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.ObjectInput; import java.io.ObjectInputStream; import java.io.ObjectOutput; import java.io.ObjectOutputStream; import org.jfree.chart.axis.SegmentedTimeline;
import java.io.*; import org.jfree.chart.axis.*;
[ "java.io", "org.jfree.chart" ]
java.io; org.jfree.chart;
119,743
ValuesSource valuesSource() { return vs; }
ValuesSource valuesSource() { return vs; }
/** * Returns the {@link ValuesSource} for this configuration. */
Returns the <code>ValuesSource</code> for this configuration
valuesSource
{ "repo_name": "qwerty4030/elasticsearch", "path": "server/src/main/java/org/elasticsearch/search/aggregations/bucket/composite/CompositeValuesSourceConfig.java", "license": "apache-2.0", "size": 2413 }
[ "org.elasticsearch.search.aggregations.support.ValuesSource" ]
import org.elasticsearch.search.aggregations.support.ValuesSource;
import org.elasticsearch.search.aggregations.support.*;
[ "org.elasticsearch.search" ]
org.elasticsearch.search;
924,776
void inspectStorageDirs(FSImageStorageInspector inspector) throws IOException { // Process each of the storage directories to find the pair of // newest image file and edit file for (Iterator<StorageDirectory> it = dirIterator(); it.hasNext();) { StorageDirectory sd = it.next(); inspector.inspectDirectory(sd); } }
void inspectStorageDirs(FSImageStorageInspector inspector) throws IOException { for (Iterator<StorageDirectory> it = dirIterator(); it.hasNext();) { StorageDirectory sd = it.next(); inspector.inspectDirectory(sd); } }
/** * Iterate over all current storage directories, inspecting them * with the given inspector. */
Iterate over all current storage directories, inspecting them with the given inspector
inspectStorageDirs
{ "repo_name": "moreus/hadoop", "path": "hadoop-0.23.10/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NNStorage.java", "license": "apache-2.0", "size": 36168 }
[ "java.io.IOException", "java.util.Iterator" ]
import java.io.IOException; import java.util.Iterator;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
2,800,840
@Override protected void onPrepareDialog(int id, Dialog dialog) { switch (id) { case 0: // Clear the input box. EditText text = (EditText) dialog.findViewById(TEXT_Allergien); text.setText(""); break; case 1: // Clear the input box. EditText text2 = (EditText) dialog.findViewById(TEXT_Medikamente); text2.setText(""); break; } }
void function(int id, Dialog dialog) { switch (id) { case 0: EditText text = (EditText) dialog.findViewById(TEXT_Allergien); text.setText(STR"); break; } }
/** * If a dialog has already been created, * this is called to reset the dialog * before showing it a 2nd time. Optional. */
If a dialog has already been created, this is called to reset the dialog before showing it a 2nd time. Optional
onPrepareDialog
{ "repo_name": "wrk-fmd/CoCeCl", "path": "app/src/main/java/it/fmd/cocecl/PatmanActivity.java", "license": "gpl-3.0", "size": 12237 }
[ "android.app.Dialog", "android.widget.EditText" ]
import android.app.Dialog; import android.widget.EditText;
import android.app.*; import android.widget.*;
[ "android.app", "android.widget" ]
android.app; android.widget;
948,836
public final Property<LocalDate> expirationDate() { return metaBean().expirationDate().createProperty(this); }
final Property<LocalDate> function() { return metaBean().expirationDate().createProperty(this); }
/** * Gets the the {@code expirationDate} property. * @return the property, not null */
Gets the the expirationDate property
expirationDate
{ "repo_name": "McLeodMoores/starling", "path": "projects/integration/src/main/java/com/opengamma/integration/tool/portfolio/xml/v1_0/jaxb/SwaptionTrade.java", "license": "apache-2.0", "size": 27209 }
[ "org.joda.beans.Property", "org.threeten.bp.LocalDate" ]
import org.joda.beans.Property; import org.threeten.bp.LocalDate;
import org.joda.beans.*; import org.threeten.bp.*;
[ "org.joda.beans", "org.threeten.bp" ]
org.joda.beans; org.threeten.bp;
1,780,058
public TaskBook generateTaskBookTasksAndEvents(List<Task> tasks, List<Event> events) throws Exception{ TaskBook taskBook = new TaskBook(); addEventsToTaskBook(taskBook, events); addTasksToTaskBook(taskBook, tasks); return taskBook; }
TaskBook function(List<Task> tasks, List<Event> events) throws Exception{ TaskBook taskBook = new TaskBook(); addEventsToTaskBook(taskBook, events); addTasksToTaskBook(taskBook, tasks); return taskBook; }
/** * Generates an TaskBook with auto-generated tasks. */
Generates an TaskBook with auto-generated tasks
generateTaskBookTasksAndEvents
{ "repo_name": "CS2103AUG2016-F09-C4/main", "path": "src/test/java/seedu/task/logic/TestDataHelper.java", "license": "mit", "size": 22975 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,834,324
public void setTarget(Entity target);
void function(Entity target);
/** * Make NPC look at an entity. * * @param target Entity to look at */
Make NPC look at an entity
setTarget
{ "repo_name": "lenis0012/NPCFactory", "path": "src/main/java/com/lenis0012/bukkit/npcfactory/api/NPC.java", "license": "mit", "size": 4433 }
[ "org.bukkit.entity.Entity" ]
import org.bukkit.entity.Entity;
import org.bukkit.entity.*;
[ "org.bukkit.entity" ]
org.bukkit.entity;
2,637,716
public void setFillPaintTransformer(GradientPaintTransformer transformer) { if (transformer == null) { throw new IllegalArgumentException("Null 'transformer' argument."); } this.fillPaintTransformer = transformer; }
void function(GradientPaintTransformer transformer) { if (transformer == null) { throw new IllegalArgumentException(STR); } this.fillPaintTransformer = transformer; }
/** * Sets the transformer used when the fill paint is an instance of * <code>GradientPaint</code>. * * @param transformer the transformer (<code>null</code> not permitted). * * @since 1.0.4 * * @see #getFillPaintTransformer() */
Sets the transformer used when the fill paint is an instance of <code>GradientPaint</code>
setFillPaintTransformer
{ "repo_name": "apetresc/JFreeChart", "path": "src/main/java/org/jfree/chart/title/LegendGraphic.java", "license": "lgpl-2.1", "size": 22996 }
[ "org.jfree.ui.GradientPaintTransformer" ]
import org.jfree.ui.GradientPaintTransformer;
import org.jfree.ui.*;
[ "org.jfree.ui" ]
org.jfree.ui;
1,382,808
private boolean isEqual(FlowableEntityEvent event1, FlowableEvent activitiEvent) { if (activitiEvent instanceof FlowableEntityEvent && event1.getType().equals(activitiEvent.getType())) { FlowableEntityEvent activitiEntityEvent = (FlowableEntityEvent) activitiEvent; if (activitiEntityEvent.getEntity().getClass().equals(event1.getEntity().getClass())) { return true; } } return false; }
boolean function(FlowableEntityEvent event1, FlowableEvent activitiEvent) { if (activitiEvent instanceof FlowableEntityEvent && event1.getType().equals(activitiEvent.getType())) { FlowableEntityEvent activitiEntityEvent = (FlowableEntityEvent) activitiEvent; if (activitiEntityEvent.getEntity().getClass().equals(event1.getEntity().getClass())) { return true; } } return false; }
/** * equals is not implemented. */
equals is not implemented
isEqual
{ "repo_name": "robsoncardosoti/flowable-engine", "path": "modules/flowable5-test/src/test/java/org/activiti/engine/test/api/event/ProcessDefinitionEventsTest.java", "license": "apache-2.0", "size": 7744 }
[ "org.flowable.engine.common.api.delegate.event.FlowableEntityEvent", "org.flowable.engine.common.api.delegate.event.FlowableEvent" ]
import org.flowable.engine.common.api.delegate.event.FlowableEntityEvent; import org.flowable.engine.common.api.delegate.event.FlowableEvent;
import org.flowable.engine.common.api.delegate.event.*;
[ "org.flowable.engine" ]
org.flowable.engine;
1,041,295
public void removeAndRecycleViewAt(int index, Recycler recycler) { final View view = getChildAt(index); removeViewAt(index); recycler.recycleView(view); }
void function(int index, Recycler recycler) { final View view = getChildAt(index); removeViewAt(index); recycler.recycleView(view); }
/** * Remove a child view and recycle it using the given Recycler. * * @param index Index of child to remove and recycle * @param recycler Recycler to use to recycle child */
Remove a child view and recycle it using the given Recycler
removeAndRecycleViewAt
{ "repo_name": "devDavide/Decisiongram", "path": "TMessagesProj/src/main/java/org/telegram/messenger/support/widget/RecyclerView.java", "license": "gpl-2.0", "size": 438498 }
[ "android.view.View" ]
import android.view.View;
import android.view.*;
[ "android.view" ]
android.view;
659,838
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); }
void function(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); }
/** * Handles the HTTP <code>POST</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */
Handles the HTTP <code>POST</code> method
doPost
{ "repo_name": "CCSU-CS416F17/CS416F17CourseInfo", "path": "Lec22SecurityRealmDemos/src/java/edu/ccsu/controller/LogoutServlet.java", "license": "mit", "size": 2883 }
[ "java.io.IOException", "javax.servlet.ServletException", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse" ]
import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;
import java.io.*; import javax.servlet.*; import javax.servlet.http.*;
[ "java.io", "javax.servlet" ]
java.io; javax.servlet;
1,116,656
public void writeReport(EPlusBatch manager, ArrayList<String> header, ArrayList<ArrayList<String>> table);
void function(EPlusBatch manager, ArrayList<String> header, ArrayList<ArrayList<String>> table);
/** * Write report table to file * @param manager Simulation manager contains jobs and paths information * @param header Table header * @param table Table content */
Write report table to file
writeReport
{ "repo_name": "jeplus/jEPlus", "path": "src/main/java/jeplus/postproc/IFReportWriter.java", "license": "gpl-3.0", "size": 2351 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
247,880
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); }
void function(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); }
/** * Handles the HTTP <code>POST</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */
Handles the HTTP <code>POST</code> method
doPost
{ "repo_name": "ssledz/java-ee-fundamentals", "path": "servlet-tutorial/src/main/java/pl/softech/learning/servlet/basic/AsynServletExample.java", "license": "apache-2.0", "size": 4662 }
[ "java.io.IOException", "javax.servlet.ServletException", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse" ]
import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse;
import java.io.*; import javax.servlet.*; import javax.servlet.http.*;
[ "java.io", "javax.servlet" ]
java.io; javax.servlet;
1,447,413
ItemLabelPosition getNegativeItemLabelPosition(int row, int column);
ItemLabelPosition getNegativeItemLabelPosition(int row, int column);
/** * Returns the item label position for negative values. This method can be * overridden to provide customisation of the item label position for * individual data items. * * @param row the row index (zero-based). * @param column the column (zero-based). * * @return The item label position (never {@code null}). */
Returns the item label position for negative values. This method can be overridden to provide customisation of the item label position for individual data items
getNegativeItemLabelPosition
{ "repo_name": "jfree/jfreechart", "path": "src/main/java/org/jfree/chart/renderer/xy/XYItemRenderer.java", "license": "lgpl-2.1", "size": 49520 }
[ "org.jfree.chart.labels.ItemLabelPosition" ]
import org.jfree.chart.labels.ItemLabelPosition;
import org.jfree.chart.labels.*;
[ "org.jfree.chart" ]
org.jfree.chart;
1,704,016
public static boolean isWithinBoundary(Location location, String name) { for (Boundary boundary : boundaryForName(name)) { if (location.getZ() == boundary.getBottomLeft().getZ() && location.getZ() == boundary.getTopRight().getZ()) { if (location.getX() >= boundary.getBottomLeft().getX() && location.getX() <= boundary.getTopRight().getX() && location.getY() >= boundary.getBottomLeft().getY() && location.getY() <= boundary.getTopRight().getY()) { return true; } } } return false; }
static boolean function(Location location, String name) { for (Boundary boundary : boundaryForName(name)) { if (location.getZ() == boundary.getBottomLeft().getZ() && location.getZ() == boundary.getTopRight().getZ()) { if (location.getX() >= boundary.getBottomLeft().getX() && location.getX() <= boundary.getTopRight().getX() && location.getY() >= boundary.getBottomLeft().getY() && location.getY() <= boundary.getTopRight().getY()) { return true; } } } return false; }
/** * If a location is within a boundary. * * @param location * The location. * @param name * The boundary. * @return If the location is within a boundary. */
If a location is within a boundary
isWithinBoundary
{ "repo_name": "kewle003/hyperion", "path": "src/org/rs2server/rs2/boundary/BoundaryManager.java", "license": "mit", "size": 3010 }
[ "org.rs2server.rs2.model.Location" ]
import org.rs2server.rs2.model.Location;
import org.rs2server.rs2.model.*;
[ "org.rs2server.rs2" ]
org.rs2server.rs2;
263,600
private void forceNSDecls() { Enumeration<String> prefixes = forcedDeclTable.keys(); while (prefixes.hasMoreElements()) { String prefix = (String) prefixes.nextElement(); doPrefix(prefix, null, true); } }
void function() { Enumeration<String> prefixes = forcedDeclTable.keys(); while (prefixes.hasMoreElements()) { String prefix = (String) prefixes.nextElement(); doPrefix(prefix, null, true); } }
/** * Force all Namespaces to be declared. * <p> * This method is used on the root element to ensure that the predeclared * Namespaces all appear. */
Force all Namespaces to be declared. This method is used on the root element to ensure that the predeclared Namespaces all appear
forceNSDecls
{ "repo_name": "1gravity/Android-RTEditor", "path": "RTEditor/src/main/java/com/onegravity/rteditor/converter/tagsoup/HTMLWriter.java", "license": "apache-2.0", "size": 41140 }
[ "java.util.Enumeration" ]
import java.util.Enumeration;
import java.util.*;
[ "java.util" ]
java.util;
1,641,708
// Initialize TenantDataManager for tenant domains dropdown feature in SSO login page log.info("Initializing TenantDataManager for tenant domains dropdown"); TenantDataManager.init(); }
log.info(STR); TenantDataManager.init(); }
/** * Method for calling after context initialization * * @param servletContextEvent */
Method for calling after context initialization
contextInitialized
{ "repo_name": "omindu/carbon-identity", "path": "components/authentication-framework/org.wso2.carbon.identity.application.authentication.endpoint/src/main/java/org/wso2/carbon/identity/application/authentication/endpoint/listener/AuthenticationEndpointContextListener.java", "license": "apache-2.0", "size": 1988 }
[ "org.wso2.carbon.identity.application.authentication.endpoint.util.TenantDataManager" ]
import org.wso2.carbon.identity.application.authentication.endpoint.util.TenantDataManager;
import org.wso2.carbon.identity.application.authentication.endpoint.util.*;
[ "org.wso2.carbon" ]
org.wso2.carbon;
307,979
public Transform getTransform() { return transform; }
Transform function() { return transform; }
/** * Get the transformation that will occur on every point. * * <p>The transformation will stack with each repetition.</p> * * @return a transformation */
Get the transformation that will occur on every point. The transformation will stack with each repetition
getTransform
{ "repo_name": "HolodeckOne-Minecraft/WorldEdit", "path": "worldedit-core/src/main/java/com/sk89q/worldedit/function/operation/ForwardExtentCopy.java", "license": "gpl-3.0", "size": 11958 }
[ "com.sk89q.worldedit.math.transform.Transform" ]
import com.sk89q.worldedit.math.transform.Transform;
import com.sk89q.worldedit.math.transform.*;
[ "com.sk89q.worldedit" ]
com.sk89q.worldedit;
2,116,473
EAttribute getRampRateCurve_RampRateType();
EAttribute getRampRateCurve_RampRateType();
/** * Returns the meta object for the attribute '{@link CIM.IEC61970.Informative.MarketOperations.RampRateCurve#getRampRateType <em>Ramp Rate Type</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Ramp Rate Type</em>'. * @see CIM.IEC61970.Informative.MarketOperations.RampRateCurve#getRampRateType() * @see #getRampRateCurve() * @generated */
Returns the meta object for the attribute '<code>CIM.IEC61970.Informative.MarketOperations.RampRateCurve#getRampRateType Ramp Rate Type</code>'.
getRampRateCurve_RampRateType
{ "repo_name": "georghinkel/ttc2017smartGrids", "path": "solutions/ModelJoin/src/main/java/CIM/IEC61970/Informative/MarketOperations/MarketOperationsPackage.java", "license": "mit", "size": 688294 }
[ "org.eclipse.emf.ecore.EAttribute" ]
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
2,431,922
@Test public void testNodeWithPorts() { Map<String, String> nodeAttributes = new HashMap<String, String>(); Map<String, String> portAttributes = new HashMap<String, String>(); Map<String, Port> ports = new HashMap<String, Port>(); nodeAttributes.put("node_att123", "node_val123"); portAttributes.put("port_att123", "port_val123"); Port port = new Port("456", "port_id123", "node_id123", "out_link123", "in_link123", portAttributes); ports.put("port_id123", port); Node result = new Node("123", "node_id123", ports, nodeAttributes); assertThat(result, is(notNullValue())); assertThat(result.getId(), is("node_id123")); assertThat(result.getVersion(), is("123")); assertThat(result.getPortMap().get("port_id123").getType(), is("Port")); assertThat(result.getPortMap().get("port_id123").getVersion(), is("456")); assertThat(result.getPortMap().get("port_id123").getId(), is("port_id123")); assertThat(result.getPortMap().get("port_id123").getNode(), is("node_id123")); assertThat(result.getPortMap().get("port_id123").getOutLink(), is("out_link123")); assertThat(result.getPortMap().get("port_id123").getInLink(), is("in_link123")); assertThat( result.getPortMap().get("port_id123") .getAttribute("port_att123"), is("port_val123")); assertThat(result.getAttribute("node_att123"), is("node_val123")); } /** * Test method for * {@link org.o3project.odenos.core.component.network.topology.Node#Node(org.o3project.odenos.core.component.network.topology.Node)}
void function() { Map<String, String> nodeAttributes = new HashMap<String, String>(); Map<String, String> portAttributes = new HashMap<String, String>(); Map<String, Port> ports = new HashMap<String, Port>(); nodeAttributes.put(STR, STR); portAttributes.put(STR, STR); Port port = new Port("456", STR, STR, STR, STR, portAttributes); ports.put(STR, port); Node result = new Node("123", STR, ports, nodeAttributes); assertThat(result, is(notNullValue())); assertThat(result.getId(), is(STR)); assertThat(result.getVersion(), is("123")); assertThat(result.getPortMap().get(STR).getType(), is("Port")); assertThat(result.getPortMap().get(STR).getVersion(), is("456")); assertThat(result.getPortMap().get(STR).getId(), is(STR)); assertThat(result.getPortMap().get(STR).getNode(), is(STR)); assertThat(result.getPortMap().get(STR).getOutLink(), is(STR)); assertThat(result.getPortMap().get(STR).getInLink(), is(STR)); assertThat( result.getPortMap().get(STR) .getAttribute(STR), is(STR)); assertThat(result.getAttribute(STR), is(STR)); } /** * Test method for * {@link org.o3project.odenos.core.component.network.topology.Node#Node(org.o3project.odenos.core.component.network.topology.Node)}
/** * Test method for {@link * org.o3project.odenos.core.component.network.topology.Node#Node(java.lang.String, * java.lang.String, java.util.Map, java.util.Map)}. */
Test method for <code>org.o3project.odenos.core.component.network.topology.Node#Node(java.lang.String, java.lang.String, java.util.Map, java.util.Map)</code>
testNodeWithPorts
{ "repo_name": "haizawa/odenos", "path": "src/test/java/org/o3project/odenos/core/component/network/topology/NodeTest.java", "license": "apache-2.0", "size": 36700 }
[ "java.util.HashMap", "java.util.Map", "org.hamcrest.CoreMatchers", "org.junit.Assert", "org.junit.Test" ]
import java.util.HashMap; import java.util.Map; import org.hamcrest.CoreMatchers; import org.junit.Assert; import org.junit.Test;
import java.util.*; import org.hamcrest.*; import org.junit.*;
[ "java.util", "org.hamcrest", "org.junit" ]
java.util; org.hamcrest; org.junit;
2,691,548
public void destroy() { // The mOfflineModelObserver which implements SuggestionsOfflineModelObserver adds itself // as the offlinePageBridge's observer. Calling onDestroy() removes itself from subscribers. mOfflineModelObserver.onDestroy(); } // TODO(dgn): I would like to move that to TileRenderer, but setting the data on the tile, // notifying the observer and updating the tasks make it awkward. private class LargeIconCallbackImpl implements LargeIconBridge.LargeIconCallback { private final SiteSuggestion mSiteData; private final boolean mTrackLoadTask; private LargeIconCallbackImpl(SiteSuggestion suggestion, boolean trackLoadTask) { mSiteData = suggestion; mTrackLoadTask = trackLoadTask; }
void function() { mOfflineModelObserver.onDestroy(); } private class LargeIconCallbackImpl implements LargeIconBridge.LargeIconCallback { private final SiteSuggestion mSiteData; private final boolean mTrackLoadTask; private LargeIconCallbackImpl(SiteSuggestion suggestion, boolean trackLoadTask) { mSiteData = suggestion; mTrackLoadTask = trackLoadTask; }
/** * Called before this instance is abandoned to the garbage collector. */
Called before this instance is abandoned to the garbage collector
destroy
{ "repo_name": "ric2b/Vivaldi-browser", "path": "chromium/chrome/android/java/src/org/chromium/chrome/browser/suggestions/tile/TileGroup.java", "license": "bsd-3-clause", "size": 25781 }
[ "org.chromium.chrome.browser.suggestions.SiteSuggestion", "org.chromium.components.favicon.LargeIconBridge" ]
import org.chromium.chrome.browser.suggestions.SiteSuggestion; import org.chromium.components.favicon.LargeIconBridge;
import org.chromium.chrome.browser.suggestions.*; import org.chromium.components.favicon.*;
[ "org.chromium.chrome", "org.chromium.components" ]
org.chromium.chrome; org.chromium.components;
783,430
public boolean attackEntityFrom(DamageSource source, float amount) { if (this.isEntityInvulnerable(source)) { return false; } else { if ((source instanceof EntityDamageSource || source == DamageSource.magic) && this.summonSilverfish != null) { this.summonSilverfish.notifyHurt(); } return super.attackEntityFrom(source, amount); } }
boolean function(DamageSource source, float amount) { if (this.isEntityInvulnerable(source)) { return false; } else { if ((source instanceof EntityDamageSource source == DamageSource.magic) && this.summonSilverfish != null) { this.summonSilverfish.notifyHurt(); } return super.attackEntityFrom(source, amount); } }
/** * Called when the entity is attacked. */
Called when the entity is attacked
attackEntityFrom
{ "repo_name": "danielyc/test-1.9.4", "path": "build/tmp/recompileMc/sources/net/minecraft/entity/monster/EntitySilverfish.java", "license": "gpl-3.0", "size": 10779 }
[ "net.minecraft.util.DamageSource", "net.minecraft.util.EntityDamageSource" ]
import net.minecraft.util.DamageSource; import net.minecraft.util.EntityDamageSource;
import net.minecraft.util.*;
[ "net.minecraft.util" ]
net.minecraft.util;
2,453,727
public static String sendPostData(String urll, String text, String key) throws IOException { String write = URLEncoder.encode(key, "UTF-8") + "=" + URLEncoder.encode(text, "UTF-8"); StringBuilder response = null; URL url = new URL(urll); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("POST"); connection.setRequestProperty("User-Agent", App.settings.getUserAgent()); connection.setRequestProperty("Cache-Control", "no-store,max-age=0,no-cache"); connection.setRequestProperty("Expires", "0"); connection.setRequestProperty("Pragma", "no-cache"); connection.setRequestProperty("Content-Length", "" + write.getBytes().length); connection.setUseCaches(false); connection.setDoInput(true); connection.setDoOutput(true); DataOutputStream writer = new DataOutputStream(connection.getOutputStream()); writer.write(write.getBytes()); writer.flush(); writer.close(); // Read the result BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); response = new StringBuilder(); String line; while ((line = reader.readLine()) != null) { response.append(line); response.append('\r'); } reader.close(); return response.toString(); }
static String function(String urll, String text, String key) throws IOException { String write = URLEncoder.encode(key, "UTF-8") + "=" + URLEncoder.encode(text, "UTF-8"); StringBuilder response = null; URL url = new URL(urll); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("POST"); connection.setRequestProperty(STR, App.settings.getUserAgent()); connection.setRequestProperty(STR, STR); connection.setRequestProperty(STR, "0"); connection.setRequestProperty(STR, STR); connection.setRequestProperty(STR, "" + write.getBytes().length); connection.setUseCaches(false); connection.setDoInput(true); connection.setDoOutput(true); DataOutputStream writer = new DataOutputStream(connection.getOutputStream()); writer.write(write.getBytes()); writer.flush(); writer.close(); BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); response = new StringBuilder(); String line; while ((line = reader.readLine()) != null) { response.append(line); response.append('\r'); } reader.close(); return response.toString(); }
/** * Send post data. * * @param urll the urll * @param text the text * @param key the key * @return the string * @throws IOException Signals that an I/O exception has occurred. */
Send post data
sendPostData
{ "repo_name": "iarspider/JULauncher", "path": "src/main/java/com/julauncher/utils/Utils.java", "license": "gpl-3.0", "size": 72785 }
[ "com.julauncher.App", "java.io.BufferedReader", "java.io.DataOutputStream", "java.io.IOException", "java.io.InputStreamReader", "java.net.HttpURLConnection", "java.net.URLEncoder" ]
import com.julauncher.App; import java.io.BufferedReader; import java.io.DataOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URLEncoder;
import com.julauncher.*; import java.io.*; import java.net.*;
[ "com.julauncher", "java.io", "java.net" ]
com.julauncher; java.io; java.net;
1,065,664
public static final ImageAnnotatorClient create(ImageAnnotatorSettings settings) throws IOException { return new ImageAnnotatorClient(settings); }
static final ImageAnnotatorClient function(ImageAnnotatorSettings settings) throws IOException { return new ImageAnnotatorClient(settings); }
/** * Constructs an instance of ImageAnnotatorClient, using the given settings. The channels are * created based on the settings passed in, or defaults for any settings that are not set. */
Constructs an instance of ImageAnnotatorClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set
create
{ "repo_name": "pongad/api-client-staging", "path": "generated/java/gapic-google-cloud-vision-v1p1beta1/src/main/java/com/google/cloud/vision/v1p1beta1/ImageAnnotatorClient.java", "license": "bsd-3-clause", "size": 9241 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,915,987
public HttpResponseMessageImpl getResponse() { HttpResponseMessageImpl resp = (HttpResponseMessageImpl) this.respPool.get(); if (null == resp) { resp = new HttpResponseMessageImpl(); } if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "getResponse(): " + resp); } return resp; }
HttpResponseMessageImpl function() { HttpResponseMessageImpl resp = (HttpResponseMessageImpl) this.respPool.get(); if (null == resp) { resp = new HttpResponseMessageImpl(); } if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, STR + resp); } return resp; }
/** * Retrieve an uninitialized response message. * * @return HttpResponseMessageImpl */
Retrieve an uninitialized response message
getResponse
{ "repo_name": "OpenLiberty/open-liberty", "path": "dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpObjectFactory.java", "license": "epl-1.0", "size": 5951 }
[ "com.ibm.websphere.ras.Tr", "com.ibm.websphere.ras.TraceComponent" ]
import com.ibm.websphere.ras.Tr; import com.ibm.websphere.ras.TraceComponent;
import com.ibm.websphere.ras.*;
[ "com.ibm.websphere" ]
com.ibm.websphere;
325,415
public void readObjectData(ObjectInputStream stream) throws ClassNotFoundException, IOException { readObject(stream); }
void function(ObjectInputStream stream) throws ClassNotFoundException, IOException { readObject(stream); }
/** * Read a serialized version of the contents of this session object from * the specified object input stream, without requiring that the * StandardSession itself have been serialized. * * @param stream The object input stream to read from * * @exception ClassNotFoundException if an unknown class is specified * @exception IOException if an input/output error occurs */
Read a serialized version of the contents of this session object from the specified object input stream, without requiring that the StandardSession itself have been serialized
readObjectData
{ "repo_name": "yuyupapa/OpenSource", "path": "apache-tomcat-6.0.48/java/org/apache/catalina/session/StandardSession.java", "license": "apache-2.0", "size": 60890 }
[ "java.io.IOException", "java.io.ObjectInputStream" ]
import java.io.IOException; import java.io.ObjectInputStream;
import java.io.*;
[ "java.io" ]
java.io;
2,654,170
public List<ChartRow> getSortedRows() { List<ChartRow> list = new ArrayList<>(rows.values()); Collections.sort(list); return list; }
List<ChartRow> function() { List<ChartRow> list = new ArrayList<>(rows.values()); Collections.sort(list); return list; }
/** * Returns the {@link ChartRow}s, sorted by their index. */
Returns the <code>ChartRow</code>s, sorted by their index
getSortedRows
{ "repo_name": "vt09/bazel", "path": "src/main/java/com/google/devtools/build/lib/profiler/chart/Chart.java", "license": "apache-2.0", "size": 6203 }
[ "java.util.ArrayList", "java.util.Collections", "java.util.List" ]
import java.util.ArrayList; import java.util.Collections; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,745,693
synchronized void setEnabledExtensions(Context context, @NonNull List<ComponentName> extensions) { Set<ComponentName> extensionsToEnable = new HashSet<>(extensions); boolean isChanged = false; // disable removed extensions for (ComponentName extension : enabledExtensions(context)) { if (!extensionsToEnable.contains(extension)) { // disable extension disableExtension(context, extension); isChanged = true; } // no need to enable, is already enabled extensionsToEnable.remove(extension); } // enable added extensions for (ComponentName extension : extensionsToEnable) { enableExtension(context, extension); isChanged = true; } // always save because just the order might have changed enabledExtensions = new ArrayList<>(extensions); saveSubscriptions(context); if (isChanged) { // clear actions cache so loaders will request new actions sEpisodeActionsCache.evictAll(); sMovieActionsCache.evictAll(); } }
synchronized void setEnabledExtensions(Context context, @NonNull List<ComponentName> extensions) { Set<ComponentName> extensionsToEnable = new HashSet<>(extensions); boolean isChanged = false; for (ComponentName extension : enabledExtensions(context)) { if (!extensionsToEnable.contains(extension)) { disableExtension(context, extension); isChanged = true; } extensionsToEnable.remove(extension); } for (ComponentName extension : extensionsToEnable) { enableExtension(context, extension); isChanged = true; } enabledExtensions = new ArrayList<>(extensions); saveSubscriptions(context); if (isChanged) { sEpisodeActionsCache.evictAll(); sMovieActionsCache.evictAll(); } }
/** * Compares the list of currently enabled extensions with the given list and enables added * extensions and disables removed extensions. */
Compares the list of currently enabled extensions with the given list and enables added extensions and disables removed extensions
setEnabledExtensions
{ "repo_name": "UweTrottmann/SeriesGuide", "path": "app/src/main/java/com/battlelancer/seriesguide/extensions/ExtensionManager.java", "license": "apache-2.0", "size": 22140 }
[ "android.content.ComponentName", "android.content.Context", "androidx.annotation.NonNull", "java.util.ArrayList", "java.util.HashSet", "java.util.List", "java.util.Set" ]
import android.content.ComponentName; import android.content.Context; import androidx.annotation.NonNull; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set;
import android.content.*; import androidx.annotation.*; import java.util.*;
[ "android.content", "androidx.annotation", "java.util" ]
android.content; androidx.annotation; java.util;
805,113
public static void main(final String[] args) throws IOException { startServer(); }
static void function(final String[] args) throws IOException { startServer(); }
/** * Application main entry point. * @param args command line arguments. * @throws IOException if there are problems reading logging properties */
Application main entry point
main
{ "repo_name": "sumeetchhetri/FrameworkBenchmarks", "path": "frameworks/Java/helidon/src/main/java/io/helidon/benchmark/Main.java", "license": "bsd-3-clause", "size": 4845 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,017,738
public Instance getMachineInstance(String workspaceId, String machineId) throws NotFoundException, ServerException { requireNonNull(workspaceId, "Required non-null workspace id"); requireNonNull(machineId, "Required non-null machine id"); workspaceDao.get(workspaceId); return runtimes.getMachine(workspaceId, machineId); }
Instance function(String workspaceId, String machineId) throws NotFoundException, ServerException { requireNonNull(workspaceId, STR); requireNonNull(machineId, STR); workspaceDao.get(workspaceId); return runtimes.getMachine(workspaceId, machineId); }
/** * Retrieves machine instance that allows to execute commands in a machine. * * @param workspaceId * ID of workspace that owns machine * @param machineId * ID of requested machine * @return instance of requested machine * @throws NotFoundException * if workspace is not running * @throws NotFoundException * if machine is not found in the workspace */
Retrieves machine instance that allows to execute commands in a machine
getMachineInstance
{ "repo_name": "cdietrich/che", "path": "wsmaster/che-core-api-workspace/src/main/java/org/eclipse/che/api/workspace/server/WorkspaceManager.java", "license": "epl-1.0", "size": 39684 }
[ "java.util.Objects", "org.eclipse.che.api.core.NotFoundException", "org.eclipse.che.api.core.ServerException", "org.eclipse.che.api.machine.server.spi.Instance" ]
import java.util.Objects; import org.eclipse.che.api.core.NotFoundException; import org.eclipse.che.api.core.ServerException; import org.eclipse.che.api.machine.server.spi.Instance;
import java.util.*; import org.eclipse.che.api.core.*; import org.eclipse.che.api.machine.server.spi.*;
[ "java.util", "org.eclipse.che" ]
java.util; org.eclipse.che;
1,808,062
@Message(id = 11421, value = "Cannot change input stream reference.") IllegalArgumentException cannotChangeInputStream();
@Message(id = 11421, value = STR) IllegalArgumentException cannotChangeInputStream();
/** * Creates an exception indicating the input stream reference cannot be changed. * * @return an {@link IllegalArgumentException} for the error. */
Creates an exception indicating the input stream reference cannot be changed
cannotChangeInputStream
{ "repo_name": "jipijapa/jipijapa", "path": "hibernate4_1/src/main/java/org/jboss/as/jpa/hibernate4/JpaMessages.java", "license": "apache-2.0", "size": 2955 }
[ "org.jboss.logging.annotations.Message" ]
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.*;
[ "org.jboss.logging" ]
org.jboss.logging;
2,830,381
public void showSettingsAlert() { AlertDialog.Builder alertDialog = new AlertDialog.Builder(mContext); // Setting Dialog Title alertDialog.setTitle("GPS is settings"); // Setting Dialog Message alertDialog.setMessage("GPS is not enabled. Do you want to go to settings menu?"); // Setting Icon to Dialog //alertDialog.setIcon(R.drawable.delete);
void function() { AlertDialog.Builder alertDialog = new AlertDialog.Builder(mContext); alertDialog.setTitle(STR); alertDialog.setMessage(STR);
/** * Function to show settings alert dialog */
Function to show settings alert dialog
showSettingsAlert
{ "repo_name": "sidd4698/DrunkDriveDetection", "path": "DrunkDrive/app/src/main/java/drunkdrive/siddesh/drunkdrive/GPSTracker.java", "license": "apache-2.0", "size": 5907 }
[ "android.app.AlertDialog" ]
import android.app.AlertDialog;
import android.app.*;
[ "android.app" ]
android.app;
56,020
@Test void testPoint() throws Exception { Point geometry = createPoint(); System.out.println("Testing " + geometry.toText()); String jsonStr = getObjectMapper().writerWithDefaultPrettyPrinter() .writeValueAsString(geometry); System.out.println(jsonStr); Point readGeometry = getObjectMapper().readValue(jsonStr, Point.class); assertTrue(GeometryUtils.equals(geometry, readGeometry)); GeometryWrapper gjg = new GeometryWrapper(geometry); jsonStr = getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(gjg); System.out.println(jsonStr); GeometryWrapper readGjg = getObjectMapper().readValue(jsonStr, GeometryWrapper.class); assertEquals(gjg, readGjg); assertTrue(GeometryUtils.equals(geometry, readGjg.getGeometry())); }
void testPoint() throws Exception { Point geometry = createPoint(); System.out.println(STR + geometry.toText()); String jsonStr = getObjectMapper().writerWithDefaultPrettyPrinter() .writeValueAsString(geometry); System.out.println(jsonStr); Point readGeometry = getObjectMapper().readValue(jsonStr, Point.class); assertTrue(GeometryUtils.equals(geometry, readGeometry)); GeometryWrapper gjg = new GeometryWrapper(geometry); jsonStr = getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(gjg); System.out.println(jsonStr); GeometryWrapper readGjg = getObjectMapper().readValue(jsonStr, GeometryWrapper.class); assertEquals(gjg, readGjg); assertTrue(GeometryUtils.equals(geometry, readGjg.getGeometry())); }
/** * Test point. * * @throws Exception the exception */
Test point
testPoint
{ "repo_name": "bremersee/geojson", "path": "geojson/src/test/java/org/bremersee/geojson/GeoJsonTests.java", "license": "apache-2.0", "size": 20930 }
[ "org.bremersee.geojson.utils.GeometryUtils", "org.junit.jupiter.api.Assertions", "org.locationtech.jts.geom.Point" ]
import org.bremersee.geojson.utils.GeometryUtils; import org.junit.jupiter.api.Assertions; import org.locationtech.jts.geom.Point;
import org.bremersee.geojson.utils.*; import org.junit.jupiter.api.*; import org.locationtech.jts.geom.*;
[ "org.bremersee.geojson", "org.junit.jupiter", "org.locationtech.jts" ]
org.bremersee.geojson; org.junit.jupiter; org.locationtech.jts;
2,266,675
private void houseKeepStats(List<XYDataItem> stats) { while (stats.size() > maxSeries) { stats.remove(0); } }
void function(List<XYDataItem> stats) { while (stats.size() > maxSeries) { stats.remove(0); } }
/** * House keep stats. * * @param stats the stats */
House keep stats
houseKeepStats
{ "repo_name": "dougwm/psi-probe", "path": "core/src/main/java/psiprobe/beans/stats/collectors/AbstractStatsCollectorBean.java", "license": "gpl-2.0", "size": 7145 }
[ "java.util.List", "org.jfree.data.xy.XYDataItem" ]
import java.util.List; import org.jfree.data.xy.XYDataItem;
import java.util.*; import org.jfree.data.xy.*;
[ "java.util", "org.jfree.data" ]
java.util; org.jfree.data;
675,358
protected String getModelManagerId() { if (xmlModelId == null) { IFile file = WorkbenchResourceHelper.getFile(getResource()); if (file != null) { xmlModelId = getModelManager().calculateId(file); } else { xmlModelId = resource.getURI() + Long.toString(System.currentTimeMillis()); } } return xmlModelId; }
String function() { if (xmlModelId == null) { IFile file = WorkbenchResourceHelper.getFile(getResource()); if (file != null) { xmlModelId = getModelManager().calculateId(file); } else { xmlModelId = resource.getURI() + Long.toString(System.currentTimeMillis()); } } return xmlModelId; }
/** * Return id used to key the XML resource in the XML ModelManager. */
Return id used to key the XML resource in the XML ModelManager
getModelManagerId
{ "repo_name": "ttimbul/eclipse.wst", "path": "bundles/org.eclipse.wst.xml.core/src-emfModelSynch/org/eclipse/wst/xml/core/internal/emf2xml/EMF2DOMSSERenderer.java", "license": "epl-1.0", "size": 19501 }
[ "org.eclipse.core.resources.IFile", "org.eclipse.wst.common.internal.emfworkbench.WorkbenchResourceHelper" ]
import org.eclipse.core.resources.IFile; import org.eclipse.wst.common.internal.emfworkbench.WorkbenchResourceHelper;
import org.eclipse.core.resources.*; import org.eclipse.wst.common.internal.emfworkbench.*;
[ "org.eclipse.core", "org.eclipse.wst" ]
org.eclipse.core; org.eclipse.wst;
1,442,632
private void populateResultsBox(IVScanResult ivScanResult) { ivScanResult.sortCombinations(); populateResultsHeader(ivScanResult); if (ivScanResult.getCount() == 1) { populateSingleIVMatch(ivScanResult); } else { // More than a match populateMultipleIVMatch(ivScanResult); } setResultScreenPercentageRange(ivScanResult); //color codes the result adjustSeekbarsThumbs(); populateAdvancedInformation(ivScanResult); populatePrevScanNarrowing(); }
void function(IVScanResult ivScanResult) { ivScanResult.sortCombinations(); populateResultsHeader(ivScanResult); if (ivScanResult.getCount() == 1) { populateSingleIVMatch(ivScanResult); } else { populateMultipleIVMatch(ivScanResult); } setResultScreenPercentageRange(ivScanResult); adjustSeekbarsThumbs(); populateAdvancedInformation(ivScanResult); populatePrevScanNarrowing(); }
/** * Sets all the information in the result box. */
Sets all the information in the result box
populateResultsBox
{ "repo_name": "sarav/GoIV", "path": "app/src/main/java/com/kamron/pogoiv/Pokefly.java", "license": "gpl-3.0", "size": 57718 }
[ "com.kamron.pogoiv.logic.IVScanResult" ]
import com.kamron.pogoiv.logic.IVScanResult;
import com.kamron.pogoiv.logic.*;
[ "com.kamron.pogoiv" ]
com.kamron.pogoiv;
143,483
public Builder zeroCouponInflationNodeIds(final Map<Tenor, CurveInstrumentProvider> zeroCouponInflationNodeIds) { _zeroCouponInflationNodeIds = zeroCouponInflationNodeIds; return this; }
Builder function(final Map<Tenor, CurveInstrumentProvider> zeroCouponInflationNodeIds) { _zeroCouponInflationNodeIds = zeroCouponInflationNodeIds; return this; }
/** * Curve instrument providers for zero coupon inflation nodes * @param zeroCouponInflationNodeIds the zeroCouponInflationNodeIds * @return this */
Curve instrument providers for zero coupon inflation nodes
zeroCouponInflationNodeIds
{ "repo_name": "ChinaQuants/OG-Platform", "path": "projects/OG-Financial/src/main/java/com/opengamma/financial/analytics/curve/CurveNodeIdMapper.java", "license": "apache-2.0", "size": 64618 }
[ "com.opengamma.financial.analytics.ircurve.CurveInstrumentProvider", "com.opengamma.util.time.Tenor", "java.util.Map" ]
import com.opengamma.financial.analytics.ircurve.CurveInstrumentProvider; import com.opengamma.util.time.Tenor; import java.util.Map;
import com.opengamma.financial.analytics.ircurve.*; import com.opengamma.util.time.*; import java.util.*;
[ "com.opengamma.financial", "com.opengamma.util", "java.util" ]
com.opengamma.financial; com.opengamma.util; java.util;
2,499,851
@XmlElementRef(required = false) public void setInput(FromDefinition input) { if (this.input != null && input != null && this.input != input) { throw new IllegalArgumentException("Only one input is allowed per route. Cannot accept input: " + input); } // required = false: in rest-dsl you can embed an in-lined route which // does not have a <from> as its implied to be the rest endpoint this.input = input; }
@XmlElementRef(required = false) void function(FromDefinition input) { if (this.input != null && input != null && this.input != input) { throw new IllegalArgumentException(STR + input); } this.input = input; }
/** * Input to the route. */
Input to the route
setInput
{ "repo_name": "nikhilvibhav/camel", "path": "core/camel-core-model/src/main/java/org/apache/camel/model/RouteDefinition.java", "license": "apache-2.0", "size": 31689 }
[ "javax.xml.bind.annotation.XmlElementRef" ]
import javax.xml.bind.annotation.XmlElementRef;
import javax.xml.bind.annotation.*;
[ "javax.xml" ]
javax.xml;
263,216
StatusBackingStore statusBackingStore();
StatusBackingStore statusBackingStore();
/** * Return a reference to the status backing store used by this herder. * * @return the status backing store used by this herder */
Return a reference to the status backing store used by this herder
statusBackingStore
{ "repo_name": "TiVo/kafka", "path": "connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Herder.java", "license": "apache-2.0", "size": 12231 }
[ "org.apache.kafka.connect.storage.StatusBackingStore" ]
import org.apache.kafka.connect.storage.StatusBackingStore;
import org.apache.kafka.connect.storage.*;
[ "org.apache.kafka" ]
org.apache.kafka;
1,723,157
private boolean override() { return Bits.get(flags, OVERRIDE_BIT); }
boolean function() { return Bits.get(flags, OVERRIDE_BIT); }
/** * Override is hiding in the 6 bit of the flags. */
Override is hiding in the 6 bit of the flags
override
{ "repo_name": "rac021/blazegraph_1_5_3_cluster_2_nodes", "path": "bigdata-rdf/src/java/com/bigdata/rdf/spo/SPO.java", "license": "gpl-2.0", "size": 23463 }
[ "com.bigdata.util.Bits" ]
import com.bigdata.util.Bits;
import com.bigdata.util.*;
[ "com.bigdata.util" ]
com.bigdata.util;
1,898,887
public void init(Map<String, String> configParams) throws FloodlightModuleException { this.moduleLoaderState = ModuleLoaderState.INIT; // These data structures are initialized here because other // module's startUp() might be called before ours this.messageListeners = new ConcurrentHashMap<OFType, ListenerDispatcher<OFType, IOFMessageListener>>(); this.haListeners = new ListenerDispatcher<HAListenerTypeMarker, IHAListener>(); this.controllerNodeIPsCache = new HashMap<String, String>(); this.updates = new LinkedBlockingQueue<IUpdate>(); this.providerMap = new HashMap<String, List<IInfoProvider>>(); setConfigParams(configParams); HARole initialRole = getInitialRole(configParams); this.notifiedRole = initialRole; this.shutdownService = new ShutdownServiceImpl(); this.roleManager = new RoleManager(this, this.shutdownService, this.notifiedRole, INITIAL_ROLE_CHANGE_DESCRIPTION); this.timer = new HashedWheelTimer(); // Switch Service Startup this.switchService.registerLogicalOFMessageCategory(LogicalOFMessageCategory.MAIN); this.switchService.addOFSwitchListener(new NotificationSwitchListener()); this.counters = new ControllerCounters(debugCounterService); }
void function(Map<String, String> configParams) throws FloodlightModuleException { this.moduleLoaderState = ModuleLoaderState.INIT; this.messageListeners = new ConcurrentHashMap<OFType, ListenerDispatcher<OFType, IOFMessageListener>>(); this.haListeners = new ListenerDispatcher<HAListenerTypeMarker, IHAListener>(); this.controllerNodeIPsCache = new HashMap<String, String>(); this.updates = new LinkedBlockingQueue<IUpdate>(); this.providerMap = new HashMap<String, List<IInfoProvider>>(); setConfigParams(configParams); HARole initialRole = getInitialRole(configParams); this.notifiedRole = initialRole; this.shutdownService = new ShutdownServiceImpl(); this.roleManager = new RoleManager(this, this.shutdownService, this.notifiedRole, INITIAL_ROLE_CHANGE_DESCRIPTION); this.timer = new HashedWheelTimer(); this.switchService.registerLogicalOFMessageCategory(LogicalOFMessageCategory.MAIN); this.switchService.addOFSwitchListener(new NotificationSwitchListener()); this.counters = new ControllerCounters(debugCounterService); }
/** * Initialize internal data structures */
Initialize internal data structures
init
{ "repo_name": "JinWenQiang/FloodlightController", "path": "src/main/java/net/floodlightcontroller/core/internal/Controller.java", "license": "apache-2.0", "size": 39344 }
[ "java.util.HashMap", "java.util.List", "java.util.Map", "java.util.concurrent.ConcurrentHashMap", "java.util.concurrent.LinkedBlockingQueue", "net.floodlightcontroller.core.HAListenerTypeMarker", "net.floodlightcontroller.core.HARole", "net.floodlightcontroller.core.IHAListener", "net.floodlightcont...
import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.LinkedBlockingQueue; import net.floodlightcontroller.core.HAListenerTypeMarker; import net.floodlightcontroller.core.HARole; import net.floodlightcontroller.core.IHAListener; import net.floodlightcontroller.core.IInfoProvider; import net.floodlightcontroller.core.IOFMessageListener; import net.floodlightcontroller.core.LogicalOFMessageCategory; import net.floodlightcontroller.core.module.FloodlightModuleException; import net.floodlightcontroller.core.util.ListenerDispatcher; import org.jboss.netty.util.HashedWheelTimer; import org.projectfloodlight.openflow.protocol.OFType;
import java.util.*; import java.util.concurrent.*; import net.floodlightcontroller.core.*; import net.floodlightcontroller.core.module.*; import net.floodlightcontroller.core.util.*; import org.jboss.netty.util.*; import org.projectfloodlight.openflow.protocol.*;
[ "java.util", "net.floodlightcontroller.core", "org.jboss.netty", "org.projectfloodlight.openflow" ]
java.util; net.floodlightcontroller.core; org.jboss.netty; org.projectfloodlight.openflow;
151,723
@PUT @Path("{calendarId}/" + CalendarResourceURIs.CALENDAR_EVENT_URI_PART + "/{eventId}/" + CalendarResourceURIs.CALENDAR_EVENT_OCCURRENCE_URI_PART + "/{occurrenceId}/" + CalendarResourceURIs.CALENDAR_EVENT_ATTENDEE_URI_PART + "/{attendeeId}") @Produces(MediaType.APPLICATION_JSON) public CalendarEventEntity updateEventAttendeeParticipation( @PathParam("calendarId") String calendarId, @PathParam("eventId") String eventId, @PathParam("occurrenceId") String occurrenceId, @PathParam("attendeeId") String attendeeId, CalendarEventAttendeeAnswerEntity answerEntity) { if(StringUtil.isLong(attendeeId) && !getUser().getId().equals(attendeeId)) { throw new WebApplicationException(FORBIDDEN); } final Calendar originalCalendar = Calendar.getById(calendarId); final CalendarEvent event = CalendarEvent.getById(eventId); final CalendarEventOccurrence occurrence = CalendarEventOccurrence.getById(decodeId(occurrenceId)).orElse(null); assertDataConsistency(originalCalendar.getComponentInstanceId(), originalCalendar, event, occurrence); answerEntity.setId(attendeeId); CalendarEvent updatedEvent = process(() -> getCalendarWebManager() .updateOccurrenceAttendeeParticipation(occurrence, answerEntity.getId(), answerEntity.getParticipationStatus(), answerEntity.getAnswerMethodType(), getZoneId())) .lowestAccessRole(null) .execute(); return updatedEvent != null ? asEventWebEntity(updatedEvent) : null; }
@Path(STR + CalendarResourceURIs.CALENDAR_EVENT_URI_PART + STR + CalendarResourceURIs.CALENDAR_EVENT_OCCURRENCE_URI_PART + STR + CalendarResourceURIs.CALENDAR_EVENT_ATTENDEE_URI_PART + STR) @Produces(MediaType.APPLICATION_JSON) CalendarEventEntity function( @PathParam(STR) String calendarId, @PathParam(STR) String eventId, @PathParam(STR) String occurrenceId, @PathParam(STR) String attendeeId, CalendarEventAttendeeAnswerEntity answerEntity) { if(StringUtil.isLong(attendeeId) && !getUser().getId().equals(attendeeId)) { throw new WebApplicationException(FORBIDDEN); } final Calendar originalCalendar = Calendar.getById(calendarId); final CalendarEvent event = CalendarEvent.getById(eventId); final CalendarEventOccurrence occurrence = CalendarEventOccurrence.getById(decodeId(occurrenceId)).orElse(null); assertDataConsistency(originalCalendar.getComponentInstanceId(), originalCalendar, event, occurrence); answerEntity.setId(attendeeId); CalendarEvent updatedEvent = process(() -> getCalendarWebManager() .updateOccurrenceAttendeeParticipation(occurrence, answerEntity.getId(), answerEntity.getParticipationStatus(), answerEntity.getAnswerMethodType(), getZoneId())) .lowestAccessRole(null) .execute(); return updatedEvent != null ? asEventWebEntity(updatedEvent) : null; }
/** * Updates the participation status of an attendee about an event.<br> If the user isn't * authenticated, a 401 HTTP code is returned. If the user isn't authorized to save the calendar, * a 403 is returned. If a problem occurs when processing the request, a 503 HTTP code is * returned. * @param calendarId the identifier of calendar the event must belong with * @param eventId the identifier of event * @param attendeeId the identifier of the attendee belonging the event * @param answerEntity the new participation status with all needed data to save it. * @return the response to the HTTP POST request with the JSON representation of the * updated/created events. */
Updates the participation status of an attendee about an event. If the user isn't authenticated, a 401 HTTP code is returned. If the user isn't authorized to save the calendar, a 403 is returned. If a problem occurs when processing the request, a 503 HTTP code is returned
updateEventAttendeeParticipation
{ "repo_name": "SilverDav/Silverpeas-Core", "path": "core-web/src/main/java/org/silverpeas/core/webapi/calendar/CalendarResource.java", "license": "agpl-3.0", "size": 37935 }
[ "javax.ws.rs.Path", "javax.ws.rs.PathParam", "javax.ws.rs.Produces", "javax.ws.rs.WebApplicationException", "javax.ws.rs.core.MediaType", "org.silverpeas.core.calendar.Calendar", "org.silverpeas.core.calendar.CalendarEvent", "org.silverpeas.core.calendar.CalendarEventOccurrence", "org.silverpeas.cor...
import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; import org.silverpeas.core.calendar.Calendar; import org.silverpeas.core.calendar.CalendarEvent; import org.silverpeas.core.calendar.CalendarEventOccurrence; import org.silverpeas.core.util.StringUtil; import org.silverpeas.core.webapi.calendar.CalendarWebManager;
import javax.ws.rs.*; import javax.ws.rs.core.*; import org.silverpeas.core.calendar.*; import org.silverpeas.core.util.*; import org.silverpeas.core.webapi.calendar.*;
[ "javax.ws", "org.silverpeas.core" ]
javax.ws; org.silverpeas.core;
520,765
public Style getStyle() { return style; }
Style function() { return style; }
/** * Getter for the style. * * @return the style of this table. */
Getter for the style
getStyle
{ "repo_name": "tghoward/geopaparazzi", "path": "geopaparazzispatialitelibrary/src/eu/geopaparazzi/spatialite/database/spatial/core/tables/SpatialVectorTable.java", "license": "gpl-3.0", "size": 19712 }
[ "eu.geopaparazzi.library.style.Style" ]
import eu.geopaparazzi.library.style.Style;
import eu.geopaparazzi.library.style.*;
[ "eu.geopaparazzi.library" ]
eu.geopaparazzi.library;
1,113,169
protected Guid createTask(Guid taskId, AsyncTaskCreationInfo asyncTaskCreationInfo, VdcActionType parentCommand) { return createTask(taskId, asyncTaskCreationInfo, parentCommand, null, // The reason Collections.emptyMap is not used here as // the map should be mutable new HashMap<Guid, VdcObjectType>()); }
Guid function(Guid taskId, AsyncTaskCreationInfo asyncTaskCreationInfo, VdcActionType parentCommand) { return createTask(taskId, asyncTaskCreationInfo, parentCommand, null, new HashMap<Guid, VdcObjectType>()); }
/** * Use this method in order to create task in the CommandCoordinatorUtil in a safe way. If you use this method within a * certain command, make sure that the command implemented the ConcreteCreateTask method. * * @param taskId * if of task to create * @param asyncTaskCreationInfo * info to send to CommandCoordinatorUtil when creating the task. * @param parentCommand * VdcActionType of the command that its endAction we want to invoke when tasks are finished. * @return Guid of the created task. */
Use this method in order to create task in the CommandCoordinatorUtil in a safe way. If you use this method within a certain command, make sure that the command implemented the ConcreteCreateTask method
createTask
{ "repo_name": "walteryang47/ovirt-engine", "path": "backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java", "license": "apache-2.0", "size": 103472 }
[ "java.util.HashMap", "org.ovirt.engine.core.common.VdcObjectType", "org.ovirt.engine.core.common.action.VdcActionType", "org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo", "org.ovirt.engine.core.compat.Guid" ]
import java.util.HashMap; import org.ovirt.engine.core.common.VdcObjectType; import org.ovirt.engine.core.common.action.VdcActionType; import org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo; import org.ovirt.engine.core.compat.Guid;
import java.util.*; import org.ovirt.engine.core.common.*; import org.ovirt.engine.core.common.action.*; import org.ovirt.engine.core.common.asynctasks.*; import org.ovirt.engine.core.compat.*;
[ "java.util", "org.ovirt.engine" ]
java.util; org.ovirt.engine;
2,904,059
@Override public boolean cacheWriteBeforeDestroy(EntryEventImpl event, Object expectedOldValue) throws CacheWriterException, EntryNotFoundException, TimeoutException { // return if notifications are inhibited if (event.inhibitAllNotifications()) { if (logger.isDebugEnabled()) { logger.debug("Notification inhibited for key {}", event.getKey()); } return false; } if (event.isDistributed()) { serverDestroy(event, expectedOldValue); CacheWriter localWriter = basicGetWriter(); Set netWriteRecipients = localWriter == null ? this.distAdvisor.adviseNetWrite() : null; if (localWriter == null && (netWriteRecipients == null || netWriteRecipients.isEmpty())) { return false; } final long start = getCachePerfStats().startCacheWriterCall(); try { event.setOldValueFromRegion(); SearchLoadAndWriteProcessor processor = SearchLoadAndWriteProcessor.getProcessor(); processor.initialize(this, event.getKey(), null); processor.doNetWrite(event, netWriteRecipients, localWriter, SearchLoadAndWriteProcessor.BEFOREDESTROY); processor.release(); } finally { getCachePerfStats().endCacheWriterCall(start); } return true; } return false; }
boolean function(EntryEventImpl event, Object expectedOldValue) throws CacheWriterException, EntryNotFoundException, TimeoutException { if (event.inhibitAllNotifications()) { if (logger.isDebugEnabled()) { logger.debug(STR, event.getKey()); } return false; } if (event.isDistributed()) { serverDestroy(event, expectedOldValue); CacheWriter localWriter = basicGetWriter(); Set netWriteRecipients = localWriter == null ? this.distAdvisor.adviseNetWrite() : null; if (localWriter == null && (netWriteRecipients == null netWriteRecipients.isEmpty())) { return false; } final long start = getCachePerfStats().startCacheWriterCall(); try { event.setOldValueFromRegion(); SearchLoadAndWriteProcessor processor = SearchLoadAndWriteProcessor.getProcessor(); processor.initialize(this, event.getKey(), null); processor.doNetWrite(event, netWriteRecipients, localWriter, SearchLoadAndWriteProcessor.BEFOREDESTROY); processor.release(); } finally { getCachePerfStats().endCacheWriterCall(start); } return true; } return false; }
/** * Invoke the CacheWriter before the detroy operation occurs. Each BucketRegion delegates to the * CacheWriter on the PartitionedRegion meaning that CacheWriters on a BucketRegion should only be * used for internal purposes. * * @see BucketRegion#cacheWriteBeforeDestroy(EntryEventImpl, Object) */
Invoke the CacheWriter before the detroy operation occurs. Each BucketRegion delegates to the CacheWriter on the PartitionedRegion meaning that CacheWriters on a BucketRegion should only be used for internal purposes
cacheWriteBeforeDestroy
{ "repo_name": "davebarnes97/geode", "path": "geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegion.java", "license": "apache-2.0", "size": 381189 }
[ "java.util.Set", "org.apache.geode.cache.CacheWriter", "org.apache.geode.cache.CacheWriterException", "org.apache.geode.cache.EntryNotFoundException", "org.apache.geode.cache.TimeoutException" ]
import java.util.Set; import org.apache.geode.cache.CacheWriter; import org.apache.geode.cache.CacheWriterException; import org.apache.geode.cache.EntryNotFoundException; import org.apache.geode.cache.TimeoutException;
import java.util.*; import org.apache.geode.cache.*;
[ "java.util", "org.apache.geode" ]
java.util; org.apache.geode;
1,247,766
public Point getTopLeftPos() { Point c = getPos(); Dimension d = getSize(); return new Point(c.x-d.width/2, c.y-d.height/2); }
Point function() { Point c = getPos(); Dimension d = getSize(); return new Point(c.x-d.width/2, c.y-d.height/2); }
/** * Returns the top left position of this ProcessNode. * @return */
Returns the top left position of this ProcessNode
getTopLeftPos
{ "repo_name": "frapu78/processeditor", "path": "src/net/frapu/code/visualization/ProcessNode.java", "license": "apache-2.0", "size": 18653 }
[ "java.awt.Dimension", "java.awt.Point" ]
import java.awt.Dimension; import java.awt.Point;
import java.awt.*;
[ "java.awt" ]
java.awt;
1,395,408
private void mkdirs(File dir) { if (dir == null || dir.exists()) return; if (dir.mkdir()) return; mkdirs(dir.getParentFile()); dir.mkdir(); }
void function(File dir) { if (dir == null dir.exists()) return; if (dir.mkdir()) return; mkdirs(dir.getParentFile()); dir.mkdir(); }
/** * We implement mkdirs ourselves because this code is known to run in * highly concurrent scenarios, and there is a race condition in the JRE implementation * of mkdirs (see bug 265654). */
We implement mkdirs ourselves because this code is known to run in highly concurrent scenarios, and there is a race condition in the JRE implementation of mkdirs (see bug 265654)
mkdirs
{ "repo_name": "dhakehurst/net.akehurst.eclipse.simple.equinox", "path": "net.akehurst.eclipse.simple.equinox/src/main/java/net/akehurst/eclipse/simple/equinox/SimplerArtifactRepository.java", "license": "epl-1.0", "size": 59922 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
807,081
void editAlertNotification(String name, String description, Boolean global, String notificationType, List<String> alertStates, List<String> ambariDispatchRecipients, String mailSmtpHost, Integer mailSmtpPort, String mailSmtpFrom, Boolean mailSmtpAuth);
void editAlertNotification(String name, String description, Boolean global, String notificationType, List<String> alertStates, List<String> ambariDispatchRecipients, String mailSmtpHost, Integer mailSmtpPort, String mailSmtpFrom, Boolean mailSmtpAuth);
/** * Add alert notification * @param name Notification name * @param description Notification description * @param global Is notification global for all groups * @param notificationType EMAIL or SNMP * @param alertStates Alert status changes for which a notification will be send - OK, WARNING, CRITICAL, UNKNOWN * @param ambariDispatchRecipients List of recipients * @param mailSmtpHost SMTP Host * @param mailSmtpPort SMTP Port * @param mailSmtpFrom SMTP From * @param mailSmtpAuth Is authentication required */
Add alert notification
editAlertNotification
{ "repo_name": "brooklyncentral/brooklyn-ambari", "path": "ambari/src/main/java/io/brooklyn/ambari/AmbariCluster.java", "license": "apache-2.0", "size": 12555 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
280,426
private File createTestFile(String filename) throws IOException { File tempFile = File.createTempFile(filename, ".xml"); return tempFile; }
File function(String filename) throws IOException { File tempFile = File.createTempFile(filename, ".xml"); return tempFile; }
/** * Create a temporary testFile * @param filename * @return * @throws IOException */
Create a temporary testFile
createTestFile
{ "repo_name": "statsbiblioteket/digital-pligtaflevering-aviser-tools", "path": "tools/dpa-manualcontrol/src/test/java/org/statsbiblioteket/digital_pligtaflevering_aviser/ui/TestSerializing.java", "license": "apache-2.0", "size": 16492 }
[ "java.io.File", "java.io.IOException" ]
import java.io.File; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
295,640
public Award getAward() { return award; }
Award function() { return award; }
/**. * This is the Getter Method for award * @return Returns the award. */
. This is the Getter Method for award
getAward
{ "repo_name": "vivantech/kc_fixes", "path": "src/main/java/org/kuali/kra/subaward/bo/AwardSubAwardTerms.java", "license": "apache-2.0", "size": 3432 }
[ "org.kuali.kra.award.home.Award" ]
import org.kuali.kra.award.home.Award;
import org.kuali.kra.award.home.*;
[ "org.kuali.kra" ]
org.kuali.kra;
1,918,105
Entry<Integer,String> execWithStdout(Class<?> clz, String[] args) throws IOException;
Entry<Integer,String> execWithStdout(Class<?> clz, String[] args) throws IOException;
/** * Execute the given class against the cluster with the provided arguments and waits for * completion. Returns the exit code of the process with the stdout. */
Execute the given class against the cluster with the provided arguments and waits for completion. Returns the exit code of the process with the stdout
execWithStdout
{ "repo_name": "keith-turner/accumulo", "path": "minicluster/src/main/java/org/apache/accumulo/cluster/ClusterControl.java", "license": "apache-2.0", "size": 2771 }
[ "java.io.IOException", "java.util.Map" ]
import java.io.IOException; import java.util.Map;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
2,307,921
public static void fixMultiAssignment(HBaseAdmin admin, HRegionInfo region, List<ServerName> servers) throws IOException, KeeperException, InterruptedException { HRegionInfo actualRegion = new HRegionInfo(region); // Close region on the servers silently for(ServerName server : servers) { closeRegionSilentlyAndWait(admin, server, actualRegion); } // Force ZK node to OFFLINE so master assigns forceOfflineInZK(admin, actualRegion); }
static void function(HBaseAdmin admin, HRegionInfo region, List<ServerName> servers) throws IOException, KeeperException, InterruptedException { HRegionInfo actualRegion = new HRegionInfo(region); for(ServerName server : servers) { closeRegionSilentlyAndWait(admin, server, actualRegion); } forceOfflineInZK(admin, actualRegion); }
/** * Fix multiple assignment by doing silent closes on each RS hosting the region * and then force ZK unassigned node to OFFLINE to trigger assignment by * master. * * @param admin HBase admin used to undeploy * @param region Region to undeploy * @param servers list of Servers to undeploy from */
Fix multiple assignment by doing silent closes on each RS hosting the region and then force ZK unassigned node to OFFLINE to trigger assignment by master
fixMultiAssignment
{ "repo_name": "Jackygq1982/hbase_src", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/util/HBaseFsckRepair.java", "license": "apache-2.0", "size": 7472 }
[ "java.io.IOException", "java.util.List", "org.apache.hadoop.hbase.HRegionInfo", "org.apache.hadoop.hbase.ServerName", "org.apache.hadoop.hbase.client.HBaseAdmin", "org.apache.zookeeper.KeeperException" ]
import java.io.IOException; import java.util.List; import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.client.HBaseAdmin; import org.apache.zookeeper.KeeperException;
import java.io.*; import java.util.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.client.*; import org.apache.zookeeper.*;
[ "java.io", "java.util", "org.apache.hadoop", "org.apache.zookeeper" ]
java.io; java.util; org.apache.hadoop; org.apache.zookeeper;
2,176,661
void run(RecoveringBlock recoveringBlock) throws Exception; }
void run(RecoveringBlock recoveringBlock) throws Exception; }
/** * Perform the operation. */
Perform the operation
run
{ "repo_name": "steveloughran/hadoop", "path": "hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBlockRecovery.java", "license": "apache-2.0", "size": 48517 }
[ "org.apache.hadoop.hdfs.server.protocol.BlockRecoveryCommand" ]
import org.apache.hadoop.hdfs.server.protocol.BlockRecoveryCommand;
import org.apache.hadoop.hdfs.server.protocol.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,917,683
private void updateContainerReportMetrics(DatanodeDetails datanodeDetails, ContainerReportsProto reports) { ContainerStat newStat = new ContainerStat(); for (StorageContainerDatanodeProtocolProtos.ContainerInfo info : reports .getReportsList()) { newStat.add(new ContainerStat(info.getSize(), info.getUsed(), info.getKeyCount(), info.getReadBytes(), info.getWriteBytes(), info.getReadCount(), info.getWriteCount())); } // update container metrics StorageContainerManager.getMetrics().setLastContainerStat(newStat); // Update container stat entry, this will trigger a removal operation if it // exists in cache. String datanodeUuid = datanodeDetails.getUuidString(); getSCM().getContainerReportCache().put(datanodeUuid, newStat); // update global view container metrics StorageContainerManager.getMetrics().incrContainerStat(newStat); }
void function(DatanodeDetails datanodeDetails, ContainerReportsProto reports) { ContainerStat newStat = new ContainerStat(); for (StorageContainerDatanodeProtocolProtos.ContainerInfo info : reports .getReportsList()) { newStat.add(new ContainerStat(info.getSize(), info.getUsed(), info.getKeyCount(), info.getReadBytes(), info.getWriteBytes(), info.getReadCount(), info.getWriteCount())); } StorageContainerManager.getMetrics().setLastContainerStat(newStat); String datanodeUuid = datanodeDetails.getUuidString(); getSCM().getContainerReportCache().put(datanodeUuid, newStat); StorageContainerManager.getMetrics().incrContainerStat(newStat); }
/** * Updates container report metrics in SCM. * * @param datanodeDetails Datanode Information * @param reports Container Reports */
Updates container report metrics in SCM
updateContainerReportMetrics
{ "repo_name": "szegedim/hadoop", "path": "hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/server/report/SCMDatanodeContainerReportHandler.java", "license": "apache-2.0", "size": 3118 }
[ "org.apache.hadoop.hdds.protocol.DatanodeDetails", "org.apache.hadoop.hdds.scm.container.placement.metrics.ContainerStat", "org.apache.hadoop.hdds.scm.server.StorageContainerManager" ]
import org.apache.hadoop.hdds.protocol.DatanodeDetails; import org.apache.hadoop.hdds.scm.container.placement.metrics.ContainerStat; import org.apache.hadoop.hdds.scm.server.StorageContainerManager;
import org.apache.hadoop.hdds.protocol.*; import org.apache.hadoop.hdds.scm.container.placement.metrics.*; import org.apache.hadoop.hdds.scm.server.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,466,023
public final String outputString(Comment comment) { StringWriter out = new StringWriter(); try { output(comment, out); // output() flushes } catch (IOException e) { // swallow - will never happen. } return out.toString(); }
final String function(Comment comment) { StringWriter out = new StringWriter(); try { output(comment, out); } catch (IOException e) { } return out.toString(); }
/** * Return a string representing a {@link Comment}. * <p> * <b>Warning</b>: a String is Unicode, which may not match the outputter's * specified encoding. * * @param comment * <code>Comment</code> to format. * @return the input content formatted as an XML String. * @throws NullPointerException * if the specified content is null. */
Return a string representing a <code>Comment</code>. Warning: a String is Unicode, which may not match the outputter's specified encoding
outputString
{ "repo_name": "djcraft/Algotica", "path": "compilateurAlgotica/src/org/jdom2/output/XMLOutputter.java", "license": "gpl-3.0", "size": 35699 }
[ "java.io.IOException", "java.io.StringWriter", "org.jdom2.Comment" ]
import java.io.IOException; import java.io.StringWriter; import org.jdom2.Comment;
import java.io.*; import org.jdom2.*;
[ "java.io", "org.jdom2" ]
java.io; org.jdom2;
475,941
return clazz; } /** * Legt den Wert der clazz-Eigenschaft fest. * * @param value * allowed object is * {@link CodeType }
return clazz; } /** * Legt den Wert der clazz-Eigenschaft fest. * * @param value * allowed object is * {@link CodeType }
/** * Ruft den Wert der clazz-Eigenschaft ab. * * @return * possible object is * {@link CodeType } * */
Ruft den Wert der clazz-Eigenschaft ab
getClazz
{ "repo_name": "citygml4j/citygml4j", "path": "src-gen/main/java/net/opengis/citygml/tunnel/_2/IntTunnelInstallationType.java", "license": "apache-2.0", "size": 10835 }
[ "net.opengis.gml.CodeType" ]
import net.opengis.gml.CodeType;
import net.opengis.gml.*;
[ "net.opengis.gml" ]
net.opengis.gml;
1,135,228
private SequenceAdapter addSequence( SequenceAdapter sequenceAdapter) { // add config this.getSequenceConfigs().add((SequenceConfig) sequenceAdapter.getModel()); // add adapter this.sequences.add( sequenceAdapter); return sequenceAdapter; }
SequenceAdapter function( SequenceAdapter sequenceAdapter) { this.getSequenceConfigs().add((SequenceConfig) sequenceAdapter.getModel()); this.sequences.add( sequenceAdapter); return sequenceAdapter; }
/** * Adds the given sequence. */
Adds the given sequence
addSequence
{ "repo_name": "RallySoftware/eclipselink.runtime", "path": "utils/eclipselink.utils.workbench/scplugin/source/org/eclipse/persistence/tools/workbench/scplugin/model/adapter/SequencingAdapter.java", "license": "epl-1.0", "size": 13164 }
[ "org.eclipse.persistence.internal.sessions.factories.model.sequencing.SequenceConfig" ]
import org.eclipse.persistence.internal.sessions.factories.model.sequencing.SequenceConfig;
import org.eclipse.persistence.internal.sessions.factories.model.sequencing.*;
[ "org.eclipse.persistence" ]
org.eclipse.persistence;
147,532
public HalClient addExceptionHandler(JsonPipelineExceptionHandler newExceptionHandler) { this.exceptionHandlers.add(newExceptionHandler); return this; }
HalClient function(JsonPipelineExceptionHandler newExceptionHandler) { this.exceptionHandlers.add(newExceptionHandler); return this; }
/** * Adds an exception handler for the pipeline actions. * @param newExceptionHandler The exceptionHandler to set. * @return This HAL client */
Adds an exception handler for the pipeline actions
addExceptionHandler
{ "repo_name": "wcm-io-caravan/caravan-pipeline", "path": "extensions/hal/src/main/java/io/wcm/caravan/pipeline/extensions/hal/client/HalClient.java", "license": "apache-2.0", "size": 14988 }
[ "io.wcm.caravan.pipeline.JsonPipelineExceptionHandler" ]
import io.wcm.caravan.pipeline.JsonPipelineExceptionHandler;
import io.wcm.caravan.pipeline.*;
[ "io.wcm.caravan" ]
io.wcm.caravan;
1,924,991
private void scheduleTask() { final String DEBUG_HEADER = "scheduleTask(): "; if (log.isDebug2()) log.debug2(DEBUG_HEADER + "Starting..."); Cron cron = (Cron) LockssDaemon.getManager(LockssDaemon.CRON); cron.addTask(new FetchTimeExporter(getDaemon()).getCronTask()); if (log.isDebug3()) log.debug3(DEBUG_HEADER + "FetchTimeExporter task added to cron."); isExporterTaskScheduled = true; if (log.isDebug2()) log.debug2(DEBUG_HEADER + "isExporterTaskScheduled = " + isExporterTaskScheduled); }
void function() { final String DEBUG_HEADER = STR; if (log.isDebug2()) log.debug2(DEBUG_HEADER + STR); Cron cron = (Cron) LockssDaemon.getManager(LockssDaemon.CRON); cron.addTask(new FetchTimeExporter(getDaemon()).getCronTask()); if (log.isDebug3()) log.debug3(DEBUG_HEADER + STR); isExporterTaskScheduled = true; if (log.isDebug2()) log.debug2(DEBUG_HEADER + STR + isExporterTaskScheduled); }
/** * Schedules the recurring task of exporting fetch data. */
Schedules the recurring task of exporting fetch data
scheduleTask
{ "repo_name": "lockss/lockss-daemon", "path": "src/org/lockss/exporter/FetchTimeExportManager.java", "license": "bsd-3-clause", "size": 8066 }
[ "org.lockss.app.LockssDaemon", "org.lockss.daemon.Cron" ]
import org.lockss.app.LockssDaemon; import org.lockss.daemon.Cron;
import org.lockss.app.*; import org.lockss.daemon.*;
[ "org.lockss.app", "org.lockss.daemon" ]
org.lockss.app; org.lockss.daemon;
671,811