method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public void setCss (File cascadingStyleSheet) { mCascadingStyleSheet = cascadingStyleSheet; }
void function (File cascadingStyleSheet) { mCascadingStyleSheet = cascadingStyleSheet; }
/** * Sets the cascading style sheet. * * @param cascadingStyleSheet the new cascading style sheet */
Sets the cascading style sheet
setCss
{ "repo_name": "jCoderZ/fawkez-old", "path": "src/java/org/jcoderz/commons/taskdefs/XtremeDocs.java", "license": "bsd-3-clause", "size": 36647 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
898,998
@android.view.RemotableViewMethod public final void setHintTextColor(@ColorInt int color) { mHintTextColor = ColorStateList.valueOf(color); updateTextColors(); }
@android.view.RemotableViewMethod final void function(@ColorInt int color) { mHintTextColor = ColorStateList.valueOf(color); updateTextColors(); }
/** * Sets the color of the hint text for all the states (disabled, focussed, selected...) of this * TextView. * * @see #setHintTextColor(ColorStateList) * @see #getHintTextColors() * @see #setTextColor(int) * * @attr ref android.R.styleable#TextView_textColorHint */
Sets the color of the hint text for all the states (disabled, focussed, selected...) of this TextView
setHintTextColor
{ "repo_name": "OmniEvo/android_frameworks_base", "path": "core/java/android/widget/TextView.java", "license": "gpl-3.0", "size": 380764 }
[ "android.annotation.ColorInt", "android.content.res.ColorStateList" ]
import android.annotation.ColorInt; import android.content.res.ColorStateList;
import android.annotation.*; import android.content.res.*;
[ "android.annotation", "android.content" ]
android.annotation; android.content;
2,627,208
@Test public void testGroupCount(){ List<User> list = toList(// new User("张飞", 20), new User("关羽", 30), new User("赵云", 50), new User("刘备", 40), new User("刘备", 30), new User("赵云", 50)); Map<String, Integer> map = AggregateUtil.groupCount(list, "name", comparatorPredicate); assertThat(map, allOf(hasEntry("刘备", 1), hasEntry("赵云", 2))); }
void function(){ List<User> list = toList( new User("关羽", 30), new User("赵云", 50), new User("刘备", 40), new User("刘备", 30), new User("赵云", 50)); Map<String, Integer> map = AggregateUtil.groupCount(list, "name", comparatorPredicate); assertThat(map, allOf(hasEntry("刘备", 1), hasEntry("赵云", 2))); }
/** * Test group count. */
Test group count
testGroupCount
{ "repo_name": "venusdrogon/feilong-core", "path": "src/test/java/com/feilong/core/util/aggregateutiltest/GroupCountPredicateTest.java", "license": "apache-2.0", "size": 4525 }
[ "com.feilong.core.bean.ConvertUtil", "com.feilong.core.util.AggregateUtil", "com.feilong.store.member.User", "java.util.List", "java.util.Map", "org.hamcrest.Matchers", "org.junit.Assert" ]
import com.feilong.core.bean.ConvertUtil; import com.feilong.core.util.AggregateUtil; import com.feilong.store.member.User; import java.util.List; import java.util.Map; import org.hamcrest.Matchers; import org.junit.Assert;
import com.feilong.core.bean.*; import com.feilong.core.util.*; import com.feilong.store.member.*; import java.util.*; import org.hamcrest.*; import org.junit.*;
[ "com.feilong.core", "com.feilong.store", "java.util", "org.hamcrest", "org.junit" ]
com.feilong.core; com.feilong.store; java.util; org.hamcrest; org.junit;
1,248,290
public static void main(String[] args){ BufferedReader f; PrintWriter p; Command c; try{ f = new BufferedReader(new FileReader("C:/EclipseSimulationAnimation/Animation1/Test.cmds")); //Model.setViewer(new javax.swing.JFrame()); //Model.setSimulationTime(new animation.viewer.SimulationTime(0, 1000,1.0)); //Model m = Model.getInstance(); //Command.setModel(m); f.close(); }catch(java.io.IOException eio){ eio.printStackTrace(); }catch(CommandException ec){ ec.printStackTrace(); }catch(desmoj.extensions.visualization2d.engine.model.ModelException em){ em.printStackTrace(); } }
static void function(String[] args){ BufferedReader f; PrintWriter p; Command c; try{ f = new BufferedReader(new FileReader(STR)); f.close(); }catch(java.io.IOException eio){ eio.printStackTrace(); }catch(CommandException ec){ ec.printStackTrace(); }catch(desmoj.extensions.visualization2d.engine.model.ModelException em){ em.printStackTrace(); } }
/** * only for testing * @param args no args */
only for testing
main
{ "repo_name": "muhd7rosli/desmoj", "path": "src/desmoj/extensions/visualization2d/engine/command/Command.java", "license": "apache-2.0", "size": 24854 }
[ "java.io.BufferedReader", "java.io.FileReader", "java.io.PrintWriter" ]
import java.io.BufferedReader; import java.io.FileReader; import java.io.PrintWriter;
import java.io.*;
[ "java.io" ]
java.io;
2,773,920
ModSecurityManager.getInstance().checkGetLogger(); Logger logger = LOGGER.get(); if(logger == null) throw new LoggerNotInitializedException(); return logger; }
ModSecurityManager.getInstance().checkGetLogger(); Logger logger = LOGGER.get(); if(logger == null) throw new LoggerNotInitializedException(); return logger; }
/** * Return mod logger * * @return mod logger * @throws java.security.AccessControlException if caller class doesn't have rights to get logger * @throws LoggerNotInitializedException if logger hadn't been set */
Return mod logger
getModLogger
{ "repo_name": "alesharik/GearsMod", "path": "src/api/java/com/alesharik/gearsmod/util/ModLoggerHolder.java", "license": "gpl-3.0", "size": 1985 }
[ "org.apache.logging.log4j.Logger" ]
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.*;
[ "org.apache.logging" ]
org.apache.logging;
890,843
public static RuleDelegationBo createRuleDelegationToUser(RuleBaseValues parentRule, RuleResponsibilityBo parentResponsibility, PrincipalContract delegatePrincipal) { return createRuleDelegation(parentRule, parentResponsibility, delegatePrincipal.getPrincipalId(), KewApiConstants.RULE_RESPONSIBILITY_WORKFLOW_ID); }
static RuleDelegationBo function(RuleBaseValues parentRule, RuleResponsibilityBo parentResponsibility, PrincipalContract delegatePrincipal) { return createRuleDelegation(parentRule, parentResponsibility, delegatePrincipal.getPrincipalId(), KewApiConstants.RULE_RESPONSIBILITY_WORKFLOW_ID); }
/** * <p>This method creates and saves a rule delegation * * <p>As a side effect, active documents of this type will be requeued for workflow processing. * * @param parentRule * @param parentResponsibility * @param delegatePrincipal */
This method creates and saves a rule delegation As a side effect, active documents of this type will be requeued for workflow processing
createRuleDelegationToUser
{ "repo_name": "ua-eas/ksd-kc5.2.1-rice2.3.6-ua", "path": "rice-middleware/it/kew/src/test/java/org/kuali/rice/kew/rule/RuleTestUtils.java", "license": "apache-2.0", "size": 6721 }
[ "org.kuali.rice.kew.api.KewApiConstants", "org.kuali.rice.kim.api.identity.principal.PrincipalContract" ]
import org.kuali.rice.kew.api.KewApiConstants; import org.kuali.rice.kim.api.identity.principal.PrincipalContract;
import org.kuali.rice.kew.api.*; import org.kuali.rice.kim.api.identity.principal.*;
[ "org.kuali.rice" ]
org.kuali.rice;
2,235,995
protected ConditionExpr getComparisonExpr(Immediate one, Immediate other) { Opcode opcode = instruction.getOpcode(); switch(opcode) { case IF_EQ: case IF_EQZ: return Jimple.v().newEqExpr(one, other); case IF_NE: case IF_NEZ: return Jimple.v().newNeExpr(one, other); case IF_LT: case IF_LTZ: return Jimple.v().newLtExpr(one, other); case IF_GE: case IF_GEZ: return Jimple.v().newGeExpr(one, other); case IF_GT: case IF_GTZ: return Jimple.v().newGtExpr(one, other); case IF_LE: case IF_LEZ: return Jimple.v().newLeExpr(one, other); default: throw new RuntimeException("Instruction is not an IfTest(z) instruction."); } }
ConditionExpr function(Immediate one, Immediate other) { Opcode opcode = instruction.getOpcode(); switch(opcode) { case IF_EQ: case IF_EQZ: return Jimple.v().newEqExpr(one, other); case IF_NE: case IF_NEZ: return Jimple.v().newNeExpr(one, other); case IF_LT: case IF_LTZ: return Jimple.v().newLtExpr(one, other); case IF_GE: case IF_GEZ: return Jimple.v().newGeExpr(one, other); case IF_GT: case IF_GTZ: return Jimple.v().newGtExpr(one, other); case IF_LE: case IF_LEZ: return Jimple.v().newLeExpr(one, other); default: throw new RuntimeException(STR); } }
/** * Get comparison expression depending on opcode between two immediates * * @param one first immediate * @param other second immediate * @throws RuntimeException if this is not a IfTest or IfTestz instruction. */
Get comparison expression depending on opcode between two immediates
getComparisonExpr
{ "repo_name": "mbenz89/soot", "path": "src/soot/dexpler/instructions/ConditionalJumpInstruction.java", "license": "lgpl-2.1", "size": 4214 }
[ "org.jf.dexlib2.Opcode" ]
import org.jf.dexlib2.Opcode;
import org.jf.dexlib2.*;
[ "org.jf.dexlib2" ]
org.jf.dexlib2;
897,068
public final DistCacheEntry getCacheEntry(HashKey hashKey, HashKey cacheKey, Object oKey) { DistCacheEntry entry = getCacheEntry(hashKey, cacheKey); if (oKey != null) { entry.setKey(oKey); } return entry; }
final DistCacheEntry function(HashKey hashKey, HashKey cacheKey, Object oKey) { DistCacheEntry entry = getCacheEntry(hashKey, cacheKey); if (oKey != null) { entry.setKey(oKey); } return entry; }
/** * Returns the key entry. */
Returns the key entry
getCacheEntry
{ "repo_name": "bertrama/resin", "path": "modules/resin/src/com/caucho/server/distcache/CacheStoreManager.java", "license": "gpl-2.0", "size": 11450 }
[ "com.caucho.util.HashKey" ]
import com.caucho.util.HashKey;
import com.caucho.util.*;
[ "com.caucho.util" ]
com.caucho.util;
363,501
public static Map<String, Object> getConfigForBranch(EntityType entityType, State taskState, int numBranches, int branch) { return getConfigForBranch(taskState, entityType.getConfigPrefix(), ForkOperatorUtils.getPropertyNameForBranch("", numBranches, branch)); }
static Map<String, Object> function(EntityType entityType, State taskState, int numBranches, int branch) { return getConfigForBranch(taskState, entityType.getConfigPrefix(), ForkOperatorUtils.getPropertyNameForBranch("", numBranches, branch)); }
/** * Retrieve encryption config for a given branch of a task * @param entityType Entity type we are retrieving config for * @param taskState State of the task * @param numBranches Number of branches overall * @param branch Branch # of the current object * @return A list of encryption properties or null if encryption isn't configured */
Retrieve encryption config for a given branch of a task
getConfigForBranch
{ "repo_name": "jinhyukchang/gobblin", "path": "gobblin-core-base/src/main/java/org/apache/gobblin/crypto/EncryptionConfigParser.java", "license": "apache-2.0", "size": 9631 }
[ "java.util.Map", "org.apache.gobblin.configuration.State", "org.apache.gobblin.util.ForkOperatorUtils" ]
import java.util.Map; import org.apache.gobblin.configuration.State; import org.apache.gobblin.util.ForkOperatorUtils;
import java.util.*; import org.apache.gobblin.configuration.*; import org.apache.gobblin.util.*;
[ "java.util", "org.apache.gobblin" ]
java.util; org.apache.gobblin;
58,877
@Override public synchronized void close() throws DataStoreException { final Collection<Resource> resources = components; if (resources != null) { components = null; // Clear first in case of failure. DataStoreException failure = null; for (final Resource r : resources) { if (r instanceof DataStore) try { ((DataStore) r).close(); } catch (DataStoreException ex) { if (failure == null) { failure = ex; } else { failure.addSuppressed(ex); } } } if (failure != null) { throw failure; } } }
synchronized void function() throws DataStoreException { final Collection<Resource> resources = components; if (resources != null) { components = null; DataStoreException failure = null; for (final Resource r : resources) { if (r instanceof DataStore) try { ((DataStore) r).close(); } catch (DataStoreException ex) { if (failure == null) { failure = ex; } else { failure.addSuppressed(ex); } } } if (failure != null) { throw failure; } } }
/** * Closes all children resources. */
Closes all children resources
close
{ "repo_name": "Geomatys/sis", "path": "storage/sis-storage/src/main/java/org/apache/sis/internal/storage/folder/Store.java", "license": "apache-2.0", "size": 15268 }
[ "java.util.Collection", "org.apache.sis.storage.DataStore", "org.apache.sis.storage.DataStoreException", "org.apache.sis.storage.Resource" ]
import java.util.Collection; import org.apache.sis.storage.DataStore; import org.apache.sis.storage.DataStoreException; import org.apache.sis.storage.Resource;
import java.util.*; import org.apache.sis.storage.*;
[ "java.util", "org.apache.sis" ]
java.util; org.apache.sis;
1,007,119
public final void clear() throws IOException { throw new IllegalStateException("Cannot clear after an unbuffered output"); }
final void function() throws IOException { throw new IllegalStateException(STR); }
/** * Discard the output buffer. */
Discard the output buffer
clear
{ "repo_name": "apache/velocity-tools", "path": "velocity-tools-view-jsp/src/main/java/org/apache/velocity/tools/view/jsp/jspimpl/JspWriterImpl.java", "license": "apache-2.0", "size": 12620 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,873,078
public static long getTotalWaitTimeForWorkgroup(String workgroupName, Date startDate, Date endDate) { Workgroup workgroup = null; try { workgroup = WorkgroupManager.getInstance().getWorkgroup(new JID(workgroupName)); } catch (Exception ex) { Log.error(ex.getMessage(), ex); } if (workgroup == null) { return 0; } int waitTime = 0; Connection con = null; PreparedStatement pstmt = null; ResultSet rs = null; try { con = DbConnectionManager.getConnection(); pstmt = con.prepareStatement(WORKGROUP_WAIT_TIME); pstmt.setLong(1, workgroup.getID()); // Set the state the ignored requests. pstmt.setInt(2, 1); pstmt.setString(2, StringUtils.dateToMillis(startDate)); pstmt.setString(3, StringUtils.dateToMillis(endDate)); rs = pstmt.executeQuery(); rs.next(); waitTime = rs.getInt(1); } catch (Exception ex) { Log.error(ex.getMessage(), ex); } finally { DbConnectionManager.closeConnection(rs, pstmt, con); } return waitTime; }
static long function(String workgroupName, Date startDate, Date endDate) { Workgroup workgroup = null; try { workgroup = WorkgroupManager.getInstance().getWorkgroup(new JID(workgroupName)); } catch (Exception ex) { Log.error(ex.getMessage(), ex); } if (workgroup == null) { return 0; } int waitTime = 0; Connection con = null; PreparedStatement pstmt = null; ResultSet rs = null; try { con = DbConnectionManager.getConnection(); pstmt = con.prepareStatement(WORKGROUP_WAIT_TIME); pstmt.setLong(1, workgroup.getID()); pstmt.setInt(2, 1); pstmt.setString(2, StringUtils.dateToMillis(startDate)); pstmt.setString(3, StringUtils.dateToMillis(endDate)); rs = pstmt.executeQuery(); rs.next(); waitTime = rs.getInt(1); } catch (Exception ex) { Log.error(ex.getMessage(), ex); } finally { DbConnectionManager.closeConnection(rs, pstmt, con); } return waitTime; }
/** * Returns the number of canceled requests. * * @param workgroupName the workgroup to search * @param startDate the time to begin the search from. * @param endDate the time to end the search. * @return the total number of requests */
Returns the number of canceled requests
getTotalWaitTimeForWorkgroup
{ "repo_name": "fanjunwei/openfireSSO", "path": "src/plugins/fastpath/src/java/org/jivesoftware/xmpp/workgroup/spi/ChatHistoryUtils.java", "license": "apache-2.0", "size": 20610 }
[ "java.sql.Connection", "java.sql.PreparedStatement", "java.sql.ResultSet", "java.util.Date", "org.jivesoftware.database.DbConnectionManager", "org.jivesoftware.util.StringUtils", "org.jivesoftware.xmpp.workgroup.Workgroup", "org.jivesoftware.xmpp.workgroup.WorkgroupManager" ]
import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.Date; import org.jivesoftware.database.DbConnectionManager; import org.jivesoftware.util.StringUtils; import org.jivesoftware.xmpp.workgroup.Workgroup; import org.jivesoftware.xmpp.workgroup.WorkgroupManager;
import java.sql.*; import java.util.*; import org.jivesoftware.database.*; import org.jivesoftware.util.*; import org.jivesoftware.xmpp.workgroup.*;
[ "java.sql", "java.util", "org.jivesoftware.database", "org.jivesoftware.util", "org.jivesoftware.xmpp" ]
java.sql; java.util; org.jivesoftware.database; org.jivesoftware.util; org.jivesoftware.xmpp;
2,030,035
public State openHabState(Class<? extends Item> itemType) { State state = UnDefType.UNDEF; try { int index; String s; if (itemType == SwitchItem.class) { index = (int) message[2]; state = index == 0 ? OnOffType.OFF : OnOffType.ON; } else if (itemType == NumberItem.class) { index = (int) message[2]; state = new DecimalType(index); } else if (itemType == DimmerItem.class) { index = (int) message[2]; state = new PercentType(index); } else if (itemType == RollershutterItem.class) { index = (int) message[2]; state = new PercentType(index); } else if (itemType == StringItem.class) { s = new String(Arrays.copyOfRange(message, 2, message.length-2)); state = new StringType(s); } } catch (Exception e) { logger.debug("Cannot convert value '{}' to data type {}", message[1], itemType); } return state; }
State function(Class<? extends Item> itemType) { State state = UnDefType.UNDEF; try { int index; String s; if (itemType == SwitchItem.class) { index = (int) message[2]; state = index == 0 ? OnOffType.OFF : OnOffType.ON; } else if (itemType == NumberItem.class) { index = (int) message[2]; state = new DecimalType(index); } else if (itemType == DimmerItem.class) { index = (int) message[2]; state = new PercentType(index); } else if (itemType == RollershutterItem.class) { index = (int) message[2]; state = new PercentType(index); } else if (itemType == StringItem.class) { s = new String(Arrays.copyOfRange(message, 2, message.length-2)); state = new StringType(s); } } catch (Exception e) { logger.debug(STR, message[1], itemType); } return state; }
/** * Convert received response message containing a Primare device variable value * to suitable OpenHAB state for the given itemType * * @param itemType * * @return openHAB state */
Convert received response message containing a Primare device variable value to suitable OpenHAB state for the given itemType
openHabState
{ "repo_name": "Greblys/openhab", "path": "bundles/binding/org.openhab.binding.primare/src/main/java/org/openhab/binding/primare/internal/protocol/PrimareResponse.java", "license": "epl-1.0", "size": 2739 }
[ "java.util.Arrays", "org.openhab.core.items.Item", "org.openhab.core.library.items.DimmerItem", "org.openhab.core.library.items.NumberItem", "org.openhab.core.library.items.RollershutterItem", "org.openhab.core.library.items.StringItem", "org.openhab.core.library.items.SwitchItem", "org.openhab.core.l...
import java.util.Arrays; import org.openhab.core.items.Item; import org.openhab.core.library.items.DimmerItem; import org.openhab.core.library.items.NumberItem; import org.openhab.core.library.items.RollershutterItem; import org.openhab.core.library.items.StringItem; import org.openhab.core.library.items.SwitchItem; import org.openhab.core.library.types.DecimalType; import org.openhab.core.library.types.OnOffType; import org.openhab.core.library.types.PercentType; import org.openhab.core.library.types.StringType; import org.openhab.core.types.State; import org.openhab.core.types.UnDefType;
import java.util.*; import org.openhab.core.items.*; import org.openhab.core.library.items.*; import org.openhab.core.library.types.*; import org.openhab.core.types.*;
[ "java.util", "org.openhab.core" ]
java.util; org.openhab.core;
715,085
public static void disposeOf(final ObjectMap<?, ? extends Disposable> disposables) { if (disposables != null) { for (final Disposable disposable : disposables.values()) { disposeOf(disposable); } } }
static void function(final ObjectMap<?, ? extends Disposable> disposables) { if (disposables != null) { for (final Disposable disposable : disposables.values()) { disposeOf(disposable); } } }
/** Performs null checks and disposes of assets. * * @param disposables its values will be disposed of (if they exist). Can be null. */
Performs null checks and disposes of assets
disposeOf
{ "repo_name": "czyzby/gdx-kiwi", "path": "src/com/github/czyzby/kiwi/util/gdx/asset/Disposables.java", "license": "apache-2.0", "size": 4375 }
[ "com.badlogic.gdx.utils.Disposable", "com.badlogic.gdx.utils.ObjectMap" ]
import com.badlogic.gdx.utils.Disposable; import com.badlogic.gdx.utils.ObjectMap;
import com.badlogic.gdx.utils.*;
[ "com.badlogic.gdx" ]
com.badlogic.gdx;
320,253
public void setCreated(Timestamp created) { this.created = created; }
void function(Timestamp created) { this.created = created; }
/** * Sets date create. * * @param created Timestamp */
Sets date create
setCreated
{ "repo_name": "roman-sd/java-a-to-z", "path": "chapter_011/springMVC/src/main/java/ru/sdroman/carstore/models/Order.java", "license": "apache-2.0", "size": 4842 }
[ "java.sql.Timestamp" ]
import java.sql.Timestamp;
import java.sql.*;
[ "java.sql" ]
java.sql;
1,187,457
void getLockReportInfo(CmsUUID structureId, AsyncCallback<CmsLockReportInfo> callback);
void getLockReportInfo(CmsUUID structureId, AsyncCallback<CmsLockReportInfo> callback);
/** * Returns the lock report info.<p> * * @param structureId the structure id of the resource to get the report for * @param callback the callback */
Returns the lock report info
getLockReportInfo
{ "repo_name": "it-tavis/opencms-core", "path": "src/org/opencms/gwt/shared/rpc/I_CmsVfsServiceAsync.java", "license": "lgpl-2.1", "size": 12380 }
[ "com.google.gwt.user.client.rpc.AsyncCallback", "org.opencms.gwt.shared.CmsLockReportInfo", "org.opencms.util.CmsUUID" ]
import com.google.gwt.user.client.rpc.AsyncCallback; import org.opencms.gwt.shared.CmsLockReportInfo; import org.opencms.util.CmsUUID;
import com.google.gwt.user.client.rpc.*; import org.opencms.gwt.shared.*; import org.opencms.util.*;
[ "com.google.gwt", "org.opencms.gwt", "org.opencms.util" ]
com.google.gwt; org.opencms.gwt; org.opencms.util;
550,497
private void submitVerificationSuccessSlaEvent(Results.Result result) { try { CompactionSlaEventHelper.getEventSubmitterBuilder(result.dataset(), Optional.<Job> absent(), this.fs) .eventSubmitter(this.eventSubmitter).eventName(CompactionSlaEventHelper.COMPLETION_VERIFICATION_SUCCESS_EVENT_NAME) .additionalMetadata(Maps.transformValues(result.verificationContext(), Functions.toStringFunction())).build() .submit(); } catch (Throwable t) { LOG.warn("Failed to submit verification success event:" + t, t); } }
void function(Results.Result result) { try { CompactionSlaEventHelper.getEventSubmitterBuilder(result.dataset(), Optional.<Job> absent(), this.fs) .eventSubmitter(this.eventSubmitter).eventName(CompactionSlaEventHelper.COMPLETION_VERIFICATION_SUCCESS_EVENT_NAME) .additionalMetadata(Maps.transformValues(result.verificationContext(), Functions.toStringFunction())).build() .submit(); } catch (Throwable t) { LOG.warn(STR + t, t); } }
/** * Submit an event when completeness verification is successful */
Submit an event when completeness verification is successful
submitVerificationSuccessSlaEvent
{ "repo_name": "jenniferzheng/gobblin", "path": "gobblin-compaction/src/main/java/org/apache/gobblin/compaction/mapreduce/MRCompactor.java", "license": "apache-2.0", "size": 45815 }
[ "com.google.common.base.Functions", "com.google.common.base.Optional", "com.google.common.collect.Maps", "org.apache.gobblin.compaction.event.CompactionSlaEventHelper", "org.apache.gobblin.compaction.verify.DataCompletenessVerifier", "org.apache.hadoop.mapreduce.Job" ]
import com.google.common.base.Functions; import com.google.common.base.Optional; import com.google.common.collect.Maps; import org.apache.gobblin.compaction.event.CompactionSlaEventHelper; import org.apache.gobblin.compaction.verify.DataCompletenessVerifier; import org.apache.hadoop.mapreduce.Job;
import com.google.common.base.*; import com.google.common.collect.*; import org.apache.gobblin.compaction.event.*; import org.apache.gobblin.compaction.verify.*; import org.apache.hadoop.mapreduce.*;
[ "com.google.common", "org.apache.gobblin", "org.apache.hadoop" ]
com.google.common; org.apache.gobblin; org.apache.hadoop;
1,965,811
public void defrag() { database.logger.logInfoEvent("defrag start"); try { // test // synchLog(); database.lobManager.synch(); deleteOldDataFiles(); DataFileDefrag dfd = cache.defrag(); database.persistentStoreCollection.setNewTableSpaces(); database.sessionManager.resetLoggedSchemas(); } catch (HsqlException e) { throw e; } catch (Throwable e) { database.logger.logSevereEvent("defrag failure", e); throw Error.error(ErrorCode.DATA_FILE_ERROR, e); } // test // database.logger.logInfoEvent("defrag end"); }
void function() { database.logger.logInfoEvent(STR); try { database.lobManager.synch(); deleteOldDataFiles(); DataFileDefrag dfd = cache.defrag(); database.persistentStoreCollection.setNewTableSpaces(); database.sessionManager.resetLoggedSchemas(); } catch (HsqlException e) { throw e; } catch (Throwable e) { database.logger.logSevereEvent(STR, e); throw Error.error(ErrorCode.DATA_FILE_ERROR, e); } }
/** * Writes out all the rows to a new file without fragmentation. */
Writes out all the rows to a new file without fragmentation
defrag
{ "repo_name": "ferquies/2dam", "path": "AD/Tema 2/hsqldb-2.3.1/hsqldb/src/org/hsqldb/persist/Log.java", "license": "gpl-3.0", "size": 24882 }
[ "org.hsqldb.HsqlException", "org.hsqldb.error.Error", "org.hsqldb.error.ErrorCode" ]
import org.hsqldb.HsqlException; import org.hsqldb.error.Error; import org.hsqldb.error.ErrorCode;
import org.hsqldb.*; import org.hsqldb.error.*;
[ "org.hsqldb", "org.hsqldb.error" ]
org.hsqldb; org.hsqldb.error;
2,710,376
private void loadDatastoreAndDatacenter() throws DatastoreNotFoundException, DatacenterNotFoundException { Folder rootFolder = vCenterClient.getServiceInstance().getRootFolder(); // Search for linked computes. List<InstancevmwareConnector> computes = getLinkedComputes(); VmwarefoldersConnector vmFolders = getMixinVmwarefolders(); if (vmFolders != null) { String datacenterTmp = vmFolders.getDatacentername(); String datastoreTmp = vmFolders.getDatastorename(); // get and set datastorename and datacentername. if (datacenterTmp != null && !datacenterTmp.trim().isEmpty()) { datacenterName = datacenterTmp; } if (datastoreTmp != null && !datastoreTmp.trim().isEmpty()) { datastoreName = datastoreTmp; } } // Load the datastore. if (datastoreName != null) { datastore = DatastoreHelper.findDatastoreForName(rootFolder, datastoreName); if (datastore == null) { throw new DatastoreNotFoundException( "Cant locate a datastore, cause: datastore is referenced but not found on vcenter, name of the datastore: " + datastoreName); } } else { // search on computes the virtual disk that represent this storage, // and get the corresponding datastore. for (InstancevmwareConnector compute : computes) { // Load the vm. String vmNameTmp = compute.getTitle(); VirtualMachine vm = VMHelper.findVMForName(rootFolder, vmNameTmp); Map<String, VirtualDisk> vdisks = VolumeHelper.getVirtualDiskForVM(vm); VirtualDisk vdiskOut = null; if (vdisks != null && !vdisks.isEmpty()) { // search the virtualdisk corresponding ref. for (Map.Entry<String, VirtualDisk> entry : vdisks.entrySet()) { String diskName = entry.getKey(); String tmp = diskName.replace(".vmdk", ""); String tampon[] = tmp.split("]"); datastoreName = tampon[0].substring(1); tampon = tampon[1].split("/"); diskName = tampon[tampon.length - 1]; if (diskName.equals(this.getTitle())) { vdiskOut = entry.getValue(); break; } } } if (datastoreName != null) { // add the attribute to persist value in addition. this.setDatastoreName(datastoreName); } if (vmName == null) { vmName = compute.getTitle(); } } } if (datacenterName != null) { datacenter = DatacenterHelper.findDatacenterForName(rootFolder, datacenterName); } if (datacenter == null) { // Another solution is to get datacenter object from datastore. datacenter = DatacenterHelper.findDatacenterFromDatastore(rootFolder, datastoreName); } if (datacenter == null && datastoreName != null) { throw new DatacenterNotFoundException( "Cannot retrieve datacenter, cause: datacenter not found for the datastore: " + datastore.getName()); } else if (datacenter == null && datastoreName == null) { throw new DatacenterNotFoundException( "Cannot retrieve datacenter, cause: no datastore defined for this virtual disk : " + this.getTitle()); } else { this.setDatacenterName(datacenter.getName()); } if (vmName == null) { for (InstancevmwareConnector compute : computes) { vmName = compute.getTitle(); break; } } }
void function() throws DatastoreNotFoundException, DatacenterNotFoundException { Folder rootFolder = vCenterClient.getServiceInstance().getRootFolder(); List<InstancevmwareConnector> computes = getLinkedComputes(); VmwarefoldersConnector vmFolders = getMixinVmwarefolders(); if (vmFolders != null) { String datacenterTmp = vmFolders.getDatacentername(); String datastoreTmp = vmFolders.getDatastorename(); if (datacenterTmp != null && !datacenterTmp.trim().isEmpty()) { datacenterName = datacenterTmp; } if (datastoreTmp != null && !datastoreTmp.trim().isEmpty()) { datastoreName = datastoreTmp; } } if (datastoreName != null) { datastore = DatastoreHelper.findDatastoreForName(rootFolder, datastoreName); if (datastore == null) { throw new DatastoreNotFoundException( STR + datastoreName); } } else { for (InstancevmwareConnector compute : computes) { String vmNameTmp = compute.getTitle(); VirtualMachine vm = VMHelper.findVMForName(rootFolder, vmNameTmp); Map<String, VirtualDisk> vdisks = VolumeHelper.getVirtualDiskForVM(vm); VirtualDisk vdiskOut = null; if (vdisks != null && !vdisks.isEmpty()) { for (Map.Entry<String, VirtualDisk> entry : vdisks.entrySet()) { String diskName = entry.getKey(); String tmp = diskName.replace(".vmdk", STR]STR/STRCannot retrieve datacenter, cause: datacenter not found for the datastore: STRCannot retrieve datacenter, cause: no datastore defined for this virtual disk : " + this.getTitle()); } else { this.setDatacenterName(datacenter.getName()); } if (vmName == null) { for (InstancevmwareConnector compute : computes) { vmName = compute.getTitle(); break; } } }
/** * Load from referenced objects, the datacenter information and datastore. */
Load from referenced objects, the datacenter information and datastore
loadDatastoreAndDatacenter
{ "repo_name": "occiware/Multi-Cloud-Studio", "path": "plugins/org.eclipse.cmf.occi.multicloud.vmware.connector/src-gen/org/eclipse/cmf/occi/multicloud/vmware/connector/StoragevmwareConnector.java", "license": "epl-1.0", "size": 35234 }
[ "com.vmware.vim25.VirtualDisk", "com.vmware.vim25.mo.Folder", "com.vmware.vim25.mo.VirtualMachine", "java.util.List", "java.util.Map", "org.eclipse.cmf.occi.multicloud.vmware.connector.driver.exceptions.DatacenterNotFoundException", "org.eclipse.cmf.occi.multicloud.vmware.connector.driver.exceptions.Dat...
import com.vmware.vim25.VirtualDisk; import com.vmware.vim25.mo.Folder; import com.vmware.vim25.mo.VirtualMachine; import java.util.List; import java.util.Map; import org.eclipse.cmf.occi.multicloud.vmware.connector.driver.exceptions.DatacenterNotFoundException; import org.eclipse.cmf.occi.multicloud.vmware.connector.driver.exceptions.DatastoreNotFoundException; import org.ecplise.cmf.occi.multicloud.vmware.connector.driver.DatastoreHelper; import org.ecplise.cmf.occi.multicloud.vmware.connector.driver.VMHelper; import org.ecplise.cmf.occi.multicloud.vmware.connector.driver.VolumeHelper;
import com.vmware.vim25.*; import com.vmware.vim25.mo.*; import java.util.*; import org.eclipse.cmf.occi.multicloud.vmware.connector.driver.exceptions.*; import org.ecplise.cmf.occi.multicloud.vmware.connector.driver.*;
[ "com.vmware.vim25", "java.util", "org.eclipse.cmf", "org.ecplise.cmf" ]
com.vmware.vim25; java.util; org.eclipse.cmf; org.ecplise.cmf;
413,730
public CountDownLatch updatePackageAsync(com.mozu.api.contracts.commerceruntime.fulfillment.Package pkg, String returnId, String packageId, String responseFields, AsyncCallback<com.mozu.api.contracts.commerceruntime.fulfillment.Package> callback) throws Exception { MozuClient<com.mozu.api.contracts.commerceruntime.fulfillment.Package> client = com.mozu.api.clients.commerce.returns.PackageClient.updatePackageClient( pkg, returnId, packageId, responseFields); client.setContext(_apiContext); return client.executeRequest(callback); }
CountDownLatch function(com.mozu.api.contracts.commerceruntime.fulfillment.Package pkg, String returnId, String packageId, String responseFields, AsyncCallback<com.mozu.api.contracts.commerceruntime.fulfillment.Package> callback) throws Exception { MozuClient<com.mozu.api.contracts.commerceruntime.fulfillment.Package> client = com.mozu.api.clients.commerce.returns.PackageClient.updatePackageClient( pkg, returnId, packageId, responseFields); client.setContext(_apiContext); return client.executeRequest(callback); }
/** * Updates one or more properties of a package associated with a return replacement. * <p><pre><code> * Package package = new Package(); * CountDownLatch latch = package.updatePackage( pkg, returnId, packageId, responseFields, callback ); * latch.await() * </code></pre></p> * @param packageId Unique identifier of the package for which to retrieve the label. * @param responseFields Use this field to include those fields which are not included by default. * @param returnId Unique identifier of the return whose items you want to get. * @param callback callback handler for asynchronous operations * @param package Properties of a physical package shipped for an order. * @return com.mozu.api.contracts.commerceruntime.fulfillment.Package * @see com.mozu.api.contracts.commerceruntime.fulfillment.Package * @see com.mozu.api.contracts.commerceruntime.fulfillment.Package */
Updates one or more properties of a package associated with a return replacement. <code><code> Package package = new Package(); CountDownLatch latch = package.updatePackage( pkg, returnId, packageId, responseFields, callback ); latch.await() * </code></code>
updatePackageAsync
{ "repo_name": "bhewett/mozu-java", "path": "mozu-javaasync-core/src/main/java/com/mozu/api/resources/commerce/returns/PackageResource.java", "license": "mit", "size": 16398 }
[ "com.mozu.api.AsyncCallback", "com.mozu.api.MozuClient", "java.util.concurrent.CountDownLatch" ]
import com.mozu.api.AsyncCallback; import com.mozu.api.MozuClient; import java.util.concurrent.CountDownLatch;
import com.mozu.api.*; import java.util.concurrent.*;
[ "com.mozu.api", "java.util" ]
com.mozu.api; java.util;
1,647,366
Assert.fail( "Test 'TrialService_getDutyRosterTurnTitlesTest.testSuccessPath()}' not implemented." ); }
Assert.fail( STR ); }
/** * Test succes path for service method <code>getDutyRosterTurnTitles</code> * * Tests expected behaviour of service method. */
Test succes path for service method <code>getDutyRosterTurnTitles</code> Tests expected behaviour of service method
testSuccessPath
{ "repo_name": "phoenixctms/ctsms", "path": "core/src/test/java/org/phoenixctms/ctsms/service/trial/test/TrialService_getDutyRosterTurnTitlesTest.java", "license": "lgpl-2.1", "size": 1373 }
[ "org.testng.Assert" ]
import org.testng.Assert;
import org.testng.*;
[ "org.testng" ]
org.testng;
313,395
@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.LibrariesBrowser_Settings_menu: startActivity(new Intent(getActivity(), SettingsActivity.class)); break; } return false; }
boolean function(MenuItem item) { switch (item.getItemId()) { case R.id.LibrariesBrowser_Settings_menu: startActivity(new Intent(getActivity(), SettingsActivity.class)); break; } return false; }
/** * Handles the event when an option is selected from the option menu. */
Handles the event when an option is selected from the option menu
onOptionsItemSelected
{ "repo_name": "MarcMeszaros/papyrus", "path": "src/main/java/ca/marcmeszaros/papyrus/fragments/LibraryListFragment.java", "license": "apache-2.0", "size": 9650 }
[ "android.content.Intent", "android.view.MenuItem", "ca.marcmeszaros.papyrus.activities.SettingsActivity" ]
import android.content.Intent; import android.view.MenuItem; import ca.marcmeszaros.papyrus.activities.SettingsActivity;
import android.content.*; import android.view.*; import ca.marcmeszaros.papyrus.activities.*;
[ "android.content", "android.view", "ca.marcmeszaros.papyrus" ]
android.content; android.view; ca.marcmeszaros.papyrus;
641,073
public static MozuClient<com.mozu.api.contracts.customer.CustomerSegment> getSegmentClient(Integer id) throws Exception { return getSegmentClient( id, null); }
static MozuClient<com.mozu.api.contracts.customer.CustomerSegment> function(Integer id) throws Exception { return getSegmentClient( id, null); }
/** * Retrieves the details of the customer segment specified in the request. This operation does not return a list of the customer accounts associated with the segment. * <p><pre><code> * MozuClient<com.mozu.api.contracts.customer.CustomerSegment> mozuClient=GetSegmentClient( id); * client.setBaseAddress(url); * client.executeRequest(); * CustomerSegment customerSegment = client.Result(); * </code></pre></p> * @param id Unique identifier of the customer segment to retrieve. * @return Mozu.Api.MozuClient <com.mozu.api.contracts.customer.CustomerSegment> * @see com.mozu.api.contracts.customer.CustomerSegment */
Retrieves the details of the customer segment specified in the request. This operation does not return a list of the customer accounts associated with the segment. <code><code> MozuClient mozuClient=GetSegmentClient( id); client.setBaseAddress(url); client.executeRequest(); CustomerSegment customerSegment = client.Result(); </code></code>
getSegmentClient
{ "repo_name": "bhewett/mozu-java", "path": "mozu-java-core/src/main/java/com/mozu/api/clients/commerce/customer/CustomerSegmentClient.java", "license": "mit", "size": 13733 }
[ "com.mozu.api.MozuClient" ]
import com.mozu.api.MozuClient;
import com.mozu.api.*;
[ "com.mozu.api" ]
com.mozu.api;
1,249,358
public Embedding project(List<Integer> propertyWhiteList) { byte[] newPropertyData = new byte[0]; for (int index : propertyWhiteList) { newPropertyData = ArrayUtils.addAll(newPropertyData, getRawProperty(index)); } return new Embedding(idData, newPropertyData, idListData); }
Embedding function(List<Integer> propertyWhiteList) { byte[] newPropertyData = new byte[0]; for (int index : propertyWhiteList) { newPropertyData = ArrayUtils.addAll(newPropertyData, getRawProperty(index)); } return new Embedding(idData, newPropertyData, idListData); }
/** * Projects the stored Properties. Only the white-listed properties will be kept * @param propertyWhiteList list of property indices * @return Embedding with the projected property list */
Projects the stored Properties. Only the white-listed properties will be kept
project
{ "repo_name": "galpha/gradoop", "path": "gradoop-flink/src/main/java/org/gradoop/flink/model/impl/operators/matching/single/cypher/pojos/Embedding.java", "license": "apache-2.0", "size": 21630 }
[ "java.util.List", "org.apache.commons.lang3.ArrayUtils" ]
import java.util.List; import org.apache.commons.lang3.ArrayUtils;
import java.util.*; import org.apache.commons.lang3.*;
[ "java.util", "org.apache.commons" ]
java.util; org.apache.commons;
842,024
public DetailsParallax getParallax() { if (mDetailsParallax == null) { mDetailsParallax = new DetailsParallax(); if (mRowsFragment != null && mRowsFragment.getView() != null) { mDetailsParallax.setRecyclerView(mRowsFragment.getVerticalGridView()); } } return mDetailsParallax; }
DetailsParallax function() { if (mDetailsParallax == null) { mDetailsParallax = new DetailsParallax(); if (mRowsFragment != null && mRowsFragment.getView() != null) { mDetailsParallax.setRecyclerView(mRowsFragment.getVerticalGridView()); } } return mDetailsParallax; }
/** * Returns the {@link DetailsParallax} instance used by * {@link DetailsFragmentBackgroundController} to configure parallax effect of background and * control embedded video playback. App usually does not use this method directly. * App may use this method for other custom parallax tasks. * * @return The DetailsParallax instance attached to the DetailsFragment. */
Returns the <code>DetailsParallax</code> instance used by <code>DetailsFragmentBackgroundController</code> to configure parallax effect of background and control embedded video playback. App usually does not use this method directly. App may use this method for other custom parallax tasks
getParallax
{ "repo_name": "AndroidX/androidx", "path": "leanback/leanback/src/main/java/androidx/leanback/app/DetailsFragment.java", "license": "apache-2.0", "size": 41358 }
[ "androidx.leanback.widget.DetailsParallax" ]
import androidx.leanback.widget.DetailsParallax;
import androidx.leanback.widget.*;
[ "androidx.leanback" ]
androidx.leanback;
1,702,909
public UserPermissionDto insertProjectPermissionOnUser(UserDto user, String permission, ComponentDto project) { UserPermissionDto dto = new UserPermissionDto(project.getOrganizationUuid(), permission, user.getId(), project.getId()); db.getDbClient().userPermissionDao().insert(db.getSession(), dto); db.commit(); return dto; }
UserPermissionDto function(UserDto user, String permission, ComponentDto project) { UserPermissionDto dto = new UserPermissionDto(project.getOrganizationUuid(), permission, user.getId(), project.getId()); db.getDbClient().userPermissionDao().insert(db.getSession(), dto); db.commit(); return dto; }
/** * Grant permission on given project */
Grant permission on given project
insertProjectPermissionOnUser
{ "repo_name": "lbndev/sonarqube", "path": "server/sonar-db-dao/src/test/java/org/sonar/db/user/UserDbTester.java", "license": "lgpl-3.0", "size": 11303 }
[ "org.sonar.db.component.ComponentDto", "org.sonar.db.permission.UserPermissionDto" ]
import org.sonar.db.component.ComponentDto; import org.sonar.db.permission.UserPermissionDto;
import org.sonar.db.component.*; import org.sonar.db.permission.*;
[ "org.sonar.db" ]
org.sonar.db;
864,206
public ParticleDescription addFadeColor(Color fadeColor) { fadeColors.add(fadeColor); return this; }
ParticleDescription function(Color fadeColor) { fadeColors.add(fadeColor); return this; }
/** * Adds a fade particle {@link Color}. * * @param fadeColor The fade particle {@link Color} to add. * @return This particle description. */
Adds a fade particle <code>Color</code>
addFadeColor
{ "repo_name": "QuarterCode/QuarterBukkit", "path": "plugin/src/main/java/com/quartercode/quarterbukkit/api/particle/ParticleDescription.java", "license": "gpl-3.0", "size": 6530 }
[ "org.bukkit.Color" ]
import org.bukkit.Color;
import org.bukkit.*;
[ "org.bukkit" ]
org.bukkit;
2,112,801
HashValue getContentHash();
HashValue getContentHash();
/** * Returns the hash of the resource(s) from which this metadata was created. */
Returns the hash of the resource(s) from which this metadata was created
getContentHash
{ "repo_name": "gstevey/gradle", "path": "subprojects/dependency-management/src/main/java/org/gradle/internal/component/external/model/ModuleComponentResolveMetadata.java", "license": "apache-2.0", "size": 2419 }
[ "org.gradle.internal.hash.HashValue" ]
import org.gradle.internal.hash.HashValue;
import org.gradle.internal.hash.*;
[ "org.gradle.internal" ]
org.gradle.internal;
382,477
public static long timeInMsOrTimeIfNullUnit(long time, TimeUnit timeUnit) { return timeUnit != null ? timeUnit.toMillis(time) : time; }
static long function(long time, TimeUnit timeUnit) { return timeUnit != null ? timeUnit.toMillis(time) : time; }
/** * Convert time to milliseconds based on the given time unit. * If time unit is null, then input time is treated as milliseconds. * * @param time The input time * @param timeUnit The time unit to base the conversion on * @return The millisecond representation of the time based on the unit, or the time * itself if the unit is <code>null</code> */
Convert time to milliseconds based on the given time unit. If time unit is null, then input time is treated as milliseconds
timeInMsOrTimeIfNullUnit
{ "repo_name": "mdogan/hazelcast", "path": "hazelcast/src/main/java/com/hazelcast/internal/util/TimeUtil.java", "license": "apache-2.0", "size": 4018 }
[ "java.util.concurrent.TimeUnit" ]
import java.util.concurrent.TimeUnit;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
2,141,445
public void startDocument( XMLLocator locator, String encoding, NamespaceContext namespaceContext, Augmentations augs) throws XNIException { fValidationState.setNamespaceSupport(namespaceContext); fState4XsiType.setNamespaceSupport(namespaceContext); fState4ApplyDefault.setNamespaceSupport(namespaceContext); fLocator = locator; handleStartDocument(locator, encoding); // call handlers if (fDocumentHandler != null) { fDocumentHandler.startDocument(locator, encoding, namespaceContext, augs); } } // startDocument(XMLLocator,String)
void function( XMLLocator locator, String encoding, NamespaceContext namespaceContext, Augmentations augs) throws XNIException { fValidationState.setNamespaceSupport(namespaceContext); fState4XsiType.setNamespaceSupport(namespaceContext); fState4ApplyDefault.setNamespaceSupport(namespaceContext); fLocator = locator; handleStartDocument(locator, encoding); if (fDocumentHandler != null) { fDocumentHandler.startDocument(locator, encoding, namespaceContext, augs); } }
/** * The start of the document. * * @param locator The system identifier of the entity if the entity * is external, null otherwise. * @param encoding The auto-detected IANA encoding name of the entity * stream. This value will be null in those situations * where the entity encoding is not auto-detected (e.g. * internal entities or a document entity that is * parsed from a java.io.Reader). * @param namespaceContext * The namespace context in effect at the * start of this document. * This object represents the current context. * Implementors of this class are responsible * for copying the namespace bindings from the * the current context (and its parent contexts) * if that information is important. * @param augs Additional information that may include infoset augmentations * * @throws XNIException Thrown by handler to signal an error. */
The start of the document
startDocument
{ "repo_name": "rokn/Count_Words_2015", "path": "testing/openjdk2/jaxp/src/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaValidator.java", "license": "mit", "size": 178126 }
[ "com.sun.org.apache.xerces.internal.xni.Augmentations", "com.sun.org.apache.xerces.internal.xni.NamespaceContext", "com.sun.org.apache.xerces.internal.xni.XMLLocator", "com.sun.org.apache.xerces.internal.xni.XNIException" ]
import com.sun.org.apache.xerces.internal.xni.Augmentations; import com.sun.org.apache.xerces.internal.xni.NamespaceContext; import com.sun.org.apache.xerces.internal.xni.XMLLocator; import com.sun.org.apache.xerces.internal.xni.XNIException;
import com.sun.org.apache.xerces.internal.xni.*;
[ "com.sun.org" ]
com.sun.org;
89,223
public void commit ( String tid ) throws RemoteException, RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException;
void function ( String tid ) throws RemoteException, RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException;
/** * Commit the transaction. * * @param tid * The tid of the tx to commit. */
Commit the transaction
commit
{ "repo_name": "hmalphettes/atomikos-essentials-3.5.8-osgified-sandbox", "path": "com.atomikos.transactions.jta/src/com/atomikos/icatch/jta/UserTransactionServer.java", "license": "apache-2.0", "size": 3354 }
[ "java.rmi.RemoteException", "javax.transaction.HeuristicMixedException", "javax.transaction.HeuristicRollbackException", "javax.transaction.RollbackException", "javax.transaction.SystemException" ]
import java.rmi.RemoteException; import javax.transaction.HeuristicMixedException; import javax.transaction.HeuristicRollbackException; import javax.transaction.RollbackException; import javax.transaction.SystemException;
import java.rmi.*; import javax.transaction.*;
[ "java.rmi", "javax.transaction" ]
java.rmi; javax.transaction;
186,802
public static String loadPreferenceString(String key, Context context) { SharedPreferences preferences = context.getSharedPreferences(PREF_FILE__NAME, Context.MODE_PRIVATE); return preferences.getString(key, ""); }
static String function(String key, Context context) { SharedPreferences preferences = context.getSharedPreferences(PREF_FILE__NAME, Context.MODE_PRIVATE); return preferences.getString(key, ""); }
/** * Loads a string shared preference value represented by the given key. * * @param key the key by which we refer the shared preference value. * @param context the context used for getting the shared pref file. * @return the value referred by the key or empty string if the key isn't saved. */
Loads a string shared preference value represented by the given key
loadPreferenceString
{ "repo_name": "andr0idsensei/soladroid", "path": "app/src/main/java/com/androidsensei/soladroid/utils/SharedPrefsUtil.java", "license": "apache-2.0", "size": 2798 }
[ "android.content.Context", "android.content.SharedPreferences" ]
import android.content.Context; import android.content.SharedPreferences;
import android.content.*;
[ "android.content" ]
android.content;
611,107
public static <T> void verifyTypeAdapterGeneration(@NotNull Class<T> clazz) throws Exception { TypeAdapter<T> typeAdapter = getTypeAdapter(clazz); assertNotNull("Type adapter should have been generated by Stag", typeAdapter); }
static <T> void function(@NotNull Class<T> clazz) throws Exception { TypeAdapter<T> typeAdapter = getTypeAdapter(clazz); assertNotNull(STR, typeAdapter); }
/** * Verifies that a TypeAdapter was generated for the specified class. * * @param clazz the class to check. * @param <T> the type of the class, used internally. * @throws Exception throws an exception if an adapter was not generated. */
Verifies that a TypeAdapter was generated for the specified class
verifyTypeAdapterGeneration
{ "repo_name": "Flipkart/stag-java", "path": "integration-test-android/src/test/java/com/vimeo/integration_test_android/Utils.java", "license": "mit", "size": 3008 }
[ "com.google.gson.TypeAdapter", "org.jetbrains.annotations.NotNull", "org.junit.Assert" ]
import com.google.gson.TypeAdapter; import org.jetbrains.annotations.NotNull; import org.junit.Assert;
import com.google.gson.*; import org.jetbrains.annotations.*; import org.junit.*;
[ "com.google.gson", "org.jetbrains.annotations", "org.junit" ]
com.google.gson; org.jetbrains.annotations; org.junit;
681,908
void onDeferredEndDrag(DragView dragView) { dragView.remove(); if (mDragObject.deferDragViewCleanupPostAnimation) { // If we skipped calling onDragEnd() before, do it now for (DragListener listener : new ArrayList<>(mListeners)) { listener.onDragEnd(); } } }
void onDeferredEndDrag(DragView dragView) { dragView.remove(); if (mDragObject.deferDragViewCleanupPostAnimation) { for (DragListener listener : new ArrayList<>(mListeners)) { listener.onDragEnd(); } } }
/** * This only gets called as a result of drag view cleanup being deferred in endDrag(); */
This only gets called as a result of drag view cleanup being deferred in endDrag()
onDeferredEndDrag
{ "repo_name": "lcg833/Trebuchet", "path": "Trebuchet/src/main/java/com/android/launcher3/DragController.java", "license": "gpl-3.0", "size": 30260 }
[ "java.util.ArrayList" ]
import java.util.ArrayList;
import java.util.*;
[ "java.util" ]
java.util;
962,501
private void setupSeeker(ExtractorInput input) throws IOException, InterruptedException { // Read the first frame which may contain a Xing or VBRI header with seeking metadata. ParsableByteArray frame = new ParsableByteArray(synchronizedHeader.frameSize); input.peekFully(frame.data, 0, synchronizedHeader.frameSize); long position = input.getPosition(); long length = input.getLength(); int headerData = 0; // Check if there is a Xing header. int xingBase = (synchronizedHeader.version & 1) != 0 ? (synchronizedHeader.channels != 1 ? 36 : 21) // MPEG 1 : (synchronizedHeader.channels != 1 ? 21 : 13); // MPEG 2 or 2.5 if (frame.limit() >= xingBase + 4) { frame.setPosition(xingBase); headerData = frame.readInt(); } if (headerData == XING_HEADER || headerData == INFO_HEADER) { seeker = XingSeeker.create(synchronizedHeader, frame, position, length); if (seeker != null && gaplessInfo == null) { // If there is a Xing header, read gapless playback metadata at a fixed offset. input.resetPeekPosition(); input.advancePeekPosition(xingBase + 141); input.peekFully(scratch.data, 0, 3); scratch.setPosition(0); gaplessInfo = GaplessInfo.createFromXingHeaderValue(scratch.readUnsignedInt24()); } input.skipFully(synchronizedHeader.frameSize); } else if (frame.limit() >= 40) { // Check if there is a VBRI header. frame.setPosition(36); // MPEG audio header (4 bytes) + 32 bytes. headerData = frame.readInt(); if (headerData == VBRI_HEADER) { seeker = VbriSeeker.create(synchronizedHeader, frame, position, length); input.skipFully(synchronizedHeader.frameSize); } } if (seeker == null) { // Repopulate the synchronized header in case we had to skip an invalid seeking header, which // would give an invalid CBR bitrate. input.resetPeekPosition(); input.peekFully(scratch.data, 0, 4); scratch.setPosition(0); MpegAudioHeader.populateHeader(scratch.readInt(), synchronizedHeader); seeker = new ConstantBitrateSeeker(input.getPosition(), synchronizedHeader.bitrate, length); } } interface Seeker extends SeekMap {
void function(ExtractorInput input) throws IOException, InterruptedException { ParsableByteArray frame = new ParsableByteArray(synchronizedHeader.frameSize); input.peekFully(frame.data, 0, synchronizedHeader.frameSize); long position = input.getPosition(); long length = input.getLength(); int headerData = 0; int xingBase = (synchronizedHeader.version & 1) != 0 ? (synchronizedHeader.channels != 1 ? 36 : 21) : (synchronizedHeader.channels != 1 ? 21 : 13); if (frame.limit() >= xingBase + 4) { frame.setPosition(xingBase); headerData = frame.readInt(); } if (headerData == XING_HEADER headerData == INFO_HEADER) { seeker = XingSeeker.create(synchronizedHeader, frame, position, length); if (seeker != null && gaplessInfo == null) { input.resetPeekPosition(); input.advancePeekPosition(xingBase + 141); input.peekFully(scratch.data, 0, 3); scratch.setPosition(0); gaplessInfo = GaplessInfo.createFromXingHeaderValue(scratch.readUnsignedInt24()); } input.skipFully(synchronizedHeader.frameSize); } else if (frame.limit() >= 40) { frame.setPosition(36); headerData = frame.readInt(); if (headerData == VBRI_HEADER) { seeker = VbriSeeker.create(synchronizedHeader, frame, position, length); input.skipFully(synchronizedHeader.frameSize); } } if (seeker == null) { input.resetPeekPosition(); input.peekFully(scratch.data, 0, 4); scratch.setPosition(0); MpegAudioHeader.populateHeader(scratch.readInt(), synchronizedHeader); seeker = new ConstantBitrateSeeker(input.getPosition(), synchronizedHeader.bitrate, length); } } interface Seeker extends SeekMap {
/** * Sets {@link #seeker} to seek using metadata read from {@code input}, which should provide data * from the start of the first frame in the stream. On returning, the input's position will be set * to the start of the first frame of audio. * * @param input The {@link ExtractorInput} from which to read. * @throws IOException Thrown if there was an error reading from the stream. Not expected if the * next two frames were already peeked during synchronization. * @throws InterruptedException Thrown if reading from the stream was interrupted. Not expected if * the next two frames were already peeked during synchronization. */
Sets <code>#seeker</code> to seek using metadata read from input, which should provide data from the start of the first frame in the stream. On returning, the input's position will be set to the start of the first frame of audio
setupSeeker
{ "repo_name": "kj2648/ExoplayerMultitrackTry", "path": "library/src/main/java/com/google/android/exoplayer/extractor/mp3/Mp3Extractor.java", "license": "apache-2.0", "size": 12972 }
[ "com.google.android.exoplayer.extractor.ExtractorInput", "com.google.android.exoplayer.extractor.GaplessInfo", "com.google.android.exoplayer.extractor.SeekMap", "com.google.android.exoplayer.util.MpegAudioHeader", "com.google.android.exoplayer.util.ParsableByteArray", "java.io.IOException" ]
import com.google.android.exoplayer.extractor.ExtractorInput; import com.google.android.exoplayer.extractor.GaplessInfo; import com.google.android.exoplayer.extractor.SeekMap; import com.google.android.exoplayer.util.MpegAudioHeader; import com.google.android.exoplayer.util.ParsableByteArray; import java.io.IOException;
import com.google.android.exoplayer.extractor.*; import com.google.android.exoplayer.util.*; import java.io.*;
[ "com.google.android", "java.io" ]
com.google.android; java.io;
575,266
@Override public void notifyChanged(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(RelationalForeignKey.class)) { case RelationalMetaModelPackage.RELATIONAL_FOREIGN_KEY__NAME: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; } super.notifyChanged(notification); }
void function(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(RelationalForeignKey.class)) { case RelationalMetaModelPackage.RELATIONAL_FOREIGN_KEY__NAME: fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); return; } super.notifyChanged(notification); }
/** * This handles model notifications by calling {@link #updateChildren} to update any cached * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This handles model notifications by calling <code>#updateChildren</code> to update any cached children and by creating a viewer notification, which it passes to <code>#fireNotifyChanged</code>.
notifyChanged
{ "repo_name": "KuehneThomas/model-to-model-transformation-generator", "path": "src/MetaModels.Relational.edit/src/relationalMetaModel/provider/RelationalForeignKeyItemProvider.java", "license": "mit", "size": 5602 }
[ "org.eclipse.emf.common.notify.Notification", "org.eclipse.emf.edit.provider.ViewerNotification" ]
import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.edit.provider.ViewerNotification;
import org.eclipse.emf.common.notify.*; import org.eclipse.emf.edit.provider.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
630,620
public DataNode setRatio(IDataset ratio);
DataNode function(IDataset ratio);
/** * pulse reduction factor of this chopper in relation to other * choppers/fastest pulse in the instrument * <p> * <b>Type:</b> NX_INT * </p> * * @param ratio the ratio */
pulse reduction factor of this chopper in relation to other choppers/fastest pulse in the instrument Type: NX_INT
setRatio
{ "repo_name": "colinpalmer/dawnsci", "path": "org.eclipse.dawnsci.nexus/autogen/org/eclipse/dawnsci/nexus/NXdisk_chopper.java", "license": "epl-1.0", "size": 11747 }
[ "org.eclipse.dawnsci.analysis.api.dataset.IDataset", "org.eclipse.dawnsci.analysis.api.tree.DataNode" ]
import org.eclipse.dawnsci.analysis.api.dataset.IDataset; import org.eclipse.dawnsci.analysis.api.tree.DataNode;
import org.eclipse.dawnsci.analysis.api.dataset.*; import org.eclipse.dawnsci.analysis.api.tree.*;
[ "org.eclipse.dawnsci" ]
org.eclipse.dawnsci;
2,880,912
CompletableFuture<Boolean> hasMessageAvailableAsync();
CompletableFuture<Boolean> hasMessageAvailableAsync();
/** * Asynchronously check if there is any message available to read from the current position. * * <p>This check can be used by an application to scan through a topic and stop when the reader reaches the current * last published message. * * @return a future that will yield true if the are messages available to be read, false otherwise, or a * {@link PulsarClientException} if there was any error in the operation */
Asynchronously check if there is any message available to read from the current position. This check can be used by an application to scan through a topic and stop when the reader reaches the current last published message
hasMessageAvailableAsync
{ "repo_name": "yahoo/pulsar", "path": "pulsar-client-api/src/main/java/org/apache/pulsar/client/api/Reader.java", "license": "apache-2.0", "size": 9116 }
[ "java.util.concurrent.CompletableFuture" ]
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
55,921
public boolean isCaseSensitive(int column) throws java.sql.SQLException { Field field = getField(column); int sqlType = field.getSQLType(); switch (sqlType) { case Types.BIT: case Types.TINYINT: case Types.SMALLINT: case Types.INTEGER: case Types.BIGINT: case Types.FLOAT: case Types.REAL: case Types.DOUBLE: case Types.DATE: case Types.TIME: case Types.TIMESTAMP: return false; case Types.CHAR: case Types.VARCHAR: case Types.LONGVARCHAR: if (field.isBinary()) { return true; } String collationName = field.getCollation(); return ((collationName != null) && !collationName.endsWith("_ci")); default: return true; } }
boolean function(int column) throws java.sql.SQLException { Field field = getField(column); int sqlType = field.getSQLType(); switch (sqlType) { case Types.BIT: case Types.TINYINT: case Types.SMALLINT: case Types.INTEGER: case Types.BIGINT: case Types.FLOAT: case Types.REAL: case Types.DOUBLE: case Types.DATE: case Types.TIME: case Types.TIMESTAMP: return false; case Types.CHAR: case Types.VARCHAR: case Types.LONGVARCHAR: if (field.isBinary()) { return true; } String collationName = field.getCollation(); return ((collationName != null) && !collationName.endsWith("_ci")); default: return true; } }
/** * Does a column's case matter? * * @param column * the first column is 1, the second is 2... * * @return true if so * * @throws java.sql.SQLException * if a database access error occurs */
Does a column's case matter
isCaseSensitive
{ "repo_name": "yyuu/libmysql-java", "path": "src/com/mysql/jdbc/ResultSetMetaData.java", "license": "gpl-2.0", "size": 22734 }
[ "java.sql.SQLException", "java.sql.Types" ]
import java.sql.SQLException; import java.sql.Types;
import java.sql.*;
[ "java.sql" ]
java.sql;
2,248,547
public KeyComponent getFirstKeyComponent() { return (KeyComponent) this.diagram.getDiagramComponent(((Relation)this.getObject()) .getFirstKey()); }
KeyComponent function() { return (KeyComponent) this.diagram.getDiagramComponent(((Relation)this.getObject()) .getFirstKey()); }
/** * Returns the diagram component representing the first key of this * relation. * * @return the diagram component for the first key. */
Returns the diagram component representing the first key of this relation
getFirstKeyComponent
{ "repo_name": "pubmed2ensembl/MartScript", "path": "src/org/biomart/builder/view/gui/diagrams/components/RelationComponent.java", "license": "lgpl-2.1", "size": 15418 }
[ "org.biomart.builder.model.Relation" ]
import org.biomart.builder.model.Relation;
import org.biomart.builder.model.*;
[ "org.biomart.builder" ]
org.biomart.builder;
735,861
private Map<String, String> getReportPlugins( Model model, boolean onlyIncludeInherited ) { Map<String, String> reportPlugins = new HashMap<String, String>(); try { for ( ReportPlugin plugin : model.getReporting().getPlugins() ) { String coord = getPluginCoords( plugin ); String version = getPluginVersion( plugin ); if ( version != null && ( !onlyIncludeInherited || getPluginInherited( plugin ) ) ) { reportPlugins.put( coord, version ); } } } catch ( NullPointerException e ) { // guess there are no plugins here } try { for ( Profile profile : model.getProfiles() ) { try { for ( ReportPlugin plugin : profile.getReporting().getPlugins() ) { String coord = getPluginCoords( plugin ); String version = getPluginVersion( plugin ); if ( version != null && ( !onlyIncludeInherited || getPluginInherited( plugin ) ) ) { reportPlugins.put( coord, version ); } } } catch ( NullPointerException e ) { // guess there are no plugins here } } } catch ( NullPointerException e ) { // guess there are no profiles here } return reportPlugins; }
Map<String, String> function( Model model, boolean onlyIncludeInherited ) { Map<String, String> reportPlugins = new HashMap<String, String>(); try { for ( ReportPlugin plugin : model.getReporting().getPlugins() ) { String coord = getPluginCoords( plugin ); String version = getPluginVersion( plugin ); if ( version != null && ( !onlyIncludeInherited getPluginInherited( plugin ) ) ) { reportPlugins.put( coord, version ); } } } catch ( NullPointerException e ) { } try { for ( Profile profile : model.getProfiles() ) { try { for ( ReportPlugin plugin : profile.getReporting().getPlugins() ) { String coord = getPluginCoords( plugin ); String version = getPluginVersion( plugin ); if ( version != null && ( !onlyIncludeInherited getPluginInherited( plugin ) ) ) { reportPlugins.put( coord, version ); } } } catch ( NullPointerException e ) { } } } catch ( NullPointerException e ) { } return reportPlugins; }
/** * Gets the report plugins of a specific project. * * @param model the model to get the report plugins from. * @param onlyIncludeInherited <code>true</code> to only return the plugins definitions that will be * inherited by child projects. * @return The map of effective plugin versions keyed by coordinates. * @since 1.0-alpha-1 */
Gets the report plugins of a specific project
getReportPlugins
{ "repo_name": "RabbitStewDio/versions-maven-plugin", "path": "src/main/java/org/codehaus/mojo/versions/DisplayPluginUpdatesMojo.java", "license": "apache-2.0", "size": 80397 }
[ "java.util.HashMap", "java.util.Map", "org.apache.maven.model.Model", "org.apache.maven.model.Profile", "org.apache.maven.model.ReportPlugin" ]
import java.util.HashMap; import java.util.Map; import org.apache.maven.model.Model; import org.apache.maven.model.Profile; import org.apache.maven.model.ReportPlugin;
import java.util.*; import org.apache.maven.model.*;
[ "java.util", "org.apache.maven" ]
java.util; org.apache.maven;
2,657,886
@Override public long getLong(int parameterIndex) throws SQLException { checkRegistered(parameterIndex); return getOpenResultSet().getLong(parameterIndex); }
long function(int parameterIndex) throws SQLException { checkRegistered(parameterIndex); return getOpenResultSet().getLong(parameterIndex); }
/** * Returns the value of the specified column as a long. * * @param parameterIndex the parameter index (1, 2, ...) * @return the value * @throws SQLException if the column is not found or if this object is * closed */
Returns the value of the specified column as a long
getLong
{ "repo_name": "miloszpiglas/h2mod", "path": "src/main/org/h2/jdbc/JdbcCallableStatement.java", "license": "mpl-2.0", "size": 53201 }
[ "java.sql.SQLException" ]
import java.sql.SQLException;
import java.sql.*;
[ "java.sql" ]
java.sql;
2,450,848
private final void consumeExpected(char expected) throws javax.xml.transform.TransformerException { if (tokenIs(expected)) { nextToken(); } else { error(XPATHErrorResources.ER_EXPECTED_BUT_FOUND, new Object[]{ String.valueOf(expected), m_token }); //"Expected "+expected+", but found: "+m_token); // Patch for Christina's gripe. She wants her errorHandler to return from // this error and continue trying to parse, rather than throwing an exception. // Without the patch, that put us into an endless loop. throw new XPathProcessorException(CONTINUE_AFTER_FATAL_ERROR); } }
final void function(char expected) throws javax.xml.transform.TransformerException { if (tokenIs(expected)) { nextToken(); } else { error(XPATHErrorResources.ER_EXPECTED_BUT_FOUND, new Object[]{ String.valueOf(expected), m_token }); throw new XPathProcessorException(CONTINUE_AFTER_FATAL_ERROR); } }
/** * Consume an expected token, throwing an exception if it * isn't there. * * @param expected the character to be expected. * * @throws javax.xml.transform.TransformerException */
Consume an expected token, throwing an exception if it isn't there
consumeExpected
{ "repo_name": "kcsl/immutability-benchmark", "path": "benchmark-applications/reiminfer-oopsla-2012/source/Xalan/src/org/apache/xpath/compiler/XPathParser.java", "license": "mit", "size": 65864 }
[ "javax.xml.transform.TransformerException", "org.apache.xpath.XPathProcessorException", "org.apache.xpath.res.XPATHErrorResources" ]
import javax.xml.transform.TransformerException; import org.apache.xpath.XPathProcessorException; import org.apache.xpath.res.XPATHErrorResources;
import javax.xml.transform.*; import org.apache.xpath.*; import org.apache.xpath.res.*;
[ "javax.xml", "org.apache.xpath" ]
javax.xml; org.apache.xpath;
1,759,223
public void remove() { ValidateHelper validate = validate("delete"); if (validate.hasErrors()) { Exceptions.runtime(validate.joinErrors("\n")); } // 删除本对象 Dao.remove("SysQuery.deleteSysQuery", this); }
void function() { ValidateHelper validate = validate(STR); if (validate.hasErrors()) { Exceptions.runtime(validate.joinErrors("\n")); } Dao.remove(STR, this); }
/** * <pre> * remove SysQuery by id * Usage : SysQuery.remove() * </pre> * * @author <a href="mailto:iffiff1@gmail.com">Tyler Chen</a> * @since 2017-11-09 */
<code> remove SysQuery by id Usage : SysQuery.remove() </code>
remove
{ "repo_name": "tylerchen/foss-qdp-project-v4", "path": "src/main/java/com/foreveross/qdp/domain/system/common/SysQuery.java", "license": "apache-2.0", "size": 13639 }
[ "org.iff.infra.util.Exceptions", "org.iff.infra.util.ValidateHelper", "org.iff.infra.util.mybatis.service.Dao" ]
import org.iff.infra.util.Exceptions; import org.iff.infra.util.ValidateHelper; import org.iff.infra.util.mybatis.service.Dao;
import org.iff.infra.util.*; import org.iff.infra.util.mybatis.service.*;
[ "org.iff.infra" ]
org.iff.infra;
787,065
private String getSubsystemCode(final Map<String, String> map) { if (map.containsKey(Constants.NS_ID_ELEM_SUBSYSTEM_CODE)) { return map.get(Constants.NS_ID_ELEM_SUBSYSTEM_CODE); } logger.warn(NOT_FOUND_LOG_PATTERN, Constants.NS_ID_ELEM_SUBSYSTEM_CODE); return null; }
String function(final Map<String, String> map) { if (map.containsKey(Constants.NS_ID_ELEM_SUBSYSTEM_CODE)) { return map.get(Constants.NS_ID_ELEM_SUBSYSTEM_CODE); } logger.warn(NOT_FOUND_LOG_PATTERN, Constants.NS_ID_ELEM_SUBSYSTEM_CODE); return null; }
/** * Reads the value of the "subsystemCode" key from the given Map and returns * the value of that key . If no "subsystemCode" key is found, null is * returned. * * @param map Map containing Member related variables as key-value-pairs * @return subsystem code as a String or null */
Reads the value of the "subsystemCode" key from the given Map and returns the value of that key . If no "subsystemCode" key is found, null is returned
getSubsystemCode
{ "repo_name": "petkivim/xrd4j", "path": "src/common/src/main/java/com/pkrete/xrd4j/common/deserializer/AbstractHeaderDeserializer.java", "license": "mit", "size": 17911 }
[ "com.pkrete.xrd4j.common.util.Constants", "java.util.Map" ]
import com.pkrete.xrd4j.common.util.Constants; import java.util.Map;
import com.pkrete.xrd4j.common.util.*; import java.util.*;
[ "com.pkrete.xrd4j", "java.util" ]
com.pkrete.xrd4j; java.util;
1,907,871
public Builder interpolator(CurveInterpolator interpolator) { JodaBeanUtils.notNull(interpolator, "interpolator"); this.interpolator = interpolator; return this; }
Builder function(CurveInterpolator interpolator) { JodaBeanUtils.notNull(interpolator, STR); this.interpolator = interpolator; return this; }
/** * Sets the interpolator used to find points on the curve. * @param interpolator the new value, not null * @return this, for chaining, not null */
Sets the interpolator used to find points on the curve
interpolator
{ "repo_name": "OpenGamma/Strata", "path": "modules/market/src/main/java/com/opengamma/strata/market/curve/InterpolatedNodalCurveDefinition.java", "license": "apache-2.0", "size": 34460 }
[ "com.opengamma.strata.market.curve.interpolator.CurveInterpolator", "org.joda.beans.JodaBeanUtils" ]
import com.opengamma.strata.market.curve.interpolator.CurveInterpolator; import org.joda.beans.JodaBeanUtils;
import com.opengamma.strata.market.curve.interpolator.*; import org.joda.beans.*;
[ "com.opengamma.strata", "org.joda.beans" ]
com.opengamma.strata; org.joda.beans;
1,468,538
@Override public boolean checkForAdditionalFields(Map<String, String> fieldValues) { return checkForAdditionalFieldsForDocumentType(fieldValues.get(DOCUMENT_TYPE_NAME_PARAM)); }
boolean function(Map<String, String> fieldValues) { return checkForAdditionalFieldsForDocumentType(fieldValues.get(DOCUMENT_TYPE_NAME_PARAM)); }
/** * Determines if there should be more search fields rendered based on already entered search criteria, and * generates additional form rows. */
Determines if there should be more search fields rendered based on already entered search criteria, and generates additional form rows
checkForAdditionalFields
{ "repo_name": "shahess/rice", "path": "rice-middleware/impl/src/main/java/org/kuali/rice/kew/impl/document/search/DocumentSearchCriteriaBoLookupableHelperService.java", "license": "apache-2.0", "size": 52078 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,609,096
@Test public void testUuidElementStringByteUUID() { UuidElement element = new UuidElement("f", UuidElement.UUID_SUBTTYPE, TEST_UUID); assertEquals("f : BinData( 4, 'ABEiM0RVZneImaq7zN3u/w==' )", element.toString()); assertEquals(UuidElement.UUID_SUBTTYPE, element.getSubType()); assertArrayEquals(STANDARD_BYTES, element.getValue()); assertEquals(TEST_UUID, element.getUuid()); element = new UuidElement("f", UuidElement.LEGACY_UUID_SUBTTYPE, TEST_UUID); assertEquals("f : BinData( 3, 'd2ZVRDMiEQD/7t3Mu6qZiA==' )", element.toString()); assertEquals(UuidElement.LEGACY_UUID_SUBTTYPE, element.getSubType()); assertArrayEquals(LEGACY_BYTES, element.getValue()); assertEquals(TEST_UUID, element.getUuid()); }
void function() { UuidElement element = new UuidElement("f", UuidElement.UUID_SUBTTYPE, TEST_UUID); assertEquals(STR, element.toString()); assertEquals(UuidElement.UUID_SUBTTYPE, element.getSubType()); assertArrayEquals(STANDARD_BYTES, element.getValue()); assertEquals(TEST_UUID, element.getUuid()); element = new UuidElement("f", UuidElement.LEGACY_UUID_SUBTTYPE, TEST_UUID); assertEquals(STR, element.toString()); assertEquals(UuidElement.LEGACY_UUID_SUBTTYPE, element.getSubType()); assertArrayEquals(LEGACY_BYTES, element.getValue()); assertEquals(TEST_UUID, element.getUuid()); }
/** * Test method for {@link UuidElement#UuidElement(String, byte, UUID)}. */
Test method for <code>UuidElement#UuidElement(String, byte, UUID)</code>
testUuidElementStringByteUUID
{ "repo_name": "allanbank/mongodb-async-driver", "path": "src/test/java/com/allanbank/mongodb/bson/element/UuidElementTest.java", "license": "apache-2.0", "size": 7875 }
[ "org.junit.Assert" ]
import org.junit.Assert;
import org.junit.*;
[ "org.junit" ]
org.junit;
689,981
private String makeQuery() { StringBuilder buffer = new StringBuilder(); buffer.append( "select " ); int possibleCount = _columnNames.length; int actualCount = 0; for ( int i = 0; i < possibleCount; i++ ) { String rawName = _columnNames[ i ]; if ( rawName == null ) { continue; } if ( actualCount > 0 ) { buffer.append( ", " ); } actualCount++; buffer.append( delimitedID( rawName ) ); } buffer.append( "\nfrom " ); buffer.append( delimitedID( _foreignSchemaName ) ); buffer.append( '.' ); buffer.append( delimitedID( _foreignTableName ) ); if ( _restriction != null ) { String clause = _restriction.toSQL(); if (clause != null) { clause = clause.trim(); if ( clause.length() != 0 ) { buffer.append( "\nwhere " + clause ); } } } return buffer.toString(); } private static String delimitedID( String text ) { return IdUtil.normalToDelimited( text ); }
String function() { StringBuilder buffer = new StringBuilder(); buffer.append( STR ); int possibleCount = _columnNames.length; int actualCount = 0; for ( int i = 0; i < possibleCount; i++ ) { String rawName = _columnNames[ i ]; if ( rawName == null ) { continue; } if ( actualCount > 0 ) { buffer.append( STR ); } actualCount++; buffer.append( delimitedID( rawName ) ); } buffer.append( STR ); buffer.append( delimitedID( _foreignSchemaName ) ); buffer.append( '.' ); buffer.append( delimitedID( _foreignTableName ) ); if ( _restriction != null ) { String clause = _restriction.toSQL(); if (clause != null) { clause = clause.trim(); if ( clause.length() != 0 ) { buffer.append( STR + clause ); } } } return buffer.toString(); } private static String delimitedID( String text ) { return IdUtil.normalToDelimited( text ); }
/** * <p> * Build the query which will be sent to the foreign database. * </p> */
Build the query which will be sent to the foreign database.
makeQuery
{ "repo_name": "scnakandala/derby", "path": "java/engine/org/apache/derby/vti/ForeignTableVTI.java", "license": "apache-2.0", "size": 12436 }
[ "org.apache.derby.iapi.util.IdUtil" ]
import org.apache.derby.iapi.util.IdUtil;
import org.apache.derby.iapi.util.*;
[ "org.apache.derby" ]
org.apache.derby;
754,323
private void checkVkpfMengenstaffelDto( VkpfMengenstaffelDto vkpfMengenstaffelDtoI) throws EJBExceptionLP { if (vkpfMengenstaffelDtoI == null) { throw new EJBExceptionLP(EJBExceptionLP.FEHLER_DTO_IS_NULL, new Exception()); } }
void function( VkpfMengenstaffelDto vkpfMengenstaffelDtoI) throws EJBExceptionLP { if (vkpfMengenstaffelDtoI == null) { throw new EJBExceptionLP(EJBExceptionLP.FEHLER_DTO_IS_NULL, new Exception()); } }
/** * Preconditions pruefen. * * @param vkpfMengenstaffelDtoI * VkpfMengenstaffelDto * @throws EJBExceptionLP * Ausnahme */
Preconditions pruefen
checkVkpfMengenstaffelDto
{ "repo_name": "erdincay/ejb", "path": "src/com/lp/server/artikel/ejbfac/VkPreisfindungFacBean.java", "license": "agpl-3.0", "size": 161149 }
[ "com.lp.server.artikel.service.VkpfMengenstaffelDto", "com.lp.util.EJBExceptionLP" ]
import com.lp.server.artikel.service.VkpfMengenstaffelDto; import com.lp.util.EJBExceptionLP;
import com.lp.server.artikel.service.*; import com.lp.util.*;
[ "com.lp.server", "com.lp.util" ]
com.lp.server; com.lp.util;
1,217,198
@Override protected void dropFewItems(boolean par1, int par2) { Item j = this.getDropItem(); this.dropItem(j, 1); }
void function(boolean par1, int par2) { Item j = this.getDropItem(); this.dropItem(j, 1); }
/** * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param * par2 - Level of Looting used to kill this mob. */
Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param par2 - Level of Looting used to kill this mob
dropFewItems
{ "repo_name": "Stormister/Rediscovered-Mod-1.7.10", "path": "src/main/java/com/stormister/rediscovered/EntityFish.java", "license": "gpl-3.0", "size": 7184 }
[ "net.minecraft.item.Item" ]
import net.minecraft.item.Item;
import net.minecraft.item.*;
[ "net.minecraft.item" ]
net.minecraft.item;
2,207,687
private static long longHashString (final String string) { if (string.isEmpty()) { return VictusLudusGame.rand.nextLong(); } long hash = 0L; for (int i = 0; i < string.length(); i++) { hash += Math.pow((string.charAt(i) * 63), string.length() - i); } return hash; }
static long function (final String string) { if (string.isEmpty()) { return VictusLudusGame.rand.nextLong(); } long hash = 0L; for (int i = 0; i < string.length(); i++) { hash += Math.pow((string.charAt(i) * 63), string.length() - i); } return hash; }
/** * Returns a hash code for this string as a long value * * @param string to hash * @return a long hash code */
Returns a hash code for this string as a long value
longHashString
{ "repo_name": "sabarjp/VictusLudus", "path": "victusludus/src/com/teamderpy/victusludus/gui/UINewOrganismMenu.java", "license": "mit", "size": 8117 }
[ "com.teamderpy.victusludus.VictusLudusGame" ]
import com.teamderpy.victusludus.VictusLudusGame;
import com.teamderpy.victusludus.*;
[ "com.teamderpy.victusludus" ]
com.teamderpy.victusludus;
1,631,005
private void synchronizeDebugger(final IDebugger oldDebugger, final IDebugger newDebugger) { if (oldDebugger != null) { oldDebugger.getProcessManager().removeListener(m_debuggerListener); final TargetProcessThread activeThread = oldDebugger.getProcessManager().getActiveThread(); if (activeThread != null) { synchronizeThreads(activeThread, null); } } if (newDebugger != null) { newDebugger.getProcessManager().addListener(m_debuggerListener); m_provider.setDebugger(newDebugger); final TargetProcessThread activeThread = newDebugger.getProcessManager().getActiveThread(); if (activeThread != null) { synchronizeThreads(null, activeThread); } } updateGui(); }
void function(final IDebugger oldDebugger, final IDebugger newDebugger) { if (oldDebugger != null) { oldDebugger.getProcessManager().removeListener(m_debuggerListener); final TargetProcessThread activeThread = oldDebugger.getProcessManager().getActiveThread(); if (activeThread != null) { synchronizeThreads(activeThread, null); } } if (newDebugger != null) { newDebugger.getProcessManager().addListener(m_debuggerListener); m_provider.setDebugger(newDebugger); final TargetProcessThread activeThread = newDebugger.getProcessManager().getActiveThread(); if (activeThread != null) { synchronizeThreads(null, activeThread); } } updateGui(); }
/** * Makes sure that the synchronizer is listening on the active debugger. * * @param oldDebugger The previously active debugger (or null). * @param newDebugger The currently active debugger (or null). */
Makes sure that the synchronizer is listening on the active debugger
synchronizeDebugger
{ "repo_name": "AmesianX/binnavi", "path": "src/main/java/com/google/security/zynamics/binnavi/Gui/Debug/MemoryPanel/CMemoryViewerSynchronizer.java", "license": "apache-2.0", "size": 12611 }
[ "com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger", "com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread" ]
import com.google.security.zynamics.binnavi.debug.debugger.interfaces.IDebugger; import com.google.security.zynamics.binnavi.debug.models.processmanager.TargetProcessThread;
import com.google.security.zynamics.binnavi.debug.debugger.interfaces.*; import com.google.security.zynamics.binnavi.debug.models.processmanager.*;
[ "com.google.security" ]
com.google.security;
2,729,533
Repository createNpmHosted(final String name, final String blobStoreName, final boolean strictContentTypeValidation, final WritePolicy writePolicy);
Repository createNpmHosted(final String name, final String blobStoreName, final boolean strictContentTypeValidation, final WritePolicy writePolicy);
/** * Create an Npm hosted repository. * @param name The name of the new Repository * @param blobStoreName The BlobStore the Repository should use * @param strictContentTypeValidation Whether or not the Repository should enforce strict content types * @param writePolicy The {@link WritePolicy} for the Repository * @return the newly created Repository */
Create an Npm hosted repository
createNpmHosted
{ "repo_name": "sonatype/nexus-public", "path": "plugins/nexus-script-plugin/src/main/java/org/sonatype/nexus/script/plugin/RepositoryApi.java", "license": "epl-1.0", "size": 25653 }
[ "org.sonatype.nexus.repository.Repository", "org.sonatype.nexus.repository.config.WritePolicy" ]
import org.sonatype.nexus.repository.Repository; import org.sonatype.nexus.repository.config.WritePolicy;
import org.sonatype.nexus.repository.*; import org.sonatype.nexus.repository.config.*;
[ "org.sonatype.nexus" ]
org.sonatype.nexus;
630,726
public static <N, E extends N, T extends N> void traverse(ReadableDocument<N, E, T> doc, N node, NodeAction<N> nodeAction) { for (; node != null; node = doc.getNextSibling(node)) { nodeAction.apply(node); traverse(doc, doc.getFirstChild(node), nodeAction); } }
static <N, E extends N, T extends N> void function(ReadableDocument<N, E, T> doc, N node, NodeAction<N> nodeAction) { for (; node != null; node = doc.getNextSibling(node)) { nodeAction.apply(node); traverse(doc, doc.getFirstChild(node), nodeAction); } }
/** * Apply action to a node and its descendants. * * @param doc view for traversing * @param node reference node * @param nodeAction action to apply to node and its descendants */
Apply action to a node and its descendants
traverse
{ "repo_name": "gburd/wave", "path": "src/org/waveprotocol/wave/model/document/util/DocHelper.java", "license": "apache-2.0", "size": 37653 }
[ "org.waveprotocol.wave.model.document.ReadableDocument" ]
import org.waveprotocol.wave.model.document.ReadableDocument;
import org.waveprotocol.wave.model.document.*;
[ "org.waveprotocol.wave" ]
org.waveprotocol.wave;
1,097,323
public void testNoResolvedType() throws Exception { // isXxx assertFalse(NO_RESOLVED_TYPE.isNoObjectType()); assertFalse(NO_RESOLVED_TYPE.isNoType()); assertTrue(NO_RESOLVED_TYPE.isNoResolvedType()); assertFalse(NO_RESOLVED_TYPE.isArrayType()); assertFalse(NO_RESOLVED_TYPE.isBooleanValueType()); assertFalse(NO_RESOLVED_TYPE.isDateType()); assertFalse(NO_RESOLVED_TYPE.isEnumElementType()); assertFalse(NO_RESOLVED_TYPE.isNullType()); assertFalse(NO_RESOLVED_TYPE.isNamedType()); assertTrue(NO_RESOLVED_TYPE.isNumber()); assertFalse(NO_RESOLVED_TYPE.isNumberObjectType()); assertFalse(NO_RESOLVED_TYPE.isNumberValueType()); assertTrue(NO_RESOLVED_TYPE.isObject()); assertFalse(NO_RESOLVED_TYPE.isFunctionPrototypeType()); assertFalse(NO_RESOLVED_TYPE.isRegexpType()); assertTrue(NO_RESOLVED_TYPE.isString()); assertFalse(NO_RESOLVED_TYPE.isStringObjectType()); assertFalse(NO_RESOLVED_TYPE.isStringValueType()); assertFalse(NO_RESOLVED_TYPE.isEnumType()); assertFalse(NO_RESOLVED_TYPE.isUnionType()); assertFalse(NO_RESOLVED_TYPE.isStruct()); assertFalse(NO_RESOLVED_TYPE.isDict()); assertFalse(NO_RESOLVED_TYPE.isAllType()); assertFalse(NO_RESOLVED_TYPE.isVoidType()); assertFalse(NO_RESOLVED_TYPE.isConstructor()); assertFalse(NO_RESOLVED_TYPE.isInstanceType()); // isSubtype assertTrue(NO_RESOLVED_TYPE.isSubtype(NO_RESOLVED_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(NO_OBJECT_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(ARRAY_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(BOOLEAN_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(BOOLEAN_OBJECT_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(DATE_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(ERROR_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(EVAL_ERROR_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(functionType)); assertTrue(NO_RESOLVED_TYPE.isSubtype(NULL_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(NUMBER_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(NUMBER_OBJECT_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(OBJECT_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(URI_ERROR_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(RANGE_ERROR_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(REFERENCE_ERROR_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(REGEXP_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(STRING_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(STRING_OBJECT_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(SYNTAX_ERROR_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(TYPE_ERROR_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(ALL_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(VOID_TYPE)); // canTestForEqualityWith assertCanTestForEqualityWith(NO_RESOLVED_TYPE, NO_RESOLVED_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, NO_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, NO_OBJECT_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, ARRAY_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, BOOLEAN_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, BOOLEAN_OBJECT_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, DATE_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, ERROR_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, EVAL_ERROR_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, functionType); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, NULL_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, NUMBER_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, NUMBER_OBJECT_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, OBJECT_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, URI_ERROR_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, RANGE_ERROR_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, REFERENCE_ERROR_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, REGEXP_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, STRING_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, STRING_OBJECT_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, SYNTAX_ERROR_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, TYPE_ERROR_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, ALL_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, VOID_TYPE); // canTestForShallowEqualityWith assertTrue( NO_RESOLVED_TYPE.canTestForShallowEqualityWith(NO_RESOLVED_TYPE)); assertTrue(NO_RESOLVED_TYPE.canTestForShallowEqualityWith(NO_OBJECT_TYPE)); assertTrue(NO_RESOLVED_TYPE.canTestForShallowEqualityWith(ARRAY_TYPE)); assertTrue(NO_RESOLVED_TYPE.canTestForShallowEqualityWith(BOOLEAN_TYPE)); assertTrue( NO_RESOLVED_TYPE.canTestForShallowEqualityWith(BOOLEAN_OBJECT_TYPE)); assertTrue(NO_RESOLVED_TYPE.canTestForShallowEqualityWith(DATE_TYPE)); assertTrue(NO_RESOLVED_TYPE.canTestForShallowEqualityWith(ERROR_TYPE)); assertTrue(NO_RESOLVED_TYPE.canTestForShallowEqualityWith(EVAL_ERROR_TYPE)); assertTrue(NO_RESOLVED_TYPE.canTestForShallowEqualityWith(functionType)); assertTrue(NO_RESOLVED_TYPE.canTestForShallowEqualityWith(NULL_TYPE)); assertTrue(NO_RESOLVED_TYPE.canTestForShallowEqualityWith(NUMBER_TYPE)); assertTrue( NO_RESOLVED_TYPE.canTestForShallowEqualityWith(NUMBER_OBJECT_TYPE)); assertTrue(NO_RESOLVED_TYPE.canTestForShallowEqualityWith(OBJECT_TYPE)); assertTrue(NO_RESOLVED_TYPE.canTestForShallowEqualityWith(URI_ERROR_TYPE)); assertTrue( NO_RESOLVED_TYPE.canTestForShallowEqualityWith(RANGE_ERROR_TYPE)); assertTrue( NO_RESOLVED_TYPE.canTestForShallowEqualityWith(REFERENCE_ERROR_TYPE)); assertTrue(NO_RESOLVED_TYPE.canTestForShallowEqualityWith(REGEXP_TYPE)); assertTrue(NO_RESOLVED_TYPE.canTestForShallowEqualityWith(STRING_TYPE)); assertTrue( NO_RESOLVED_TYPE.canTestForShallowEqualityWith(STRING_OBJECT_TYPE)); assertTrue( NO_RESOLVED_TYPE.canTestForShallowEqualityWith(SYNTAX_ERROR_TYPE)); assertTrue(NO_RESOLVED_TYPE.canTestForShallowEqualityWith(TYPE_ERROR_TYPE)); assertTrue(NO_RESOLVED_TYPE.canTestForShallowEqualityWith(ALL_TYPE)); assertTrue(NO_RESOLVED_TYPE.canTestForShallowEqualityWith(VOID_TYPE)); // isNullable assertTrue(NO_RESOLVED_TYPE.isNullable()); assertTrue(NO_RESOLVED_TYPE.isVoidable()); // isObject assertTrue(NO_RESOLVED_TYPE.isObject()); // matchesXxx assertTrue(NO_RESOLVED_TYPE.matchesInt32Context()); assertTrue(NO_RESOLVED_TYPE.matchesNumberContext()); assertTrue(NO_RESOLVED_TYPE.matchesObjectContext()); assertTrue(NO_RESOLVED_TYPE.matchesStringContext()); assertTrue(NO_RESOLVED_TYPE.matchesUint32Context()); // toString assertEquals("NoResolvedType", NO_RESOLVED_TYPE.toString()); assertEquals(null, NO_RESOLVED_TYPE.getDisplayName()); assertFalse(NO_RESOLVED_TYPE.hasDisplayName()); // getPropertyType assertTypeEquals(CHECKED_UNKNOWN_TYPE, NO_RESOLVED_TYPE.getPropertyType("anyProperty")); Asserts.assertResolvesToSame(NO_RESOLVED_TYPE); assertTrue(forwardDeclaredNamedType.isEmptyType()); assertTrue(forwardDeclaredNamedType.isNoResolvedType()); UnionType nullable = (UnionType) registry.createNullableType(NO_RESOLVED_TYPE); assertTypeEquals( nullable, nullable.getGreatestSubtype(NULL_TYPE)); assertTypeEquals(NO_RESOLVED_TYPE, nullable.getRestrictedUnion(NULL_TYPE)); }
void function() throws Exception { assertFalse(NO_RESOLVED_TYPE.isNoObjectType()); assertFalse(NO_RESOLVED_TYPE.isNoType()); assertTrue(NO_RESOLVED_TYPE.isNoResolvedType()); assertFalse(NO_RESOLVED_TYPE.isArrayType()); assertFalse(NO_RESOLVED_TYPE.isBooleanValueType()); assertFalse(NO_RESOLVED_TYPE.isDateType()); assertFalse(NO_RESOLVED_TYPE.isEnumElementType()); assertFalse(NO_RESOLVED_TYPE.isNullType()); assertFalse(NO_RESOLVED_TYPE.isNamedType()); assertTrue(NO_RESOLVED_TYPE.isNumber()); assertFalse(NO_RESOLVED_TYPE.isNumberObjectType()); assertFalse(NO_RESOLVED_TYPE.isNumberValueType()); assertTrue(NO_RESOLVED_TYPE.isObject()); assertFalse(NO_RESOLVED_TYPE.isFunctionPrototypeType()); assertFalse(NO_RESOLVED_TYPE.isRegexpType()); assertTrue(NO_RESOLVED_TYPE.isString()); assertFalse(NO_RESOLVED_TYPE.isStringObjectType()); assertFalse(NO_RESOLVED_TYPE.isStringValueType()); assertFalse(NO_RESOLVED_TYPE.isEnumType()); assertFalse(NO_RESOLVED_TYPE.isUnionType()); assertFalse(NO_RESOLVED_TYPE.isStruct()); assertFalse(NO_RESOLVED_TYPE.isDict()); assertFalse(NO_RESOLVED_TYPE.isAllType()); assertFalse(NO_RESOLVED_TYPE.isVoidType()); assertFalse(NO_RESOLVED_TYPE.isConstructor()); assertFalse(NO_RESOLVED_TYPE.isInstanceType()); assertTrue(NO_RESOLVED_TYPE.isSubtype(NO_RESOLVED_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(NO_OBJECT_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(ARRAY_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(BOOLEAN_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(BOOLEAN_OBJECT_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(DATE_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(ERROR_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(EVAL_ERROR_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(functionType)); assertTrue(NO_RESOLVED_TYPE.isSubtype(NULL_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(NUMBER_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(NUMBER_OBJECT_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(OBJECT_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(URI_ERROR_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(RANGE_ERROR_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(REFERENCE_ERROR_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(REGEXP_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(STRING_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(STRING_OBJECT_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(SYNTAX_ERROR_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(TYPE_ERROR_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(ALL_TYPE)); assertTrue(NO_RESOLVED_TYPE.isSubtype(VOID_TYPE)); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, NO_RESOLVED_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, NO_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, NO_OBJECT_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, ARRAY_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, BOOLEAN_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, BOOLEAN_OBJECT_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, DATE_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, ERROR_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, EVAL_ERROR_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, functionType); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, NULL_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, NUMBER_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, NUMBER_OBJECT_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, OBJECT_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, URI_ERROR_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, RANGE_ERROR_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, REFERENCE_ERROR_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, REGEXP_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, STRING_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, STRING_OBJECT_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, SYNTAX_ERROR_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, TYPE_ERROR_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, ALL_TYPE); assertCanTestForEqualityWith(NO_RESOLVED_TYPE, VOID_TYPE); assertTrue( NO_RESOLVED_TYPE.canTestForShallowEqualityWith(NO_RESOLVED_TYPE)); assertTrue(NO_RESOLVED_TYPE.canTestForShallowEqualityWith(NO_OBJECT_TYPE)); assertTrue(NO_RESOLVED_TYPE.canTestForShallowEqualityWith(ARRAY_TYPE)); assertTrue(NO_RESOLVED_TYPE.canTestForShallowEqualityWith(BOOLEAN_TYPE)); assertTrue( NO_RESOLVED_TYPE.canTestForShallowEqualityWith(BOOLEAN_OBJECT_TYPE)); assertTrue(NO_RESOLVED_TYPE.canTestForShallowEqualityWith(DATE_TYPE)); assertTrue(NO_RESOLVED_TYPE.canTestForShallowEqualityWith(ERROR_TYPE)); assertTrue(NO_RESOLVED_TYPE.canTestForShallowEqualityWith(EVAL_ERROR_TYPE)); assertTrue(NO_RESOLVED_TYPE.canTestForShallowEqualityWith(functionType)); assertTrue(NO_RESOLVED_TYPE.canTestForShallowEqualityWith(NULL_TYPE)); assertTrue(NO_RESOLVED_TYPE.canTestForShallowEqualityWith(NUMBER_TYPE)); assertTrue( NO_RESOLVED_TYPE.canTestForShallowEqualityWith(NUMBER_OBJECT_TYPE)); assertTrue(NO_RESOLVED_TYPE.canTestForShallowEqualityWith(OBJECT_TYPE)); assertTrue(NO_RESOLVED_TYPE.canTestForShallowEqualityWith(URI_ERROR_TYPE)); assertTrue( NO_RESOLVED_TYPE.canTestForShallowEqualityWith(RANGE_ERROR_TYPE)); assertTrue( NO_RESOLVED_TYPE.canTestForShallowEqualityWith(REFERENCE_ERROR_TYPE)); assertTrue(NO_RESOLVED_TYPE.canTestForShallowEqualityWith(REGEXP_TYPE)); assertTrue(NO_RESOLVED_TYPE.canTestForShallowEqualityWith(STRING_TYPE)); assertTrue( NO_RESOLVED_TYPE.canTestForShallowEqualityWith(STRING_OBJECT_TYPE)); assertTrue( NO_RESOLVED_TYPE.canTestForShallowEqualityWith(SYNTAX_ERROR_TYPE)); assertTrue(NO_RESOLVED_TYPE.canTestForShallowEqualityWith(TYPE_ERROR_TYPE)); assertTrue(NO_RESOLVED_TYPE.canTestForShallowEqualityWith(ALL_TYPE)); assertTrue(NO_RESOLVED_TYPE.canTestForShallowEqualityWith(VOID_TYPE)); assertTrue(NO_RESOLVED_TYPE.isNullable()); assertTrue(NO_RESOLVED_TYPE.isVoidable()); assertTrue(NO_RESOLVED_TYPE.isObject()); assertTrue(NO_RESOLVED_TYPE.matchesInt32Context()); assertTrue(NO_RESOLVED_TYPE.matchesNumberContext()); assertTrue(NO_RESOLVED_TYPE.matchesObjectContext()); assertTrue(NO_RESOLVED_TYPE.matchesStringContext()); assertTrue(NO_RESOLVED_TYPE.matchesUint32Context()); assertEquals(STR, NO_RESOLVED_TYPE.toString()); assertEquals(null, NO_RESOLVED_TYPE.getDisplayName()); assertFalse(NO_RESOLVED_TYPE.hasDisplayName()); assertTypeEquals(CHECKED_UNKNOWN_TYPE, NO_RESOLVED_TYPE.getPropertyType(STR)); Asserts.assertResolvesToSame(NO_RESOLVED_TYPE); assertTrue(forwardDeclaredNamedType.isEmptyType()); assertTrue(forwardDeclaredNamedType.isNoResolvedType()); UnionType nullable = (UnionType) registry.createNullableType(NO_RESOLVED_TYPE); assertTypeEquals( nullable, nullable.getGreatestSubtype(NULL_TYPE)); assertTypeEquals(NO_RESOLVED_TYPE, nullable.getRestrictedUnion(NULL_TYPE)); }
/** * Tests the behavior of the unresolved Bottom type. */
Tests the behavior of the unresolved Bottom type
testNoResolvedType
{ "repo_name": "lgeorgieff/closure-compiler", "path": "test/com/google/javascript/rhino/jstype/JSTypeTest.java", "license": "apache-2.0", "size": 273346 }
[ "com.google.javascript.rhino.testing.Asserts" ]
import com.google.javascript.rhino.testing.Asserts;
import com.google.javascript.rhino.testing.*;
[ "com.google.javascript" ]
com.google.javascript;
2,165,617
public void writeExternal(ObjectOutput out) throws IOException { ep.writeExternal(out, false); writeCommon(out); }
void function(ObjectOutput out) throws IOException { ep.writeExternal(out, false); writeCommon(out); }
/** * Writes this UnicastRef object to the specified output stream. * * @param out the stream to write the object to * * @throws IOException if any I/O error occurred or class is not serializable */
Writes this UnicastRef object to the specified output stream
writeExternal
{ "repo_name": "freeVM/freeVM", "path": "enhanced/archive/classlib/java6/modules/rmi/src/main/java/org/apache/harmony/rmi/remoteref/UnicastRef.java", "license": "apache-2.0", "size": 10131 }
[ "java.io.IOException", "java.io.ObjectOutput" ]
import java.io.IOException; import java.io.ObjectOutput;
import java.io.*;
[ "java.io" ]
java.io;
63,095
@SuppressWarnings("deprecation") CompilationResult compileToJsSrcFiles( String outputPathFormat, String inputFilePathPrefix, SoyJsSrcOptions jsSrcOptions, List<String> locales, @Nullable String messageFilePathFormat) throws SoySyntaxException, IOException { // Synchronize old and new ways to declare syntax version V1. if (jsSrcOptions.shouldAllowDeprecatedSyntax()) { generalOptions.setDeclaredSyntaxVersionName("1.0"); } SyntaxVersion declaredSyntaxVersion = generalOptions.getDeclaredSyntaxVersion(SyntaxVersion.V2_0); Checkpoint checkpoint = errorReporter.checkpoint(); // Allow unknown globals for backwards compatibility ParseResult result = parse(SyntaxVersion.V2_0, true , typeRegistry); if (errorReporter.errorsSince(checkpoint)) { return failure(); } SoyFileSetNode soyTree = result.fileSet(); TemplateRegistry registry = result.registry(); registry = runMiddleendPasses(registry, soyTree, declaredSyntaxVersion); // TODO(lukes): pass the template registry to jsSrcMain if (errorReporter.errorsSince(checkpoint)) { return failure(); } if (locales.isEmpty()) { // Not generating localized JS. jsSrcMainProvider.get().genJsFiles( soyTree, jsSrcOptions, null, null, outputPathFormat, inputFilePathPrefix); } else { // Generating localized JS. for (String locale : locales) { SoyFileSetNode soyTreeClone = SoytreeUtils.cloneNode(soyTree); String msgFilePath = MainEntryPointUtils.buildFilePath( messageFilePathFormat, locale, null, inputFilePathPrefix); SoyMsgBundle msgBundle = msgBundleHandlerProvider.get().createFromFile(new File(msgFilePath)); if (msgBundle.getLocaleString() == null) { // TODO: Remove this check (but make sure no projects depend on this behavior). // There was an error reading the message file. We continue processing only if the locale // begins with "en", because falling back to the Soy source will probably be fine. if (!locale.startsWith("en")) { throw new IOException("Error opening or reading message file " + msgFilePath); } } jsSrcMainProvider.get().genJsFiles( soyTreeClone, jsSrcOptions, locale, msgBundle, outputPathFormat, inputFilePathPrefix); } } return result(); }
@SuppressWarnings(STR) CompilationResult compileToJsSrcFiles( String outputPathFormat, String inputFilePathPrefix, SoyJsSrcOptions jsSrcOptions, List<String> locales, @Nullable String messageFilePathFormat) throws SoySyntaxException, IOException { if (jsSrcOptions.shouldAllowDeprecatedSyntax()) { generalOptions.setDeclaredSyntaxVersionName("1.0"); } SyntaxVersion declaredSyntaxVersion = generalOptions.getDeclaredSyntaxVersion(SyntaxVersion.V2_0); Checkpoint checkpoint = errorReporter.checkpoint(); ParseResult result = parse(SyntaxVersion.V2_0, true , typeRegistry); if (errorReporter.errorsSince(checkpoint)) { return failure(); } SoyFileSetNode soyTree = result.fileSet(); TemplateRegistry registry = result.registry(); registry = runMiddleendPasses(registry, soyTree, declaredSyntaxVersion); if (errorReporter.errorsSince(checkpoint)) { return failure(); } if (locales.isEmpty()) { jsSrcMainProvider.get().genJsFiles( soyTree, jsSrcOptions, null, null, outputPathFormat, inputFilePathPrefix); } else { for (String locale : locales) { SoyFileSetNode soyTreeClone = SoytreeUtils.cloneNode(soyTree); String msgFilePath = MainEntryPointUtils.buildFilePath( messageFilePathFormat, locale, null, inputFilePathPrefix); SoyMsgBundle msgBundle = msgBundleHandlerProvider.get().createFromFile(new File(msgFilePath)); if (msgBundle.getLocaleString() == null) { if (!locale.startsWith("en")) { throw new IOException(STR + msgFilePath); } } jsSrcMainProvider.get().genJsFiles( soyTreeClone, jsSrcOptions, locale, msgBundle, outputPathFormat, inputFilePathPrefix); } } return result(); }
/** * Compiles this Soy file set into JS source code files and writes these JS files to disk. * * @param outputPathFormat The format string defining how to build the output file path * corresponding to an input file path. * @param inputFilePathPrefix The prefix prepended to all input file paths (can be empty string). * @param jsSrcOptions The compilation options for the JS Src output target. * @param locales The list of locales. Can be an empty list if not applicable. * @param messageFilePathFormat The message file path format, or null if not applicable. * @throws SoySyntaxException If a syntax error is found. * @throws IOException If there is an error in opening/reading a message file or opening/writing * an output JS file. */
Compiles this Soy file set into JS source code files and writes these JS files to disk
compileToJsSrcFiles
{ "repo_name": "SerkanSipahi/closure-templates", "path": "java/src/com/google/template/soy/SoyFileSet.java", "license": "apache-2.0", "size": 50703 }
[ "com.google.template.soy.SoyFileSetParser", "com.google.template.soy.base.SoySyntaxException", "com.google.template.soy.basetree.SyntaxVersion", "com.google.template.soy.error.ErrorReporter", "com.google.template.soy.jssrc.SoyJsSrcOptions", "com.google.template.soy.msgs.SoyMsgBundle", "com.google.templa...
import com.google.template.soy.SoyFileSetParser; import com.google.template.soy.base.SoySyntaxException; import com.google.template.soy.basetree.SyntaxVersion; import com.google.template.soy.error.ErrorReporter; import com.google.template.soy.jssrc.SoyJsSrcOptions; import com.google.template.soy.msgs.SoyMsgBundle; import com.google.template.soy.shared.internal.MainEntryPointUtils; import com.google.template.soy.soytree.SoyFileSetNode; import com.google.template.soy.soytree.SoytreeUtils; import com.google.template.soy.soytree.TemplateRegistry; import java.io.File; import java.io.IOException; import java.util.List; import javax.annotation.Nullable;
import com.google.template.soy.*; import com.google.template.soy.base.*; import com.google.template.soy.basetree.*; import com.google.template.soy.error.*; import com.google.template.soy.jssrc.*; import com.google.template.soy.msgs.*; import com.google.template.soy.shared.internal.*; import com.google.template.soy.soytree.*; import java.io.*; import java.util.*; import javax.annotation.*;
[ "com.google.template", "java.io", "java.util", "javax.annotation" ]
com.google.template; java.io; java.util; javax.annotation;
2,839,033
protected void init(Nitrapi api) throws NitrapiException { this.api = api; if (status.equals(Status.ACTIVE)) { refresh(); // initially load the data } fixServiceStatus(); }
void function(Nitrapi api) throws NitrapiException { this.api = api; if (status.equals(Status.ACTIVE)) { refresh(); } fixServiceStatus(); }
/** * Used internally. * <p> * Get the service directly via the Nitrapi-Object. * * @param api reference to the api * @see Nitrapi#getService(int) * @see Nitrapi#getServices() */
Used internally. Get the service directly via the Nitrapi-Object
init
{ "repo_name": "nitrado/Nitrapi-Java", "path": "src/main/java/net/nitrado/api/services/Service.java", "license": "mit", "size": 9027 }
[ "net.nitrado.api.Nitrapi", "net.nitrado.api.common.exceptions.NitrapiException" ]
import net.nitrado.api.Nitrapi; import net.nitrado.api.common.exceptions.NitrapiException;
import net.nitrado.api.*; import net.nitrado.api.common.exceptions.*;
[ "net.nitrado.api" ]
net.nitrado.api;
1,585,094
protected Map<String, InstructorAttributes> loadCourseInstructorMap(boolean omitArchived) { HashMap<String, InstructorAttributes> courseInstructorMap = new HashMap<>(); List<InstructorAttributes> instructors = logic.getInstructorsForGoogleId(account.googleId, omitArchived); for (InstructorAttributes instructor : instructors) { courseInstructorMap.put(instructor.courseId, instructor); } return courseInstructorMap; }
Map<String, InstructorAttributes> function(boolean omitArchived) { HashMap<String, InstructorAttributes> courseInstructorMap = new HashMap<>(); List<InstructorAttributes> instructors = logic.getInstructorsForGoogleId(account.googleId, omitArchived); for (InstructorAttributes instructor : instructors) { courseInstructorMap.put(instructor.courseId, instructor); } return courseInstructorMap; }
/** * Gets a Map with courseId as key, and InstructorAttributes as value. */
Gets a Map with courseId as key, and InstructorAttributes as value
loadCourseInstructorMap
{ "repo_name": "LiHaoTan/teammates", "path": "src/main/java/teammates/ui/controller/InstructorFeedbackAbstractAction.java", "license": "gpl-2.0", "size": 10190 }
[ "java.util.HashMap", "java.util.List", "java.util.Map" ]
import java.util.HashMap; import java.util.List; import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
563,747
if (isBackedBySimpleArray(bitmap)) { Util.flipBitmapRange(bitmap.array(), start, end); return; } if (start == end) return; int firstword = start / 64; int endword = (end - 1) / 64; bitmap.put(firstword, bitmap.get(firstword) ^ ~(~0L << start)); for (int i = firstword; i < endword; i++) bitmap.put(i, ~bitmap.get(i)); bitmap.put(endword, bitmap.get(endword) ^ (~0L >>> -end)); }
if (isBackedBySimpleArray(bitmap)) { Util.flipBitmapRange(bitmap.array(), start, end); return; } if (start == end) return; int firstword = start / 64; int endword = (end - 1) / 64; bitmap.put(firstword, bitmap.get(firstword) ^ ~(~0L << start)); for (int i = firstword; i < endword; i++) bitmap.put(i, ~bitmap.get(i)); bitmap.put(endword, bitmap.get(endword) ^ (~0L >>> -end)); }
/** * flip bits at start, start+1,..., end-1 * * @param bitmap array of words to be modified * @param start first index to be modified (inclusive) * @param end last index to be modified (exclusive) */
flip bits at start, start+1,..., end-1
flipBitmapRange
{ "repo_name": "gssiyankai/RoaringBitmap", "path": "src/main/java/org/roaringbitmap/buffer/BufferUtil.java", "license": "apache-2.0", "size": 27089 }
[ "org.roaringbitmap.Util" ]
import org.roaringbitmap.Util;
import org.roaringbitmap.*;
[ "org.roaringbitmap" ]
org.roaringbitmap;
155,685
public boolean getFeature (String name) throws SAXNotRecognizedException, SAXNotSupportedException { throw new SAXNotRecognizedException("Feature: " + name); }
boolean function (String name) throws SAXNotRecognizedException, SAXNotSupportedException { throw new SAXNotRecognizedException(STR + name); }
/** * Look up the state of a feature. * * <p>This will always fail.</p> * * @param name The feature name. * @return The current state of the feature. * @exception org.xml.sax.SAXNotRecognizedException When the * XMLReader does not recognize the feature name. * @exception org.xml.sax.SAXNotSupportedException When the * XMLReader recognizes the feature name but * cannot determine its state at this time. * @see org.xml.sax.XMLReader#getFeature */
Look up the state of a feature. This will always fail
getFeature
{ "repo_name": "Baltasarq/Gia", "path": "src/JDom/samples/sax/XMLReaderBase.java", "license": "mit", "size": 39286 }
[ "org.xml.sax.SAXNotRecognizedException", "org.xml.sax.SAXNotSupportedException" ]
import org.xml.sax.SAXNotRecognizedException; import org.xml.sax.SAXNotSupportedException;
import org.xml.sax.*;
[ "org.xml.sax" ]
org.xml.sax;
821,203
public void writeEntityToNBT(NBTTagCompound compound) { compound.setString("Motive", this.art.title); super.writeEntityToNBT(compound); }
void function(NBTTagCompound compound) { compound.setString(STR, this.art.title); super.writeEntityToNBT(compound); }
/** * (abstract) Protected helper method to write subclass entity data to NBT. */
(abstract) Protected helper method to write subclass entity data to NBT
writeEntityToNBT
{ "repo_name": "danielyc/test-1.9.4", "path": "build/tmp/recompileMc/sources/net/minecraft/entity/item/EntityPainting.java", "license": "gpl-3.0", "size": 6266 }
[ "net.minecraft.nbt.NBTTagCompound" ]
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.*;
[ "net.minecraft.nbt" ]
net.minecraft.nbt;
189,881
private static Analyzer create(String name, Settings analyzerSettings, Map<String, TokenizerFactory> tokenizers, Map<String, CharFilterFactory> charFilters, Map<String, TokenFilterFactory> tokenFilters) { int positionIncrementGap = TextFieldMapper.Defaults.POSITION_INCREMENT_GAP; positionIncrementGap = analyzerSettings.getAsInt("position_increment_gap", positionIncrementGap); int offsetGap = analyzerSettings.getAsInt("offset_gap", -1); AnalyzerComponents components = createComponents(name, analyzerSettings, tokenizers, charFilters, tokenFilters); if (components.analysisMode().equals(AnalysisMode.SEARCH_TIME)) { return new ReloadableCustomAnalyzer(components, positionIncrementGap, offsetGap); } else { return new CustomAnalyzer(components.getTokenizerFactory(), components.getCharFilters(), components.getTokenFilters(), positionIncrementGap, offsetGap); } }
static Analyzer function(String name, Settings analyzerSettings, Map<String, TokenizerFactory> tokenizers, Map<String, CharFilterFactory> charFilters, Map<String, TokenFilterFactory> tokenFilters) { int positionIncrementGap = TextFieldMapper.Defaults.POSITION_INCREMENT_GAP; positionIncrementGap = analyzerSettings.getAsInt(STR, positionIncrementGap); int offsetGap = analyzerSettings.getAsInt(STR, -1); AnalyzerComponents components = createComponents(name, analyzerSettings, tokenizers, charFilters, tokenFilters); if (components.analysisMode().equals(AnalysisMode.SEARCH_TIME)) { return new ReloadableCustomAnalyzer(components, positionIncrementGap, offsetGap); } else { return new CustomAnalyzer(components.getTokenizerFactory(), components.getCharFilters(), components.getTokenFilters(), positionIncrementGap, offsetGap); } }
/** * Factory method that either returns a plain {@link ReloadableCustomAnalyzer} if the components used for creation are supporting index * and search time use, or a {@link ReloadableCustomAnalyzer} if the components are intended for search time use only. */
Factory method that either returns a plain <code>ReloadableCustomAnalyzer</code> if the components used for creation are supporting index and search time use, or a <code>ReloadableCustomAnalyzer</code> if the components are intended for search time use only
create
{ "repo_name": "gingerwizard/elasticsearch", "path": "server/src/main/java/org/elasticsearch/index/analysis/CustomAnalyzerProvider.java", "license": "apache-2.0", "size": 3372 }
[ "java.util.Map", "org.apache.lucene.analysis.Analyzer", "org.elasticsearch.common.settings.Settings", "org.elasticsearch.index.analysis.AnalyzerComponents", "org.elasticsearch.index.mapper.TextFieldMapper" ]
import java.util.Map; import org.apache.lucene.analysis.Analyzer; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.analysis.AnalyzerComponents; import org.elasticsearch.index.mapper.TextFieldMapper;
import java.util.*; import org.apache.lucene.analysis.*; import org.elasticsearch.common.settings.*; import org.elasticsearch.index.analysis.*; import org.elasticsearch.index.mapper.*;
[ "java.util", "org.apache.lucene", "org.elasticsearch.common", "org.elasticsearch.index" ]
java.util; org.apache.lucene; org.elasticsearch.common; org.elasticsearch.index;
2,542,641
public static BufferedImage resizeImage(Image image) { BufferedImage result = new BufferedImage(128, 128, BufferedImage.TYPE_INT_ARGB); Graphics2D graphics = result.createGraphics(); graphics.drawImage(image, 0, 0, 128, 128, null); graphics.dispose(); return result; }
static BufferedImage function(Image image) { BufferedImage result = new BufferedImage(128, 128, BufferedImage.TYPE_INT_ARGB); Graphics2D graphics = result.createGraphics(); graphics.drawImage(image, 0, 0, 128, 128, null); graphics.dispose(); return result; }
/** * Resize an image to 128x128. * * @param image The image to resize. * @return The resized image. */
Resize an image to 128x128
resizeImage
{ "repo_name": "Scrik/Cauldron-1", "path": "eclipse/cauldron/src/main/java/org/bukkit/map/MapPalette.java", "license": "gpl-3.0", "size": 8372 }
[ "java.awt.Graphics2D", "java.awt.Image", "java.awt.image.BufferedImage" ]
import java.awt.Graphics2D; import java.awt.Image; import java.awt.image.BufferedImage;
import java.awt.*; import java.awt.image.*;
[ "java.awt" ]
java.awt;
1,081,152
public String processTemplate(Map<String, Object> rootMap, String freeMarkerTemplateName) throws Exception { // tell Freemarker to use main class path and therefore find templates in // main/resources/templates FreeMarkerConfiguration.addTemplateClass(PageSchema.class, getFreemarkerTemplatePath()); // process the template with the given name if (debug) LOGGER.log(Level.INFO, "processing template " + freeMarkerTemplateName + " from path " + getFreemarkerTemplatePath()); String result = FreeMarkerConfiguration.doProcessTemplate( freeMarkerTemplateName, rootMap); return result; }
String function(Map<String, Object> rootMap, String freeMarkerTemplateName) throws Exception { FreeMarkerConfiguration.addTemplateClass(PageSchema.class, getFreemarkerTemplatePath()); if (debug) LOGGER.log(Level.INFO, STR + freeMarkerTemplateName + STR + getFreemarkerTemplatePath()); String result = FreeMarkerConfiguration.doProcessTemplate( freeMarkerTemplateName, rootMap); return result; }
/** * get a template result * * @param rootMap * @param freeMarkerTemplateName * @return * @throws Exception */
get a template result
processTemplate
{ "repo_name": "WolfgangFahl/JSMW_PageSchema", "path": "src/main/java/org/mediawiki/smw/pageschemas/PageSchema.java", "license": "lgpl-3.0", "size": 11812 }
[ "com.bitplan.rest.freemarker.FreeMarkerConfiguration", "java.util.Map", "java.util.logging.Level" ]
import com.bitplan.rest.freemarker.FreeMarkerConfiguration; import java.util.Map; import java.util.logging.Level;
import com.bitplan.rest.freemarker.*; import java.util.*; import java.util.logging.*;
[ "com.bitplan.rest", "java.util" ]
com.bitplan.rest; java.util;
2,176,090
//------------------------- AUTOGENERATED START ------------------------- ///CLOVER:OFF public static SharedUserComponentFactory.Meta meta() { return SharedUserComponentFactory.Meta.INSTANCE; } static { JodaBeanUtils.registerMetaBean(SharedUserComponentFactory.Meta.INSTANCE); }
static SharedUserComponentFactory.Meta function() { return SharedUserComponentFactory.Meta.INSTANCE; } static { JodaBeanUtils.registerMetaBean(SharedUserComponentFactory.Meta.INSTANCE); }
/** * The meta-bean for {@code SharedUserComponentFactory}. * @return the meta-bean, not null */
The meta-bean for SharedUserComponentFactory
meta
{ "repo_name": "jeorme/OG-Platform", "path": "projects/OG-Component/src/main/java/com/opengamma/component/factory/user/SharedUserComponentFactory.java", "license": "apache-2.0", "size": 6772 }
[ "org.joda.beans.JodaBeanUtils" ]
import org.joda.beans.JodaBeanUtils;
import org.joda.beans.*;
[ "org.joda.beans" ]
org.joda.beans;
229,537
public void registerPetiteCtorInjectionPoint(String beanName, Class[] paramTypes, String[] references) { BeanDefinition beanDefinition = lookupExistingBeanDefinition(beanName); String[][] ref = PetiteUtil.convertRefToReferences(references); ClassDescriptor cd = ClassIntrospector.lookup(beanDefinition.type); Constructor constructor = null; if (paramTypes == null) { CtorDescriptor[] ctors = cd.getAllCtorDescriptors(); if (ctors != null && ctors.length > 0) { if (ctors.length > 1) { throw new PetiteException(ctors.length + " suitable constructor found as injection point for: " + beanDefinition.type.getName()); } constructor = ctors[0].getConstructor(); } } else { CtorDescriptor ctorDescriptor = cd.getCtorDescriptor(paramTypes, true); if (ctorDescriptor != null) { constructor = ctorDescriptor.getConstructor(); } } if (constructor == null) { throw new PetiteException("Constructor not found: " + beanDefinition.type.getName()); } beanDefinition.ctor = injectionPointFactory.createCtorInjectionPoint(constructor, ref); }
void function(String beanName, Class[] paramTypes, String[] references) { BeanDefinition beanDefinition = lookupExistingBeanDefinition(beanName); String[][] ref = PetiteUtil.convertRefToReferences(references); ClassDescriptor cd = ClassIntrospector.lookup(beanDefinition.type); Constructor constructor = null; if (paramTypes == null) { CtorDescriptor[] ctors = cd.getAllCtorDescriptors(); if (ctors != null && ctors.length > 0) { if (ctors.length > 1) { throw new PetiteException(ctors.length + STR + beanDefinition.type.getName()); } constructor = ctors[0].getConstructor(); } } else { CtorDescriptor ctorDescriptor = cd.getCtorDescriptor(paramTypes, true); if (ctorDescriptor != null) { constructor = ctorDescriptor.getConstructor(); } } if (constructor == null) { throw new PetiteException(STR + beanDefinition.type.getName()); } beanDefinition.ctor = injectionPointFactory.createCtorInjectionPoint(constructor, ref); }
/** * Registers constructor injection point. * * @param beanName bean name * @param paramTypes constructor parameter types, may be <code>null</code> * @param references references for arguments */
Registers constructor injection point
registerPetiteCtorInjectionPoint
{ "repo_name": "vilmospapp/jodd", "path": "jodd-petite/src/main/java/jodd/petite/PetiteBeans.java", "license": "bsd-2-clause", "size": 23444 }
[ "java.lang.reflect.Constructor" ]
import java.lang.reflect.Constructor;
import java.lang.reflect.*;
[ "java.lang" ]
java.lang;
438,049
@Override public int hashCode() { return HashCodeBuilder.reflectionHashCode(this); }
int function() { return HashCodeBuilder.reflectionHashCode(this); }
/** * Important! Models must be identifiable by their contained object. */
Important! Models must be identifiable by their contained object
hashCode
{ "repo_name": "nextreports/nextreports-server", "path": "src/ro/nextreports/server/web/core/EntityModel.java", "license": "apache-2.0", "size": 2427 }
[ "org.apache.commons.lang.builder.HashCodeBuilder" ]
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.*;
[ "org.apache.commons" ]
org.apache.commons;
1,830,174
@Override public void setResponse(Response response) { contentLength = response.getContentLengthLong(); remaining = contentLength; }
void function(Response response) { contentLength = response.getContentLengthLong(); remaining = contentLength; }
/** * Some filters need additional parameters from the response. All the * necessary reading can occur in that method, as this method is called * after the response header processing is complete. */
Some filters need additional parameters from the response. All the necessary reading can occur in that method, as this method is called after the response header processing is complete
setResponse
{ "repo_name": "Nickname0806/Test_Q4", "path": "java/org/apache/coyote/http11/filters/IdentityOutputFilter.java", "license": "apache-2.0", "size": 3994 }
[ "org.apache.coyote.Response" ]
import org.apache.coyote.Response;
import org.apache.coyote.*;
[ "org.apache.coyote" ]
org.apache.coyote;
2,338,515
public static void closeQuietly(Closeable closeable) { if (closeable != null) { try { closeable.close(); } catch (IOException e) { } } }
static void function(Closeable closeable) { if (closeable != null) { try { closeable.close(); } catch (IOException e) { } } }
/** * Close silently a stream. * * @param closeable The stream to close. */
Close silently a stream
closeQuietly
{ "repo_name": "mnbogner/flickr-api", "path": "src/main/java/com/flickr/api/utils/IOUtils.java", "license": "mit", "size": 2186 }
[ "java.io.Closeable", "java.io.IOException" ]
import java.io.Closeable; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
2,151,503
void create(BookCollection b); void delete(BookCollection b); void update(BookCollection b); List<BookCollection> findAll(); BookCollection findByName(String name); BookCollection findById(Long id);
void create(BookCollection b); void delete(BookCollection b); void update(BookCollection b); List<BookCollection> findAll(); BookCollection findByName(String name); BookCollection findById(Long id);
/** * return BookCollection objects with target id * * @param id collection id * @return BookCollection objects with target id */
return BookCollection objects with target id
findById
{ "repo_name": "msimacek/PA165-LibraryManager", "path": "persistence/src/main/java/cz/muni/fi/pa165/dao/BookCollectionDao.java", "license": "apache-2.0", "size": 1292 }
[ "cz.muni.fi.pa165.entity.BookCollection", "java.util.List" ]
import cz.muni.fi.pa165.entity.BookCollection; import java.util.List;
import cz.muni.fi.pa165.entity.*; import java.util.*;
[ "cz.muni.fi", "java.util" ]
cz.muni.fi; java.util;
2,492,172
@DELETE @Path("{subjectKey}/{subject}") @Consumes(MediaType.APPLICATION_JSON) @SuppressWarnings("unchecked") public Response upload(@PathParam("subjectKey") String subjectKey, @PathParam("subject") String subject) { NetworkConfigService service = get(NetworkConfigService.class); Object s = service.getSubjectFactory(subjectKey).createSubject(subject); service.getConfigs(s).forEach(c -> service.removeConfig(s, c.getClass())); return Response.ok().build(); }
@Path(STR) @Consumes(MediaType.APPLICATION_JSON) @SuppressWarnings(STR) Response function(@PathParam(STR) String subjectKey, @PathParam(STR) String subject) { NetworkConfigService service = get(NetworkConfigService.class); Object s = service.getSubjectFactory(subjectKey).createSubject(subject); service.getConfigs(s).forEach(c -> service.removeConfig(s, c.getClass())); return Response.ok().build(); }
/** * Clears network configuration for the specified subject. * * @param subjectKey subject class key * @param subject subject key * @return empty response */
Clears network configuration for the specified subject
upload
{ "repo_name": "kuangrewawa/OnosFw", "path": "web/api/src/main/java/org/onosproject/rest/resources/NetworkConfigWebResource.java", "license": "apache-2.0", "size": 10882 }
[ "javax.ws.rs.Consumes", "javax.ws.rs.Path", "javax.ws.rs.PathParam", "javax.ws.rs.core.MediaType", "javax.ws.rs.core.Response", "org.onosproject.incubator.net.config.NetworkConfigService" ]
import javax.ws.rs.Consumes; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import org.onosproject.incubator.net.config.NetworkConfigService;
import javax.ws.rs.*; import javax.ws.rs.core.*; import org.onosproject.incubator.net.config.*;
[ "javax.ws", "org.onosproject.incubator" ]
javax.ws; org.onosproject.incubator;
386,768
public static String getEscapedColumnName( IntrospectedColumn introspectedColumn) { StringBuilder sb = new StringBuilder(); sb.append(escapeStringForMyBatis3(introspectedColumn .getActualColumnName())); if (introspectedColumn.isColumnNameDelimited()) { sb.insert(0, introspectedColumn.getContext() .getBeginningDelimiter()); sb.append(introspectedColumn.getContext().getEndingDelimiter()); } return sb.toString(); }
static String function( IntrospectedColumn introspectedColumn) { StringBuilder sb = new StringBuilder(); sb.append(escapeStringForMyBatis3(introspectedColumn .getActualColumnName())); if (introspectedColumn.isColumnNameDelimited()) { sb.insert(0, introspectedColumn.getContext() .getBeginningDelimiter()); sb.append(introspectedColumn.getContext().getEndingDelimiter()); } return sb.toString(); }
/** * Gets the escaped column name. * * @param introspectedColumn * the introspected column * @return the escaped column name */
Gets the escaped column name
getEscapedColumnName
{ "repo_name": "victzero/ezjs-generator", "path": "generator/src/main/java/me/ezjs/generator/mybatis/codegen/mybatis3/MyBatis3FormattingUtilities.java", "license": "apache-2.0", "size": 7474 }
[ "me.ezjs.generator.mybatis.api.IntrospectedColumn" ]
import me.ezjs.generator.mybatis.api.IntrospectedColumn;
import me.ezjs.generator.mybatis.api.*;
[ "me.ezjs.generator" ]
me.ezjs.generator;
129,489
@Nonnull public HDLIfStatement setIfExp(@Nonnull HDLExpression ifExp) { ifExp = validateIfExp(ifExp); final HDLIfStatement res = new HDLIfStatement(id, container, ifExp, thenDo, elseDo, false); return res; }
HDLIfStatement function(@Nonnull HDLExpression ifExp) { ifExp = validateIfExp(ifExp); final HDLIfStatement res = new HDLIfStatement(id, container, ifExp, thenDo, elseDo, false); return res; }
/** * Setter for the field {@link #getIfExp()}. * * @param ifExp * sets the new ifExp of this object. Can <b>not</b> be <code>null</code>. * @return a new instance of {@link HDLIfStatement} with the updated ifExp field. */
Setter for the field <code>#getIfExp()</code>
setIfExp
{ "repo_name": "pshdl/org.pshdl", "path": "model-gen/org/pshdl/model/impl/AbstractHDLIfStatement.java", "license": "gpl-3.0", "size": 17083 }
[ "javax.annotation.Nonnull", "org.pshdl.model.HDLExpression", "org.pshdl.model.HDLIfStatement" ]
import javax.annotation.Nonnull; import org.pshdl.model.HDLExpression; import org.pshdl.model.HDLIfStatement;
import javax.annotation.*; import org.pshdl.model.*;
[ "javax.annotation", "org.pshdl.model" ]
javax.annotation; org.pshdl.model;
2,052,398
protected void init() { JButton testButton = new JButton(); oldDayBackgroundColor = testButton.getBackground(); selectedColor = new Color(160, 160, 160); Date date = calendar.getTime(); calendar = Calendar.getInstance(locale); calendar.setTime(date); drawDayNames(); drawDays(); }
void function() { JButton testButton = new JButton(); oldDayBackgroundColor = testButton.getBackground(); selectedColor = new Color(160, 160, 160); Date date = calendar.getTime(); calendar = Calendar.getInstance(locale); calendar.setTime(date); drawDayNames(); drawDays(); }
/** * Initializes the locale specific names for the days of the week. */
Initializes the locale specific names for the days of the week
init
{ "repo_name": "aitortarazaga/Programacion", "path": "t8p1p123/jcalendar-1.4/src/com/toedter/calendar/JDayChooser.java", "license": "apache-2.0", "size": 25967 }
[ "java.awt.Color", "java.util.Calendar", "java.util.Date", "javax.swing.JButton" ]
import java.awt.Color; import java.util.Calendar; import java.util.Date; import javax.swing.JButton;
import java.awt.*; import java.util.*; import javax.swing.*;
[ "java.awt", "java.util", "javax.swing" ]
java.awt; java.util; javax.swing;
2,382,401
@Generated @ServiceMethod(returns = ReturnType.SINGLE) public Response<ActivityRunsQueryResponse> queryActivityRunsWithResponse( String pipelineName, String runId, RunFilterParameters filterParameters, Context context) { return this.serviceClient.queryActivityRunsWithResponse(pipelineName, runId, filterParameters, context); }
@ServiceMethod(returns = ReturnType.SINGLE) Response<ActivityRunsQueryResponse> function( String pipelineName, String runId, RunFilterParameters filterParameters, Context context) { return this.serviceClient.queryActivityRunsWithResponse(pipelineName, runId, filterParameters, context); }
/** * Query activity runs based on input filter conditions. * * @param pipelineName The pipeline name. * @param runId The pipeline run identifier. * @param filterParameters Parameters to filter the activity runs. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws CloudErrorAutoGeneratedException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list activity runs along with {@link Response}. */
Query activity runs based on input filter conditions
queryActivityRunsWithResponse
{ "repo_name": "Azure/azure-sdk-for-java", "path": "sdk/synapse/azure-analytics-synapse-artifacts/src/main/java/com/azure/analytics/synapse/artifacts/PipelineRunClient.java", "license": "mit", "size": 8519 }
[ "com.azure.analytics.synapse.artifacts.models.ActivityRunsQueryResponse", "com.azure.analytics.synapse.artifacts.models.RunFilterParameters", "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.http.rest.Response", "com.azure.core.util.Context" ]
import com.azure.analytics.synapse.artifacts.models.ActivityRunsQueryResponse; import com.azure.analytics.synapse.artifacts.models.RunFilterParameters; import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context;
import com.azure.analytics.synapse.artifacts.models.*; import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*;
[ "com.azure.analytics", "com.azure.core" ]
com.azure.analytics; com.azure.core;
1,145,365
public static void optimizeWriter(IndexWriter iw) throws IOException { iw.forceMerge(1); }
static void function(IndexWriter iw) throws IOException { iw.forceMerge(1); }
/** * Optimizes an index. * @param iw * @throws IOException */
Optimizes an index
optimizeWriter
{ "repo_name": "angleto/lire", "path": "src/main/java/net/semanticmetadata/lire/utils/LuceneUtils.java", "license": "gpl-2.0", "size": 9447 }
[ "java.io.IOException", "org.apache.lucene.index.IndexWriter" ]
import java.io.IOException; import org.apache.lucene.index.IndexWriter;
import java.io.*; import org.apache.lucene.index.*;
[ "java.io", "org.apache.lucene" ]
java.io; org.apache.lucene;
1,778,301
@Override public Socket createSocket(InetAddress host, int port) throws IOException { final SSLSocketFactory factory = sslCtxt.getSocketFactory(); final SSLSocket ss = (SSLSocket) factory.createSocket(host, port); ss.setEnabledProtocols(protocols); return ss; }
Socket function(InetAddress host, int port) throws IOException { final SSLSocketFactory factory = sslCtxt.getSocketFactory(); final SSLSocket ss = (SSLSocket) factory.createSocket(host, port); ss.setEnabledProtocols(protocols); return ss; }
/** * Creates a new SSL Socket. * * @param host the host to connect to * @param port the port to connect to * @return the SSL Socket * @throws IOException thrown if the creation fails */
Creates a new SSL Socket
createSocket
{ "repo_name": "awhitford/DependencyCheck", "path": "utils/src/main/java/org/owasp/dependencycheck/utils/SSLSocketFactoryEx.java", "license": "apache-2.0", "size": 10078 }
[ "java.io.IOException", "java.net.InetAddress", "java.net.Socket", "javax.net.ssl.SSLSocket", "javax.net.ssl.SSLSocketFactory" ]
import java.io.IOException; import java.net.InetAddress; import java.net.Socket; import javax.net.ssl.SSLSocket; import javax.net.ssl.SSLSocketFactory;
import java.io.*; import java.net.*; import javax.net.ssl.*;
[ "java.io", "java.net", "javax.net" ]
java.io; java.net; javax.net;
2,675,495
public void uploadBuildSlaveEvents( StampedeId stampedeId, BuildSlaveRunId runId, List<BuildSlaveEvent> events) throws IOException { Stopwatch watch = Stopwatch.createStarted(); LOG.debug(String.format("Uploading [%d] BuildSlaveEvents.", events.size())); AppendBuildSlaveEventsRequest request = new AppendBuildSlaveEventsRequest(); request.setStampedeId(stampedeId); request.setBuildSlaveRunId(runId); for (BuildSlaveEvent slaveEvent : events) { request.addToEvents( ThriftUtil.serializeToByteBuffer(PROTOCOL_FOR_CLIENT_ONLY_STRUCTS, slaveEvent)); } FrontendRequest frontendRequest = new FrontendRequest(); frontendRequest.setType(FrontendRequestType.APPEND_BUILD_SLAVE_EVENTS); frontendRequest.setAppendBuildSlaveEventsRequest(request); makeRequestChecked(frontendRequest); LOG.debug( "Uploaded [%d] BuildSlaveEvents in [%dms].", events.size(), watch.elapsed(TimeUnit.MILLISECONDS)); }
void function( StampedeId stampedeId, BuildSlaveRunId runId, List<BuildSlaveEvent> events) throws IOException { Stopwatch watch = Stopwatch.createStarted(); LOG.debug(String.format(STR, events.size())); AppendBuildSlaveEventsRequest request = new AppendBuildSlaveEventsRequest(); request.setStampedeId(stampedeId); request.setBuildSlaveRunId(runId); for (BuildSlaveEvent slaveEvent : events) { request.addToEvents( ThriftUtil.serializeToByteBuffer(PROTOCOL_FOR_CLIENT_ONLY_STRUCTS, slaveEvent)); } FrontendRequest frontendRequest = new FrontendRequest(); frontendRequest.setType(FrontendRequestType.APPEND_BUILD_SLAVE_EVENTS); frontendRequest.setAppendBuildSlaveEventsRequest(request); makeRequestChecked(frontendRequest); LOG.debug( STR, events.size(), watch.elapsed(TimeUnit.MILLISECONDS)); }
/** * Publishes generic BuildSlaveEvents, so that they can be downloaded by distributed build client. */
Publishes generic BuildSlaveEvents, so that they can be downloaded by distributed build client
uploadBuildSlaveEvents
{ "repo_name": "LegNeato/buck", "path": "src/com/facebook/buck/distributed/DistBuildService.java", "license": "apache-2.0", "size": 39561 }
[ "com.facebook.buck.distributed.thrift.AppendBuildSlaveEventsRequest", "com.facebook.buck.distributed.thrift.BuildSlaveEvent", "com.facebook.buck.distributed.thrift.BuildSlaveRunId", "com.facebook.buck.distributed.thrift.FrontendRequest", "com.facebook.buck.distributed.thrift.FrontendRequestType", "com.fac...
import com.facebook.buck.distributed.thrift.AppendBuildSlaveEventsRequest; import com.facebook.buck.distributed.thrift.BuildSlaveEvent; import com.facebook.buck.distributed.thrift.BuildSlaveRunId; import com.facebook.buck.distributed.thrift.FrontendRequest; import com.facebook.buck.distributed.thrift.FrontendRequestType; import com.facebook.buck.distributed.thrift.StampedeId; import com.facebook.buck.slb.ThriftUtil; import com.google.common.base.Stopwatch; import java.io.IOException; import java.util.List; import java.util.concurrent.TimeUnit;
import com.facebook.buck.distributed.thrift.*; import com.facebook.buck.slb.*; import com.google.common.base.*; import java.io.*; import java.util.*; import java.util.concurrent.*;
[ "com.facebook.buck", "com.google.common", "java.io", "java.util" ]
com.facebook.buck; com.google.common; java.io; java.util;
1,747,081
private static int snapOnly30s(int degrees, final int forceHigherOrLower) { int stepSize = HOUR_VALUE_TO_DEGREES_STEP_SIZE; int floor = (degrees / stepSize) * stepSize; int ceiling = floor + stepSize; if (forceHigherOrLower == 1) { degrees = ceiling; } else if (forceHigherOrLower == CommonHelper.INVALID) { if (degrees == floor) { floor -= stepSize; } degrees = floor; } else { if ((degrees - floor) < (ceiling - degrees)) { degrees = floor; } else { degrees = ceiling; } } return degrees; }
static int function(int degrees, final int forceHigherOrLower) { int stepSize = HOUR_VALUE_TO_DEGREES_STEP_SIZE; int floor = (degrees / stepSize) * stepSize; int ceiling = floor + stepSize; if (forceHigherOrLower == 1) { degrees = ceiling; } else if (forceHigherOrLower == CommonHelper.INVALID) { if (degrees == floor) { floor -= stepSize; } degrees = floor; } else { if ((degrees - floor) < (ceiling - degrees)) { degrees = floor; } else { degrees = ceiling; } } return degrees; }
/** * Returns mapping of any input degrees (0 to 360) to one of 12 visible output degrees (all * multiples of 30), where the input will be "snapped" to the closest visible degrees. * * @param degrees The input degrees * @param forceHigherOrLower The output may be forced to either the higher or lower step, or may * be allowed to snap to whichever is closer. Use 1 to force strictly higher, -1 to force * strictly lower, and 0 to snap to the closer one. * @return output degrees, will be a multiple of 30 */
Returns mapping of any input degrees (0 to 360) to one of 12 visible output degrees (all multiples of 30), where the input will be "snapped" to the closest visible degrees
snapOnly30s
{ "repo_name": "Albul/support-date-time-pickers", "path": "support-date-time-pickers/src/main/java/com/albul/supportdatetimepickers/time/RadialPickerLayout.java", "license": "apache-2.0", "size": 38555 }
[ "com.albul.commonhelpers.CommonHelper" ]
import com.albul.commonhelpers.CommonHelper;
import com.albul.commonhelpers.*;
[ "com.albul.commonhelpers" ]
com.albul.commonhelpers;
1,447,596
public Swarm stop() throws Exception { if (this.server == null) { throw SwarmMessages.MESSAGES.containerNotStarted("stop()"); } this.server.stop(); this.server = null; Module module = Module.getBootModuleLoader().loadModule(ModuleIdentifier.create(CONTAINER_MODULE_NAME)); Class<?> shutdownClass = module.getClassLoader().loadClass("org.wildfly.swarm.container.runtime.WeldShutdownImpl"); WeldShutdown shutdown = (WeldShutdown) shutdownClass.newInstance(); shutdown.shutdown(); return this; }
Swarm function() throws Exception { if (this.server == null) { throw SwarmMessages.MESSAGES.containerNotStarted(STR); } this.server.stop(); this.server = null; Module module = Module.getBootModuleLoader().loadModule(ModuleIdentifier.create(CONTAINER_MODULE_NAME)); Class<?> shutdownClass = module.getClassLoader().loadClass(STR); WeldShutdown shutdown = (WeldShutdown) shutdownClass.newInstance(); shutdown.shutdown(); return this; }
/** * Stop the container, first undeploying all deployments. * * @return THe container. * @throws Exception If an error occurs. */
Stop the container, first undeploying all deployments
stop
{ "repo_name": "jamezp/wildfly-swarm", "path": "core/container/src/main/java/org/wildfly/swarm/Swarm.java", "license": "apache-2.0", "size": 34002 }
[ "org.jboss.modules.Module", "org.jboss.modules.ModuleIdentifier", "org.wildfly.swarm.container.internal.WeldShutdown", "org.wildfly.swarm.internal.SwarmMessages" ]
import org.jboss.modules.Module; import org.jboss.modules.ModuleIdentifier; import org.wildfly.swarm.container.internal.WeldShutdown; import org.wildfly.swarm.internal.SwarmMessages;
import org.jboss.modules.*; import org.wildfly.swarm.container.internal.*; import org.wildfly.swarm.internal.*;
[ "org.jboss.modules", "org.wildfly.swarm" ]
org.jboss.modules; org.wildfly.swarm;
2,352,301
public static ClusterNode youngest(Collection<ClusterNode> c, @Nullable IgnitePredicate<ClusterNode> p) { ClusterNode youngest = null; long maxOrder = Long.MIN_VALUE; for (ClusterNode n : c) { if ((p == null || p.apply(n)) && n.order() > maxOrder) { youngest = n; maxOrder = n.order(); } } return youngest; }
static ClusterNode function(Collection<ClusterNode> c, @Nullable IgnitePredicate<ClusterNode> p) { ClusterNode youngest = null; long maxOrder = Long.MIN_VALUE; for (ClusterNode n : c) { if ((p == null p.apply(n)) && n.order() > maxOrder) { youngest = n; maxOrder = n.order(); } } return youngest; }
/** * Gets youngest node out of collection of nodes. * * @param c Collection of nodes. * @return Youngest node. */
Gets youngest node out of collection of nodes
youngest
{ "repo_name": "ascherbakoff/ignite", "path": "modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java", "license": "apache-2.0", "size": 385578 }
[ "java.util.Collection", "org.apache.ignite.cluster.ClusterNode", "org.apache.ignite.lang.IgnitePredicate", "org.jetbrains.annotations.Nullable" ]
import java.util.Collection; import org.apache.ignite.cluster.ClusterNode; import org.apache.ignite.lang.IgnitePredicate; import org.jetbrains.annotations.Nullable;
import java.util.*; import org.apache.ignite.cluster.*; import org.apache.ignite.lang.*; import org.jetbrains.annotations.*;
[ "java.util", "org.apache.ignite", "org.jetbrains.annotations" ]
java.util; org.apache.ignite; org.jetbrains.annotations;
2,273,710
@Column(name = "CONVERTED_AMT", precision = 7, scale = 2, nullable = true) public KualiDecimal getConvertedAmount();
@Column(name = STR, precision = 7, scale = 2, nullable = true) KualiDecimal function();
/** * Get the value of convertedAmount * * @return the value of convertedAmount */
Get the value of convertedAmount
getConvertedAmount
{ "repo_name": "kuali/kfs", "path": "kfs-tem/src/main/java/org/kuali/kfs/module/tem/businessobject/TemExpense.java", "license": "agpl-3.0", "size": 7554 }
[ "javax.persistence.Column", "org.kuali.rice.core.api.util.type.KualiDecimal" ]
import javax.persistence.Column; import org.kuali.rice.core.api.util.type.KualiDecimal;
import javax.persistence.*; import org.kuali.rice.core.api.util.type.*;
[ "javax.persistence", "org.kuali.rice" ]
javax.persistence; org.kuali.rice;
2,719,349
public int getHashCode(Object x) throws HibernateException;
int function(Object x) throws HibernateException;
/** * Get a hash code, consistent with persistence "equality". Again for most types the normal usage is to * delegate to the value's {@link Object#hashCode hashCode}. * * @param x The value for which to retrieve a hash code * @return The hash code * * @throws HibernateException A problem occurred calculating the hash code */
Get a hash code, consistent with persistence "equality". Again for most types the normal usage is to delegate to the value's <code>Object#hashCode hashCode</code>
getHashCode
{ "repo_name": "HerrB92/obp", "path": "OpenBeaconPackage/libraries/hibernate-release-4.2.7.SP1/project/hibernate-core/src/main/java/org/hibernate/type/Type.java", "license": "mit", "size": 24337 }
[ "org.hibernate.HibernateException" ]
import org.hibernate.HibernateException;
import org.hibernate.*;
[ "org.hibernate" ]
org.hibernate;
826,472
@Generated(value = "com.sun.tools.xjc.Driver", date = "2015-10-25T05:29:34+06:00", comments = "JAXB RI v2.2.11") public void setIsInsert(long value) { this.isInsert = value; } /** * Gets the value of the val property. * * @return * possible object is * {@link SoapMasterCategoryFull }
@Generated(value = STR, date = STR, comments = STR) void function(long value) { this.isInsert = value; } /** * Gets the value of the val property. * * * possible object is * {@link SoapMasterCategoryFull }
/** * Sets the value of the isInsert property. * */
Sets the value of the isInsert property
setIsInsert
{ "repo_name": "kanonirov/lanb-client", "path": "src/main/java/ru/lanbilling/webservice/wsdl/InsupdMasterCategory.java", "license": "mit", "size": 2819 }
[ "javax.annotation.Generated" ]
import javax.annotation.Generated;
import javax.annotation.*;
[ "javax.annotation" ]
javax.annotation;
1,726,251
private Collection<Path> systemClasses() throws IOException { // Return "modules" jimage file if available if (Files.isRegularFile(thisSystemModules)) { return Collections.singleton(thisSystemModules); } // Exploded module image Path modules = javaHome.resolve("modules"); if (Files.isDirectory(modules.resolve("java.base"))) { try (Stream<Path> listedModules = Files.list(modules)) { return listedModules.collect(Collectors.toList()); } } // not a modular image that we know about return null; }
Collection<Path> function() throws IOException { if (Files.isRegularFile(thisSystemModules)) { return Collections.singleton(thisSystemModules); } Path modules = javaHome.resolve(STR); if (Files.isDirectory(modules.resolve(STR))) { try (Stream<Path> listedModules = Files.list(modules)) { return listedModules.collect(Collectors.toList()); } } return null; }
/** * Return a collection of files containing system classes. * Returns {@code null} if not running on a modular image. * * @throws UncheckedIOException if an I/O errors occurs */
Return a collection of files containing system classes. Returns null if not running on a modular image
systemClasses
{ "repo_name": "md-5/jdk10", "path": "src/jdk.compiler/share/classes/com/sun/tools/javac/file/Locations.java", "license": "gpl-2.0", "size": 81424 }
[ "java.io.IOException", "java.nio.file.Files", "java.nio.file.Path", "java.util.Collection", "java.util.Collections", "java.util.stream.Collectors", "java.util.stream.Stream" ]
import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.util.Collection; import java.util.Collections; import java.util.stream.Collectors; import java.util.stream.Stream;
import java.io.*; import java.nio.file.*; import java.util.*; import java.util.stream.*;
[ "java.io", "java.nio", "java.util" ]
java.io; java.nio; java.util;
2,374,704
@Override public T visitCompilationUnit(@NotNull MurmurParser.CompilationUnitContext ctx) { return visitChildren(ctx); }
@Override public T visitCompilationUnit(@NotNull MurmurParser.CompilationUnitContext ctx) { return visitChildren(ctx); }
/** * {@inheritDoc} * * <p>The default implementation returns the result of calling * {@link #visitChildren} on {@code ctx}.</p> */
The default implementation returns the result of calling <code>#visitChildren</code> on ctx
visitLambda
{ "repo_name": "Mihail-K/Murmur", "path": "src/io/cloudchaser/murmur/parser/MurmurParserBaseVisitor.java", "license": "mit", "size": 5087 }
[ "org.antlr.v4.runtime.misc.NotNull" ]
import org.antlr.v4.runtime.misc.NotNull;
import org.antlr.v4.runtime.misc.*;
[ "org.antlr.v4" ]
org.antlr.v4;
2,875,642
public static Pair<Integer, Integer> getCodecProfileAndLevel(String codec) { if (codec == null) { return null; } String[] parts = codec.split("\\."); switch (parts[0]) { case CODEC_ID_HEV1: case CODEC_ID_HVC1: return getHevcProfileAndLevel(codec, parts); case CODEC_ID_AVC1: case CODEC_ID_AVC2: return getAvcProfileAndLevel(codec, parts); default: return null; } }
static Pair<Integer, Integer> function(String codec) { if (codec == null) { return null; } String[] parts = codec.split("\\."); switch (parts[0]) { case CODEC_ID_HEV1: case CODEC_ID_HVC1: return getHevcProfileAndLevel(codec, parts); case CODEC_ID_AVC1: case CODEC_ID_AVC2: return getAvcProfileAndLevel(codec, parts); default: return null; } }
/** * Returns profile and level (as defined by {@link CodecProfileLevel}) corresponding to the given * codec description string (as defined by RFC 6381). * * @param codec A codec description string, as defined by RFC 6381. * @return A pair (profile constant, level constant) if {@code codec} is well-formed and * recognized, or null otherwise */
Returns profile and level (as defined by <code>CodecProfileLevel</code>) corresponding to the given codec description string (as defined by RFC 6381)
getCodecProfileAndLevel
{ "repo_name": "WeiChungChang/ExoPlayer", "path": "library/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecUtil.java", "license": "apache-2.0", "size": 25357 }
[ "android.util.Pair" ]
import android.util.Pair;
import android.util.*;
[ "android.util" ]
android.util;
1,777,918
public final void setBitmapDecoderClass(Class<? extends ImageDecoder> bitmapDecoderClass) { if (bitmapDecoderClass == null) { throw new IllegalArgumentException("Decoder class cannot be set to null"); } this.bitmapDecoderFactory = new CompatDecoderFactory<ImageDecoder>(bitmapDecoderClass); }
final void function(Class<? extends ImageDecoder> bitmapDecoderClass) { if (bitmapDecoderClass == null) { throw new IllegalArgumentException(STR); } this.bitmapDecoderFactory = new CompatDecoderFactory<ImageDecoder>(bitmapDecoderClass); }
/** * Swap the default bitmap decoder implementation for one of your own. You must do this before setting the image file or * asset, and you cannot use a custom decoder when using layout XML to set an asset name. Your class must have a * public default constructor. * @param bitmapDecoderClass The {@link ImageDecoder} implementation to use. */
Swap the default bitmap decoder implementation for one of your own. You must do this before setting the image file or asset, and you cannot use a custom decoder when using layout XML to set an asset name. Your class must have a public default constructor
setBitmapDecoderClass
{ "repo_name": "augmify/subsampling-scale-image-view", "path": "library/src/com/davemorrissey/labs/subscaleview/SubsamplingScaleImageView.java", "license": "apache-2.0", "size": 114158 }
[ "com.davemorrissey.labs.subscaleview.decoder.CompatDecoderFactory", "com.davemorrissey.labs.subscaleview.decoder.ImageDecoder" ]
import com.davemorrissey.labs.subscaleview.decoder.CompatDecoderFactory; import com.davemorrissey.labs.subscaleview.decoder.ImageDecoder;
import com.davemorrissey.labs.subscaleview.decoder.*;
[ "com.davemorrissey.labs" ]
com.davemorrissey.labs;
1,944,161
void markAllParametersEscaped() { Node lp = jsScope.getRootNode().getFirstChild().getNext(); for(Node arg = lp.getFirstChild(); arg != null; arg = arg.getNext()) { escaped.add(jsScope.getVar(arg.getString())); } }
void markAllParametersEscaped() { Node lp = jsScope.getRootNode().getFirstChild().getNext(); for(Node arg = lp.getFirstChild(); arg != null; arg = arg.getNext()) { escaped.add(jsScope.getVar(arg.getString())); } }
/** * Give up computing liveness of formal parameter by putting all the parameter * names in the escaped set. */
Give up computing liveness of formal parameter by putting all the parameter names in the escaped set
markAllParametersEscaped
{ "repo_name": "110035/kissy", "path": "tools/module-compiler/src/com/google/javascript/jscomp/LiveVariablesAnalysis.java", "license": "mit", "size": 9330 }
[ "com.google.javascript.rhino.Node" ]
import com.google.javascript.rhino.Node;
import com.google.javascript.rhino.*;
[ "com.google.javascript" ]
com.google.javascript;
127,797
public final void unregisterLightService(SensorEventListener listenerfromMainApp) throws LightSensorException { if(listenerfromMainApp!=null) { if(light!=null) { light.disableLightSensor(listenerfromMainApp); CAFConfig.setSensorLight(false); if(enableDebugging) Log.d(TAG,"Unregister Light Sensor"); } } else { Log.d(TAG,"listenerfromMainApp is null"); } }
final void function(SensorEventListener listenerfromMainApp) throws LightSensorException { if(listenerfromMainApp!=null) { if(light!=null) { light.disableLightSensor(listenerfromMainApp); CAFConfig.setSensorLight(false); if(enableDebugging) Log.d(TAG,STR); } } else { Log.d(TAG,STR); } }
/** * To un-register the Light sensor Service */
To un-register the Light sensor Service
unregisterLightService
{ "repo_name": "AndroidLearnerchn/AndroidLibraryProject", "path": "ContextAwareFramework/src/com/contextawareframework/controller/SensorController.java", "license": "apache-2.0", "size": 13120 }
[ "android.hardware.SensorEventListener", "android.util.Log", "com.contextawareframework.exceptions.LightSensorException", "com.contextawareframework.globalvariable.CAFConfig" ]
import android.hardware.SensorEventListener; import android.util.Log; import com.contextawareframework.exceptions.LightSensorException; import com.contextawareframework.globalvariable.CAFConfig;
import android.hardware.*; import android.util.*; import com.contextawareframework.exceptions.*; import com.contextawareframework.globalvariable.*;
[ "android.hardware", "android.util", "com.contextawareframework.exceptions", "com.contextawareframework.globalvariable" ]
android.hardware; android.util; com.contextawareframework.exceptions; com.contextawareframework.globalvariable;
2,178,533
protected SourceModule getSourceModule(IResource resource, IDocument document, IPythonNature nature) throws MisconfigurationException { SourceModule module = (SourceModule) memo.get(MODULE_CACHE + resource.getModificationStamp()); if (module == null) { module = createSoureModule(resource, document, getModuleName(resource, nature)); setModuleInCache(resource, module); } return module; }
SourceModule function(IResource resource, IDocument document, IPythonNature nature) throws MisconfigurationException { SourceModule module = (SourceModule) memo.get(MODULE_CACHE + resource.getModificationStamp()); if (module == null) { module = createSoureModule(resource, document, getModuleName(resource, nature)); setModuleInCache(resource, module); } return module; }
/** * This method returns the module that is created from the given resource. * * It also uses the cache, to see if the module is already available for that. * * @param resource the resource we are analyzing * @param document the document with the resource contents * @return the module that is created by the given resource * @throws MisconfigurationException */
This method returns the module that is created from the given resource. It also uses the cache, to see if the module is already available for that
getSourceModule
{ "repo_name": "smkr/pyclipse", "path": "plugins/org.python.pydev/src/org/python/pydev/builder/PyDevBuilderVisitor.java", "license": "epl-1.0", "size": 11132 }
[ "org.eclipse.core.resources.IResource", "org.eclipse.jface.text.IDocument", "org.python.pydev.core.IPythonNature", "org.python.pydev.core.MisconfigurationException", "org.python.pydev.editor.codecompletion.revisited.modules.SourceModule" ]
import org.eclipse.core.resources.IResource; import org.eclipse.jface.text.IDocument; import org.python.pydev.core.IPythonNature; import org.python.pydev.core.MisconfigurationException; import org.python.pydev.editor.codecompletion.revisited.modules.SourceModule;
import org.eclipse.core.resources.*; import org.eclipse.jface.text.*; import org.python.pydev.core.*; import org.python.pydev.editor.codecompletion.revisited.modules.*;
[ "org.eclipse.core", "org.eclipse.jface", "org.python.pydev" ]
org.eclipse.core; org.eclipse.jface; org.python.pydev;
1,980,489
public void writeCIOnlineResource(XMLStreamWriter writer, CIOnlineResource bean) throws XMLStreamException { writer.writeStartElement(NS_URI, "CI_OnlineResource"); this.writeNamespaces(writer); this.writeCIOnlineResourceType(writer, bean); writer.writeEndElement(); }
void function(XMLStreamWriter writer, CIOnlineResource bean) throws XMLStreamException { writer.writeStartElement(NS_URI, STR); this.writeNamespaces(writer); this.writeCIOnlineResourceType(writer, bean); writer.writeEndElement(); }
/** * Write method for CIOnlineResource element */
Write method for CIOnlineResource element
writeCIOnlineResource
{ "repo_name": "sensiasoft/lib-sensorml", "path": "sensorml-core/src/main/java/org/isotc211/v2005/gmd/bind/XMLStreamBindings.java", "license": "mpl-2.0", "size": 80004 }
[ "javax.xml.stream.XMLStreamException", "javax.xml.stream.XMLStreamWriter", "org.isotc211.v2005.gmd.CIOnlineResource" ]
import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; import org.isotc211.v2005.gmd.CIOnlineResource;
import javax.xml.stream.*; import org.isotc211.v2005.gmd.*;
[ "javax.xml", "org.isotc211.v2005" ]
javax.xml; org.isotc211.v2005;
2,643,624
protected String extractDocTypeFromMetaData(ExtrinsicObjectType documentMetaData) { log.debug("Begin extractDocTypeFromMetaData"); String value = null; if (null != documentMetaData && null != documentMetaData.getClassification() && documentMetaData.getClassification().size() > 0) { log.debug("Classification size: " + documentMetaData.getClassification().size()); List<ClassificationType> classificationList = documentMetaData.getClassification(); for (ClassificationType classification : classificationList) { if (null != classification && null != classification.getClassificationScheme() && classification.getClassificationScheme().contentEquals(EBXML_RESPONSE_TYPECODE_CLASS_SCHEME)) { log.debug("Looking at classification scheme (" + classification.getClassificationScheme() + ") compared to (" + EBXML_RESPONSE_TYPECODE_CLASS_SCHEME + ")"); value = classification.getNodeRepresentation(); // value = parseInternationalType(classification.getName()); log.debug("Value extracted from classification: " + value); } } } log.debug("End extractDocTypeFromMetaData - result: " + value); return value; }
String function(ExtrinsicObjectType documentMetaData) { log.debug(STR); String value = null; if (null != documentMetaData && null != documentMetaData.getClassification() && documentMetaData.getClassification().size() > 0) { log.debug(STR + documentMetaData.getClassification().size()); List<ClassificationType> classificationList = documentMetaData.getClassification(); for (ClassificationType classification : classificationList) { if (null != classification && null != classification.getClassificationScheme() && classification.getClassificationScheme().contentEquals(EBXML_RESPONSE_TYPECODE_CLASS_SCHEME)) { log.debug(STR + classification.getClassificationScheme() + STR + EBXML_RESPONSE_TYPECODE_CLASS_SCHEME + ")"); value = classification.getNodeRepresentation(); log.debug(STR + value); } } } log.debug(STR + value); return value; }
/** * This method extracts Document Type from AdhocQuery Metadata for identified Extrinsic Object for a particular * Document * * @param documentMetaData * @return String */
This method extracts Document Type from AdhocQuery Metadata for identified Extrinsic Object for a particular Document
extractDocTypeFromMetaData
{ "repo_name": "alameluchidambaram/CONNECT", "path": "Product/Production/Services/SharedEngineCore/src/main/java/gov/hhs/fha/nhinc/redactionengine/adapter/DocRetrieveResponseProcessor.java", "license": "bsd-3-clause", "size": 18168 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,148,542
public static void copyFromStreamToBuffer(ByteBuffer out, DataInputStream in, int length) throws IOException { if (out.hasArray()) { in.readFully(out.array(), out.position() + out.arrayOffset(), length); skip(out, length); } else { for (int i = 0; i < length; ++i) { out.put(in.readByte()); } } }
static void function(ByteBuffer out, DataInputStream in, int length) throws IOException { if (out.hasArray()) { in.readFully(out.array(), out.position() + out.arrayOffset(), length); skip(out, length); } else { for (int i = 0; i < length; ++i) { out.put(in.readByte()); } } }
/** * Copy the given number of bytes from the given stream and put it at the * current position of the given buffer, updating the position in the buffer. * @param out the buffer to write data to * @param in the stream to read data from * @param length the number of bytes to read/write */
Copy the given number of bytes from the given stream and put it at the current position of the given buffer, updating the position in the buffer
copyFromStreamToBuffer
{ "repo_name": "ddraj/hbase-trunk-mttr", "path": "hbase-common/src/main/java/org/apache/hadoop/hbase/util/ByteBufferUtils.java", "license": "apache-2.0", "size": 13470 }
[ "java.io.DataInputStream", "java.io.IOException", "java.nio.ByteBuffer" ]
import java.io.DataInputStream; import java.io.IOException; import java.nio.ByteBuffer;
import java.io.*; import java.nio.*;
[ "java.io", "java.nio" ]
java.io; java.nio;
2,269,289
@Override public int quantityDropped(Random random) { return random.nextInt(1) + 1; }
int function(Random random) { return random.nextInt(1) + 1; }
/** * Returns the quantity of items to drop on block destruction. */
Returns the quantity of items to drop on block destruction
quantityDropped
{ "repo_name": "Lumaceon/ClockworkPhase", "path": "src/main/java/lumaceon/mods/clockworkphase/block/BlockTemporalWood.java", "license": "gpl-2.0", "size": 1417 }
[ "java.util.Random" ]
import java.util.Random;
import java.util.*;
[ "java.util" ]
java.util;
322,093
@JsonProperty("exibirInformacaoAdicional") @NotNull public Boolean isExibirInformacaoAdicional() { return exibirInformacaoAdicional; }
@JsonProperty(STR) Boolean function() { return exibirInformacaoAdicional; }
/** * Indica se o sistema permite que seja informado o campo informacaoAdicional durante o cadastro de LPCOs do modelo * @return exibirInformacaoAdicional **/
Indica se o sistema permite que seja informado o campo informacaoAdicional durante o cadastro de LPCOs do modelo
isExibirInformacaoAdicional
{ "repo_name": "samuelfac/portalunico.siscomex.gov.br", "path": "src/main/java/br/gov/siscomex/portalunico/talpco/model/ModeloLpcoCompleto.java", "license": "mit", "size": 10845 }
[ "com.fasterxml.jackson.annotation.JsonProperty" ]
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.*;
[ "com.fasterxml.jackson" ]
com.fasterxml.jackson;
2,858,242
public JTabbedPane getOtherTabs() { return this.otherTabs; }
JTabbedPane function() { return this.otherTabs; }
/** * Returns a reference to the tabbed pane. * * @return A reference to the tabbed pane. */
Returns a reference to the tabbed pane
getOtherTabs
{ "repo_name": "jfree/jfreechart", "path": "src/main/java/org/jfree/chart/swing/editor/DefaultAxisEditor.java", "license": "lgpl-2.1", "size": 17216 }
[ "javax.swing.JTabbedPane" ]
import javax.swing.JTabbedPane;
import javax.swing.*;
[ "javax.swing" ]
javax.swing;
44,380
public HttpServerExchange setDispatchExecutor(final Executor executor) { if (executor == null) { dispatchExecutor = null; } else { dispatchExecutor = executor; } return this; }
HttpServerExchange function(final Executor executor) { if (executor == null) { dispatchExecutor = null; } else { dispatchExecutor = executor; } return this; }
/** * Sets the executor that is used for dispatch operations where no executor is specified. * * @param executor The executor to use */
Sets the executor that is used for dispatch operations where no executor is specified
setDispatchExecutor
{ "repo_name": "biddyweb/undertow", "path": "core/src/main/java/io/undertow/server/HttpServerExchange.java", "license": "apache-2.0", "size": 81449 }
[ "java.util.concurrent.Executor" ]
import java.util.concurrent.Executor;
import java.util.concurrent.*;
[ "java.util" ]
java.util;
2,726,970