before stringlengths 33 3.21M | after stringlengths 63 3.21M | repo stringlengths 1 56 | type stringclasses 1
value | __index_level_0__ int64 0 442k |
|---|---|---|---|---|
@RequiresApi(api = Build.VERSION_CODES.P)
private void initStore() {
mPermissionHelper = new PermissionHelper(this, this);
mPermissionHelper.requestPermissions();
if (!NetCheckUtil.isNetworkAvailable(this)) {
showWarnDialog(this, Constant.NETWORK_ERROR);
return;
}
if (!BluetoothCheckUtil.isBlueEnabled()) {
showWarnDial... | @RequiresApi(api = Build.VERSION_CODES.P)
private void initStore() {
mPermissionHelper = new PermissionHelper(this, this);
mPermissionHelper.requestPermissions();
<DeepExtract>
if (!NetCheckUtil.isNetworkAvailable(this)) {
showWarnDialog(this, Constant.NETWORK_ERROR);
return;
}
if (!BluetoothCheckUtil.isBlueEnabled()) ... | hms-nearby-demo | positive | 438,024 |
public JSONObject parseObject() throws ParseException {
JSONObject toReturn;
final JSONObject json = new JSONObject();
String key;
Object value;
key = objectKey();
jj_consume_token(EQUALS);
value = value();
json.put(key, value);
key = null;
value = null;
label_2: while (true) {
if (jj_2_1(2)) {
;
} else {
break label_2... | public JSONObject parseObject() throws ParseException {
<DeepExtract>
JSONObject toReturn;
final JSONObject json = new JSONObject();
String key;
Object value;
key = objectKey();
jj_consume_token(EQUALS);
value = value();
json.put(key, value);
key = null;
value = null;
label_2: while (true) {
if (jj_2_1(2)) {
;
} else {... | opensoc-streaming | positive | 438,025 |
@Override
public void receiveConfigInfo(String config) {
final String prefix = properties.prefix();
PropertyValues propertyValues = NacosUtils.resolvePropertyValues(bean, prefix, dataId, groupId, config, type);
doBind(bean, properties, propertyValues);
publishBoundEvent(bean, beanName, dataId, groupId, properties, conf... | @Override
public void receiveConfigInfo(String config) {
<DeepExtract>
final String prefix = properties.prefix();
PropertyValues propertyValues = NacosUtils.resolvePropertyValues(bean, prefix, dataId, groupId, config, type);
doBind(bean, properties, propertyValues);
publishBoundEvent(bean, beanName, dataId, groupId, pr... | nacos-spring-project | positive | 438,027 |
private void testUniqueAggregatesByDefaultModel(PaymentModel testPaymentModel) {
PaymentModel paymentModel = new PaymentModel();
paymentModel.setEmail(testPaymentModel.getEmail());
Integer uniqCardTokensByEmail = dgraphUniqueAggregator.countUniqueValue(PaymentCheckedField.EMAIL, paymentModel, PaymentCheckedField.CARD_T... | private void testUniqueAggregatesByDefaultModel(PaymentModel testPaymentModel) {
PaymentModel paymentModel = new PaymentModel();
paymentModel.setEmail(testPaymentModel.getEmail());
Integer uniqCardTokensByEmail = dgraphUniqueAggregator.countUniqueValue(PaymentCheckedField.EMAIL, paymentModel, PaymentCheckedField.CARD_T... | fraudbusters | positive | 438,028 |
public Criteria andBz171IsNotNull() {
if ("`bz171` is not null" == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion("`bz171` is not null"));
return (Criteria) this;
} | public Criteria andBz171IsNotNull() {
<DeepExtract>
if ("`bz171` is not null" == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion("`bz171` is not null"));
</DeepExtract>
return (Criteria) this;
} | blockhealth | positive | 438,031 |
public void actionPerformed(java.awt.event.ActionEvent evt) {
FunctionHook hook = getCurrentHook();
if (hook != null) {
int rc = JOptionPane.showConfirmDialog(this, "Are you sure you want to delete this hook?");
if (rc == JOptionPane.YES_OPTION) {
try {
startProgressBar();
statusMessageLabel.setText("Setting hooks...")... | public void actionPerformed(java.awt.event.ActionEvent evt) {
<DeepExtract>
FunctionHook hook = getCurrentHook();
if (hook != null) {
int rc = JOptionPane.showConfirmDialog(this, "Are you sure you want to delete this hook?");
if (rc == JOptionPane.YES_OPTION) {
try {
startProgressBar();
statusMessageLabel.setText("Sett... | JavaSnoop | positive | 438,033 |
private void handleNetError(String err, String cmd, final eventType endEvent) {
if (err.contains("not_logged_in")) {
closeConnection();
}
System.out.println("Net error|" + cmd + "|" + endEvent);
} | private void handleNetError(String err, String cmd, final eventType endEvent) {
if (err.contains("not_logged_in")) {
closeConnection();
}
<DeepExtract>
System.out.println("Net error|" + cmd + "|" + endEvent);
</DeepExtract>
} | DragonGoApp | positive | 438,035 |
public void onClick(View v) {
prefs.edit().putLong(theAlert, 0).apply();
if (prefs.getLong("alerts_disabled_until", 0) > new Date().getTime()) {
disableAlerts.setVisibility(View.GONE);
clearDisabled.setVisibility(View.VISIBLE);
disableLowAlerts.setVisibility(View.GONE);
clearLowDisabled.setVisibility(View.GONE);
disabl... | public void onClick(View v) {
prefs.edit().putLong(theAlert, 0).apply();
<DeepExtract>
if (prefs.getLong("alerts_disabled_until", 0) > new Date().getTime()) {
disableAlerts.setVisibility(View.GONE);
clearDisabled.setVisibility(View.VISIBLE);
disableLowAlerts.setVisibility(View.GONE);
clearLowDisabled.setVisibility(View... | NightWatch | positive | 438,037 |
@Override
public void mapInstances(Mapping mappings) {
if (id2Instances == null || mappings == null)
return;
Map<String, Set<ResourceWrapper<T>>> labelOrName2Resources = new HashMap<>();
for (Map.Entry<Integer, Set<T>> e : id2Instances.entrySet()) {
constructLabelOrName2ResourcesTable(e.getValue(), labelOrName2Resource... | @Override
public void mapInstances(Mapping mappings) {
<DeepExtract>
if (id2Instances == null || mappings == null)
return;
Map<String, Set<ResourceWrapper<T>>> labelOrName2Resources = new HashMap<>();
for (Map.Entry<Integer, Set<T>> e : id2Instances.entrySet()) {
constructLabelOrName2ResourcesTable(e.getValue(), labelO... | FCA-Map | positive | 438,038 |
@Override
public int compareTo(LineWrapper arg0) {
double a0 = angle(p0, length()), a1 = angle(p0, arg0.length());
if (a0 < a1)
return -1;
if (a0 > a1)
return 1;
double d0 = length().distance(p0), d1 = arg0.length().distance(p0);
if (d0 < d1)
return -1;
if (d0 > d1)
return 1;
return 0;
} | @Override
public int compareTo(LineWrapper arg0) {
<DeepExtract>
double a0 = angle(p0, length()), a1 = angle(p0, arg0.length());
if (a0 < a1)
return -1;
if (a0 > a1)
return 1;
double d0 = length().distance(p0), d1 = arg0.length().distance(p0);
if (d0 < d1)
return -1;
if (d0 > d1)
return 1;
return 0;
</DeepExtract>
} | molvec | positive | 438,039 |
@RequestMapping
public ViewName index(ModelMap modelMap) {
modelMap.put("message", "hello world");
ViewName viewName = new ViewName();
this.name = "index";
return viewName;
} | @RequestMapping
public ViewName index(ModelMap modelMap) {
modelMap.put("message", "hello world");
ViewName viewName = new ViewName();
<DeepExtract>
this.name = "index";
</DeepExtract>
return viewName;
} | learn-java | positive | 438,041 |
public void end() {
itemSelected = false;
currentItem = null;
selectedSlot.setVisible(false);
toggleInventoryButtons(false);
tooltip.hide();
if (!inMenu) {
ui.moving.target.set(200, 7);
ui.moving.origin.set(7, 7);
ui.start();
ended = true;
}
} | public void end() {
<DeepExtract>
itemSelected = false;
currentItem = null;
selectedSlot.setVisible(false);
toggleInventoryButtons(false);
tooltip.hide();
</DeepExtract>
if (!inMenu) {
ui.moving.target.set(200, 7);
ui.moving.origin.set(7, 7);
ui.start();
ended = true;
}
} | Unlucky | positive | 438,043 |
@NotNull
@Override
public <E extends GuiElement<E>> E makeChildLast(@NotNull E element) {
GuiElementImpl<?> impl = (GuiElementImpl<?>) element;
if (impl.getParent() != this || children.indexOf(element) != children.size()) {
impl.setParent(this);
children.add(children.size(), impl);
getRoot().flagAndUpdate(this);
}
retu... | @NotNull
@Override
public <E extends GuiElement<E>> E makeChildLast(@NotNull E element) {
<DeepExtract>
GuiElementImpl<?> impl = (GuiElementImpl<?>) element;
if (impl.getParent() != this || children.indexOf(element) != children.size()) {
impl.setParent(this);
children.add(children.size(), impl);
getRoot().flagAndUpdate... | Iodine | positive | 438,044 |
@Override
public void write(int b) throws IOException {
long result = maxContentSize - getContentSize();
if (result > 0) {
return result;
}
if (volumeWriter == null) {
volumeWriter = createVolumeWriter(1);
} else {
flushContent();
}
long contentSize = getMaxContentSize();
if (contentSize <= 0) {
completeVolumeWriter();... | @Override
public void write(int b) throws IOException {
<DeepExtract>
long result = maxContentSize - getContentSize();
if (result > 0) {
return result;
}
if (volumeWriter == null) {
volumeWriter = createVolumeWriter(1);
} else {
flushContent();
}
long contentSize = getMaxContentSize();
if (contentSize <= 0) {
completeV... | b1-pack | positive | 438,045 |
@Override
public Map.Entry<Long, V> next() {
if (this.next == null)
return null;
Map.Entry<Long, V> r = this.next;
if (this.next != null && this.next.next != null) {
this.next = this.next.next;
}
for (; this.index < table.length; this.index++) {
if (table[this.index] != null)
this.next = table[this.index++];
}
return n... | @Override
public Map.Entry<Long, V> next() {
if (this.next == null)
return null;
Map.Entry<Long, V> r = this.next;
<DeepExtract>
if (this.next != null && this.next.next != null) {
this.next = this.next.next;
}
for (; this.index < table.length; this.index++) {
if (table[this.index] != null)
this.next = table[this.index+... | lite-pool | positive | 438,048 |
@Test
public void setAndClearDeviceMetricsOverrideTest() {
Supplier<Long> getWindowHeight = () -> getScriptResultOrDefault("getWindowSize.js", 0L);
final int initialValue = getWindowHeight.get().intValue();
if (initialValue == HEIGHT) {
throw new IllegalArgumentException("To check that override works, initial value sho... | @Test
public void setAndClearDeviceMetricsOverrideTest() {
<DeepExtract>
Supplier<Long> getWindowHeight = () -> getScriptResultOrDefault("getWindowSize.js", 0L);
final int initialValue = getWindowHeight.get().intValue();
if (initialValue == HEIGHT) {
throw new IllegalArgumentException("To check that override works, ini... | aquality-selenium-java | positive | 438,051 |
@FXML
private void onImportHrmFile(final ActionEvent event) {
final String hrmFile = StringUtils.getTrimmedTextOrNull(exerciseViewModel.hrmFile.get());
if (hrmFile == null) {
return;
}
EVExercise evExercise = null;
try {
ExerciseParser parser = ExerciseParserFactory.INSTANCE.getParser(hrmFile);
evExercise = parser.pars... | @FXML
private void onImportHrmFile(final ActionEvent event) {
final String hrmFile = StringUtils.getTrimmedTextOrNull(exerciseViewModel.hrmFile.get());
if (hrmFile == null) {
return;
}
EVExercise evExercise = null;
try {
ExerciseParser parser = ExerciseParserFactory.INSTANCE.getParser(hrmFile);
evExercise = parser.pars... | sportstracker | positive | 438,055 |
public static byte[] matching() {
return Exceptions.sneak().get(() -> {
try (InputStream input = TestResources.class.getResourceAsStream("matching.png")) {
return IOUtils.toByteArray(input);
}
});
} | public static byte[] matching() {
<DeepExtract>
return Exceptions.sneak().get(() -> {
try (InputStream input = TestResources.class.getResourceAsStream("matching.png")) {
return IOUtils.toByteArray(input);
}
});
</DeepExtract>
} | sourceafis-java | positive | 438,057 |
@Override
public void save(Caption object) {
if (!StringUtil.isEmpty(object.getShortcut())) {
object.setShortcutSha1(getJacuzzi().findString("SELECT CONVERT(SHA1(?) USING utf8)", object.getShortcut()));
}
Caption prev;
String cacheKey = object.getShortcutSha1() + (char) 1 + object.getLocale();
Caption cachedCaption = c... | @Override
public void save(Caption object) {
if (!StringUtil.isEmpty(object.getShortcut())) {
object.setShortcutSha1(getJacuzzi().findString("SELECT CONVERT(SHA1(?) USING utf8)", object.getShortcut()));
}
Caption prev;
String cacheKey = object.getShortcutSha1() + (char) 1 + object.getLocale();
Caption cachedCaption = c... | pbox | positive | 438,058 |
public JFreeChart createStackedAreaChart(final ChartData chartData) {
PlotOrientation orientation = PlotOrientation.VERTICAL;
final JFreeChart chart = ChartFactory.createStackedAreaChart(chartData.getTitle(), chartData.getCatAx().getTitle(), chartData.getValAx().getTitle(), createDataset(chartData), orientation, true, ... | public JFreeChart createStackedAreaChart(final ChartData chartData) {
PlotOrientation orientation = PlotOrientation.VERTICAL;
final JFreeChart chart = ChartFactory.createStackedAreaChart(chartData.getTitle(), chartData.getCatAx().getTitle(), chartData.getValAx().getTitle(), createDataset(chartData), orientation, true, ... | TieFaces | positive | 438,059 |
@Override
public void onActivityCreated(Bundle savedInstanceState) {
List<View> mViews = new ArrayList<View>();
List<CategoryInfo> data = new ArrayList<CategoryInfo>();
for (int i = 0; i < Constants.category_msg.length; i++) {
CategoryInfo categoryInfo2 = new CategoryInfo();
categoryInfo2.setIcon(Constants.category_ico... | @Override
public void onActivityCreated(Bundle savedInstanceState) {
<DeepExtract>
List<View> mViews = new ArrayList<View>();
List<CategoryInfo> data = new ArrayList<CategoryInfo>();
for (int i = 0; i < Constants.category_msg.length; i++) {
CategoryInfo categoryInfo2 = new CategoryInfo();
categoryInfo2.setIcon(Constant... | createcjj | positive | 438,060 |
@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
long start = System.nanoTime();
UserVo userVo = userService.findUserByIdentifier(null, username, TenantHolder.getTenantCode());
if (userVo == null) {
throw new UsernameNotFoundException("User does not exist");
}
boolean ... | @Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
long start = System.nanoTime();
UserVo userVo = userService.findUserByIdentifier(null, username, TenantHolder.getTenantCode());
<DeepExtract>
if (userVo == null) {
throw new UsernameNotFoundException("User does not exist... | spring-microservice-exam | positive | 438,061 |
public void setSqlDate(final Instant v, final Calendar cal) throws IOException {
if (index != 0) {
writer.write(delimiterString);
}
index++;
cal.setTimeInMillis(v.getEpochSecond() * 1000);
String f = String.format(Locale.ENGLISH, "%02d-%02d-%02d", cal.get(Calendar.YEAR), cal.get(Calendar.MONTH) + 1, cal.get(Calendar.DA... | public void setSqlDate(final Instant v, final Calendar cal) throws IOException {
<DeepExtract>
if (index != 0) {
writer.write(delimiterString);
}
index++;
</DeepExtract>
cal.setTimeInMillis(v.getEpochSecond() * 1000);
String f = String.format(Locale.ENGLISH, "%02d-%02d-%02d", cal.get(Calendar.YEAR), cal.get(Calendar.MO... | embulk-output-jdbc | positive | 438,062 |
public void update(final ReGalAndroidContext regalAndroidContext) {
ContentValues values = new ContentValues();
try {
values.put("current_position", regalAndroidContext.currentPosition);
values.put("current_album", Serialization.serializeAlbum(regalAndroidContext.currentAlbum));
} catch (SerializationException e) {
log... | public void update(final ReGalAndroidContext regalAndroidContext) {
ContentValues values = new ContentValues();
try {
values.put("current_position", regalAndroidContext.currentPosition);
values.put("current_album", Serialization.serializeAlbum(regalAndroidContext.currentAlbum));
} catch (SerializationException e) {
log... | ReGalAndroid | positive | 438,063 |
public DynamicResource getRouteMap(long platformId, boolean vertical, boolean flip, float aspectRatio, boolean transparentWhite) {
final Minecraft minecraftClient = Minecraft.getInstance();
if (font == null || fontCjk == null) {
final ResourceManager resourceManager = minecraftClient.getResourceManager();
try {
font = ... | public DynamicResource getRouteMap(long platformId, boolean vertical, boolean flip, float aspectRatio, boolean transparentWhite) {
<DeepExtract>
final Minecraft minecraftClient = Minecraft.getInstance();
if (font == null || fontCjk == null) {
final ResourceManager resourceManager = minecraftClient.getResourceManager();... | Minecraft-Transit-Railway | positive | 438,064 |
public static boolean isExtension(String filename, String[] extensions) {
if (filename == null) {
return false;
}
if (extensions == null || extensions.length == 0) {
return (indexOfExtension(filename) == -1);
}
String fileExt;
if (filename == null) {
fileExt = null;
}
int index = indexOfExtension(filename);
if (index =... | public static boolean isExtension(String filename, String[] extensions) {
if (filename == null) {
return false;
}
if (extensions == null || extensions.length == 0) {
return (indexOfExtension(filename) == -1);
}
<DeepExtract>
String fileExt;
if (filename == null) {
fileExt = null;
}
int index = indexOfExtension(filename... | spring-file-storage-service | positive | 438,066 |
public static void testDBReadWrite(DB db) throws IOException {
GraphGenerator graphGenerator = newGraphGenerator();
Vocabulary vocabulary = graphGenerator.getModel().getSchemaVocabulary();
db.setVocabulary(vocabulary);
db.writeVertex(new QualifiedName("users.User"), 1L, "name", "name1");
db.writeVertex(new QualifiedNam... | public static void testDBReadWrite(DB db) throws IOException {
<DeepExtract>
GraphGenerator graphGenerator = newGraphGenerator();
Vocabulary vocabulary = graphGenerator.getModel().getSchemaVocabulary();
db.setVocabulary(vocabulary);
db.writeVertex(new QualifiedName("users.User"), 1L, "name", "name1");
db.writeVertex(ne... | uber-graph-benchmark | positive | 438,067 |
@Override
public void onBindViewHolder(final ViewHolder holder, final int position) {
final Item item = mItemList.get(position);
mListener = mListener;
String dateStr = item.getPubDate();
DateFormat formatter = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss", Locale.getDefault());
try {
Date date = formatter.parse(dat... | @Override
public void onBindViewHolder(final ViewHolder holder, final int position) {
final Item item = mItemList.get(position);
<DeepExtract>
mListener = mListener;
</DeepExtract>
String dateStr = item.getPubDate();
DateFormat formatter = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss", Locale.getDefault());
try {
Da... | pod-adddict | positive | 438,068 |
private void initializeState(final UnionState state, final Object[] parameters) {
int nominalEntries = DEFAULT_NOMINAL_ENTRIES;
if (this.nominalEntriesObjectInspector != null) {
nominalEntries = PrimitiveObjectInspectorUtils.getInt(parameters[1], this.nominalEntriesObjectInspector);
}
long seed = DEFAULT_UPDATE_SEED;
i... | private void initializeState(final UnionState state, final Object[] parameters) {
int nominalEntries = DEFAULT_NOMINAL_ENTRIES;
if (this.nominalEntriesObjectInspector != null) {
nominalEntries = PrimitiveObjectInspectorUtils.getInt(parameters[1], this.nominalEntriesObjectInspector);
}
long seed = DEFAULT_UPDATE_SEED;
i... | datasketches-hive | positive | 438,069 |
@Test
public void test11() {
String actual = reusableResolver.expand("{undef1|one {var_2|value2}} and {var.2|three {$var4|value4}}");
assertEquals("one val2 and val3", actual);
VariableResolver newInstance = new VariableResolver(environmentMap);
actual = newInstance.expand("{undef1|one {var_2|value2}} and {var.2|three ... | @Test
public void test11() {
<DeepExtract>
String actual = reusableResolver.expand("{undef1|one {var_2|value2}} and {var.2|three {$var4|value4}}");
assertEquals("one val2 and val3", actual);
VariableResolver newInstance = new VariableResolver(environmentMap);
actual = newInstance.expand("{undef1|one {var_2|value2}} and... | unravl | positive | 438,070 |
@Private
void ringRead(long position, byte[] buffer, int offset, int count) throws IOException {
return position < fileLength ? position : headerLength + position - fileLength;
if (position + count <= fileLength) {
raf.seek(position);
raf.readFully(buffer, offset, count);
} else {
int beforeEof = (int) (fileLength - po... | @Private
void ringRead(long position, byte[] buffer, int offset, int count) throws IOException {
<DeepExtract>
return position < fileLength ? position : headerLength + position - fileLength;
</DeepExtract>
if (position + count <= fileLength) {
raf.seek(position);
raf.readFully(buffer, offset, count);
} else {
int befor... | ConnectSDK-Android | positive | 438,071 |
private void initKeyboard() {
int keyboardType = getKeyboardTypePreference();
useNativeKeyboard = (keyboardType == -1);
keyboardView = (KeyboardView) findViewById(R.id.playKeyboard);
if (!useNativeKeyboard) {
Keyboard keyboard = new Keyboard(this, keyboardType);
keyboardView.setKeyboard(keyboard);
} else {
keyboardView... | private void initKeyboard() {
<DeepExtract>
int keyboardType = getKeyboardTypePreference();
useNativeKeyboard = (keyboardType == -1);
keyboardView = (KeyboardView) findViewById(R.id.playKeyboard);
if (!useNativeKeyboard) {
Keyboard keyboard = new Keyboard(this, keyboardType);
keyboardView.setKeyboard(keyboard);
} else ... | robocrosswords | positive | 438,073 |
@Test
public void testTurnVectorsWorkWithSample() {
Vector gxp = new Vector(0.9988797f, -0.00771637028f, 0.04668929f);
Vector mxp = new Vector(0.9106779f, 0.286284238f, 0.297837347f);
Vector gr = new Vector(0.5807441f, -0.00199999986f, 0.04895164f);
Vector mr = new Vector(0.713514864f, 0.229811013f, 0.239675581f);
Vect... | @Test
public void testTurnVectorsWorkWithSample() {
Vector gxp = new Vector(0.9988797f, -0.00771637028f, 0.04668929f);
Vector mxp = new Vector(0.9106779f, 0.286284238f, 0.297837347f);
Vector gr = new Vector(0.5807441f, -0.00199999986f, 0.04895164f);
Vector mr = new Vector(0.713514864f, 0.229811013f, 0.239675581f);
Vect... | sexytopo | positive | 438,074 |
public void setData(Integer... color) {
mData.clear();
mData.addAll(Arrays.asList(color));
int newOne = mData.indexOf(mColor);
setSelected(newOne);
notifyDataSetChanged();
Log.d(TAG, "setData: size = " + color.length + ", data size = " + mData.size());
} | public void setData(Integer... color) {
mData.clear();
mData.addAll(Arrays.asList(color));
<DeepExtract>
int newOne = mData.indexOf(mColor);
setSelected(newOne);
</DeepExtract>
notifyDataSetChanged();
Log.d(TAG, "setData: size = " + color.length + ", data size = " + mData.size());
} | ExpectLauncher | positive | 438,075 |
public double[] generate(int N, double param1, double[][] spots) {
if (READ_FROM_FILE) {
double[] ret;
if (READ_FROM_FILE_CYCLE == 0) {
ret = readFromFile("D:\\data\\EPFL\\data-uniform-2000000.txt");
} else if (READ_FROM_FILE_CYCLE == 1) {
allQueries = readFromFile("D:\\data\\EPFL\\data-clustered-1000000.txt");
ret = n... | public double[] generate(int N, double param1, double[][] spots) {
if (READ_FROM_FILE) {
double[] ret;
if (READ_FROM_FILE_CYCLE == 0) {
ret = readFromFile("D:\\data\\EPFL\\data-uniform-2000000.txt");
} else if (READ_FROM_FILE_CYCLE == 1) {
allQueries = readFromFile("D:\\data\\EPFL\\data-clustered-1000000.txt");
ret = n... | TinSpin | positive | 438,077 |
public Instant minusNanos(long nanosToSubtract) {
if (nanosToSubtract == Long.MIN_VALUE) {
return plusNanos(Long.MAX_VALUE).plusNanos(1);
}
return plus(0, -nanosToSubtract);
} | public Instant minusNanos(long nanosToSubtract) {
if (nanosToSubtract == Long.MIN_VALUE) {
return plusNanos(Long.MAX_VALUE).plusNanos(1);
}
<DeepExtract>
return plus(0, -nanosToSubtract);
</DeepExtract>
} | gwt-time | positive | 438,078 |
private void initWithContext(Context context) {
mScroller = new Scroller(context, new DecelerateInterpolator());
mScrollListener = this;
mHeaderView = new LoadMoreListViewHeader(context);
mHeaderViewContent = (RelativeLayout) mHeaderView.findViewById(R.id.head_contentLayout);
mHeaderTimeView = (TextView) mHeaderView.fi... | private void initWithContext(Context context) {
mScroller = new Scroller(context, new DecelerateInterpolator());
<DeepExtract>
mScrollListener = this;
</DeepExtract>
mHeaderView = new LoadMoreListViewHeader(context);
mHeaderViewContent = (RelativeLayout) mHeaderView.findViewById(R.id.head_contentLayout);
mHeaderTimeVie... | LinkChat | positive | 438,080 |
@Override
protected String doForward(F a) {
return to.apply(a);
} | @Override
protected String doForward(F a) {
<DeepExtract>
return to.apply(a);
</DeepExtract>
} | wicket-orientdb | positive | 438,081 |
public boolean cancel(boolean mayInterruptIfRunning) {
this.mIsCancelled = true;
this.mRequest.abort();
if (this.mIsCancelled) {
this.sendCancelNotification();
}
return this.mIsCancelled;
} | public boolean cancel(boolean mayInterruptIfRunning) {
this.mIsCancelled = true;
this.mRequest.abort();
<DeepExtract>
if (this.mIsCancelled) {
this.sendCancelNotification();
}
return this.mIsCancelled;
</DeepExtract>
} | J-AndroidFramework | positive | 438,084 |
public void testStringEscaping() throws Exception {
Test test = new Test();
test.stringValue = "" + "if (chr != ' ' && chr != '\\t' && chr != '\\r'\n" + "\t&& chr != '\\n') {\n" + "\tbreak\n" + "\t}\n";
return roundTrip(test, null, new YamlConfig());
} | public void testStringEscaping() throws Exception {
Test test = new Test();
test.stringValue = "" + "if (chr != ' ' && chr != '\\t' && chr != '\\r'\n" + "\t&& chr != '\\n') {\n" + "\tbreak\n" + "\t}\n";
<DeepExtract>
return roundTrip(test, null, new YamlConfig());
</DeepExtract>
} | yamlbeans | positive | 438,085 |
public void restore(Player player) {
if (player == null)
return;
Util.clearInv(player);
player.setWalkSpeed(0.2f);
player.setLevel(expL);
player.setExp(expP);
player.setFoodLevel(food);
player.setSaturation(saturation);
player.getInventory().setStorageContents(inv);
player.getInventory().setArmorContents(equip);
player... | public void restore(Player player) {
if (player == null)
return;
Util.clearInv(player);
player.setWalkSpeed(0.2f);
player.setLevel(expL);
player.setExp(expP);
player.setFoodLevel(food);
player.setSaturation(saturation);
player.getInventory().setStorageContents(inv);
player.getInventory().setArmorContents(equip);
player... | HungerGames | positive | 438,087 |
@Test
void testSimpleConfiguration() {
Map<String, Object> consumerConfiguration = new HashMap<>();
consumerConfiguration.put("ackTimeoutMillis", 100L);
test(consumerConfiguration, ConsumerConfiguration.DEFAULT, (result -> {
assertEquals(100L, result.getConsumerConfiguration().get("ackTimeoutMillis"));
assertNull(resul... | @Test
void testSimpleConfiguration() {
Map<String, Object> consumerConfiguration = new HashMap<>();
consumerConfiguration.put("ackTimeoutMillis", 100L);
<DeepExtract>
test(consumerConfiguration, ConsumerConfiguration.DEFAULT, (result -> {
assertEquals(100L, result.getConsumerConfiguration().get("ackTimeoutMillis"));
as... | pulsar-jms | positive | 438,089 |
@Override
public void updateDescription(String newValue) {
checkState(!closed, "closed");
description.set(newValue);
eventSinksByEvent.get(Event.UPDATE_DESC).accept(() -> delegate.updateDescription(description.get()));
} | @Override
public void updateDescription(String newValue) {
<DeepExtract>
checkState(!closed, "closed");
</DeepExtract>
description.set(newValue);
eventSinksByEvent.get(Event.UPDATE_DESC).accept(() -> delegate.updateDescription(description.get()));
} | jiotty-photos-uploader | positive | 438,090 |
private void onTerminatedAbruptly() {
getPluginContext().getLogFacility().logDebug("StartExplorer search job for custom command config stored as shared files has terminated with non-OK state.");
getLogFacility().logDebug("reset() waiting for lock");
synchronized (this.lock) {
getLogFacility().logDebug("reset() got lock... | private void onTerminatedAbruptly() {
getPluginContext().getLogFacility().logDebug("StartExplorer search job for custom command config stored as shared files has terminated with non-OK state.");
<DeepExtract>
getLogFacility().logDebug("reset() waiting for lock");
synchronized (this.lock) {
getLogFacility().logDebug("re... | startexplorer | positive | 438,091 |
public RendererOptions smooth(Boolean smooth) {
this.smooth = smooth;
return this;
return this;
} | public RendererOptions smooth(Boolean smooth) {
<DeepExtract>
this.smooth = smooth;
return this;
</DeepExtract>
return this;
} | jqplot4java | positive | 438,093 |
private static TaskType newTask(String taskName, Properties lscProperties) throws LscConfigurationException {
TaskType newTask = new TaskType();
newTask.setName(taskName);
String prefix = PropertiesConfigurationHelper.TASKS_PROPS_PREFIX + "." + taskName + ".";
if (lscProperties.getProperty(PropertiesConfigurationHelper... | private static TaskType newTask(String taskName, Properties lscProperties) throws LscConfigurationException {
TaskType newTask = new TaskType();
newTask.setName(taskName);
String prefix = PropertiesConfigurationHelper.TASKS_PROPS_PREFIX + "." + taskName + ".";
<DeepExtract>
if (lscProperties.getProperty(PropertiesConfi... | lsc | positive | 438,094 |
@Override
public OwnershipType read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
for (OwnershipType b : OwnershipType.values()) {
if (b.value.equals(value)) {
return b;
}
}
return null;
} | @Override
public OwnershipType read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
<DeepExtract>
for (OwnershipType b : OwnershipType.values()) {
if (b.value.equals(value)) {
return b;
}
}
return null;
</DeepExtract>
} | plaid-java | positive | 438,095 |
public static Builder newBuilder(com.googlecode.protobuf.blerpc.api.Api.WifiConnectRequest prototype) {
if (prototype instanceof com.googlecode.protobuf.blerpc.api.Api.WifiNetwork) {
return mergeFrom((com.googlecode.protobuf.blerpc.api.Api.WifiNetwork) prototype);
} else {
super.mergeFrom(prototype);
return this;
}
} | public static Builder newBuilder(com.googlecode.protobuf.blerpc.api.Api.WifiConnectRequest prototype) {
<DeepExtract>
if (prototype instanceof com.googlecode.protobuf.blerpc.api.Api.WifiNetwork) {
return mergeFrom((com.googlecode.protobuf.blerpc.api.Api.WifiNetwork) prototype);
} else {
super.mergeFrom(prototype);
retu... | protobuf-ble-rpc | positive | 438,096 |
public void showHomeAnonymousComments(final RequestContext context) {
final Request request = context.getRequest();
final AbstractFreeMarkerRenderer renderer = new SkinRenderer(context, "home/comments.ftl");
final Map<String, Object> dataModel = renderer.getDataModel();
dataModelService.fillHeaderAndFooter(context, dat... | public void showHomeAnonymousComments(final RequestContext context) {
final Request request = context.getRequest();
final AbstractFreeMarkerRenderer renderer = new SkinRenderer(context, "home/comments.ftl");
final Map<String, Object> dataModel = renderer.getDataModel();
dataModelService.fillHeaderAndFooter(context, dat... | symphony | positive | 438,097 |
public Criteria andBizActionLike(String value) {
if (value == null) {
throw new RuntimeException("Value for " + "bizAction" + " cannot be null");
}
criteria.add(new Criterion("biz_action like", value));
return (Criteria) this;
} | public Criteria andBizActionLike(String value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "bizAction" + " cannot be null");
}
criteria.add(new Criterion("biz_action like", value));
</DeepExtract>
return (Criteria) this;
} | dtsopensource | positive | 438,098 |
private FieldsCollection getIdFieldsFromClass(Class<?> entityClass) {
if (entityClass == Object.class) {
return EMPTY_FIELD_COLLECTION;
}
FieldsCollection parentClassFields = getIdFieldsFromClass(entityClass.getSuperclass());
FieldsCollection currentClassFields = new FieldsCollection(Stream.of(entityClass.getDeclaredFi... | private FieldsCollection getIdFieldsFromClass(Class<?> entityClass) {
if (entityClass == Object.class) {
return EMPTY_FIELD_COLLECTION;
}
FieldsCollection parentClassFields = getIdFieldsFromClass(entityClass.getSuperclass());
FieldsCollection currentClassFields = new FieldsCollection(Stream.of(entityClass.getDeclaredFi... | jfleet | positive | 438,099 |
@Test
public void willThrowOnUnsuccessfulRequestLessThan100() throws Exception {
GetMethod method = methodFactory.get("http://localhost/abc");
mockMethod("HTTP/1.0 101 OK", String.class, method, "BLABLA");
return method;
try {
rest.get("abc", String.class);
fail("should throw");
} catch (RequestFailedException ex) {
as... | @Test
public void willThrowOnUnsuccessfulRequestLessThan100() throws Exception {
<DeepExtract>
GetMethod method = methodFactory.get("http://localhost/abc");
mockMethod("HTTP/1.0 101 OK", String.class, method, "BLABLA");
return method;
</DeepExtract>
try {
rest.get("abc", String.class);
fail("should throw");
} catch (Re... | lognit-cli | positive | 438,100 |
public void remove(IRI uri) throws MetadataRepositoryException {
try (RepositoryConnection conn = repository.getConnection()) {
conn.remove(null, null, null, uri);
} catch (RepositoryException exception) {
throw new MetadataRepositoryException(MSG_ERROR_REMOVE);
}
} | public void remove(IRI uri) throws MetadataRepositoryException {
<DeepExtract>
try (RepositoryConnection conn = repository.getConnection()) {
conn.remove(null, null, null, uri);
} catch (RepositoryException exception) {
throw new MetadataRepositoryException(MSG_ERROR_REMOVE);
}
</DeepExtract>
} | FAIRDataPoint | positive | 438,101 |
synchronized public int readGroupMsgLogCount(int nGroupNum, int nOffset, int nRows) {
if (null == m_DB || !m_DB.isOpen())
return 0;
int nCount = 0;
String strSql = "SELECT COUNT(*) FROM (SELECT * FROM [tb_GroupMsg] WHERE [groupnum]=? ORDER BY [time] LIMIT ?,?)";
Cursor cursor = m_DB.rawQuery(strSql, new String[] { Stri... | synchronized public int readGroupMsgLogCount(int nGroupNum, int nOffset, int nRows) {
if (null == m_DB || !m_DB.isOpen())
return 0;
int nCount = 0;
String strSql = "SELECT COUNT(*) FROM (SELECT * FROM [tb_GroupMsg] WHERE [groupnum]=? ORDER BY [time] LIMIT ?,?)";
Cursor cursor = m_DB.rawQuery(strSql, new String[] { Stri... | MingQQ | positive | 438,102 |
@Override
public ImageProxyType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
String jsonValue = p.getText();
return Arrays.stream(values()).filter(e -> e.getCode().equals(jsonValue)).findFirst().orElse(null);
} | @Override
public ImageProxyType deserialize(JsonParser p, DeserializationContext ctxt) throws IOException {
String jsonValue = p.getText();
<DeepExtract>
return Arrays.stream(values()).filter(e -> e.getCode().equals(jsonValue)).findFirst().orElse(null);
</DeepExtract>
} | mattermost4j | positive | 438,103 |
@Override
public CollectionMetadata<T> assets(Map<String, Asset> assets) {
this.assets = assets;
return this;
} | @Override
public CollectionMetadata<T> assets(Map<String, Asset> assets) {
<DeepExtract>
this.assets = assets;
</DeepExtract>
return this;
} | staccato | positive | 438,104 |
@Field(value = "ANY:any", setterPolicy = NOT_EMPTY)
public void setAE(String n, String v) {
setStringValue("E" + "-" + n, v);
} | @Field(value = "ANY:any", setterPolicy = NOT_EMPTY)
public void setAE(String n, String v) {
<DeepExtract>
setStringValue("E" + "-" + n, v);
</DeepExtract>
} | logparser | positive | 438,105 |
public boolean addBlacklist(TableFactory tf, TableId id, ServerTable st) {
if (this.blacklist.containsKey(id)) {
return false;
}
if (!this.tfs.containsKey(tf)) {
this.tfs.put(tf, new HashSet<TableId>());
}
this.tfs.get(tf).add(id);
this.blacklist.put(id, st);
ServerTable st = blacklist.remove(id);
if (st == null)
st = ... | public boolean addBlacklist(TableFactory tf, TableId id, ServerTable st) {
if (this.blacklist.containsKey(id)) {
return false;
}
if (!this.tfs.containsKey(tf)) {
this.tfs.put(tf, new HashSet<TableId>());
}
this.tfs.get(tf).add(id);
this.blacklist.put(id, st);
<DeepExtract>
ServerTable st = blacklist.remove(id);
if (st ... | resthub | positive | 438,106 |
void set() {
i = 5;
System.out.println(i);
System.out.println("Frame.put()");
} | void set() {
i = 5;
System.out.println(i);
<DeepExtract>
System.out.println("Frame.put()");
</DeepExtract>
} | Eckel | positive | 438,107 |
static String getUploadUrl(String bucketName, String objectPath, String contentType, boolean publicRead) {
String canonicalizedResource = "/" + bucketName + "/" + objectPath;
long expirationInSecondsSinceEpoch = getExpiration(UPLOAD_URL_EXPIRATION_IN_MINUTES);
String stringToSign = getStringToSign(canonicalizedResource... | static String getUploadUrl(String bucketName, String objectPath, String contentType, boolean publicRead) {
<DeepExtract>
String canonicalizedResource = "/" + bucketName + "/" + objectPath;
long expirationInSecondsSinceEpoch = getExpiration(UPLOAD_URL_EXPIRATION_IN_MINUTES);
String stringToSign = getStringToSign(canonic... | io2014-codelabs | positive | 438,108 |
public List<String> getTextsContains(CharSequence s) {
List<String> list = new ArrayList<String>();
for (ActionMsg msg : this) {
if (!(msg instanceof ActionCode)) {
String text = msg.getMsg();
if ((null == null || text.startsWith(null)) && (s == null || text.contains(s)) && (null == null || text.endsWith(null)))
list.a... | public List<String> getTextsContains(CharSequence s) {
<DeepExtract>
List<String> list = new ArrayList<String>();
for (ActionMsg msg : this) {
if (!(msg instanceof ActionCode)) {
String text = msg.getMsg();
if ((null == null || text.startsWith(null)) && (s == null || text.contains(s)) && (null == null || text.endsWith(... | jcq-coolq | positive | 438,109 |
@Test
public void doesntShowsSplashScreenInClient_IfSplashScreensNotSupported() {
mEnableComponents.manuallyDisable(TestCustomTabsServiceSupportsTwas.class);
mEnableComponents.manuallyEnable(TestCustomTabsServiceNoSplashScreens.class);
runOnUiThreadBlocking(() -> mStrategy.onTwaLaunchInitiated(mActivity.getPackageName(... | @Test
public void doesntShowsSplashScreenInClient_IfSplashScreensNotSupported() {
mEnableComponents.manuallyDisable(TestCustomTabsServiceSupportsTwas.class);
mEnableComponents.manuallyEnable(TestCustomTabsServiceNoSplashScreens.class);
<DeepExtract>
runOnUiThreadBlocking(() -> mStrategy.onTwaLaunchInitiated(mActivity.g... | custom-tabs-client | positive | 438,110 |
@Test
public void testIsValidAuthString() {
try {
PowerMock.resetAll();
PowerMock.expectNew(Date.class).andReturn(today);
PowerMock.replayAll();
} catch (Exception e) {
throw new RuntimeException(e);
}
String auth = service.getCurrentAuthString(user);
try {
PowerMock.resetAll();
PowerMock.expectNew(Date.class).andRetur... | @Test
public void testIsValidAuthString() {
try {
PowerMock.resetAll();
PowerMock.expectNew(Date.class).andReturn(today);
PowerMock.replayAll();
} catch (Exception e) {
throw new RuntimeException(e);
}
String auth = service.getCurrentAuthString(user);
try {
PowerMock.resetAll();
PowerMock.expectNew(Date.class).andRetur... | mds | positive | 438,113 |
@Override
public void initStrategy() {
name = "ProxyEightRax";
armyForBay = 0;
armyForTurret = 0;
numBays = 0;
raxPerCC = 1;
facPerCC = 0;
numRaxForFac = 0;
bunker = false;
proxy = true;
supplyForFirstRefinery = 400;
armyForAttack = 7;
armyForExpand = 100;
facForArmory = 0;
numArmories = 0;
trainUnits.add(UnitType.Terr... | @Override
<DeepExtract>
</DeepExtract>
public void initStrategy() {
<DeepExtract>
</DeepExtract>
name = "ProxyEightRax";
<DeepExtract>
</DeepExtract>
armyForBay = 0;
<DeepExtract>
</DeepExtract>
armyForTurret = 0;
<DeepExtract>
</DeepExtract>
numBays = 0;
<DeepExtract>
</DeepExtract>
raxPerCC = 1;
<DeepExtract>
</DeepE... | Ecgberht | positive | 438,114 |
@Override
public E element() {
final Node<E> f = first;
if (f == null) {
throw new NoSuchElementException();
}
return f.item;
} | @Override
public E element() {
<DeepExtract>
final Node<E> f = first;
if (f == null) {
throw new NoSuchElementException();
}
return f.item;
</DeepExtract>
} | java-Kcp | positive | 438,115 |
private void closeWindow() {
try {
stringsModel.save();
} catch (Exception e) {
JOptionPane.showMessageDialog(this, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
}
dispose();
} | private void closeWindow() {
<DeepExtract>
try {
stringsModel.save();
} catch (Exception e) {
JOptionPane.showMessageDialog(this, e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
}
</DeepExtract>
dispose();
} | micropolis-java | positive | 438,116 |
private void loginComplete(Boolean userChanged) {
boolean preserveActivityStack = !userChanged && mContinueSession;
if (preserveActivityStack && !isTaskRoot()) {
application.onLogin();
} else {
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
boolean showDisc... | private void loginComplete(Boolean userChanged) {
boolean preserveActivityStack = !userChanged && mContinueSession;
<DeepExtract>
if (preserveActivityStack && !isTaskRoot()) {
application.onLogin();
} else {
SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
bo... | mage-android | positive | 438,118 |
public void remove(MutableTreeNode aChild) {
int iChild = this.getIndex(aChild);
super.remove(aChild);
if (SwingUtilities.isEventDispatchThread()) {
() -> model.nodesWereRemoved(this, new int[] { iChild }, new Object[] { aChild }).run();
} else {
SwingUtilities.invokeLater(() -> model.nodesWereRemoved(this, new int[] {... | public void remove(MutableTreeNode aChild) {
int iChild = this.getIndex(aChild);
super.remove(aChild);
<DeepExtract>
if (SwingUtilities.isEventDispatchThread()) {
() -> model.nodesWereRemoved(this, new int[] { iChild }, new Object[] { aChild }).run();
} else {
SwingUtilities.invokeLater(() -> model.nodesWereRemoved(thi... | bigdataviewer-playground | positive | 438,121 |
public void disconnect() {
this.conversationsNode.removeEventListener(this.conversationsChildEventListener);
this.conversationsListeners = null;
Log.i(TAG, "Removed all ConversationsListeners");
this.conversationsNode.removeEventListener(unreadConversationsValueEventListener);
if (unreadConversationsListeners != null)
... | public void disconnect() {
this.conversationsNode.removeEventListener(this.conversationsChildEventListener);
this.conversationsListeners = null;
Log.i(TAG, "Removed all ConversationsListeners");
this.conversationsNode.removeEventListener(unreadConversationsValueEventListener);
<DeepExtract>
if (unreadConversationsListe... | chat21-android-sdk | positive | 438,123 |
@Override
public void onDragStart(DragEvent e) {
panelHeight = FxUtil.getHeight(this.getElement());
widgetHeight = el().getOffsetHeight();
double matrixY;
if (_hasTextBox) {
matrixY = FxUtil.getStyleTop(this);
} else {
matrixY = FxUtil.getMatrixY(el());
}
double currY;
if (_hasTextBox) {
currY = FxUtil.getStyleTop(this... | @Override
public void onDragStart(DragEvent e) {
panelHeight = FxUtil.getHeight(this.getElement());
widgetHeight = el().getOffsetHeight();
double matrixY;
if (_hasTextBox) {
matrixY = FxUtil.getStyleTop(this);
} else {
matrixY = FxUtil.getMatrixY(el());
}
<DeepExtract>
double currY;
if (_hasTextBox) {
currY = FxUtil.ge... | next | positive | 438,127 |
public static VariantWriter getWriter(String writerSpec, StreamableOutput output, ReferenceSequence[] referenceSequenceArray, boolean byRegion, ClassLoader loader) throws NullPointerException, IllegalArgumentException, FileNotFoundException, IOException, VariantWriterInitException {
if (writerSpec == null)
throw new Nu... | public static VariantWriter getWriter(String writerSpec, StreamableOutput output, ReferenceSequence[] referenceSequenceArray, boolean byRegion, ClassLoader loader) throws NullPointerException, IllegalArgumentException, FileNotFoundException, IOException, VariantWriterInitException {
if (writerSpec == null)
throw new Nu... | kestrel | positive | 438,129 |
public void addItemDecoration(@NonNull ItemDecoration decor, int index) {
if (mLayout != null) {
mLayout.assertNotInLayoutOrScroll("Cannot add item decoration during a scroll or layout");
}
if (mItemDecorations.isEmpty()) {
setWillNotDraw(false);
}
if (index < 0) {
mItemDecorations.add(decor);
} else {
mItemDecoration... | public void addItemDecoration(@NonNull ItemDecoration decor, int index) {
if (mLayout != null) {
mLayout.assertNotInLayoutOrScroll("Cannot add item decoration during a scroll or layout");
}
if (mItemDecorations.isEmpty()) {
setWillNotDraw(false);
}
if (index < 0) {
mItemDecorations.add(decor);
} else {
mItemDecoration... | SamsungOneUi | positive | 438,130 |
@Override
@PostConstruct
public void setup() {
HistoryUtil util = new HistoryUtil();
entryResource = util.getHistoryEntryResource(resource);
return util.readHistoryEntry(entryResource);
searchTerm = request.getParameter(POST_FULLTEXT);
} | @Override
@PostConstruct
public void setup() {
<DeepExtract>
HistoryUtil util = new HistoryUtil();
entryResource = util.getHistoryEntryResource(resource);
return util.readHistoryEntry(entryResource);
</DeepExtract>
searchTerm = request.getParameter(POST_FULLTEXT);
} | aem-easy-content-upgrade | positive | 438,131 |
public static void teachPlayer(String playerName, Collection<?> objects) {
if (mod != null) {
ModWrapper.mod = (EquivalentExchange) mod;
}
if (mod != null) {
ModWrapper.mod.getPlayerKnowledgeRegistry().teachPlayer(playerName, objects);
}
} | public static void teachPlayer(String playerName, Collection<?> objects) {
<DeepExtract>
if (mod != null) {
ModWrapper.mod = (EquivalentExchange) mod;
}
</DeepExtract>
if (mod != null) {
ModWrapper.mod.getPlayerKnowledgeRegistry().teachPlayer(playerName, objects);
}
} | Equivalent-Exchange-3 | positive | 438,133 |
public boolean isOne() {
if (value instanceof ZElement)
return isEqual((Element) value);
return isEqual((ZElement) value);
} | public boolean isOne() {
<DeepExtract>
if (value instanceof ZElement)
return isEqual((Element) value);
return isEqual((ZElement) value);
</DeepExtract>
} | jlbc | positive | 438,134 |
private void onSoundClicked() {
doSounds = !doSounds;
Preferences prefs = Preferences.userNodeForPackage(MainWindow.class);
prefs.putBoolean(SOUNDS_PREF, doSounds);
autoBudgetMenuItem.setSelected(getEngine().autoBudget);
autoBulldozeMenuItem.setSelected(getEngine().autoBulldoze);
disastersMenuItem.setSelected(!getEngin... | private void onSoundClicked() {
doSounds = !doSounds;
Preferences prefs = Preferences.userNodeForPackage(MainWindow.class);
prefs.putBoolean(SOUNDS_PREF, doSounds);
<DeepExtract>
autoBudgetMenuItem.setSelected(getEngine().autoBudget);
autoBulldozeMenuItem.setSelected(getEngine().autoBulldoze);
disastersMenuItem.setSele... | micropolis-java | positive | 438,135 |
private void respondPickedValueChanged(int oldVal, int newVal, Object respondChange) {
if (mScrollState == OnScrollListener.SCROLL_STATE_IDLE) {
return;
}
mScrollState = OnScrollListener.SCROLL_STATE_IDLE;
if (mOnScrollListener != null) {
mOnScrollListener.onScrollStateChange(this, OnScrollListener.SCROLL_STATE_IDLE);
... | private void respondPickedValueChanged(int oldVal, int newVal, Object respondChange) {
<DeepExtract>
if (mScrollState == OnScrollListener.SCROLL_STATE_IDLE) {
return;
}
mScrollState = OnScrollListener.SCROLL_STATE_IDLE;
if (mOnScrollListener != null) {
mOnScrollListener.onScrollStateChange(this, OnScrollListener.SCROLL... | EasyAndroid | positive | 438,137 |
public void setMetaData(int jsonFileNo, Configuration configuration) {
for (Element element : elements) {
element.setMetaData(this, configuration);
if (element.isScenario()) {
scenarios.add(element);
}
}
String fileName = "report-feature_";
if (jsonFileNo > 0) {
fileName += jsonFileNo + "_";
}
fileName += Util.toValidF... | public void setMetaData(int jsonFileNo, Configuration configuration) {
for (Element element : elements) {
element.setMetaData(this, configuration);
if (element.isScenario()) {
scenarios.add(element);
}
}
String fileName = "report-feature_";
if (jsonFileNo > 0) {
fileName += jsonFileNo + "_";
}
fileName += Util.toValidF... | cucumber-reporting | positive | 438,140 |
@Override
public Actor commonParse(CocoStudioSceneEditor editor, CCGameObject widget, CCComponent option, Group parent, Actor actor) {
Actor ac = super.commonParse(editor, widget, option, parent, actor);
if (ac != null) {
return ac;
}
Table table = new Table();
table.setVisible(widget.isVisible());
table.setName(actor.... | @Override
public Actor commonParse(CocoStudioSceneEditor editor, CCGameObject widget, CCComponent option, Group parent, Actor actor) {
Actor ac = super.commonParse(editor, widget, option, parent, actor);
if (ac != null) {
return ac;
}
<DeepExtract>
Table table = new Table();
table.setVisible(widget.isVisible());
table.... | cocostudio-ui-libgdx | positive | 438,141 |
@Override
public void onClick(final View v) {
ToggleButton btn = (ToggleButton) v;
mathSymbolEditor.toggleEditingSymbol(btn.getText().charAt(0));
refreshButtonState(getView());
} | @Override
public void onClick(final View v) {
ToggleButton btn = (ToggleButton) v;
mathSymbolEditor.toggleEditingSymbol(btn.getText().charAt(0));
<DeepExtract>
refreshButtonState(getView());
</DeepExtract>
} | math-dragon | positive | 438,142 |
@Override
protected void toWireUnchecked(IpmiPacketContext context, ByteBuffer buffer) {
int chk1Start = buffer.position();
buffer.put(getTargetAddress());
byte networkFunctionByte = getCommandName().getNetworkFunction().getCode();
if (this instanceof IpmiResponse)
networkFunctionByte |= 1;
buffer.put((byte) (networkFu... | @Override
protected void toWireUnchecked(IpmiPacketContext context, ByteBuffer buffer) {
int chk1Start = buffer.position();
buffer.put(getTargetAddress());
byte networkFunctionByte = getCommandName().getNetworkFunction().getCode();
if (this instanceof IpmiResponse)
networkFunctionByte |= 1;
buffer.put((byte) (networkFu... | ipmi4j | positive | 438,144 |
@Override
public <T> List<T> findAllByHtmlTag(Class<T> type, String tag) {
try {
return () -> webContext.findAllByHtmlTag(type, tag).get();
} catch (NoSuchFrameException | NoSuchWindowException | NoSuchSessionException e) {
throw new FindableNotPresentException(this, e);
}
} | @Override
public <T> List<T> findAllByHtmlTag(Class<T> type, String tag) {
<DeepExtract>
try {
return () -> webContext.findAllByHtmlTag(type, tag).get();
} catch (NoSuchFrameException | NoSuchWindowException | NoSuchSessionException e) {
throw new FindableNotPresentException(this, e);
}
</DeepExtract>
} | darcy-webdriver | positive | 438,149 |
public synchronized void addBacklogMessage(IrcMessage message) {
if (message.isHighlighted() && message.messageId > lastHighlightMessageId) {
lastHighlightMessageId = message.messageId;
this.setChanged();
}
if ((message.type == IrcMessage.Type.Plain || message.type == IrcMessage.Type.Action) && message.messageId > last... | public synchronized void addBacklogMessage(IrcMessage message) {
<DeepExtract>
if (message.isHighlighted() && message.messageId > lastHighlightMessageId) {
lastHighlightMessageId = message.messageId;
this.setChanged();
}
if ((message.type == IrcMessage.Type.Plain || message.type == IrcMessage.Type.Action) && message.me... | QuasselDroid | positive | 438,153 |
int getEndLine(int defaultValue, OrientationHelperEx helper) {
if (mCachedEnd != INVALID_LINE) {
return mCachedEnd;
}
if (defaultValue != INVALID_LINE && mViews.size() == 0) {
if (mLastEdgeStart != INVALID_LINE) {
return mLastEdgeStart;
}
return defaultValue;
}
if (mViews.size() == 0) {
mCachedEnd = INVALID_LINE;
} els... | int getEndLine(int defaultValue, OrientationHelperEx helper) {
if (mCachedEnd != INVALID_LINE) {
return mCachedEnd;
}
if (defaultValue != INVALID_LINE && mViews.size() == 0) {
if (mLastEdgeStart != INVALID_LINE) {
return mLastEdgeStart;
}
return defaultValue;
}
<DeepExtract>
if (mViews.size() == 0) {
mCachedEnd = INVAL... | vlayout | positive | 438,155 |
@Override
public void onPropertyChanged(Observable sender, int propertyId) {
Log.i(Util.LOG_TAG, "Check Mandatory Update Task Completed");
if (!mUseOtherKeyManager && mIsMandatoryUpdateRequired.get()) {
AlertUtil.showUpdateRequireDialog(this);
Log.d(Util.LOG_TAG, "SBK Mandatory update required.");
} else {
Intent inten... | @Override
public void onPropertyChanged(Observable sender, int propertyId) {
Log.i(Util.LOG_TAG, "Check Mandatory Update Task Completed");
<DeepExtract>
if (!mUseOtherKeyManager && mIsMandatoryUpdateRequired.get()) {
AlertUtil.showUpdateRequireDialog(this);
Log.d(Util.LOG_TAG, "SBK Mandatory update required.");
} else ... | FOUNDERS_3rd | positive | 438,156 |
public final void setCurrentPage(long page) {
if (currentPage != page) {
if (isVersioned()) {
addStateChange();
}
}
currentPage = page;
} | public final void setCurrentPage(long page) {
<DeepExtract>
if (currentPage != page) {
if (isVersioned()) {
addStateChange();
}
}
currentPage = page;
</DeepExtract>
} | quickview | positive | 438,157 |
public static String getSimpleFormatDateTime(Date date) {
SimpleDateFormat sdf = new SimpleDateFormat(DATE_TIME);
return sdf.format(date);
} | public static String getSimpleFormatDateTime(Date date) {
<DeepExtract>
SimpleDateFormat sdf = new SimpleDateFormat(DATE_TIME);
return sdf.format(date);
</DeepExtract>
} | erupt | positive | 438,158 |
@Override
public void draw(Canvas canvas) {
Rect r = getBounds();
float centerY = (r.top + r.bottom) / 2f;
long currentMillis = System.currentTimeMillis();
float offsetMillis = (float) (currentMillis % ANIMATION_DURATION_MILLIS);
float progress = offsetMillis / ANIMATION_DURATION_MILLIS;
float canvasWidth = canvas.getW... | @Override
public void draw(Canvas canvas) {
Rect r = getBounds();
float centerY = (r.top + r.bottom) / 2f;
long currentMillis = System.currentTimeMillis();
float offsetMillis = (float) (currentMillis % ANIMATION_DURATION_MILLIS);
float progress = offsetMillis / ANIMATION_DURATION_MILLIS;
float canvasWidth = canvas.getW... | GreenMatter | positive | 438,159 |
@Override
public void onClick(View v) {
SMSSDK.getVerificationCode("86", phString);
receiveRestartLayout.setVisibility(View.GONE);
receiveNormaLayout.setVisibility(View.VISIBLE);
seconds = 60;
timer = new Timer();
timer.schedule(new TimerTask() {
@Override
public void run() {
handler2.sendEmptyMessage(seconds--);
}
}, ... | @Override
public void onClick(View v) {
SMSSDK.getVerificationCode("86", phString);
receiveRestartLayout.setVisibility(View.GONE);
receiveNormaLayout.setVisibility(View.VISIBLE);
seconds = 60;
timer = new Timer();
timer.schedule(new TimerTask() {
@Override
public void run() {
handler2.sendEmptyMessage(seconds--);
}
}, ... | Charismatic_YiChang | positive | 438,161 |
public void markScrambled() {
tvTimer.setTextColor(0xff00ff00);
tvMulPhase.setTextColor(0xff00ff00);
timer.setTimerState(DCTTimer.READY);
canStart = true;
} | public void markScrambled() {
<DeepExtract>
tvTimer.setTextColor(0xff00ff00);
tvMulPhase.setTextColor(0xff00ff00);
</DeepExtract>
timer.setTimerState(DCTTimer.READY);
canStart = true;
} | DCTimer-Android | positive | 438,162 |
void initGUI() {
this.addKeyListener(this);
this.addMouseListener(this);
try {
appletWindowWidth = Integer.parseInt(getParameter(APPLET_WIDTH_PARAM));
} catch (NumberFormatException ex) {
appletWindowWidth = DEFAULT_VIEW_WIDTH;
}
try {
appletWindowHeight = Integer.parseInt(getParameter(APPLET_HEIGHT_PARAM));
} catch (N... | void initGUI() {
this.addKeyListener(this);
this.addMouseListener(this);
try {
appletWindowWidth = Integer.parseInt(getParameter(APPLET_WIDTH_PARAM));
} catch (NumberFormatException ex) {
appletWindowWidth = DEFAULT_VIEW_WIDTH;
}
try {
appletWindowHeight = Integer.parseInt(getParameter(APPLET_HEIGHT_PARAM));
} catch (N... | LLFI | positive | 438,163 |
@Override
public void actionPerformed(ActionEvent arg0) {
if (tankPanel != null) {
this.remove(tankPanel);
this.remove(chapterPanel);
}
this.remove(createRoomPanel);
this.add(modePanel);
this.validate();
this.repaint();
} | @Override
public void actionPerformed(ActionEvent arg0) {
<DeepExtract>
if (tankPanel != null) {
this.remove(tankPanel);
this.remove(chapterPanel);
}
this.remove(createRoomPanel);
this.add(modePanel);
this.validate();
this.repaint();
</DeepExtract>
} | TankBattle | positive | 438,164 |
@Test(groups = { "listers" })
public void listerForRecentUnapproved() {
BlogPosts posts = conn.blogPosts();
Lister blogLister = posts.listerForRecent(BlogPostField.title);
blogLister = blogLister.unapproved();
int count = 0;
Iterator<BlogPost> blogIterator = blogLister.iterator();
while (blogIterator.hasNext()) {
blogI... | @Test(groups = { "listers" })
public void listerForRecentUnapproved() {
BlogPosts posts = conn.blogPosts();
Lister blogLister = posts.listerForRecent(BlogPostField.title);
blogLister = blogLister.unapproved();
<DeepExtract>
int count = 0;
Iterator<BlogPost> blogIterator = blogLister.iterator();
while (blogIterator.hasN... | ning-api-java | positive | 438,165 |
public byte[] JITB$toByteArray() {
final byte[] result = new byte[_length];
assert 0 <= _length : "Position must not exceed length.";
_position = (int) 0;
_bytesAvailable = _length - _position;
_buffer.limit(_buffer.capacity());
_buffer.get(result);
return result;
} | public byte[] JITB$toByteArray() {
final byte[] result = new byte[_length];
<DeepExtract>
assert 0 <= _length : "Position must not exceed length.";
_position = (int) 0;
_bytesAvailable = _length - _position;
</DeepExtract>
_buffer.limit(_buffer.capacity());
_buffer.get(result);
return result;
} | apparat | positive | 438,166 |
public void destroy() {
if (currentConsole != null)
currentConsole.extendedPowerOff();
awtControls.powerOff();
speaker.powerOff();
screen.powerOff();
if (standaloneConsole != null)
standaloneConsole.destroy();
if (serverConsole != null)
serverConsole.destroy();
if (clientConsole != null)
clientConsole.destroy();
screen... | public void destroy() {
<DeepExtract>
if (currentConsole != null)
currentConsole.extendedPowerOff();
awtControls.powerOff();
speaker.powerOff();
screen.powerOff();
</DeepExtract>
if (standaloneConsole != null)
standaloneConsole.destroy();
if (serverConsole != null)
serverConsole.destroy();
if (clientConsole != null)
cl... | javatari | positive | 438,167 |
@Test
public void ingredients_are_missing() {
when(process.waitsAtServiceTask("PrepareDinner")).thenReturn(task -> task.handleBpmnError("IngredientsMissing"));
run(process).startByKey("Dinner").execute();
verify(process, times(1)).hasFinished("DinnerNotPrepared");
verify(process, never()).hasFinished("DinnerPrepared");... | @Test
public void ingredients_are_missing() {
when(process.waitsAtServiceTask("PrepareDinner")).thenReturn(task -> task.handleBpmnError("IngredientsMissing"));
run(process).startByKey("Dinner").execute();
verify(process, times(1)).hasFinished("DinnerNotPrepared");
verify(process, never()).hasFinished("DinnerPrepared");... | camunda-platform-scenario | positive | 438,169 |
@Override
synchronized public boolean isReceiveFramingEnabled() {
if (m_FD < 0)
failWithIllegalStateException();
return false;
} | @Override
synchronized public boolean isReceiveFramingEnabled() {
<DeepExtract>
if (m_FD < 0)
failWithIllegalStateException();
</DeepExtract>
return false;
} | purejavacomm | positive | 438,170 |
public static <T> Qf max(Attr.Property<T, ?> field, String as) {
Qf qf = new Qf();
qf.sql = sql(field, null, as, FUNC.MAX, null);
return qf;
} | public static <T> Qf max(Attr.Property<T, ?> field, String as) {
<DeepExtract>
Qf qf = new Qf();
qf.sql = sql(field, null, as, FUNC.MAX, null);
return qf;
</DeepExtract>
} | act-eagle-allone | positive | 438,174 |
private List<TemplateTransformation> resolveTemplateFile(String source, File outputFile) {
TemplateSource templateSource;
try (DataSource dataSource = dataSourceLoader.load(source)) {
templateSource = TemplateSource.fromCode(dataSource.getName(), dataSource.getText(templateEncoding.name()));
}
TemplateOutput templateOu... | private List<TemplateTransformation> resolveTemplateFile(String source, File outputFile) {
TemplateSource templateSource;
try (DataSource dataSource = dataSourceLoader.load(source)) {
templateSource = TemplateSource.fromCode(dataSource.getName(), dataSource.getText(templateEncoding.name()));
}
<DeepExtract>
TemplateOut... | freemarker-generator | positive | 438,175 |
private void doInclude(TemplateModel model, String templateName) throws Exception {
AbstractTemplateEngine engine = model.getRenderer();
Writer out = model.getWriter();
try {
Template template = findTemplate(templateName);
Writable writable = template.make(wrap(model));
writable.writeTo(out);
} catch (Exception e) {
th... | private void doInclude(TemplateModel model, String templateName) throws Exception {
AbstractTemplateEngine engine = model.getRenderer();
Writer out = model.getWriter();
<DeepExtract>
try {
Template template = findTemplate(templateName);
Writable writable = template.make(wrap(model));
writable.writeTo(out);
} catch (Exc... | jbake | positive | 438,177 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.