method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
sequence
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
sequence
libraries_info
stringlengths
6
661
id
int64
0
2.92M
private static Document parseDom(InputStream in, ErrorLocation errorLocation) throws BlockFileException { try { URL schemaURL = BlockFileReader.class .getResource(XmlToken.SCHEMA_NAME); Document document = org.conqat.lib.commons.xml.XMLUtils.parse( new InputSource(in), schemaURL); return document; } catch (SAXException e) { throw new BlockFileException( EDriverExceptionType.XML_PARSING_EXCEPTION, "XML parsing exception", e, errorLocation); } catch (IOException e) { throw new BlockFileException(EDriverExceptionType.IO_ERROR, "File not readable: " + e.getMessage(), e, errorLocation); } finally { FileSystemUtils.close(in); } }
static Document function(InputStream in, ErrorLocation errorLocation) throws BlockFileException { try { URL schemaURL = BlockFileReader.class .getResource(XmlToken.SCHEMA_NAME); Document document = org.conqat.lib.commons.xml.XMLUtils.parse( new InputSource(in), schemaURL); return document; } catch (SAXException e) { throw new BlockFileException( EDriverExceptionType.XML_PARSING_EXCEPTION, STR, e, errorLocation); } catch (IOException e) { throw new BlockFileException(EDriverExceptionType.IO_ERROR, STR + e.getMessage(), e, errorLocation); } finally { FileSystemUtils.close(in); } }
/** * Read the provided stream and return a DOM tree of its contents. The * stream is closed by this method. */
Read the provided stream and return a DOM tree of its contents. The stream is closed by this method
parseDom
{ "repo_name": "vimaier/conqat", "path": "org.conqat.engine.core/src/org/conqat/engine/core/driver/BlockFileReader.java", "license": "apache-2.0", "size": 19283 }
[ "java.io.IOException", "java.io.InputStream", "org.conqat.engine.core.driver.error.BlockFileException", "org.conqat.engine.core.driver.error.EDriverExceptionType", "org.conqat.engine.core.driver.error.ErrorLocation", "org.conqat.engine.core.driver.util.XmlToken", "org.conqat.lib.commons.filesystem.FileSystemUtils", "org.conqat.lib.commons.xml.XMLUtils", "org.w3c.dom.Document", "org.xml.sax.InputSource", "org.xml.sax.SAXException" ]
import java.io.IOException; import java.io.InputStream; import org.conqat.engine.core.driver.error.BlockFileException; import org.conqat.engine.core.driver.error.EDriverExceptionType; import org.conqat.engine.core.driver.error.ErrorLocation; import org.conqat.engine.core.driver.util.XmlToken; import org.conqat.lib.commons.filesystem.FileSystemUtils; import org.conqat.lib.commons.xml.XMLUtils; import org.w3c.dom.Document; import org.xml.sax.InputSource; import org.xml.sax.SAXException;
import java.io.*; import org.conqat.engine.core.driver.error.*; import org.conqat.engine.core.driver.util.*; import org.conqat.lib.commons.filesystem.*; import org.conqat.lib.commons.xml.*; import org.w3c.dom.*; import org.xml.sax.*;
[ "java.io", "org.conqat.engine", "org.conqat.lib", "org.w3c.dom", "org.xml.sax" ]
java.io; org.conqat.engine; org.conqat.lib; org.w3c.dom; org.xml.sax;
523,581
@NotNull public static <IN, OUT> Function<StreamBuilder<IN, OUT>, StreamBuilder<IN, OUT>> tryCatchAccept( @NotNull final BiConsumer<? super RoutineException, ? super Channel<OUT, ?>> catchConsumer) { ConstantConditions.notNull("consumer instance", catchConsumer); return new TransformationFunction<IN, OUT, OUT>( new BiFunction<StreamConfiguration, Function<? super Channel<?, IN>, ? extends Channel<?, OUT>>, Function<? super Channel<?, IN>, ? extends Channel<?, OUT>>>() {
static <IN, OUT> Function<StreamBuilder<IN, OUT>, StreamBuilder<IN, OUT>> function( @NotNull final BiConsumer<? super RoutineException, ? super Channel<OUT, ?>> catchConsumer) { ConstantConditions.notNull(STR, catchConsumer); return new TransformationFunction<IN, OUT, OUT>( new BiFunction<StreamConfiguration, Function<? super Channel<?, IN>, ? extends Channel<?, OUT>>, Function<? super Channel<?, IN>, ? extends Channel<?, OUT>>>() {
/** * Returns a function concatenating to the stream a consumer handling invocation exceptions. * <br> * The result channel of the backing routine will be passed to the consumer, so that multiple * or no results may be generated. * <br> * The errors will not be automatically further propagated. * * @param catchConsumer the bi-consumer instance. * @param <IN> the input data type. * @param <OUT> the output data type. * @return the transformation function. * @see StreamBuilder#let(Function) */
Returns a function concatenating to the stream a consumer handling invocation exceptions. The result channel of the backing routine will be passed to the consumer, so that multiple or no results may be generated. The errors will not be automatically further propagated
tryCatchAccept
{ "repo_name": "davide-maestroni/jroutine", "path": "stream/src/main/java/com/github/dm/jrt/stream/transform/Transformations.java", "license": "apache-2.0", "size": 28858 }
[ "com.github.dm.jrt.core.channel.Channel", "com.github.dm.jrt.core.common.RoutineException", "com.github.dm.jrt.core.util.ConstantConditions", "com.github.dm.jrt.function.BiConsumer", "com.github.dm.jrt.function.BiFunction", "com.github.dm.jrt.function.Function", "com.github.dm.jrt.stream.builder.StreamBuilder", "org.jetbrains.annotations.NotNull" ]
import com.github.dm.jrt.core.channel.Channel; import com.github.dm.jrt.core.common.RoutineException; import com.github.dm.jrt.core.util.ConstantConditions; import com.github.dm.jrt.function.BiConsumer; import com.github.dm.jrt.function.BiFunction; import com.github.dm.jrt.function.Function; import com.github.dm.jrt.stream.builder.StreamBuilder; import org.jetbrains.annotations.NotNull;
import com.github.dm.jrt.core.channel.*; import com.github.dm.jrt.core.common.*; import com.github.dm.jrt.core.util.*; import com.github.dm.jrt.function.*; import com.github.dm.jrt.stream.builder.*; import org.jetbrains.annotations.*;
[ "com.github.dm", "org.jetbrains.annotations" ]
com.github.dm; org.jetbrains.annotations;
1,770,228
public Deferred<DataPoints[]> call(final DataPoints[] datapoints) throws Exception { //TODO review this logic during spatial aggregation implementation if (datapoints == NO_RESULT && RollupQuery.isValidQuery(rollup_query)) { //There are no datapoints for this query and it is a rollup query //but not the default interval (default interval means raw). //This will prevent redundant scan on raw data on the presense of //default rollup interval //If the rollup usage is to fallback directly to raw data //then nullyfy the rollup query, so that the recursive scan will use //raw data and this will not called again because of isValida check //If the rollup usage is to fallback to next best match then pupup //next best match and attach that to the rollup query if (rollup_usage == ROLLUP_USAGE.ROLLUP_FALLBACK_RAW) { transformRollupQueryToDownSampler(); return runAsync(); } else if (best_match_rollups != null && best_match_rollups.size() > 0) { RollupInterval interval = best_match_rollups.remove(0); if (interval.isDefaultInterval()) { transformRollupQueryToDownSampler(); } else { rollup_query = new RollupQuery(interval, rollup_query.getRollupAgg(), rollup_query.getSampleIntervalInMS(), aggregator); //Here the requested sampling rate will be higher than //resulted result. So downsample it if (!rollup_query.isLowerSamplingRate()) { // sample_interval_ms = rollup_query.getSampleIntervalInMS(); // downsampler = rollup_query.getRollupAgg(); // TODO - default fill downsampler = new DownsamplingSpecification( rollup_query.getSampleIntervalInMS(), rollup_query.getRollupAgg(), (downsampler != null ? downsampler.getFillPolicy() : FillPolicy.ZERO)); } } return runAsync(); } return Deferred.fromResult(NO_RESULT); } else { return Deferred.fromResult(datapoints); } } }
Deferred<DataPoints[]> function(final DataPoints[] datapoints) throws Exception { if (datapoints == NO_RESULT && RollupQuery.isValidQuery(rollup_query)) { if (rollup_usage == ROLLUP_USAGE.ROLLUP_FALLBACK_RAW) { transformRollupQueryToDownSampler(); return runAsync(); } else if (best_match_rollups != null && best_match_rollups.size() > 0) { RollupInterval interval = best_match_rollups.remove(0); if (interval.isDefaultInterval()) { transformRollupQueryToDownSampler(); } else { rollup_query = new RollupQuery(interval, rollup_query.getRollupAgg(), rollup_query.getSampleIntervalInMS(), aggregator); if (!rollup_query.isLowerSamplingRate()) { downsampler = new DownsamplingSpecification( rollup_query.getSampleIntervalInMS(), rollup_query.getRollupAgg(), (downsampler != null ? downsampler.getFillPolicy() : FillPolicy.ZERO)); } } return runAsync(); } return Deferred.fromResult(NO_RESULT); } else { return Deferred.fromResult(datapoints); } } }
/** * Creates the {@link SpanGroup}s to form the final results of this query. * @param spans The {@link Span}s found for this query ({@link #findSpans}). * Can be {@code null}, in which case the array returned will be empty. * @return A possibly empty array of {@link SpanGroup}s built according to * any 'GROUP BY' formulated in this query. */
Creates the <code>SpanGroup</code>s to form the final results of this query
call
{ "repo_name": "OpenTSDB/opentsdb", "path": "src/core/TsdbQuery.java", "license": "lgpl-2.1", "size": 75725 }
[ "com.stumbleupon.async.Deferred", "net.opentsdb.rollup.RollupInterval", "net.opentsdb.rollup.RollupQuery" ]
import com.stumbleupon.async.Deferred; import net.opentsdb.rollup.RollupInterval; import net.opentsdb.rollup.RollupQuery;
import com.stumbleupon.async.*; import net.opentsdb.rollup.*;
[ "com.stumbleupon.async", "net.opentsdb.rollup" ]
com.stumbleupon.async; net.opentsdb.rollup;
1,077,221
public static void removePropertyChangeListener (PropertyChangeListener listener) { // FIXME }
static void function (PropertyChangeListener listener) { }
/** * Remove a <code>PropertyChangeListener</code> from the listener list. * * @param listener the listener to remove */
Remove a <code>PropertyChangeListener</code> from the listener list
removePropertyChangeListener
{ "repo_name": "aosm/gcc_40", "path": "libjava/javax/swing/UIManager.java", "license": "gpl-2.0", "size": 9295 }
[ "java.beans.PropertyChangeListener" ]
import java.beans.PropertyChangeListener;
import java.beans.*;
[ "java.beans" ]
java.beans;
2,159,906
@Generated @Selector("setMaximumValue:") public native void setMaximumValue(float value);
@Selector(STR) native void function(float value);
/** * [@property] maximumValue * <p> * maximumValue is used to clamp the result of an arithmetic operation: * result = clamp(result, minimumValue, maximumValue). * The default value of maximumValue is FLT_MAX. */
[@property] maximumValue maximumValue is used to clamp the result of an arithmetic operation: result = clamp(result, minimumValue, maximumValue). The default value of maximumValue is FLT_MAX
setMaximumValue
{ "repo_name": "multi-os-engine/moe-core", "path": "moe.apple/moe.platform.ios/src/main/java/apple/metalperformanceshaders/MPSCNNArithmeticGradient.java", "license": "apache-2.0", "size": 12141 }
[ "org.moe.natj.objc.ann.Selector" ]
import org.moe.natj.objc.ann.Selector;
import org.moe.natj.objc.ann.*;
[ "org.moe.natj" ]
org.moe.natj;
2,306,754
public synchronized byte[] read(int address, int length) throws IOException { requireValidAddress(address); R.requireThat(isOpen(), "isOpen()").isTrue(); Packet packet = createPacket(8, hi(address), lo(address), hi(length), lo(length)); Packet answer = sendPacketGetReply(packet); byte[] result = new byte[length]; // TODO 2011-01-09 mh: C64 currently just gets returns an ack System.arraycopy(answer.getData(), IDX_DATA, result, 0, length); return result; }
synchronized byte[] function(int address, int length) throws IOException { requireValidAddress(address); R.requireThat(isOpen(), STR).isTrue(); Packet packet = createPacket(8, hi(address), lo(address), hi(length), lo(length)); Packet answer = sendPacketGetReply(packet); byte[] result = new byte[length]; System.arraycopy(answer.getData(), IDX_DATA, result, 0, length); return result; }
/** * Read data from memory location ???. * Command defined but not implemented in in CodeNet client. * This method is currently broken! * TODO 2011-01-09 mh: Fix this * * @param address address * @param length number of bytes to read * @return read data */
Read data from memory location ???. Command defined but not implemented in in CodeNet client. This method is currently broken! TODO 2011-01-09 mh: Fix this
read
{ "repo_name": "markusheiden/c64dt", "path": "net/src/main/java/de/heiden/c64dt/net/code/C64Connection.java", "license": "gpl-3.0", "size": 5859 }
[ "de.heiden.c64dt.bytes.AddressUtil", "de.heiden.c64dt.bytes.ByteUtil", "de.heiden.c64dt.common.Requirements", "de.heiden.c64dt.net.Packet", "java.io.IOException" ]
import de.heiden.c64dt.bytes.AddressUtil; import de.heiden.c64dt.bytes.ByteUtil; import de.heiden.c64dt.common.Requirements; import de.heiden.c64dt.net.Packet; import java.io.IOException;
import de.heiden.c64dt.bytes.*; import de.heiden.c64dt.common.*; import de.heiden.c64dt.net.*; import java.io.*;
[ "de.heiden.c64dt", "java.io" ]
de.heiden.c64dt; java.io;
468,851
public static Optional<ButtonType> showNotification(NotificationType type, String windowTitle, String message) { TopsoilNotification notification = new TopsoilNotification(windowTitle, message); notification.setImage(type.getImage()); notification.getDialogPane().getButtonTypes().addAll(type.getButtonTypes()); return notification.showAndWait(); } public enum NotificationType { INFORMATION("notify.png", ButtonType.OK), ERROR("error.png", ButtonType.OK), VERIFICATION("question.png", ButtonType.CANCEL, ButtonType.OK), YES_NO("question.png", ButtonType.CANCEL, ButtonType.NO, ButtonType.YES); private final Image image; private final ButtonType[] buttonTypes; private final ResourceExtractor RESOURCE_EXTRACTOR = new ResourceExtractor(NotificationType.class); NotificationType(String imageName, ButtonType... buttonTypes) { this.image = new Image(RESOURCE_EXTRACTOR.extractResourceAsPath(imageName).toUri().toString()); this.buttonTypes = buttonTypes; }
static Optional<ButtonType> function(NotificationType type, String windowTitle, String message) { TopsoilNotification notification = new TopsoilNotification(windowTitle, message); notification.setImage(type.getImage()); notification.getDialogPane().getButtonTypes().addAll(type.getButtonTypes()); return notification.showAndWait(); } public enum NotificationType { INFORMATION(STR, ButtonType.OK), ERROR(STR, ButtonType.OK), VERIFICATION(STR, ButtonType.CANCEL, ButtonType.OK), YES_NO(STR, ButtonType.CANCEL, ButtonType.NO, ButtonType.YES); private final Image image; private final ButtonType[] buttonTypes; private final ResourceExtractor RESOURCE_EXTRACTOR = new ResourceExtractor(NotificationType.class); NotificationType(String imageName, ButtonType... buttonTypes) { this.image = new Image(RESOURCE_EXTRACTOR.extractResourceAsPath(imageName).toUri().toString()); this.buttonTypes = buttonTypes; }
/** * Shows a small notification window with the specified title and message. Other attributes, such as the * available {@code ButtonType}s and the graphic are based on the supplied {@code NotificationType}. * * @param type NotificationType * @param windowTitle the String title of the Stage * @param message String message * @return the ButtonType of the button the user pressed in response */
Shows a small notification window with the specified title and message. Other attributes, such as the available ButtonTypes and the graphic are based on the supplied NotificationType
showNotification
{ "repo_name": "emilycoleman/Topsoil", "path": "app/src/main/java/org/cirdles/topsoil/app/util/dialog/TopsoilNotification.java", "license": "apache-2.0", "size": 4983 }
[ "java.util.Optional", "org.cirdles.commons.util.ResourceExtractor" ]
import java.util.Optional; import org.cirdles.commons.util.ResourceExtractor;
import java.util.*; import org.cirdles.commons.util.*;
[ "java.util", "org.cirdles.commons" ]
java.util; org.cirdles.commons;
963,106
private static Location scanLocations(List<Location> locations, LocationPredicate predicate) { Location location = null; for (Location l : locations) { if (location == null) { location = l; } else { if (predicate.accept(location, l)) { location = l; } } } return location; }
static Location function(List<Location> locations, LocationPredicate predicate) { Location location = null; for (Location l : locations) { if (location == null) { location = l; } else { if (predicate.accept(location, l)) { location = l; } } } return location; }
/** * Used for scanning through a list of locations; assumes the * locations given will have at least one value otherwise * we will get a null pointer */
Used for scanning through a list of locations; assumes the locations given will have at least one value otherwise we will get a null pointer
scanLocations
{ "repo_name": "fionakim/biojava", "path": "biojava-core/src/main/java/org/biojava/nbio/core/sequence/location/LocationHelper.java", "license": "lgpl-2.1", "size": 12125 }
[ "java.util.List", "org.biojava.nbio.core.sequence.location.template.Location" ]
import java.util.List; import org.biojava.nbio.core.sequence.location.template.Location;
import java.util.*; import org.biojava.nbio.core.sequence.location.template.*;
[ "java.util", "org.biojava.nbio" ]
java.util; org.biojava.nbio;
2,547,121
public void setRawObject(@Nonnull final ISerializer serializer, @Nonnull final JsonObject json) { }
void function(@Nonnull final ISerializer serializer, @Nonnull final JsonObject json) { }
/** * Sets the raw JSON object * * @param serializer the serializer * @param json the JSON object to set this object to */
Sets the raw JSON object
setRawObject
{ "repo_name": "microsoftgraph/msgraph-sdk-java", "path": "src/main/java/com/microsoft/graph/models/ManagedDeviceMobileAppConfigurationDeviceSummary.java", "license": "mit", "size": 2920 }
[ "com.google.gson.JsonObject", "com.microsoft.graph.serializer.ISerializer", "javax.annotation.Nonnull" ]
import com.google.gson.JsonObject; import com.microsoft.graph.serializer.ISerializer; import javax.annotation.Nonnull;
import com.google.gson.*; import com.microsoft.graph.serializer.*; import javax.annotation.*;
[ "com.google.gson", "com.microsoft.graph", "javax.annotation" ]
com.google.gson; com.microsoft.graph; javax.annotation;
899,956
public void setLoadingImage(Bitmap bitmap) { mLoadingBitmap = bitmap; }
void function(Bitmap bitmap) { mLoadingBitmap = bitmap; }
/** * Set placeholder bitmap that shows when the the background thread is running. * * @param bitmap */
Set placeholder bitmap that shows when the the background thread is running
setLoadingImage
{ "repo_name": "Eaiman/BitmapHandler", "path": "src/com/bitmaphandler/ImageWorker.java", "license": "mit", "size": 19948 }
[ "android.graphics.Bitmap" ]
import android.graphics.Bitmap;
import android.graphics.*;
[ "android.graphics" ]
android.graphics;
670,347
protected void paintComponent( Graphics g ) { if( moveNames ) { // Paint our own text, aligning to the left of the screen g.setClip( this.getVisibleRect( ) ); // First paint background g.setColor( this.getBackground( ) ); g.fillRect( 0, 0, this.getWidth( ), this.getHeight( ) ); // Then set everything to draw the text g.setFont( this.getFont( ) ); g.setColor( this.getForeground( ) ); // Compute the right place from the left border int fontX = 0; Insets ins = this.getInsets( ); if( this.getBorder( ) != null ) { fontX = ins.left; } if( ( g.getClipBounds( ) != null ) && ( fontX < g.getClipBounds( ).x ) ) { fontX = g.getClipBounds( ).x + ins.left; } Graphics2D g2d = (Graphics2D) g; g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, // Anti-alias! RenderingHints.VALUE_ANTIALIAS_ON); // now we now where, draw the text g.drawString( getText( ), fontX, ( ins.top + ( getHeight( ) - ins.top - ins.bottom + g.getFontMetrics( ).getAscent( ) ) ) >> 1 ); } else { super.paintComponent( g ); } if( isDrawHeart ) { Graphics2D graphics = (Graphics2D)g; AffineTransform originalTransform = graphics.getTransform( ); graphics.setColor( Color.RED ); // switch on anti-aliasing graphics.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON ); // Scale and position appropriately--taking into account the borders Rectangle bounds = HEART_SHAPE.getBounds( ); double scale = 0.45 * ( getHeight( ) / bounds.getHeight( ) ); double right = getWidth( ) - 2 - ( scale * bounds.getWidth( ) ); graphics.translate( right, 2 ); graphics.scale( scale, scale ); graphics.fill( HEART_SHAPE ); graphics.setTransform( originalTransform ); } }
void function( Graphics g ) { if( moveNames ) { g.setClip( this.getVisibleRect( ) ); g.setColor( this.getBackground( ) ); g.fillRect( 0, 0, this.getWidth( ), this.getHeight( ) ); g.setFont( this.getFont( ) ); g.setColor( this.getForeground( ) ); int fontX = 0; Insets ins = this.getInsets( ); if( this.getBorder( ) != null ) { fontX = ins.left; } if( ( g.getClipBounds( ) != null ) && ( fontX < g.getClipBounds( ).x ) ) { fontX = g.getClipBounds( ).x + ins.left; } Graphics2D g2d = (Graphics2D) g; g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g.drawString( getText( ), fontX, ( ins.top + ( getHeight( ) - ins.top - ins.bottom + g.getFontMetrics( ).getAscent( ) ) ) >> 1 ); } else { super.paintComponent( g ); } if( isDrawHeart ) { Graphics2D graphics = (Graphics2D)g; AffineTransform originalTransform = graphics.getTransform( ); graphics.setColor( Color.RED ); graphics.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON ); Rectangle bounds = HEART_SHAPE.getBounds( ); double scale = 0.45 * ( getHeight( ) / bounds.getHeight( ) ); double right = getWidth( ) - 2 - ( scale * bounds.getWidth( ) ); graphics.translate( right, 2 ); graphics.scale( scale, scale ); graphics.fill( HEART_SHAPE ); graphics.setTransform( originalTransform ); } }
/** * Paint component override. * * @param g DOCUMENT ME! */
Paint component override
paintComponent
{ "repo_name": "andybalaam/freeguide", "path": "src/freeguide/plugins/ui/horizontal/manylabels/JLabelProgramme.java", "license": "gpl-2.0", "size": 14494 }
[ "java.awt.Color", "java.awt.Graphics", "java.awt.Graphics2D", "java.awt.Insets", "java.awt.Rectangle", "java.awt.RenderingHints", "java.awt.geom.AffineTransform" ]
import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Insets; import java.awt.Rectangle; import java.awt.RenderingHints; import java.awt.geom.AffineTransform;
import java.awt.*; import java.awt.geom.*;
[ "java.awt" ]
java.awt;
1,183,989
public OneToManyLink getItem() { return item; } public DefaultOneToManyItem() { item = new OneToManyLink(); }
OneToManyLink function() { return item; } public DefaultOneToManyItem() { item = new OneToManyLink(); }
/** * Return the actual form item. * * @return the actual form item */
Return the actual form item
getItem
{ "repo_name": "olivermay/geomajas", "path": "face/geomajas-face-gwt/client/src/main/java/org/geomajas/gwt/client/widget/attribute/DefaultOneToManyItem.java", "license": "agpl-3.0", "size": 10386 }
[ "org.geomajas.gwt.client.widget.attribute.DefaultOneToManyItem" ]
import org.geomajas.gwt.client.widget.attribute.DefaultOneToManyItem;
import org.geomajas.gwt.client.widget.attribute.*;
[ "org.geomajas.gwt" ]
org.geomajas.gwt;
1,310,162
EAttribute getRemindRoundScoreMessage_TeamWin();
EAttribute getRemindRoundScoreMessage_TeamWin();
/** * Returns the meta object for the attribute '{@link MessagesModel.RemindRoundScoreMessage#getTeamWin <em>Team Win</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the attribute '<em>Team Win</em>'. * @see MessagesModel.RemindRoundScoreMessage#getTeamWin() * @see #getRemindRoundScoreMessage() * @generated */
Returns the meta object for the attribute '<code>MessagesModel.RemindRoundScoreMessage#getTeamWin Team Win</code>'.
getRemindRoundScoreMessage_TeamWin
{ "repo_name": "Hu3bl/statsbot", "path": "statsbot-parent/statsbot-module.messages.model/src/main/java/MessagesModel/ModelPackage.java", "license": "mit", "size": 147130 }
[ "org.eclipse.emf.ecore.EAttribute" ]
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
773,109
Instant getLastAccessedTime();
Instant getLastAccessedTime();
/** * Gets the last time this {@link Session} was accessed. * @return the last time the client sent a request associated with the session */
Gets the last time this <code>Session</code> was accessed
getLastAccessedTime
{ "repo_name": "vpavic/spring-session", "path": "spring-session-core/src/main/java/org/springframework/session/Session.java", "license": "apache-2.0", "size": 4936 }
[ "java.time.Instant" ]
import java.time.Instant;
import java.time.*;
[ "java.time" ]
java.time;
2,783,922
private void deleteGroupFamily( EntityId entityId, FamilyLayout familyLayout, long upToTimestamp) throws IOException { final String familyName = Preconditions.checkNotNull(familyLayout.getName()); // Delete each column in the group according to the layout. final Delete delete = new Delete(entityId.getHBaseRowKey()); for (ColumnLayout columnLayout : familyLayout.getColumnMap().values()) { final String qualifier = columnLayout.getName(); final KijiColumnName column = new KijiColumnName(familyName, qualifier); final HBaseColumnName hbaseColumnName = mWriterLayoutCapsule.getColumnNameTranslator().toHBaseColumnName(column); delete.deleteColumns( hbaseColumnName.getFamily(), hbaseColumnName.getQualifier(), upToTimestamp); } // Send the delete to the HBase HTable. mHTable.delete(delete); }
void function( EntityId entityId, FamilyLayout familyLayout, long upToTimestamp) throws IOException { final String familyName = Preconditions.checkNotNull(familyLayout.getName()); final Delete delete = new Delete(entityId.getHBaseRowKey()); for (ColumnLayout columnLayout : familyLayout.getColumnMap().values()) { final String qualifier = columnLayout.getName(); final KijiColumnName column = new KijiColumnName(familyName, qualifier); final HBaseColumnName hbaseColumnName = mWriterLayoutCapsule.getColumnNameTranslator().toHBaseColumnName(column); delete.deleteColumns( hbaseColumnName.getFamily(), hbaseColumnName.getQualifier(), upToTimestamp); } mHTable.delete(delete); }
/** * Deletes all cells from a group-type family with a timestamp less than or equal to a * specified timestamp. * * @param entityId The entity (row) to delete from. * @param familyLayout The family layout. * @param upToTimestamp A timestamp. * @throws IOException If there is an IO error. */
Deletes all cells from a group-type family with a timestamp less than or equal to a specified timestamp
deleteGroupFamily
{ "repo_name": "zenoss/kiji-schema", "path": "kiji-schema/src/main/java/org/kiji/schema/impl/HBaseKijiTableWriter.java", "license": "apache-2.0", "size": 19236 }
[ "com.google.common.base.Preconditions", "java.io.IOException", "org.apache.hadoop.hbase.client.Delete", "org.kiji.schema.EntityId", "org.kiji.schema.KijiColumnName", "org.kiji.schema.hbase.HBaseColumnName", "org.kiji.schema.layout.KijiTableLayout" ]
import com.google.common.base.Preconditions; import java.io.IOException; import org.apache.hadoop.hbase.client.Delete; import org.kiji.schema.EntityId; import org.kiji.schema.KijiColumnName; import org.kiji.schema.hbase.HBaseColumnName; import org.kiji.schema.layout.KijiTableLayout;
import com.google.common.base.*; import java.io.*; import org.apache.hadoop.hbase.client.*; import org.kiji.schema.*; import org.kiji.schema.hbase.*; import org.kiji.schema.layout.*;
[ "com.google.common", "java.io", "org.apache.hadoop", "org.kiji.schema" ]
com.google.common; java.io; org.apache.hadoop; org.kiji.schema;
1,711,723
public void setPartitionFileTag(String partitionFileTagType) { this.partitionFileTagType = PartitionFileTagType.valueOfIgnoreCase(partitionFileTagType); }
void function(String partitionFileTagType) { this.partitionFileTagType = PartitionFileTagType.valueOfIgnoreCase(partitionFileTagType); }
/** * Sets number file tag for data partition. * * @param partitionKey */
Sets number file tag for data partition
setPartitionFileTag
{ "repo_name": "CloverETL/CloverETL-Engine", "path": "cloveretl.component/src/org/jetel/component/FixLenDataWriter.java", "license": "lgpl-2.1", "size": 18033 }
[ "org.jetel.enums.PartitionFileTagType" ]
import org.jetel.enums.PartitionFileTagType;
import org.jetel.enums.*;
[ "org.jetel.enums" ]
org.jetel.enums;
2,552,557
public Entity<T> removeExcludeDefaultListeners() { childNode.removeChild("exclude-default-listeners"); return this; } // --------------------------------------------------------------------------------------------------------|| // ClassName: Entity ElementName: javaee:emptyType ElementType : exclude-superclass-listeners // MaxOccurs: - isGeneric: true isAttribute: false isEnum: false isDataType: true // --------------------------------------------------------------------------------------------------------||
Entity<T> function() { childNode.removeChild(STR); return this; }
/** * Removes the <code>exclude-default-listeners</code> element * @return the current instance of <code>Entity<T></code> */
Removes the <code>exclude-default-listeners</code> element
removeExcludeDefaultListeners
{ "repo_name": "forge/javaee-descriptors", "path": "impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/orm20/EntityImpl.java", "license": "epl-1.0", "size": 48316 }
[ "org.jboss.shrinkwrap.descriptor.api.orm20.Entity" ]
import org.jboss.shrinkwrap.descriptor.api.orm20.Entity;
import org.jboss.shrinkwrap.descriptor.api.orm20.*;
[ "org.jboss.shrinkwrap" ]
org.jboss.shrinkwrap;
2,411,469
@Nonnull public static <T> DoubleBinding mapToDoubleThenReduce(@Nonnull final ObservableList<T> items, @Nonnull final Supplier<Double> supplier, @Nonnull final Function<? super T, Double> mapper, @Nonnull final BinaryOperator<Double> reducer) { requireNonNull(items, ERROR_ITEMS_NULL); requireNonNull(reducer, ERROR_REDUCER_NULL); requireNonNull(supplier, ERROR_SUPPLIER_NULL); requireNonNull(mapper, ERROR_MAPPER_NULL); return createDoubleBinding(() -> items.stream().map(mapper).reduce(reducer).orElseGet(supplier), items); }
static <T> DoubleBinding function(@Nonnull final ObservableList<T> items, @Nonnull final Supplier<Double> supplier, @Nonnull final Function<? super T, Double> mapper, @Nonnull final BinaryOperator<Double> reducer) { requireNonNull(items, ERROR_ITEMS_NULL); requireNonNull(reducer, ERROR_REDUCER_NULL); requireNonNull(supplier, ERROR_SUPPLIER_NULL); requireNonNull(mapper, ERROR_MAPPER_NULL); return createDoubleBinding(() -> items.stream().map(mapper).reduce(reducer).orElseGet(supplier), items); }
/** * Returns a double binding whose value is the reduction of all elements in the list. The mapper function is applied to each element before reduction. * * @param items the observable list of elements. * @param supplier a {@code Supplier} whose result is returned if no value is present. * @param mapper a non-interfering, stateless function to apply to each element. * @param reducer an associative, non-interfering, stateless function for combining two values. * * @return a double binding */
Returns a double binding whose value is the reduction of all elements in the list. The mapper function is applied to each element before reduction
mapToDoubleThenReduce
{ "repo_name": "griffon/griffon", "path": "subprojects/griffon-javafx/src/main/java/griffon/javafx/beans/binding/ReducingBindings.java", "license": "apache-2.0", "size": 249342 }
[ "java.util.Objects", "java.util.function.BinaryOperator", "java.util.function.Function", "java.util.function.Supplier" ]
import java.util.Objects; import java.util.function.BinaryOperator; import java.util.function.Function; import java.util.function.Supplier;
import java.util.*; import java.util.function.*;
[ "java.util" ]
java.util;
509,776
public User getMe() throws BotException;
User function() throws BotException;
/** * A simple method for testing your bot's auth token. Requires no parameters. * Returns basic information about the bot in form of a {@link User} object. * * @return User */
A simple method for testing your bot's auth token. Requires no parameters. Returns basic information about the bot in form of a <code>User</code> object
getMe
{ "repo_name": "rainu/telegram-bot-api", "path": "src/main/java/de/raysha/lib/telegram/bot/api/BotAPI.java", "license": "mit", "size": 30237 }
[ "de.raysha.lib.telegram.bot.api.exception.BotException", "de.raysha.lib.telegram.bot.api.model.User" ]
import de.raysha.lib.telegram.bot.api.exception.BotException; import de.raysha.lib.telegram.bot.api.model.User;
import de.raysha.lib.telegram.bot.api.exception.*; import de.raysha.lib.telegram.bot.api.model.*;
[ "de.raysha.lib" ]
de.raysha.lib;
2,761,409
public final PropertiesBuilder setHttpClient(final HttpClient httpClient) { this.httpClient = httpClient; return this; }
final PropertiesBuilder function(final HttpClient httpClient) { this.httpClient = httpClient; return this; }
/** * {@code Apache HttpClient} to use for connecting to the API end point. It is recommended to configure connection * pooling on the client. This is required. * * @param httpClient HttpClient to use for connecting to the API end point. * @return The builder object reference. */
Apache HttpClient to use for connecting to the API end point. It is recommended to configure connection pooling on the client. This is required
setHttpClient
{ "repo_name": "spasam/terremark-api", "path": "src/main/java/com/terremark/config/PropertiesBuilder.java", "license": "apache-2.0", "size": 10295 }
[ "org.apache.http.client.HttpClient" ]
import org.apache.http.client.HttpClient;
import org.apache.http.client.*;
[ "org.apache.http" ]
org.apache.http;
212,250
@Test public void moveBlock() throws Exception { TieredBlockStoreTestUtils.cache(SESSION_ID1, BLOCK_ID1, BLOCK_SIZE, mTestDir1, mMetaManager, mEvictor); mBlockStore.moveBlock(SESSION_ID1, BLOCK_ID1, mTestDir2.toBlockStoreLocation()); Assert.assertFalse(mTestDir1.hasBlockMeta(BLOCK_ID1)); Assert.assertTrue(mTestDir2.hasBlockMeta(BLOCK_ID1)); Assert.assertTrue(mBlockStore.hasBlockMeta(BLOCK_ID1)); Assert.assertFalse(FileUtils.exists(BlockMeta.commitPath(mTestDir1, BLOCK_ID1))); Assert.assertTrue(FileUtils.exists(BlockMeta.commitPath(mTestDir2, BLOCK_ID1))); // Move block from the specific Dir TieredBlockStoreTestUtils.cache(SESSION_ID2, BLOCK_ID2, BLOCK_SIZE, mTestDir1, mMetaManager, mEvictor); // Move block from wrong Dir mThrown.expect(BlockDoesNotExistException.class); mThrown.expectMessage(ExceptionMessage.BLOCK_NOT_FOUND_AT_LOCATION.getMessage(BLOCK_ID2, mTestDir2.toBlockStoreLocation())); mBlockStore.moveBlock(SESSION_ID2, BLOCK_ID2, mTestDir2.toBlockStoreLocation(), mTestDir3.toBlockStoreLocation()); // Move block from right Dir mBlockStore.moveBlock(SESSION_ID2, BLOCK_ID2, mTestDir1.toBlockStoreLocation(), mTestDir3.toBlockStoreLocation()); Assert.assertFalse(mTestDir1.hasBlockMeta(BLOCK_ID2)); Assert.assertTrue(mTestDir3.hasBlockMeta(BLOCK_ID2)); Assert.assertTrue(mBlockStore.hasBlockMeta(BLOCK_ID2)); Assert.assertFalse(FileUtils.exists(BlockMeta.commitPath(mTestDir1, BLOCK_ID2))); Assert.assertTrue(FileUtils.exists(BlockMeta.commitPath(mTestDir3, BLOCK_ID2))); // Move block from the specific tier mBlockStore.moveBlock(SESSION_ID2, BLOCK_ID2, BlockStoreLocation.anyDirInTier(mTestDir1.getParentTier().getTierAlias()), mTestDir3.toBlockStoreLocation()); Assert.assertFalse(mTestDir1.hasBlockMeta(BLOCK_ID2)); Assert.assertTrue(mTestDir3.hasBlockMeta(BLOCK_ID2)); Assert.assertTrue(mBlockStore.hasBlockMeta(BLOCK_ID2)); Assert.assertFalse(FileUtils.exists(BlockMeta.commitPath(mTestDir1, BLOCK_ID2))); Assert.assertTrue(FileUtils.exists(BlockMeta.commitPath(mTestDir3, BLOCK_ID2))); }
void function() throws Exception { TieredBlockStoreTestUtils.cache(SESSION_ID1, BLOCK_ID1, BLOCK_SIZE, mTestDir1, mMetaManager, mEvictor); mBlockStore.moveBlock(SESSION_ID1, BLOCK_ID1, mTestDir2.toBlockStoreLocation()); Assert.assertFalse(mTestDir1.hasBlockMeta(BLOCK_ID1)); Assert.assertTrue(mTestDir2.hasBlockMeta(BLOCK_ID1)); Assert.assertTrue(mBlockStore.hasBlockMeta(BLOCK_ID1)); Assert.assertFalse(FileUtils.exists(BlockMeta.commitPath(mTestDir1, BLOCK_ID1))); Assert.assertTrue(FileUtils.exists(BlockMeta.commitPath(mTestDir2, BLOCK_ID1))); TieredBlockStoreTestUtils.cache(SESSION_ID2, BLOCK_ID2, BLOCK_SIZE, mTestDir1, mMetaManager, mEvictor); mThrown.expect(BlockDoesNotExistException.class); mThrown.expectMessage(ExceptionMessage.BLOCK_NOT_FOUND_AT_LOCATION.getMessage(BLOCK_ID2, mTestDir2.toBlockStoreLocation())); mBlockStore.moveBlock(SESSION_ID2, BLOCK_ID2, mTestDir2.toBlockStoreLocation(), mTestDir3.toBlockStoreLocation()); mBlockStore.moveBlock(SESSION_ID2, BLOCK_ID2, mTestDir1.toBlockStoreLocation(), mTestDir3.toBlockStoreLocation()); Assert.assertFalse(mTestDir1.hasBlockMeta(BLOCK_ID2)); Assert.assertTrue(mTestDir3.hasBlockMeta(BLOCK_ID2)); Assert.assertTrue(mBlockStore.hasBlockMeta(BLOCK_ID2)); Assert.assertFalse(FileUtils.exists(BlockMeta.commitPath(mTestDir1, BLOCK_ID2))); Assert.assertTrue(FileUtils.exists(BlockMeta.commitPath(mTestDir3, BLOCK_ID2))); mBlockStore.moveBlock(SESSION_ID2, BLOCK_ID2, BlockStoreLocation.anyDirInTier(mTestDir1.getParentTier().getTierAlias()), mTestDir3.toBlockStoreLocation()); Assert.assertFalse(mTestDir1.hasBlockMeta(BLOCK_ID2)); Assert.assertTrue(mTestDir3.hasBlockMeta(BLOCK_ID2)); Assert.assertTrue(mBlockStore.hasBlockMeta(BLOCK_ID2)); Assert.assertFalse(FileUtils.exists(BlockMeta.commitPath(mTestDir1, BLOCK_ID2))); Assert.assertTrue(FileUtils.exists(BlockMeta.commitPath(mTestDir3, BLOCK_ID2))); }
/** * Tests the {@link TieredBlockStore#moveBlock(long, long, BlockStoreLocation)} method. */
Tests the <code>TieredBlockStore#moveBlock(long, long, BlockStoreLocation)</code> method
moveBlock
{ "repo_name": "bit-zyl/Alluxio-Nvdimm", "path": "core/server/src/test/java/alluxio/worker/block/TieredBlockStoreTest.java", "license": "apache-2.0", "size": 24911 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
1,447,550
public static native FileStatus lstat(String path) throws IOException;
static native FileStatus function(String path) throws IOException;
/** * Native wrapper around POSIX lstat(2) syscall. * * @param path the file to lstat. * @return a FileStatus instance containing the metadata. * @throws IOException if the lstat() syscall failed. */
Native wrapper around POSIX lstat(2) syscall
lstat
{ "repo_name": "Asana/bazel", "path": "src/main/java/com/google/devtools/build/lib/unix/NativePosixFiles.java", "license": "apache-2.0", "size": 15575 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,145,025
public List<Long> getRequestsByStatus(RequestStatus status, int maxResults, boolean ascOrder);
List<Long> function(RequestStatus status, int maxResults, boolean ascOrder);
/** * Get first or last maxResults requests that are in the specified status * * @param status * Desired request status * @param maxResults * maximal number of returned id's * @param ascOrder * defines sorting order for database query result * @return First or last maxResults request id's if ascOrder is true or false, * respectively */
Get first or last maxResults requests that are in the specified status
getRequestsByStatus
{ "repo_name": "arenadata/ambari", "path": "ambari-server/src/main/java/org/apache/ambari/server/actionmanager/ActionDBAccessor.java", "license": "apache-2.0", "size": 8089 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,191,968
@Test public void shouldReturnTwoRoots() throws Exception { // when // create second project TestProject secondProject = new TestProject(true, "Project-2"); try { IProject secondIProject = secondProject.project; // add connect project with repository new ConnectProviderOperation(secondIProject, gitDir).execute(null); try (Git git = new Git(repo)) { git.commit().setAuthor("JUnit", "[email protected]") .setMessage("Initial commit").call(); } GitSynchronizeData data = new GitSynchronizeData(repo, HEAD, HEAD, false); GitSynchronizeDataSet dataSet = new GitSynchronizeDataSet(data); // given GitResourceVariantTree grvt = new GitTestResourceVariantTree(dataSet, null, null);
void function() throws Exception { TestProject secondProject = new TestProject(true, STR); try { IProject secondIProject = secondProject.project; new ConnectProviderOperation(secondIProject, gitDir).execute(null); try (Git git = new Git(repo)) { git.commit().setAuthor("JUnit", STR) .setMessage(STR).call(); } GitSynchronizeData data = new GitSynchronizeData(repo, HEAD, HEAD, false); GitSynchronizeDataSet dataSet = new GitSynchronizeDataSet(data); GitResourceVariantTree grvt = new GitTestResourceVariantTree(dataSet, null, null);
/** * When we have two or more project associated with repository, roots() * method should return list of project. In this case we have two project * associated with particular repository, therefore '2' value is expected. * * @throws Exception */
When we have two or more project associated with repository, roots() method should return list of project. In this case we have two project associated with particular repository, therefore '2' value is expected
shouldReturnTwoRoots
{ "repo_name": "collaborative-modeling/egit", "path": "org.eclipse.egit.core.test/src/org/eclipse/egit/core/synchronize/GitResourceVariantTreeTest.java", "license": "epl-1.0", "size": 15852 }
[ "org.eclipse.core.resources.IProject", "org.eclipse.egit.core.op.ConnectProviderOperation", "org.eclipse.egit.core.synchronize.dto.GitSynchronizeData", "org.eclipse.egit.core.synchronize.dto.GitSynchronizeDataSet", "org.eclipse.egit.core.test.TestProject", "org.eclipse.jgit.api.Git" ]
import org.eclipse.core.resources.IProject; import org.eclipse.egit.core.op.ConnectProviderOperation; import org.eclipse.egit.core.synchronize.dto.GitSynchronizeData; import org.eclipse.egit.core.synchronize.dto.GitSynchronizeDataSet; import org.eclipse.egit.core.test.TestProject; import org.eclipse.jgit.api.Git;
import org.eclipse.core.resources.*; import org.eclipse.egit.core.op.*; import org.eclipse.egit.core.synchronize.dto.*; import org.eclipse.egit.core.test.*; import org.eclipse.jgit.api.*;
[ "org.eclipse.core", "org.eclipse.egit", "org.eclipse.jgit" ]
org.eclipse.core; org.eclipse.egit; org.eclipse.jgit;
2,223,142
@ServiceMethod(returns = ReturnType.SINGLE) public Response<ApiKeysInner> regenerateKeyWithResponse( String resourceGroupName, String accountName, RegenerateKeyParameters parameters, Context context) { return regenerateKeyWithResponseAsync(resourceGroupName, accountName, parameters, context).block(); }
@ServiceMethod(returns = ReturnType.SINGLE) Response<ApiKeysInner> function( String resourceGroupName, String accountName, RegenerateKeyParameters parameters, Context context) { return regenerateKeyWithResponseAsync(resourceGroupName, accountName, parameters, context).block(); }
/** * Regenerates the specified account key for the specified Cognitive Services account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName The name of Cognitive Services account. * @param parameters regenerate key parameters. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the access keys for the cognitive services account. */
Regenerates the specified account key for the specified Cognitive Services account
regenerateKeyWithResponse
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/implementation/AccountsClientImpl.java", "license": "mit", "size": 114340 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.Response", "com.azure.core.util.Context", "com.azure.resourcemanager.cognitiveservices.fluent.models.ApiKeysInner", "com.azure.resourcemanager.cognitiveservices.models.RegenerateKeyParameters" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.cognitiveservices.fluent.models.ApiKeysInner; import com.azure.resourcemanager.cognitiveservices.models.RegenerateKeyParameters;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.cognitiveservices.fluent.models.*; import com.azure.resourcemanager.cognitiveservices.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
797,793
public static long getInterfaceHash(Class cls) throws RMIHashException { try { return getInterfaceHash(getSortedMethodMap(cls.getMethods())); } catch (RMIHashException e) { // rmi.43=Failed to calculate interface hash for class {0} throw new RMIHashException(Messages.getString("rmi.43", //$NON-NLS-1$ cls), e.getCause()); } }
static long function(Class cls) throws RMIHashException { try { return getInterfaceHash(getSortedMethodMap(cls.getMethods())); } catch (RMIHashException e) { throw new RMIHashException(Messages.getString(STR, cls), e.getCause()); } }
/** * Calculates RMI interface hash * as specified in Chapter 8.3 of RMI Specification. * * @param cls * Class to calculate RMI hash for. * * @return RMI hash for the specified class. * * @throws RMIHashException * If some error occurs. */
Calculates RMI interface hash as specified in Chapter 8.3 of RMI Specification
getInterfaceHash
{ "repo_name": "skyHALud/codenameone", "path": "Ports/iOSPort/xmlvm/apache-harmony-6.0-src-r991881/classlib/modules/rmi/src/main/java/org/apache/harmony/rmi/common/RMIHash.java", "license": "gpl-2.0", "size": 7416 }
[ "org.apache.harmony.rmi.internal.nls.Messages" ]
import org.apache.harmony.rmi.internal.nls.Messages;
import org.apache.harmony.rmi.internal.nls.*;
[ "org.apache.harmony" ]
org.apache.harmony;
1,448,354
public List<Map<String, Long>> resolvePackages(List<Integer> userPackages, User user) { List<Map<String, Long>> selected = new ArrayList<Map<String, Long>>(); for (Integer pkgId : userPackages) { Map<String, Long> pkgMap = new HashMap<String, Long>(); Package pkg = PackageManager.lookupByIdAndUser( new Long(pkgId.longValue()), user); if (pkg == null) { throw new InvalidPackageException(pkgId.toString()); } pkgMap.put("name_id", pkg.getPackageName().getId()); pkgMap.put("evr_id", pkg.getPackageEvr().getId()); pkgMap.put("arch_id", pkg.getPackageArch().getId()); selected.add(pkgMap); } return selected; }
List<Map<String, Long>> function(List<Integer> userPackages, User user) { List<Map<String, Long>> selected = new ArrayList<Map<String, Long>>(); for (Integer pkgId : userPackages) { Map<String, Long> pkgMap = new HashMap<String, Long>(); Package pkg = PackageManager.lookupByIdAndUser( new Long(pkgId.longValue()), user); if (pkg == null) { throw new InvalidPackageException(pkgId.toString()); } pkgMap.put(STR, pkg.getPackageName().getId()); pkgMap.put(STR, pkg.getPackageEvr().getId()); pkgMap.put(STR, pkg.getPackageArch().getId()); selected.add(pkgMap); } return selected; }
/** * Resolve packages from IDs. * * @param userPackages User packages * @param user User of the system * @return selectedPackages Map of the selected packages */
Resolve packages from IDs
resolvePackages
{ "repo_name": "xkollar/spacewalk", "path": "java/code/src/com/redhat/rhn/frontend/xmlrpc/chain/ActionChainRPCCommon.java", "license": "gpl-2.0", "size": 3922 }
[ "com.redhat.rhn.domain.rhnpackage.Package", "com.redhat.rhn.domain.user.User", "com.redhat.rhn.frontend.xmlrpc.InvalidPackageException", "com.redhat.rhn.manager.rhnpackage.PackageManager", "java.util.ArrayList", "java.util.HashMap", "java.util.List", "java.util.Map" ]
import com.redhat.rhn.domain.rhnpackage.Package; import com.redhat.rhn.domain.user.User; import com.redhat.rhn.frontend.xmlrpc.InvalidPackageException; import com.redhat.rhn.manager.rhnpackage.PackageManager; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map;
import com.redhat.rhn.domain.rhnpackage.*; import com.redhat.rhn.domain.user.*; import com.redhat.rhn.frontend.xmlrpc.*; import com.redhat.rhn.manager.rhnpackage.*; import java.util.*;
[ "com.redhat.rhn", "java.util" ]
com.redhat.rhn; java.util;
1,022,463
private static String toString(LinearRegressionModel mdl) { BiFunction<Integer, Double, String> formatter = (idx, val) -> String.format("%.2f*f%d", val, idx); Vector weights = mdl.getWeights(); StringBuilder sb = new StringBuilder(formatter.apply(0, weights.get(0))); for (int fid = 1; fid < weights.size(); fid++) { double w = weights.get(fid); sb.append(" ").append(w > 0 ? "+" : "-").append(" ") .append(formatter.apply(fid, Math.abs(w))); } double intercept = mdl.getIntercept(); sb.append(" ").append(intercept > 0 ? "+" : "-").append(" ") .append(String.format("%.2f", Math.abs(intercept))); return sb.toString(); }
static String function(LinearRegressionModel mdl) { BiFunction<Integer, Double, String> formatter = (idx, val) -> String.format(STR, val, idx); Vector weights = mdl.getWeights(); StringBuilder sb = new StringBuilder(formatter.apply(0, weights.get(0))); for (int fid = 1; fid < weights.size(); fid++) { double w = weights.get(fid); sb.append(" ").append(w > 0 ? "+" : "-").append(" ") .append(formatter.apply(fid, Math.abs(w))); } double intercept = mdl.getIntercept(); sb.append(" ").append(intercept > 0 ? "+" : "-").append(" ") .append(String.format("%.2f", Math.abs(intercept))); return sb.toString(); }
/** * Prepare pretty string for model. * * @param mdl Model. * @return String representation of model. */
Prepare pretty string for model
toString
{ "repo_name": "nizhikov/ignite", "path": "examples/src/main/java/org/apache/ignite/examples/ml/regression/linear/BostonHousePricesPredictionExample.java", "license": "apache-2.0", "size": 5549 }
[ "java.util.function.BiFunction", "org.apache.ignite.ml.math.primitives.vector.Vector", "org.apache.ignite.ml.regressions.linear.LinearRegressionModel" ]
import java.util.function.BiFunction; import org.apache.ignite.ml.math.primitives.vector.Vector; import org.apache.ignite.ml.regressions.linear.LinearRegressionModel;
import java.util.function.*; import org.apache.ignite.ml.math.primitives.vector.*; import org.apache.ignite.ml.regressions.linear.*;
[ "java.util", "org.apache.ignite" ]
java.util; org.apache.ignite;
806,242
void setClientState(KaaClientState state);
void setClientState(KaaClientState state);
/** * Sets the given client's state . * * @param state the client's state to be set. * */
Sets the given client's state
setClientState
{ "repo_name": "kallelzied/kaa", "path": "client/client-multi/client-java-core/src/main/java/org/kaaproject/kaa/client/channel/MetaDataTransport.java", "license": "apache-2.0", "size": 1873 }
[ "org.kaaproject.kaa.client.persistence.KaaClientState" ]
import org.kaaproject.kaa.client.persistence.KaaClientState;
import org.kaaproject.kaa.client.persistence.*;
[ "org.kaaproject.kaa" ]
org.kaaproject.kaa;
1,539,711
@Deprecated protected void showOverlay(TableRowElement unused) { showOverlay(); }
void function(TableRowElement unused) { showOverlay(); }
/** * Equivalent to {@code showOverlay()}. The argument is ignored. * * @param unused * ignored argument * * @deprecated As of 7.5, use {@link #showOverlay()} instead. */
Equivalent to showOverlay(). The argument is ignored
showOverlay
{ "repo_name": "shahrzadmn/vaadin", "path": "client/src/com/vaadin/client/widgets/Grid.java", "license": "apache-2.0", "size": 302957 }
[ "com.google.gwt.dom.client.TableRowElement" ]
import com.google.gwt.dom.client.TableRowElement;
import com.google.gwt.dom.client.*;
[ "com.google.gwt" ]
com.google.gwt;
1,526,930
Task<Target, Transformation> view(@NonNull ImageView view);
Task<Target, Transformation> view(@NonNull ImageView view);
/** * Specifies an image view to which should be attached image bitmap loaded via this task. * * @param view The desired image view. * @return This task to allow methods chaining. * @see #view() * @see #transform(Object) */
Specifies an image view to which should be attached image bitmap loaded via this task
view
{ "repo_name": "android-libraries/android_image_loader", "path": "library/src/main/java/com/albedinsky/android/imageloader/ImageLoader.java", "license": "apache-2.0", "size": 11550 }
[ "android.support.annotation.NonNull", "android.widget.ImageView" ]
import android.support.annotation.NonNull; import android.widget.ImageView;
import android.support.annotation.*; import android.widget.*;
[ "android.support", "android.widget" ]
android.support; android.widget;
1,872,023
public void handleMultiBlockChange(S22PacketMultiBlockChange packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); for (S22PacketMultiBlockChange.BlockUpdateData s22packetmultiblockchange$blockupdatedata : packetIn.getChangedBlocks()) { this.clientWorldController.invalidateRegionAndSetBlock(s22packetmultiblockchange$blockupdatedata.getPos(), s22packetmultiblockchange$blockupdatedata.getBlockState()); } }
void function(S22PacketMultiBlockChange packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); for (S22PacketMultiBlockChange.BlockUpdateData s22packetmultiblockchange$blockupdatedata : packetIn.getChangedBlocks()) { this.clientWorldController.invalidateRegionAndSetBlock(s22packetmultiblockchange$blockupdatedata.getPos(), s22packetmultiblockchange$blockupdatedata.getBlockState()); } }
/** * Received from the servers PlayerManager if between 1 and 64 blocks in a chunk are changed. If only one block * requires an update, the server sends S23PacketBlockChange and if 64 or more blocks are changed, the server sends * S21PacketChunkData */
Received from the servers PlayerManager if between 1 and 64 blocks in a chunk are changed. If only one block requires an update, the server sends S23PacketBlockChange and if 64 or more blocks are changed, the server sends S21PacketChunkData
handleMultiBlockChange
{ "repo_name": "tomtomtom09/CampCraft", "path": "build/tmp/recompileMc/sources/net/minecraft/client/network/NetHandlerPlayClient.java", "license": "gpl-3.0", "size": 95487 }
[ "net.minecraft.network.PacketThreadUtil", "net.minecraft.network.play.server.S22PacketMultiBlockChange" ]
import net.minecraft.network.PacketThreadUtil; import net.minecraft.network.play.server.S22PacketMultiBlockChange;
import net.minecraft.network.*; import net.minecraft.network.play.server.*;
[ "net.minecraft.network" ]
net.minecraft.network;
2,106,794
public static ArrayList<ArrayList<int[]>> segmentBoundariesRaw(final int[][] labels, final int nbLabels, final int[][] neighbors) { ArrayList<ArrayList<int[]>> boundaryCoords = new ArrayList<ArrayList<int[]>>(); for (int i=0; i<nbLabels; i++) { boundaryCoords.add(i, new ArrayList<int[]>() ); } // segmentation sizes int width = labels.length; int height = labels[0].length; int k; // add just boundaries because all image boundaries has to be segment boundaries // parallel first and last row for ( int i = 0; i < width; i++ ) { boundaryCoords.get(labels[i][0]).add(new int[]{i,0}); boundaryCoords.get(labels[i][height-1]).add(new int[]{i,height-1}); } // parallel first and last column for ( int i = 1; i < height-1; i++ ) { boundaryCoords.get(labels[0][i]).add(new int[]{0,i}); boundaryCoords.get(labels[width-1][i]).add(new int[]{width-1,i}); } // go over all pixels in distance 1 from image boundaries which means // that segm[0][0], segm[0][end], segm[end][0], segm[end][end] may // not be not covered in case of 4-neighborhood for (int i=1; i<width-1; i++) { for (int j=1; j<height-1; j++) { // over all defined neighbors for (k=0; k<neighbors.length; k++) { if (labels[i][j] != labels[ i+neighbors[k][0] ][ j+neighbors[k][1] ]) { boundaryCoords.get(labels[i][j]).add( new int[]{i, j} ); break; } } } } return boundaryCoords; } public static final int[][] CONNECT4 = {{-1,0},{0,-1},{1,0},{0,1}}; // public static int[][] CONNECT4 = {{-1,0,1,0},{0,-1,0,1}} public static final int[][] CONNECT8 = {{-1,1},{-1,0},{-1,-1},{0,-1},{1,-1},{1,0},{1,1},{0,1}}; // public static int[][] CONNECT8 = {{-1,-1,-1,0,1,1,1,0},{1,0,-1,-1,-1,0,1,1}}
static ArrayList<ArrayList<int[]>> function(final int[][] labels, final int nbLabels, final int[][] neighbors) { ArrayList<ArrayList<int[]>> boundaryCoords = new ArrayList<ArrayList<int[]>>(); for (int i=0; i<nbLabels; i++) { boundaryCoords.add(i, new ArrayList<int[]>() ); } int width = labels.length; int height = labels[0].length; int k; for ( int i = 0; i < width; i++ ) { boundaryCoords.get(labels[i][0]).add(new int[]{i,0}); boundaryCoords.get(labels[i][height-1]).add(new int[]{i,height-1}); } for ( int i = 1; i < height-1; i++ ) { boundaryCoords.get(labels[0][i]).add(new int[]{0,i}); boundaryCoords.get(labels[width-1][i]).add(new int[]{width-1,i}); } for (int i=1; i<width-1; i++) { for (int j=1; j<height-1; j++) { for (k=0; k<neighbors.length; k++) { if (labels[i][j] != labels[ i+neighbors[k][0] ][ j+neighbors[k][1] ]) { boundaryCoords.get(labels[i][j]).add( new int[]{i, j} ); break; } } } } return boundaryCoords; } public static final int[][] CONNECT4 = {{-1,0},{0,-1},{1,0},{0,1}}; public static final int[][] CONNECT8 = {{-1,1},{-1,0},{-1,-1},{0,-1},{1,-1},{1,0},{1,1},{0,1}};
/** * returns coordinates of all points belonging to the boundaries among * different labels in given segmentation, all image boundaries are * automatically considered also as segments boundaries * Note: there is no order in these boundary points * * @param neighborhood is matrix int[nbPints][nbDims] describing the * connectivity around one pixel in given regular grid * @param nbLabels is number of all labelles in segmentation * @return int[nbPixels][nbDims] coordinates of the bordering points */
returns coordinates of all points belonging to the boundaries among different labels in given segmentation, all image boundaries are automatically considered also as segments boundaries Note: there is no order in these boundary points
segmentBoundariesRaw
{ "repo_name": "dscho/ij-CMP-BIA", "path": "src/main/java/sc/fiji/CMP_BIA/segmentation/tools/Connectivity2D.java", "license": "gpl-2.0", "size": 13469 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
1,230,899
private static void init(String host, String portStr) { root = Category.getRoot(); BasicConfigurator.configure(); try { int port = Integer.parseInt(portStr); cat.info("Creating socket appender ("+host+","+port+")."); sapp = new SocketAppender(host, port); sapp.setName("Sapp"); root.addAppender(sapp); } catch(java.lang.NumberFormatException efe) { efe.printStackTrace(); usage("Could not interpret port number ["+ portStr +"]."); } catch(Exception ge) { System.err.println("Could not start!"); ge.printStackTrace(); } }
static void function(String host, String portStr) { root = Category.getRoot(); BasicConfigurator.configure(); try { int port = Integer.parseInt(portStr); cat.info(STR+host+","+port+")."); sapp = new SocketAppender(host, port); sapp.setName("Sapp"); root.addAppender(sapp); } catch(java.lang.NumberFormatException efe) { efe.printStackTrace(); usage(STR+ portStr +"]."); } catch(Exception ge) { System.err.println(STR); ge.printStackTrace(); } }
/** * init socket appender * @param host - host IP address of log4j server * @param postStr - port number 0f log4j server */
init socket appender
init
{ "repo_name": "jredden/cosmos", "path": "src/main/java/com/zenred/infra/Log.java", "license": "agpl-3.0", "size": 3678 }
[ "org.apache.log4j.BasicConfigurator", "org.apache.log4j.Category", "org.apache.log4j.net.SocketAppender" ]
import org.apache.log4j.BasicConfigurator; import org.apache.log4j.Category; import org.apache.log4j.net.SocketAppender;
import org.apache.log4j.*; import org.apache.log4j.net.*;
[ "org.apache.log4j" ]
org.apache.log4j;
126,533
private ArrayList<DiskLatency> getSlowDisks( Map<String, DiskLatency> reports, int numDisks, long now) { if (reports.isEmpty()) { return new ArrayList(ImmutableList.of()); }
ArrayList<DiskLatency> function( Map<String, DiskLatency> reports, int numDisks, long now) { if (reports.isEmpty()) { return new ArrayList(ImmutableList.of()); }
/** * Retrieve a list of stop low disks i.e disks with the highest max latencies. * @param numDisks number of disks to return. This is to limit the size of * the generated JSON. */
Retrieve a list of stop low disks i.e disks with the highest max latencies
getSlowDisks
{ "repo_name": "lukmajercak/hadoop", "path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/SlowDiskTracker.java", "license": "apache-2.0", "size": 9524 }
[ "com.google.common.collect.ImmutableList", "java.util.ArrayList", "java.util.Map" ]
import com.google.common.collect.ImmutableList; import java.util.ArrayList; import java.util.Map;
import com.google.common.collect.*; import java.util.*;
[ "com.google.common", "java.util" ]
com.google.common; java.util;
788,556
public void setReceiveFilterIP(InetAddress ip) { filterIP = ip; }
void function(InetAddress ip) { filterIP = ip; }
/** * This is useful on UDP Broadcast receivers where we'd otherwise receive * our own sent packets */
This is useful on UDP Broadcast receivers where we'd otherwise receive our own sent packets
setReceiveFilterIP
{ "repo_name": "thinktube-kobe/airtube", "path": "JavaLibrary/src/com/thinktube/net/nio/UDPConnection.java", "license": "lgpl-3.0", "size": 7244 }
[ "java.net.InetAddress" ]
import java.net.InetAddress;
import java.net.*;
[ "java.net" ]
java.net;
2,224,449
public RunningExecutionsResult getRunningExecutions(String projectName, String flowId) throws Exception { final URI uri = new URIBuilder(executionUri) .setParameter("session.id", sessionId) .setParameter("ajax", "getRunning") .setParameter("project", projectName) .setParameter("flow", flowId) .build(); final HttpGet get = new HttpGet(uri); final String json = HttpManager.get(get); logger.info("Running executions result: \n{}", json); return (RunningExecutionsResult) JsonUtil.deserialize(json, RunningExecutionsResult.class); }
RunningExecutionsResult function(String projectName, String flowId) throws Exception { final URI uri = new URIBuilder(executionUri) .setParameter(STR, sessionId) .setParameter("ajax", STR) .setParameter(STR, projectName) .setParameter("flow", flowId) .build(); final HttpGet get = new HttpGet(uri); final String json = HttpManager.get(get); logger.info(STR, json); return (RunningExecutionsResult) JsonUtil.deserialize(json, RunningExecutionsResult.class); }
/** * Returns all of the current executions of the flow * * @param projectName The project to fetch from * @param flowId The id of the flow to executeFlow the exections for * @return List of flow ID's that are currently executing */
Returns all of the current executions of the flow
getRunningExecutions
{ "repo_name": "ezbake/ezbake-azkaban-submitter", "path": "azkaban-submitter/src/main/java/ezbake/azkaban/manager/ExecutionManager.java", "license": "apache-2.0", "size": 7147 }
[ "org.apache.http.client.methods.HttpGet", "org.apache.http.client.utils.URIBuilder" ]
import org.apache.http.client.methods.HttpGet; import org.apache.http.client.utils.URIBuilder;
import org.apache.http.client.methods.*; import org.apache.http.client.utils.*;
[ "org.apache.http" ]
org.apache.http;
1,965,692
public static void connectToBluetoothSocket(Object bluetoothSocket) throws IOException { // bluetoothSocket.connect(); invokeMethodThrowsIOException(getMethod(bluetoothSocket.getClass(), "connect"), bluetoothSocket); } /** * Invokes the method * {@link android.bluetooth.BluetoothSocket#getInputStream}. * * @param bluetoothSocket a {@link android.bluetooth.BluetoothSocket} object * @return the {@link InputStream}
static void function(Object bluetoothSocket) throws IOException { invokeMethodThrowsIOException(getMethod(bluetoothSocket.getClass(), STR), bluetoothSocket); } /** * Invokes the method * {@link android.bluetooth.BluetoothSocket#getInputStream}. * * @param bluetoothSocket a {@link android.bluetooth.BluetoothSocket} object * @return the {@link InputStream}
/** * Invokes the method * {@link android.bluetooth.BluetoothSocket#connect}. * * @param bluetoothSocket a {@link android.bluetooth.BluetoothSocket} object */
Invokes the method <code>android.bluetooth.BluetoothSocket#connect</code>
connectToBluetoothSocket
{ "repo_name": "mark-friedman/app-inventor-from-google-code", "path": "src/components/runtime/components/android/util/BluetoothReflection.java", "license": "apache-2.0", "size": 13409 }
[ "android.bluetooth.BluetoothSocket", "java.io.IOException", "java.io.InputStream" ]
import android.bluetooth.BluetoothSocket; import java.io.IOException; import java.io.InputStream;
import android.bluetooth.*; import java.io.*;
[ "android.bluetooth", "java.io" ]
android.bluetooth; java.io;
1,877,334
@RequestMapping(value = "/rest/activiti/process-definition-forms/{processDefinitionId}", method = RequestMethod.GET, produces = "application/json") public JsonNode getProcessDefinitionForms(@PathVariable String processDefinitionId, HttpServletRequest request) { return clientService.getProcessDefinitionForms(retrieveServerConfig(), processDefinitionId); }
@RequestMapping(value = STR, method = RequestMethod.GET, produces = STR) JsonNode function(@PathVariable String processDefinitionId, HttpServletRequest request) { return clientService.getProcessDefinitionForms(retrieveServerConfig(), processDefinitionId); }
/** * GET process definition's list of deployed forms. */
GET process definition's list of deployed forms
getProcessDefinitionForms
{ "repo_name": "stefan-ziel/Activiti", "path": "modules/activiti-admin/src/main/java/com/activiti/web/rest/client/FormsClientResource.java", "license": "apache-2.0", "size": 2202 }
[ "com.fasterxml.jackson.databind.JsonNode", "javax.servlet.http.HttpServletRequest", "org.springframework.web.bind.annotation.PathVariable", "org.springframework.web.bind.annotation.RequestMapping", "org.springframework.web.bind.annotation.RequestMethod" ]
import com.fasterxml.jackson.databind.JsonNode; import javax.servlet.http.HttpServletRequest; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod;
import com.fasterxml.jackson.databind.*; import javax.servlet.http.*; import org.springframework.web.bind.annotation.*;
[ "com.fasterxml.jackson", "javax.servlet", "org.springframework.web" ]
com.fasterxml.jackson; javax.servlet; org.springframework.web;
2,460,860
public boolean visitStringLiteral(ExpressionOwner owner, XString str) { return true; }
boolean function(ExpressionOwner owner, XString str) { return true; }
/** * Visit a string literal. * @param owner The owner of the expression, to which the expression can * be reset if rewriting takes place. * @param str The string literal object. * @return true if the sub expressions should be traversed. */
Visit a string literal
visitStringLiteral
{ "repo_name": "md-5/jdk10", "path": "src/java.xml/share/classes/com/sun/org/apache/xpath/internal/XPathVisitor.java", "license": "gpl-2.0", "size": 7950 }
[ "com.sun.org.apache.xpath.internal.objects.XString" ]
import com.sun.org.apache.xpath.internal.objects.XString;
import com.sun.org.apache.xpath.internal.objects.*;
[ "com.sun.org" ]
com.sun.org;
214,960
public List<Sku> readAllSkus();
List<Sku> function();
/** * Retrieve all {@code Sku} instances from the datastore * * @return the list of all skus */
Retrieve all Sku instances from the datastore
readAllSkus
{ "repo_name": "sitexa/BroadleafCommerce", "path": "core/broadleaf-framework/src/main/java/org/broadleafcommerce/core/catalog/dao/SkuDao.java", "license": "apache-2.0", "size": 5657 }
[ "java.util.List", "org.broadleafcommerce.core.catalog.domain.Sku" ]
import java.util.List; import org.broadleafcommerce.core.catalog.domain.Sku;
import java.util.*; import org.broadleafcommerce.core.catalog.domain.*;
[ "java.util", "org.broadleafcommerce.core" ]
java.util; org.broadleafcommerce.core;
760,790
default void trace(Throwable throwable) { final Optional<Throwable> oThrowable = Optional.ofNullable(throwable); log(Level.TRACE, oThrowable, oThrowable.map(Throwable::getMessage).orElse(NO_EXCEPTION_TEXT)); }
default void trace(Throwable throwable) { final Optional<Throwable> oThrowable = Optional.ofNullable(throwable); log(Level.TRACE, oThrowable, oThrowable.map(Throwable::getMessage).orElse(NO_EXCEPTION_TEXT)); }
/** * Logs a <tt>throwable</tt> at level * {@link com.speedment.fika.logger.Level#TRACE}. * * @param throwable the message to log * @throws java.lang.NullPointerException whenever <tt>level</tt> or * <tt>message</tt> is null */
Logs a throwable at level <code>com.speedment.fika.logger.Level#TRACE</code>
trace
{ "repo_name": "speedment/fika", "path": "logger/src/main/java/com/speedment/fika/logger/Logger.java", "license": "apache-2.0", "size": 47672 }
[ "java.util.Optional" ]
import java.util.Optional;
import java.util.*;
[ "java.util" ]
java.util;
1,025,571
EReference getMServiceLibraryInstance_Library();
EReference getMServiceLibraryInstance_Library();
/** * Returns the meta object for the reference '{@link es.uah.aut.srg.micobs.mclev.mclevmcad.MServiceLibraryInstance#getLibrary <em>Library</em>}'. * @return the meta object for the reference '<em>Library</em>'. * @see es.uah.aut.srg.micobs.mclev.mclevmcad.MServiceLibraryInstance#getLibrary() * @see #getMServiceLibraryInstance() * @generated */
Returns the meta object for the reference '<code>es.uah.aut.srg.micobs.mclev.mclevmcad.MServiceLibraryInstance#getLibrary Library</code>'
getMServiceLibraryInstance_Library
{ "repo_name": "parraman/micobs", "path": "mclev/es.uah.aut.srg.micobs.mclev/src/es/uah/aut/srg/micobs/mclev/mclevmcad/mclevmcadPackage.java", "license": "epl-1.0", "size": 59510 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
116,627
public static SimpleDateFormat getTimeFormat() { return OpenmrsUtil.getTimeFormat(getLocale()); }
static SimpleDateFormat function() { return OpenmrsUtil.getTimeFormat(getLocale()); }
/** * Gets the simple time format for the current user's locale. The format will be similar to * hh:mm a * * @return SimpleDateFormat for the user's current locale * @see org.openmrs.util.OpenmrsUtil#getTimeFormat(Locale) * @should return a pattern with two h characters in it */
Gets the simple time format for the current user's locale. The format will be similar to hh:mm a
getTimeFormat
{ "repo_name": "spereverziev/openmrs-core", "path": "api/src/main/java/org/openmrs/api/context/Context.java", "license": "mpl-2.0", "size": 43371 }
[ "java.text.SimpleDateFormat", "org.openmrs.util.OpenmrsUtil" ]
import java.text.SimpleDateFormat; import org.openmrs.util.OpenmrsUtil;
import java.text.*; import org.openmrs.util.*;
[ "java.text", "org.openmrs.util" ]
java.text; org.openmrs.util;
517,536
public void setPathMatcher(PathMatcher pathMatcher) { Assert.notNull(pathMatcher, "PathMatcher must not be null"); this.pathMatcher = pathMatcher; }
void function(PathMatcher pathMatcher) { Assert.notNull(pathMatcher, STR); this.pathMatcher = pathMatcher; }
/** * Set the PathMatcher implementation to use for matching URL paths * against registered URL patterns. Default is AntPathMatcher. * @see org.springframework.util.AntPathMatcher */
Set the PathMatcher implementation to use for matching URL paths against registered URL patterns. Default is AntPathMatcher
setPathMatcher
{ "repo_name": "codeApeFromChina/resource", "path": "frame_packages/java_libs/spring-2.5.6-src/src/org/springframework/web/servlet/mvc/multiaction/PropertiesMethodNameResolver.java", "license": "unlicense", "size": 3256 }
[ "org.springframework.util.Assert", "org.springframework.util.PathMatcher" ]
import org.springframework.util.Assert; import org.springframework.util.PathMatcher;
import org.springframework.util.*;
[ "org.springframework.util" ]
org.springframework.util;
2,169,728
public final LocalDriver getLocalDriver() { return localDriver; }
final LocalDriver function() { return localDriver; }
/** * Returns the local driver. * * @return The local driver. */
Returns the local driver
getLocalDriver
{ "repo_name": "neeveresearch/nvx-apps", "path": "nvx-app-oms/src/main/java/com/neeve/oms/sr/Application.java", "license": "apache-2.0", "size": 3515 }
[ "com.neeve.oms.driver.local.LocalDriver" ]
import com.neeve.oms.driver.local.LocalDriver;
import com.neeve.oms.driver.local.*;
[ "com.neeve.oms" ]
com.neeve.oms;
362,282
public List<IOError> getErrors() { return lastErrors != null ? lastErrors.getErrors() : null; }
List<IOError> function() { return lastErrors != null ? lastErrors.getErrors() : null; }
/** * Returns a list of writing errors */
Returns a list of writing errors
getErrors
{ "repo_name": "PRImA-Research-Lab/prima-core-libs", "path": "java/PrimaDla/src/org/primaresearch/dla/page/io/xml/XmlPageWriter_2013_07_15.java", "license": "apache-2.0", "size": 22644 }
[ "java.util.List", "org.primaresearch.io.xml.IOError" ]
import java.util.List; import org.primaresearch.io.xml.IOError;
import java.util.*; import org.primaresearch.io.xml.*;
[ "java.util", "org.primaresearch.io" ]
java.util; org.primaresearch.io;
956,426
public static Rectangle getBounds() { Display display = Display.getDefault(); Rectangle bounds = display.getBounds(); Rectangle result = new Rectangle(bounds.x + bounds.width / 4, bounds.y + bounds.height / 4, bounds.width / 2, bounds.height / 2); return result; }
static Rectangle function() { Display display = Display.getDefault(); Rectangle bounds = display.getBounds(); Rectangle result = new Rectangle(bounds.x + bounds.width / 4, bounds.y + bounds.height / 4, bounds.width / 2, bounds.height / 2); return result; }
/** * Gets the bounds. * * @return the bounds */
Gets the bounds
getBounds
{ "repo_name": "pgaufillet/topcased-req", "path": "plugins/org.topcased.requirement.import.document/src/org/topcased/requirement/document/ui/PopupRegexDialog.java", "license": "epl-1.0", "size": 6830 }
[ "org.eclipse.swt.graphics.Rectangle", "org.eclipse.swt.widgets.Display" ]
import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.graphics.*; import org.eclipse.swt.widgets.*;
[ "org.eclipse.swt" ]
org.eclipse.swt;
2,913,947
final BallThread ballThread = new BallThread(); final BallItem ballItem = mock(BallItem.class); ballThread.setTwin(ballItem); ballThread.start(); verify(ballItem, timeout(2000).atLeastOnce()).draw(); verify(ballItem, timeout(2000).atLeastOnce()).move(); ballThread.suspendMe(); sleep(1000); ballThread.stopMe(); ballThread.join(); verifyNoMoreInteractions(ballItem); }
final BallThread ballThread = new BallThread(); final BallItem ballItem = mock(BallItem.class); ballThread.setTwin(ballItem); ballThread.start(); verify(ballItem, timeout(2000).atLeastOnce()).draw(); verify(ballItem, timeout(2000).atLeastOnce()).move(); ballThread.suspendMe(); sleep(1000); ballThread.stopMe(); ballThread.join(); verifyNoMoreInteractions(ballItem); }
/** * Verify if the {@link BallThread} can be resumed */
Verify if the <code>BallThread</code> can be resumed
testSuspend
{ "repo_name": "hoswey/java-design-patterns", "path": "twin/src/test/java/com/iluwatar/twin/BallThreadTest.java", "license": "mit", "size": 2367 }
[ "java.lang.Thread", "org.mockito.Mockito" ]
import java.lang.Thread; import org.mockito.Mockito;
import java.lang.*; import org.mockito.*;
[ "java.lang", "org.mockito" ]
java.lang; org.mockito;
2,801,608
public void saveFeatureSet(FeatureSet featureSet, PrintWriter out) { assert null != featureSet.getFeatures(); Set<?> keySet = featureSet.getProperties().keySet(); String[] keys = new String[keySet.size()]; int i = 0; for (Object key : keySet) keys[i++] = key.toString(); Arrays.sort(keys); for (i = 0; i < keys.length; i++) { Object propertyValue = featureSet.getProperties().get(keys[i]); //if this property is known about by an extra info def, let the def handle it Set<FeatureExtraInformationDef> infoDefsToTry = new HashSet<FeatureExtraInformationDef>(); infoDefsToTry.addAll(featureSet.getExtraInformationTypes()); for (FeatureExtraInformationDef standardInfoDef : FeatureExtraInformationDef.getStandardExtraInformationTypes()) { infoDefsToTry.add(standardInfoDef); } for (FeatureExtraInformationDef extraInfoDef : infoDefsToTry) { if (extraInfoDef.isThisTypeOfFeatureSetProperty(keys[i])) { propertyValue = extraInfoDef.convertFeatureSetPropertyToString( extraInfoDef.stripPrefixFromFeatureSetPropertyName(keys[i]), propertyValue); break; } } out.println("# " + keys[i] + "=" + propertyValue); } String header = Feature.getFeatureHeader(featureSet.getExtraInformationTypesArray()); if (dumpWindow) header += "\twindow"; out.println(header); out.flush(); Feature[] features = featureSet.getFeatures(); for (i = 0; i < features.length; i++) { out.print(features[i].toString(featureSet.getExtraInformationTypesArray())); if (dumpWindow && null != features[i].intensityWindow) out.print("\t" + join(features[i].intensityWindow, ",")); out.println(); } out.flush(); }
void function(FeatureSet featureSet, PrintWriter out) { assert null != featureSet.getFeatures(); Set<?> keySet = featureSet.getProperties().keySet(); String[] keys = new String[keySet.size()]; int i = 0; for (Object key : keySet) keys[i++] = key.toString(); Arrays.sort(keys); for (i = 0; i < keys.length; i++) { Object propertyValue = featureSet.getProperties().get(keys[i]); Set<FeatureExtraInformationDef> infoDefsToTry = new HashSet<FeatureExtraInformationDef>(); infoDefsToTry.addAll(featureSet.getExtraInformationTypes()); for (FeatureExtraInformationDef standardInfoDef : FeatureExtraInformationDef.getStandardExtraInformationTypes()) { infoDefsToTry.add(standardInfoDef); } for (FeatureExtraInformationDef extraInfoDef : infoDefsToTry) { if (extraInfoDef.isThisTypeOfFeatureSetProperty(keys[i])) { propertyValue = extraInfoDef.convertFeatureSetPropertyToString( extraInfoDef.stripPrefixFromFeatureSetPropertyName(keys[i]), propertyValue); break; } } out.println(STR + keys[i] + "=" + propertyValue); } String header = Feature.getFeatureHeader(featureSet.getExtraInformationTypesArray()); if (dumpWindow) header += STR; out.println(header); out.flush(); Feature[] features = featureSet.getFeatures(); for (i = 0; i < features.length; i++) { out.print(features[i].toString(featureSet.getExtraInformationTypesArray())); if (dumpWindow && null != features[i].intensityWindow) out.print("\t" + join(features[i].intensityWindow, ",")); out.println(); } out.flush(); }
/** * Save a FeatureSet * @param featureSet * @param out */
Save a FeatureSet
saveFeatureSet
{ "repo_name": "dhmay/msInspect", "path": "src/org/fhcrc/cpl/toolbox/proteomics/feature/filehandler/NativeTSVFeatureFileHandler.java", "license": "apache-2.0", "size": 8966 }
[ "java.io.PrintWriter", "java.util.Arrays", "java.util.HashSet", "java.util.Set", "org.fhcrc.cpl.toolbox.proteomics.feature.Feature", "org.fhcrc.cpl.toolbox.proteomics.feature.FeatureSet", "org.fhcrc.cpl.toolbox.proteomics.feature.extraInfo.FeatureExtraInformationDef" ]
import java.io.PrintWriter; import java.util.Arrays; import java.util.HashSet; import java.util.Set; import org.fhcrc.cpl.toolbox.proteomics.feature.Feature; import org.fhcrc.cpl.toolbox.proteomics.feature.FeatureSet; import org.fhcrc.cpl.toolbox.proteomics.feature.extraInfo.FeatureExtraInformationDef;
import java.io.*; import java.util.*; import org.fhcrc.cpl.toolbox.proteomics.feature.*;
[ "java.io", "java.util", "org.fhcrc.cpl" ]
java.io; java.util; org.fhcrc.cpl;
2,566,557
public void testTautology10() throws Exception { final Element ele = BasicParser.createElement( "<IMPL><PREDVAR id=\"A\"/><OR><NOT><PREDVAR id=\"B\"/></NOT><PREDVAR id=\"A\"/></OR></IMPL>"); // System.out.println(ele.toString()); assertTrue(isTautology(ele)); }
void function() throws Exception { final Element ele = BasicParser.createElement( STRA\STRB\STRA\STR); assertTrue(isTautology(ele)); }
/** * Function: isTautology(Element) * Type: positive * Data: A -> -B v A * * @throws Exception Test failed. */
Function: isTautology(Element) Type: positive Data: A -> -B v A
testTautology10
{ "repo_name": "m-31/qedeq", "path": "QedeqKernelBoTest/src/org/qedeq/kernel/bo/logic/model/DynamicDirectInterpreterTest.java", "license": "gpl-2.0", "size": 82947 }
[ "org.qedeq.kernel.se.base.list.Element", "org.qedeq.kernel.xml.parser.BasicParser" ]
import org.qedeq.kernel.se.base.list.Element; import org.qedeq.kernel.xml.parser.BasicParser;
import org.qedeq.kernel.se.base.list.*; import org.qedeq.kernel.xml.parser.*;
[ "org.qedeq.kernel" ]
org.qedeq.kernel;
770,779
public Filter createFilter(BridgeContext ctx, Element filterElement, Element filteredElement, GraphicsNode filteredNode, Filter inputFilter, Rectangle2D filterRegion, Map filterMap) { // 'order' attribute - default is [3, 3] int[] orderXY = convertOrder(filterElement, ctx); // 'kernelMatrix' attribute - required float[] kernelMatrix = convertKernelMatrix(filterElement, orderXY, ctx); // 'divisor' attribute - default is kernel matrix sum or 1 if sum is 0 float divisor = convertDivisor(filterElement, kernelMatrix, ctx); // 'bias' attribute - default is 0 float bias = convertNumber(filterElement, SVG_BIAS_ATTRIBUTE, 0, ctx); // 'targetX' and 'targetY' attribute int[] targetXY = convertTarget(filterElement, orderXY, ctx); // 'edgeMode' attribute - default is 'duplicate' PadMode padMode = convertEdgeMode(filterElement, ctx); // 'kernelUnitLength' attribute double[] kernelUnitLength = convertKernelUnitLength(filterElement, ctx); // 'preserveAlpha' attribute - default is 'false' boolean preserveAlpha = convertPreserveAlpha(filterElement, ctx); // 'in' attribute Filter in = getIn(filterElement, filteredElement, filteredNode, inputFilter, filterMap, ctx); if (in == null) { return null; // disable the filter } // Default region is the size of in (if in is SourceGraphic or // SourceAlpha it will already include a pad/crop to the // proper filter region size). Rectangle2D defaultRegion = in.getBounds2D(); Rectangle2D primitiveRegion = SVGUtilities.convertFilterPrimitiveRegion(filterElement, filteredElement, filteredNode, defaultRegion, filterRegion, ctx); PadRable pad = new PadRable8Bit(in, primitiveRegion, PadMode.ZERO_PAD); // build the convolve filter ConvolveMatrixRable convolve = new ConvolveMatrixRable8Bit(pad); for (int i = 0; i < kernelMatrix.length; i++) { kernelMatrix[i] /= divisor; } convolve.setKernel(new Kernel(orderXY[0], orderXY[1], kernelMatrix)); convolve.setTarget(new Point(targetXY[0], targetXY[1])); convolve.setBias(bias); convolve.setEdgeMode(padMode); convolve.setKernelUnitLength(kernelUnitLength); convolve.setPreserveAlpha(preserveAlpha); // handle the 'color-interpolation-filters' property handleColorInterpolationFilters(convolve, filterElement); PadRable filter = new PadRable8Bit (convolve, primitiveRegion, PadMode.ZERO_PAD); // update the filter Map updateFilterMap(filterElement, filter, filterMap); return filter; }
Filter function(BridgeContext ctx, Element filterElement, Element filteredElement, GraphicsNode filteredNode, Filter inputFilter, Rectangle2D filterRegion, Map filterMap) { int[] orderXY = convertOrder(filterElement, ctx); float[] kernelMatrix = convertKernelMatrix(filterElement, orderXY, ctx); float divisor = convertDivisor(filterElement, kernelMatrix, ctx); float bias = convertNumber(filterElement, SVG_BIAS_ATTRIBUTE, 0, ctx); int[] targetXY = convertTarget(filterElement, orderXY, ctx); PadMode padMode = convertEdgeMode(filterElement, ctx); double[] kernelUnitLength = convertKernelUnitLength(filterElement, ctx); boolean preserveAlpha = convertPreserveAlpha(filterElement, ctx); Filter in = getIn(filterElement, filteredElement, filteredNode, inputFilter, filterMap, ctx); if (in == null) { return null; } Rectangle2D defaultRegion = in.getBounds2D(); Rectangle2D primitiveRegion = SVGUtilities.convertFilterPrimitiveRegion(filterElement, filteredElement, filteredNode, defaultRegion, filterRegion, ctx); PadRable pad = new PadRable8Bit(in, primitiveRegion, PadMode.ZERO_PAD); ConvolveMatrixRable convolve = new ConvolveMatrixRable8Bit(pad); for (int i = 0; i < kernelMatrix.length; i++) { kernelMatrix[i] /= divisor; } convolve.setKernel(new Kernel(orderXY[0], orderXY[1], kernelMatrix)); convolve.setTarget(new Point(targetXY[0], targetXY[1])); convolve.setBias(bias); convolve.setEdgeMode(padMode); convolve.setKernelUnitLength(kernelUnitLength); convolve.setPreserveAlpha(preserveAlpha); handleColorInterpolationFilters(convolve, filterElement); PadRable filter = new PadRable8Bit (convolve, primitiveRegion, PadMode.ZERO_PAD); updateFilterMap(filterElement, filter, filterMap); return filter; }
/** * Creates a <tt>Filter</tt> primitive according to the specified * parameters. * * @param ctx the bridge context to use * @param filterElement the element that defines a filter * @param filteredElement the element that references the filter * @param filteredNode the graphics node to filter * * @param inputFilter the <tt>Filter</tt> that represents the current * filter input if the filter chain. * @param filterRegion the filter area defined for the filter chain * the new node will be part of. * @param filterMap a map where the mediator can map a name to the * <tt>Filter</tt> it creates. Other <tt>FilterBridge</tt>s * can then access a filter node from the filterMap if they * know its name. */
Creates a Filter primitive according to the specified parameters
createFilter
{ "repo_name": "srnsw/xena", "path": "plugins/image/ext/src/batik-1.7/sources/org/apache/batik/bridge/SVGFeConvolveMatrixElementBridge.java", "license": "gpl-3.0", "size": 16211 }
[ "java.awt.Point", "java.awt.geom.Rectangle2D", "java.awt.image.Kernel", "java.util.Map", "org.apache.batik.ext.awt.image.PadMode", "org.apache.batik.ext.awt.image.renderable.ConvolveMatrixRable", "org.apache.batik.ext.awt.image.renderable.ConvolveMatrixRable8Bit", "org.apache.batik.ext.awt.image.renderable.Filter", "org.apache.batik.ext.awt.image.renderable.PadRable", "org.apache.batik.ext.awt.image.renderable.PadRable8Bit", "org.apache.batik.gvt.GraphicsNode", "org.w3c.dom.Element" ]
import java.awt.Point; import java.awt.geom.Rectangle2D; import java.awt.image.Kernel; import java.util.Map; import org.apache.batik.ext.awt.image.PadMode; import org.apache.batik.ext.awt.image.renderable.ConvolveMatrixRable; import org.apache.batik.ext.awt.image.renderable.ConvolveMatrixRable8Bit; import org.apache.batik.ext.awt.image.renderable.Filter; import org.apache.batik.ext.awt.image.renderable.PadRable; import org.apache.batik.ext.awt.image.renderable.PadRable8Bit; import org.apache.batik.gvt.GraphicsNode; import org.w3c.dom.Element;
import java.awt.*; import java.awt.geom.*; import java.awt.image.*; import java.util.*; import org.apache.batik.ext.awt.image.*; import org.apache.batik.ext.awt.image.renderable.*; import org.apache.batik.gvt.*; import org.w3c.dom.*;
[ "java.awt", "java.util", "org.apache.batik", "org.w3c.dom" ]
java.awt; java.util; org.apache.batik; org.w3c.dom;
750,918
@Nullable RelationType getRelation(DfaValue left, DfaValue right);
RelationType getRelation(DfaValue left, DfaValue right);
/** * Returns a relation between given values within this state, if known * @param left first value * @param right second value * @return a relation (EQ, NE, GT, LT), or null if not known. */
Returns a relation between given values within this state, if known
getRelation
{ "repo_name": "dahlstrom-g/intellij-community", "path": "java/java-analysis-impl/src/com/intellij/codeInspection/dataFlow/DfaMemoryState.java", "license": "apache-2.0", "size": 6244 }
[ "com.intellij.codeInspection.dataFlow.value.DfaValue", "com.intellij.codeInspection.dataFlow.value.RelationType" ]
import com.intellij.codeInspection.dataFlow.value.DfaValue; import com.intellij.codeInspection.dataFlow.value.RelationType;
import com.intellij.*;
[ "com.intellij" ]
com.intellij;
822,880
public ValueSetExpansionOutcome expandVS(ValueSet source, boolean cacheOk);
ValueSetExpansionOutcome function(ValueSet source, boolean cacheOk);
/** * ValueSet Expansion - see $expand * * @param source * @return */
ValueSet Expansion - see $expand
expandVS
{ "repo_name": "Gaduo/hapi-fhir", "path": "hapi-fhir-structures-dstu2.1/src/main/java/org/hl7/fhir/dstu2016may/utils/IWorkerContext.java", "license": "apache-2.0", "size": 9379 }
[ "org.hl7.fhir.dstu2016may.model.ValueSet", "org.hl7.fhir.dstu2016may.terminologies.ValueSetExpander" ]
import org.hl7.fhir.dstu2016may.model.ValueSet; import org.hl7.fhir.dstu2016may.terminologies.ValueSetExpander;
import org.hl7.fhir.dstu2016may.model.*; import org.hl7.fhir.dstu2016may.terminologies.*;
[ "org.hl7.fhir" ]
org.hl7.fhir;
1,831,070
//----------------------------------------------------------------------- @FromString public static Period parse(String str) { return parse(str, ISOPeriodFormat.standard()); }
static Period function(String str) { return parse(str, ISOPeriodFormat.standard()); }
/** * Parses a {@code Period} from the specified string. * <p> * This uses {@link ISOPeriodFormat#standard()}. * * @param str the string to parse, not null * @since 2.0 */
Parses a Period from the specified string. This uses <code>ISOPeriodFormat#standard()</code>
parse
{ "repo_name": "likecool21/joda-time-2.3-Testing", "path": "src/main/java/org/joda/time/Period.java", "license": "apache-2.0", "size": 72737 }
[ "org.joda.time.format.ISOPeriodFormat" ]
import org.joda.time.format.ISOPeriodFormat;
import org.joda.time.format.*;
[ "org.joda.time" ]
org.joda.time;
2,659,257
void handleCommand(String channel, Command command);
void handleCommand(String channel, Command command);
/** * Procedure for sending command. * * @param channel the channel to which the command applies * @param command the command to be handled */
Procedure for sending command
handleCommand
{ "repo_name": "Snickermicker/openhab2", "path": "bundles/org.openhab.binding.samsungtv/src/main/java/org/openhab/binding/samsungtv/internal/service/api/SamsungTvService.java", "license": "epl-1.0", "size": 1934 }
[ "org.eclipse.smarthome.core.types.Command" ]
import org.eclipse.smarthome.core.types.Command;
import org.eclipse.smarthome.core.types.*;
[ "org.eclipse.smarthome" ]
org.eclipse.smarthome;
907,275
public void setDateFormatter(DateTimeFormatter formatter) { this.formatters.put(Type.DATE, formatter); }
void function(DateTimeFormatter formatter) { this.formatters.put(Type.DATE, formatter); }
/** * Set the formatter that will be used for objects representing date values. * <p>This formatter will be used for the {@link LocalDate} type. When specified * the {@link #setDateStyle(String) dateStyle} and * {@link #setUseIsoFormat(boolean) useIsoFormat} properties will be ignored. * @param formatter the formatter to use * @see #setTimeFormatter * @see #setDateTimeFormatter * @since 3.2 */
Set the formatter that will be used for objects representing date values. This formatter will be used for the <code>LocalDate</code> type. When specified the <code>#setDateStyle(String) dateStyle</code> and <code>#setUseIsoFormat(boolean) useIsoFormat</code> properties will be ignored
setDateFormatter
{ "repo_name": "deathspeeder/class-guard", "path": "spring-framework-3.2.x/spring-context/src/main/java/org/springframework/format/datetime/joda/JodaTimeFormatterRegistrar.java", "license": "gpl-2.0", "size": 7493 }
[ "org.joda.time.format.DateTimeFormatter" ]
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.*;
[ "org.joda.time" ]
org.joda.time;
1,068,819
//------------------------- AUTOGENERATED START ------------------------- ///CLOVER:OFF public static ScenarioDefinition.Meta meta() { return ScenarioDefinition.Meta.INSTANCE; } static { JodaBeanUtils.registerMetaBean(ScenarioDefinition.Meta.INSTANCE); }
static ScenarioDefinition.Meta function() { return ScenarioDefinition.Meta.INSTANCE; } static { JodaBeanUtils.registerMetaBean(ScenarioDefinition.Meta.INSTANCE); }
/** * The meta-bean for {@code ScenarioDefinition}. * @return the meta-bean, not null */
The meta-bean for ScenarioDefinition
meta
{ "repo_name": "DevStreet/FinanceAnalytics", "path": "sesame/sesame-engine/src/main/java/com/opengamma/sesame/marketdata/scenarios/ScenarioDefinition.java", "license": "apache-2.0", "size": 28226 }
[ "org.joda.beans.JodaBeanUtils" ]
import org.joda.beans.JodaBeanUtils;
import org.joda.beans.*;
[ "org.joda.beans" ]
org.joda.beans;
2,759,163
@Override public void redrawPaths() { if (D) Log.d(tag, "--- redrawPaths --------------------"); canvas.drawColor(0xFFFFFFFF); // Copy background to buffer if(background != null) { if (D) Log.d(tag, "- drawing background..."); bitmap.copyPixelsFromBuffer(background); } if (D) Log.d(tag, "-- fetching all paths to draw..."); // Fetch all saved paths to a new list List<DrawingPath> paths; synchronized (DrawingActivity.path) { if (D) Log.d(tag+"-fetch", "- path buffer empty: "+DrawingActivity.path.isEmpty()); if (DrawingActivity.path.isEmpty()) paths = new ArrayList<DrawingPath>(); else paths = new ArrayList<DrawingPath>(DrawingActivity.path); if (D) Log.d(tag+"-fetch", "- nmbr of fetched paths: "+paths.size()); } // Since not all paths have been saved yet, fetch these and insert // them at their proper place synchronized (DrawingActivityMulti.players) { if (paths.isEmpty()) { if (D) Log.d(tag+"-fetch", "- adding all player paths and sorting"); for (Player p : DrawingActivityMulti.players) if (!p.getPath().getPath().isEmpty()) paths.add(p.getPath()); Collections.sort(paths); if (D) { } } else { if (D) Log.d(tag+"-fetch", "- adding all players in the correct spot"); for (Player p : DrawingActivityMulti.players) { if (p.getPath().getPath().isEmpty()) continue; final int index = findPlaceSorted(p.getPath().getTimeStamp(), paths); if (D) {Log.d(tag+"-fetch", "-- Added Player" + "\n- player ID: "+p.getPlayerID() + "\n- path empty: "+p.getPath().getPath().isEmpty() + "\n- time_stamp: "+p.getPath().getTimeStamp() +" \n- index: "+index);} if (index > 0) paths.add(index, p.getPath()); else paths.add(p.getPath()); } } } if (D) { Log.d(tag+"-loop", "-- Paths to draw: "); if (paths.isEmpty()) Log.d(tag+"-loop", "- none, paths is empty..."); for (DrawingPath dp : paths) Log.d(tag+"-loop:paths", "- Path ID: "+dp.getPID() + "\n- Path time_stamp: "+dp.getTimeStamp()); } // And finally draw the paths for (DrawingPath dp : paths) canvas.drawPath(dp.getPath(), dp.getBrush().getPaint()); invalidate(); } // ------------------------- Touch methods --------------------------- //
void function() { if (D) Log.d(tag, STR); canvas.drawColor(0xFFFFFFFF); if(background != null) { if (D) Log.d(tag, STR); bitmap.copyPixelsFromBuffer(background); } if (D) Log.d(tag, STR); List<DrawingPath> paths; synchronized (DrawingActivity.path) { if (D) Log.d(tag+STR, STR+DrawingActivity.path.isEmpty()); if (DrawingActivity.path.isEmpty()) paths = new ArrayList<DrawingPath>(); else paths = new ArrayList<DrawingPath>(DrawingActivity.path); if (D) Log.d(tag+STR, STR+paths.size()); } synchronized (DrawingActivityMulti.players) { if (paths.isEmpty()) { if (D) Log.d(tag+STR, STR); for (Player p : DrawingActivityMulti.players) if (!p.getPath().getPath().isEmpty()) paths.add(p.getPath()); Collections.sort(paths); if (D) { } } else { if (D) Log.d(tag+STR, STR); for (Player p : DrawingActivityMulti.players) { if (p.getPath().getPath().isEmpty()) continue; final int index = findPlaceSorted(p.getPath().getTimeStamp(), paths); if (D) {Log.d(tag+STR, STR + STR+p.getPlayerID() + STR+p.getPath().getPath().isEmpty() + STR+p.getPath().getTimeStamp() +STR+index);} if (index > 0) paths.add(index, p.getPath()); else paths.add(p.getPath()); } } } if (D) { Log.d(tag+"-loop", STR); if (paths.isEmpty()) Log.d(tag+"-loop", STR); for (DrawingPath dp : paths) Log.d(tag+STR, STR+dp.getPID() + STR+dp.getTimeStamp()); } for (DrawingPath dp : paths) canvas.drawPath(dp.getPath(), dp.getBrush().getPaint()); invalidate(); }
/** * Redraws all drawn paths as well as the sent path at the * specified index, and background, to the canvas and invalidates. */
Redraws all drawn paths as well as the sent path at the specified index, and background, to the canvas and invalidates
redrawPaths
{ "repo_name": "BoEmma/netpaint", "path": "src/com/kandidat/rityta/multi/DrawingViewMulti.java", "license": "apache-2.0", "size": 9417 }
[ "android.util.Log", "com.kandidat.rityta.DrawingActivity", "com.kandidat.rityta.DrawingPath", "java.util.ArrayList", "java.util.Collections", "java.util.List" ]
import android.util.Log; import com.kandidat.rityta.DrawingActivity; import com.kandidat.rityta.DrawingPath; import java.util.ArrayList; import java.util.Collections; import java.util.List;
import android.util.*; import com.kandidat.rityta.*; import java.util.*;
[ "android.util", "com.kandidat.rityta", "java.util" ]
android.util; com.kandidat.rityta; java.util;
1,715,804
default void longPressKeyCode(int key, Integer metastate) { CommandExecutionHelper.execute(this, longPressKeyCodeCommand(key, metastate)); }
default void longPressKeyCode(int key, Integer metastate) { CommandExecutionHelper.execute(this, longPressKeyCodeCommand(key, metastate)); }
/** * Send a long key event along with an Android metastate to an Android device. * Metastates are things like *shift* to get uppercase characters. * * @param key code for the key pressed on the Android device. * @param metastate metastate for the keypress. */
Send a long key event along with an Android metastate to an Android device. Metastates are things like *shift* to get uppercase characters
longPressKeyCode
{ "repo_name": "dolszews/appium-tigerspike", "path": "src/main/java/io/appium/java_client/PressesKeyCode.java", "license": "apache-2.0", "size": 2310 }
[ "io.appium.java_client.MobileCommand" ]
import io.appium.java_client.MobileCommand;
import io.appium.java_client.*;
[ "io.appium.java_client" ]
io.appium.java_client;
1,184,730
public void fillInNotifierBundle(Bundle bundleToFill) { bundleToFill.putInt("baseStationId", this.mBaseStationId); bundleToFill.putInt("baseStationLatitude", this.mBaseStationLatitude); bundleToFill.putInt("baseStationLongitude", this.mBaseStationLongitude); bundleToFill.putInt("systemId", this.mSystemId); bundleToFill.putInt("networkId", this.mNetworkId); }
void function(Bundle bundleToFill) { bundleToFill.putInt(STR, this.mBaseStationId); bundleToFill.putInt(STR, this.mBaseStationLatitude); bundleToFill.putInt(STR, this.mBaseStationLongitude); bundleToFill.putInt(STR, this.mSystemId); bundleToFill.putInt(STR, this.mNetworkId); }
/** * Fill the cell location data into the intent notifier Bundle based on service state * * @param bundleToFill intent notifier Bundle */
Fill the cell location data into the intent notifier Bundle based on service state
fillInNotifierBundle
{ "repo_name": "mateor/PDroidHistory", "path": "frameworks/base/telephony/java/android/telephony/cdma/CdmaCellLocation.java", "license": "gpl-3.0", "size": 7238 }
[ "android.os.Bundle" ]
import android.os.Bundle;
import android.os.*;
[ "android.os" ]
android.os;
15,651
public static void renameCascadingChildLinks(ICascadingJob cascadingProject, String oldName, String newName) throws IOException { if (cascadingProject != null) { cascadingProject.renameCascadingChildName(oldName, newName); if (cascadingProject.hasCascadingProject()) { renameCascadingChildLinks(cascadingProject.getCascadingProject(), oldName, newName); } } }
static void function(ICascadingJob cascadingProject, String oldName, String newName) throws IOException { if (cascadingProject != null) { cascadingProject.renameCascadingChildName(oldName, newName); if (cascadingProject.hasCascadingProject()) { renameCascadingChildLinks(cascadingProject.getCascadingProject(), oldName, newName); } } }
/** * Updates the name of the project in all children cascading references. If * this project uses some cascading parent, the name of this project will be * renamed in the cascading children collection of the cascading parent * project. * * @param cascadingProject cascading project. * @param oldName old project name. * @param newName new project name. * @throws java.io.IOException if cascading project couldn't be saved. */
Updates the name of the project in all children cascading references. If this project uses some cascading parent, the name of this project will be renamed in the cascading children collection of the cascading parent project
renameCascadingChildLinks
{ "repo_name": "bboyfeiyu/hudson.core", "path": "hudson-core/src/main/java/hudson/util/CascadingUtil.java", "license": "apache-2.0", "size": 24923 }
[ "java.io.IOException", "org.eclipse.hudson.api.model.ICascadingJob" ]
import java.io.IOException; import org.eclipse.hudson.api.model.ICascadingJob;
import java.io.*; import org.eclipse.hudson.api.model.*;
[ "java.io", "org.eclipse.hudson" ]
java.io; org.eclipse.hudson;
2,471,389
ContentDocument removeContent();
ContentDocument removeContent();
/** * Removes the editor's document * * @return the old document. It is still in render mode. */
Removes the editor's document
removeContent
{ "repo_name": "wisebaldone/incubator-wave", "path": "wave/src/main/java/org/waveprotocol/wave/client/editor/Editor.java", "license": "apache-2.0", "size": 7567 }
[ "org.waveprotocol.wave.client.editor.content.ContentDocument" ]
import org.waveprotocol.wave.client.editor.content.ContentDocument;
import org.waveprotocol.wave.client.editor.content.*;
[ "org.waveprotocol.wave" ]
org.waveprotocol.wave;
968,811
public void testBorrowingSiblingBreakerMemory() throws Exception { Settings clusterSettings = Settings.builder() .put(HierarchyCircuitBreakerService.USE_REAL_MEMORY_USAGE_SETTING.getKey(), false) .put(HierarchyCircuitBreakerService.TOTAL_CIRCUIT_BREAKER_LIMIT_SETTING.getKey(), "200mb") .put(HierarchyCircuitBreakerService.REQUEST_CIRCUIT_BREAKER_LIMIT_SETTING.getKey(), "150mb") .put(HierarchyCircuitBreakerService.FIELDDATA_CIRCUIT_BREAKER_LIMIT_SETTING.getKey(), "150mb") .build(); try (CircuitBreakerService service = new HierarchyCircuitBreakerService(clusterSettings, new ClusterSettings(clusterSettings, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS))) { CircuitBreaker requestCircuitBreaker = service.getBreaker(CircuitBreaker.REQUEST); CircuitBreaker fieldDataCircuitBreaker = service.getBreaker(CircuitBreaker.FIELDDATA); assertEquals(new ByteSizeValue(200, ByteSizeUnit.MB).getBytes(), service.stats().getStats(CircuitBreaker.PARENT).getLimit()); assertEquals(new ByteSizeValue(150, ByteSizeUnit.MB).getBytes(), requestCircuitBreaker.getLimit()); assertEquals(new ByteSizeValue(150, ByteSizeUnit.MB).getBytes(), fieldDataCircuitBreaker.getLimit()); double fieldDataUsedBytes = fieldDataCircuitBreaker .addEstimateBytesAndMaybeBreak(new ByteSizeValue(50, ByteSizeUnit.MB).getBytes(), "should not break"); assertEquals(new ByteSizeValue(50, ByteSizeUnit.MB).getBytes(), fieldDataUsedBytes, 0.0); double requestUsedBytes = requestCircuitBreaker.addEstimateBytesAndMaybeBreak(new ByteSizeValue(50, ByteSizeUnit.MB).getBytes(), "should not break"); assertEquals(new ByteSizeValue(50, ByteSizeUnit.MB).getBytes(), requestUsedBytes, 0.0); requestUsedBytes = requestCircuitBreaker.addEstimateBytesAndMaybeBreak(new ByteSizeValue(50, ByteSizeUnit.MB).getBytes(), "should not break"); assertEquals(new ByteSizeValue(100, ByteSizeUnit.MB).getBytes(), requestUsedBytes, 0.0); CircuitBreakingException exception = expectThrows(CircuitBreakingException.class, () -> requestCircuitBreaker .addEstimateBytesAndMaybeBreak(new ByteSizeValue(50, ByteSizeUnit.MB).getBytes(), "should break")); assertThat(exception.getMessage(), containsString("[parent] Data too large, data for [should break] would be")); assertThat(exception.getMessage(), containsString("which is larger than the limit of [209715200/200mb]")); assertThat(exception.getMessage(), containsString("usages [request=157286400/150mb, fielddata=54001664/51.5mb, accounting=0/0b, inflight_requests=0/0b]")); assertThat(exception.getDurability(), equalTo(CircuitBreaker.Durability.TRANSIENT)); } }
void function() throws Exception { Settings clusterSettings = Settings.builder() .put(HierarchyCircuitBreakerService.USE_REAL_MEMORY_USAGE_SETTING.getKey(), false) .put(HierarchyCircuitBreakerService.TOTAL_CIRCUIT_BREAKER_LIMIT_SETTING.getKey(), "200mb") .put(HierarchyCircuitBreakerService.REQUEST_CIRCUIT_BREAKER_LIMIT_SETTING.getKey(), "150mb") .put(HierarchyCircuitBreakerService.FIELDDATA_CIRCUIT_BREAKER_LIMIT_SETTING.getKey(), "150mb") .build(); try (CircuitBreakerService service = new HierarchyCircuitBreakerService(clusterSettings, new ClusterSettings(clusterSettings, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS))) { CircuitBreaker requestCircuitBreaker = service.getBreaker(CircuitBreaker.REQUEST); CircuitBreaker fieldDataCircuitBreaker = service.getBreaker(CircuitBreaker.FIELDDATA); assertEquals(new ByteSizeValue(200, ByteSizeUnit.MB).getBytes(), service.stats().getStats(CircuitBreaker.PARENT).getLimit()); assertEquals(new ByteSizeValue(150, ByteSizeUnit.MB).getBytes(), requestCircuitBreaker.getLimit()); assertEquals(new ByteSizeValue(150, ByteSizeUnit.MB).getBytes(), fieldDataCircuitBreaker.getLimit()); double fieldDataUsedBytes = fieldDataCircuitBreaker .addEstimateBytesAndMaybeBreak(new ByteSizeValue(50, ByteSizeUnit.MB).getBytes(), STR); assertEquals(new ByteSizeValue(50, ByteSizeUnit.MB).getBytes(), fieldDataUsedBytes, 0.0); double requestUsedBytes = requestCircuitBreaker.addEstimateBytesAndMaybeBreak(new ByteSizeValue(50, ByteSizeUnit.MB).getBytes(), STR); assertEquals(new ByteSizeValue(50, ByteSizeUnit.MB).getBytes(), requestUsedBytes, 0.0); requestUsedBytes = requestCircuitBreaker.addEstimateBytesAndMaybeBreak(new ByteSizeValue(50, ByteSizeUnit.MB).getBytes(), STR); assertEquals(new ByteSizeValue(100, ByteSizeUnit.MB).getBytes(), requestUsedBytes, 0.0); CircuitBreakingException exception = expectThrows(CircuitBreakingException.class, () -> requestCircuitBreaker .addEstimateBytesAndMaybeBreak(new ByteSizeValue(50, ByteSizeUnit.MB).getBytes(), STR)); assertThat(exception.getMessage(), containsString(STR)); assertThat(exception.getMessage(), containsString(STR)); assertThat(exception.getMessage(), containsString(STR)); assertThat(exception.getDurability(), equalTo(CircuitBreaker.Durability.TRANSIENT)); } }
/** * Test that a breaker correctly redistributes to a different breaker, in * this case, the request breaker borrows space from the fielddata breaker */
Test that a breaker correctly redistributes to a different breaker, in this case, the request breaker borrows space from the fielddata breaker
testBorrowingSiblingBreakerMemory
{ "repo_name": "coding0011/elasticsearch", "path": "server/src/test/java/org/elasticsearch/indices/breaker/HierarchyCircuitBreakerServiceTests.java", "license": "apache-2.0", "size": 16789 }
[ "org.elasticsearch.common.breaker.CircuitBreaker", "org.elasticsearch.common.breaker.CircuitBreakingException", "org.elasticsearch.common.settings.ClusterSettings", "org.elasticsearch.common.settings.Settings", "org.elasticsearch.common.unit.ByteSizeUnit", "org.elasticsearch.common.unit.ByteSizeValue", "org.hamcrest.Matchers" ]
import org.elasticsearch.common.breaker.CircuitBreaker; import org.elasticsearch.common.breaker.CircuitBreakingException; import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; import org.hamcrest.Matchers;
import org.elasticsearch.common.breaker.*; import org.elasticsearch.common.settings.*; import org.elasticsearch.common.unit.*; import org.hamcrest.*;
[ "org.elasticsearch.common", "org.hamcrest" ]
org.elasticsearch.common; org.hamcrest;
1,811,317
protected boolean handles(File location) { return location.isFile() && location.getName().endsWith("." + getExtension()); }
boolean function(File location) { return location.isFile() && location.getName().endsWith("." + getExtension()); }
/** * Returns whether this model utility class handles this type of file. * * @param location the location to be considered * @return <code>true</code> if it handles the specified location, <code>false</code> else * @see #getExtension() */
Returns whether this model utility class handles this type of file
handles
{ "repo_name": "SSEHUB/EASyProducer", "path": "Plugins/VarModel/de.uni_hildesheim.sse.dslCore/src/net/ssehub/easy/dslCore/ModelUtility.java", "license": "apache-2.0", "size": 17776 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
578,829
static public final void replace(Page pg, final Class< ? extends UrlPage> clz, final IPageParameters pp, UIMessage msg) { if(clz == null) throw new IllegalArgumentException("The class to move-to cannot be null"); List<UIMessage> msgl = new ArrayList<UIMessage>(1); msgl.add(msg); WindowSession ws = pg.getConversation().getWindowSession(); ws.setAttribute(UIGoto.SINGLESHOT_MESSAGE, msgl); context().internalSetNextPage(MoveMode.REPLACE, clz, null, null, pp); }
static final void function(Page pg, final Class< ? extends UrlPage> clz, final IPageParameters pp, UIMessage msg) { if(clz == null) throw new IllegalArgumentException(STR); List<UIMessage> msgl = new ArrayList<UIMessage>(1); msgl.add(msg); WindowSession ws = pg.getConversation().getWindowSession(); ws.setAttribute(UIGoto.SINGLESHOT_MESSAGE, msgl); context().internalSetNextPage(MoveMode.REPLACE, clz, null, null, pp); }
/** * Replace the "current" page with a new page. The current page is destroyed; the shelve stack is not changed. * On the new page show the specified message as an UI message. */
Replace the "current" page with a new page. The current page is destroyed; the shelve stack is not changed. On the new page show the specified message as an UI message
replace
{ "repo_name": "fjalvingh/domui", "path": "to.etc.domui/src/main/java/to/etc/domui/state/UIGoto.java", "license": "lgpl-2.1", "size": 11231 }
[ "java.util.ArrayList", "java.util.List", "to.etc.domui.dom.errors.UIMessage", "to.etc.domui.dom.html.Page", "to.etc.domui.dom.html.UrlPage" ]
import java.util.ArrayList; import java.util.List; import to.etc.domui.dom.errors.UIMessage; import to.etc.domui.dom.html.Page; import to.etc.domui.dom.html.UrlPage;
import java.util.*; import to.etc.domui.dom.errors.*; import to.etc.domui.dom.html.*;
[ "java.util", "to.etc.domui" ]
java.util; to.etc.domui;
2,325,377
public static void setupRegionReplicaReplication(Configuration conf) throws IOException { if (!conf.getBoolean(REGION_REPLICA_REPLICATION_CONF_KEY, DEFAULT_REGION_REPLICA_REPLICATION)) { return; } ReplicationAdmin repAdmin = new ReplicationAdmin(conf); try { if (repAdmin.getPeerConfig(REGION_REPLICA_REPLICATION_PEER) == null) { ReplicationPeerConfig peerConfig = new ReplicationPeerConfig(); peerConfig.setClusterKey(ZKUtil.getZooKeeperClusterKey(conf)); peerConfig.setReplicationEndpointImpl(RegionReplicaReplicationEndpoint.class.getName()); repAdmin.addPeer(REGION_REPLICA_REPLICATION_PEER, peerConfig, null); } } catch (ReplicationException ex) { throw new IOException(ex); } finally { repAdmin.close(); } }
static void function(Configuration conf) throws IOException { if (!conf.getBoolean(REGION_REPLICA_REPLICATION_CONF_KEY, DEFAULT_REGION_REPLICA_REPLICATION)) { return; } ReplicationAdmin repAdmin = new ReplicationAdmin(conf); try { if (repAdmin.getPeerConfig(REGION_REPLICA_REPLICATION_PEER) == null) { ReplicationPeerConfig peerConfig = new ReplicationPeerConfig(); peerConfig.setClusterKey(ZKUtil.getZooKeeperClusterKey(conf)); peerConfig.setReplicationEndpointImpl(RegionReplicaReplicationEndpoint.class.getName()); repAdmin.addPeer(REGION_REPLICA_REPLICATION_PEER, peerConfig, null); } } catch (ReplicationException ex) { throw new IOException(ex); } finally { repAdmin.close(); } }
/** * Create replication peer for replicating to region replicas if needed. * @param conf configuration to use * @throws IOException */
Create replication peer for replicating to region replicas if needed
setupRegionReplicaReplication
{ "repo_name": "toshimasa-nasu/hbase", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/util/ServerRegionReplicaUtil.java", "license": "apache-2.0", "size": 6375 }
[ "java.io.IOException", "org.apache.hadoop.conf.Configuration", "org.apache.hadoop.hbase.client.replication.ReplicationAdmin", "org.apache.hadoop.hbase.replication.ReplicationException", "org.apache.hadoop.hbase.replication.ReplicationPeerConfig", "org.apache.hadoop.hbase.replication.regionserver.RegionReplicaReplicationEndpoint", "org.apache.hadoop.hbase.zookeeper.ZKUtil" ]
import java.io.IOException; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.client.replication.ReplicationAdmin; import org.apache.hadoop.hbase.replication.ReplicationException; import org.apache.hadoop.hbase.replication.ReplicationPeerConfig; import org.apache.hadoop.hbase.replication.regionserver.RegionReplicaReplicationEndpoint; import org.apache.hadoop.hbase.zookeeper.ZKUtil;
import java.io.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.hbase.client.replication.*; import org.apache.hadoop.hbase.replication.*; import org.apache.hadoop.hbase.replication.regionserver.*; import org.apache.hadoop.hbase.zookeeper.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
2,192,729
EventQueue.invokeLater(new Runnable() {
EventQueue.invokeLater(new Runnable() {
/** * Launch the application. */
Launch the application
main
{ "repo_name": "jenniferlarsson/KD405A_Jennifer_L", "path": "Assignment_2/src/se/mah/ke/jenniferlarsson/HouseGUI.java", "license": "mit", "size": 3251 }
[ "java.awt.EventQueue" ]
import java.awt.EventQueue;
import java.awt.*;
[ "java.awt" ]
java.awt;
752,791
public boolean preDelete(final Delete delete, final WALEdit edit, final Durability durability) throws IOException { if (this.coprocEnvironments.isEmpty()) { return false; }
boolean function(final Delete delete, final WALEdit edit, final Durability durability) throws IOException { if (this.coprocEnvironments.isEmpty()) { return false; }
/** * Supports Coprocessor 'bypass'. * @param delete The Delete object * @param edit The WALEdit object. * @param durability The durability used * @return true if default processing should be bypassed * @exception IOException Exception */
Supports Coprocessor 'bypass'
preDelete
{ "repo_name": "ChinmaySKulkarni/hbase", "path": "hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java", "license": "apache-2.0", "size": 66007 }
[ "java.io.IOException", "org.apache.hadoop.hbase.client.Delete", "org.apache.hadoop.hbase.client.Durability", "org.apache.hadoop.hbase.wal.WALEdit" ]
import java.io.IOException; import org.apache.hadoop.hbase.client.Delete; import org.apache.hadoop.hbase.client.Durability; import org.apache.hadoop.hbase.wal.WALEdit;
import java.io.*; import org.apache.hadoop.hbase.client.*; import org.apache.hadoop.hbase.wal.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
2,379,260
@UiHandler("m_helpBubbleClose") protected void closeHelpBubble(ClickEvent event) { addStyleName(formCss().closedBubble()); }
@UiHandler(STR) void function(ClickEvent event) { addStyleName(formCss().closedBubble()); }
/** * Handles the click event to close the help bubble.<p> * * @param event the click event */
Handles the click event to close the help bubble
closeHelpBubble
{ "repo_name": "sbonoc/opencms-core", "path": "src-gwt/org/opencms/acacia/client/ui/CmsAttributeValueView.java", "license": "lgpl-2.1", "size": 37189 }
[ "com.google.gwt.event.dom.client.ClickEvent", "com.google.gwt.uibinder.client.UiHandler" ]
import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.event.dom.client.*; import com.google.gwt.uibinder.client.*;
[ "com.google.gwt" ]
com.google.gwt;
181,557
Set<Section> lookupIntersectedSections (Rectangle rect);
Set<Section> lookupIntersectedSections (Rectangle rect);
/** * Lookup for lag sections that are <b>intersected</b> by the * provided rectangle. * Specific sections are not considered. * * @param rect the given rectangle * @return the set of lag sections intersected, which may be empty */
Lookup for lag sections that are intersected by the provided rectangle. Specific sections are not considered
lookupIntersectedSections
{ "repo_name": "jlpoolen/libreveris", "path": "src/main/omr/lag/Lag.java", "license": "lgpl-3.0", "size": 6260 }
[ "java.awt.Rectangle", "java.util.Set" ]
import java.awt.Rectangle; import java.util.Set;
import java.awt.*; import java.util.*;
[ "java.awt", "java.util" ]
java.awt; java.util;
2,249,779
public java.util.List<fr.lip6.move.pnml.hlpn.integers.hlapi.LessThanHLAPI> getSubterm_integers_LessThanHLAPI(){ java.util.List<fr.lip6.move.pnml.hlpn.integers.hlapi.LessThanHLAPI> retour = new ArrayList<fr.lip6.move.pnml.hlpn.integers.hlapi.LessThanHLAPI>(); for (Term elemnt : getSubterm()) { if(elemnt.getClass().equals(fr.lip6.move.pnml.hlpn.integers.impl.LessThanImpl.class)){ retour.add(new fr.lip6.move.pnml.hlpn.integers.hlapi.LessThanHLAPI( (fr.lip6.move.pnml.hlpn.integers.LessThan)elemnt )); } } return retour; }
java.util.List<fr.lip6.move.pnml.hlpn.integers.hlapi.LessThanHLAPI> function(){ java.util.List<fr.lip6.move.pnml.hlpn.integers.hlapi.LessThanHLAPI> retour = new ArrayList<fr.lip6.move.pnml.hlpn.integers.hlapi.LessThanHLAPI>(); for (Term elemnt : getSubterm()) { if(elemnt.getClass().equals(fr.lip6.move.pnml.hlpn.integers.impl.LessThanImpl.class)){ retour.add(new fr.lip6.move.pnml.hlpn.integers.hlapi.LessThanHLAPI( (fr.lip6.move.pnml.hlpn.integers.LessThan)elemnt )); } } return retour; }
/** * This accessor return a list of encapsulated subelement, only of LessThanHLAPI kind. * WARNING : this method can creates a lot of new object in memory. */
This accessor return a list of encapsulated subelement, only of LessThanHLAPI kind. WARNING : this method can creates a lot of new object in memory
getSubterm_integers_LessThanHLAPI
{ "repo_name": "lhillah/pnmlframework", "path": "pnmlFw-HLPN/src/fr/lip6/move/pnml/hlpn/booleans/hlapi/AndHLAPI.java", "license": "epl-1.0", "size": 108259 }
[ "fr.lip6.move.pnml.hlpn.terms.Term", "java.util.ArrayList", "java.util.List" ]
import fr.lip6.move.pnml.hlpn.terms.Term; import java.util.ArrayList; import java.util.List;
import fr.lip6.move.pnml.hlpn.terms.*; import java.util.*;
[ "fr.lip6.move", "java.util" ]
fr.lip6.move; java.util;
1,464,999
EReference getActivity__Anonymous_activity_2_1();
EReference getActivity__Anonymous_activity_2_1();
/** * Returns the meta object for the containment reference list '{@link cruise.umple.umple.Activity_#getAnonymous_activity_2_1 <em>Anonymous activity 21</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the containment reference list '<em>Anonymous activity 21</em>'. * @see cruise.umple.umple.Activity_#getAnonymous_activity_2_1() * @see #getActivity_() * @generated */
Returns the meta object for the containment reference list '<code>cruise.umple.umple.Activity_#getAnonymous_activity_2_1 Anonymous activity 21</code>'.
getActivity__Anonymous_activity_2_1
{ "repo_name": "ahmedvc/umple", "path": "cruise.umple.xtext/src-gen/cruise/umple/umple/UmplePackage.java", "license": "mit", "size": 485842 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
392,330
@Deprecated // to be removed before 2.0 public static DatabaseProduct getProduct( String productName, String productVersion) { final String upperProductName = productName.toUpperCase(Locale.ROOT).trim(); switch (upperProductName) { case "ACCESS": return DatabaseProduct.ACCESS; case "APACHE DERBY": return DatabaseProduct.DERBY; case "CLICKHOUSE": return DatabaseProduct.CLICKHOUSE; case "DBMS:CLOUDSCAPE": return DatabaseProduct.DERBY; case "HIVE": return DatabaseProduct.HIVE; case "INGRES": return DatabaseProduct.INGRES; case "INTERBASE": return DatabaseProduct.INTERBASE; case "LUCIDDB": return DatabaseProduct.LUCIDDB; case "ORACLE": return DatabaseProduct.ORACLE; case "PHOENIX": return DatabaseProduct.PHOENIX; case "PRESTO": return DatabaseProduct.PRESTO; case "MYSQL (INFOBRIGHT)": return DatabaseProduct.INFOBRIGHT; case "MYSQL": return DatabaseProduct.MYSQL; case "REDSHIFT": return DatabaseProduct.REDSHIFT; default: break; } // Now the fuzzy matches. if (productName.startsWith("DB2")) { return DatabaseProduct.DB2; } else if (upperProductName.contains("FIREBIRD")) { return DatabaseProduct.FIREBIRD; } else if (productName.startsWith("Informix")) { return DatabaseProduct.INFORMIX; } else if (upperProductName.contains("NETEZZA")) { return DatabaseProduct.NETEZZA; } else if (upperProductName.contains("PARACCEL")) { return DatabaseProduct.PARACCEL; } else if (productName.startsWith("HP Neoview")) { return DatabaseProduct.NEOVIEW; } else if (upperProductName.contains("POSTGRE")) { return DatabaseProduct.POSTGRESQL; } else if (upperProductName.contains("SQL SERVER")) { return DatabaseProduct.MSSQL; } else if (upperProductName.contains("SYBASE")) { return DatabaseProduct.SYBASE; } else if (upperProductName.contains("TERADATA")) { return DatabaseProduct.TERADATA; } else if (upperProductName.contains("HSQL")) { return DatabaseProduct.HSQLDB; } else if (upperProductName.contains("H2")) { return DatabaseProduct.H2; } else if (upperProductName.contains("VERTICA")) { return DatabaseProduct.VERTICA; } else if (upperProductName.contains("GOOGLE BIGQUERY")) { return DatabaseProduct.BIG_QUERY; } else { return DatabaseProduct.UNKNOWN; } }
@Deprecated static DatabaseProduct function( String productName, String productVersion) { final String upperProductName = productName.toUpperCase(Locale.ROOT).trim(); switch (upperProductName) { case STR: return DatabaseProduct.ACCESS; case STR: return DatabaseProduct.DERBY; case STR: return DatabaseProduct.CLICKHOUSE; case STR: return DatabaseProduct.DERBY; case "HIVE": return DatabaseProduct.HIVE; case STR: return DatabaseProduct.INGRES; case STR: return DatabaseProduct.INTERBASE; case STR: return DatabaseProduct.LUCIDDB; case STR: return DatabaseProduct.ORACLE; case STR: return DatabaseProduct.PHOENIX; case STR: return DatabaseProduct.PRESTO; case STR: return DatabaseProduct.INFOBRIGHT; case "MYSQL": return DatabaseProduct.MYSQL; case STR: return DatabaseProduct.REDSHIFT; default: break; } if (productName.startsWith("DB2")) { return DatabaseProduct.DB2; } else if (upperProductName.contains(STR)) { return DatabaseProduct.FIREBIRD; } else if (productName.startsWith(STR)) { return DatabaseProduct.INFORMIX; } else if (upperProductName.contains(STR)) { return DatabaseProduct.NETEZZA; } else if (upperProductName.contains(STR)) { return DatabaseProduct.PARACCEL; } else if (productName.startsWith(STR)) { return DatabaseProduct.NEOVIEW; } else if (upperProductName.contains(STR)) { return DatabaseProduct.POSTGRESQL; } else if (upperProductName.contains(STR)) { return DatabaseProduct.MSSQL; } else if (upperProductName.contains(STR)) { return DatabaseProduct.SYBASE; } else if (upperProductName.contains(STR)) { return DatabaseProduct.TERADATA; } else if (upperProductName.contains("HSQL")) { return DatabaseProduct.HSQLDB; } else if (upperProductName.contains("H2")) { return DatabaseProduct.H2; } else if (upperProductName.contains(STR)) { return DatabaseProduct.VERTICA; } else if (upperProductName.contains(STR)) { return DatabaseProduct.BIG_QUERY; } else { return DatabaseProduct.UNKNOWN; } }
/** * Converts a product name and version (per the JDBC driver) into a product * enumeration. * * @param productName Product name * @param productVersion Product version * @return database product */
Converts a product name and version (per the JDBC driver) into a product enumeration
getProduct
{ "repo_name": "datametica/calcite", "path": "core/src/main/java/org/apache/calcite/sql/SqlDialect.java", "license": "apache-2.0", "size": 69008 }
[ "java.util.Locale" ]
import java.util.Locale;
import java.util.*;
[ "java.util" ]
java.util;
351,520
public synchronized void load(InputStream inStream) throws IOException { // HL: Use the FileEncoding class instead //BufferedReader in = new BufferedReader(new InputStreamReader(inStream, ENCODING)); BufferedReader in = FileEncoding.getReader(inStream); String line = in.readLine(); while(line != null) { line = removeWhiteSpaces(line); if(!line.equals("") && COMMENT.indexOf(line.charAt(0)) == -1) { // Removes the beginning separators String property = line; // Reads the whole property if it is on multiple lines while(continueLine(line)) { property = property.substring(0, property.length() - 1); line = in.readLine(); property += line; } //property = new String(property.getBytes(ENCODING), ENCODING); if(!property.equals("")) { int endOfKey = 0; // calculates the ending index of the key while(endOfKey < property.length() && (keyValueSeparators.indexOf(property.charAt(endOfKey)) == -1)) { endOfKey++; } String key = property.substring(0, endOfKey); // HL: This check is needed if (endOfKey < property.length()) { String value = property.substring(endOfKey + 1, property.length()); key = loadConversion(key); value = loadConversion(removeWhiteSpaces(value)); put(key, value); //// For debugging only //System.out.println("key: " + key); //System.out.println("value: " + value); //System.out.println("-----------"); } } } //System.out.println(line); line = in.readLine(); } }
synchronized void function(InputStream inStream) throws IOException { BufferedReader in = FileEncoding.getReader(inStream); String line = in.readLine(); while(line != null) { line = removeWhiteSpaces(line); if(!line.equals(STR")) { int endOfKey = 0; while(endOfKey < property.length() && (keyValueSeparators.indexOf(property.charAt(endOfKey)) == -1)) { endOfKey++; } String key = property.substring(0, endOfKey); if (endOfKey < property.length()) { String value = property.substring(endOfKey + 1, property.length()); key = loadConversion(key); value = loadConversion(removeWhiteSpaces(value)); put(key, value); } } } line = in.readLine(); } }
/** * Reads a property list (key and element pairs) from the input * stream. The stream is assumed to be using the default * character encoding. * Characters can be written with their unicode escape sequence. * * @param inStream the input stream. * @exception IOException if an error occurred when reading from the * input stream. * @throws IllegalArgumentException if the input stream contains a * malformed Unicode escape sequence. * @see java.util.Properties#load(java.io.InputStream) */
Reads a property list (key and element pairs) from the input stream. The stream is assumed to be using the default character encoding. Characters can be written with their unicode escape sequence
load
{ "repo_name": "icenlp/icenlp-core", "path": "src/main/java/is/iclt/icenlp/core/utils/PropertiesEncoding.java", "license": "gpl-3.0", "size": 9680 }
[ "java.io.BufferedReader", "java.io.IOException", "java.io.InputStream" ]
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream;
import java.io.*;
[ "java.io" ]
java.io;
336,249
@ServiceMethod(returns = ReturnType.SINGLE) Response<PolicyAssignmentInner> getWithResponse(String scope, String policyAssignmentName, Context context);
@ServiceMethod(returns = ReturnType.SINGLE) Response<PolicyAssignmentInner> getWithResponse(String scope, String policyAssignmentName, Context context);
/** * This operation retrieves a single policy assignment, given its name and the scope it was created at. * * @param scope The scope of the policy assignment. Valid scopes are: management group (format: * '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: * '/subscriptions/{subscriptionId}'), resource group (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'. * @param policyAssignmentName The name of the policy assignment to get. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the policy assignment. */
This operation retrieves a single policy assignment, given its name and the scope it was created at
getWithResponse
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-resources/src/main/java/com/azure/resourcemanager/resources/fluent/PolicyAssignmentsClient.java", "license": "mit", "size": 66288 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.Response", "com.azure.core.util.Context", "com.azure.resourcemanager.resources.fluent.models.PolicyAssignmentInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.resources.fluent.models.PolicyAssignmentInner;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.resources.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
15,839
public static void copy(Reader in, Writer out, long byteCount) throws IOException { char buffer[] = new char[bufferSize]; int len=bufferSize; if (byteCount>=0) { while (byteCount>0) { if (byteCount<bufferSize) len=in.read(buffer,0,(int)byteCount); else len=in.read(buffer,0,bufferSize); if (len==-1) break; byteCount -= len; out.write(buffer,0,len); } } else if (out instanceof PrintWriter) { PrintWriter pout=(PrintWriter)out; while (!pout.checkError()) { len=in.read(buffer,0,bufferSize); if (len==-1) break; out.write(buffer,0,len); } } else { while (true) { len=in.read(buffer,0,bufferSize); if (len==-1) break; out.write(buffer,0,len); } } }
static void function(Reader in, Writer out, long byteCount) throws IOException { char buffer[] = new char[bufferSize]; int len=bufferSize; if (byteCount>=0) { while (byteCount>0) { if (byteCount<bufferSize) len=in.read(buffer,0,(int)byteCount); else len=in.read(buffer,0,bufferSize); if (len==-1) break; byteCount -= len; out.write(buffer,0,len); } } else if (out instanceof PrintWriter) { PrintWriter pout=(PrintWriter)out; while (!pout.checkError()) { len=in.read(buffer,0,bufferSize); if (len==-1) break; out.write(buffer,0,len); } } else { while (true) { len=in.read(buffer,0,bufferSize); if (len==-1) break; out.write(buffer,0,len); } } }
/** Copy Reader to Writer for byteCount bytes or until EOF or exception. */
Copy Reader to Writer for byteCount bytes or until EOF or exception
copy
{ "repo_name": "sdw2330976/Research-jetty-9.2.5", "path": "jetty-util/src/main/java/org/eclipse/jetty/util/IO.java", "license": "apache-2.0", "size": 13976 }
[ "java.io.IOException", "java.io.PrintWriter", "java.io.Reader", "java.io.Writer" ]
import java.io.IOException; import java.io.PrintWriter; import java.io.Reader; import java.io.Writer;
import java.io.*;
[ "java.io" ]
java.io;
1,344,293
public void process() throws WorkflowException { // Get the process instance UpdatableProcessInstance instance = (UpdatableProcessInstance) event.getProcessInstance(); ProcessInstanceManager instanceManager = WorkflowHub.getProcessInstanceManager(); Database db = null; UpdatableHistoryStep step = null; try { // Get database connection db = WorkflowJDOManager.getDatabase(); // begin transaction db.begin(); // Re-load process instance instance = (UpdatableProcessInstance) db.load(ProcessInstanceImpl.class, instance.getInstanceId()); // first create the history step try { step = (UpdatableHistoryStep) instanceManager.createHistoryStep(); step.setUserId(event.getUser().getUserId()); step.setAction("#response#"); step.setActionDate(event.getActionDate()); step.setUserRoleName(event.getUserRoleName()); step.setResolvedState(event.getResolvedState().getName()); step.setActionStatus(0); // To be processed // add the new step to the processInstance instance.addHistoryStep(step); } catch (WorkflowException we) { db.rollback(); WorkflowHub.getErrorManager().saveError(instance, event, null, we); // begin transaction db.begin(); // Re-load process instance instance = (UpdatableProcessInstance) db.load(ProcessInstanceImpl.class, instance.getInstanceId()); // set errorStatus to true instance.setErrorStatus(true); // begin transaction db.commit(); throw new WorkflowException("WorkflowEngineThread.process", "workflowEngine.EX_ERR_PROCESS_ADD_TASKDONE_REQUEST", we); } // commit db.commit(); // begin transaction db.begin(); // Re-load process instance instance = (UpdatableProcessInstance) db.load(ProcessInstanceImpl.class, instance.getInstanceId()); // Do workflow stuff try { processEvent(instance, step.getId()); } catch (WorkflowException we) { db.rollback(); // begin transaction db.begin(); // Re-load process instance instance = (UpdatableProcessInstance) db.load(ProcessInstanceImpl.class, instance.getInstanceId()); // set errorStatus to true instance.setErrorStatus(true); // begin transaction db.commit(); throw new WorkflowException("WorkflowEngineThread.process", "workflowEngine.EX_ERR_PROCESS_ADD_TASKDONE_REQUEST", we); } // commit db.commit(); } catch (PersistenceException pe) { WorkflowHub.getErrorManager().saveError(instance, event, step, pe); throw new WorkflowException("WorkflowEngineThread.process", "workflowEngine.EX_ERR_PROCESS_ADD_TASKDONE_REQUEST", pe); } finally { WorkflowJDOManager.closeDatabase(db); } }
void function() throws WorkflowException { UpdatableProcessInstance instance = (UpdatableProcessInstance) event.getProcessInstance(); ProcessInstanceManager instanceManager = WorkflowHub.getProcessInstanceManager(); Database db = null; UpdatableHistoryStep step = null; try { db = WorkflowJDOManager.getDatabase(); db.begin(); instance = (UpdatableProcessInstance) db.load(ProcessInstanceImpl.class, instance.getInstanceId()); try { step = (UpdatableHistoryStep) instanceManager.createHistoryStep(); step.setUserId(event.getUser().getUserId()); step.setAction(STR); step.setActionDate(event.getActionDate()); step.setUserRoleName(event.getUserRoleName()); step.setResolvedState(event.getResolvedState().getName()); step.setActionStatus(0); instance.addHistoryStep(step); } catch (WorkflowException we) { db.rollback(); WorkflowHub.getErrorManager().saveError(instance, event, null, we); db.begin(); instance = (UpdatableProcessInstance) db.load(ProcessInstanceImpl.class, instance.getInstanceId()); instance.setErrorStatus(true); db.commit(); throw new WorkflowException(STR, STR, we); } db.commit(); db.begin(); instance = (UpdatableProcessInstance) db.load(ProcessInstanceImpl.class, instance.getInstanceId()); try { processEvent(instance, step.getId()); } catch (WorkflowException we) { db.rollback(); db.begin(); instance = (UpdatableProcessInstance) db.load(ProcessInstanceImpl.class, instance.getInstanceId()); instance.setErrorStatus(true); db.commit(); throw new WorkflowException(STR, STR, we); } db.commit(); } catch (PersistenceException pe) { WorkflowHub.getErrorManager().saveError(instance, event, step, pe); throw new WorkflowException(STR, STR, pe); } finally { WorkflowJDOManager.closeDatabase(db); } }
/** * Method declaration */
Method declaration
process
{ "repo_name": "ebonnet/Silverpeas-Core", "path": "core-services/workflow/src/main/java/org/silverpeas/core/workflow/engine/WorkflowEngineThread.java", "license": "agpl-3.0", "size": 39455 }
[ "org.exolab.castor.jdo.Database", "org.exolab.castor.jdo.PersistenceException", "org.silverpeas.core.workflow.api.ProcessInstanceManager", "org.silverpeas.core.workflow.api.WorkflowException", "org.silverpeas.core.workflow.api.instance.UpdatableHistoryStep", "org.silverpeas.core.workflow.api.instance.UpdatableProcessInstance", "org.silverpeas.core.workflow.engine.instance.ProcessInstanceImpl", "org.silverpeas.core.workflow.engine.jdo.WorkflowJDOManager" ]
import org.exolab.castor.jdo.Database; import org.exolab.castor.jdo.PersistenceException; import org.silverpeas.core.workflow.api.ProcessInstanceManager; import org.silverpeas.core.workflow.api.WorkflowException; import org.silverpeas.core.workflow.api.instance.UpdatableHistoryStep; import org.silverpeas.core.workflow.api.instance.UpdatableProcessInstance; import org.silverpeas.core.workflow.engine.instance.ProcessInstanceImpl; import org.silverpeas.core.workflow.engine.jdo.WorkflowJDOManager;
import org.exolab.castor.jdo.*; import org.silverpeas.core.workflow.api.*; import org.silverpeas.core.workflow.api.instance.*; import org.silverpeas.core.workflow.engine.instance.*; import org.silverpeas.core.workflow.engine.jdo.*;
[ "org.exolab.castor", "org.silverpeas.core" ]
org.exolab.castor; org.silverpeas.core;
1,298,479
public jsx3.gui.ColorPicker setAxis(int intAxis) { ScriptBuffer script = new ScriptBuffer(); script.appendCall(getContextPath() + "setAxis", intAxis); ScriptSessions.addScript(script); return this; }
jsx3.gui.ColorPicker function(int intAxis) { ScriptBuffer script = new ScriptBuffer(); script.appendCall(getContextPath() + STR, intAxis); ScriptSessions.addScript(script); return this; }
/** * Sets the color axis shown on the right side of the control. The other two axes are displayed in a box on the left side. * @param intAxis <code>HUE</code>, <code>SATURATION</code>, or <code>BRIGHTNESS</code>. */
Sets the color axis shown on the right side of the control. The other two axes are displayed in a box on the
setAxis
{ "repo_name": "burris/dwr", "path": "ui/gi/generated/java/jsx3/gui/ColorPicker.java", "license": "apache-2.0", "size": 27297 }
[ "org.directwebremoting.ScriptBuffer", "org.directwebremoting.ScriptSessions" ]
import org.directwebremoting.ScriptBuffer; import org.directwebremoting.ScriptSessions;
import org.directwebremoting.*;
[ "org.directwebremoting" ]
org.directwebremoting;
224,251
public static List<String> phoneMnemonics(String phoneNumber) { char[] partialMnemonic = new char[phoneNumber.length()]; List<String> result = new ArrayList<>(); phoneMnemonicsRecursive(phoneNumber, 0, partialMnemonic, result); return result; }
static List<String> function(String phoneNumber) { char[] partialMnemonic = new char[phoneNumber.length()]; List<String> result = new ArrayList<>(); phoneMnemonicsRecursive(phoneNumber, 0, partialMnemonic, result); return result; }
/** * Returns all possible character sequences that correspond to the given phone number * * @param phoneNumber the phone number * @return List of all possible mnemonics corresponding to the given phone number * * @time <i>O(4<sup>n</sup> <b>·</b> n)</i> * @space <i>O(n)</i> **/
Returns all possible character sequences that correspond to the given phone number
phoneMnemonics
{ "repo_name": "murick/Algorithms", "path": "Java/src/main/java/recursion/phoneMnemonics/Solution1A.java", "license": "apache-2.0", "size": 2575 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
318,075
public void setBPM(int bpm) { float beatInHz = bpm/60f; OscMessage rateMessage = new OscMessage(new Object[] { "n_set",clockNode,"rate",beatInHz }); Log.d(TAG,"RATE:"+rateMessage.toString()); superCollider.sendMessage(rateMessage); }
void function(int bpm) { float beatInHz = bpm/60f; OscMessage rateMessage = new OscMessage(new Object[] { "n_set",clockNode,"rate",beatInHz }); Log.d(TAG,"RATE:"+rateMessage.toString()); superCollider.sendMessage(rateMessage); }
/** * Set the BPM of the supercollider clock * * @param bpm */
Set the BPM of the supercollider clock
setBPM
{ "repo_name": "glastonbridge/ScanVox", "path": "src/org/isophonics/scanvox/SoundManager.java", "license": "gpl-3.0", "size": 16125 }
[ "android.util.Log", "net.sf.supercollider.android.OscMessage" ]
import android.util.Log; import net.sf.supercollider.android.OscMessage;
import android.util.*; import net.sf.supercollider.android.*;
[ "android.util", "net.sf.supercollider" ]
android.util; net.sf.supercollider;
482,985
public Object eval(byte[] script, List<byte[]> keys, List<byte[]> args) { return eval(script, toByteArray(keys.size()), getParamsWithBinary(keys, args)); }
Object function(byte[] script, List<byte[]> keys, List<byte[]> args) { return eval(script, toByteArray(keys.size()), getParamsWithBinary(keys, args)); }
/** * Evaluates scripts using the Lua interpreter built into Redis starting from version 2.6.0. * <p> * @return Script result */
Evaluates scripts using the Lua interpreter built into Redis starting from version 2.6.0.
eval
{ "repo_name": "corydolphin/jedis", "path": "src/main/java/redis/clients/jedis/BinaryJedis.java", "license": "mit", "size": 122575 }
[ "java.util.List", "redis.clients.jedis.Protocol" ]
import java.util.List; import redis.clients.jedis.Protocol;
import java.util.*; import redis.clients.jedis.*;
[ "java.util", "redis.clients.jedis" ]
java.util; redis.clients.jedis;
2,179,611
void propagate(MleDensityAccumulator source) { if (source.n == 0) return; // observations n += source.n; // stats occ += source.occ; Arithmetics.vadd2(mue, source.mue); Arithmetics.vadd2(cov, source.cov); }
void propagate(MleDensityAccumulator source) { if (source.n == 0) return; n += source.n; occ += source.occ; Arithmetics.vadd2(mue, source.mue); Arithmetics.vadd2(cov, source.cov); }
/** * Add the referenced accumulator's scores to this one's. * @param source */
Add the referenced accumulator's scores to this one's
propagate
{ "repo_name": "jokereactive/SpeakerCounter", "path": "src/de/fau/cs/jstk/stat/MleDensityAccumulator.java", "license": "gpl-3.0", "size": 7560 }
[ "de.fau.cs.jstk.util.Arithmetics" ]
import de.fau.cs.jstk.util.Arithmetics;
import de.fau.cs.jstk.util.*;
[ "de.fau.cs" ]
de.fau.cs;
2,194,921
public void addOption(String returnValue, Message message) throws WingException { Option option = this.addOption(returnValue); option.addContent(message); }
void function(String returnValue, Message message) throws WingException { Option option = this.addOption(returnValue); option.addContent(message); }
/** * Add an option. * * @param returnValue * (Required) The value to be passed back if this option is * selected. * @param message * (Required) The transalted text to set as the visible option. */
Add an option
addOption
{ "repo_name": "jamie-dryad/dryad-repo", "path": "dspace-xmlui/dspace-xmlui-wing/src/main/java/org/dspace/app/xmlui/wing/element/Radio.java", "license": "bsd-3-clause", "size": 8375 }
[ "org.dspace.app.xmlui.wing.Message", "org.dspace.app.xmlui.wing.WingException" ]
import org.dspace.app.xmlui.wing.Message; import org.dspace.app.xmlui.wing.WingException;
import org.dspace.app.xmlui.wing.*;
[ "org.dspace.app" ]
org.dspace.app;
1,341,159
public static void writeString(DataOutput out, String s) throws IOException { // Write null flag. out.writeBoolean(s == null); if (s != null) out.writeUTF(s); }
static void function(DataOutput out, String s) throws IOException { out.writeBoolean(s == null); if (s != null) out.writeUTF(s); }
/** * Writes string to output stream accounting for {@code null} values. * * @param out Output stream to write to. * @param s String to write, possibly {@code null}. * @throws IOException If write failed. */
Writes string to output stream accounting for null values
writeString
{ "repo_name": "pperalta/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java", "license": "apache-2.0", "size": 314980 }
[ "java.io.DataOutput", "java.io.IOException" ]
import java.io.DataOutput; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,151,818
@Override protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); newChildDescriptors.add (createChildParameter (AstPackage.Literals.COMPOSITE_NODE__CHILDREN, AstFactory.eINSTANCE.createWhitespaceNode())); newChildDescriptors.add (createChildParameter (AstPackage.Literals.COMPOSITE_NODE__CHILDREN, AstFactory.eINSTANCE.createTerminalNode())); newChildDescriptors.add (createChildParameter (AstPackage.Literals.COMPOSITE_NODE__CHILDREN, AstFactory.eINSTANCE.createRemovedTerminalNode())); newChildDescriptors.add (createChildParameter (AstPackage.Literals.COMPOSITE_NODE__CHILDREN, AstFactory.eINSTANCE.createInsertedTerminalNode())); newChildDescriptors.add (createChildParameter (AstPackage.Literals.COMPOSITE_NODE__CHILDREN, AstFactory.eINSTANCE.createInsertedFeatureSetTerminalNode())); newChildDescriptors.add (createChildParameter (AstPackage.Literals.COMPOSITE_NODE__CHILDREN, AstFactory.eINSTANCE.createFeatureSetValue())); newChildDescriptors.add (createChildParameter (AstPackage.Literals.COMPOSITE_NODE__CHILDREN, AstFactory.eINSTANCE.createFeatureSetTerminalNode())); newChildDescriptors.add (createChildParameter (AstPackage.Literals.COMPOSITE_NODE__CHILDREN, AstFactory.eINSTANCE.createCompositeNode())); newChildDescriptors.add (createChildParameter (AstPackage.Literals.COMPOSITE_NODE__CHILDREN, AstFactory.eINSTANCE.createFeatureSetCompositeNode())); newChildDescriptors.add (createChildParameter (AstPackage.Literals.COMPOSITE_NODE__CHILDREN, AstFactory.eINSTANCE.createPushElement())); newChildDescriptors.add (createChildParameter (AstPackage.Literals.COMPOSITE_NODE__CHILDREN, AstFactory.eINSTANCE.createFeatureSetPushElement())); newChildDescriptors.add (createChildParameter (AstPackage.Literals.COMPOSITE_NODE__CHILDREN, AstFactory.eINSTANCE.createPopElement())); }
void function(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); newChildDescriptors.add (createChildParameter (AstPackage.Literals.COMPOSITE_NODE__CHILDREN, AstFactory.eINSTANCE.createWhitespaceNode())); newChildDescriptors.add (createChildParameter (AstPackage.Literals.COMPOSITE_NODE__CHILDREN, AstFactory.eINSTANCE.createTerminalNode())); newChildDescriptors.add (createChildParameter (AstPackage.Literals.COMPOSITE_NODE__CHILDREN, AstFactory.eINSTANCE.createRemovedTerminalNode())); newChildDescriptors.add (createChildParameter (AstPackage.Literals.COMPOSITE_NODE__CHILDREN, AstFactory.eINSTANCE.createInsertedTerminalNode())); newChildDescriptors.add (createChildParameter (AstPackage.Literals.COMPOSITE_NODE__CHILDREN, AstFactory.eINSTANCE.createInsertedFeatureSetTerminalNode())); newChildDescriptors.add (createChildParameter (AstPackage.Literals.COMPOSITE_NODE__CHILDREN, AstFactory.eINSTANCE.createFeatureSetValue())); newChildDescriptors.add (createChildParameter (AstPackage.Literals.COMPOSITE_NODE__CHILDREN, AstFactory.eINSTANCE.createFeatureSetTerminalNode())); newChildDescriptors.add (createChildParameter (AstPackage.Literals.COMPOSITE_NODE__CHILDREN, AstFactory.eINSTANCE.createCompositeNode())); newChildDescriptors.add (createChildParameter (AstPackage.Literals.COMPOSITE_NODE__CHILDREN, AstFactory.eINSTANCE.createFeatureSetCompositeNode())); newChildDescriptors.add (createChildParameter (AstPackage.Literals.COMPOSITE_NODE__CHILDREN, AstFactory.eINSTANCE.createPushElement())); newChildDescriptors.add (createChildParameter (AstPackage.Literals.COMPOSITE_NODE__CHILDREN, AstFactory.eINSTANCE.createFeatureSetPushElement())); newChildDescriptors.add (createChildParameter (AstPackage.Literals.COMPOSITE_NODE__CHILDREN, AstFactory.eINSTANCE.createPopElement())); }
/** * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children * that can be created under this object. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This adds <code>org.eclipse.emf.edit.command.CommandParameter</code>s describing the children that can be created under this object.
collectNewChildDescriptors
{ "repo_name": "balazsgrill/temon", "path": "hu.temon.edit/src/hu/temon/ast/provider/CompositeNodeItemProvider.java", "license": "epl-1.0", "size": 7451 }
[ "hu.temon.ast.AstFactory", "hu.temon.ast.AstPackage", "java.util.Collection" ]
import hu.temon.ast.AstFactory; import hu.temon.ast.AstPackage; import java.util.Collection;
import hu.temon.ast.*; import java.util.*;
[ "hu.temon.ast", "java.util" ]
hu.temon.ast; java.util;
1,912,241
@Override public String getClientID() throws JMSException { if (ActiveMQRASessionFactoryImpl.trace) { ActiveMQRALogger.LOGGER.trace("getClientID()"); } checkClosed(); if (clientID == null) { return ((ActiveMQResourceAdapter) mcf.getResourceAdapter()).getProperties().getClientID(); } return clientID; }
String function() throws JMSException { if (ActiveMQRASessionFactoryImpl.trace) { ActiveMQRALogger.LOGGER.trace(STR); } checkClosed(); if (clientID == null) { return ((ActiveMQResourceAdapter) mcf.getResourceAdapter()).getProperties().getClientID(); } return clientID; }
/** * Get the client ID * * @return The client ID * @throws JMSException Thrown if an error occurs */
Get the client ID
getClientID
{ "repo_name": "dudaerich/activemq-artemis", "path": "artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQRASessionFactoryImpl.java", "license": "apache-2.0", "size": 31766 }
[ "javax.jms.JMSException" ]
import javax.jms.JMSException;
import javax.jms.*;
[ "javax.jms" ]
javax.jms;
863,252
private HashMap<String, String> getCredentialsFromCSF(String map, String key) { LOGGER.log(ODLLevel.TRACE, "Enter getWavesetCredentialsFromCSF() with parameters: Map = {0}, Key = {1}", new Object[]{map, key}); HashMap<String, String> credentials = null; try { String userName = ""; String password = ""; String description = ""; JpsContext ctx = JpsContextFactory.getContextFactory().getContext(); LOGGER.log(ODLLevel.TRACE, "Context: {0} ", new Object[]{ctx.getName()}); final CredentialStore cs = (CredentialStore) ctx.getServiceInstance(CredentialStore.class); LOGGER.log(ODLLevel.TRACE, "Credential Store: {0}", new Object[]{cs.getName()}); CredentialMap cmap = cs.getCredentialMap(map); LOGGER.log(ODLLevel.TRACE, "Credential Map: {0} ", new Object[]{cmap.toString()}); Credential cred = cmap.getCredential(key); LOGGER.log(ODLLevel.TRACE, "Gathered Credential"); if(cred instanceof PasswordCredential) { PasswordCredential pcred = (PasswordCredential) cred; char[] p = pcred.getPassword(); userName = pcred.getName(); password = new String(p); description = pcred.getDescription(); credentials = new HashMap<String, String>(); credentials.put("username", userName); credentials.put("password", password); credentials.put("description", description); } } catch (JpsException ex) { LOGGER.log(ODLLevel.SEVERE, "", ex); } catch(Exception ex) { LOGGER.log(ODLLevel.SEVERE, "", ex); } return credentials; }
HashMap<String, String> function(String map, String key) { LOGGER.log(ODLLevel.TRACE, STR, new Object[]{map, key}); HashMap<String, String> credentials = null; try { String userName = STRSTRSTRContext: {0} STRCredential Store: {0}STRCredential Map: {0} STRGathered CredentialSTRusernameSTRpasswordSTRdescriptionSTRSTR", ex); } return credentials; }
/** * Fetches credentials from WebLogic Credential Store. * @param map Name of map where key is under * @param key Name of key * @return HashMap of connection information including * <br/>username<br/>password<br/>description */
Fetches credentials from WebLogic Credential Store
getCredentialsFromCSF
{ "repo_name": "rayedchan/OIMUtilities", "path": "src/com/blogspot/oraclestack/scheduledtasks/FetchFromCredentialStore.java", "license": "mit", "size": 6827 }
[ "java.util.HashMap", "java.util.Map", "oracle.core.ojdl.logging.ODLLevel" ]
import java.util.HashMap; import java.util.Map; import oracle.core.ojdl.logging.ODLLevel;
import java.util.*; import oracle.core.ojdl.logging.*;
[ "java.util", "oracle.core.ojdl" ]
java.util; oracle.core.ojdl;
89,446
@ThreadSafe public void wssMessage(WebSocket ws, ByteBuffer message);
void function(WebSocket ws, ByteBuffer message);
/** * Callback for binary messages received from the remote host * * @param ws * @param message * @see #onMessage(WebSocket, String) * */
Callback for binary messages received from the remote host
wssMessage
{ "repo_name": "Periapsis/aphelion", "path": "src/main/java/aphelion/shared/net/HttpWebSocketServerListener.java", "license": "agpl-3.0", "size": 4820 }
[ "java.nio.ByteBuffer", "org.java_websocket.WebSocket" ]
import java.nio.ByteBuffer; import org.java_websocket.WebSocket;
import java.nio.*; import org.java_websocket.*;
[ "java.nio", "org.java_websocket" ]
java.nio; org.java_websocket;
1,269,294
public boolean getHideAudioButton(HttpServletRequest request) { if (request != null && request.getParameter("hideAudioButton") != null) { String height = request.getParameter("hideAudioButton"); return Boolean.parseBoolean(height); } if (!getUseAudio(request)) { return false; } Element layoutE = getUniqueDescendant(getDocument().getFirstChild(), "layout"); Element audioE = getUniqueDescendant(layoutE, "audio"); return Boolean.parseBoolean(audioE.getAttribute("hideButton")); }
boolean function(HttpServletRequest request) { if (request != null && request.getParameter(STR) != null) { String height = request.getParameter(STR); return Boolean.parseBoolean(height); } if (!getUseAudio(request)) { return false; } Element layoutE = getUniqueDescendant(getDocument().getFirstChild(), STR); Element audioE = getUniqueDescendant(layoutE, "audio"); return Boolean.parseBoolean(audioE.getAttribute(STR)); }
/** * Specifies whether or not to hide the audio button on the applet (default * false) */
Specifies whether or not to hide the audio button on the applet (default false)
getHideAudioButton
{ "repo_name": "ananthvelu/wami", "path": "src/edu/mit/csail/sls/wami/WamiConfig.java", "license": "mit", "size": 39472 }
[ "javax.servlet.http.HttpServletRequest", "org.w3c.dom.Element" ]
import javax.servlet.http.HttpServletRequest; import org.w3c.dom.Element;
import javax.servlet.http.*; import org.w3c.dom.*;
[ "javax.servlet", "org.w3c.dom" ]
javax.servlet; org.w3c.dom;
2,102,435
public ContentSource createRepo(User loggedInUser, String label, String type, String url, String sslCaCert, String sslCliCert, String sslCliKey) { if (StringUtils.isEmpty(label)) { throw new InvalidParameterException("label might not be empty"); } if (StringUtils.isEmpty(url)) { throw new InvalidParameterException("url might not be empty"); } type = type.toLowerCase(); BaseRepoCommand repoCmd = new CreateRepoCommand(loggedInUser.getOrg()); repoCmd.setLabel(label); repoCmd.setUrl(url); repoCmd.setType(type); // check SSL-certificates parameters if (!StringUtils.isEmpty(sslCaCert)) { try { // FIXME: Allow to set multiple SSL sets per custom repo - new API calls? repoCmd.addSslSet(getKeyId(loggedInUser, sslCaCert), getKeyId(loggedInUser, sslCliCert), getKeyId(loggedInUser, sslCliKey)); } catch (InvalidCertificateException e) { throw new NoSuchCryptoKeyException(e.getMessage()); } } else if (!StringUtils.isEmpty(sslCliCert) || !StringUtils.isEmpty(sslCliKey)) { log.warn("SSL CA Certificate is missing, ignoring other SSL Certs/Keys"); } repoCmd.store(); return ChannelFactory.lookupContentSourceByOrgAndLabel(loggedInUser.getOrg(), label); }
ContentSource function(User loggedInUser, String label, String type, String url, String sslCaCert, String sslCliCert, String sslCliKey) { if (StringUtils.isEmpty(label)) { throw new InvalidParameterException(STR); } if (StringUtils.isEmpty(url)) { throw new InvalidParameterException(STR); } type = type.toLowerCase(); BaseRepoCommand repoCmd = new CreateRepoCommand(loggedInUser.getOrg()); repoCmd.setLabel(label); repoCmd.setUrl(url); repoCmd.setType(type); if (!StringUtils.isEmpty(sslCaCert)) { try { repoCmd.addSslSet(getKeyId(loggedInUser, sslCaCert), getKeyId(loggedInUser, sslCliCert), getKeyId(loggedInUser, sslCliKey)); } catch (InvalidCertificateException e) { throw new NoSuchCryptoKeyException(e.getMessage()); } } else if (!StringUtils.isEmpty(sslCliCert) !StringUtils.isEmpty(sslCliKey)) { log.warn(STR); } repoCmd.store(); return ChannelFactory.lookupContentSourceByOrgAndLabel(loggedInUser.getOrg(), label); }
/** * Creates a repository * @param loggedInUser The current user * @param label of the repo to be created * @param type of the repo * @param url of the repo * @param sslCaCert CA certificate description * @param sslCliCert Client certificate description * @param sslCliKey Client key description * @return new ContentSource * * @xmlrpc.doc Creates a repository * @xmlrpc.param #session_key() * @xmlrpc.param #param_desc("string", "label", "repository label") * @xmlrpc.param #param_desc("string", "type", * "repository type (yum, uln...)") * @xmlrpc.param #param_desc("string", "url", "repository url") * @xmlrpc.param #param_desc("string", "sslCaCert", "SSL CA cert description") * @xmlrpc.param #param_desc("string", "sslCliCert", "SSL Client cert description") * @xmlrpc.param #param_desc("string", "sslCliKey", "SSL Client key description") * @xmlrpc.returntype $ContentSourceSerializer **/
Creates a repository
createRepo
{ "repo_name": "ogajduse/spacewalk", "path": "java/code/src/com/redhat/rhn/frontend/xmlrpc/channel/software/ChannelSoftwareHandler.java", "license": "gpl-2.0", "size": 133982 }
[ "com.redhat.rhn.common.client.InvalidCertificateException", "com.redhat.rhn.domain.channel.ChannelFactory", "com.redhat.rhn.domain.channel.ContentSource", "com.redhat.rhn.domain.user.User", "com.redhat.rhn.frontend.xmlrpc.InvalidParameterException", "com.redhat.rhn.manager.channel.repo.BaseRepoCommand", "com.redhat.rhn.manager.channel.repo.CreateRepoCommand", "com.redhat.rhn.manager.kickstart.crypto.NoSuchCryptoKeyException", "org.apache.commons.lang.StringUtils" ]
import com.redhat.rhn.common.client.InvalidCertificateException; import com.redhat.rhn.domain.channel.ChannelFactory; import com.redhat.rhn.domain.channel.ContentSource; import com.redhat.rhn.domain.user.User; import com.redhat.rhn.frontend.xmlrpc.InvalidParameterException; import com.redhat.rhn.manager.channel.repo.BaseRepoCommand; import com.redhat.rhn.manager.channel.repo.CreateRepoCommand; import com.redhat.rhn.manager.kickstart.crypto.NoSuchCryptoKeyException; import org.apache.commons.lang.StringUtils;
import com.redhat.rhn.common.client.*; import com.redhat.rhn.domain.channel.*; import com.redhat.rhn.domain.user.*; import com.redhat.rhn.frontend.xmlrpc.*; import com.redhat.rhn.manager.channel.repo.*; import com.redhat.rhn.manager.kickstart.crypto.*; import org.apache.commons.lang.*;
[ "com.redhat.rhn", "org.apache.commons" ]
com.redhat.rhn; org.apache.commons;
566,373
public void badRequest(final BadRequestException exception) { logWarn("Bad Request on " + request().getUri() + ": " + exception.getMessage()); sendStatusOnly(HttpResponseStatus.BAD_REQUEST); }
void function(final BadRequestException exception) { logWarn(STR + request().getUri() + STR + exception.getMessage()); sendStatusOnly(HttpResponseStatus.BAD_REQUEST); }
/** * Sends <code>400/Bad Request</code> status to the client. * @param exception The exception that was thrown */
Sends <code>400/Bad Request</code> status to the client
badRequest
{ "repo_name": "geoffreyanderson/opentsdb", "path": "src/tsd/AbstractHttpQuery.java", "license": "gpl-3.0", "size": 17287 }
[ "org.jboss.netty.handler.codec.http.HttpResponseStatus" ]
import org.jboss.netty.handler.codec.http.HttpResponseStatus;
import org.jboss.netty.handler.codec.http.*;
[ "org.jboss.netty" ]
org.jboss.netty;
109,952
public File getFileForKey(String key) { return new File(mRootDirectory, getFilenameForKey(key)); }
File function(String key) { return new File(mRootDirectory, getFilenameForKey(key)); }
/** * Returns a file object for the given cache key. */
Returns a file object for the given cache key
getFileForKey
{ "repo_name": "zzlnewair/android_study", "path": "实战篇/Volley/Volley-master/src/com/android/volley/toolbox/DiskBasedCache.java", "license": "gpl-2.0", "size": 17844 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
2,253,049
public RangeCursor dup(boolean samePosition) throws DatabaseException { try { RangeCursor c = (RangeCursor) super.clone(); c.cursor = dupCursor(cursor, samePosition); c.init(); return c; } catch (CloneNotSupportedException neverHappens) { return null; } }
RangeCursor function(boolean samePosition) throws DatabaseException { try { RangeCursor c = (RangeCursor) super.clone(); c.cursor = dupCursor(cursor, samePosition); c.init(); return c; } catch (CloneNotSupportedException neverHappens) { return null; } }
/** * Create a cloned range cursor. The caller must clone the underlying * cursor before using this constructor, because cursor open/close is * handled specially for CDS cursors outside this class. */
Create a cloned range cursor. The caller must clone the underlying cursor before using this constructor, because cursor open/close is handled specially for CDS cursors outside this class
dup
{ "repo_name": "prat0318/dbms", "path": "mini_dbms/je-5.0.103/src/com/sleepycat/util/keyrange/RangeCursor.java", "license": "mit", "size": 37406 }
[ "com.sleepycat.je.DatabaseException" ]
import com.sleepycat.je.DatabaseException;
import com.sleepycat.je.*;
[ "com.sleepycat.je" ]
com.sleepycat.je;
2,073,128
private void realSkip(long value) throws IOException { if (value >= 0) { long skipped = 0; while (skipped < value) { long rem = value - skipped; int x = in.read(SKIP_BUF, 0, (int) (SKIP_BUF.length > rem ? rem : SKIP_BUF.length)); if (x == -1) { return; } count(x); skipped += x; } return; } throw new IllegalArgumentException(); }
void function(long value) throws IOException { if (value >= 0) { long skipped = 0; while (skipped < value) { long rem = value - skipped; int x = in.read(SKIP_BUF, 0, (int) (SKIP_BUF.length > rem ? rem : SKIP_BUF.length)); if (x == -1) { return; } count(x); skipped += x; } return; } throw new IllegalArgumentException(); }
/** * Skips bytes by reading from the underlying stream rather than * the (potentially inflating) archive stream - which {@link * #skip} would do. * * Also updates bytes-read counter. */
Skips bytes by reading from the underlying stream rather than the (potentially inflating) archive stream - which <code>#skip</code> would do. Also updates bytes-read counter
realSkip
{ "repo_name": "wspeirs/sop4j-base", "path": "src/main/java/com/sop4j/base/apache/compress/archivers/zip/ZipArchiveInputStream.java", "license": "apache-2.0", "size": 37230 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
682,890
public PolicyDefinition transacted(String ref) { PolicyDefinition answer = new PolicyDefinition(); answer.setType(TransactedPolicy.class); answer.setRef(ref); addOutput(answer); return answer; } // Transformers // ------------------------------------------------------------------------- /** * <a href="http://camel.apache.org/message-translator.html">Message Translator EIP:</a> * Adds the custom processor to this destination which could be a final * destination, or could be a transformation in a pipeline * * @param processor the custom {@link Processor}
PolicyDefinition function(String ref) { PolicyDefinition answer = new PolicyDefinition(); answer.setType(TransactedPolicy.class); answer.setRef(ref); addOutput(answer); return answer; } /** * <a href="http: * Adds the custom processor to this destination which could be a final * destination, or could be a transformation in a pipeline * * @param processor the custom {@link Processor}
/** * Marks this route as transacted. * * @param ref reference to lookup a transacted policy in the registry * @return the policy builder to configure */
Marks this route as transacted
transacted
{ "repo_name": "chicagozer/rheosoft", "path": "camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java", "license": "apache-2.0", "size": 125020 }
[ "org.apache.camel.Processor", "org.apache.camel.spi.TransactedPolicy" ]
import org.apache.camel.Processor; import org.apache.camel.spi.TransactedPolicy;
import org.apache.camel.*; import org.apache.camel.spi.*;
[ "org.apache.camel" ]
org.apache.camel;
576,609
// read the array from stdin Scanner scanner = new Scanner(System.in); int arraySize = scanner.nextInt(); int[] array = new int[arraySize]; for (int i = 0; i < arraySize; i++) array[i] = scanner.nextInt(); System.out.println("Array loaded, sorting"); sort(array); System.out.println(Arrays.toString(array)); } /** * Sorts the array {@code array}
Scanner scanner = new Scanner(System.in); int arraySize = scanner.nextInt(); int[] array = new int[arraySize]; for (int i = 0; i < arraySize; i++) array[i] = scanner.nextInt(); System.out.println(STR); sort(array); System.out.println(Arrays.toString(array)); } /** * Sorts the array {@code array}
/** * Reads from stdin * 1) the number of integers we are about to receive * 2) that number of ints * * @param args ignored */
Reads from stdin 1) the number of integers we are about to receive 2) that number of ints
main
{ "repo_name": "knappa/CSC281", "path": "Selection.java", "license": "mit", "size": 1349 }
[ "java.util.Arrays", "java.util.Scanner" ]
import java.util.Arrays; import java.util.Scanner;
import java.util.*;
[ "java.util" ]
java.util;
2,284,440
Map<String, String> getAdditionalParameters();
Map<String, String> getAdditionalParameters();
/** Returns a map from request parameter names to Solr query parts (where the parameter's values are typically inserted). * @return A map from request parameter names to Solr query parts (where the parameter's values are typically inserted). */
Returns a map from request parameter names to Solr query parts (where the parameter's values are typically inserted)
getAdditionalParameters
{ "repo_name": "alkacon/opencms-core", "path": "src/org/opencms/jsp/search/config/I_CmsSearchConfigurationCommon.java", "license": "lgpl-2.1", "size": 4995 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,813,589
public String tryToLock(File file) throws Exception { return null; }
String function(File file) throws Exception { return null; }
/** * Attempts to lock the map using semaphore file. * * @return If the map is locked, return the name of the locking user, return * null otherwise. * @throws Exception */
Attempts to lock the map using semaphore file
tryToLock
{ "repo_name": "derekprovance/Freemind", "path": "freemind/modes/MapAdapter.java", "license": "gpl-2.0", "size": 18852 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
2,506,056
private void initalizeAndConfigureActionBar() { actionBar = getSupportActionBar(); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST); actionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor("#085382"))); initalizeAndConfigureActionBarSpinners(); actionBar.setDisplayHomeAsUpEnabled(false); actionBar.setDisplayShowTitleEnabled(true); actionBar.setListNavigationCallbacks(adapter, navigationListener); actionBar.setSelectedNavigationItem(adapter.getCount()); }
void function() { actionBar = getSupportActionBar(); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST); actionBar.setBackgroundDrawable(new ColorDrawable(Color.parseColor(STR))); initalizeAndConfigureActionBarSpinners(); actionBar.setDisplayHomeAsUpEnabled(false); actionBar.setDisplayShowTitleEnabled(true); actionBar.setListNavigationCallbacks(adapter, navigationListener); actionBar.setSelectedNavigationItem(adapter.getCount()); }
/** * Initializes and configures the ActionBar depending on the users API-Level * The backward compatible version uses a hacked together spinner for the * drop down menu in the action bar, as it did not exist prior to API-level * 11. */
Initializes and configures the ActionBar depending on the users API-Level The backward compatible version uses a hacked together spinner for the drop down menu in the action bar, as it did not exist prior to API-level 11
initalizeAndConfigureActionBar
{ "repo_name": "barentswatch/fiskinfoapp", "path": "src/no/barentswatch/fiskinfo/BaseActivity.java", "license": "apache-2.0", "size": 55069 }
[ "android.app.ActionBar", "android.graphics.Color", "android.graphics.drawable.ColorDrawable" ]
import android.app.ActionBar; import android.graphics.Color; import android.graphics.drawable.ColorDrawable;
import android.app.*; import android.graphics.*; import android.graphics.drawable.*;
[ "android.app", "android.graphics" ]
android.app; android.graphics;
234,616