before stringlengths 12 3.21M | after stringlengths 41 3.21M | repo stringlengths 1 56 | type stringclasses 1
value | __index_level_0__ int64 0 442k |
|---|---|---|---|---|
@Override
public boolean onUpdate() {
if (!pageURI.equals(tabData.pageURI)) {
pageURI = tabData.pageURI;
name = tabData.getDocPage().getDisplayName();
reloadElement();
}
if (scrollBar.getRawPos() != tabData.scrollPosition) {
scrollBar.updateRawPos(tabData.scrollPosition, true);
}
if (tabData.requiresEditReload) {
tabDa... | @Override
public boolean onUpdate() {
if (!pageURI.equals(tabData.pageURI)) {
pageURI = tabData.pageURI;
name = tabData.getDocPage().getDisplayName();
reloadElement();
}
if (scrollBar.getRawPos() != tabData.scrollPosition) {
scrollBar.updateRawPos(tabData.scrollPosition, true);
}
if (tabData.requiresEditReload) {
tabDa... | ProjectIntelligence | positive | 6,148 |
public void expand(boolean animate) {
if (true == expanded) {
return;
}
expanded = true;
int targetExpansion = true ? 1 : 0;
if (animate) {
animateSize(targetExpansion);
} else {
expansion = targetExpansion;
requestLayout();
}
} | public void expand(boolean animate) {
<DeepExtract>
if (true == expanded) {
return;
}
expanded = true;
int targetExpansion = true ? 1 : 0;
if (animate) {
animateSize(targetExpansion);
} else {
expansion = targetExpansion;
requestLayout();
}
</DeepExtract>
} | EduBao | positive | 6,149 |
public void widgetSelected(SelectionEvent e) {
List<String> packages = getPackages();
for (PackageSelectionFinishedListener listener : packageListeners) {
listener.packagesSelected(packages);
}
clear();
} | public void widgetSelected(SelectionEvent e) {
<DeepExtract>
List<String> packages = getPackages();
for (PackageSelectionFinishedListener listener : packageListeners) {
listener.packagesSelected(packages);
}
clear();
</DeepExtract>
} | Composer-Eclipse-Plugin | positive | 6,150 |
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
final String[] files;
try {
files = getResources().getAssets().list(ASSETS_PATH_COMMANDS);
Arrays.sort(files, String.CASE_INSENSITIVE_ORDER);
mFiles = files;
} catch (IOException e) {
e.printStackTrace();
}
return new String[0];
AlertDialog.Builder bui... | @Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
<DeepExtract>
final String[] files;
try {
files = getResources().getAssets().list(ASSETS_PATH_COMMANDS);
Arrays.sort(files, String.CASE_INSENSITIVE_ORDER);
mFiles = files;
} catch (IOException e) {
e.printStackTrace();
}
return new String[0];
</DeepExt... | RtkGps | positive | 6,151 |
@Override
public void start() throws IllegalStateException {
if (mWakeLock != null) {
if (true && !mWakeLock.isHeld()) {
mWakeLock.acquire();
} else if (!true && mWakeLock.isHeld()) {
mWakeLock.release();
}
}
mStayAwake = true;
updateSurfaceScreenOn();
_start();
} | @Override
public void start() throws IllegalStateException {
<DeepExtract>
if (mWakeLock != null) {
if (true && !mWakeLock.isHeld()) {
mWakeLock.acquire();
} else if (!true && mWakeLock.isHeld()) {
mWakeLock.release();
}
}
mStayAwake = true;
updateSurfaceScreenOn();
</DeepExtract>
_start();
} | Car-eye-Client-android | positive | 6,152 |
public String generateFulfillment(String ilpPacket, byte[] secret) {
byte[] bFulfillment;
try {
String HMAC_ALGORITHM = "HmacSHA256";
Mac mac = Mac.getInstance(HMAC_ALGORITHM);
mac.init(new SecretKeySpec(secret, HMAC_ALGORITHM));
bFulfillment = mac.doFinal(ilpPacket.getBytes());
} catch (NoSuchAlgorithmException | Ille... | public String generateFulfillment(String ilpPacket, byte[] secret) {
<DeepExtract>
byte[] bFulfillment;
try {
String HMAC_ALGORITHM = "HmacSHA256";
Mac mac = Mac.getInstance(HMAC_ALGORITHM);
mac.init(new SecretKeySpec(secret, HMAC_ALGORITHM));
bFulfillment = mac.doFinal(ilpPacket.getBytes());
} catch (NoSuchAlgorithmEx... | payment-hub | positive | 6,153 |
public void setTypeface(Typeface typeface) {
_defTypeface = typeface;
_boldTypeface = Typeface.create(typeface, Typeface.BOLD);
_italicTypeface = Typeface.create(typeface, Typeface.ITALIC);
_brush.setTypeface(typeface);
_brushLine.setTypeface(typeface);
if (_hDoc.isWordWrap())
_hDoc.analyzeWordWrap();
int newRow = _hDo... | public void setTypeface(Typeface typeface) {
_defTypeface = typeface;
_boldTypeface = Typeface.create(typeface, Typeface.BOLD);
_italicTypeface = Typeface.create(typeface, Typeface.ITALIC);
_brush.setTypeface(typeface);
_brushLine.setTypeface(typeface);
if (_hDoc.isWordWrap())
_hDoc.analyzeWordWrap();
<DeepExtract>
int... | ALuaJ | positive | 6,154 |
@Command(args = "info", type = CommandType.DEFAULT, minargs = 1, usage = "<name>")
public boolean command_info(CommandSender sender, String[] args) throws MyCommandException {
if (!ItemStorage.isValidName(args[0])) {
throw new MyCommandException("§cInvalid name. Use [0-9a-zA-Z_-], 64 characters max.");
}
if (!ItemStor... | @Command(args = "info", type = CommandType.DEFAULT, minargs = 1, usage = "<name>")
public boolean command_info(CommandSender sender, String[] args) throws MyCommandException {
if (!ItemStorage.isValidName(args[0])) {
throw new MyCommandException("§cInvalid name. Use [0-9a-zA-Z_-], 64 characters max.");
}
<DeepExtract>... | NBTEditor | positive | 6,155 |
public Map<String, ArmorStand> spawnArmorStands(Block block) {
Map<String, ArmorStand> map = new HashMap<>();
Location origin = block.getLocation();
Location loc = origin.clone().add(0.5, 0.2, 0.5);
SurroundingPlaneArmorStand slot1 = new SurroundingPlaneArmorStand(loc.clone(), 0.7, pathType);
slot1.setBasePlate(false);... | public Map<String, ArmorStand> spawnArmorStands(Block block) {
Map<String, ArmorStand> map = new HashMap<>();
Location origin = block.getLocation();
Location loc = origin.clone().add(0.5, 0.2, 0.5);
SurroundingPlaneArmorStand slot1 = new SurroundingPlaneArmorStand(loc.clone(), 0.7, pathType);
<DeepExtract>
slot1.setBas... | InteractionVisualizer | positive | 6,156 |
@Override
public Response post(String path, String body, Map<String, String> options) throws SparkAPIClientException {
HttpPost r = new HttpPost(path);
if (headers != null) {
for (String key : headers.keySet()) r.addHeader(key, headers.get(key));
}
HttpEntity data;
try {
data = new StringEntity(body);
((StringEntity) d... | @Override
public Response post(String path, String body, Map<String, String> options) throws SparkAPIClientException {
HttpPost r = new HttpPost(path);
if (headers != null) {
for (String key : headers.keySet()) r.addHeader(key, headers.get(key));
}
HttpEntity data;
try {
data = new StringEntity(body);
((StringEntity) d... | SparkJava | positive | 6,157 |
public static int checkSuggestBitRate(int wxh, int bitrate) {
int sugg;
if (wxh <= 480 * 480) {
sugg = 1000 * 1024;
} else if (wxh <= 640 * 480) {
sugg = 1500 * 1024;
} else if (wxh <= 800 * 480) {
sugg = 1800 * 1024;
} else if (wxh <= 960 * 544) {
sugg = 2300 * 1024;
} else if (wxh <= 1280 * 720) {
sugg = 2800 * 1024;... | public static int checkSuggestBitRate(int wxh, int bitrate) {
<DeepExtract>
int sugg;
if (wxh <= 480 * 480) {
sugg = 1000 * 1024;
} else if (wxh <= 640 * 480) {
sugg = 1500 * 1024;
} else if (wxh <= 800 * 480) {
sugg = 1800 * 1024;
} else if (wxh <= 960 * 544) {
sugg = 2300 * 1024;
} else if (wxh <= 1280 * 720) {
sugg ... | video-edit-sdk-android | positive | 6,158 |
public boolean validUtf8(int[] data) {
int len = data.length;
String[] utf = new String[len];
int base = (1 << 8) - 1;
for (int i = 0; i < len; i++) {
utf[i] = Integer.toBinaryString(data[i] & base);
while (utf[i].length() < 8) utf[i] = "0" + utf[i];
}
int len = utf.length - 0, cnt = 0;
for (int i = 0; i < 8; i++) if (... | public boolean validUtf8(int[] data) {
int len = data.length;
String[] utf = new String[len];
int base = (1 << 8) - 1;
for (int i = 0; i < len; i++) {
utf[i] = Integer.toBinaryString(data[i] & base);
while (utf[i].length() < 8) utf[i] = "0" + utf[i];
}
<DeepExtract>
int len = utf.length - 0, cnt = 0;
for (int i = 0; i ... | OnlineJudge-Solutions | positive | 6,159 |
public static void dispose() {
for (Color color : m_colorMap.values()) {
color.dispose();
}
m_colorMap.clear();
{
for (Image image : m_imageMap.values()) {
image.dispose();
}
m_imageMap.clear();
}
for (int i = 0; i < m_decoratedImageMap.length; i++) {
Map<Image, Map<Image, Image>> cornerDecoratedImageMap = m_decoratedI... | public static void dispose() {
for (Color color : m_colorMap.values()) {
color.dispose();
}
m_colorMap.clear();
{
for (Image image : m_imageMap.values()) {
image.dispose();
}
m_imageMap.clear();
}
for (int i = 0; i < m_decoratedImageMap.length; i++) {
Map<Image, Map<Image, Image>> cornerDecoratedImageMap = m_decoratedI... | AndroidRobot | positive | 6,160 |
@Override
public void createControl(Composite parent) {
this.parentComposite = parent;
try {
toolsJsonParser.loadJson();
this.toolsVOs = toolsJsonParser.getToolsList();
} catch (Exception e) {
Logger.log(e);
}
Composite treeControlsComposite = new Composite(parent, SWT.NONE);
treeControlsComposite.setLayout(new GridLay... | @Override
public void createControl(Composite parent) {
this.parentComposite = parent;
try {
toolsJsonParser.loadJson();
this.toolsVOs = toolsJsonParser.getToolsList();
} catch (Exception e) {
Logger.log(e);
}
Composite treeControlsComposite = new Composite(parent, SWT.NONE);
treeControlsComposite.setLayout(new GridLay... | idf-eclipse-plugin | positive | 6,161 |
@Override
public Future<Set<TopicPartition>> paused() {
Promise<T> promise = Promise.promise();
submitTask((consumer, future) -> {
Set<TopicPartition> result = consumer.paused();
if (future != null) {
future.complete(result);
}
}, promise);
return promise.future();
} | @Override
public Future<Set<TopicPartition>> paused() {
<DeepExtract>
Promise<T> promise = Promise.promise();
submitTask((consumer, future) -> {
Set<TopicPartition> result = consumer.paused();
if (future != null) {
future.complete(result);
}
}, promise);
return promise.future();
</DeepExtract>
} | vertx-kafka-client | positive | 6,162 |
public Criteria andGmtModifiedBetween(Long value1, Long value2) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "gmtModified" + " cannot be null");
}
criteria.add(new Criterion("gmt_modified between", value1, value2));
return (Criteria) this;
} | public Criteria andGmtModifiedBetween(Long value1, Long value2) {
<DeepExtract>
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "gmtModified" + " cannot be null");
}
criteria.add(new Criterion("gmt_modified between", value1, value2));
</DeepExtract>
return (Criteria) this;
} | community | positive | 6,163 |
public MessageBufPro getDefaultInstanceForType() {
return defaultInstance;
} | public MessageBufPro getDefaultInstanceForType() {
<DeepExtract>
return defaultInstance;
</DeepExtract>
} | tcp-gateway | positive | 6,164 |
@Override
public int computeHorizontalScrollRange(RecyclerView.State state) {
if (getItemCount() == 0) {
return 0;
} else {
return scrollToChangeCurrent * (getItemCount() - 1);
}
} | @Override
public int computeHorizontalScrollRange(RecyclerView.State state) {
<DeepExtract>
if (getItemCount() == 0) {
return 0;
} else {
return scrollToChangeCurrent * (getItemCount() - 1);
}
</DeepExtract>
} | ABase | positive | 6,165 |
public String getDefaultCommentsMobileSite() {
if (mSharedPreferences.getBoolean("mobilecommentspref", true)) {
return REDDIT_MOBILE_BETA_URL;
} else {
return REDDIT_MOBILE_URL;
}
} | public String getDefaultCommentsMobileSite() {
<DeepExtract>
if (mSharedPreferences.getBoolean("mobilecommentspref", true)) {
return REDDIT_MOBILE_BETA_URL;
} else {
return REDDIT_MOBILE_URL;
}
</DeepExtract>
} | reddinator | positive | 6,166 |
public Criteria andItemIdLessThanOrEqualTo(Integer value) {
if (value == null) {
throw new RuntimeException("Value for " + "itemId" + " cannot be null");
}
criteria.add(new Criterion("item_id <=", value));
return (Criteria) this;
} | public Criteria andItemIdLessThanOrEqualTo(Integer value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "itemId" + " cannot be null");
}
criteria.add(new Criterion("item_id <=", value));
</DeepExtract>
return (Criteria) this;
} | XiaoMiShop | positive | 6,167 |
@GetMapping(path = "/get")
@Authorize(value = { AuthConstant.AUTHORIZATION_WWW_SERVICE, AuthConstant.AUTHORIZATION_ACCOUNT_SERVICE, AuthConstant.AUTHORIZATION_COMPANY_SERVICE, AuthConstant.AUTHORIZATION_WHOAMI_SERVICE, AuthConstant.AUTHORIZATION_BOT_SERVICE, AuthConstant.AUTHORIZATION_AUTHENTICATED_USER, AuthConstant.A... | @GetMapping(path = "/get")
@Authorize(value = { AuthConstant.AUTHORIZATION_WWW_SERVICE, AuthConstant.AUTHORIZATION_ACCOUNT_SERVICE, AuthConstant.AUTHORIZATION_COMPANY_SERVICE, AuthConstant.AUTHORIZATION_WHOAMI_SERVICE, AuthConstant.AUTHORIZATION_BOT_SERVICE, AuthConstant.AUTHORIZATION_AUTHENTICATED_USER, AuthConstant.A... | staffjoy | positive | 6,168 |
@Test
public void testSearchResultsAreSubmittedToResultsQueue() throws Exception {
Queue resultsQueue = queueSession.createQueue("Results");
QueueReceiver receiver = queueSession.createReceiver(resultsQueue);
receiver.setMessageListener(this);
SearchListenerBean bean = new SearchListenerBean();
bean.connectionFactory =... | @Test
public void testSearchResultsAreSubmittedToResultsQueue() throws Exception {
Queue resultsQueue = queueSession.createQueue("Results");
QueueReceiver receiver = queueSession.createReceiver(resultsQueue);
receiver.setMessageListener(this);
SearchListenerBean bean = new SearchListenerBean();
bean.connectionFactory =... | edu | positive | 6,169 |
@Override
public void setInt(int paramInt1, int paramInt2) throws SQLException {
List<Object> paramsList = getParamsList();
paramsList.add(paramInt2);
((PreparedStatement) this.statement).setInt(paramInt1, paramInt2);
} | @Override
public void setInt(int paramInt1, int paramInt2) throws SQLException {
<DeepExtract>
List<Object> paramsList = getParamsList();
paramsList.add(paramInt2);
</DeepExtract>
((PreparedStatement) this.statement).setInt(paramInt1, paramInt2);
} | dts | positive | 6,170 |
@Override
public JsonObjectBuilder add(String name, long value) {
if (name == null) {
throw new NullPointerException(JsonMessages.OBJBUILDER_NAME_NULL());
}
if (valueMap == null) {
this.valueMap = new LinkedHashMap<>();
}
valueMap.put(name, JsonNumberImpl.getJsonNumber(value));
return this;
} | @Override
public JsonObjectBuilder add(String name, long value) {
if (name == null) {
throw new NullPointerException(JsonMessages.OBJBUILDER_NAME_NULL());
}
<DeepExtract>
if (valueMap == null) {
this.valueMap = new LinkedHashMap<>();
}
valueMap.put(name, JsonNumberImpl.getJsonNumber(value));
</DeepExtract>
return this;... | jsonp | positive | 6,171 |
public DataWrapper put_after(String key, Object value, Set<DataWrapper> after) throws Exception {
storage.put(key, (byte[]) value, System.currentTimeMillis(), true);
return new DataWrapper(key, value, new KeyDependencySet(), -1);
} | public DataWrapper put_after(String key, Object value, Set<DataWrapper> after) throws Exception {
<DeepExtract>
storage.put(key, (byte[]) value, System.currentTimeMillis(), true);
</DeepExtract>
return new DataWrapper(key, value, new KeyDependencySet(), -1);
} | bolton-sigmod2013-code | positive | 6,172 |
@Override
public void onSuccess() {
} | @Override
<DeepExtract>
</DeepExtract>
public void onSuccess() {
<DeepExtract>
</DeepExtract>
} | KJFrameForAndroid_Modify | positive | 6,173 |
public MachineInfo toMachineInfo() {
MachineInfo machineInfo = new MachineInfo();
this.app = app;
this.hostname = hostname;
this.ip = ip;
this.port = port;
machineInfo.setLastHeartbeat(timestamp.getTime());
machineInfo.setHeartbeatVersion(timestamp.getTime());
return machineInfo;
} | public MachineInfo toMachineInfo() {
MachineInfo machineInfo = new MachineInfo();
this.app = app;
this.hostname = hostname;
this.ip = ip;
<DeepExtract>
this.port = port;
</DeepExtract>
machineInfo.setLastHeartbeat(timestamp.getTime());
machineInfo.setHeartbeatVersion(timestamp.getTime());
return machineInfo;
} | alibaba-sentinel-dashboard-nacos | positive | 6,174 |
@Deprecated
public void runtimeNative(String bundleId) {
SwtPlatform platform = SwtPlatform.getRunning();
dep(JavaPlugin.RUNTIME_CONFIGURATION_NAME, bundleId + "." + platform);
} | @Deprecated
public void runtimeNative(String bundleId) {
<DeepExtract>
SwtPlatform platform = SwtPlatform.getRunning();
dep(JavaPlugin.RUNTIME_CONFIGURATION_NAME, bundleId + "." + platform);
</DeepExtract>
} | goomph | positive | 6,175 |
@Test
public void testRebalance(TestContext ctx) throws Exception {
String topicName = "testRebalance-" + this.getClass().getName();
String consumerId = topicName;
kafkaCluster.createTopic(topicName, 2, 1);
Properties config = kafkaCluster.useTo().getConsumerProperties(consumerId, consumerId, OffsetResetStrategy.EARLIE... | @Test
public void testRebalance(TestContext ctx) throws Exception {
String topicName = "testRebalance-" + this.getClass().getName();
String consumerId = topicName;
kafkaCluster.createTopic(topicName, 2, 1);
Properties config = kafkaCluster.useTo().getConsumerProperties(consumerId, consumerId, OffsetResetStrategy.EARLIE... | vertx-kafka-client | positive | 6,176 |
public String rotateString(String obj, Integer n) {
if (obj == null || n < 0)
return "";
char[] res = obj.toCharArray();
while (0 < n - 1) {
char tmp = res[0];
res[0++] = res[n - 1];
res[n - 1--] = tmp;
}
while (n < res.length - 1) {
char tmp = res[n];
res[n++] = res[res.length - 1];
res[res.length - 1--] = tmp;
}
whil... | public String rotateString(String obj, Integer n) {
if (obj == null || n < 0)
return "";
char[] res = obj.toCharArray();
while (0 < n - 1) {
char tmp = res[0];
res[0++] = res[n - 1];
res[n - 1--] = tmp;
}
while (n < res.length - 1) {
char tmp = res[n];
res[n++] = res[res.length - 1];
res[res.length - 1--] = tmp;
}
<Dee... | LeeCode | positive | 6,177 |
public static Key TRANSCRIPTION_ID(String value) {
if (value instanceof Enum) {
value = value.toString();
}
Key key = new Key("transcriptionID");
key.value = value;
return key;
} | public static Key TRANSCRIPTION_ID(String value) {
<DeepExtract>
if (value instanceof Enum) {
value = value.toString();
}
Key key = new Key("transcriptionID");
key.value = value;
return key;
</DeepExtract>
} | tropo-webapi-java | positive | 6,178 |
private void updateRecyclerViewByLabel(MenuItem menuItem) {
isHome = false;
mCheckedLocation.clear();
mDataSet.clear();
mNavigationView.getMenu().findItem(R.id.item_all).setChecked(true);
mItemNoFolder.setChecked(true);
if (menuItem.isChecked()) {
mCheckedTag.remove(menuItem.getTitle().toString());
} else {
mCheckedTag... | private void updateRecyclerViewByLabel(MenuItem menuItem) {
isHome = false;
mCheckedLocation.clear();
mDataSet.clear();
mNavigationView.getMenu().findItem(R.id.item_all).setChecked(true);
mItemNoFolder.setChecked(true);
if (menuItem.isChecked()) {
mCheckedTag.remove(menuItem.getTitle().toString());
} else {
mCheckedTag... | Keep | positive | 6,179 |
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
LayoutInflater inflater = ctx.getLayoutInflater();
convertView = inflater.inflate(R.layout.headline_list_row, parent, false);
holder = new ViewHolder();
holder.textViewItem = (TextView) convertView.findViewById(... | @Override
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
LayoutInflater inflater = ctx.getLayoutInflater();
convertView = inflater.inflate(R.layout.headline_list_row, parent, false);
holder = new ViewHolder();
holder.textViewItem = (TextView) convertView.findViewById(... | Gazetti_Newspaper_Reader | positive | 6,180 |
public MouseWheelEvent publishMouseWheelEvent(Component source, int id, long when, int modifiers, Point sourcePoint, int clickCount, int scrollType, int scrollAmount, int wheelRotation) {
boolean isPopupTrigger = false;
MouseWheelEvent e = new MouseWheelEvent(source, id, when, modifiers, sourcePoint.x, sourcePoint.y, 0... | public MouseWheelEvent publishMouseWheelEvent(Component source, int id, long when, int modifiers, Point sourcePoint, int clickCount, int scrollType, int scrollAmount, int wheelRotation) {
boolean isPopupTrigger = false;
MouseWheelEvent e = new MouseWheelEvent(source, id, when, modifiers, sourcePoint.x, sourcePoint.y, 0... | glg2d | positive | 6,182 |
private void sendRequestRecord() throws IllegalStateException, SocketException, IOException {
String request = "RECORD rtsp://" + mParameters.host + ":" + mParameters.port + mParameters.path + " RTSP/1.0\r\n" + "Range: npt=0.000-" + addHeaders();
Log.i(TAG, request.substring(0, request.indexOf("\r\n")));
mOutputStream.... | private void sendRequestRecord() throws IllegalStateException, SocketException, IOException {
String request = "RECORD rtsp://" + mParameters.host + ":" + mParameters.port + mParameters.path + " RTSP/1.0\r\n" + "Range: npt=0.000-" + addHeaders();
Log.i(TAG, request.substring(0, request.indexOf("\r\n")));
mOutputStream.... | spydroid-ipcamera | positive | 6,183 |
public void clear() {
state = next = INIT;
states.clear();
initial = FINAL;
} | public void clear() {
<DeepExtract>
state = next = INIT;
</DeepExtract>
states.clear();
initial = FINAL;
} | fjage | positive | 6,185 |
public static double finalReflect(double baseDamage, LoreInfo defense) {
double ref = defense.reflect > defense.meleeReflect ? defense.reflect : defense.meleeReflect;
ref = ref > defense.rangeReflect ? ref : defense.rangeReflect;
return baseDamage * ref;
} | public static double finalReflect(double baseDamage, LoreInfo defense) {
double ref = defense.reflect > defense.meleeReflect ? defense.reflect : defense.meleeReflect;
ref = ref > defense.rangeReflect ? ref : defense.rangeReflect;
<DeepExtract>
return baseDamage * ref;
</DeepExtract>
} | Mesmerize | positive | 6,186 |
@Override
public void onReset() {
setState(State.Normal);
} | @Override
public void onReset() {
<DeepExtract>
setState(State.Normal);
</DeepExtract>
} | Designer | positive | 6,187 |
private void setUp(Canvas canvas) {
switch(bubbleType) {
case COLOR:
mPaint.setColor(bubbleColor);
break;
case BITMAP:
if (bubbleBitmap == null)
return;
if (mBitmapShader == null) {
mBitmapShader = new BitmapShader(bubbleBitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);
}
mPaint.setShader(mBitmapShader);
setUpShad... | private void setUp(Canvas canvas) {
switch(bubbleType) {
case COLOR:
mPaint.setColor(bubbleColor);
break;
case BITMAP:
if (bubbleBitmap == null)
return;
if (mBitmapShader == null) {
mBitmapShader = new BitmapShader(bubbleBitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);
}
mPaint.setShader(mBitmapShader);
setUpShad... | android-wechat | positive | 6,188 |
protected <E> HttpResponse<E> asyncBean(Class<E> type, HttpResponse<byte[]> response) {
responseTimeNanos = System.nanoTime() - startAsyncNanos;
httpResponse = response;
encodedResponseBody = context.readContent(response);
context.afterResponse(this);
context.checkMaybeThrow(response);
return new HttpWrapperResponse<>(... | protected <E> HttpResponse<E> asyncBean(Class<E> type, HttpResponse<byte[]> response) {
<DeepExtract>
responseTimeNanos = System.nanoTime() - startAsyncNanos;
httpResponse = response;
encodedResponseBody = context.readContent(response);
context.afterResponse(this);
context.checkMaybeThrow(response);
</DeepExtract>
retu... | avaje-http | positive | 6,189 |
@Override
@Transactional(rollbackFor = Exception.class)
public boolean updateAllById(T model) {
boolean updateBool = super.updateAllById(model);
delCache(Arrays.asList(model));
return updateBool;
} | @Override
@Transactional(rollbackFor = Exception.class)
public boolean updateAllById(T model) {
boolean updateBool = super.updateAllById(model);
<DeepExtract>
delCache(Arrays.asList(model));
</DeepExtract>
return updateBool;
} | lamp-util | positive | 6,190 |
public ImmersionBar navigationBarColorTransform(String navigationBarColorTransform) {
mBarParams.navigationBarColorTransform = Color.parseColor(navigationBarColorTransform);
return this;
} | public ImmersionBar navigationBarColorTransform(String navigationBarColorTransform) {
<DeepExtract>
mBarParams.navigationBarColorTransform = Color.parseColor(navigationBarColorTransform);
return this;
</DeepExtract>
} | MNImageBrowser | positive | 6,191 |
private void populateBean(BeanDefinition bd, Class<?> clz, Object obj) {
System.out.println("handle properties for bean : " + bd.getId());
PropertyValues propertyValues = bd.getPropertyValues();
if (propertyValues != null) {
if (!propertyValues.isEmpty()) {
for (int i = 0; i < propertyValues.size(); i++) {
PropertyValu... | private void populateBean(BeanDefinition bd, Class<?> clz, Object obj) {
<DeepExtract>
System.out.println("handle properties for bean : " + bd.getId());
PropertyValues propertyValues = bd.getPropertyValues();
if (propertyValues != null) {
if (!propertyValues.isEmpty()) {
for (int i = 0; i < propertyValues.size(); i++) ... | Minis | positive | 6,192 |
private void processFriends(long sitestreamUser, JSONObject json) throws TwitterException, JSONException {
logger.info("Unhandled event: onFriends");
} | private void processFriends(long sitestreamUser, JSONObject json) throws TwitterException, JSONException {
<DeepExtract>
logger.info("Unhandled event: onFriends");
</DeepExtract>
} | hbc | positive | 6,193 |
public static void set(State state, Texture2 texture) {
this.texture = texture;
} | public static void set(State state, Texture2 texture) {
<DeepExtract>
this.texture = texture;
</DeepExtract>
} | jogl-utils | positive | 6,194 |
public void putAllFormData(Map<String, List<String>> data) {
if (this.formData == null) {
synchronized (this) {
if (this.formData == null) {
this.formData = new ConcurrentHashMap<>(16);
}
}
}
this.formData.putAll(data);
} | public void putAllFormData(Map<String, List<String>> data) {
<DeepExtract>
if (this.formData == null) {
synchronized (this) {
if (this.formData == null) {
this.formData = new ConcurrentHashMap<>(16);
}
}
}
</DeepExtract>
this.formData.putAll(data);
} | alita | positive | 6,195 |
public static Tokeninfo createFromAuthorizationCode(APIContext apiContext, CreateFromAuthorizationCodeParameters createFromAuthorizationCodeParameters) throws PayPalRESTException {
String pattern = "v1/identity/openidconnect/tokenservice?grant_type={0}&code={1}&redirect_uri={2}";
Object[] parameters = new Object[] { cr... | public static Tokeninfo createFromAuthorizationCode(APIContext apiContext, CreateFromAuthorizationCodeParameters createFromAuthorizationCodeParameters) throws PayPalRESTException {
String pattern = "v1/identity/openidconnect/tokenservice?grant_type={0}&code={1}&redirect_uri={2}";
Object[] parameters = new Object[] { cr... | PayPal-Java-SDK | positive | 6,196 |
private void layout1() {
AREA1_zoom_x = AREA1_zoom_y = 1.0f * AREA1_HGT / AREA1_bitmap_hgt0;
recycle_area = new RecycleArea(width, AREA1_HGT);
BITMAP_MEM_BUDGET = (int) (2 * 2 * width * height * (1.0f * AREA1_bitmap_hgt0 / AREA1_HGT));
tiles_x.clear();
int x = 0;
for (int i = 0; i < num_measures; i++) {
tiles_x.add(x);... | private void layout1() {
AREA1_zoom_x = AREA1_zoom_y = 1.0f * AREA1_HGT / AREA1_bitmap_hgt0;
recycle_area = new RecycleArea(width, AREA1_HGT);
BITMAP_MEM_BUDGET = (int) (2 * 2 * width * height * (1.0f * AREA1_bitmap_hgt0 / AREA1_HGT));
tiles_x.clear();
int x = 0;
for (int i = 0; i < num_measures; i++) {
tiles_x.add(x);... | midisheetmusicmemo | positive | 6,198 |
@Deprecated
@Override
public final void close() throws Exception {
for (int i = 0; i < size; i++) {
events[i].release();
events[i] = null;
}
size = 0;
IDs.rewind();
} | @Deprecated
@Override
public final void close() throws Exception {
<DeepExtract>
for (int i = 0; i < size; i++) {
events[i].release();
events[i] = null;
}
size = 0;
IDs.rewind();
</DeepExtract>
} | jocl | positive | 6,199 |
private View initTextControl() {
setOrientation(VERTICAL);
OEditTextField edt = new OEditTextField(mContext);
edt.setWidgetType(mWidgetType);
mControlData = edt;
edt.setResource(textSize, textAppearance, textColor);
mColumn = mColumn;
mType = getType(mColumn.getType());
if (label_view != null) {
label_view.setText(getL... | private View initTextControl() {
setOrientation(VERTICAL);
OEditTextField edt = new OEditTextField(mContext);
edt.setWidgetType(mWidgetType);
mControlData = edt;
edt.setResource(textSize, textAppearance, textColor);
<DeepExtract>
mColumn = mColumn;
mType = getType(mColumn.getType());
if (label_view != null) {
label_vie... | hr | positive | 6,200 |
@Test
public void testCleanCodeBasic() throws Exception {
System.out.println(loadOut("cleanCodeBasic"));
System.out.println(BASIC.cleanCode(loadBasicIn()));
System.out.println();
Assert.assertEquals(loadOut("cleanCodeBasic"), BASIC.cleanCode(loadBasicIn()));
} | @Test
public void testCleanCodeBasic() throws Exception {
<DeepExtract>
System.out.println(loadOut("cleanCodeBasic"));
System.out.println(BASIC.cleanCode(loadBasicIn()));
System.out.println();
Assert.assertEquals(loadOut("cleanCodeBasic"), BASIC.cleanCode(loadBasicIn()));
</DeepExtract>
} | awesome-blogs-android | positive | 6,201 |
private void openAblumWithPermissionsCheck() {
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this, new String[] { Manifest.permission.READ_EXTERNAL_STORAGE }, REQUEST_PERMISSON_SORAGE);
return;
}
MainActi... | private void openAblumWithPermissionsCheck() {
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this, new String[] { Manifest.permission.READ_EXTERNAL_STORAGE }, REQUEST_PERMISSON_SORAGE);
return;
}
<DeepExt... | SimpleImageEditor | positive | 6,202 |
@Override
public void onProgressChanged(WebView view, int newProgress) {
super.onProgressChanged(view, newProgress);
} | @Override
<DeepExtract>
</DeepExtract>
public void onProgressChanged(WebView view, int newProgress) {
<DeepExtract>
</DeepExtract>
super.onProgressChanged(view, newProgress);
<DeepExtract>
</DeepExtract>
} | BasisDependency | positive | 6,203 |
@Override
public int getBatchSizeFailureThreshold() {
logger.finest(" getBatchSizeFailureThreshold()");
return client.getIntValue("/storage_service/batch_size_failure_threshold");
} | @Override
public int getBatchSizeFailureThreshold() {
<DeepExtract>
logger.finest(" getBatchSizeFailureThreshold()");
</DeepExtract>
return client.getIntValue("/storage_service/batch_size_failure_threshold");
} | scylla-jmx | positive | 6,204 |
public CallableExecutionAssert containsParamKey(Object paramKey) {
ExecutionParameters executionParameters = ExecutionParameters.containsParamKeys(paramKey);
this.parameterAsserts.assertParameterKeys(this.actual, executionParameters, true);
return this;
return this;
} | public CallableExecutionAssert containsParamKey(Object paramKey) {
<DeepExtract>
ExecutionParameters executionParameters = ExecutionParameters.containsParamKeys(paramKey);
this.parameterAsserts.assertParameterKeys(this.actual, executionParameters, true);
return this;
</DeepExtract>
return this;
} | datasource-assert | positive | 6,205 |
@Test
public void testMultipleMatch() throws IOException, DbException, TransactionAbortedException {
HashMap<Integer, Integer> columnSpecification = new HashMap<Integer, Integer>();
columnSpecification.put(0, 1);
ArrayList<ArrayList<Integer>> t1Tuples = new ArrayList<ArrayList<Integer>>();
HeapFile table1 = SystemTestU... | @Test
public void testMultipleMatch() throws IOException, DbException, TransactionAbortedException {
<DeepExtract>
HashMap<Integer, Integer> columnSpecification = new HashMap<Integer, Integer>();
columnSpecification.put(0, 1);
ArrayList<ArrayList<Integer>> t1Tuples = new ArrayList<ArrayList<Integer>>();
HeapFile table1... | ToyDB | positive | 6,206 |
public String getHash() {
if (!complete)
throw new IllegalStateException("Bundle has not yet been fetched completely yet. Cannot " + "calculate hash" + ".");
if (!structureValid)
throw new IllegalStateException("Bundle structure is invalid. Cannot " + "calculate hash" + ".");
return hash;
} | public String getHash() {
<DeepExtract>
if (!complete)
throw new IllegalStateException("Bundle has not yet been fetched completely yet. Cannot " + "calculate hash" + ".");
if (!structureValid)
throw new IllegalStateException("Bundle structure is invalid. Cannot " + "calculate hash" + ".");
</DeepExtract>
return hash;
} | ict | positive | 6,207 |
private static byte[] getBuildFingerprintAndDeviceSerial() {
StringBuilder result = new StringBuilder();
String fingerprint = Build.FINGERPRINT;
if (fingerprint != null) {
result.append(fingerprint);
}
String serial;
try {
serial = (String) Build.class.getField("SERIAL").get(null);
} catch (Exception ignored) {
serial ... | private static byte[] getBuildFingerprintAndDeviceSerial() {
StringBuilder result = new StringBuilder();
String fingerprint = Build.FINGERPRINT;
if (fingerprint != null) {
result.append(fingerprint);
}
<DeepExtract>
String serial;
try {
serial = (String) Build.class.getField("SERIAL").get(null);
} catch (Exception igno... | safe | positive | 6,208 |
@Override
public void onError(@NonNull String e) {
if (BuildConfig.DEBUG)
Log.d("Zerokit", "onError " + e);
if (ids != null)
for (String id : ids) jsInterfaceByteArrayProvider.remove(id);
subscriber.onError(new ResponseZerokitError().parse(e));
} | @Override
public void onError(@NonNull String e) {
<DeepExtract>
if (BuildConfig.DEBUG)
Log.d("Zerokit", "onError " + e);
</DeepExtract>
if (ids != null)
for (String id : ids) jsInterfaceByteArrayProvider.remove(id);
subscriber.onError(new ResponseZerokitError().parse(e));
} | ZeroKit-Android-SDK | positive | 6,210 |
@Override
public void release() {
super.release();
if (mSurfaceTexture != null) {
if (mSurfaceTextureHost != null) {
mSurfaceTextureHost.releaseSurfaceTexture(mSurfaceTexture);
} else {
mSurfaceTexture.release();
}
mSurfaceTexture = null;
}
} | @Override
public void release() {
super.release();
<DeepExtract>
if (mSurfaceTexture != null) {
if (mSurfaceTextureHost != null) {
mSurfaceTextureHost.releaseSurfaceTexture(mSurfaceTexture);
} else {
mSurfaceTexture.release();
}
mSurfaceTexture = null;
}
</DeepExtract>
} | react-native-giraffe-player | positive | 6,211 |
public Date getExpirationDateFromToken(String token) {
final Claims claims = getAllClaimsFromToken(token);
return Claims::getExpiration.apply(claims);
} | public Date getExpirationDateFromToken(String token) {
<DeepExtract>
final Claims claims = getAllClaimsFromToken(token);
return Claims::getExpiration.apply(claims);
</DeepExtract>
} | spring-boot-study | positive | 6,212 |
@Override
public final void onCreateAfter(Bundle savedInstanceState) {
url = getIntent().getStringExtra(URL_KEY);
title = getIntent().getStringExtra(TITLE_KEY);
content = getIntent().getStringExtra(CONTENT_KEY);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.getSettings().setJavaScriptCanOpenWindowsAutomat... | @Override
<DeepExtract>
</DeepExtract>
public final void onCreateAfter(Bundle savedInstanceState) {
<DeepExtract>
</DeepExtract>
url = getIntent().getStringExtra(URL_KEY);
<DeepExtract>
</DeepExtract>
title = getIntent().getStringExtra(TITLE_KEY);
<DeepExtract>
</DeepExtract>
content = getIntent().getStringExtra(CONTEN... | MarkdownEditors | positive | 6,213 |
@Override
public void onDragEnd(DragEvent e) {
Element widgetEle = getWidget().getElement();
int current;
if (_hasTextBox) {
current = getStyleTop();
} else {
Element element = getWidget().getElement();
current = Utils.getTranslateY(element);
}
if (current == 0) {
return;
}
int panelHeight = Utils.getHeight(this.getEle... | @Override
public void onDragEnd(DragEvent e) {
Element widgetEle = getWidget().getElement();
int current;
if (_hasTextBox) {
current = getStyleTop();
} else {
Element element = getWidget().getElement();
current = Utils.getTranslateY(element);
}
if (current == 0) {
return;
}
int panelHeight = Utils.getHeight(this.getEle... | GwtMobile-UI | positive | 6,214 |
public static void main(String[] args) {
int[] array = { 1, 1, 2, 0, 0, 2, 1, 0 };
if (null == array || 1 >= array.length) {
return;
}
int begin = 0;
int current = 0;
int end = array.length - 1;
while (current <= end) {
if (0 == array[current]) {
swap(array, current, begin);
++begin;
++current;
} else if (1 == array[cu... | public static void main(String[] args) {
int[] array = { 1, 1, 2, 0, 0, 2, 1, 0 };
<DeepExtract>
if (null == array || 1 >= array.length) {
return;
}
int begin = 0;
int current = 0;
int end = array.length - 1;
while (current <= end) {
if (0 == array[current]) {
swap(array, current, begin);
++begin;
++current;
} else if ... | CodingInterview | positive | 6,215 |
public void actionPerformed(java.awt.event.ActionEvent evt) {
prefs.putBoolean(SHOW_EXTRA_LEFT, MenuItemViewLeftExtra.isSelected());
isLeftExtraShow();
} | public void actionPerformed(java.awt.event.ActionEvent evt) {
<DeepExtract>
prefs.putBoolean(SHOW_EXTRA_LEFT, MenuItemViewLeftExtra.isSelected());
isLeftExtraShow();
</DeepExtract>
} | ESPlorer | positive | 6,216 |
public final <U> Ix<List<T>> mayBy(Func1<? super T, U> keySelector, Comparator<? super U> keyComparator) {
if (Interactive.maxBy(it, keySelector, keyComparator) instanceof Ix) {
return (Ix<T>) Interactive.maxBy(it, keySelector, keyComparator);
}
return new Ix<T>(Interactive.maxBy(it, keySelector, keyComparator));
} | public final <U> Ix<List<T>> mayBy(Func1<? super T, U> keySelector, Comparator<? super U> keyComparator) {
<DeepExtract>
if (Interactive.maxBy(it, keySelector, keyComparator) instanceof Ix) {
return (Ix<T>) Interactive.maxBy(it, keySelector, keyComparator);
}
return new Ix<T>(Interactive.maxBy(it, keySelector, keyCompa... | ixjava | positive | 6,217 |
public Criteria andUserAccountIn(List<String> values) {
if (values == null) {
throw new RuntimeException("Value for " + "userAccount" + " cannot be null");
}
criteria.add(new Criterion("user_account in", values));
return (Criteria) this;
} | public Criteria andUserAccountIn(List<String> values) {
<DeepExtract>
if (values == null) {
throw new RuntimeException("Value for " + "userAccount" + " cannot be null");
}
criteria.add(new Criterion("user_account in", values));
</DeepExtract>
return (Criteria) this;
} | health_online | positive | 6,218 |
@Override
public void onPageSelected(int position) {
for (int i = 0; i < getChildCount(); i++) {
View view = getChildAt(i);
if (view instanceof TextView) {
((TextView) view).setTextColor(COLOR_TEXT_NORMAL);
}
}
View view = getChildAt(position);
if (view instanceof TextView) {
((TextView) view).setTextColor(getContext()... | @Override
public void onPageSelected(int position) {
for (int i = 0; i < getChildCount(); i++) {
View view = getChildAt(i);
if (view instanceof TextView) {
((TextView) view).setTextColor(COLOR_TEXT_NORMAL);
}
}
<DeepExtract>
View view = getChildAt(position);
if (view instanceof TextView) {
((TextView) view).setTextColo... | GizOpenSource_AppKit_Android | positive | 6,219 |
public MDSLResource moveOperation(Operation opToBeMoved, String targetEndpointName) {
ServiceSpecification mdslSpecRoot = (ServiceSpecification) opToBeMoved.eContainer().eContainer();
EndpointContract sourceEndpointType = (EndpointContract) opToBeMoved.eContainer();
EndpointContract targetEndpointType = TransformationH... | public MDSLResource moveOperation(Operation opToBeMoved, String targetEndpointName) {
ServiceSpecification mdslSpecRoot = (ServiceSpecification) opToBeMoved.eContainer().eContainer();
EndpointContract sourceEndpointType = (EndpointContract) opToBeMoved.eContainer();
EndpointContract targetEndpointType = TransformationH... | MDSL-Specification | positive | 6,220 |
@Override
public boolean runTest() throws Exception {
System.out.println("============== testRestApiExample()");
final String helloWorld = ParseCloud.callFunction("hello", null);
assertEqual("Hello world!", helloWorld);
return true;
} | @Override
public boolean runTest() throws Exception {
<DeepExtract>
System.out.println("============== testRestApiExample()");
final String helloWorld = ParseCloud.callFunction("hello", null);
assertEqual("Hello world!", helloWorld);
</DeepExtract>
return true;
} | parse4cn1 | positive | 6,221 |
public void testParallelGenerator1M_100_8() {
AtomicInteger index = new AtomicInteger();
Generator<Integer> gen = Generator.fromParallelProducers(() -> yielder -> {
int ind = index.getAndIncrement();
for (int i = 0; i <= 125_000; i++) yielder.yield((125_000 + 1) * ind + i);
}, 8, 1000, false);
testResult(gen);
} | public void testParallelGenerator1M_100_8() {
<DeepExtract>
AtomicInteger index = new AtomicInteger();
Generator<Integer> gen = Generator.fromParallelProducers(() -> yielder -> {
int ind = index.getAndIncrement();
for (int i = 0; i <= 125_000; i++) yielder.yield((125_000 + 1) * ind + i);
}, 8, 1000, false);
testResult(... | Fibry | positive | 6,222 |
private static void setEnvironmetInstance(boolean isEncryptionEnabled) {
IEnvironmentService environmentInstance = Guice.createInjector(new EnvironmentModule()).getInstance(IEnvironmentService.class);
environmentInstance.setEnvironment(RuntimeParametersCore.ENV.getValue());
if (isEncryptionEnabled) {
IDataEncryptionSer... | private static void setEnvironmetInstance(boolean isEncryptionEnabled) {
IEnvironmentService environmentInstance = Guice.createInjector(new EnvironmentModule()).getInstance(IEnvironmentService.class);
environmentInstance.setEnvironment(RuntimeParametersCore.ENV.getValue());
if (isEncryptionEnabled) {
IDataEncryptionSer... | mrchecker | positive | 6,224 |
protected void init() {
return new CordovaWebViewImpl(makeWebViewEngine());
appView.getView().setId(100);
appView.getView().setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
setContentView(appView.getView());
if (preferences.contains("BackgroundColo... | protected void init() {
return new CordovaWebViewImpl(makeWebViewEngine());
<DeepExtract>
appView.getView().setId(100);
appView.getView().setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
setContentView(appView.getView());
if (preferences.contains("... | Teaching-Ionic-MeanStack-SSUET-2015-May-ModuleB | positive | 6,225 |
@Benchmark
public Slice b18slice128M(Buffers buffers) {
verify(buffers.startOffset >= 0, "startOffset < 0");
verify(buffers.destOffset >= 0, "destOffset < 0");
verify(buffers.startOffset + 128 * 1024 * 1024 < ALLOC_SIZE, "startOffset + length >= ALLOC_SIZE");
verify(buffers.destOffset + 128 * 1024 * 1024 < ALLOC_SIZE, ... | @Benchmark
public Slice b18slice128M(Buffers buffers) {
<DeepExtract>
verify(buffers.startOffset >= 0, "startOffset < 0");
verify(buffers.destOffset >= 0, "destOffset < 0");
verify(buffers.startOffset + 128 * 1024 * 1024 < ALLOC_SIZE, "startOffset + length >= ALLOC_SIZE");
verify(buffers.destOffset + 128 * 1024 * 1024 ... | slice | positive | 6,227 |
private void onCreateInit() {
Button bma_main_export_button = findViewById(R.id.bma_main_export_button);
Button bma_main_import_button = findViewById(R.id.bma_main_import_button);
Button bma_main_copy_button = findViewById(R.id.bma_main_copy_button);
Button bma_main_paste_button = findViewById(R.id.bma_main_paste_butto... | private void onCreateInit() {
<DeepExtract>
Button bma_main_export_button = findViewById(R.id.bma_main_export_button);
Button bma_main_import_button = findViewById(R.id.bma_main_import_button);
Button bma_main_copy_button = findViewById(R.id.bma_main_copy_button);
Button bma_main_paste_button = findViewById(R.id.bma_ma... | FreezeYou | positive | 6,228 |
@Override
public void run(Timeout timeout) throws Exception {
ChannelFuture channelfuture;
bootstrap = new ClientBootstrap(new NioClientSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool()));
bootstrap.setOption("tcpNoDelay", false);
bootstrap.setOption("keepAlive", true);
final NettyCl... | @Override
public void run(Timeout timeout) throws Exception {
ChannelFuture channelfuture;
bootstrap = new ClientBootstrap(new NioClientSocketChannelFactory(Executors.newCachedThreadPool(), Executors.newCachedThreadPool()));
bootstrap.setOption("tcpNoDelay", false);
bootstrap.setOption("keepAlive", true);
final NettyCl... | jlogstash-input-plugin | positive | 6,229 |
public String getToolText(String name) {
String ret = menuHash.get(name);
if (ret == null)
return name;
else
return ret;
} | public String getToolText(String name) {
<DeepExtract>
String ret = menuHash.get(name);
if (ret == null)
return name;
else
return ret;
</DeepExtract>
} | HyperZebra | positive | 6,231 |
public Criteria andCollegenameLike(String value) {
if (value == null) {
throw new RuntimeException("Value for " + "collegename" + " cannot be null");
}
criteria.add(new Criterion("collegeName like", value));
return (Criteria) this;
} | public Criteria andCollegenameLike(String value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "collegename" + " cannot be null");
}
criteria.add(new Criterion("collegeName like", value));
</DeepExtract>
return (Criteria) this;
} | JavaWeb-WeChatMini | positive | 6,232 |
public static double get(OfflinePlayer player) {
return economy.getBalance(player);
} | public static double get(OfflinePlayer player) {
<DeepExtract>
return economy.getBalance(player);
</DeepExtract>
} | Mesmerize | positive | 6,233 |
private void setDataLength(long headerAddress, int length) {
DirectUtils.putInt(headerAddress + LENGTH_OFFSET, length);
} | private void setDataLength(long headerAddress, int length) {
<DeepExtract>
DirectUtils.putInt(headerAddress + LENGTH_OFFSET, length);
</DeepExtract>
} | Oak | positive | 6,234 |
@Test
public void test_file_location_by_relative_classpath_path() throws IOException {
sr.sendStep("Test image by relative classpath path", new File("pug/unlucky.jpg"));
ArgumentCaptor<List<MultipartBody.Part>> logCaptor = ArgumentCaptor.forClass(List.class);
verify(rpClient, timeout(1000).times(1)).log(logCaptor.captu... | @Test
public void test_file_location_by_relative_classpath_path() throws IOException {
sr.sendStep("Test image by relative classpath path", new File("pug/unlucky.jpg"));
ArgumentCaptor<List<MultipartBody.Part>> logCaptor = ArgumentCaptor.forClass(List.class);
verify(rpClient, timeout(1000).times(1)).log(logCaptor.captu... | client-java | positive | 6,235 |
private static Method getSetFlashEnabledMethod(Object iHardwareService) {
if (iHardwareService == null) {
return null;
}
Class<?> proxyClass = iHardwareService.getClass();
try {
return proxyClass.getMethod("setFlashlightEnabled", boolean.class);
} catch (NoSuchMethodException nsme) {
return null;
} catch (RuntimeExcept... | private static Method getSetFlashEnabledMethod(Object iHardwareService) {
if (iHardwareService == null) {
return null;
}
Class<?> proxyClass = iHardwareService.getClass();
<DeepExtract>
try {
return proxyClass.getMethod("setFlashlightEnabled", boolean.class);
} catch (NoSuchMethodException nsme) {
return null;
} catch ... | Android_BaseLib | positive | 6,236 |
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mContext = this;
setContentView(R.layout.activity_minidrone);
ButterKnife.bind(this);
if (SpUtil.getMode().equals(MODE_NORMAL)) {
mDebug = false;
checkIsNormalMode();
} else {
mDebug = true;
checkIsDebugMode();
}
Hub hub ... | @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mContext = this;
setContentView(R.layout.activity_minidrone);
ButterKnife.bind(this);
if (SpUtil.getMode().equals(MODE_NORMAL)) {
mDebug = false;
checkIsNormalMode();
} else {
mDebug = true;
checkIsDebugMode();
}
Hub hub ... | MyoParrot | positive | 6,237 |
@Override
public void removeUpdate(DocumentEvent e) {
fireChange();
} | @Override
public void removeUpdate(DocumentEvent e) {
<DeepExtract>
fireChange();
</DeepExtract>
} | netbeans-vagrant-plugin | positive | 6,238 |
@Test
public void testString() {
new PlainOldDataReadonlyCovisitor().covisit("x", "x");
} | @Test
public void testString() {
<DeepExtract>
new PlainOldDataReadonlyCovisitor().covisit("x", "x");
</DeepExtract>
} | cdep | positive | 6,239 |
public String asString() {
return GenericUtils.castFrom(value(), String.class);
} | public String asString() {
<DeepExtract>
return GenericUtils.castFrom(value(), String.class);
</DeepExtract>
} | morn-boot-projects | positive | 6,240 |
public static void main(String[] args) {
ActiveObjectDemo d1 = new ActiveObjectDemo();
List<Future<?>> results = new CopyOnWriteArrayList<Future<?>>();
for (float f = 0.0f; f < 1.0f; f += 0.2f) results.add(d1.calculateFloat(f, f));
for (int i = 0; i < 5; i++) results.add(d1.calculateInt(i, i));
System.out.println("All ... | public static void main(String[] args) {
ActiveObjectDemo d1 = new ActiveObjectDemo();
List<Future<?>> results = new CopyOnWriteArrayList<Future<?>>();
for (float f = 0.0f; f < 1.0f; f += 0.2f) results.add(d1.calculateFloat(f, f));
for (int i = 0; i < 5; i++) results.add(d1.calculateInt(i, i));
System.out.println("All ... | learning-note | positive | 6,241 |
@Test
public void generateAllBundles() throws IOException, SAXException {
JenkinsRule.JSONWebResponse jsonWebResponse = j.postJSON(root.getUrlName() + "/generateAllBundles?json={\"components\":1}", "");
File zipFile = File.createTempFile("test", "zip");
IOUtils.copy(jsonWebResponse.getContentAsStream(), Files.newOutput... | @Test
public void generateAllBundles() throws IOException, SAXException {
<DeepExtract>
JenkinsRule.JSONWebResponse jsonWebResponse = j.postJSON(root.getUrlName() + "/generateAllBundles?json={\"components\":1}", "");
File zipFile = File.createTempFile("test", "zip");
IOUtils.copy(jsonWebResponse.getContentAsStream(), F... | support-core-plugin | positive | 6,242 |
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_movie_theaters, container, false);
setFragmentView(view);
Bundle bundle = getArguments();
if (bundle != null) {
if (bundle.containsKey(MOVIE)) {
Gson gSon = new Gs... | @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_movie_theaters, container, false);
setFragmentView(view);
Bundle bundle = getArguments();
if (bundle != null) {
if (bundle.containsKey(MOVIE)) {
Gson gSon = new Gs... | OCiney | positive | 6,243 |
public void shutdown() {
mBlinker = null;
try {
if (this != Thread.currentThread()) {
synchronized (this) {
this.notifyAll();
}
this.join();
}
} catch (InterruptedException e) {
e.printStackTrace();
}
} | public void shutdown() {
<DeepExtract>
mBlinker = null;
</DeepExtract>
try {
if (this != Thread.currentThread()) {
synchronized (this) {
this.notifyAll();
}
this.join();
}
} catch (InterruptedException e) {
e.printStackTrace();
}
} | android-extend | positive | 6,244 |
public <T> T decodeAmf3() throws IOException {
int type = in.read();
return deserializeAmf3(type.ordinal());
} | public <T> T decodeAmf3() throws IOException {
int type = in.read();
<DeepExtract>
return deserializeAmf3(type.ordinal());
</DeepExtract>
} | riotapi | positive | 6,245 |
private void addButtons() {
titleTable = new Table();
allHeroesTable = new Table();
selectedHeroesTableVerticalGroup = new VerticalGroup();
selectedHeroesTableVerticalGroup2 = new VerticalGroup();
saveAndExitTable = new Table();
mainTable.setFillParent(true);
titleTable.add(titleLabel);
mainTable.add(titleTable).align(... | private void addButtons() {
titleTable = new Table();
allHeroesTable = new Table();
selectedHeroesTableVerticalGroup = new VerticalGroup();
selectedHeroesTableVerticalGroup2 = new VerticalGroup();
saveAndExitTable = new Table();
mainTable.setFillParent(true);
<DeepExtract>
titleTable.add(titleLabel);
mainTable.add(titl... | Norii | positive | 6,246 |
public Criteria andIdNotIn(List<Long> values) {
if (values == null) {
throw new RuntimeException("Value for " + "id" + " cannot be null");
}
criteria.add(new Criterion("id not in", values));
return (Criteria) this;
} | public Criteria andIdNotIn(List<Long> values) {
<DeepExtract>
if (values == null) {
throw new RuntimeException("Value for " + "id" + " cannot be null");
}
criteria.add(new Criterion("id not in", values));
</DeepExtract>
return (Criteria) this;
} | oauth2-resource | positive | 6,247 |
@Test(expected = IllegalArgumentException.class)
public void testBuilderWithNullStart() {
return Ipv6.of(BigInteger.valueOf(Long.parseLong(ip3)));
} | @Test(expected = IllegalArgumentException.class)
public void testBuilderWithNullStart() {
<DeepExtract>
return Ipv6.of(BigInteger.valueOf(Long.parseLong(ip3)));
</DeepExtract>
} | commons-ip-math | positive | 6,248 |
@Override
public int visit(final IASTArrayModifier arrayModifier) {
final IASTFileLocation fileLocation = arrayModifier.getFileLocation();
if (fileLocation == null) {
return;
}
final int fromPosition = fileLocation.getNodeOffset();
final int endPosition = fromPosition + fileLocation.getNodeLength();
final String nodeTy... | @Override
public int visit(final IASTArrayModifier arrayModifier) {
<DeepExtract>
final IASTFileLocation fileLocation = arrayModifier.getFileLocation();
if (fileLocation == null) {
return;
}
final int fromPosition = fileLocation.getNodeOffset();
final int endPosition = fromPosition + fileLocation.getNodeLength();
final... | api-mining | positive | 6,249 |
private Expression parseBinaryOperator(int minPrecedence) throws ParseException {
Expression lhs;
Token next = peek(0);
if (TokenType.UnaryOperator.isUnaryOperator(next.getScript())) {
advance();
lhs = new UnaryOperator(next, parseUnaryOperator());
} else {
lhs = parsePostfixValue();
}
while (peek(0).getTokenType() == ... | private Expression parseBinaryOperator(int minPrecedence) throws ParseException {
<DeepExtract>
Expression lhs;
Token next = peek(0);
if (TokenType.UnaryOperator.isUnaryOperator(next.getScript())) {
advance();
lhs = new UnaryOperator(next, parseUnaryOperator());
} else {
lhs = parsePostfixValue();
}
</DeepExtract>
whil... | ngAndroid | positive | 6,250 |
@Test
public void testToType() {
p("=== Testing " + "toArray" + " ===");
p("[2,3,4].stream().map(i->i*10).toArray()");
Object ret = elp.eval("[2,3,4].stream().map(i->i*10).toArray()");
p(" = returns =");
if (ret.getClass().isArray()) {
int size = Array.getLength(ret);
assertTrue(size == exp4.length);
for (int i = 0; i ... | @Test
public void testToType() {
p("=== Testing " + "toArray" + " ===");
p("[2,3,4].stream().map(i->i*10).toArray()");
Object ret = elp.eval("[2,3,4].stream().map(i->i*10).toArray()");
p(" = returns =");
if (ret.getClass().isArray()) {
int size = Array.getLength(ret);
assertTrue(size == exp4.length);
for (int i = 0; i ... | uel-ri | positive | 6,251 |
public double computeSingle(Model model) {
if (options.countBLasParameters)
return 2 * model.getLnL() + model.getK() * Math.log(options.getSampleSize());
else
return 2 * model.getLnL() + (model.getK() - options.getNumBranches()) * Math.log(options.getSampleSize());
} | public double computeSingle(Model model) {
<DeepExtract>
if (options.countBLasParameters)
return 2 * model.getLnL() + model.getK() * Math.log(options.getSampleSize());
else
return 2 * model.getLnL() + (model.getK() - options.getNumBranches()) * Math.log(options.getSampleSize());
</DeepExtract>
} | jmodeltest2 | positive | 6,252 |
public IRiakClient createDefaultConnection(String host, int port, RuntimeContext ctx) {
try {
PBClientConfig pbconf = new PBClientConfig.Builder().withHost(host).withPort(port).build();
IRiakClient riakClient = RiakFactory.newClient(pbconf);
riakClient.ping();
ConnectionInfo ci = new ConnectionInfo();
ci.pbport = port;... | public IRiakClient createDefaultConnection(String host, int port, RuntimeContext ctx) {
<DeepExtract>
try {
PBClientConfig pbconf = new PBClientConfig.Builder().withHost(host).withPort(port).build();
IRiakClient riakClient = RiakFactory.newClient(pbconf);
riakClient.ping();
ConnectionInfo ci = new ConnectionInfo();
ci.... | contact | positive | 6,255 |
@Override
public Event process(JsonValueParser parser, ObjectScope scope) {
this.state = KEY;
return Event.START_OBJECT;
} | @Override
public Event process(JsonValueParser parser, ObjectScope scope) {
<DeepExtract>
this.state = KEY;
</DeepExtract>
return Event.START_OBJECT;
} | joy | positive | 6,256 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.