method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public int onUpdateSelection(int oldSelStart, int oldSelEnd, int newSelStart, int newSelEnd, int candidatesStart, int candidatesEnd) { if (MozcLog.isLoggable(Log.DEBUG)) { MozcLog.d(String.format("onUpdateSelection: %d %d %d %d %d %d", oldSelStart, oldSelEnd, newSelStart, newSelEnd, candidatesStart, candidatesEnd)); MozcLog.d(recordQueue.toString()); } Record record = new Record(candidatesStart, candidatesEnd, newSelStart, newSelEnd); // There are four cases to come here. // 1) Framework invokes this callback when the caret position is updated due to the text // change from IME, i.e. MozcService. // 2-1) During composition, users can move the caret position by tapping somewhere around the // current preedit text. // 2-2) During composition, users can make a selection region by long-tapping somewhere text. // 3) Unexpected cursor/selection moving coming from outside of MozcService. // At first, we checks 1) state. if (recordQueue.contains(record)) { // This is case 1). Discard preceding records, because on some devices, some callbacks are // just skipped. while (!recordQueue.isEmpty()) { Record head = recordQueue.peekFirst(); if (record.equals(head)) { // Note: keep the last record. break; } recordQueue.removeFirst(); } return DO_NOTHING; } // Here, the event is not caused by MozcService (probably). Record lastRecord = recordQueue.peekLast(); if (lastRecord != null && lastRecord.candidatesStart >= 0 && lastRecord.candidatesStart == candidatesStart && lastRecord.candidatesEnd == candidatesEnd) { // This is the case 2). // Remember the new position. clear(); offerInternal(candidatesStart, candidatesEnd, newSelStart, newSelEnd); if (newSelStart == newSelEnd) { // This is case 2-1) // In composition with tapping somewhere. return MozcUtil.clamp(newSelStart - candidatesStart, 0, candidatesEnd - candidatesStart); } // This is case 2-2). // Commit the composing text and reset the context. So that, in the next turn, // the user can edit the selected region as usual. return RESET_CONTEXT; } // Here is the case 3), i.e. totally unknown state. // This can happen, e.g., // - the cursor is moved when there are no preedit // - the text message is sent to the chat by tapping sending button // - the field is filled by the application's suggestion // Thus, we reset the context. // But on problematic views, which don't call onUpdateSelection when there is not preedit // (e.g. WebView), execution flow reaches here unexpectedly. // In such case the context is reset unexpectedly, which causes serious unpleasantness. // Therefore fall-back logic is implemented here. // If any recorded entry has given candidate length (candidatesEnd - candidatesStart), // reset the queue and return DO_NOTHING instead. Such recored entry was recorded in // previous call of onRender. // For example on problematic views following scenario would be seen. // - onRender (commit) // - onUpdateSelection (caused by last commit) // - undetectable cursor move (causes record inconsistency) // - onRender (records invalid entry but its length is correct) // - onUpdateSelection (here) // - Records are basically unreliable but the last one has correct length) if (candidatesStart != -1 || candidatesEnd != -1) { if (MozcLog.isLoggable(Log.DEBUG)) { MozcLog.d("Unknown candidates: " + candidatesStart + ":" + candidatesEnd); } if (webTextView && containsSeeingOnlyCandidateLength(record)) { if (MozcLog.isLoggable(Log.DEBUG)) { MozcLog.d(String.format( "Fall-back is applied as " + "there is a entry of which the candidate length (%d) meets expectation.", candidatesEnd - candidatesStart)); } clear(); offerInternal(candidatesStart, candidatesEnd, newSelStart, newSelEnd); return DO_NOTHING; } } // For the next handling, we should remember the newest position. clear(); offerInternal(-1, -1, newSelStart, newSelEnd); // Tell the caller to reset the context. return RESET_CONTEXT; }
int function(int oldSelStart, int oldSelEnd, int newSelStart, int newSelEnd, int candidatesStart, int candidatesEnd) { if (MozcLog.isLoggable(Log.DEBUG)) { MozcLog.d(String.format(STR, oldSelStart, oldSelEnd, newSelStart, newSelEnd, candidatesStart, candidatesEnd)); MozcLog.d(recordQueue.toString()); } Record record = new Record(candidatesStart, candidatesEnd, newSelStart, newSelEnd); if (recordQueue.contains(record)) { while (!recordQueue.isEmpty()) { Record head = recordQueue.peekFirst(); if (record.equals(head)) { break; } recordQueue.removeFirst(); } return DO_NOTHING; } Record lastRecord = recordQueue.peekLast(); if (lastRecord != null && lastRecord.candidatesStart >= 0 && lastRecord.candidatesStart == candidatesStart && lastRecord.candidatesEnd == candidatesEnd) { clear(); offerInternal(candidatesStart, candidatesEnd, newSelStart, newSelEnd); if (newSelStart == newSelEnd) { return MozcUtil.clamp(newSelStart - candidatesStart, 0, candidatesEnd - candidatesStart); } return RESET_CONTEXT; } if (candidatesStart != -1 candidatesEnd != -1) { if (MozcLog.isLoggable(Log.DEBUG)) { MozcLog.d(STR + candidatesStart + ":" + candidatesEnd); } if (webTextView && containsSeeingOnlyCandidateLength(record)) { if (MozcLog.isLoggable(Log.DEBUG)) { MozcLog.d(String.format( STR + STR, candidatesEnd - candidatesStart)); } clear(); offerInternal(candidatesStart, candidatesEnd, newSelStart, newSelEnd); return DO_NOTHING; } } clear(); offerInternal(-1, -1, newSelStart, newSelEnd); return RESET_CONTEXT; }
/** * Should be invoked when MozcServer receives the callback {@code onUpdateSelection}. * @return the move cursor position, or one of special values * {@code DO_NOTHING, RESET_CONTEXT}. The caller should follow the result. */
Should be invoked when MozcServer receives the callback onUpdateSelection
onUpdateSelection
{ "repo_name": "kishikawakatsumi/Mozc-for-iOS", "path": "src/android/src/com/google/android/inputmethod/japanese/model/SelectionTracker.java", "license": "apache-2.0", "size": 17539 }
[ "android.util.Log", "org.mozc.android.inputmethod.japanese.MozcLog", "org.mozc.android.inputmethod.japanese.MozcUtil" ]
import android.util.Log; import org.mozc.android.inputmethod.japanese.MozcLog; import org.mozc.android.inputmethod.japanese.MozcUtil;
import android.util.*; import org.mozc.android.inputmethod.japanese.*;
[ "android.util", "org.mozc.android" ]
android.util; org.mozc.android;
367,432
protected LongSet getDefaultExcludes(@Nullable UserHistory<? extends Event> user) { if (user == null) { return LongSets.EMPTY_SET; } else { return user.itemSet(); } }
LongSet function(@Nullable UserHistory<? extends Event> user) { if (user == null) { return LongSets.EMPTY_SET; } else { return user.itemSet(); } }
/** * Get the default exclude set for a user. The base implementation returns * all the items they have interacted with (from {@link UserHistory#itemSet()}). * * @param user The user history. * @return The set of items to exclude. */
Get the default exclude set for a user. The base implementation returns all the items they have interacted with (from <code>UserHistory#itemSet()</code>)
getDefaultExcludes
{ "repo_name": "amaliujia/lenskit", "path": "lenskit-core/src/main/java/org/lenskit/basic/TopNItemRecommender.java", "license": "lgpl-2.1", "size": 6408 }
[ "it.unimi.dsi.fastutil.longs.LongSet", "it.unimi.dsi.fastutil.longs.LongSets", "javax.annotation.Nullable", "org.lenskit.data.events.Event", "org.lenskit.data.history.UserHistory" ]
import it.unimi.dsi.fastutil.longs.LongSet; import it.unimi.dsi.fastutil.longs.LongSets; import javax.annotation.Nullable; import org.lenskit.data.events.Event; import org.lenskit.data.history.UserHistory;
import it.unimi.dsi.fastutil.longs.*; import javax.annotation.*; import org.lenskit.data.events.*; import org.lenskit.data.history.*;
[ "it.unimi.dsi", "javax.annotation", "org.lenskit.data" ]
it.unimi.dsi; javax.annotation; org.lenskit.data;
1,575,025
public void deleteExtendedProperties(List<String> keys, String orderId) throws Exception { deleteExtendedProperties( keys, orderId, null, null); }
void function(List<String> keys, String orderId) throws Exception { deleteExtendedProperties( keys, orderId, null, null); }
/** * Deletes the extended property associated with the order. * <p><pre><code> * ExtendedProperty extendedproperty = new ExtendedProperty(); * extendedproperty.deleteExtendedProperties( keys, orderId); * </code></pre></p> * @param orderId Unique identifier of the order. * @param keys * @return * @see string */
Deletes the extended property associated with the order. <code><code> ExtendedProperty extendedproperty = new ExtendedProperty(); extendedproperty.deleteExtendedProperties( keys, orderId); </code></code>
deleteExtendedProperties
{ "repo_name": "bhewett/mozu-java", "path": "mozu-java-core/src/main/java/com/mozu/api/resources/commerce/orders/ExtendedPropertyResource.java", "license": "mit", "size": 14903 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,700,781
public void setDateTill(Date dateTill) { this.dateTill = dateTill; }
void function(Date dateTill) { this.dateTill = dateTill; }
/** * Missing description at method setDateTill. * * @param dateTill the Date. */
Missing description at method setDateTill
setDateTill
{ "repo_name": "NABUCCO/org.nabucco.business.provision", "path": "org.nabucco.business.provision.facade.datatype/src/main/gen/org/nabucco/business/provision/facade/datatype/ProvisionAssignment.java", "license": "epl-1.0", "size": 34808 }
[ "org.nabucco.framework.base.facade.datatype.date.Date" ]
import org.nabucco.framework.base.facade.datatype.date.Date;
import org.nabucco.framework.base.facade.datatype.date.*;
[ "org.nabucco.framework" ]
org.nabucco.framework;
1,677,126
public boolean removeAsignatura(Asignatura asignatura) { Assert.isTrue(this.asignaturas.contains(asignatura)); asignatura.setCurso(null); return this.asignaturas.remove(asignatura); }
boolean function(Asignatura asignatura) { Assert.isTrue(this.asignaturas.contains(asignatura)); asignatura.setCurso(null); return this.asignaturas.remove(asignatura); }
/** * Elimina una asignatura * * @author David Romero Alcaide * @param asignatura * @return */
Elimina una asignatura
removeAsignatura
{ "repo_name": "david-romero/guardians-dashboard", "path": "guardians-dashboard/src/main/java/com/app/domain/model/types/Curso.java", "license": "apache-2.0", "size": 4916 }
[ "org.springframework.util.Assert" ]
import org.springframework.util.Assert;
import org.springframework.util.*;
[ "org.springframework.util" ]
org.springframework.util;
1,368,182
void clearScroll(ClearScrollRequest request, ActionListener<ClearScrollResponse> listener);
void clearScroll(ClearScrollRequest request, ActionListener<ClearScrollResponse> listener);
/** * Clears the search contexts associated with specified scroll ids. */
Clears the search contexts associated with specified scroll ids
clearScroll
{ "repo_name": "ern/elasticsearch", "path": "server/src/main/java/org/elasticsearch/client/Client.java", "license": "apache-2.0", "size": 15097 }
[ "org.elasticsearch.action.ActionListener", "org.elasticsearch.action.search.ClearScrollRequest", "org.elasticsearch.action.search.ClearScrollResponse" ]
import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.search.ClearScrollRequest; import org.elasticsearch.action.search.ClearScrollResponse;
import org.elasticsearch.action.*; import org.elasticsearch.action.search.*;
[ "org.elasticsearch.action" ]
org.elasticsearch.action;
344,594
static void executeTool(String carbonHome, String profile) throws CarbonToolException, IOException { if ((carbonHome == null) || (carbonHome.isEmpty())) { throw new CarbonToolException("Invalid Carbon home specified: " + carbonHome); } if (profile != null) { Path osgiLibDirectoryPath = Paths.get(carbonHome, Constants.OSGI_LIB); logger.log(Level.FINE, "Loading the new OSGi bundle information from " + Constants.OSGI_LIB + " folder..."); List<BundleInfo> newBundlesInfo = OSGiLibBundleDeployerUtils.getBundlesInfo(osgiLibDirectoryPath); logger.log(Level.FINE, "Successfully loaded the new OSGi bundle information from " + Constants.OSGI_LIB + " folder"); if (profile.equals("ALL")) { OSGiLibBundleDeployerUtils.getCarbonProfiles(carbonHome) .forEach(carbonProfile -> { try { OSGiLibBundleDeployerUtils.updateOSGiLib(carbonHome, carbonProfile, newBundlesInfo); } catch (IOException e) { logger.log(Level.SEVERE, "Failed to update the OSGi bundle information of Carbon Runtime: " + carbonProfile, e); } }); } else { try { OSGiLibBundleDeployerUtils.updateOSGiLib(carbonHome, profile, newBundlesInfo); } catch (IOException e) { logger.log(Level.SEVERE, "Failed to update the OSGi bundle information of Carbon Runtime: " + profile, e); } } } }
static void executeTool(String carbonHome, String profile) throws CarbonToolException, IOException { if ((carbonHome == null) (carbonHome.isEmpty())) { throw new CarbonToolException(STR + carbonHome); } if (profile != null) { Path osgiLibDirectoryPath = Paths.get(carbonHome, Constants.OSGI_LIB); logger.log(Level.FINE, STR + Constants.OSGI_LIB + STR); List<BundleInfo> newBundlesInfo = OSGiLibBundleDeployerUtils.getBundlesInfo(osgiLibDirectoryPath); logger.log(Level.FINE, STR + Constants.OSGI_LIB + STR); if (profile.equals("ALL")) { OSGiLibBundleDeployerUtils.getCarbonProfiles(carbonHome) .forEach(carbonProfile -> { try { OSGiLibBundleDeployerUtils.updateOSGiLib(carbonHome, carbonProfile, newBundlesInfo); } catch (IOException e) { logger.log(Level.SEVERE, STR + carbonProfile, e); } }); } else { try { OSGiLibBundleDeployerUtils.updateOSGiLib(carbonHome, profile, newBundlesInfo); } catch (IOException e) { logger.log(Level.SEVERE, STR + profile, e); } } } }
/** * Executes the WSO2 Carbon OSGi-lib deployer tool. * * @param carbonHome the {@link String} value of carbon.home * @param profile the Carbon Runtime identifier * @throws CarbonToolException if the {@code carbonHome} is invalid * @throws IOException if an I/O error occurs when extracting the Carbon Runtime names */
Executes the WSO2 Carbon OSGi-lib deployer tool
executeTool
{ "repo_name": "daneshk/carbon-kernel", "path": "tools/tools-core/src/main/java/org/wso2/carbon/tools/osgilib/OSGiLibDeployerToolUtils.java", "license": "apache-2.0", "size": 4130 }
[ "java.io.IOException", "java.nio.file.Path", "java.nio.file.Paths", "java.util.List", "java.util.logging.Level", "org.wso2.carbon.launcher.Constants", "org.wso2.carbon.launcher.extensions.OSGiLibBundleDeployerUtils", "org.wso2.carbon.launcher.extensions.model.BundleInfo", "org.wso2.carbon.tools.exception.CarbonToolException" ]
import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; import java.util.logging.Level; import org.wso2.carbon.launcher.Constants; import org.wso2.carbon.launcher.extensions.OSGiLibBundleDeployerUtils; import org.wso2.carbon.launcher.extensions.model.BundleInfo; import org.wso2.carbon.tools.exception.CarbonToolException;
import java.io.*; import java.nio.file.*; import java.util.*; import java.util.logging.*; import org.wso2.carbon.launcher.*; import org.wso2.carbon.launcher.extensions.*; import org.wso2.carbon.launcher.extensions.model.*; import org.wso2.carbon.tools.exception.*;
[ "java.io", "java.nio", "java.util", "org.wso2.carbon" ]
java.io; java.nio; java.util; org.wso2.carbon;
1,329,494
public static int indexOfIgnoreCase(int startingPosition, String searchIn, String searchFor, String openingMarkers, String closingMarkers, Set<SearchMode> searchMode) { return indexOfIgnoreCase(startingPosition, searchIn, searchFor, openingMarkers, closingMarkers, "", searchMode); }
static int function(int startingPosition, String searchIn, String searchFor, String openingMarkers, String closingMarkers, Set<SearchMode> searchMode) { return indexOfIgnoreCase(startingPosition, searchIn, searchFor, openingMarkers, closingMarkers, "", searchMode); }
/** * Finds the position of a substring within a string, ignoring case, with the option to skip text delimited by given markers or within comments. * * @param startingPosition * the position to start the search from * @param searchIn * the string to search in * @param searchFor * the string to search for * @param openingMarkers * characters which delimit the beginning of a text block to skip * @param closingMarkers * characters which delimit the end of a text block to skip * @param searchMode * a <code>Set</code>, ideally an <code>EnumSet</code>, containing the flags from the enum <code>StringUtils.SearchMode</code> that determine the * behavior of the search * @return the position where <code>searchFor</code> is found within <code>searchIn</code> starting from <code>startingPosition</code>. */
Finds the position of a substring within a string, ignoring case, with the option to skip text delimited by given markers or within comments
indexOfIgnoreCase
{ "repo_name": "ac2cz/FoxTelem", "path": "lib/mysql-connector-java-8.0.13/src/main/core-api/java/com/mysql/cj/util/StringUtils.java", "license": "gpl-3.0", "size": 83966 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
606,097
public static BufferedImage[] splitByWidth(BufferedImage img, int width) { if (img.getWidth() > 0) { BufferedImage[] result = new BufferedImage[(img.getWidth() + width - 1) / width]; int x = 0; for (int i = 0; i < result.length; i++) { int x2 = Math.min(x + width - 1, img.getWidth() - 1); result[i] = newSubimage(img, x, 0, x2 - x + 1, img.getHeight()); x += width; } return result; } return new BufferedImage[0]; }
static BufferedImage[] function(BufferedImage img, int width) { if (img.getWidth() > 0) { BufferedImage[] result = new BufferedImage[(img.getWidth() + width - 1) / width]; int x = 0; for (int i = 0; i < result.length; i++) { int x2 = Math.min(x + width - 1, img.getWidth() - 1); result[i] = newSubimage(img, x, 0, x2 - x + 1, img.getHeight()); x += width; } return result; } return new BufferedImage[0]; }
/** * Split the image into equally sized sub-images. * * @param img * the image to split * @param width * the split width * @return the array of images */
Split the image into equally sized sub-images
splitByWidth
{ "repo_name": "nkutsche/opendocs", "path": "net.sqf.view.utils/src/net/sqf/view/utils/images/ImageUtils.java", "license": "gpl-2.0", "size": 4473 }
[ "java.awt.image.BufferedImage" ]
import java.awt.image.BufferedImage;
import java.awt.image.*;
[ "java.awt" ]
java.awt;
2,516,444
public byte[] SendReceive(byte[] dataToWrite, SpiChipSelectPin chipSelect, ChipSelectMode chipSelectMode, double speedMhz) { return SendReceive(dataToWrite, chipSelect, chipSelectMode, speedMhz, BurstMode.NoBurst, SpiMode.Mode00); }
byte[] function(byte[] dataToWrite, SpiChipSelectPin chipSelect, ChipSelectMode chipSelectMode, double speedMhz) { return SendReceive(dataToWrite, chipSelect, chipSelectMode, speedMhz, BurstMode.NoBurst, SpiMode.Mode00); }
/** * Exchange data with an SPI slave * @param dataToWrite the data to write * @param chipSelect the chip select pin to use * @param chipSelectMode the chip select mode to use * @param speedMhz the speed, in MHz, to use * @return The data read from the peripheral */
Exchange data with an SPI slave
SendReceive
{ "repo_name": "treehopper-electronics/treehopper-sdk", "path": "Java/api/treehopper/src/main/java/io/treehopper/HardwareSpi.java", "license": "mit", "size": 13896 }
[ "io.treehopper.enums.BurstMode", "io.treehopper.enums.ChipSelectMode", "io.treehopper.enums.SpiMode", "io.treehopper.interfaces.SpiChipSelectPin" ]
import io.treehopper.enums.BurstMode; import io.treehopper.enums.ChipSelectMode; import io.treehopper.enums.SpiMode; import io.treehopper.interfaces.SpiChipSelectPin;
import io.treehopper.enums.*; import io.treehopper.interfaces.*;
[ "io.treehopper.enums", "io.treehopper.interfaces" ]
io.treehopper.enums; io.treehopper.interfaces;
1,662,794
List<Permalink> getPermalinks();
List<Permalink> getPermalinks();
/** * Gets the permalinks defined for this project. * * <p> * Because {@link Permalink} is a strategy-pattern object, * this method should normally return a pre-initialized * read-only static list object. * * @return * can be empty, but never null. */
Gets the permalinks defined for this project. Because <code>Permalink</code> is a strategy-pattern object, this method should normally return a pre-initialized read-only static list object
getPermalinks
{ "repo_name": "rsandell/jenkins", "path": "core/src/main/java/hudson/model/PermalinkProjectAction.java", "license": "mit", "size": 7322 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
49,650
public MappingConfiguration<S, D> useMapper(Mapper<?, ?> mapper) { denyNull("mapper", mapper); InternalMapper<?, ?> interalMapper = new MapperAdapter<>(mapper); useInternalMapper(interalMapper); return this; }
MappingConfiguration<S, D> function(Mapper<?, ?> mapper) { denyNull(STR, mapper); InternalMapper<?, ?> interalMapper = new MapperAdapter<>(mapper); useInternalMapper(interalMapper); return this; }
/** * Registers a configured mapper to this object that is to be used whenever a hierarchical mapping * tries to map the specified types. <b>Note: Only one mapper can be added for a combination of * source and destination type!</b> * * @param mapper A mapper * @return Returns this {@link MappingConfiguration} object for further configuration. */
Registers a configured mapper to this object that is to be used whenever a hierarchical mapping tries to map the specified types. Note: Only one mapper can be added for a combination of source and destination type
useMapper
{ "repo_name": "remondis-it/remap", "path": "src/main/java/com/remondis/remap/MappingConfiguration.java", "license": "apache-2.0", "size": 32483 }
[ "com.remondis.remap.Lang" ]
import com.remondis.remap.Lang;
import com.remondis.remap.*;
[ "com.remondis.remap" ]
com.remondis.remap;
286,360
@SuppressWarnings("unused") private void setInfoWindowAnchor(final JSONArray args, final CallbackContext callbackContext) throws JSONException { float anchorX = (float)args.getDouble(2); float anchorY = (float)args.getDouble(3); String id = args.getString(1); Marker marker = this.getMarker(id); Bundle imageSize = (Bundle) this.objects.get("imageSize"); if (imageSize != null) { this._setInfoWindowAnchor(marker, anchorX, anchorY, imageSize.getInt("width"), imageSize.getInt("height")); } this.sendNoResult(callbackContext); }
@SuppressWarnings(STR) void function(final JSONArray args, final CallbackContext callbackContext) throws JSONException { float anchorX = (float)args.getDouble(2); float anchorY = (float)args.getDouble(3); String id = args.getString(1); Marker marker = this.getMarker(id); Bundle imageSize = (Bundle) this.objects.get(STR); if (imageSize != null) { this._setInfoWindowAnchor(marker, anchorX, anchorY, imageSize.getInt("width"), imageSize.getInt(STR)); } this.sendNoResult(callbackContext); }
/** * Set anchor for the InfoWindow of the marker * @param args * @param callbackContext * @throws JSONException */
Set anchor for the InfoWindow of the marker
setInfoWindowAnchor
{ "repo_name": "MasGaNo/gameofcode", "path": "GameOfCode/plugins/cordova-plugin-googlemaps/src/android/plugin/google/maps/PluginMarker.java", "license": "apache-2.0", "size": 30911 }
[ "android.os.Bundle", "com.google.android.gms.maps.model.Marker", "org.apache.cordova.CallbackContext", "org.json.JSONArray", "org.json.JSONException" ]
import android.os.Bundle; import com.google.android.gms.maps.model.Marker; import org.apache.cordova.CallbackContext; import org.json.JSONArray; import org.json.JSONException;
import android.os.*; import com.google.android.gms.maps.model.*; import org.apache.cordova.*; import org.json.*;
[ "android.os", "com.google.android", "org.apache.cordova", "org.json" ]
android.os; com.google.android; org.apache.cordova; org.json;
2,026,483
private void paintDataTracks(final PlotPanel panel, final Collection<Experiment> experiments, final AnnotationPlotParameters params, final short chromosome, final long startLocation, final long endLocation) { for (Experiment exp : experiments) { float minSat = Float.NaN; float maxSat = Float.NaN; if (exp.getQuantitationType().isExpressionData()) { minSat = params.getExpressionMinSaturation(); maxSat = params.getExpressionMaxSaturation(); } else { minSat = params.getCopyNumberMinSaturation(); minSat = params.getCopyNumberMaxSaturation(); } for (BioAssay bioAssay : exp.getBioAssays()) { ChromosomeArrayData cad = this.getChromosomeArrayDataGetter(). getChromosomeArrayData(bioAssay, chromosome); DataTrack track = new DataTrack(cad, startLocation, endLocation, minSat, maxSat, params.getWidth(), bioAssay.getName(), panel.getDrawingCanvas()); panel.add(track, HorizontalAlignment.LEFT_JUSTIFIED, VerticalAlignment.BELOW); } } }
void function(final PlotPanel panel, final Collection<Experiment> experiments, final AnnotationPlotParameters params, final short chromosome, final long startLocation, final long endLocation) { for (Experiment exp : experiments) { float minSat = Float.NaN; float maxSat = Float.NaN; if (exp.getQuantitationType().isExpressionData()) { minSat = params.getExpressionMinSaturation(); maxSat = params.getExpressionMaxSaturation(); } else { minSat = params.getCopyNumberMinSaturation(); minSat = params.getCopyNumberMaxSaturation(); } for (BioAssay bioAssay : exp.getBioAssays()) { ChromosomeArrayData cad = this.getChromosomeArrayDataGetter(). getChromosomeArrayData(bioAssay, chromosome); DataTrack track = new DataTrack(cad, startLocation, endLocation, minSat, maxSat, params.getWidth(), bioAssay.getName(), panel.getDrawingCanvas()); panel.add(track, HorizontalAlignment.LEFT_JUSTIFIED, VerticalAlignment.BELOW); } } }
/** * Paint data tracks. * @param panel Panel on which to paint * @param experiments Experiments * @param params Plot parameters * @param chromosome Chromosome number * @param startLocation Starting chromosome location * in base pair units * @param endLocation Ending chromosome location in * base pair units */
Paint data tracks
paintDataTracks
{ "repo_name": "NCIP/webgenome", "path": "java/core/src/org/rti/webgenome/service/plot/AnnotationPlotPainter.java", "license": "bsd-3-clause", "size": 12156 }
[ "java.util.Collection", "org.rti.webgenome.domain.BioAssay", "org.rti.webgenome.domain.ChromosomeArrayData", "org.rti.webgenome.domain.Experiment", "org.rti.webgenome.graphics.widget.DataTrack", "org.rti.webgenome.graphics.widget.PlotPanel", "org.rti.webgenome.units.HorizontalAlignment", "org.rti.webgenome.units.VerticalAlignment" ]
import java.util.Collection; import org.rti.webgenome.domain.BioAssay; import org.rti.webgenome.domain.ChromosomeArrayData; import org.rti.webgenome.domain.Experiment; import org.rti.webgenome.graphics.widget.DataTrack; import org.rti.webgenome.graphics.widget.PlotPanel; import org.rti.webgenome.units.HorizontalAlignment; import org.rti.webgenome.units.VerticalAlignment;
import java.util.*; import org.rti.webgenome.domain.*; import org.rti.webgenome.graphics.widget.*; import org.rti.webgenome.units.*;
[ "java.util", "org.rti.webgenome" ]
java.util; org.rti.webgenome;
2,646,776
public void addUser( JsonNewUser user, Response.Listener<JsonUser> successListener, Response.ErrorListener errorListener);
void function( JsonNewUser user, Response.Listener<JsonUser> successListener, Response.ErrorListener errorListener);
/** * Creates a new user. * @param user the JsonNewUser to add */
Creates a new user
addUser
{ "repo_name": "projectbuendia/client", "path": "app/src/main/java/org/projectbuendia/client/net/Server.java", "license": "apache-2.0", "size": 6017 }
[ "com.android.volley.Response", "org.projectbuendia.client.json.JsonNewUser", "org.projectbuendia.client.json.JsonUser" ]
import com.android.volley.Response; import org.projectbuendia.client.json.JsonNewUser; import org.projectbuendia.client.json.JsonUser;
import com.android.volley.*; import org.projectbuendia.client.json.*;
[ "com.android.volley", "org.projectbuendia.client" ]
com.android.volley; org.projectbuendia.client;
848,095
EReference getUnaryPreOpExpression_Expr();
EReference getUnaryPreOpExpression_Expr();
/** * Returns the meta object for the containment reference '{@link org.eclipse.xtext.testlanguages.backtracking.beeLangTestLanguage.UnaryPreOpExpression#getExpr <em>Expr</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the containment reference '<em>Expr</em>'. * @see org.eclipse.xtext.testlanguages.backtracking.beeLangTestLanguage.UnaryPreOpExpression#getExpr() * @see #getUnaryPreOpExpression() * @generated */
Returns the meta object for the containment reference '<code>org.eclipse.xtext.testlanguages.backtracking.beeLangTestLanguage.UnaryPreOpExpression#getExpr Expr</code>'.
getUnaryPreOpExpression_Expr
{ "repo_name": "miklossy/xtext-core", "path": "org.eclipse.xtext.testlanguages/src-gen/org/eclipse/xtext/testlanguages/backtracking/beeLangTestLanguage/BeeLangTestLanguagePackage.java", "license": "epl-1.0", "size": 161651 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
682,285
@Test(expected = IllegalStateException.class) public void uninitializedPostman() throws IOException { SendEmail se = new SendEmail("amihaiemil@gmail.com", "hello", "hello, how are you?"); se.perform(Mockito.mock(Command.class), Mockito.mock(Logger.class)); }
@Test(expected = IllegalStateException.class) void function() throws IOException { SendEmail se = new SendEmail(STR, "hello", STR); se.perform(Mockito.mock(Command.class), Mockito.mock(Logger.class)); }
/** * SendEmail does not send any email if username and/or password are not specified. * @throws Exception If something goes wrong. */
SendEmail does not send any email if username and/or password are not specified
uninitializedPostman
{ "repo_name": "opencharles/charles-rest", "path": "src/test/java/com/amihaiemil/charles/github/SendEmailTestCase.java", "license": "bsd-3-clause", "size": 6490 }
[ "com.amihaiemil.charles.github.SendEmail", "java.io.IOException", "org.junit.Test", "org.mockito.Mockito", "org.slf4j.Logger" ]
import com.amihaiemil.charles.github.SendEmail; import java.io.IOException; import org.junit.Test; import org.mockito.Mockito; import org.slf4j.Logger;
import com.amihaiemil.charles.github.*; import java.io.*; import org.junit.*; import org.mockito.*; import org.slf4j.*;
[ "com.amihaiemil.charles", "java.io", "org.junit", "org.mockito", "org.slf4j" ]
com.amihaiemil.charles; java.io; org.junit; org.mockito; org.slf4j;
1,205,839
public void setPermission(Path p, FsPermission permission ) throws IOException { }
void function(Path p, FsPermission permission ) throws IOException { }
/** * Set permission of a path. * @param p * @param permission */
Set permission of a path
setPermission
{ "repo_name": "songweijia/fffs", "path": "sources/hadoop-2.4.1-src/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java", "license": "apache-2.0", "size": 102912 }
[ "java.io.IOException", "org.apache.hadoop.fs.permission.FsPermission" ]
import java.io.IOException; import org.apache.hadoop.fs.permission.FsPermission;
import java.io.*; import org.apache.hadoop.fs.permission.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
1,514,746
public JSONObject putOnce(String key, Object value) throws JSONException { if (key != null && value != null) { if (opt(key) != null) { throw new JSONException("Duplicate key \"" + key + "\""); } put(key, value); } return this; }
JSONObject function(String key, Object value) throws JSONException { if (key != null && value != null) { if (opt(key) != null) { throw new JSONException(STRSTR\""); } put(key, value); } return this; }
/** * Put a key/value pair in the JSONObject, but only if the key and the * value are both non-null, and only if there is not already a member * with that name. * @param key * @param value * @return his. * @throws JSONException if the key is a duplicate */
Put a key/value pair in the JSONObject, but only if the key and the value are both non-null, and only if there is not already a member with that name
putOnce
{ "repo_name": "VysakhV/eeplat-social-api", "path": "src/org/json/JSONObject.java", "license": "mit", "size": 52661 }
[ "org.json.JSONException", "org.json.JSONObject" ]
import org.json.JSONException; import org.json.JSONObject;
import org.json.*;
[ "org.json" ]
org.json;
546,505
public boolean getKeepAlive() throws SocketException { System.err.println("getKeepAlive() not implemented by " + this); throw new RuntimeException("getKeepAlive() not implemented by " + this); }
boolean function() throws SocketException { System.err.println(STR + this); throw new RuntimeException(STR + this); }
/** * Tests if SO_KEEPALIVE is enabled. * * @return if SO_KEEPALIVE is enabled. * @throws SocketException the test count not be performed. */
Tests if SO_KEEPALIVE is enabled
getKeepAlive
{ "repo_name": "interdroid/smartsockets", "path": "src/ibis/smartsockets/virtual/VirtualSocket.java", "license": "bsd-3-clause", "size": 20109 }
[ "java.net.SocketException" ]
import java.net.SocketException;
import java.net.*;
[ "java.net" ]
java.net;
1,407,524
protected ClusterHealthStatus ensureSearchable(String... indices) { // this is just a temporary thing but it's easier to change if it is encapsulated. return ensureGreen(indices); }
ClusterHealthStatus function(String... indices) { return ensureGreen(indices); }
/** * Ensures the cluster is in a searchable state for the given indices. This means a searchable copy of each * shard is available on the cluster. */
Ensures the cluster is in a searchable state for the given indices. This means a searchable copy of each shard is available on the cluster
ensureSearchable
{ "repo_name": "myelin/elasticsearch", "path": "test/framework/src/main/java/org/elasticsearch/test/ESIntegTestCase.java", "license": "apache-2.0", "size": 96521 }
[ "org.elasticsearch.cluster.health.ClusterHealthStatus" ]
import org.elasticsearch.cluster.health.ClusterHealthStatus;
import org.elasticsearch.cluster.health.*;
[ "org.elasticsearch.cluster" ]
org.elasticsearch.cluster;
2,592,236
@Test public void sendMessageToPartition() { // Arrange final SendOptions sendOptions = new SendOptions().setPartitionId(PARTITION_ID); final List<EventData> events = Arrays.asList( new EventData("Event 1".getBytes(UTF_8)), new EventData("Event 2".getBytes(UTF_8)), new EventData("Event 3".getBytes(UTF_8))); // Act & Assert StepVerifier.create(producer.send(events, sendOptions)) .verifyComplete(); }
void function() { final SendOptions sendOptions = new SendOptions().setPartitionId(PARTITION_ID); final List<EventData> events = Arrays.asList( new EventData(STR.getBytes(UTF_8)), new EventData(STR.getBytes(UTF_8)), new EventData(STR.getBytes(UTF_8))); StepVerifier.create(producer.send(events, sendOptions)) .verifyComplete(); }
/** * Verifies that we can create and send a message to an Event Hub partition. */
Verifies that we can create and send a message to an Event Hub partition
sendMessageToPartition
{ "repo_name": "navalev/azure-sdk-for-java", "path": "sdk/eventhubs/azure-messaging-eventhubs/src/test/java/com/azure/messaging/eventhubs/EventHubProducerAsyncClientIntegrationTest.java", "license": "mit", "size": 6854 }
[ "com.azure.messaging.eventhubs.models.SendOptions", "java.util.Arrays", "java.util.List" ]
import com.azure.messaging.eventhubs.models.SendOptions; import java.util.Arrays; import java.util.List;
import com.azure.messaging.eventhubs.models.*; import java.util.*;
[ "com.azure.messaging", "java.util" ]
com.azure.messaging; java.util;
165,372
public static boolean updatesparten(Connection con, int keyId, String spartenNummer, String bezeichnung, String gruppe, int steuersatz) throws SQLException { String sql = "SELECT * FROM sparten WHERE id = ?"; PreparedStatement statement = con.prepareStatement(sql, ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); statement.setInt(1, keyId); ResultSet entry = statement.executeQuery(); entry.last(); int rows = entry.getRow(); entry.beforeFirst(); if(rows == 0) return false; entry.next(); if(spartenNummer != null) entry.updateString("spartenNummer", spartenNummer); if(bezeichnung != null) entry.updateString("bezeichnung", bezeichnung); if(gruppe != null) entry.updateString("gruppe", gruppe); entry.updateInt("steuersatz", steuersatz); entry.updateRow(); entry.close(); statement.close(); con.close(); return true; }
static boolean function(Connection con, int keyId, String spartenNummer, String bezeichnung, String gruppe, int steuersatz) throws SQLException { String sql = STR; PreparedStatement statement = con.prepareStatement(sql, ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); statement.setInt(1, keyId); ResultSet entry = statement.executeQuery(); entry.last(); int rows = entry.getRow(); entry.beforeFirst(); if(rows == 0) return false; entry.next(); if(spartenNummer != null) entry.updateString(STR, spartenNummer); if(bezeichnung != null) entry.updateString(STR, bezeichnung); if(gruppe != null) entry.updateString(STR, gruppe); entry.updateInt(STR, steuersatz); entry.updateRow(); entry.close(); statement.close(); con.close(); return true; }
/** * Java method that updates a row in the generated sql table * @param con (open java.sql.Connection) * @param spartenNummer * @param bezeichnung * @param gruppe * @param steuersatz * @return boolean (true on success) * @throws SQLException */
Java method that updates a row in the generated sql table
updatesparten
{ "repo_name": "yvesh/maklerpoint-office", "path": "src/de/maklerpoint/office/Sparten/Tools/SpartenSQLMethods.java", "license": "gpl-2.0", "size": 11987 }
[ "java.sql.Connection", "java.sql.PreparedStatement", "java.sql.ResultSet", "java.sql.SQLException" ]
import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,451,481
protected List<Pair<String, String>> addSystemProperties(EnumSet<MobileServiceSystemProperty> systemProperties, List<Pair<String, String>> parameters) { boolean containsSystemProperties = false; List<Pair<String,String>> result = new ArrayList<Pair<String,String>>(parameters != null ? parameters.size() : 0); // Make sure we have a case-insensitive parameters list if (parameters != null) { for (Pair<String,String> parameter : parameters) { result.add(parameter); containsSystemProperties = containsSystemProperties || parameter.first.equalsIgnoreCase(SystemPropertiesQueryParameterName); } } // If there is already a user parameter for the system properties, just use it if (!containsSystemProperties) { String systemPropertiesString = getSystemPropertiesString(systemProperties); if (systemPropertiesString != null) { result.add(new Pair<String,String>(SystemPropertiesQueryParameterName,systemPropertiesString)); } } return result; }
List<Pair<String, String>> function(EnumSet<MobileServiceSystemProperty> systemProperties, List<Pair<String, String>> parameters) { boolean containsSystemProperties = false; List<Pair<String,String>> result = new ArrayList<Pair<String,String>>(parameters != null ? parameters.size() : 0); if (parameters != null) { for (Pair<String,String> parameter : parameters) { result.add(parameter); containsSystemProperties = containsSystemProperties parameter.first.equalsIgnoreCase(SystemPropertiesQueryParameterName); } } if (!containsSystemProperties) { String systemPropertiesString = getSystemPropertiesString(systemProperties); if (systemPropertiesString != null) { result.add(new Pair<String,String>(SystemPropertiesQueryParameterName,systemPropertiesString)); } } return result; }
/** * Adds the tables requested system properties to the parameters collection. * @param systemProperties The system properties to add. * @param parameters The parameters collection. * @return The parameters collection with any requested system properties included. */
Adds the tables requested system properties to the parameters collection
addSystemProperties
{ "repo_name": "marianosz/azure-mobile-services", "path": "sdk/android/src/sdk/src/com/microsoft/windowsazure/mobileservices/MobileServiceTableBase.java", "license": "apache-2.0", "size": 27160 }
[ "android.util.Pair", "java.util.ArrayList", "java.util.EnumSet", "java.util.List" ]
import android.util.Pair; import java.util.ArrayList; import java.util.EnumSet; import java.util.List;
import android.util.*; import java.util.*;
[ "android.util", "java.util" ]
android.util; java.util;
672,501
public static void validatePropagationVerticalObject(PropagationVerticalObject toValidate) { PropagationVerticalObject base = buildPropagationVerticalObject(); Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); assertEquals(base.getIntegerPrimitiveAttribute(), toValidate.getIntegerPrimitiveAttribute()); assertEquals(base.getDoublePrimitiveAttribute(), toValidate.getDoublePrimitiveAttribute()); assertEquals(base.getLongPrimitiveAttribute(), toValidate.getLongPrimitiveAttribute()); assertEquals(base.isBooleanPrimitiveAttribute(), toValidate.isBooleanPrimitiveAttribute()); assertEquals(base.getFloatPrimitiveAttribute(), toValidate.getFloatPrimitiveAttribute()); // TODO add new validation below }
static void function(PropagationVerticalObject toValidate) { PropagationVerticalObject base = buildPropagationVerticalObject(); Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); assertEquals(base.getIntegerPrimitiveAttribute(), toValidate.getIntegerPrimitiveAttribute()); assertEquals(base.getDoublePrimitiveAttribute(), toValidate.getDoublePrimitiveAttribute()); assertEquals(base.getLongPrimitiveAttribute(), toValidate.getLongPrimitiveAttribute()); assertEquals(base.isBooleanPrimitiveAttribute(), toValidate.isBooleanPrimitiveAttribute()); assertEquals(base.getFloatPrimitiveAttribute(), toValidate.getFloatPrimitiveAttribute()); }
/** * Validate the PropagationVerticalObject based on the object build with the method * 'buildPropagationVerticalObject' * * @param toValidate * the object to validate */
Validate the PropagationVerticalObject based on the object build with the method 'buildPropagationVerticalObject'
validatePropagationVerticalObject
{ "repo_name": "cacristo/ceos-project", "path": "jexan/src/test/java/net/ceos/project/poi/annotated/bean/PropagationVerticalObjectBuilder.java", "license": "apache-2.0", "size": 3372 }
[ "java.util.Calendar", "java.util.Date", "org.testng.Assert" ]
import java.util.Calendar; import java.util.Date; import org.testng.Assert;
import java.util.*; import org.testng.*;
[ "java.util", "org.testng" ]
java.util; org.testng;
459,362
@GET("users/{username}/followers") Call<List<Follower>> followers( @Path("username") Username username, @Query(value = "extended", encoded = true) Extended extended );
@GET(STR) Call<List<Follower>> followers( @Path(STR) Username username, @Query(value = STR, encoded = true) Extended extended );
/** * <b>OAuth Optional</b> * * <p>Returns all followers including when the relationship began. */
OAuth Optional Returns all followers including when the relationship began
followers
{ "repo_name": "rhespanhol/RxTraktJava", "path": "app/src/main/java/me/rhespanhol/rxtraktjava/services/Users.java", "license": "apache-2.0", "size": 14930 }
[ "java.util.List", "me.rhespanhol.rxtraktjava.entities.Follower", "me.rhespanhol.rxtraktjava.entities.Username", "me.rhespanhol.rxtraktjava.enums.Extended" ]
import java.util.List; import me.rhespanhol.rxtraktjava.entities.Follower; import me.rhespanhol.rxtraktjava.entities.Username; import me.rhespanhol.rxtraktjava.enums.Extended;
import java.util.*; import me.rhespanhol.rxtraktjava.entities.*; import me.rhespanhol.rxtraktjava.enums.*;
[ "java.util", "me.rhespanhol.rxtraktjava" ]
java.util; me.rhespanhol.rxtraktjava;
2,285,719
public static int findFirstLineBeginningFromSeries(String aFileName, String prefix) { try { return findFirstLineBeginning(seriesReader(aFileName), prefix); } catch (IOException e) { e.printStackTrace(); return -1; } }
static int function(String aFileName, String prefix) { try { return findFirstLineBeginning(seriesReader(aFileName), prefix); } catch (IOException e) { e.printStackTrace(); return -1; } }
/** * Return the line number of the first line in the * log/file that begins with the given string. * * @param aFileName The filename of the log/file * @param prefix The prefix string to match * @return The line number (counting from 1, not zero) of the first line * that matches the given regular expression. -1 is returned if no * line matches the regular expression. -1 also is returned if * errors occur (file not found, io exception etc.) */
Return the line number of the first line in the log/file that begins with the given string
findFirstLineBeginningFromSeries
{ "repo_name": "searchtechnologies/heritrix-connector", "path": "engine-3.1.1/engine/src/main/java/org/archive/crawler/util/LogReader.java", "license": "apache-2.0", "size": 37045 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,008,534
public void setPolicyComponent(PolicyComponent policyComponent) { this.policyComponent = policyComponent; }
void function(PolicyComponent policyComponent) { this.policyComponent = policyComponent; }
/** * Set the component used to bind to behaviour callbacks */
Set the component used to bind to behaviour callbacks
setPolicyComponent
{ "repo_name": "Tybion/community-edition", "path": "projects/repository/source/java/org/alfresco/repo/audit/access/AccessAuditor.java", "license": "lgpl-3.0", "size": 23336 }
[ "org.alfresco.repo.policy.PolicyComponent" ]
import org.alfresco.repo.policy.PolicyComponent;
import org.alfresco.repo.policy.*;
[ "org.alfresco.repo" ]
org.alfresco.repo;
1,539,902
private static void abort(String message, int code, Throwable exception) throws CoreException { throw new CoreException(new Status(IStatus.ERROR, JavaScriptCore.PLUGIN_ID, code, message, exception)); }
static void function(String message, int code, Throwable exception) throws CoreException { throw new CoreException(new Status(IStatus.ERROR, JavaScriptCore.PLUGIN_ID, code, message, exception)); }
/** * Throws a core exception with an internal error status. * * @param message the status message * @param code status code * @param exception lower level exception associated with the * * error, or <code>null</code> if none */
Throws a core exception with an internal error status
abort
{ "repo_name": "boniatillo-com/PhaserEditor", "path": "source/thirdparty/jsdt/org.eclipse.wst.jsdt.core/src/org/eclipse/wst/jsdt/launching/JavaRuntime.java", "license": "epl-1.0", "size": 102757 }
[ "org.eclipse.core.runtime.CoreException", "org.eclipse.core.runtime.IStatus", "org.eclipse.core.runtime.Status", "org.eclipse.wst.jsdt.core.JavaScriptCore" ]
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.wst.jsdt.core.JavaScriptCore;
import org.eclipse.core.runtime.*; import org.eclipse.wst.jsdt.core.*;
[ "org.eclipse.core", "org.eclipse.wst" ]
org.eclipse.core; org.eclipse.wst;
1,388,790
@Deprecated public Table getTable(String tableName) throws IOException { return getTable(TableName.valueOf(tableName)); }
Table function(String tableName) throws IOException { return getTable(TableName.valueOf(tableName)); }
/** * This should not be used. The hbase shell needs this in hbase 0.99.2. Remove this once 1.0.0 * comes out. * * @param tableName a {@link java.lang.String} object. * @return a {@link org.apache.hadoop.hbase.client.Table} object. * @throws java.io.IOException if any. */
This should not be used. The hbase shell needs this in hbase 0.99.2. Remove this once 1.0.0 comes out
getTable
{ "repo_name": "sduskis/cloud-bigtable-client", "path": "bigtable-client-core-parent/bigtable-hbase/src/main/java/org/apache/hadoop/hbase/client/AbstractBigtableConnection.java", "license": "apache-2.0", "size": 12752 }
[ "java.io.IOException", "org.apache.hadoop.hbase.TableName" ]
import java.io.IOException; import org.apache.hadoop.hbase.TableName;
import java.io.*; import org.apache.hadoop.hbase.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
678,396
private String formatProcessed(String[] values) { String result; FieldProcessor processor = getProcessor(); if (processor != null) { result = processor.process(values); } else { logger.warning("Rule field has " + format + " type, but no processor is registered"); // fallback to display format result = formatDisplay(values); } return result; }
String function(String[] values) { String result; FieldProcessor processor = getProcessor(); if (processor != null) { result = processor.process(values); } else { logger.warning(STR + format + STR); result = formatDisplay(values); } return result; }
/** * Formats values using an {@link FieldProcessor}. * * @param values the values to format * @return the formatted string * @throws IzPackException if formatting fails */
Formats values using an <code>FieldProcessor</code>
formatProcessed
{ "repo_name": "codehaus/izpack", "path": "izpack-panel/src/main/java/com/izforge/izpack/panels/userinput/field/rule/RuleField.java", "license": "apache-2.0", "size": 13337 }
[ "com.izforge.izpack.panels.userinput.field.FieldProcessor" ]
import com.izforge.izpack.panels.userinput.field.FieldProcessor;
import com.izforge.izpack.panels.userinput.field.*;
[ "com.izforge.izpack" ]
com.izforge.izpack;
2,113,775
public void pressSpinnerItem(int spinnerIndex, int itemIndex) { clicker.clickOnScreen(waiter.waitForAndGetView(spinnerIndex, Spinner.class)); dialogUtils.waitForDialogToOpen(Timeout.getSmallTimeout(), true); try{ inst.sendKeyDownUpSync(KeyEvent.KEYCODE_DPAD_DOWN); }catch(SecurityException ignored){} boolean countingUp = true; if(itemIndex < 0){ countingUp = false; itemIndex *= -1; } for(int i = 0; i < itemIndex; i++) { sleeper.sleepMini(); if(countingUp){ try{ inst.sendKeyDownUpSync(KeyEvent.KEYCODE_DPAD_DOWN); }catch(SecurityException ignored){} }else{ try{ inst.sendKeyDownUpSync(KeyEvent.KEYCODE_DPAD_UP); }catch(SecurityException ignored){} } } try{ inst.sendKeyDownUpSync(KeyEvent.KEYCODE_ENTER); }catch(SecurityException ignored){} }
void function(int spinnerIndex, int itemIndex) { clicker.clickOnScreen(waiter.waitForAndGetView(spinnerIndex, Spinner.class)); dialogUtils.waitForDialogToOpen(Timeout.getSmallTimeout(), true); try{ inst.sendKeyDownUpSync(KeyEvent.KEYCODE_DPAD_DOWN); }catch(SecurityException ignored){} boolean countingUp = true; if(itemIndex < 0){ countingUp = false; itemIndex *= -1; } for(int i = 0; i < itemIndex; i++) { sleeper.sleepMini(); if(countingUp){ try{ inst.sendKeyDownUpSync(KeyEvent.KEYCODE_DPAD_DOWN); }catch(SecurityException ignored){} }else{ try{ inst.sendKeyDownUpSync(KeyEvent.KEYCODE_DPAD_UP); }catch(SecurityException ignored){} } } try{ inst.sendKeyDownUpSync(KeyEvent.KEYCODE_ENTER); }catch(SecurityException ignored){} }
/** * Presses on a {@link android.widget.Spinner} (drop-down menu) item. * * @param spinnerIndex the index of the {@code Spinner} menu to be used * @param itemIndex the index of the {@code Spinner} item to be pressed relative to the currently selected item. * A Negative number moves up on the {@code Spinner}, positive moves down */
Presses on a <code>android.widget.Spinner</code> (drop-down menu) item
pressSpinnerItem
{ "repo_name": "zhic5352/robotium", "path": "robotium-solo/src/main/java/com/robotium/solo/Presser.java", "license": "apache-2.0", "size": 5147 }
[ "android.view.KeyEvent", "android.widget.Spinner" ]
import android.view.KeyEvent; import android.widget.Spinner;
import android.view.*; import android.widget.*;
[ "android.view", "android.widget" ]
android.view; android.widget;
1,364,860
public static boolean canExecute(STCommand command, CommandSender sender, boolean allowConsole) { if (sender instanceof Player) { if (command.getPermissions().isEmpty()) { return true; } final Player player = (Player) sender; for (Permission p : command.getPermissions()) { if (player.hasPermission(p)) { return true; } } return false; } else { return allowConsole; } }
static boolean function(STCommand command, CommandSender sender, boolean allowConsole) { if (sender instanceof Player) { if (command.getPermissions().isEmpty()) { return true; } final Player player = (Player) sender; for (Permission p : command.getPermissions()) { if (player.hasPermission(p)) { return true; } } return false; } else { return allowConsole; } }
/** * Returns if a sender is allowed to execute a command. * * @param command the command with permissions being checked * @param sender sender of the command * @param allowConsole if the command is allowed to be executed by console * @return if a player has permissions for the command */
Returns if a sender is allowed to execute a command
canExecute
{ "repo_name": "JamesHealey94/SimpleTowns", "path": "SimpleTowns/src/com/gmail/jameshealey1994/simpletowns/permissions/PermissionUtils.java", "license": "unlicense", "size": 1935 }
[ "com.gmail.jameshealey1994.simpletowns.commands.command.STCommand", "org.bukkit.command.CommandSender", "org.bukkit.entity.Player", "org.bukkit.permissions.Permission" ]
import com.gmail.jameshealey1994.simpletowns.commands.command.STCommand; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; import org.bukkit.permissions.Permission;
import com.gmail.jameshealey1994.simpletowns.commands.command.*; import org.bukkit.command.*; import org.bukkit.entity.*; import org.bukkit.permissions.*;
[ "com.gmail.jameshealey1994", "org.bukkit.command", "org.bukkit.entity", "org.bukkit.permissions" ]
com.gmail.jameshealey1994; org.bukkit.command; org.bukkit.entity; org.bukkit.permissions;
1,322,936
public Boleto getBoleto() { return pdfViewer.getBoleto(); }
Boleto function() { return pdfViewer.getBoleto(); }
/** * <p> * Retorna o boleto usado pelo visualizador * </p> * * @return o boleto * * @since 0.2 */
Retorna o boleto usado pelo visualizador
getBoleto
{ "repo_name": "jrimum/bopepo", "path": "src/main/java/org/jrimum/bopepo/view/BoletoViewer.java", "license": "apache-2.0", "size": 38818 }
[ "org.jrimum.bopepo.Boleto" ]
import org.jrimum.bopepo.Boleto;
import org.jrimum.bopepo.*;
[ "org.jrimum.bopepo" ]
org.jrimum.bopepo;
2,454,148
protected void refreshComponents() { rangesTable.tableChanged(new TableModelEvent(rangesTable.getModel())); try { rangesNumSpinner.setValue(new Integer(strategy.getRangeNumber())); } catch (NumberFormatException nfe) { } }
void function() { rangesTable.tableChanged(new TableModelEvent(rangesTable.getModel())); try { rangesNumSpinner.setValue(new Integer(strategy.getRangeNumber())); } catch (NumberFormatException nfe) { } }
/** * synchronizes components to display coherently global number of ranges */
synchronizes components to display coherently global number of ranges
refreshComponents
{ "repo_name": "HOMlab/QN-ACTR-Release", "path": "QN-ACTR Java/src/jmt/gui/common/editors/LDStrategyEditor.java", "license": "lgpl-3.0", "size": 19396 }
[ "javax.swing.event.TableModelEvent" ]
import javax.swing.event.TableModelEvent;
import javax.swing.event.*;
[ "javax.swing" ]
javax.swing;
1,216,216
public List<CustomMenuItem> getItems() { return items; }
List<CustomMenuItem> function() { return items; }
/** * Returns a list of items in this menu. */
Returns a list of items in this menu
getItems
{ "repo_name": "Darsstar/framework", "path": "client/src/main/java/com/vaadin/client/ui/VMenuBar.java", "license": "apache-2.0", "size": 61609 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,314,297
private void includeInternalWithCache( ServletRequest req, ServletResponse res, CmsFlexController controller, CmsObject cms, CmsResource resource) throws ServletException, IOException { CmsFlexCache cache = controller.getCmsCache(); // this is a request through the CMS CmsFlexRequest f_req = controller.getCurrentRequest(); CmsFlexResponse f_res = controller.getCurrentResponse(); if (f_req.exceedsCallLimit(m_vfsTarget)) { // this resource was already included earlier, so we have a (probably endless) inclusion loop throw new ServletException( Messages.get().getBundle().key(Messages.ERR_FLEXREQUESTDISPATCHER_INCLUSION_LOOP_1, m_vfsTarget)); } else { f_req.addInlucdeCall(m_vfsTarget); } // do nothing if response is already finished (probably as a result of an earlier redirect) if (f_res.isSuspended()) { // remove this include call if response is suspended (e.g. because of redirect) f_res.setCmsIncludeMode(false); f_req.removeIncludeCall(m_vfsTarget); return; } // indicate to response that all further output or headers are result of include calls f_res.setCmsIncludeMode(true); // create wrapper for request & response CmsFlexRequest w_req = new CmsFlexRequest((HttpServletRequest)req, controller, m_vfsTarget); CmsFlexResponse w_res = new CmsFlexResponse((HttpServletResponse)res, controller); // push req/res to controller stack controller.push(w_req, w_res); // now that the req/res are on the stack, we need to make sure that they are removed later // that's why we have this try { ... } finally { ... } clause here try { CmsFlexCacheEntry entry = null; if (f_req.isCacheable()) { // caching is on, check if requested resource is already in cache entry = cache.get(w_req.getCmsCacheKey()); if (entry != null) { // the target is already in the cache try { if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key( Messages.LOG_FLEXREQUESTDISPATCHER_LOADING_RESOURCE_FROM_CACHE_1, m_vfsTarget)); } controller.updateDates(entry.getDateLastModified(), entry.getDateExpires()); entry.service(w_req, w_res); } catch (CmsException e) { Throwable t; if (e.getCause() != null) { t = e.getCause(); } else { t = e; } t = controller.setThrowable(e, m_vfsTarget); throw new ServletException( Messages.get().getBundle().key( Messages.ERR_FLEXREQUESTDISPATCHER_ERROR_LOADING_RESOURCE_FROM_CACHE_1, m_vfsTarget), t); } } else { // cache is on and resource is not yet cached, so we need to read the cache key for the response CmsFlexCacheKey res_key = cache.getKey(CmsFlexCacheKey.getKeyName(m_vfsTarget, w_req.isOnline())); if (res_key != null) { // key already in cache, reuse it w_res.setCmsCacheKey(res_key); } else { // cache key is unknown, read key from properties String cacheProperty = null; try { // read caching property from requested VFS resource if (resource == null) { resource = cms.readResource(m_vfsTarget); } cacheProperty = cms.readPropertyObject( resource, CmsPropertyDefinition.PROPERTY_CACHE, true).getValue(); if (cacheProperty == null) { // caching property not set, use default for resource type cacheProperty = OpenCms.getResourceManager().getResourceType( resource.getTypeId()).getCachePropertyDefault(); } cache.putKey( w_res.setCmsCacheKey( cms.getRequestContext().addSiteRoot(m_vfsTarget), cacheProperty, f_req.isOnline())); } catch (CmsFlexCacheException e) { // invalid key is ignored but logged, used key is cache=never if (LOG.isWarnEnabled()) { LOG.warn( Messages.get().getBundle().key( Messages.LOG_FLEXREQUESTDISPATCHER_INVALID_CACHE_KEY_2, m_vfsTarget, cacheProperty)); } // there will be a valid key in the response ("cache=never") even after an exception cache.putKey(w_res.getCmsCacheKey()); } catch (CmsException e) { // all other errors are not handled here controller.setThrowable(e, m_vfsTarget); throw new ServletException( Messages.get().getBundle().key( Messages.ERR_FLEXREQUESTDISPATCHER_ERROR_LOADING_CACHE_PROPERTIES_1, m_vfsTarget), e); } if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key( Messages.LOG_FLEXREQUESTDISPATCHER_ADDING_CACHE_PROPERTIES_2, m_vfsTarget, cacheProperty)); } } } } if (entry == null) { // the target is not cached (or caching off), so load it with the internal resource loader I_CmsResourceLoader loader = null; String variation = null; // check cache keys to see if the result can be cached if (w_req.isCacheable()) { variation = w_res.getCmsCacheKey().matchRequestKey(w_req.getCmsCacheKey()); } // indicate to the response if caching is not required w_res.setCmsCachingRequired(!controller.isForwardMode() && (variation != null)); try { if (resource == null) { resource = cms.readResource(m_vfsTarget); } if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key( Messages.LOG_FLEXREQUESTDISPATCHER_LOADING_RESOURCE_TYPE_1, new Integer(resource.getTypeId()))); } loader = OpenCms.getResourceManager().getLoader(resource); } catch (ClassCastException e) { controller.setThrowable(e, m_vfsTarget); throw new ServletException( Messages.get().getBundle().key( Messages.ERR_FLEXREQUESTDISPATCHER_CLASSCAST_EXCEPTION_1, m_vfsTarget), e); } catch (CmsException e) { // file might not exist or no read permissions controller.setThrowable(e, m_vfsTarget); throw new ServletException( Messages.get().getBundle().key( Messages.ERR_FLEXREQUESTDISPATCHER_ERROR_READING_RESOURCE_1, m_vfsTarget), e); } if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key( Messages.LOG_FLEXREQUESTDISPATCHER_INCLUDE_RESOURCE_1, m_vfsTarget)); } try { loader.service(cms, resource, w_req, w_res); } catch (CmsException e) { // an error occurred during access to OpenCms controller.setThrowable(e, m_vfsTarget); throw new ServletException(e); } entry = w_res.processCacheEntry(); if ((entry != null) && (variation != null) && w_req.isCacheable()) { // the result can be cached if (w_res.getCmsCacheKey().getTimeout() > 0) { // cache entry has a timeout, set last modified to time of last creation entry.setDateLastModifiedToPreviousTimeout(w_res.getCmsCacheKey().getTimeout()); entry.setDateExpiresToNextTimeout(w_res.getCmsCacheKey().getTimeout()); controller.updateDates(entry.getDateLastModified(), entry.getDateExpires()); } else { // no timeout, use last modified date from files in VFS entry.setDateLastModified(controller.getDateLastModified()); entry.setDateExpires(controller.getDateExpires()); } cache.put(w_res.getCmsCacheKey(), entry, variation); } else { // result can not be cached, do not use "last modified" optimization controller.updateDates(-1, controller.getDateExpires()); } } if (f_res.hasIncludeList()) { // special case: this indicates that the output was not yet displayed Map<String, List<String>> headers = w_res.getHeaders(); byte[] result = w_res.getWriterBytes(); if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key( Messages.LOG_FLEXREQUESTDISPATCHER_RESULT_1, new String(result))); } CmsFlexResponse.processHeaders(headers, f_res); f_res.addToIncludeResults(result); result = null; } } finally { // indicate to response that include is finished f_res.setCmsIncludeMode(false); f_req.removeIncludeCall(m_vfsTarget); // pop req/res from controller stack controller.pop(); } }
void function( ServletRequest req, ServletResponse res, CmsFlexController controller, CmsObject cms, CmsResource resource) throws ServletException, IOException { CmsFlexCache cache = controller.getCmsCache(); CmsFlexRequest f_req = controller.getCurrentRequest(); CmsFlexResponse f_res = controller.getCurrentResponse(); if (f_req.exceedsCallLimit(m_vfsTarget)) { throw new ServletException( Messages.get().getBundle().key(Messages.ERR_FLEXREQUESTDISPATCHER_INCLUSION_LOOP_1, m_vfsTarget)); } else { f_req.addInlucdeCall(m_vfsTarget); } if (f_res.isSuspended()) { f_res.setCmsIncludeMode(false); f_req.removeIncludeCall(m_vfsTarget); return; } f_res.setCmsIncludeMode(true); CmsFlexRequest w_req = new CmsFlexRequest((HttpServletRequest)req, controller, m_vfsTarget); CmsFlexResponse w_res = new CmsFlexResponse((HttpServletResponse)res, controller); controller.push(w_req, w_res); try { CmsFlexCacheEntry entry = null; if (f_req.isCacheable()) { entry = cache.get(w_req.getCmsCacheKey()); if (entry != null) { try { if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key( Messages.LOG_FLEXREQUESTDISPATCHER_LOADING_RESOURCE_FROM_CACHE_1, m_vfsTarget)); } controller.updateDates(entry.getDateLastModified(), entry.getDateExpires()); entry.service(w_req, w_res); } catch (CmsException e) { Throwable t; if (e.getCause() != null) { t = e.getCause(); } else { t = e; } t = controller.setThrowable(e, m_vfsTarget); throw new ServletException( Messages.get().getBundle().key( Messages.ERR_FLEXREQUESTDISPATCHER_ERROR_LOADING_RESOURCE_FROM_CACHE_1, m_vfsTarget), t); } } else { CmsFlexCacheKey res_key = cache.getKey(CmsFlexCacheKey.getKeyName(m_vfsTarget, w_req.isOnline())); if (res_key != null) { w_res.setCmsCacheKey(res_key); } else { String cacheProperty = null; try { if (resource == null) { resource = cms.readResource(m_vfsTarget); } cacheProperty = cms.readPropertyObject( resource, CmsPropertyDefinition.PROPERTY_CACHE, true).getValue(); if (cacheProperty == null) { cacheProperty = OpenCms.getResourceManager().getResourceType( resource.getTypeId()).getCachePropertyDefault(); } cache.putKey( w_res.setCmsCacheKey( cms.getRequestContext().addSiteRoot(m_vfsTarget), cacheProperty, f_req.isOnline())); } catch (CmsFlexCacheException e) { if (LOG.isWarnEnabled()) { LOG.warn( Messages.get().getBundle().key( Messages.LOG_FLEXREQUESTDISPATCHER_INVALID_CACHE_KEY_2, m_vfsTarget, cacheProperty)); } cache.putKey(w_res.getCmsCacheKey()); } catch (CmsException e) { controller.setThrowable(e, m_vfsTarget); throw new ServletException( Messages.get().getBundle().key( Messages.ERR_FLEXREQUESTDISPATCHER_ERROR_LOADING_CACHE_PROPERTIES_1, m_vfsTarget), e); } if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key( Messages.LOG_FLEXREQUESTDISPATCHER_ADDING_CACHE_PROPERTIES_2, m_vfsTarget, cacheProperty)); } } } } if (entry == null) { I_CmsResourceLoader loader = null; String variation = null; if (w_req.isCacheable()) { variation = w_res.getCmsCacheKey().matchRequestKey(w_req.getCmsCacheKey()); } w_res.setCmsCachingRequired(!controller.isForwardMode() && (variation != null)); try { if (resource == null) { resource = cms.readResource(m_vfsTarget); } if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key( Messages.LOG_FLEXREQUESTDISPATCHER_LOADING_RESOURCE_TYPE_1, new Integer(resource.getTypeId()))); } loader = OpenCms.getResourceManager().getLoader(resource); } catch (ClassCastException e) { controller.setThrowable(e, m_vfsTarget); throw new ServletException( Messages.get().getBundle().key( Messages.ERR_FLEXREQUESTDISPATCHER_CLASSCAST_EXCEPTION_1, m_vfsTarget), e); } catch (CmsException e) { controller.setThrowable(e, m_vfsTarget); throw new ServletException( Messages.get().getBundle().key( Messages.ERR_FLEXREQUESTDISPATCHER_ERROR_READING_RESOURCE_1, m_vfsTarget), e); } if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key( Messages.LOG_FLEXREQUESTDISPATCHER_INCLUDE_RESOURCE_1, m_vfsTarget)); } try { loader.service(cms, resource, w_req, w_res); } catch (CmsException e) { controller.setThrowable(e, m_vfsTarget); throw new ServletException(e); } entry = w_res.processCacheEntry(); if ((entry != null) && (variation != null) && w_req.isCacheable()) { if (w_res.getCmsCacheKey().getTimeout() > 0) { entry.setDateLastModifiedToPreviousTimeout(w_res.getCmsCacheKey().getTimeout()); entry.setDateExpiresToNextTimeout(w_res.getCmsCacheKey().getTimeout()); controller.updateDates(entry.getDateLastModified(), entry.getDateExpires()); } else { entry.setDateLastModified(controller.getDateLastModified()); entry.setDateExpires(controller.getDateExpires()); } cache.put(w_res.getCmsCacheKey(), entry, variation); } else { controller.updateDates(-1, controller.getDateExpires()); } } if (f_res.hasIncludeList()) { Map<String, List<String>> headers = w_res.getHeaders(); byte[] result = w_res.getWriterBytes(); if (LOG.isDebugEnabled()) { LOG.debug( Messages.get().getBundle().key( Messages.LOG_FLEXREQUESTDISPATCHER_RESULT_1, new String(result))); } CmsFlexResponse.processHeaders(headers, f_res); f_res.addToIncludeResults(result); result = null; } } finally { f_res.setCmsIncludeMode(false); f_req.removeIncludeCall(m_vfsTarget); controller.pop(); } }
/** * Includes the requested resource, ignoring the Flex cache.<p> * * @param req the servlet request * @param res the servlet response * @param controller the Flex controller * @param cms the current users OpenCms context * @param resource the requested resource (may be <code>null</code>) * * @throws ServletException in case something goes wrong * @throws IOException in case something goes wrong */
Includes the requested resource, ignoring the Flex cache
includeInternalWithCache
{ "repo_name": "mediaworx/opencms-core", "path": "src/org/opencms/flex/CmsFlexRequestDispatcher.java", "license": "lgpl-2.1", "size": 21680 }
[ "java.io.IOException", "java.util.List", "java.util.Map", "javax.servlet.ServletException", "javax.servlet.ServletRequest", "javax.servlet.ServletResponse", "javax.servlet.http.HttpServletRequest", "javax.servlet.http.HttpServletResponse", "org.opencms.file.CmsObject", "org.opencms.file.CmsPropertyDefinition", "org.opencms.file.CmsResource", "org.opencms.main.CmsException", "org.opencms.main.OpenCms" ]
import java.io.IOException; import java.util.List; import java.util.Map; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.opencms.file.CmsObject; import org.opencms.file.CmsPropertyDefinition; import org.opencms.file.CmsResource; import org.opencms.main.CmsException; import org.opencms.main.OpenCms;
import java.io.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; import org.opencms.file.*; import org.opencms.main.*;
[ "java.io", "java.util", "javax.servlet", "org.opencms.file", "org.opencms.main" ]
java.io; java.util; javax.servlet; org.opencms.file; org.opencms.main;
1,921,189
@Generated(value = "com.sun.tools.xjc.Driver", date = "2015-10-25T05:29:34+06:00", comments = "JAXB RI v2.2.11") public void setId(long value) { this.id = value; }
@Generated(value = STR, date = STR, comments = STR) void function(long value) { this.id = value; }
/** * Sets the value of the id property. * */
Sets the value of the id property
setId
{ "repo_name": "kanonirov/lanb-client", "path": "src/main/java/ru/lanbilling/webservice/wsdl/GetManager.java", "license": "mit", "size": 1686 }
[ "javax.annotation.Generated" ]
import javax.annotation.Generated;
import javax.annotation.*;
[ "javax.annotation" ]
javax.annotation;
1,951,703
public void setGravity(Vector3f gravity) { rigidBody.setGravity(gravity); localUp.set(gravity).normalizeLocal().negateLocal(); updateLocalCoordinateSystem(); }
void function(Vector3f gravity) { rigidBody.setGravity(gravity); localUp.set(gravity).normalizeLocal().negateLocal(); updateLocalCoordinateSystem(); }
/** * Set the gravity for this character. Note that this also realigns the local * coordinate system of the character so that continuous changes in gravity direction * are possible while maintaining a sensible control over the character. * * @param gravity */
Set the gravity for this character. Note that this also realigns the local coordinate system of the character so that continuous changes in gravity direction are possible while maintaining a sensible control over the character
setGravity
{ "repo_name": "rockfireredmoon/iceclient", "path": "iceclient-app/src/org/icemoon/scene/AdvancedCharacterControl.java", "license": "gpl-3.0", "size": 28658 }
[ "com.jme3.math.Vector3f" ]
import com.jme3.math.Vector3f;
import com.jme3.math.*;
[ "com.jme3.math" ]
com.jme3.math;
1,044,490
public void testUpdateXXXOnOutOfRangeColumn() throws SQLException { createTableT1(); Statement stmt = createStatement( ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE); ResultSet rs = stmt.executeQuery("SELECT c1, c2 FROM t1 FOR UPDATE"); assertTrue("FAIL - row not found", rs.next()); try { println("There are only 2 columns in the select list and we are " + "trying to send updateXXX on column position 3"); rs.updateInt(3,22); fail("FAIL - updateInt should have failed because there are " + "only 2 columns in the select list"); } catch (SQLException e) { assertSQLState("XCL14", e); } rs.close(); stmt.close(); }
void function() throws SQLException { createTableT1(); Statement stmt = createStatement( ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE); ResultSet rs = stmt.executeQuery(STR); assertTrue(STR, rs.next()); try { println(STR + STR); rs.updateInt(3,22); fail(STR + STR); } catch (SQLException e) { assertSQLState("XCL14", e); } rs.close(); stmt.close(); }
/** * Negative test - Call updateXXX method on out of the range column */
Negative test - Call updateXXX method on out of the range column
testUpdateXXXOnOutOfRangeColumn
{ "repo_name": "trejkaz/derby", "path": "java/testing/org/apache/derbyTesting/functionTests/tests/lang/UpdatableResultSetTest.java", "license": "apache-2.0", "size": 214498 }
[ "java.sql.ResultSet", "java.sql.SQLException", "java.sql.Statement" ]
import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,812,755
private static StackManipulation callImplementation( VariableScope scope, AstAccessors debugAccessors, Operator operator) { Class<?>[] parameterTypes = new Class<?>[] {Object.class, Object.class, Environment.class, Location.class}; return new StackManipulation.Compound( scope.loadEnvironment(), debugAccessors.loadLocation, ByteCodeUtils.invoke( BinaryOperatorExpression.class, operator.name().toLowerCase(), parameterTypes)); }
static StackManipulation function( VariableScope scope, AstAccessors debugAccessors, Operator operator) { Class<?>[] parameterTypes = new Class<?>[] {Object.class, Object.class, Environment.class, Location.class}; return new StackManipulation.Compound( scope.loadEnvironment(), debugAccessors.loadLocation, ByteCodeUtils.invoke( BinaryOperatorExpression.class, operator.name().toLowerCase(), parameterTypes)); }
/** * Returns a StackManipulation that calls the given operator's implementation method. * * <p> The method must be named exactly as the lower case name of the operator and in addition to * the operands require an Environment and Location. */
Returns a StackManipulation that calls the given operator's implementation method. The method must be named exactly as the lower case name of the operator and in addition to the operands require an Environment and Location
callImplementation
{ "repo_name": "Digas29/bazel", "path": "src/main/java/com/google/devtools/build/lib/syntax/BinaryOperatorExpression.java", "license": "apache-2.0", "size": 17945 }
[ "com.google.devtools.build.lib.events.Location", "com.google.devtools.build.lib.syntax.compiler.ByteCodeUtils", "com.google.devtools.build.lib.syntax.compiler.DebugInfo", "com.google.devtools.build.lib.syntax.compiler.VariableScope", "net.bytebuddy.implementation.bytecode.StackManipulation" ]
import com.google.devtools.build.lib.events.Location; import com.google.devtools.build.lib.syntax.compiler.ByteCodeUtils; import com.google.devtools.build.lib.syntax.compiler.DebugInfo; import com.google.devtools.build.lib.syntax.compiler.VariableScope; import net.bytebuddy.implementation.bytecode.StackManipulation;
import com.google.devtools.build.lib.events.*; import com.google.devtools.build.lib.syntax.compiler.*; import net.bytebuddy.implementation.bytecode.*;
[ "com.google.devtools", "net.bytebuddy.implementation" ]
com.google.devtools; net.bytebuddy.implementation;
2,272,194
public static void notEmpty(Object[] array, Supplier<String> messageSupplier) { if (ObjectUtils.isEmpty(array)) { throw new IllegalArgumentException(nullSafeGet(messageSupplier)); } }
static void function(Object[] array, Supplier<String> messageSupplier) { if (ObjectUtils.isEmpty(array)) { throw new IllegalArgumentException(nullSafeGet(messageSupplier)); } }
/** * Assert that an array contains elements; that is, it must not be * {@code null} and must contain at least one element. * <pre class="code"> * Assert.notEmpty(array, () -&gt; "The " + arrayType + " array must contain elements"); * </pre> * @param array the array to check * @param messageSupplier a supplier for the exception message to use if the * assertion fails * @throws IllegalArgumentException if the object array is {@code null} or contains no elements * @since 5.0 */
Assert that an array contains elements; that is, it must not be null and must contain at least one element. Assert.notEmpty(array, () -&gt; "The " + arrayType + " array must contain elements"); </code>
notEmpty
{ "repo_name": "nucleusbox/nucleus-project", "path": "nucleus-project-core/src/main/java/org/nucleusbox/util/Assert.java", "license": "apache-2.0", "size": 22180 }
[ "java.util.function.Supplier" ]
import java.util.function.Supplier;
import java.util.function.*;
[ "java.util" ]
java.util;
1,985,956
public void debug(Marker marker, String format, Object arg1, Object arg2) { if (!logger.isDebugEnabled(marker)) return; if (instanceofLAL) { String formattedMessage = MessageFormatter.format(format, arg1, arg2) .getMessage(); ((LocationAwareLogger) logger).log(marker, fqcn, LocationAwareLogger.DEBUG_INT, formattedMessage, new Object[] { arg1, arg2 }, null); } else { logger.debug(marker, format, arg1, arg2); } }
void function(Marker marker, String format, Object arg1, Object arg2) { if (!logger.isDebugEnabled(marker)) return; if (instanceofLAL) { String formattedMessage = MessageFormatter.format(format, arg1, arg2) .getMessage(); ((LocationAwareLogger) logger).log(marker, fqcn, LocationAwareLogger.DEBUG_INT, formattedMessage, new Object[] { arg1, arg2 }, null); } else { logger.debug(marker, format, arg1, arg2); } }
/** * Delegate to the appropriate method of the underlying logger. */
Delegate to the appropriate method of the underlying logger
debug
{ "repo_name": "PRECISE/ROSLab", "path": "lib/slf4j-1.7.10/slf4j-ext/src/main/java/org/slf4j/ext/LoggerWrapper.java", "license": "apache-2.0", "size": 28131 }
[ "org.slf4j.Marker", "org.slf4j.helpers.MessageFormatter", "org.slf4j.spi.LocationAwareLogger" ]
import org.slf4j.Marker; import org.slf4j.helpers.MessageFormatter; import org.slf4j.spi.LocationAwareLogger;
import org.slf4j.*; import org.slf4j.helpers.*; import org.slf4j.spi.*;
[ "org.slf4j", "org.slf4j.helpers", "org.slf4j.spi" ]
org.slf4j; org.slf4j.helpers; org.slf4j.spi;
719,019
public ByteMap<byte[]> getColumnFamily(final byte[] table, final byte[] key, final byte[] family) { final ByteMap<ByteMap<ByteMap<TreeMap<Long, byte[]>>>> map = storage.get(table); if (map == null) { return null; } final ByteMap<ByteMap<TreeMap<Long, byte[]>>> cf = map.get(family); if (cf == null) { return null; } final ByteMap<TreeMap<Long, byte[]>> row = cf.get(key); if (row == null) { return null; } // convert to a <qualifier, value> byte map final ByteMap<byte[]> columns = new ByteMap<byte[]>(); for (Entry<byte[], TreeMap<Long, byte[]>> entry : row.entrySet()) { // the <timestamp, value> map should never be null columns.put(entry.getKey(), entry.getValue().firstEntry().getValue()); } return columns; }
ByteMap<byte[]> function(final byte[] table, final byte[] key, final byte[] family) { final ByteMap<ByteMap<ByteMap<TreeMap<Long, byte[]>>>> map = storage.get(table); if (map == null) { return null; } final ByteMap<ByteMap<TreeMap<Long, byte[]>>> cf = map.get(family); if (cf == null) { return null; } final ByteMap<TreeMap<Long, byte[]>> row = cf.get(key); if (row == null) { return null; } final ByteMap<byte[]> columns = new ByteMap<byte[]>(); for (Entry<byte[], TreeMap<Long, byte[]>> entry : row.entrySet()) { columns.put(entry.getKey(), entry.getValue().firstEntry().getValue()); } return columns; }
/** * Returns the most recent value from all columns for a given column family * @param table The table to fetch from * @param key The row key * @param family The column family ID * @return A map of columns if the CF was found, null if no such CF */
Returns the most recent value from all columns for a given column family
getColumnFamily
{ "repo_name": "manolama/opentsdb", "path": "test/storage/MockBase.java", "license": "lgpl-2.1", "size": 67471 }
[ "java.util.Map", "java.util.TreeMap", "org.hbase.async.Bytes" ]
import java.util.Map; import java.util.TreeMap; import org.hbase.async.Bytes;
import java.util.*; import org.hbase.async.*;
[ "java.util", "org.hbase.async" ]
java.util; org.hbase.async;
385,082
private void cleanup() throws SQLException { if (statement_M != null) {statement_M.close();} if (connection_M != null) {connection_M.close();} }
void function() throws SQLException { if (statement_M != null) {statement_M.close();} if (connection_M != null) {connection_M.close();} }
/** * do cleanup after the query has been executed * @throws SQLException */
do cleanup after the query has been executed
cleanup
{ "repo_name": "jpchanson/OpenDMS", "path": "src/tomoBay/model/sql/queries/concreteQueries/SelectUninvoicedOrdersNoErrors.java", "license": "gpl-3.0", "size": 4285 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
411,936
public static Request getAllMemberGroups(int memberId, JsonEvents events) { JsonClient client = new JsonClient(true, events); client.put("member", memberId); return client.call(GROUPS_MANAGER + "getAllMemberGroups"); }
static Request function(int memberId, JsonEvents events) { JsonClient client = new JsonClient(true, events); client.put(STR, memberId); return client.call(GROUPS_MANAGER + STR); }
/** * Returns all groups of specific member including group "members". * * @param memberId id of member * @param events Events done on callback * @return Request unique request */
Returns all groups of specific member including group "members"
getAllMemberGroups
{ "repo_name": "zlamalp/perun-wui", "path": "perun-wui-core/src/main/java/cz/metacentrum/perun/wui/json/managers/GroupsManager.java", "license": "bsd-2-clause", "size": 2663 }
[ "com.google.gwt.http.client.Request", "cz.metacentrum.perun.wui.json.JsonClient", "cz.metacentrum.perun.wui.json.JsonEvents" ]
import com.google.gwt.http.client.Request; import cz.metacentrum.perun.wui.json.JsonClient; import cz.metacentrum.perun.wui.json.JsonEvents;
import com.google.gwt.http.client.*; import cz.metacentrum.perun.wui.json.*;
[ "com.google.gwt", "cz.metacentrum.perun" ]
com.google.gwt; cz.metacentrum.perun;
1,621,466
public static long getChecksum(File file, Checksum checksum) throws IOException { return ByteStreams.getChecksum(newInputStreamSupplier(file), checksum); }
static long function(File file, Checksum checksum) throws IOException { return ByteStreams.getChecksum(newInputStreamSupplier(file), checksum); }
/** * Computes and returns the checksum value for a file. * The checksum object is reset when this method returns successfully. * * @param file the file to read * @param checksum the checksum object * @return the result of {@link Checksum#getValue} after updating the * checksum object with all of the bytes in the file * @throws IOException if an I/O error occurs */
Computes and returns the checksum value for a file. The checksum object is reset when this method returns successfully
getChecksum
{ "repo_name": "lshain-android-source/external-guava", "path": "guava/src/com/google/common/io/Files.java", "license": "apache-2.0", "size": 25724 }
[ "java.io.File", "java.io.IOException", "java.util.zip.Checksum" ]
import java.io.File; import java.io.IOException; import java.util.zip.Checksum;
import java.io.*; import java.util.zip.*;
[ "java.io", "java.util" ]
java.io; java.util;
1,846,224
public void process() throws NoSuchElementException, InvalidAlgorithmParameterException { this.process(this.init()); } /** * Selects Vertex ({@link Action}) with specified id * @param id ID of {@link Action}
void function() throws NoSuchElementException, InvalidAlgorithmParameterException { this.process(this.init()); } /** * Selects Vertex ({@link Action}) with specified id * @param id ID of {@link Action}
/** * Processes the data loaded from xml * @throws NoSuchElementException when connection to {@link Action} does not exist * @throws InvalidAlgorithmParameterException when solution does not exist */
Processes the data loaded from xml
process
{ "repo_name": "dawon/jgraphanalysis", "path": "src/cz/dawon/java/library/JGraphAnalysis.java", "license": "lgpl-3.0", "size": 7369 }
[ "java.security.InvalidAlgorithmParameterException", "java.util.NoSuchElementException" ]
import java.security.InvalidAlgorithmParameterException; import java.util.NoSuchElementException;
import java.security.*; import java.util.*;
[ "java.security", "java.util" ]
java.security; java.util;
1,536,025
public interface TEXTGYVisitor<T> extends ParseTreeVisitor<T> {
public interface TEXTGYVisitor<T> extends ParseTreeVisitor<T> {
/** * Visit a parse tree produced by {@link TEXTGYParser#lause}. * @param ctx the parse tree * @return the visitor result */
Visit a parse tree produced by <code>TEXTGYParser#lause</code>
visitLause
{ "repo_name": "RainVagel/TEXTGY", "path": "src/gen/java/TEXTGY/TEXTGYVisitor.java", "license": "mit", "size": 8390 }
[ "org.antlr.v4.runtime.tree.ParseTreeVisitor" ]
import org.antlr.v4.runtime.tree.ParseTreeVisitor;
import org.antlr.v4.runtime.tree.*;
[ "org.antlr.v4" ]
org.antlr.v4;
804,335
public void expand( final Command callback ) { //This TreeNode is already expanded if ( !hasCollapsedChildren() ) { return; } if ( animationHandle != null ) { animationHandle.stop(); } animationHandle = animate( AnimationTweener.EASE_OUT, new AnimationProperties(), ANIMATION_DURATION, new IAnimationCallback() { private List<WiresBaseTreeNode> descendants; private Map<WiresBaseShape, Pair<Point2D, Point2D>> transformations = new HashMap<WiresBaseShape, Pair<Point2D, Point2D>>();
void function( final Command callback ) { if ( !hasCollapsedChildren() ) { return; } if ( animationHandle != null ) { animationHandle.stop(); } animationHandle = animate( AnimationTweener.EASE_OUT, new AnimationProperties(), ANIMATION_DURATION, new IAnimationCallback() { private List<WiresBaseTreeNode> descendants; private Map<WiresBaseShape, Pair<Point2D, Point2D>> transformations = new HashMap<WiresBaseShape, Pair<Point2D, Point2D>>();
/** * Expand this TreeNode and all descendants. Nested collapsed TreeNodes are not expanded. * @param callback The callback is invoked when the animation completes. */
Expand this TreeNode and all descendants. Nested collapsed TreeNodes are not expanded
expand
{ "repo_name": "Salaboy/wires", "path": "wires-core/wires-trees/src/main/java/org/kie/wires/core/trees/client/shapes/WiresBaseTreeNode.java", "license": "apache-2.0", "size": 24265 }
[ "com.emitrom.lienzo.client.core.animation.AnimationProperties", "com.emitrom.lienzo.client.core.animation.AnimationTweener", "com.emitrom.lienzo.client.core.animation.IAnimationCallback", "com.emitrom.lienzo.client.core.types.Point2D", "java.util.HashMap", "java.util.List", "java.util.Map", "org.kie.wires.core.api.shapes.WiresBaseShape", "org.uberfire.commons.data.Pair", "org.uberfire.mvp.Command" ]
import com.emitrom.lienzo.client.core.animation.AnimationProperties; import com.emitrom.lienzo.client.core.animation.AnimationTweener; import com.emitrom.lienzo.client.core.animation.IAnimationCallback; import com.emitrom.lienzo.client.core.types.Point2D; import java.util.HashMap; import java.util.List; import java.util.Map; import org.kie.wires.core.api.shapes.WiresBaseShape; import org.uberfire.commons.data.Pair; import org.uberfire.mvp.Command;
import com.emitrom.lienzo.client.core.animation.*; import com.emitrom.lienzo.client.core.types.*; import java.util.*; import org.kie.wires.core.api.shapes.*; import org.uberfire.commons.data.*; import org.uberfire.mvp.*;
[ "com.emitrom.lienzo", "java.util", "org.kie.wires", "org.uberfire.commons", "org.uberfire.mvp" ]
com.emitrom.lienzo; java.util; org.kie.wires; org.uberfire.commons; org.uberfire.mvp;
2,405,253
public Color getBorderColor() { return borderColor; }
Color function() { return borderColor; }
/** * Getter method for border color. * * @return Border color. */
Getter method for border color
getBorderColor
{ "repo_name": "mindrunner/funCKit", "path": "workspace/funCKit/src/main/java/de/sep2011/funckit/drawer/LayoutShape.java", "license": "gpl-3.0", "size": 3611 }
[ "java.awt.Color" ]
import java.awt.Color;
import java.awt.*;
[ "java.awt" ]
java.awt;
2,315,662
public static RRDv3 dumpRrd(File sourceFile) throws IOException, RrdException { String rrdBinary = System.getProperty("rrd.binary"); if (rrdBinary == null) { throw new IllegalArgumentException("rrd.binary property must be set"); } try { XMLReader xmlReader = XMLReaderFactory.createXMLReader(); xmlReader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); Process process = Runtime.getRuntime().exec(new String[] {rrdBinary, "dump", sourceFile.getAbsolutePath()}); SAXSource source = new SAXSource(xmlReader, new InputSource(new InputStreamReader(process.getInputStream()))); JAXBContext jc = JAXBContext.newInstance(RRDv3.class); Unmarshaller u = jc.createUnmarshaller(); return (RRDv3) u.unmarshal(source); } catch (Exception e) { throw new RrdException("Can't parse RRD Dump", e); } }
static RRDv3 function(File sourceFile) throws IOException, RrdException { String rrdBinary = System.getProperty(STR); if (rrdBinary == null) { throw new IllegalArgumentException(STR); } try { XMLReader xmlReader = XMLReaderFactory.createXMLReader(); xmlReader.setFeature(STRdumpSTRCan't parse RRD Dump", e); } }
/** * Dumps a RRD. * * @param sourceFile the source file * @return the RRD Object * @throws IOException Signals that an I/O exception has occurred. * @throws RrdException the RRD exception */
Dumps a RRD
dumpRrd
{ "repo_name": "roskens/opennms-pre-github", "path": "opennms-rrd/opennms-rrd-model/src/main/java/org/opennms/netmgt/rrd/model/RrdConvertUtils.java", "license": "agpl-3.0", "size": 11152 }
[ "java.io.File", "java.io.IOException", "org.jrobin.core.RrdException", "org.opennms.netmgt.rrd.model.v3.RRDv3", "org.xml.sax.XMLReader", "org.xml.sax.helpers.XMLReaderFactory" ]
import java.io.File; import java.io.IOException; import org.jrobin.core.RrdException; import org.opennms.netmgt.rrd.model.v3.RRDv3; import org.xml.sax.XMLReader; import org.xml.sax.helpers.XMLReaderFactory;
import java.io.*; import org.jrobin.core.*; import org.opennms.netmgt.rrd.model.v3.*; import org.xml.sax.*; import org.xml.sax.helpers.*;
[ "java.io", "org.jrobin.core", "org.opennms.netmgt", "org.xml.sax" ]
java.io; org.jrobin.core; org.opennms.netmgt; org.xml.sax;
551,034
private String getCVSArguments() { @NonNls final StringBuffer toReturn = new StringBuffer(); if (!isRecursive()) { toReturn.append("-l "); } return toReturn.toString(); }
String function() { @NonNls final StringBuffer toReturn = new StringBuffer(); if (!isRecursive()) { toReturn.append(STR); } return toReturn.toString(); }
/** * Returns the arguments of the command in the command-line style. * Similar to getCVSCommand() however without the files and command's name */
Returns the arguments of the command in the command-line style. Similar to getCVSCommand() however without the files and command's name
getCVSArguments
{ "repo_name": "jexp/idea2", "path": "plugins/cvs/javacvs-src/org/netbeans/lib/cvsclient/command/reservedcheckout/EditorsCommand.java", "license": "apache-2.0", "size": 3678 }
[ "org.jetbrains.annotations.NonNls" ]
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.*;
[ "org.jetbrains.annotations" ]
org.jetbrains.annotations;
1,163,772
protected int determineBalanceTypeAmountChangeMode(JournalVoucherForm journalVoucherForm) throws Exception { int balanceTypeAmountChangeMode = NO_MODE_CHANGE; // retrieve fully populated balance type instances BalanceType origBalType = getPopulatedBalanceTypeInstance(journalVoucherForm.getOriginalBalanceType()); BalanceType newBalType = getPopulatedBalanceTypeInstance(journalVoucherForm.getSelectedBalanceType().getCode()); // figure out which ways we are switching the modes first deal with amount changes if (origBalType.isFinancialOffsetGenerationIndicator() && !newBalType.isFinancialOffsetGenerationIndicator()) { // credit/debit balanceTypeAmountChangeMode = CREDIT_DEBIT_TO_SINGLE_AMT_MODE; } else if (!origBalType.isFinancialOffsetGenerationIndicator() && newBalType.isFinancialOffsetGenerationIndicator()) { // single balanceTypeAmountChangeMode = SINGLE_AMT_TO_CREDIT_DEBIT_MODE; } return balanceTypeAmountChangeMode; }
int function(JournalVoucherForm journalVoucherForm) throws Exception { int balanceTypeAmountChangeMode = NO_MODE_CHANGE; BalanceType origBalType = getPopulatedBalanceTypeInstance(journalVoucherForm.getOriginalBalanceType()); BalanceType newBalType = getPopulatedBalanceTypeInstance(journalVoucherForm.getSelectedBalanceType().getCode()); if (origBalType.isFinancialOffsetGenerationIndicator() && !newBalType.isFinancialOffsetGenerationIndicator()) { balanceTypeAmountChangeMode = CREDIT_DEBIT_TO_SINGLE_AMT_MODE; } else if (!origBalType.isFinancialOffsetGenerationIndicator() && newBalType.isFinancialOffsetGenerationIndicator()) { balanceTypeAmountChangeMode = SINGLE_AMT_TO_CREDIT_DEBIT_MODE; } return balanceTypeAmountChangeMode; }
/** * This method will determine which balance type amount mode to switch to. A change in the balance type selection will * eventually invoke this mechanism, which looks at the old balance type value, and the new balance type value to determine what * the next mode is. * * @param journalVoucherForm * @throws Exception */
This method will determine which balance type amount mode to switch to. A change in the balance type selection will eventually invoke this mechanism, which looks at the old balance type value, and the new balance type value to determine what the next mode is
determineBalanceTypeAmountChangeMode
{ "repo_name": "Ariah-Group/Finance", "path": "af_webapp/src/main/java/org/kuali/kfs/fp/document/web/struts/JournalVoucherAction.java", "license": "apache-2.0", "size": 32374 }
[ "org.kuali.kfs.coa.businessobject.BalanceType" ]
import org.kuali.kfs.coa.businessobject.BalanceType;
import org.kuali.kfs.coa.businessobject.*;
[ "org.kuali.kfs" ]
org.kuali.kfs;
2,641,078
public final static String toString(IoBuffer buf) { int pos = buf.position(); int limit = buf.limit(); final java.nio.ByteBuffer strBuf = buf.buf(); final String string = CHARSET.decode(strBuf).toString(); buf.position(pos); buf.limit(limit); return string; }
final static String function(IoBuffer buf) { int pos = buf.position(); int limit = buf.limit(); final java.nio.ByteBuffer strBuf = buf.buf(); final String string = CHARSET.decode(strBuf).toString(); buf.position(pos); buf.limit(limit); return string; }
/** * String representation of byte buffer * @param buf Byte buffer * @return String representation */
String representation of byte buffer
toString
{ "repo_name": "spearzero/StitchRTSP", "path": "src/main/java/org/red5/io/utils/IOUtils.java", "license": "apache-2.0", "size": 5935 }
[ "java.nio.ByteBuffer", "org.apache.mina.core.buffer.IoBuffer" ]
import java.nio.ByteBuffer; import org.apache.mina.core.buffer.IoBuffer;
import java.nio.*; import org.apache.mina.core.buffer.*;
[ "java.nio", "org.apache.mina" ]
java.nio; org.apache.mina;
402,045
@SafeVarargs public final void migrate(Migration<T>... migrations) { for (Migration<T> migration : migrations) { if (!migration.shouldMigrate()) { continue; } final Object data = migration.getData(); final boolean supportedDataType = isDataTypeSupported(data); if (!supportedDataType) { Log.w(TAG, "could not migrate " + migration.getPreviousKey() + " because the datatype" + data.getClass().getSimpleName() + "is invalid"); migration.onPostMigrate(null); continue; } final String key = migration.getTrayKey(); final String migrationKey = migration.getPreviousKey(); // save into tray getStorage().put(key, migrationKey, data); // return the saved data. final T item = getStorage().get(key); migration.onPostMigrate(item); } }
final void function(Migration<T>... migrations) { for (Migration<T> migration : migrations) { if (!migration.shouldMigrate()) { continue; } final Object data = migration.getData(); final boolean supportedDataType = isDataTypeSupported(data); if (!supportedDataType) { Log.w(TAG, STR + migration.getPreviousKey() + STR + data.getClass().getSimpleName() + STR); migration.onPostMigrate(null); continue; } final String key = migration.getTrayKey(); final String migrationKey = migration.getPreviousKey(); getStorage().put(key, migrationKey, data); final T item = getStorage().get(key); migration.onPostMigrate(item); } }
/** * Migrates data into this preference. * * @param migrations migrations will be migrated into this preference */
Migrates data into this preference
migrate
{ "repo_name": "wtttc/tray", "path": "library/src/main/java/net/grandcentrix/tray/core/Preferences.java", "license": "apache-2.0", "size": 7311 }
[ "android.util.Log" ]
import android.util.Log;
import android.util.*;
[ "android.util" ]
android.util;
1,925,030
void addToInvalidates(final Block block, final DatanodeInfo datanode) { invalidateBlocks.add(block, datanode, true); }
void addToInvalidates(final Block block, final DatanodeInfo datanode) { invalidateBlocks.add(block, datanode, true); }
/** * Adds block to list of blocks which will be invalidated on specified * datanode and log the operation */
Adds block to list of blocks which will be invalidated on specified datanode and log the operation
addToInvalidates
{ "repo_name": "ict-carch/hadoop-plus", "path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java", "license": "apache-2.0", "size": 123764 }
[ "org.apache.hadoop.hdfs.protocol.Block", "org.apache.hadoop.hdfs.protocol.DatanodeInfo" ]
import org.apache.hadoop.hdfs.protocol.Block; import org.apache.hadoop.hdfs.protocol.DatanodeInfo;
import org.apache.hadoop.hdfs.protocol.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
2,295,957
public Set<CallSite> getCallers(Context<SootMethod,CFGNode,PointsToGraph> target) { return callers.get(target); }
Set<CallSite> function(Context<SootMethod,CFGNode,PointsToGraph> target) { return callers.get(target); }
/** * Returns the callers of a value context. * * @param target the target value context * @return a set of call-sites which transition to the given target context */
Returns the callers of a value context
getCallers
{ "repo_name": "csytang/vreAnalyzer", "path": "src/vreAnalyzer/Context/ContextTransitionTable.java", "license": "gpl-2.0", "size": 9024 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
739,267
public View getHeader() { return mDrawer.mHeaderView; }
View function() { return mDrawer.mHeaderView; }
/** * get the Header View if set else NULL * * @return */
get the Header View if set else NULL
getHeader
{ "repo_name": "GaneshRepo/Material-Drawer", "path": "library/src/main/java/com/mikepenz/materialdrawer/Drawer.java", "license": "apache-2.0", "size": 56906 }
[ "android.view.View" ]
import android.view.View;
import android.view.*;
[ "android.view" ]
android.view;
179,635
default AdvancedCassandraEndpointConsumerBuilder pollStrategy( PollingConsumerPollStrategy pollStrategy) { doSetProperty("pollStrategy", pollStrategy); return this; }
default AdvancedCassandraEndpointConsumerBuilder pollStrategy( PollingConsumerPollStrategy pollStrategy) { doSetProperty(STR, pollStrategy); return this; }
/** * A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing * you to provide your custom implementation to control error handling * usually occurred during the poll operation before an Exchange have * been created and being routed in Camel. * * The option is a: * <code>org.apache.camel.spi.PollingConsumerPollStrategy</code> type. * * Group: consumer (advanced) */
A pluggable org.apache.camel.PollingConsumerPollingStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation before an Exchange have been created and being routed in Camel. The option is a: <code>org.apache.camel.spi.PollingConsumerPollStrategy</code> type. Group: consumer (advanced)
pollStrategy
{ "repo_name": "ullgren/camel", "path": "core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/CassandraEndpointBuilderFactory.java", "license": "apache-2.0", "size": 54057 }
[ "org.apache.camel.spi.PollingConsumerPollStrategy" ]
import org.apache.camel.spi.PollingConsumerPollStrategy;
import org.apache.camel.spi.*;
[ "org.apache.camel" ]
org.apache.camel;
2,837,339
void setContent(File file) throws IOException;
void setContent(File file) throws IOException;
/** * Set the content from the file (erase any previous data) * * @param file * must be not null * @exception IOException */
Set the content from the file (erase any previous data)
setContent
{ "repo_name": "satishsaley/netty", "path": "codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpData.java", "license": "apache-2.0", "size": 6862 }
[ "java.io.File", "java.io.IOException" ]
import java.io.File; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
135,030
@Exported @StaplerDispatchable public List<UpdateCenterJob> getJobs() { synchronized (jobs) { return new ArrayList<>(jobs); } }
List<UpdateCenterJob> function() { synchronized (jobs) { return new ArrayList<>(jobs); } }
/** * Returns the list of {@link UpdateCenterJob} representing scheduled installation attempts. * * @return * can be empty but never null. Oldest entries first. */
Returns the list of <code>UpdateCenterJob</code> representing scheduled installation attempts
getJobs
{ "repo_name": "batmat/jenkins", "path": "core/src/main/java/hudson/model/UpdateCenter.java", "license": "mit", "size": 88993 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
326,111
public static String[] getNames(Object... objects) { final String[] names = new String[objects.length]; for (int i = 0; i < names.length; i++) { String name; if (objects[i] instanceof NamedObject) { final NamedObject o = (NamedObject) objects[i]; name = getName(o.getName(), o.getShortName()); } else { name = objects[i].toString(); } // Capitalise first letter if (name.length() > 0 && Character.isLowerCase(name.charAt(0))) { name = Character.toUpperCase(name.charAt(0)) + name.substring(1); } names[i] = name; } return names; }
static String[] function(Object... objects) { final String[] names = new String[objects.length]; for (int i = 0; i < names.length; i++) { String name; if (objects[i] instanceof NamedObject) { final NamedObject o = (NamedObject) objects[i]; name = getName(o.getName(), o.getShortName()); } else { name = objects[i].toString(); } if (name.length() > 0 && Character.isLowerCase(name.charAt(0))) { name = Character.toUpperCase(name.charAt(0)) + name.substring(1); } names[i] = name; } return names; }
/** * Convert a list of objects into names (e.g. pass in (Object[])enum.getValues()). The first * letter is capitalised. The rest of the name is converted to lowercase if it is all uppercase. * Remaining mixed case names are left unchanged. * * <p>Used to convert the settings enumerations into names used with dialogs. * * @param objects the objects * @return the names */
Convert a list of objects into names (e.g. pass in (Object[])enum.getValues()). The first letter is capitalised. The rest of the name is converted to lowercase if it is all uppercase. Remaining mixed case names are left unchanged. Used to convert the settings enumerations into names used with dialogs
getNames
{ "repo_name": "aherbert/GDSC-SMLM", "path": "src/main/java/uk/ac/sussex/gdsc/smlm/ij/settings/SettingsManager.java", "license": "gpl-3.0", "size": 46108 }
[ "uk.ac.sussex.gdsc.smlm.data.NamedObject" ]
import uk.ac.sussex.gdsc.smlm.data.NamedObject;
import uk.ac.sussex.gdsc.smlm.data.*;
[ "uk.ac.sussex" ]
uk.ac.sussex;
1,638,254
protected void prepareToReturnNone(MultipleValueLookupForm multipleValueLookupForm) { String lookupResultsSequenceNumber = multipleValueLookupForm.getLookupResultsSequenceNumber(); try { if (StringUtils.isNotBlank(lookupResultsSequenceNumber)) { // we're returning nothing, so we try to get rid of stuff LookupResultsService lookupResultsService = KNSServiceLocator.getLookupResultsService(); lookupResultsService.clearPersistedLookupResults(lookupResultsSequenceNumber); multipleValueLookupForm.setLookupResultsSequenceNumber(null); } } catch (Exception e) { // not a big deal, continue on and purge w/ a batch job LOG.error("error occured trying to clear lookup results seq nbr " + lookupResultsSequenceNumber, e); } }
void function(MultipleValueLookupForm multipleValueLookupForm) { String lookupResultsSequenceNumber = multipleValueLookupForm.getLookupResultsSequenceNumber(); try { if (StringUtils.isNotBlank(lookupResultsSequenceNumber)) { LookupResultsService lookupResultsService = KNSServiceLocator.getLookupResultsService(); lookupResultsService.clearPersistedLookupResults(lookupResultsSequenceNumber); multipleValueLookupForm.setLookupResultsSequenceNumber(null); } } catch (Exception e) { LOG.error(STR + lookupResultsSequenceNumber, e); } }
/** * This method performs the operations necessary for a multiple value lookup to return no results to the calling page * * @param multipleValueLookupForm */
This method performs the operations necessary for a multiple value lookup to return no results to the calling page
prepareToReturnNone
{ "repo_name": "ua-eas/ksd-kc5.2.1-rice2.3.6-ua", "path": "rice-middleware/kns/src/main/java/org/kuali/rice/kns/web/struts/action/KualiMultipleValueLookupAction.java", "license": "apache-2.0", "size": 31616 }
[ "org.apache.commons.lang.StringUtils", "org.kuali.rice.kns.lookup.LookupResultsService", "org.kuali.rice.kns.service.KNSServiceLocator", "org.kuali.rice.kns.web.struts.form.MultipleValueLookupForm" ]
import org.apache.commons.lang.StringUtils; import org.kuali.rice.kns.lookup.LookupResultsService; import org.kuali.rice.kns.service.KNSServiceLocator; import org.kuali.rice.kns.web.struts.form.MultipleValueLookupForm;
import org.apache.commons.lang.*; import org.kuali.rice.kns.lookup.*; import org.kuali.rice.kns.service.*; import org.kuali.rice.kns.web.struts.form.*;
[ "org.apache.commons", "org.kuali.rice" ]
org.apache.commons; org.kuali.rice;
1,255,782
List<String> datastores = new ArrayList<String>(); File dsManagerDir = new File(this.path); for(File file:dsManagerDir.listFiles()){ boolean isStore = file.isDirectory() && new File(file, "db.sync").isFile(); if (isStore) { //replace . with a slash, on disk / are replaced with dots datastores.add(file.getName().replace(".", "/")); } } return datastores; }
List<String> datastores = new ArrayList<String>(); File dsManagerDir = new File(this.path); for(File file:dsManagerDir.listFiles()){ boolean isStore = file.isDirectory() && new File(file, STR).isFile(); if (isStore) { datastores.add(file.getName().replace(".", "/")); } } return datastores; }
/** * Lists all the names of {@link com.cloudant.sync.datastore.Datastore Datastores} managed by this DatastoreManager * * @return List of {@link com.cloudant.sync.datastore.Datastore Datastores} names. */
Lists all the names of <code>com.cloudant.sync.datastore.Datastore Datastores</code> managed by this DatastoreManager
listAllDatastores
{ "repo_name": "nuan-nuan/sync-android", "path": "cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/datastore/DatastoreManager.java", "license": "apache-2.0", "size": 12381 }
[ "java.io.File", "java.util.ArrayList", "java.util.List" ]
import java.io.File; import java.util.ArrayList; import java.util.List;
import java.io.*; import java.util.*;
[ "java.io", "java.util" ]
java.io; java.util;
2,686,954
public float numCols(float thumbWidth, float spacing, DisplayMetrics d) { return (d.widthPixels - spacing) / (spacing + thumbWidth); }
float function(float thumbWidth, float spacing, DisplayMetrics d) { return (d.widthPixels - spacing) / (spacing + thumbWidth); }
/** * Calculates the number of columns possible given thumbnail width (px), spacing (px), * and screen dimensions. * @param thumbWidth Width of the thumbnails (px). * @param spacing Space between images (px). * @param d Screen information (in DisplayMetrics object). * @return Maximum number of columns given parameters. */
Calculates the number of columns possible given thumbnail width (px), spacing (px), and screen dimensions
numCols
{ "repo_name": "0359xiaodong/gina-puffinfeeder-android-viewer", "path": "PuffinFeeder/src/main/java/edu/alaska/gina/feeder/gina_puffinfeeder_android_viewer/ImageFeedFragment.java", "license": "apache-2.0", "size": 12904 }
[ "android.util.DisplayMetrics" ]
import android.util.DisplayMetrics;
import android.util.*;
[ "android.util" ]
android.util;
441,906
@Override public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) { worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn)); }
void function(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) { worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn)); }
/** * schedule an update the block after the neighbor changes * @param worldIn * @param pos * @param state * @param neighborBlock */
schedule an update the block after the neighbor changes
onNeighborBlockChange
{ "repo_name": "pollend/mine-sweeper", "path": "src/main/java/com/minesweeper/blocks/BaseFieldBlock.java", "license": "lgpl-2.1", "size": 7454 }
[ "net.minecraft.block.Block", "net.minecraft.block.state.IBlockState", "net.minecraft.util.BlockPos", "net.minecraft.world.World" ]
import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.util.BlockPos; import net.minecraft.world.World;
import net.minecraft.block.*; import net.minecraft.block.state.*; import net.minecraft.util.*; import net.minecraft.world.*;
[ "net.minecraft.block", "net.minecraft.util", "net.minecraft.world" ]
net.minecraft.block; net.minecraft.util; net.minecraft.world;
1,451,779
@Override public boolean setValue(String newValue) { if (super.setValue(newValue)) { try { if (typeName.equals("java.lang.String")) { containingEcoreNode.eSet(entryMetaData, newValue); } else if (typeName.equals("java.math.BigInteger")) { BigInteger b = new BigInteger(newValue); containingEcoreNode.eSet(entryMetaData, b); } else if (typeName.equals("java.math.BigDecimal")) { BigDecimal d = new BigDecimal(newValue); containingEcoreNode.eSet(entryMetaData, d); } else { throw new IllegalArgumentException( "Unsupported Data Type for the EMFEntry."); } } catch (IllegalArgumentException e) { logger.error(getClass().getName() + " Exception!",e); return false; } return true; } return false; }
boolean function(String newValue) { if (super.setValue(newValue)) { try { if (typeName.equals(STR)) { containingEcoreNode.eSet(entryMetaData, newValue); } else if (typeName.equals(STR)) { BigInteger b = new BigInteger(newValue); containingEcoreNode.eSet(entryMetaData, b); } else if (typeName.equals(STR)) { BigDecimal d = new BigDecimal(newValue); containingEcoreNode.eSet(entryMetaData, d); } else { throw new IllegalArgumentException( STR); } } catch (IllegalArgumentException e) { logger.error(getClass().getName() + STR,e); return false; } return true; } return false; }
/** * This method overrides Entry.setValue to additionally modify the * EAttribute in the EMF Ecore model tree. * */
This method overrides Entry.setValue to additionally modify the EAttribute in the EMF Ecore model tree
setValue
{ "repo_name": "gorindn/ice", "path": "src/org.eclipse.ice.datastructures/src/org/eclipse/ice/datastructures/form/emf/EMFEntry.java", "license": "epl-1.0", "size": 5170 }
[ "java.math.BigDecimal", "java.math.BigInteger" ]
import java.math.BigDecimal; import java.math.BigInteger;
import java.math.*;
[ "java.math" ]
java.math;
254,065
public void add(BigDecimal[] array) { for(BigDecimal number : array) { this.data.add(BigDecimalUtil.toBigDecimal(number)); } }
void function(BigDecimal[] array) { for(BigDecimal number : array) { this.data.add(BigDecimalUtil.toBigDecimal(number)); } }
/** * Adds an array of numbers to the data set. * @param BigDecimal[] the data to add */
Adds an array of numbers to the data set
add
{ "repo_name": "jessemull/MicroFlex", "path": "src/main/java/com/github/jessemull/microflex/bigdecimalflex/plate/WellBigDecimal.java", "license": "apache-2.0", "size": 25559 }
[ "com.github.jessemull.microflex.util.BigDecimalUtil", "java.math.BigDecimal" ]
import com.github.jessemull.microflex.util.BigDecimalUtil; import java.math.BigDecimal;
import com.github.jessemull.microflex.util.*; import java.math.*;
[ "com.github.jessemull", "java.math" ]
com.github.jessemull; java.math;
1,538,339
public Target[] getTargets() { Target[] targs = new Target[targets.size()]; int count = 0; for (Enumeration e = targets.getObjects(); e.hasMoreElements();) { targs[count++] = Target.getInstance(e.nextElement()); } return targs; }
Target[] function() { Target[] targs = new Target[targets.size()]; int count = 0; for (Enumeration e = targets.getObjects(); e.hasMoreElements();) { targs[count++] = Target.getInstance(e.nextElement()); } return targs; }
/** * Returns the targets in a <code>Vector</code>. * <p> * The vector is cloned before it is returned. * * @return Returns the targets. */
Returns the targets in a <code>Vector</code>. The vector is cloned before it is returned
getTargets
{ "repo_name": "bitcoin-labs/bitcoinj", "path": "src/com/google/bitcoin/bouncycastle/asn1/x509/Targets.java", "license": "apache-2.0", "size": 3318 }
[ "java.util.Enumeration" ]
import java.util.Enumeration;
import java.util.*;
[ "java.util" ]
java.util;
2,461,244
public static AbstractOffsetTimeAssert<?> assertThat(OffsetTime actual) { return AssertionsForClassTypes.assertThat(actual); }
static AbstractOffsetTimeAssert<?> function(OffsetTime actual) { return AssertionsForClassTypes.assertThat(actual); }
/** * Create assertion for {@link java.time.OffsetTime}. * * @param actual the actual value. * @return the created assertion object. */
Create assertion for <code>java.time.OffsetTime</code>
assertThat
{ "repo_name": "pimterry/assertj-core", "path": "src/main/java/org/assertj/core/api/Assertions.java", "license": "apache-2.0", "size": 62714 }
[ "java.time.OffsetTime" ]
import java.time.OffsetTime;
import java.time.*;
[ "java.time" ]
java.time;
1,349,149
public void onEntityDamaged(EntityLivingBase user, Entity target, int level) { if (target instanceof EntityLivingBase) { EntityLivingBase entitylivingbase = (EntityLivingBase)target; if (this.damageType == 2 && entitylivingbase.getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD) { int i = 20 + user.getRNG().nextInt(10 * level); entitylivingbase.addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, i, 3)); } } }
void function(EntityLivingBase user, Entity target, int level) { if (target instanceof EntityLivingBase) { EntityLivingBase entitylivingbase = (EntityLivingBase)target; if (this.damageType == 2 && entitylivingbase.getCreatureAttribute() == EnumCreatureAttribute.ARTHROPOD) { int i = 20 + user.getRNG().nextInt(10 * level); entitylivingbase.addPotionEffect(new PotionEffect(MobEffects.SLOWNESS, i, 3)); } } }
/** * Called whenever a mob is damaged with an item that has this enchantment on it. */
Called whenever a mob is damaged with an item that has this enchantment on it
onEntityDamaged
{ "repo_name": "lucemans/ShapeClient-SRC", "path": "net/minecraft/enchantment/EnchantmentDamage.java", "license": "mpl-2.0", "size": 4280 }
[ "net.minecraft.entity.Entity", "net.minecraft.entity.EntityLivingBase", "net.minecraft.entity.EnumCreatureAttribute", "net.minecraft.init.MobEffects", "net.minecraft.potion.PotionEffect" ]
import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EnumCreatureAttribute; import net.minecraft.init.MobEffects; import net.minecraft.potion.PotionEffect;
import net.minecraft.entity.*; import net.minecraft.init.*; import net.minecraft.potion.*;
[ "net.minecraft.entity", "net.minecraft.init", "net.minecraft.potion" ]
net.minecraft.entity; net.minecraft.init; net.minecraft.potion;
2,457,570
public void addOpenController(DefaultController c) { openControllers.put(c.getModelObject(), c); CogTool.controllerNexus.addController(c.getProject(), c); raiseAlert(new ControllerChange(this, c, true)); }
void function(DefaultController c) { openControllers.put(c.getModelObject(), c); CogTool.controllerNexus.addController(c.getProject(), c); raiseAlert(new ControllerChange(this, c, true)); }
/** * Register the given controller with its model object in this * registry and with its associated <code>Project</code> instance * in the <code>ControllerNexus</code> registry. * <p> * Notifies observers by raising an alert with a * <code>ControllerChange</code> instance indicating the "add". * * @param c the controller to register * @author mlh */
Register the given controller with its model object in this registry and with its associated <code>Project</code> instance in the <code>ControllerNexus</code> registry. Notifies observers by raising an alert with a <code>ControllerChange</code> instance indicating the "add"
addOpenController
{ "repo_name": "cogtool/cogtool", "path": "java/edu/cmu/cs/hcii/cogtool/controller/ControllerRegistry.java", "license": "lgpl-2.1", "size": 8628 }
[ "edu.cmu.cs.hcii.cogtool.CogTool" ]
import edu.cmu.cs.hcii.cogtool.CogTool;
import edu.cmu.cs.hcii.cogtool.*;
[ "edu.cmu.cs" ]
edu.cmu.cs;
1,604,301
public String next() { if (next == null) { throw new NoSuchElementException(); } String s = next; advance(); return s; }
String function() { if (next == null) { throw new NoSuchElementException(); } String s = next; advance(); return s; }
/** * Returns the next word from the reader that has passed the filter. */
Returns the next word from the reader that has passed the filter
next
{ "repo_name": "fozziethebeat/S-Space", "path": "src/main/java/edu/ucla/sspace/text/OrderPreservingFilteredIterator.java", "license": "gpl-2.0", "size": 3648 }
[ "java.util.NoSuchElementException" ]
import java.util.NoSuchElementException;
import java.util.*;
[ "java.util" ]
java.util;
51,025
RedisFuture<Long> rpush(K key, V... values);
RedisFuture<Long> rpush(K key, V... values);
/** * Append one or multiple values to a list. * * @param key the key. * @param values the value. * @return Long integer-reply the length of the list after the push operation. */
Append one or multiple values to a list
rpush
{ "repo_name": "lettuce-io/lettuce-core", "path": "src/main/java/io/lettuce/core/api/async/RedisListAsyncCommands.java", "license": "apache-2.0", "size": 15307 }
[ "io.lettuce.core.RedisFuture" ]
import io.lettuce.core.RedisFuture;
import io.lettuce.core.*;
[ "io.lettuce.core" ]
io.lettuce.core;
2,400,397
private void populateViews(LinearLayout linearLayout, View[] views, Context context) { RelativeLayout.LayoutParams llParams = (android.widget.RelativeLayout.LayoutParams) linearLayout.getLayoutParams(); Display display = getActivity().getWindowManager().getDefaultDisplay(); linearLayout.removeAllViews(); int maxWidth = display.getWidth() - llParams.leftMargin - llParams.rightMargin - mParentView.getPaddingLeft() - mParentView.getPaddingRight(); if (DisplayUtils.isXLarge(getActivity())) { int minDialogWidth = getResources().getDimensionPixelSize(R.dimen.theme_details_dialog_min_width); int dialogWidth = Math.max((int) (display.getWidth() * 0.6), minDialogWidth); maxWidth = dialogWidth / 2 - llParams.leftMargin - llParams.rightMargin; } else if (mLeftContainer != null && mLeftContainer.getLayoutParams() instanceof LinearLayout.LayoutParams) { int spec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED); mLeftContainer.measure(spec, spec); LinearLayout.LayoutParams params = (LayoutParams) mLeftContainer.getLayoutParams(); maxWidth -= mLeftContainer.getMeasuredWidth() + params.rightMargin + params.leftMargin; } linearLayout.setOrientation(LinearLayout.VERTICAL); LinearLayout.LayoutParams params; LinearLayout newLL = new LinearLayout(context); newLL.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); newLL.setGravity(Gravity.LEFT); newLL.setOrientation(LinearLayout.HORIZONTAL); int widthSoFar = 0; int dp4 = DisplayUtils.dpToPx(getActivity(), 4); int dp2 = DisplayUtils.dpToPx(getActivity(), 2); for (int i = 0; i < views.length; i++) { LinearLayout LL = new LinearLayout(context); LL.setOrientation(LinearLayout.HORIZONTAL); LL.setLayoutParams(new ListView.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); views[i].measure(0, 0); params = new LinearLayout.LayoutParams(views[i].getMeasuredWidth(), LayoutParams.WRAP_CONTENT); params.setMargins(0, dp2, dp4, dp2); LL.addView(views[i], params); LL.measure(0, 0); widthSoFar += views[i].getMeasuredWidth() + views[i].getPaddingLeft() + views[i].getPaddingRight(); if (widthSoFar >= maxWidth) { linearLayout.addView(newLL); newLL = new LinearLayout(context); newLL.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); newLL.setOrientation(LinearLayout.HORIZONTAL); newLL.setGravity(Gravity.LEFT); params = new LinearLayout.LayoutParams(LL.getMeasuredWidth(), LL.getMeasuredHeight()); newLL.addView(LL, params); widthSoFar = LL.getMeasuredWidth(); } else { newLL.addView(LL); } } linearLayout.addView(newLL); }
void function(LinearLayout linearLayout, View[] views, Context context) { RelativeLayout.LayoutParams llParams = (android.widget.RelativeLayout.LayoutParams) linearLayout.getLayoutParams(); Display display = getActivity().getWindowManager().getDefaultDisplay(); linearLayout.removeAllViews(); int maxWidth = display.getWidth() - llParams.leftMargin - llParams.rightMargin - mParentView.getPaddingLeft() - mParentView.getPaddingRight(); if (DisplayUtils.isXLarge(getActivity())) { int minDialogWidth = getResources().getDimensionPixelSize(R.dimen.theme_details_dialog_min_width); int dialogWidth = Math.max((int) (display.getWidth() * 0.6), minDialogWidth); maxWidth = dialogWidth / 2 - llParams.leftMargin - llParams.rightMargin; } else if (mLeftContainer != null && mLeftContainer.getLayoutParams() instanceof LinearLayout.LayoutParams) { int spec = MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED); mLeftContainer.measure(spec, spec); LinearLayout.LayoutParams params = (LayoutParams) mLeftContainer.getLayoutParams(); maxWidth -= mLeftContainer.getMeasuredWidth() + params.rightMargin + params.leftMargin; } linearLayout.setOrientation(LinearLayout.VERTICAL); LinearLayout.LayoutParams params; LinearLayout newLL = new LinearLayout(context); newLL.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); newLL.setGravity(Gravity.LEFT); newLL.setOrientation(LinearLayout.HORIZONTAL); int widthSoFar = 0; int dp4 = DisplayUtils.dpToPx(getActivity(), 4); int dp2 = DisplayUtils.dpToPx(getActivity(), 2); for (int i = 0; i < views.length; i++) { LinearLayout LL = new LinearLayout(context); LL.setOrientation(LinearLayout.HORIZONTAL); LL.setLayoutParams(new ListView.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT)); views[i].measure(0, 0); params = new LinearLayout.LayoutParams(views[i].getMeasuredWidth(), LayoutParams.WRAP_CONTENT); params.setMargins(0, dp2, dp4, dp2); LL.addView(views[i], params); LL.measure(0, 0); widthSoFar += views[i].getMeasuredWidth() + views[i].getPaddingLeft() + views[i].getPaddingRight(); if (widthSoFar >= maxWidth) { linearLayout.addView(newLL); newLL = new LinearLayout(context); newLL.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); newLL.setOrientation(LinearLayout.HORIZONTAL); newLL.setGravity(Gravity.LEFT); params = new LinearLayout.LayoutParams(LL.getMeasuredWidth(), LL.getMeasuredHeight()); newLL.addView(LL, params); widthSoFar = LL.getMeasuredWidth(); } else { newLL.addView(LL); } } linearLayout.addView(newLL); }
/** * Copyright 2011 Sherif * Updated by Karim Varela to handle LinearLayouts with other views on either side. * @param linearLayout * @param views : The views to wrap within LinearLayout * @param context * @author Karim Varela **/
Copyright 2011 Sherif Updated by Karim Varela to handle LinearLayouts with other views on either side
populateViews
{ "repo_name": "nickhargreaves/CitizenReporter", "path": "WordPress/src/main/java/org/codeforafrica/citizenreporter/starreports/ui/themes/ThemeDetailsFragment.java", "license": "gpl-2.0", "size": 13755 }
[ "android.content.Context", "android.view.Display", "android.view.Gravity", "android.view.View", "android.widget.LinearLayout", "android.widget.ListView", "android.widget.RelativeLayout", "org.wordpress.android.util.DisplayUtils" ]
import android.content.Context; import android.view.Display; import android.view.Gravity; import android.view.View; import android.widget.LinearLayout; import android.widget.ListView; import android.widget.RelativeLayout; import org.wordpress.android.util.DisplayUtils;
import android.content.*; import android.view.*; import android.widget.*; import org.wordpress.android.util.*;
[ "android.content", "android.view", "android.widget", "org.wordpress.android" ]
android.content; android.view; android.widget; org.wordpress.android;
122,402
public void setDeviceSelectorConfiguration(String deviceSelector) { m_deviceSelectorConfiguration = deviceSelector; Object objectInstance; try { objectInstance = Class.forName(m_deviceSelectorConfiguration).newInstance(); } catch (Throwable t) { LOG.error( Messages.get().getBundle().key(Messages.LOG_CLASS_INIT_FAILURE_1, m_deviceSelectorConfiguration), t); return; } if (objectInstance instanceof I_CmsJspDeviceSelector) { m_deviceSelector = (I_CmsJspDeviceSelector)objectInstance; if (CmsLog.INIT.isInfoEnabled()) { CmsLog.INIT.info( Messages.get().getBundle().key( Messages.INIT_FLEXCACHE_DEVICE_SELECTOR_SUCCESS_1, m_deviceSelectorConfiguration)); } } else { if (CmsLog.INIT.isFatalEnabled()) { CmsLog.INIT.fatal( Messages.get().getBundle().key( Messages.INIT_FLEXCACHE_DEVICE_SELECTOR_FAILURE_1, m_deviceSelectorConfiguration)); } } }
void function(String deviceSelector) { m_deviceSelectorConfiguration = deviceSelector; Object objectInstance; try { objectInstance = Class.forName(m_deviceSelectorConfiguration).newInstance(); } catch (Throwable t) { LOG.error( Messages.get().getBundle().key(Messages.LOG_CLASS_INIT_FAILURE_1, m_deviceSelectorConfiguration), t); return; } if (objectInstance instanceof I_CmsJspDeviceSelector) { m_deviceSelector = (I_CmsJspDeviceSelector)objectInstance; if (CmsLog.INIT.isInfoEnabled()) { CmsLog.INIT.info( Messages.get().getBundle().key( Messages.INIT_FLEXCACHE_DEVICE_SELECTOR_SUCCESS_1, m_deviceSelectorConfiguration)); } } else { if (CmsLog.INIT.isFatalEnabled()) { CmsLog.INIT.fatal( Messages.get().getBundle().key( Messages.INIT_FLEXCACHE_DEVICE_SELECTOR_FAILURE_1, m_deviceSelectorConfiguration)); } } }
/** * Sets the device selector configuration.<p> * * @param deviceSelector the device selector to set */
Sets the device selector configuration
setDeviceSelectorConfiguration
{ "repo_name": "ggiudetti/opencms-core", "path": "src/org/opencms/flex/CmsFlexCacheConfiguration.java", "license": "lgpl-2.1", "size": 7863 }
[ "org.opencms.main.CmsLog" ]
import org.opencms.main.CmsLog;
import org.opencms.main.*;
[ "org.opencms.main" ]
org.opencms.main;
508,365
@Override public void sendUrgentData(int data) throws IOException { throw new SocketException("Method sendUrgentData() is not supported."); }
void function(int data) throws IOException { throw new SocketException(STR); }
/** * This method is not supported for SSLSocket implementation. */
This method is not supported for SSLSocket implementation
sendUrgentData
{ "repo_name": "webos21/xi", "path": "java/jcl/src/java/org/apache/harmony/xnet/provider/jsse/SSLSocketImpl.java", "license": "apache-2.0", "size": 25837 }
[ "java.io.IOException", "java.net.SocketException" ]
import java.io.IOException; import java.net.SocketException;
import java.io.*; import java.net.*;
[ "java.io", "java.net" ]
java.io; java.net;
549,833
@Deployment public void testSimpleAutomaticSubProcess() { ProcessInstance pi = runtimeService.startProcessInstanceByKey("simpleSubProcessAutomatic"); assertTrue(pi.isEnded()); assertProcessEnded(pi.getId()); }
void function() { ProcessInstance pi = runtimeService.startProcessInstanceByKey(STR); assertTrue(pi.isEnded()); assertProcessEnded(pi.getId()); }
/** * Same test case as before, but now with all automatic steps */
Same test case as before, but now with all automatic steps
testSimpleAutomaticSubProcess
{ "repo_name": "menski/camunda-bpm-platform", "path": "engine/src/test/java/org/camunda/bpm/engine/test/bpmn/subprocess/SubProcessTest.java", "license": "apache-2.0", "size": 23873 }
[ "org.camunda.bpm.engine.runtime.ProcessInstance" ]
import org.camunda.bpm.engine.runtime.ProcessInstance;
import org.camunda.bpm.engine.runtime.*;
[ "org.camunda.bpm" ]
org.camunda.bpm;
2,088,901
void processInner(final ConcurrentReadInputStream cris, final ConcurrentReadOutputStream ros){ readsProcessed=0; basesProcessed=0; { ListNum<Read> ln=cris.nextList(); ArrayList<Read> reads=(ln!=null ? ln.list : null); if(reads!=null && !reads.isEmpty()){ Read r=reads.get(0); assert((ffin1==null || ffin1.samOrBam()) || (r.mate!=null)==cris.paired()); } while(reads!=null && reads.size()>0){ if(verbose){outstream.println("Fetched "+reads.size()+" reads.");} for(int idx=0; idx<reads.size(); idx++){ final Read r1=reads.get(idx); final Read r2=r1.mate; final int initialLength1=r1.length(); final int initialLength2=(r1.mateLength()); { readsProcessed++; basesProcessed+=initialLength1; } if(r2!=null){ readsProcessed++; basesProcessed+=initialLength2; } boolean keep=processReadPair(r1, r2); if(!keep){reads.set(idx, null);} } if(ros!=null){ros.add(reads, ln.id);} cris.returnList(ln.id, ln.list.isEmpty()); if(verbose){outstream.println("Returned a list.");} ln=cris.nextList(); reads=(ln!=null ? ln.list : null); } if(ln!=null){ cris.returnList(ln.id, ln.list==null || ln.list.isEmpty()); } } }
void processInner(final ConcurrentReadInputStream cris, final ConcurrentReadOutputStream ros){ readsProcessed=0; basesProcessed=0; { ListNum<Read> ln=cris.nextList(); ArrayList<Read> reads=(ln!=null ? ln.list : null); if(reads!=null && !reads.isEmpty()){ Read r=reads.get(0); assert((ffin1==null ffin1.samOrBam()) (r.mate!=null)==cris.paired()); } while(reads!=null && reads.size()>0){ if(verbose){outstream.println(STR+reads.size()+STR);} for(int idx=0; idx<reads.size(); idx++){ final Read r1=reads.get(idx); final Read r2=r1.mate; final int initialLength1=r1.length(); final int initialLength2=(r1.mateLength()); { readsProcessed++; basesProcessed+=initialLength1; } if(r2!=null){ readsProcessed++; basesProcessed+=initialLength2; } boolean keep=processReadPair(r1, r2); if(!keep){reads.set(idx, null);} } if(ros!=null){ros.add(reads, ln.id);} cris.returnList(ln.id, ln.list.isEmpty()); if(verbose){outstream.println(STR);} ln=cris.nextList(); reads=(ln!=null ? ln.list : null); } if(ln!=null){ cris.returnList(ln.id, ln.list==null ln.list.isEmpty()); } } }
/** Iterate through the reads. * This may optionally be overridden. */
Iterate through the reads
processInner
{ "repo_name": "CruorVolt/mu_bbmap", "path": "src/bbmap/current/jgi/BBTool_ST.java", "license": "apache-2.0", "size": 14746 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
2,369,748
Properties getUserProperties();
Properties getUserProperties();
/** * Gets the user properties to use for interpolation and profile activation. The user properties have been * configured directly by the user on his discretion, e.g. via the {@code -Dkey=value} parameter on the command * line. * * @return The user properties, never {@code null}. */
Gets the user properties to use for interpolation and profile activation. The user properties have been configured directly by the user on his discretion, e.g. via the -Dkey=value parameter on the command line
getUserProperties
{ "repo_name": "vedmishr/demo1", "path": "maven-core/src/main/java/org/apache/maven/project/ProjectBuildingRequest.java", "license": "apache-2.0", "size": 7146 }
[ "java.util.Properties" ]
import java.util.Properties;
import java.util.*;
[ "java.util" ]
java.util;
145,061
public void removeStep(final ProtocolStep protocolStep) { storage.remove(protocolStep); fireStepRemoved(new ProtocolHandlerListenerEvent( this, protocolStep, ProtocolHandlerListenerEvent.PROTOCOL_STEP_REMOVED)); }
void function(final ProtocolStep protocolStep) { storage.remove(protocolStep); fireStepRemoved(new ProtocolHandlerListenerEvent( this, protocolStep, ProtocolHandlerListenerEvent.PROTOCOL_STEP_REMOVED)); }
/** * DOCUMENT ME! * * @param protocolStep DOCUMENT ME! */
DOCUMENT ME
removeStep
{ "repo_name": "cismet/cismet-gui-commons", "path": "src/main/java/de/cismet/commons/gui/protocol/ProtocolHandler.java", "license": "lgpl-3.0", "size": 15059 }
[ "de.cismet.commons.gui.protocol.listener.ProtocolHandlerListenerEvent" ]
import de.cismet.commons.gui.protocol.listener.ProtocolHandlerListenerEvent;
import de.cismet.commons.gui.protocol.listener.*;
[ "de.cismet.commons" ]
de.cismet.commons;
2,330,029
@Test public void testInprogressRecoveryMixed() throws IOException { File f1 = new File(TestEditLog.TEST_DIR + "/mixtest0"); File f2 = new File(TestEditLog.TEST_DIR + "/mixtest1"); File f3 = new File(TestEditLog.TEST_DIR + "/mixtest2"); List<URI> editUris = ImmutableList.of(f1.toURI(), f2.toURI(), f3.toURI()); // abort after the 5th roll NNStorage storage = setupEdits(editUris, 5, new AbortSpec(5, 1)); Iterator<StorageDirectory> dirs = storage.dirIterator(NameNodeDirType.EDITS); StorageDirectory sd = dirs.next(); FileJournalManager jm = new FileJournalManager(conf, sd, storage); assertEquals(6*TXNS_PER_ROLL, getNumberOfTransactions(jm, 1, true, false)); sd = dirs.next(); jm = new FileJournalManager(conf, sd, storage); assertEquals(5*TXNS_PER_ROLL + TXNS_PER_FAIL, getNumberOfTransactions(jm, 1, true, false)); sd = dirs.next(); jm = new FileJournalManager(conf, sd, storage); assertEquals(6*TXNS_PER_ROLL, getNumberOfTransactions(jm, 1, true, false)); }
void function() throws IOException { File f1 = new File(TestEditLog.TEST_DIR + STR); File f2 = new File(TestEditLog.TEST_DIR + STR); File f3 = new File(TestEditLog.TEST_DIR + STR); List<URI> editUris = ImmutableList.of(f1.toURI(), f2.toURI(), f3.toURI()); NNStorage storage = setupEdits(editUris, 5, new AbortSpec(5, 1)); Iterator<StorageDirectory> dirs = storage.dirIterator(NameNodeDirType.EDITS); StorageDirectory sd = dirs.next(); FileJournalManager jm = new FileJournalManager(conf, sd, storage); assertEquals(6*TXNS_PER_ROLL, getNumberOfTransactions(jm, 1, true, false)); sd = dirs.next(); jm = new FileJournalManager(conf, sd, storage); assertEquals(5*TXNS_PER_ROLL + TXNS_PER_FAIL, getNumberOfTransactions(jm, 1, true, false)); sd = dirs.next(); jm = new FileJournalManager(conf, sd, storage); assertEquals(6*TXNS_PER_ROLL, getNumberOfTransactions(jm, 1, true, false)); }
/** * Test a mixture of inprogress files and finalised. Set up 3 edits * directories and fail the second on the last roll. Verify that reading * the transactions, reads from the finalised directories. */
Test a mixture of inprogress files and finalised. Set up 3 edits directories and fail the second on the last roll. Verify that reading the transactions, reads from the finalised directories
testInprogressRecoveryMixed
{ "repo_name": "jonathangizmo/HadoopDistJ", "path": "hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestFileJournalManager.java", "license": "mit", "size": 18689 }
[ "com.google.common.collect.ImmutableList", "java.io.File", "java.io.IOException", "java.util.Iterator", "java.util.List", "org.apache.hadoop.hdfs.server.common.Storage", "org.apache.hadoop.hdfs.server.namenode.NNStorage", "org.apache.hadoop.hdfs.server.namenode.TestEditLog", "org.junit.Assert" ]
import com.google.common.collect.ImmutableList; import java.io.File; import java.io.IOException; import java.util.Iterator; import java.util.List; import org.apache.hadoop.hdfs.server.common.Storage; import org.apache.hadoop.hdfs.server.namenode.NNStorage; import org.apache.hadoop.hdfs.server.namenode.TestEditLog; import org.junit.Assert;
import com.google.common.collect.*; import java.io.*; import java.util.*; import org.apache.hadoop.hdfs.server.common.*; import org.apache.hadoop.hdfs.server.namenode.*; import org.junit.*;
[ "com.google.common", "java.io", "java.util", "org.apache.hadoop", "org.junit" ]
com.google.common; java.io; java.util; org.apache.hadoop; org.junit;
2,244,111
public static List<Tag> getAllTagsOfVersion(String versionHashId) throws AppCloudException { Connection dbConnection = DBUtil.getDBConnection(); int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId(); try { return ApplicationDAO.getInstance().getAllTagsOfVersion(dbConnection, versionHashId, tenantId); } catch (AppCloudException e) { String msg = "Error while getting all tags of version for version with hash id : " + versionHashId + " for tenant id : " + tenantId; log.error(msg, e); throw new AppCloudException(msg, e); } finally { DBUtil.closeConnection(dbConnection); } }
static List<Tag> function(String versionHashId) throws AppCloudException { Connection dbConnection = DBUtil.getDBConnection(); int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId(); try { return ApplicationDAO.getInstance().getAllTagsOfVersion(dbConnection, versionHashId, tenantId); } catch (AppCloudException e) { String msg = STR + versionHashId + STR + tenantId; log.error(msg, e); throw new AppCloudException(msg, e); } finally { DBUtil.closeConnection(dbConnection); } }
/** * Method for getting all tags of version. * * @param versionHashId hash id of version * @return list of tags * @throws AppCloudException */
Method for getting all tags of version
getAllTagsOfVersion
{ "repo_name": "lmanohara/app-cloud", "path": "modules/components/org.wso2.appcloud.core/src/main/java/org/wso2/appcloud/core/ApplicationManager.java", "license": "apache-2.0", "size": 57767 }
[ "java.sql.Connection", "java.util.List", "org.wso2.appcloud.common.AppCloudException", "org.wso2.appcloud.core.dao.ApplicationDAO", "org.wso2.appcloud.core.dto.Tag", "org.wso2.carbon.context.CarbonContext" ]
import java.sql.Connection; import java.util.List; import org.wso2.appcloud.common.AppCloudException; import org.wso2.appcloud.core.dao.ApplicationDAO; import org.wso2.appcloud.core.dto.Tag; import org.wso2.carbon.context.CarbonContext;
import java.sql.*; import java.util.*; import org.wso2.appcloud.common.*; import org.wso2.appcloud.core.dao.*; import org.wso2.appcloud.core.dto.*; import org.wso2.carbon.context.*;
[ "java.sql", "java.util", "org.wso2.appcloud", "org.wso2.carbon" ]
java.sql; java.util; org.wso2.appcloud; org.wso2.carbon;
1,529,653
public double localScore(int i, int... parents) { for (int p : parents) if (forbidden.contains(p)) return Double.NaN; // if (parents.length == 0) return localScore(i); // else if (parents.length == 1) return localScore(i, parents[0]); double residualVariance = covariances.get(i, i); int n = getSampleSize(); int p = parents.length; Matrix covxx = getSelection1(covariances, parents); try { Matrix covxxInv = covxx.inverse(); Matrix covxy = getSelection2(covariances, parents, i); Matrix b = covxxInv.times(covxy); double dot = 0.0; for (int j = 0; j < covxy.getRowDimension(); j++) { for (int k = 0; k < covxy.getColumnDimension(); k++) { dot += covxy.get(j, k) * b.get(j, k); } } residualVariance -= dot; //covxy.dotProduct(b); if (residualVariance <= 0) { if (isVerbose()) { out.println("Nonpositive residual varianceY: resVar / varianceY = " + (residualVariance / covariances.get(i, i))); } return Double.NaN; } double c = getPenaltyDiscount(); return score(residualVariance, n, logn, p, c); } catch (Exception e) { boolean removedOne = true; while (removedOne) { List<Integer> _parents = new ArrayList<>(); for (int y = 0; y < parents.length; y++) _parents.add(parents[y]); _parents.removeAll(forbidden); parents = new int[_parents.size()]; for (int y = 0; y < _parents.size(); y++) parents[y] = _parents.get(y); removedOne = printMinimalLinearlyDependentSet(parents, covariances); } return Double.NaN; } }
double function(int i, int... parents) { for (int p : parents) if (forbidden.contains(p)) return Double.NaN; double residualVariance = covariances.get(i, i); int n = getSampleSize(); int p = parents.length; Matrix covxx = getSelection1(covariances, parents); try { Matrix covxxInv = covxx.inverse(); Matrix covxy = getSelection2(covariances, parents, i); Matrix b = covxxInv.times(covxy); double dot = 0.0; for (int j = 0; j < covxy.getRowDimension(); j++) { for (int k = 0; k < covxy.getColumnDimension(); k++) { dot += covxy.get(j, k) * b.get(j, k); } } residualVariance -= dot; if (residualVariance <= 0) { if (isVerbose()) { out.println(STR + (residualVariance / covariances.get(i, i))); } return Double.NaN; } double c = getPenaltyDiscount(); return score(residualVariance, n, logn, p, c); } catch (Exception e) { boolean removedOne = true; while (removedOne) { List<Integer> _parents = new ArrayList<>(); for (int y = 0; y < parents.length; y++) _parents.add(parents[y]); _parents.removeAll(forbidden); parents = new int[_parents.size()]; for (int y = 0; y < _parents.size(); y++) parents[y] = _parents.get(y); removedOne = printMinimalLinearlyDependentSet(parents, covariances); } return Double.NaN; } }
/** * Calculates the sample likelihood and BIC score for i given its parents in a simple SEM model */
Calculates the sample likelihood and BIC score for i given its parents in a simple SEM model
localScore
{ "repo_name": "ajsedgewick/tetrad", "path": "tetrad-lib/src/main/java/edu/cmu/tetrad/search/SemBicScore2.java", "license": "gpl-2.0", "size": 11311 }
[ "java.util.ArrayList", "java.util.List" ]
import java.util.ArrayList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,508,130
public static void writeNameSpace(XMLStreamWriter writer, String prefix, String ns) throws ProcessingException { try { writer.writeNamespace(prefix, ns); } catch (XMLStreamException e) { throw logger.processingError(e); } }
static void function(XMLStreamWriter writer, String prefix, String ns) throws ProcessingException { try { writer.writeNamespace(prefix, ns); } catch (XMLStreamException e) { throw logger.processingError(e); } }
/** * Write a namespace * * @param writer * @param prefix prefix * @param ns Namespace URI * * @throws ProcessingException */
Write a namespace
writeNameSpace
{ "repo_name": "mbaluch/keycloak", "path": "saml-core/src/main/java/org/keycloak/saml/common/util/StaxUtil.java", "license": "apache-2.0", "size": 13791 }
[ "javax.xml.stream.XMLStreamException", "javax.xml.stream.XMLStreamWriter", "org.keycloak.saml.common.exceptions.ProcessingException" ]
import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; import org.keycloak.saml.common.exceptions.ProcessingException;
import javax.xml.stream.*; import org.keycloak.saml.common.exceptions.*;
[ "javax.xml", "org.keycloak.saml" ]
javax.xml; org.keycloak.saml;
1,598,981
@Override protected void process(final ClusterDistributionManager dm) { final long startTime = getTimestamp(); if (logger.isTraceEnabled(LogMarker.DM_VERBOSE)) { logger.trace(LogMarker.DM_VERBOSE, "InterestEventReplyMessage process invoking reply processor with processorId: {}", this.processorId); } try { ReplyProcessor21 processor = ReplyProcessor21.getProcessor(this.processorId); if (processor == null) { if (logger.isTraceEnabled(LogMarker.DM_VERBOSE)) { logger.trace(LogMarker.DM_VERBOSE, "InterestEventReplyMessage processor not found"); } return; } processor.process(this); if (logger.isTraceEnabled(LogMarker.DM_VERBOSE)) { logger.trace("{} processed {}", processor, this); } } finally { dm.getStats().incReplyMessageTime(DistributionStats.getStatTime() - startTime); } }
void function(final ClusterDistributionManager dm) { final long startTime = getTimestamp(); if (logger.isTraceEnabled(LogMarker.DM_VERBOSE)) { logger.trace(LogMarker.DM_VERBOSE, STR, this.processorId); } try { ReplyProcessor21 processor = ReplyProcessor21.getProcessor(this.processorId); if (processor == null) { if (logger.isTraceEnabled(LogMarker.DM_VERBOSE)) { logger.trace(LogMarker.DM_VERBOSE, STR); } return; } processor.process(this); if (logger.isTraceEnabled(LogMarker.DM_VERBOSE)) { logger.trace(STR, processor, this); } } finally { dm.getStats().incReplyMessageTime(DistributionStats.getStatTime() - startTime); } }
/** * Processes this message. This method is invoked by the receiver of the message. * * @param dm the distribution manager that is processing the message. */
Processes this message. This method is invoked by the receiver of the message
process
{ "repo_name": "PurelyApplied/geode", "path": "geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/InterestEventMessage.java", "license": "apache-2.0", "size": 9334 }
[ "org.apache.geode.distributed.internal.ClusterDistributionManager", "org.apache.geode.distributed.internal.DistributionStats", "org.apache.geode.distributed.internal.ReplyProcessor21", "org.apache.geode.internal.logging.log4j.LogMarker" ]
import org.apache.geode.distributed.internal.ClusterDistributionManager; import org.apache.geode.distributed.internal.DistributionStats; import org.apache.geode.distributed.internal.ReplyProcessor21; import org.apache.geode.internal.logging.log4j.LogMarker;
import org.apache.geode.distributed.internal.*; import org.apache.geode.internal.logging.log4j.*;
[ "org.apache.geode" ]
org.apache.geode;
2,850,115
public void setAnnotationgraphicsHLAPI( AnnotationGraphicsHLAPI elem){ if(elem!=null) item.setAnnotationgraphics((AnnotationGraphics)elem.getContainedItem()); }
void function( AnnotationGraphicsHLAPI elem){ if(elem!=null) item.setAnnotationgraphics((AnnotationGraphics)elem.getContainedItem()); }
/** * set Annotationgraphics */
set Annotationgraphics
setAnnotationgraphicsHLAPI
{ "repo_name": "lhillah/pnmlframework", "path": "pnmlFw-SNNet/src/fr/lip6/move/pnml/symmetricnet/hlcorestructure/hlapi/HLAnnotationHLAPI.java", "license": "epl-1.0", "size": 18811 }
[ "fr.lip6.move.pnml.symmetricnet.hlcorestructure.AnnotationGraphics" ]
import fr.lip6.move.pnml.symmetricnet.hlcorestructure.AnnotationGraphics;
import fr.lip6.move.pnml.symmetricnet.hlcorestructure.*;
[ "fr.lip6.move" ]
fr.lip6.move;
1,228,033
private final String generateSessionKey() { try { return RandomUuidFactory.getInstance().createSessionID(); }catch (Exception err) { throw new KingRunTimeException( err); } }
final String function() { try { return RandomUuidFactory.getInstance().createSessionID(); }catch (Exception err) { throw new KingRunTimeException( err); } }
/** * Private method that generates a kinguserId * * @param intKingUserId * @return */
Private method that generates a kinguserId
generateSessionKey
{ "repo_name": "eidos71/kingchallenge", "path": "src/main/java/org/eidos/kingchallenge/domain/model/KingUser.java", "license": "apache-2.0", "size": 3609 }
[ "org.eidos.kingchallenge.exceptions.KingRunTimeException", "org.eidos.kingchallenge.utils.RandomUuidFactory" ]
import org.eidos.kingchallenge.exceptions.KingRunTimeException; import org.eidos.kingchallenge.utils.RandomUuidFactory;
import org.eidos.kingchallenge.exceptions.*; import org.eidos.kingchallenge.utils.*;
[ "org.eidos.kingchallenge" ]
org.eidos.kingchallenge;
1,372,974
@ServiceMethod(returns = ReturnType.SINGLE) Mono<Response<AzureMonitorPrivateLinkScopeInner>> getByResourceGroupWithResponseAsync( String resourceGroupName, String scopeName);
@ServiceMethod(returns = ReturnType.SINGLE) Mono<Response<AzureMonitorPrivateLinkScopeInner>> getByResourceGroupWithResponseAsync( String resourceGroupName, String scopeName);
/** * Returns a Azure Monitor PrivateLinkScope. * * @param resourceGroupName The name of the resource group. * @param scopeName The name of the Azure Monitor PrivateLinkScope resource. * @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 an Azure Monitor PrivateLinkScope definition. */
Returns a Azure Monitor PrivateLinkScope
getByResourceGroupWithResponseAsync
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/resourcemanagerhybrid/azure-resourcemanager-monitor/src/main/java/com/azure/resourcemanager/monitor/fluent/PrivateLinkScopesClient.java", "license": "mit", "size": 22062 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.Response", "com.azure.resourcemanager.monitor.fluent.models.AzureMonitorPrivateLinkScopeInner" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.resourcemanager.monitor.fluent.models.AzureMonitorPrivateLinkScopeInner;
import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.resourcemanager.monitor.fluent.models.*;
[ "com.azure.core", "com.azure.resourcemanager" ]
com.azure.core; com.azure.resourcemanager;
1,922,980
private String requestType(Request<?> req) { return req.getOriginalRequest().getClass().getSimpleName(); }
String function(Request<?> req) { return req.getOriginalRequest().getClass().getSimpleName(); }
/** * Returns the name of the type of request. */
Returns the name of the type of request
requestType
{ "repo_name": "dagnir/aws-sdk-java", "path": "aws-java-sdk-cloudwatchmetrics/src/main/java/com/amazonaws/metrics/internal/cloudwatch/provider/transform/DynamoDBRequestMetricTransformer.java", "license": "apache-2.0", "size": 4949 }
[ "com.amazonaws.Request" ]
import com.amazonaws.Request;
import com.amazonaws.*;
[ "com.amazonaws" ]
com.amazonaws;
1,611,974
public Observable<ServiceResponse<Void>> beginRevokeAccessWithServiceResponseAsync(String resourceGroupName, String diskName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (diskName == null) { throw new IllegalArgumentException("Parameter diskName is required and cannot be null."); }
Observable<ServiceResponse<Void>> function(String resourceGroupName, String diskName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException(STR); } if (resourceGroupName == null) { throw new IllegalArgumentException(STR); } if (diskName == null) { throw new IllegalArgumentException(STR); }
/** * Revokes access to a disk. * * @param resourceGroupName The name of the resource group. * @param diskName The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80 characters. * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceResponse} object if successful. */
Revokes access to a disk
beginRevokeAccessWithServiceResponseAsync
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/compute/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/compute/v2020_06_01/implementation/DisksInner.java", "license": "mit", "size": 88768 }
[ "com.microsoft.rest.ServiceResponse" ]
import com.microsoft.rest.ServiceResponse;
import com.microsoft.rest.*;
[ "com.microsoft.rest" ]
com.microsoft.rest;
1,622,528
public SessionFactory getSessionFactory() { return sessionFactory; }
SessionFactory function() { return sessionFactory; }
/** * Returns the current active session factory for injecting to DAOs. *` * @return {@link SessionFactory} with an open session. */
Returns the current active session factory for injecting to DAOs. `
getSessionFactory
{ "repo_name": "tjcutajar/dropwizard", "path": "dropwizard-testing/src/main/java/io/dropwizard/testing/common/DAOTest.java", "license": "apache-2.0", "size": 6270 }
[ "org.hibernate.SessionFactory" ]
import org.hibernate.SessionFactory;
import org.hibernate.*;
[ "org.hibernate" ]
org.hibernate;
2,729,558
private void export202( XMLStreamWriter writer, Transaction transaction, MetadataStore<?> store ) throws OWSException, XMLStreamException, MetadataStoreException { Version version = new Version( 2, 0, 2 ); int insertCount = 0; int updateCount = 0; int deleteCount = 0; writer.setDefaultNamespace( CSW_202_NS ); writer.writeStartElement( CSW_202_NS, "TransactionResponse" ); writer.writeDefaultNamespace( CSW_202_NS ); writer.writeAttribute( "version", version.toString() ); writer.writeStartElement( CSW_202_NS, "TransactionSummary" ); if ( transaction.getRequestId() != null ) { writer.writeAttribute( "requestId", transaction.getRequestId() ); } MetadataStoreTransaction ta = store.acquireTransaction(); List<String> insertHandles = new ArrayList<String>(); List<List<String>> insertIds = new ArrayList<List<String>>(); String currentHandle = null; try { for ( TransactionOperation transact : transaction.getOperations() ) { currentHandle = transact.getHandle(); switch ( transact.getType() ) { case INSERT: List<String> ids = doInsert( ta, (InsertOperation) transact ); insertHandles.add( transact.getHandle() ); insertIds.add( ids ); insertCount += ids.size(); break; case UPDATE: updateCount = doUpdate( ta, (UpdateOperation) transact ); break; case DELETE: deleteCount = doDelete( ta, (DeleteOperation) transact ); break; } } ta.commit(); } catch ( Throwable e ) { ta.rollback(); if ( currentHandle != null ) { String msg = "Transaction operation '" + currentHandle + "' failed: " + e.getMessage(); throw new OWSException( msg, OWSException.NO_APPLICABLE_CODE ); } throw new OWSException( e.getMessage(), e, OWSException.NO_APPLICABLE_CODE ); } writer.writeStartElement( CSW_202_NS, "totalInserted" ); writer.writeCharacters( Integer.toString( insertCount ) ); writer.writeEndElement();// totalInserted writer.writeStartElement( CSW_202_NS, "totalUpdated" ); writer.writeCharacters( Integer.toString( updateCount ) ); writer.writeEndElement();// totalUpdated writer.writeStartElement( CSW_202_NS, "totalDeleted" ); writer.writeCharacters( Integer.toString( deleteCount ) ); writer.writeEndElement();// totalDeleted writer.writeEndElement();// TransactionSummary if ( insertCount > 0 ) { for ( int i = 0; i < insertHandles.size(); i++ ) { String handle = insertHandles.get( i ); List<String> ids = insertIds.get( i ); writer.writeStartElement( CSW_202_NS, "InsertResult" ); if ( handle != null ) { writer.writeAttribute( "handleRef", handle ); } MetadataResultSet<?> rs = store.getRecordById( ids, null ); try { while ( rs.next() ) { DCRecord dc = rs.getRecord().toDublinCore(); dc.serialize( writer, ReturnableElement.brief ); } } finally { if ( rs != null ) { rs.close(); } } writer.writeEndElement();// InsertResult } } writer.writeEndElement();// TransactionResponse writer.writeEndDocument(); }
void function( XMLStreamWriter writer, Transaction transaction, MetadataStore<?> store ) throws OWSException, XMLStreamException, MetadataStoreException { Version version = new Version( 2, 0, 2 ); int insertCount = 0; int updateCount = 0; int deleteCount = 0; writer.setDefaultNamespace( CSW_202_NS ); writer.writeStartElement( CSW_202_NS, STR ); writer.writeDefaultNamespace( CSW_202_NS ); writer.writeAttribute( STR, version.toString() ); writer.writeStartElement( CSW_202_NS, STR ); if ( transaction.getRequestId() != null ) { writer.writeAttribute( STR, transaction.getRequestId() ); } MetadataStoreTransaction ta = store.acquireTransaction(); List<String> insertHandles = new ArrayList<String>(); List<List<String>> insertIds = new ArrayList<List<String>>(); String currentHandle = null; try { for ( TransactionOperation transact : transaction.getOperations() ) { currentHandle = transact.getHandle(); switch ( transact.getType() ) { case INSERT: List<String> ids = doInsert( ta, (InsertOperation) transact ); insertHandles.add( transact.getHandle() ); insertIds.add( ids ); insertCount += ids.size(); break; case UPDATE: updateCount = doUpdate( ta, (UpdateOperation) transact ); break; case DELETE: deleteCount = doDelete( ta, (DeleteOperation) transact ); break; } } ta.commit(); } catch ( Throwable e ) { ta.rollback(); if ( currentHandle != null ) { String msg = STR + currentHandle + STR + e.getMessage(); throw new OWSException( msg, OWSException.NO_APPLICABLE_CODE ); } throw new OWSException( e.getMessage(), e, OWSException.NO_APPLICABLE_CODE ); } writer.writeStartElement( CSW_202_NS, STR ); writer.writeCharacters( Integer.toString( insertCount ) ); writer.writeEndElement(); writer.writeStartElement( CSW_202_NS, STR ); writer.writeCharacters( Integer.toString( updateCount ) ); writer.writeEndElement(); writer.writeStartElement( CSW_202_NS, STR ); writer.writeCharacters( Integer.toString( deleteCount ) ); writer.writeEndElement(); writer.writeEndElement(); if ( insertCount > 0 ) { for ( int i = 0; i < insertHandles.size(); i++ ) { String handle = insertHandles.get( i ); List<String> ids = insertIds.get( i ); writer.writeStartElement( CSW_202_NS, STR ); if ( handle != null ) { writer.writeAttribute( STR, handle ); } MetadataResultSet<?> rs = store.getRecordById( ids, null ); try { while ( rs.next() ) { DCRecord dc = rs.getRecord().toDublinCore(); dc.serialize( writer, ReturnableElement.brief ); } } finally { if ( rs != null ) { rs.close(); } } writer.writeEndElement(); } } writer.writeEndElement(); writer.writeEndDocument(); }
/** * Exporthandling for the version 2.0.2. <br> * Here it is determined which of the transaction actions are handled. First there is the handling with the * database. After that in the case of the INSERT action the output should generate a brief representation of the * inserted records. * * @param writer * @param transaction * request * @throws XMLStreamException * @throws OWSException * @throws MetadataStoreException */
Exporthandling for the version 2.0.2. Here it is determined which of the transaction actions are handled. First there is the handling with the database. After that in the case of the INSERT action the output should generate a brief representation of the inserted records
export202
{ "repo_name": "deegree/deegree3", "path": "deegree-services/deegree-services-csw/src/main/java/org/deegree/services/csw/exporthandling/TransactionHandler.java", "license": "lgpl-2.1", "size": 11491 }
[ "java.util.ArrayList", "java.util.List", "javax.xml.stream.XMLStreamException", "javax.xml.stream.XMLStreamWriter", "org.deegree.commons.ows.exception.OWSException", "org.deegree.commons.tom.ows.Version", "org.deegree.metadata.DCRecord", "org.deegree.metadata.persistence.MetadataResultSet", "org.deegree.metadata.persistence.MetadataStore", "org.deegree.metadata.persistence.MetadataStoreTransaction", "org.deegree.metadata.persistence.transaction.DeleteOperation", "org.deegree.metadata.persistence.transaction.InsertOperation", "org.deegree.metadata.persistence.transaction.TransactionOperation", "org.deegree.metadata.persistence.transaction.UpdateOperation", "org.deegree.protocol.csw.CSWConstants", "org.deegree.protocol.csw.MetadataStoreException", "org.deegree.services.csw.transaction.Transaction" ]
import java.util.ArrayList; import java.util.List; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; import org.deegree.commons.ows.exception.OWSException; import org.deegree.commons.tom.ows.Version; import org.deegree.metadata.DCRecord; import org.deegree.metadata.persistence.MetadataResultSet; import org.deegree.metadata.persistence.MetadataStore; import org.deegree.metadata.persistence.MetadataStoreTransaction; import org.deegree.metadata.persistence.transaction.DeleteOperation; import org.deegree.metadata.persistence.transaction.InsertOperation; import org.deegree.metadata.persistence.transaction.TransactionOperation; import org.deegree.metadata.persistence.transaction.UpdateOperation; import org.deegree.protocol.csw.CSWConstants; import org.deegree.protocol.csw.MetadataStoreException; import org.deegree.services.csw.transaction.Transaction;
import java.util.*; import javax.xml.stream.*; import org.deegree.commons.ows.exception.*; import org.deegree.commons.tom.ows.*; import org.deegree.metadata.*; import org.deegree.metadata.persistence.*; import org.deegree.metadata.persistence.transaction.*; import org.deegree.protocol.csw.*; import org.deegree.services.csw.transaction.*;
[ "java.util", "javax.xml", "org.deegree.commons", "org.deegree.metadata", "org.deegree.protocol", "org.deegree.services" ]
java.util; javax.xml; org.deegree.commons; org.deegree.metadata; org.deegree.protocol; org.deegree.services;
2,086,155
@CallSuper protected void integerElement(int id, long value) throws ParserException { switch (id) { case ID_EBML_READ_VERSION: // Validate that EBMLReadVersion is supported. This extractor only supports v1. if (value != 1) { throw new ParserException("EBMLReadVersion " + value + " not supported"); } break; case ID_DOC_TYPE_READ_VERSION: // Validate that DocTypeReadVersion is supported. This extractor only supports up to v2. if (value < 1 || value > 2) { throw new ParserException("DocTypeReadVersion " + value + " not supported"); } break; case ID_SEEK_POSITION: // Seek Position is the relative offset beginning from the Segment. So to get absolute // offset from the beginning of the file, we need to add segmentContentPosition to it. seekEntryPosition = value + segmentContentPosition; break; case ID_TIMECODE_SCALE: timecodeScale = value; break; case ID_PIXEL_WIDTH: currentTrack.width = (int) value; break; case ID_PIXEL_HEIGHT: currentTrack.height = (int) value; break; case ID_DISPLAY_WIDTH: currentTrack.displayWidth = (int) value; break; case ID_DISPLAY_HEIGHT: currentTrack.displayHeight = (int) value; break; case ID_DISPLAY_UNIT: currentTrack.displayUnit = (int) value; break; case ID_TRACK_NUMBER: currentTrack.number = (int) value; break; case ID_FLAG_DEFAULT: currentTrack.flagDefault = value == 1; break; case ID_FLAG_FORCED: currentTrack.flagForced = value == 1; break; case ID_TRACK_TYPE: currentTrack.type = (int) value; break; case ID_DEFAULT_DURATION: currentTrack.defaultSampleDurationNs = (int) value; break; case ID_MAX_BLOCK_ADDITION_ID: currentTrack.maxBlockAdditionId = (int) value; break; case ID_CODEC_DELAY: currentTrack.codecDelayNs = value; break; case ID_SEEK_PRE_ROLL: currentTrack.seekPreRollNs = value; break; case ID_CHANNELS: currentTrack.channelCount = (int) value; break; case ID_AUDIO_BIT_DEPTH: currentTrack.audioBitDepth = (int) value; break; case ID_REFERENCE_BLOCK: blockHasReferenceBlock = true; break; case ID_CONTENT_ENCODING_ORDER: // This extractor only supports one ContentEncoding element and hence the order has to be 0. if (value != 0) { throw new ParserException("ContentEncodingOrder " + value + " not supported"); } break; case ID_CONTENT_ENCODING_SCOPE: // This extractor only supports the scope of all frames. if (value != 1) { throw new ParserException("ContentEncodingScope " + value + " not supported"); } break; case ID_CONTENT_COMPRESSION_ALGORITHM: // This extractor only supports header stripping. if (value != 3) { throw new ParserException("ContentCompAlgo " + value + " not supported"); } break; case ID_CONTENT_ENCRYPTION_ALGORITHM: // Only the value 5 (AES) is allowed according to the WebM specification. if (value != 5) { throw new ParserException("ContentEncAlgo " + value + " not supported"); } break; case ID_CONTENT_ENCRYPTION_AES_SETTINGS_CIPHER_MODE: // Only the value 1 is allowed according to the WebM specification. if (value != 1) { throw new ParserException("AESSettingsCipherMode " + value + " not supported"); } break; case ID_CUE_TIME: cueTimesUs.add(scaleTimecodeToUs(value)); break; case ID_CUE_CLUSTER_POSITION: if (!seenClusterPositionForCurrentCuePoint) { // If there's more than one video/audio track, then there could be more than one // CueTrackPositions within a single CuePoint. In such a case, ignore all but the first // one (since the cluster position will be quite close for all the tracks). cueClusterPositions.add(value); seenClusterPositionForCurrentCuePoint = true; } break; case ID_TIME_CODE: clusterTimecodeUs = scaleTimecodeToUs(value); break; case ID_BLOCK_DURATION: blockDurationUs = scaleTimecodeToUs(value); break; case ID_STEREO_MODE: int layout = (int) value; switch (layout) { case 0: currentTrack.stereoMode = C.STEREO_MODE_MONO; break; case 1: currentTrack.stereoMode = C.STEREO_MODE_LEFT_RIGHT; break; case 3: currentTrack.stereoMode = C.STEREO_MODE_TOP_BOTTOM; break; case 15: currentTrack.stereoMode = C.STEREO_MODE_STEREO_MESH; break; default: break; } break; case ID_COLOUR_PRIMARIES: currentTrack.hasColorInfo = true; switch ((int) value) { case 1: currentTrack.colorSpace = C.COLOR_SPACE_BT709; break; case 4: // BT.470M. case 5: // BT.470BG. case 6: // SMPTE 170M. case 7: // SMPTE 240M. currentTrack.colorSpace = C.COLOR_SPACE_BT601; break; case 9: currentTrack.colorSpace = C.COLOR_SPACE_BT2020; break; default: break; } break; case ID_COLOUR_TRANSFER: switch ((int) value) { case 1: // BT.709. case 6: // SMPTE 170M. case 7: // SMPTE 240M. currentTrack.colorTransfer = C.COLOR_TRANSFER_SDR; break; case 16: currentTrack.colorTransfer = C.COLOR_TRANSFER_ST2084; break; case 18: currentTrack.colorTransfer = C.COLOR_TRANSFER_HLG; break; default: break; } break; case ID_COLOUR_RANGE: switch((int) value) { case 1: // Broadcast range. currentTrack.colorRange = C.COLOR_RANGE_LIMITED; break; case 2: currentTrack.colorRange = C.COLOR_RANGE_FULL; break; default: break; } break; case ID_MAX_CLL: currentTrack.maxContentLuminance = (int) value; break; case ID_MAX_FALL: currentTrack.maxFrameAverageLuminance = (int) value; break; case ID_PROJECTION_TYPE: switch ((int) value) { case 0: currentTrack.projectionType = C.PROJECTION_RECTANGULAR; break; case 1: currentTrack.projectionType = C.PROJECTION_EQUIRECTANGULAR; break; case 2: currentTrack.projectionType = C.PROJECTION_CUBEMAP; break; case 3: currentTrack.projectionType = C.PROJECTION_MESH; break; default: break; } break; case ID_BLOCK_ADD_ID: blockAdditionalId = (int) value; break; default: break; } }
void function(int id, long value) throws ParserException { switch (id) { case ID_EBML_READ_VERSION: if (value != 1) { throw new ParserException(STR + value + STR); } break; case ID_DOC_TYPE_READ_VERSION: if (value < 1 value > 2) { throw new ParserException(STR + value + STR); } break; case ID_SEEK_POSITION: seekEntryPosition = value + segmentContentPosition; break; case ID_TIMECODE_SCALE: timecodeScale = value; break; case ID_PIXEL_WIDTH: currentTrack.width = (int) value; break; case ID_PIXEL_HEIGHT: currentTrack.height = (int) value; break; case ID_DISPLAY_WIDTH: currentTrack.displayWidth = (int) value; break; case ID_DISPLAY_HEIGHT: currentTrack.displayHeight = (int) value; break; case ID_DISPLAY_UNIT: currentTrack.displayUnit = (int) value; break; case ID_TRACK_NUMBER: currentTrack.number = (int) value; break; case ID_FLAG_DEFAULT: currentTrack.flagDefault = value == 1; break; case ID_FLAG_FORCED: currentTrack.flagForced = value == 1; break; case ID_TRACK_TYPE: currentTrack.type = (int) value; break; case ID_DEFAULT_DURATION: currentTrack.defaultSampleDurationNs = (int) value; break; case ID_MAX_BLOCK_ADDITION_ID: currentTrack.maxBlockAdditionId = (int) value; break; case ID_CODEC_DELAY: currentTrack.codecDelayNs = value; break; case ID_SEEK_PRE_ROLL: currentTrack.seekPreRollNs = value; break; case ID_CHANNELS: currentTrack.channelCount = (int) value; break; case ID_AUDIO_BIT_DEPTH: currentTrack.audioBitDepth = (int) value; break; case ID_REFERENCE_BLOCK: blockHasReferenceBlock = true; break; case ID_CONTENT_ENCODING_ORDER: if (value != 0) { throw new ParserException(STR + value + STR); } break; case ID_CONTENT_ENCODING_SCOPE: if (value != 1) { throw new ParserException(STR + value + STR); } break; case ID_CONTENT_COMPRESSION_ALGORITHM: if (value != 3) { throw new ParserException(STR + value + STR); } break; case ID_CONTENT_ENCRYPTION_ALGORITHM: if (value != 5) { throw new ParserException(STR + value + STR); } break; case ID_CONTENT_ENCRYPTION_AES_SETTINGS_CIPHER_MODE: if (value != 1) { throw new ParserException(STR + value + STR); } break; case ID_CUE_TIME: cueTimesUs.add(scaleTimecodeToUs(value)); break; case ID_CUE_CLUSTER_POSITION: if (!seenClusterPositionForCurrentCuePoint) { cueClusterPositions.add(value); seenClusterPositionForCurrentCuePoint = true; } break; case ID_TIME_CODE: clusterTimecodeUs = scaleTimecodeToUs(value); break; case ID_BLOCK_DURATION: blockDurationUs = scaleTimecodeToUs(value); break; case ID_STEREO_MODE: int layout = (int) value; switch (layout) { case 0: currentTrack.stereoMode = C.STEREO_MODE_MONO; break; case 1: currentTrack.stereoMode = C.STEREO_MODE_LEFT_RIGHT; break; case 3: currentTrack.stereoMode = C.STEREO_MODE_TOP_BOTTOM; break; case 15: currentTrack.stereoMode = C.STEREO_MODE_STEREO_MESH; break; default: break; } break; case ID_COLOUR_PRIMARIES: currentTrack.hasColorInfo = true; switch ((int) value) { case 1: currentTrack.colorSpace = C.COLOR_SPACE_BT709; break; case 4: case 5: case 6: case 7: currentTrack.colorSpace = C.COLOR_SPACE_BT601; break; case 9: currentTrack.colorSpace = C.COLOR_SPACE_BT2020; break; default: break; } break; case ID_COLOUR_TRANSFER: switch ((int) value) { case 1: case 6: case 7: currentTrack.colorTransfer = C.COLOR_TRANSFER_SDR; break; case 16: currentTrack.colorTransfer = C.COLOR_TRANSFER_ST2084; break; case 18: currentTrack.colorTransfer = C.COLOR_TRANSFER_HLG; break; default: break; } break; case ID_COLOUR_RANGE: switch((int) value) { case 1: currentTrack.colorRange = C.COLOR_RANGE_LIMITED; break; case 2: currentTrack.colorRange = C.COLOR_RANGE_FULL; break; default: break; } break; case ID_MAX_CLL: currentTrack.maxContentLuminance = (int) value; break; case ID_MAX_FALL: currentTrack.maxFrameAverageLuminance = (int) value; break; case ID_PROJECTION_TYPE: switch ((int) value) { case 0: currentTrack.projectionType = C.PROJECTION_RECTANGULAR; break; case 1: currentTrack.projectionType = C.PROJECTION_EQUIRECTANGULAR; break; case 2: currentTrack.projectionType = C.PROJECTION_CUBEMAP; break; case 3: currentTrack.projectionType = C.PROJECTION_MESH; break; default: break; } break; case ID_BLOCK_ADD_ID: blockAdditionalId = (int) value; break; default: break; } }
/** * Called when an integer element is encountered. * * @see EbmlProcessor#integerElement(int, long) */
Called when an integer element is encountered
integerElement
{ "repo_name": "tkpb/Telegram", "path": "TMessagesProj/src/main/java/com/google/android/exoplayer2/extractor/mkv/MatroskaExtractor.java", "license": "gpl-2.0", "size": 94252 }
[ "com.google.android.exoplayer2.ParserException" ]
import com.google.android.exoplayer2.ParserException;
import com.google.android.exoplayer2.*;
[ "com.google.android" ]
com.google.android;
884,847
public void setRawObject(@Nonnull final ISerializer serializer, @Nonnull final JsonObject json) { if (json.has("groups")) { groups = serializer.deserializeObject(json.get("groups"), ExternalGroupCollectionPage.class); } if (json.has("items")) { items = serializer.deserializeObject(json.get("items"), ExternalItemCollectionPage.class); } if (json.has("operations")) { operations = serializer.deserializeObject(json.get("operations"), ConnectionOperationCollectionPage.class); } }
void function(@Nonnull final ISerializer serializer, @Nonnull final JsonObject json) { if (json.has(STR)) { groups = serializer.deserializeObject(json.get(STR), ExternalGroupCollectionPage.class); } if (json.has("items")) { items = serializer.deserializeObject(json.get("items"), ExternalItemCollectionPage.class); } if (json.has(STR)) { operations = serializer.deserializeObject(json.get(STR), ConnectionOperationCollectionPage.class); } }
/** * 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/externalconnectors/models/ExternalConnection.java", "license": "mit", "size": 4437 }
[ "com.google.gson.JsonObject", "com.microsoft.graph.externalconnectors.requests.ConnectionOperationCollectionPage", "com.microsoft.graph.externalconnectors.requests.ExternalGroupCollectionPage", "com.microsoft.graph.externalconnectors.requests.ExternalItemCollectionPage", "com.microsoft.graph.serializer.ISerializer", "javax.annotation.Nonnull" ]
import com.google.gson.JsonObject; import com.microsoft.graph.externalconnectors.requests.ConnectionOperationCollectionPage; import com.microsoft.graph.externalconnectors.requests.ExternalGroupCollectionPage; import com.microsoft.graph.externalconnectors.requests.ExternalItemCollectionPage; import com.microsoft.graph.serializer.ISerializer; import javax.annotation.Nonnull;
import com.google.gson.*; import com.microsoft.graph.externalconnectors.requests.*; import com.microsoft.graph.serializer.*; import javax.annotation.*;
[ "com.google.gson", "com.microsoft.graph", "javax.annotation" ]
com.google.gson; com.microsoft.graph; javax.annotation;
1,438,022
ContentValues getContentValues();
ContentValues getContentValues();
/** * Gets content values to be saved to DB * * @return content values */
Gets content values to be saved to DB
getContentValues
{ "repo_name": "doodeec/wedr", "path": "mobile/src/main/java/com/doodeec/weather/android/database/model/IDatabaseSavable.java", "license": "mit", "size": 941 }
[ "android.content.ContentValues" ]
import android.content.ContentValues;
import android.content.*;
[ "android.content" ]
android.content;
340,379
public void writeLong(long val) throws IOException { write((int) (val >>> 56) & 0xFF); write((int) (val >>> 48) & 0xFF); write((int) (val >>> 40) & 0xFF); write((int) (val >>> 32) & 0xFF); write((int) (val >>> 24) & 0xFF); write((int) (val >>> 16) & 0xFF); write((int) (val >>> 8) & 0xFF); write((int) (val >>> 0) & 0xFF); }
void function(long val) throws IOException { write((int) (val >>> 56) & 0xFF); write((int) (val >>> 48) & 0xFF); write((int) (val >>> 40) & 0xFF); write((int) (val >>> 32) & 0xFF); write((int) (val >>> 24) & 0xFF); write((int) (val >>> 16) & 0xFF); write((int) (val >>> 8) & 0xFF); write((int) (val >>> 0) & 0xFF); }
/** * Writes a 64-bit long to this output stream. The resulting output is the 8 * bytes, highest order first, of val. * * @param val the long to be written. * @throws IOException If an error occurs attempting to write to this * DataOutputStream. */
Writes a 64-bit long to this output stream. The resulting output is the 8 bytes, highest order first, of val
writeLong
{ "repo_name": "belliottsmith/cassandra", "path": "src/java/org/apache/cassandra/io/util/UnbufferedDataOutputStreamPlus.java", "license": "apache-2.0", "size": 13017 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,450,210
public MultipartFile getFile() { return file; }
MultipartFile function() { return file; }
/** * <<Transient>> Convenience property to hold uploaded data. */
> Convenience property to hold uploaded data
getFile
{ "repo_name": "iservport/helianto", "path": "helianto-partner/src/main/java/org/helianto/partner/domain/PartnerCategory.java", "license": "apache-2.0", "size": 6459 }
[ "org.springframework.web.multipart.MultipartFile" ]
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.*;
[ "org.springframework.web" ]
org.springframework.web;
2,695,010
public List<Floor> getFloors() { return floors; }
List<Floor> function() { return floors; }
/** * Returns the list of all floors * contained in this tile. * * @return * List of all floors in this tile. */
Returns the list of all floors contained in this tile
getFloors
{ "repo_name": "vlabatut/totalboumboum", "path": "src/org/totalboumboum/engine/container/tile/Tile.java", "license": "gpl-2.0", "size": 25465 }
[ "java.util.List", "org.totalboumboum.engine.content.sprite.floor.Floor" ]
import java.util.List; import org.totalboumboum.engine.content.sprite.floor.Floor;
import java.util.*; import org.totalboumboum.engine.content.sprite.floor.*;
[ "java.util", "org.totalboumboum.engine" ]
java.util; org.totalboumboum.engine;
369,921