code stringlengths 10 174k | nl stringlengths 3 129k |
|---|---|
public boolean isCumulative(){
return cumulative;
}
| Check if sum has to be cumulative. |
private IsEquivalent(final Collection<T> lhs){
this.lhs=lhs;
}
| Creates a new IsEquivalent matcher. |
public boolean fullScroll(int direction){
boolean moved=false;
if (direction == FOCUS_UP) {
int position=lookForSelectablePosition(0,true);
if (position >= 0) {
mLayoutMode=LAYOUT_FORCE_TOP;
invokeOnItemScrollListener();
moved=true;
}
}
else if (direction == FOCUS_DOWN) {
int ... | Go to the last or first item if possible (not worrying about panning across or navigating within the internal focus of the currently selected item.) |
public String toString(){
StringBuffer buffer=new StringBuffer();
buffer.append(Constants.INDENT);
buffer.append("hashAlg: ");
buffer.append(hashAlg);
buffer.append(Constants.NEWLINE);
buffer.append(Constants.INDENT);
buffer.append("mgf: ");
buffer.append(mgf);
buffer.append(Constants.NEWLINE);
buff... | Returns the string representation of CK_RSA_PKCS_OAEP_PARAMS. |
protected void assertEqualDocuments(final String actual,final String expected){
try {
JsonApiDocument expectedDoc=jsonApiMapper.readJsonApiDocument(expected);
JsonApiDocument actualDoc=jsonApiMapper.readJsonApiDocument(actual);
assertEquals(actualDoc,expectedDoc,"\n" + actual + "\n"+ expected+ "\n");
}
... | Assert equal documents. |
protected GphotoEntry(BaseEntry<?> sourceEntry){
super(sourceEntry);
this.delegate=new GphotoDataImpl(this);
}
| Constructs a new entry instance using the source for a shallow copy. |
public void resetOriginals(){
mStartingStartTrim=0;
mStartingEndTrim=0;
mStartingRotation=0;
setStartTrim(0);
setEndTrim(0);
setRotation(0);
}
| Reset the progress spinner to default rotation, start and end angles. |
public void postEvent(processing.event.Event pe){
eventQueue.add(pe);
if (!looping) {
dequeueEvents();
}
}
| Add an event to the internal event queue, or process it immediately if the sketch is not currently looping. |
public boolean visit(Block node){
return true;
}
| Visits the given type-specific AST node. <p> The default implementation does nothing and return true. Subclasses may reimplement. </p> |
public SnackbarBuilder manualDismissCallback(SnackbarManualDismissCallback callback){
callbackBuilder.manualDismissCallback(callback);
return this;
}
| Set the callback to be informed of the Snackbar being dismissed manually, due to a call to dismiss(). |
public void addItem(WorkListItem item){
workList.add(item);
}
| Add a work list item for a basic block to be constructed. |
boolean repliedOK(){
return this.replyCode == DLockQueryReplyMessage.OK;
}
| Returns true if the queried grantor replied with the current lease info for the named lock. |
public final int maxBag(){
double max;
int maxIndex;
int i;
max=0;
maxIndex=-1;
for (i=0; i < m_perBag.length; i++) {
if (Utils.grOrEq(m_perBag[i],max)) {
max=m_perBag[i];
maxIndex=i;
}
}
return maxIndex;
}
| Returns index of bag containing maximum number of instances. |
public boolean containsValue(Object value,boolean identity){
V[] valueTable=this.valueTable;
if (value == null) {
if (hasZeroValue && zeroValue == null) return true;
long[] keyTable=this.keyTable;
for (int i=capacity + stashSize; i-- > 0; ) if (keyTable[i] != EMPTY && valueTable[i] == null) ... | Returns true if the specified value is in the map. Note this traverses the entire map and compares every value, which may be an expensive operation. |
private int height(TreeNode node,List<List<Integer>> res){
if (null == node) return -1;
int level=1 + Math.max(height(node.left,res),height(node.right,res));
if (res.size() == level) {
res.add(new ArrayList<>());
}
res.get(level).add(node.val);
return level;
}
| Return the height of a node. height(node) = 1 + max(height(node.left), height(node.right)) |
public DisconnectContainerFromNetworkParams withDisconnectContainer(@NotNull DisconnectContainer disconnectContainer){
requireNonNull(disconnectContainer);
this.disconnectContainer=disconnectContainer;
return this;
}
| Adds container identifier to this parameters. |
public boolean releaseUpgradeLock(){
log.info("Strat releasing upgrade Lock ...");
boolean flag=false;
String leader=coordinatorClientExt.getUpgradeLockOwner(upgradeLockId);
if (leader != null) {
log.info("Now upgrade lock belongs to: {}",leader);
}
try {
flag=coordinatorClientExt.releasePersistentL... | Release upgrade lock |
protected void fireOptionSelected(JFileChooser pane,int option){
SheetEvent sheetEvent=null;
Object[] listeners=listenerList.getListenerList();
for (int i=listeners.length - 2; i >= 0; i-=2) {
if (listeners[i] == SheetListener.class) {
if (sheetEvent == null) {
sheetEvent=new SheetEvent(this,pan... | Notify all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method. |
public void myMethod(){
return "";
}
| My test method javadoc; |
public String message(){
return message;
}
| Returns the HTTP status message or null if it is unknown. |
public boolean shouldReverse(String token){
int posQ=token.indexOf('?');
int posA=token.indexOf('*');
if (posQ == -1 && posA == -1) {
return false;
}
int pos;
int lastPos;
int len=token.length();
lastPos=token.lastIndexOf('?');
pos=token.lastIndexOf('*');
if (pos > lastPos) lastPos=pos;
if (... | This method encapsulates the logic that determines whether a query token should be reversed in order to use the reversed terms in the index. |
private void forceExpectedTokensReplication(){
Map<String,String> expected=getExpectedTokens();
Map<String,String> clone=new HashMap<String,String>();
clone.putAll(expected);
session.setAttribute(EXPECTED_TOKENS_ATT,clone);
}
| This is only necessary because Google AppEngine does not replicates sessions the same way other containers do. The replication only occurs when you call the <code>setAttribute</code> method on the <code>session</code> object, storing an object different than the previous one stored for the desired key. <a href="https:... |
protected void populateVcenterData(Vcenter vcenter,VcenterParam param){
vcenter.setLabel(param.getName());
vcenter.setOsVersion(param.getOsVersion());
vcenter.setUsername(param.getUserName());
vcenter.setPassword(param.getPassword());
vcenter.setIpAddress(param.findIpAddress());
vcenter.setPortNumber(param.... | Populate an instance of vCenter with the provided vcenter parameter |
public Staff(String name,String address,String phone,String email,int office,double salary,String title){
super(name,address,phone,email,office,salary);
this.title=title;
}
| Construct a Staff object |
public static <A,B>Pair<A,B> pairify(A first,B second){
return new Pair<A,B>(first,second);
}
| Convenience method to create a pair |
public static CTagManager loadTagManager(final AbstractSQLProvider provider,final TagType type) throws CouldntLoadDataException {
Preconditions.checkNotNull(type,"IE00567: Tag type argument can't be null");
final CConnection connection=provider.getConnection();
if (!PostgreSQLHelpers.hasTable(connection,CTableNam... | Loads a tag manager from the database. |
public static byte convertUint8toByte(char uint8){
if (uint8 > Byte.MAX_VALUE - Byte.MIN_VALUE) {
throw new RuntimeException("Out of Boundary");
}
return (byte)uint8;
}
| Convert uint8 into char( we treat char as uint8) |
public static PlaceholderFragment newInstance(int sectionNumber){
PlaceholderFragment fragment=new PlaceholderFragment();
Bundle args=new Bundle();
args.putInt(ARG_SECTION_NUMBER,sectionNumber);
fragment.setArguments(args);
return fragment;
}
| Returns a new instance of this fragment for the given section number. |
private AppUtils(){
throw new Error("Do not need instantiate!");
}
| Don't let anyone instantiate this class. |
public synchronized void onSocketTimeout(){
sockTimeoutsCnt++;
}
| Increments socket timeouts count. |
public Connection borrowConnection(ServerLocation server,long acquireTimeout,boolean onlyUseExistingCnx) throws AllConnectionsInUseException, NoAvailableServersException {
lock.lock();
try {
if (shuttingDown) {
throw new PoolCancelledException();
}
for (Iterator itr=availableConnections.iterator()... | Borrow a connection to a specific server. This task currently allows us to break the connection limit, because it is used by tasks from the background thread that shouldn't be constrained by the limit. They will only violate the limit by 1 connection, and that connection will be destroyed when returned to the pool. |
public void lineColor(int rgb){
_lineColor=rgb;
}
| Sets the color of the Lines |
public static boolean areTypesEqual(TypeElement typeElement1,TypeElement typeElement2){
return typeElement1.getQualifiedName().equals(typeElement2.getQualifiedName());
}
| Types.isSameType() does not work when the origin element that triggers annotation processing, and calls Types.isSameType() is generated by an other annotation processor Workaround is to compare the full qualified names of the two types |
public boolean onKeyUp(int keyCode,KeyEvent event){
if (keyCode == KeyEvent.KEYCODE_BACK) {
show_existDialog();
return false;
}
else {
return true;
}
}
| On key up. |
public int stepToOuterScreenEvent(){
FormIndex index=stepIndexOut(getFormIndex());
int currentEvent=getEvent();
while (index != null && getEvent(index) == FormEntryController.EVENT_GROUP) {
index=stepIndexOut(index);
}
if (index == null) {
jumpToIndex(FormIndex.createBeginningOfFormIndex());
}
else... | Move the current form index to the index of the first enclosing repeat or to the start of the form. |
public boolean removeLocalEventListener(IgnitePredicate<? extends Event> lsnr,@Nullable int... types){
return removeLocalEventListener(new UserListenerWrapper(lsnr),types);
}
| Removes user listener for specified events, if any. If no event types provided - it removes the listener for all its registered events. |
public static boolean equals(short[] array1,short[] array2){
if (array1 == array2) {
return true;
}
if (array1 == null || array2 == null || array1.length != array2.length) {
return false;
}
for (int i=0; i < array1.length; i++) {
if (array1[i] != array2[i]) {
return false;
}
}
return... | Compares the two arrays. |
public void initialize(String pname,Scheduler scheduler,ClassLoadHelper classLoadHelper) throws SchedulerException {
this.name=pname;
scheduler.getListenerManager().addJobListener(this,EverythingMatcher.allJobs());
}
| <p> Called during creation of the <code>Scheduler</code> in order to give the <code>SchedulerPlugin</code> a chance to initialize. </p> |
public void init(Connection conn,String schemaName,String triggerName,String tableName,boolean before,int type) throws SQLException {
this.init(conn,triggerName,schemaName,tableName);
}
| This method is called by the database engine once when initializing the trigger. |
@Override public void clear(){
removeAllElements();
}
| Removes all elements from this vector, leaving it empty. |
public void pauseSystemAsync(final String deploymentId,final FutureCallback<Task> responseCallback) throws IOException {
String path=String.format("%s/%s/pause_system",getBasePath(),deploymentId);
createObjectAsync(path,null,responseCallback);
}
| Pause system. |
private boolean hasTripleDbVersionsInFederation(String targetVersion){
Set<String> allSchemaVersions=new HashSet<>();
allSchemaVersions.add(VdcUtil.getDbSchemaVersion(targetVersion));
List<URI> vdcIds=dbClient.queryByType(VirtualDataCenter.class,true);
List<URI> vdcVersionIds=dbClient.queryByType(VdcVersion.cla... | Check if we'll have 3 geodb schema version after upgrading to give version. |
static protected TestSuite filterOutTests(final TestSuite suite1,final String name){
final TestSuite suite2=new TestSuite(suite1.getName());
final Enumeration<Test> e=suite1.tests();
while (e.hasMoreElements()) {
final Test aTest=e.nextElement();
if (aTest instanceof TestSuite) {
final TestSuite aTe... | Hack filters out the "dataset" tests. |
protected void addContent(Group bg,OMGraphicHandlerLayer layer,double baselineHeight){
Debug.message("3d","LayerMapContent: putting layer " + layer.getName() + " graphics on the map.");
addTo(bg,OMGraphicUtil.createShape3D(layer.getList(),baselineHeight));
}
| Add a layer to the Group, at a specific height. |
public String toString(){
return value.toString();
}
| Obtains the string representation of this object. |
private static <T>BinaryOperator<T> throwingMerger(){
return null;
}
| copy from jdk Collectors, for toMap only |
static boolean removeAllImpl(Set<?> set,Iterator<?> iterator){
boolean changed=false;
while (iterator.hasNext()) {
changed|=set.remove(iterator.next());
}
return changed;
}
| Remove each element in an iterable from a set. |
public SimpleHttpOperationInvoker(final Gfsh gfsh,final String baseUrl,Map<String,String> securityProperties){
super(gfsh,baseUrl,securityProperties);
}
| Constructs an instance of the SimpleHttpOperationInvoker class initialized with a reference to the GemFire shell (Gfsh) using this HTTP-based OperationInvoker to send command invocations to the GemFire Manager's HTTP service using HTTP for processing. In addition, the base URL to the HTTP service running in the GemFire... |
protected void extendSignatureTag() throws DSSException {
assertExtendSignaturePossible();
ensureUnsignedProperties();
ensureUnsignedSignatureProperties();
ensureSignedDataObjectProperties();
if (!xadesSignature.hasTProfile() || XAdES_BASELINE_T.equals(params.getSignatureLevel())) {
final TimestampParamet... | Extends the signature to a desired level. This method is overridden by other profiles.<br> For -T profile adds the SignatureTimeStamp element which contains a single HashDataInfo element that refers to the ds:SignatureValue element of the [XMLDSIG] signature. The timestamp token is obtained from TSP source.<br> Adds <S... |
@Override public NotificationChain eInverseRemove(InternalEObject otherEnd,int featureID,NotificationChain msgs){
switch (featureID) {
case N4JSPackage.ANNOTABLE_SCRIPT_ELEMENT__ANNOTATION_LIST:
return basicSetAnnotationList(null,msgs);
}
return super.eInverseRemove(otherEnd,featureID,msgs);
}
| <!-- begin-user-doc --> <!-- end-user-doc --> |
public Contribution(NondominatedPopulation referenceSet){
this(referenceSet,(EpsilonBoxDominanceComparator)null);
}
| Constructs the contribution indicator using the specified reference set. Exact matching is used. |
private Type(final int sort){
this(sort,null,0,1);
}
| Constructs a primitive type. |
public static CommandResult execCommand(String command,boolean isRoot,boolean isNeedResultMsg){
return execCommand(new String[]{command},isRoot,isNeedResultMsg);
}
| execute shell command |
@Override public boolean isAllowedToInviteParticipants() throws RemoteException {
try {
if (!isGroupChatCapableOfReceivingParticipantInvitations()) {
return false;
}
if (!isAllowedToInviteAdditionalParticipants(1)) {
if (sLogger.isActivated()) {
sLogger.debug("Cannot invite participant... | Returns true if it is possible to invite additional participants to the group chat right now, else returns false. |
private void throwUsernamePasswordStyleException(final Throwable cause) throws InvalidOptionValueException {
final char preferredPrefix=OptionsMap.getPreferredOptionPrefix();
final String causeMessage=(cause != null) ? cause.getLocalizedMessage() : "";
final String messageFormat=Messages.getString("UsernamePasswo... | Throws an error about invalid username and password syntax, integrating text from an optional cause. |
@Override public boolean isActive(){
return amIActive;
}
| Used by the Whitebox GUI to tell if this plugin is still running. |
public RenameRefactoring(RenameProcessor processor){
super(processor);
Assert.isNotNull(processor);
fProcessor=processor;
}
| Creates a new rename refactoring with the given rename processor. |
public void fixupVariables(java.util.Vector vars,int globalsSize){
if (null != m_arg0) m_arg0.fixupVariables(vars,globalsSize);
}
| This function is used to fixup variables from QNames to stack frame indexes at stylesheet build time. |
public void reindexScriptSteps(){
int index=1;
for ( ScriptStep step : steps) {
step.setStepIndex(index);
index++;
}
}
| Reindexes the script steps. |
public Set<String> addContent(String variable,boolean value){
if (!paused) {
curState.addToState(new Assignment(variable,value));
return update();
}
else {
log.info("system is paused, ignoring " + variable + "="+ value);
return Collections.emptySet();
}
}
| Adds the content (expressed as a pair of variable=value) to the current dialogue state, and subsequently updates the dialogue state. |
public AlgorithmInitializationException(Algorithm algorithm,Throwable cause){
super(algorithm,cause);
}
| Constructs an algorithm initialization exception originating from the specified algorithm with the given cause. |
public void removePEPListener(PEPListener pepListener){
synchronized (pepListeners) {
pepListeners.remove(pepListener);
}
}
| Removes a listener from PEP events. |
public synchronized void close() throws IOException {
if (journalWriter == null) {
return;
}
for ( Entry entry : new ArrayList<Entry>(lruEntries.values())) {
if (entry.currentEditor != null) {
entry.currentEditor.abort();
}
}
trimToSize();
trimToFileCount();
journalWriter.close();
jou... | Closes this cache. Stored values will remain on the filesystem. |
public void instantiate(){
String nameT=namePrefix + "T" + nameDivider+ output;
String nameC=namePrefix + "C" + nameDivider+ output;
RouteManager rm=InstanceManager.getDefault(jmri.RouteManager.class);
Route rt=rm.getBySystemName(nameT);
if (rt != null) {
rt.deActivateRoute();
rm.deleteRoute(rt);
}
... | Create the underlying objects that implement this |
public static int deleteInventoryLineMA(int M_InventoryLine_ID,String trxName){
String sql="DELETE FROM M_InventoryLineMA ma WHERE EXISTS " + "(SELECT * FROM M_InventoryLine l WHERE l.M_InventoryLine_ID=ma.M_InventoryLine_ID" + " AND M_InventoryLine_ID=" + M_InventoryLine_ID + ")";
return DB.executeUpdate(sql,trxNa... | Delete all Material Allocation for Inventory |
protected void printAttributeSummary(boolean nominalPredictor,boolean numericPredictor,boolean stringPredictor,boolean datePredictor,boolean relationalPredictor,boolean multiInstance,int classType){
String str="";
if (numericPredictor) {
str+=" numeric";
}
if (nominalPredictor) {
if (str.length() > 0) {... | Print out a short summary string for the dataset characteristics |
public static Object evaluate(Object context,Object self,String expr,List<String> engineConfigs) throws CWLExpressionException {
String trimmedExpr=StringUtils.trim(expr);
if (trimmedExpr.startsWith("$")) {
trimmedExpr=trimmedExpr.substring(1);
}
String function=trimmedExpr;
if (trimmedExpr.startsWith("{"... | Evaluate JS script (function or statement) |
public static int largestColumn(int[][] m){
int maxColumnIndex=0;
int max=0;
for (int col=0; col < m[0].length; col++) {
int count=0;
for (int row=0; row < m.length; row++) {
if (m[row][col] == 1) count++;
}
if (count > max) {
max=count;
maxColumnIndex=col;
}
}
retu... | largestColumn finds the first column with the most 1s |
public boolean isModified(){
for (int i=_dependencyList.size() - 1; i >= 0; i--) {
Dependency dependency=_dependencyList.get(i);
if (dependency.isModified()) {
return true;
}
}
return false;
}
| Returns true if the underlying dependencies have changed. |
public void convertToGL(CGPoint uiPoint,CGPoint ret){
convertToGL(uiPoint.x,uiPoint.y,ret);
}
| Optimizaed version of convertToGL(CGPoint uiPoint). |
@Override public Address allocateContiguousChunks(int descriptor,Space space,int chunks,Address head){
lock.acquire();
int chunk=regionMap.alloc(chunks);
if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(chunk != 0);
if (chunk == -1) {
if (Options.verbose.getValue() > 3) {
Log.write("Unable to allocat... | Allocate some number of contiguous chunks within a discontiguous region. |
private UnitInterface findUnit(String unitName){
for ( UnitInterface unit : allUnits) {
if (unit.getName().equalsIgnoreCase(unitName)) {
return unit;
}
}
return null;
}
| Searches for a unit by given unit name |
public void testRegisterListeners(){
FacesContext context=getFacesContext();
UIViewRoot root=Util.getViewHandler(context).createView(context,null);
root.setLocale(Locale.US);
root.setViewId(TEST_URI);
context.setViewRoot(root);
UIForm basicForm=new UIForm();
basicForm.setId("basicForm");
root.getChildre... | This method will test the <code>registerActionListeners</code> method. It will first create a simple tree consisting of a couple of <code>UICommand</code> components added to a facet; Then the <code>ReconstituteComponentTree.execute</code> method is run; And finally, an assertion is done to ensure that default action... |
public boolean removeParameter(String name){
return authParams.delete(name);
}
| delete the specified parameter |
@Override public boolean supportsSelectForUpdate(){
debugCodeCall("supportsSelectForUpdate");
return true;
}
| Returns whether SELECT ... FOR UPDATE is supported. |
public TermsBuilder size(int size){
bucketCountThresholds.setRequiredSize(size);
return this;
}
| Sets the size - indicating how many term buckets should be returned (defaults to 10) |
public AddNodesItem clone(){
AddNodesItem result=new AddNodesItem();
result.ParentNodeId=ParentNodeId;
result.ReferenceTypeId=ReferenceTypeId;
result.RequestedNewNodeId=RequestedNewNodeId;
result.BrowseName=BrowseName;
result.NodeClass=NodeClass;
result.NodeAttributes=NodeAttributes;
result.TypeDefiniti... | Deep clone |
public JMapper(final Class<D> destination,final Class<S> source,final JMapperAPI api){
this(destination,source,api.toXStream().toString());
}
| Constructs a JMapper that handles two classes: the class of destination and the class of source. <br>Taking configuration by API. |
public static int byteArrayToInt(byte[] b,int offset){
int value=0;
for (int i=0; i < 4; i++) {
int shift=(4 - 1 - i) * 8;
value+=(b[i + offset] & 0x000000FF) << shift;
}
return value;
}
| Convert the byte array to an int starting from the given offset. |
public void compress(final ByteBuffer buf,final OutputStream os){
if (true && buf.hasArray()) {
final int off=buf.arrayOffset() + buf.position();
final int len=buf.remaining();
compress(buf.array(),off,len,os);
buf.position(buf.limit());
return;
}
throw new UnsupportedOperationException();
}
| Writes the buffer on the output stream. |
public void splitLinesIntoHashMap(Vector<String> content) throws Exception {
for (int i=0; i < content.size(); i++) {
String line=content.get(i);
if (line == null || line.length() < 1) continue;
if (!line.contains(_divider)) throw new Exception("ConfigReader: ConfigFile " + _filePath + " contains ... | Splitting lines into hashmap by divider |
private void initialize(boolean isRtlContext){
mIsRtlContext=isRtlContext;
mTextDirectionHeuristicCompat=DEFAULT_TEXT_DIRECTION_HEURISTIC;
mFlags=DEFAULT_FLAGS;
}
| Initializes the builder with the given context directionality and default options. |
public void testBlendedSort() throws IOException {
BytesRef payload=new BytesRef("star");
Input keys[]=new Input[]{new Input("star wars: episode v - the empire strikes back",8,payload)};
Path tempDir=createTempDir("BlendedInfixSuggesterTest");
Analyzer a=new StandardAnalyzer(CharArraySet.EMPTY_SET);
BlendedIn... | Test the weight transformation depending on the position of the matching term. |
public XMLApiResult executeSshRetry(String command,String request){
XMLApiResult reTryResult=new XMLApiResult();
try {
int maxRetry=3;
while (maxRetry > 0) {
reTryResult=this.executeSsh(command,request);
String message=reTryResult.getMessage();
if (reTryResult.isCommandSuccess()) {
... | Execute ssh retry. |
public void stopScanning(){
if (mServiceConnected) {
mBeaconsListFragment.stopScanning(mServiceConnection);
}
}
| Stops scanning for added beacons if the service is connected. |
public void testCase2(){
byte aBytes[]={1,2,3,4,5,6,7,1,2,3};
byte bBytes[]={10,20,30,40,50,60,70,10,20,30};
int aSign=1;
int bSign=1;
byte rBytes[]={-10,-19,-28,-37,-46,-55,-64,-10,-19,-27};
BigInteger aNumber=new BigInteger(aSign,aBytes);
BigInteger bNumber=new BigInteger(bSign,bBytes);
BigInteger res... | Subtract two positive numbers of the same length. The second is greater. |
protected Link determineAtbLink(final LinksSupport links,final String linkId,final ProductSearchResultDTO product,final CustomerWishList itemData,final String qty){
final PageParameters params=new PageParameters();
params.add(WebParametersKeys.SKU_ID,itemData.getSkus().getSkuId());
return links.newAddToCartLink(l... | Extension hook for sub classes. |
private void checkKey(String newKey){
boolean isRefreshIdents=false;
if (null == registrationIdKey) {
registrationIdKey=newKey;
}
else {
isRefreshIdents=!Objects.equals(registrationIdKey,newKey);
registrationIdKey=newKey;
}
if (isRefreshIdents) {
cachedDataService.triggerRefreshIdents();
}
... | Check if key has changed and fire the refresh idents if necessary. |
private static HashSet<String> parseAllowGeolocationOrigins(String setting){
HashSet<String> origins=new HashSet<String>();
if (!TextUtils.isEmpty(setting)) {
for ( String origin : setting.split("\\s+")) {
if (!TextUtils.isEmpty(origin)) {
origins.add(origin);
}
}
}
return origins... | Parses the value of the default geolocation permissions setting. |
public boolean atEnd(){
return currentToken.length() == 0;
}
| Are we at the end of the input? |
@Override public int read() throws java.io.IOException {
if (position < 0) {
if (encode) {
byte[] b3=new byte[3];
int numBinaryBytes=0;
for (int i=0; i < 3; i++) {
int b=in.read();
if (b >= 0) {
b3[i]=(byte)b;
numBinaryBytes++;
}
else {
brea... | Reads enough of the input stream to convert to/from Base64 and returns the next byte. |
public static void copyFile(File origPath,File destPath) throws IOException {
try (FileInputStream ins=new FileInputStream(origPath);FileOutputStream outs=new FileOutputStream(destPath)){
FileChannel in=ins.getChannel();
FileChannel out=outs.getChannel();
in.transferTo(0,in.size(),out);
}
}
| Convenience function to copy a file. If the destination file exists it is overwritten. |
protected T childValue(T parentValue){
return parentValue;
}
| Computes the child's initial value for this inheritable thread-local variable as a function of the parent's value at the time the child thread is created. This method is called from within the parent thread before the child is started. <p> This method merely returns its input argument, and should be overridden if a di... |
public static void quickSort(int[] a){
quickSort(a,0,a.length - 1);
}
| Wrapper method to quick sort the entire array. |
protected void adjustVisibility(Rectangle r){
SwingUtilities.invokeLater(new SafeScroller(r));
}
| Adjusts the visibility of the caret according to the windows feel which seems to be to move the caret out into the field by about a quarter of a field length if not visible. |
private void loadOffsets(){
List<Map<String,String>> partitions=new ArrayList<>();
for ( String db : databases) {
Map<String,String> partition=Collections.singletonMap("mongodb",db);
partitions.add(partition);
}
offsets.putAll(context.offsetStorageReader().offsets(partitions));
}
| Loads the current saved offsets. |
@Override public float tf(float freq){
return baselineTf(freq);
}
| Delegates to baselineTf |
@Before public void before(){
LOGGER.info("********* " + name.getMethodName() + " *********");
latch=new CountDownLatch(1);
completedSessionIds.clear();
failedSessionIds.clear();
bus.register(this);
}
| Clears the session ID caches. Registers the test to the event bus. |
private void checkOneNode(int id) throws Exception {
String id8;
File logFile;
try (Ignite ignite=G.start(getConfiguration("grid" + id,LOG_PATH_MAIN))){
id8=U.id8(ignite.cluster().localNode().id());
String logPath="work/log/ignite-" + id8 + ".log";
logFile=U.resolveIgnitePath(logPath);
assertNotNu... | Starts the local node and checks for presence of log file. Also checks that this is really a log of a started node. |
private void writeObject(ObjectOutputStream s) throws IOException {
s.defaultWriteObject();
if (getUIClassID().equals(uiClassID)) {
byte count=JComponent.getWriteObjCounter(this);
JComponent.setWriteObjCounter(this,--count);
if (count == 0 && ui != null) {
ui.installUI(this);
}
}
}
| See readObject() and writeObject() in JComponent for more information about serialization in Swing. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.