before stringlengths 12 3.21M | after stringlengths 41 3.21M | repo stringlengths 1 56 | type stringclasses 1
value | __index_level_0__ int64 0 442k |
|---|---|---|---|---|
public Long word_id(String word) {
float[] ret = new float[vectorSize];
get(word, ret, 0);
return ret;
} | public Long word_id(String word) {
<DeepExtract>
float[] ret = new float[vectorSize];
get(word, ret, 0);
return ret;
</DeepExtract>
} | SalIE | positive | 1,960 |
public static Bitmap getBitmap(final String filePath, final int maxWidth, final int maxHeight) {
if (isSpace(filePath)) {
return null;
}
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeFile(filePath, options);
int height = options.outHeight;
int width ... | public static Bitmap getBitmap(final String filePath, final int maxWidth, final int maxHeight) {
if (isSpace(filePath)) {
return null;
}
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeFile(filePath, options);
<DeepExtract>
int height = options.outHeig... | Jetpack-From-Java-To-Kotlin | positive | 1,961 |
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
if (mGrid != null) {
return;
}
View root = getView();
if (root == null) {
throw new IllegalStateException("Content view not yet created");
}
if (root instanceof GridView) {
mGrid = (GridView) root;... | @Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
<DeepExtract>
if (mGrid != null) {
return;
}
View root = getView();
if (root == null) {
throw new IllegalStateException("Content view not yet created");
}
if (root instanceof GridView) {
mGrid = (G... | android-xbmcremote-sandbox | positive | 1,962 |
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
if (getActivity() instanceof AppCompatActivity) {
getActionBar().setDisplayShowTitleEnabled(false);
getActionBar().setDisplayHomeAsUpEnabled(true);
getActionBar().setHomeButtonEnabled(true);
}
listView = (ListView) view.findViewById(R.id.listvi... | @Override
public void onViewCreated(View view, Bundle savedInstanceState) {
if (getActivity() instanceof AppCompatActivity) {
getActionBar().setDisplayShowTitleEnabled(false);
getActionBar().setDisplayHomeAsUpEnabled(true);
getActionBar().setHomeButtonEnabled(true);
}
listView = (ListView) view.findViewById(R.id.listvi... | dhis2-android-trackercapture | positive | 1,963 |
@PostConstruct
protected void afterCreated() {
return FOLDER_TYPES.contains(getProperty(resource, JcrConstants.JCR_PRIMARYTYPE));
this.scriptName = defaultIfEmpty(getProperty(resource, JcrConstants.JCR_TITLE), resource.getName());
if (!isFolder) {
Optional.ofNullable(resource.adaptTo(ScriptModel.class)).ifPresent(scrip... | @PostConstruct
protected void afterCreated() {
<DeepExtract>
return FOLDER_TYPES.contains(getProperty(resource, JcrConstants.JCR_PRIMARYTYPE));
</DeepExtract>
this.scriptName = defaultIfEmpty(getProperty(resource, JcrConstants.JCR_TITLE), resource.getName());
if (!isFolder) {
Optional.ofNullable(resource.adaptTo(Script... | APM | positive | 1,964 |
@Override
public PacketData translate(ServerSession session, PacketData data) {
int entityId = data.read(Type.INT, 0);
int x = data.read(Type.BYTE, 1);
int y = data.read(Type.BYTE, 2);
int z = data.read(Type.BYTE, 3);
EntityTracker tracker = session.getStorage().get(EntityTracker.class);
AbstractEntity e = tracker.getE... | @Override
public PacketData translate(ServerSession session, PacketData data) {
int entityId = data.read(Type.INT, 0);
int x = data.read(Type.BYTE, 1);
int y = data.read(Type.BYTE, 2);
int z = data.read(Type.BYTE, 3);
<DeepExtract>
EntityTracker tracker = session.getStorage().get(EntityTracker.class);
AbstractEntity e ... | DirtMultiversion | positive | 1,965 |
@SuppressWarnings("unchecked")
private static void loadPlugin(File pluginDir, String reloadId) throws MalformedURLException, ClassNotFoundException, IllegalAccessException, InstantiationException {
if (!pluginDir.isDirectory()) {
return;
}
String dir = pluginDir.getAbsolutePath();
PluginClassLoader classLoader = new Pl... | @SuppressWarnings("unchecked")
private static void loadPlugin(File pluginDir, String reloadId) throws MalformedURLException, ClassNotFoundException, IllegalAccessException, InstantiationException {
if (!pluginDir.isDirectory()) {
return;
}
String dir = pluginDir.getAbsolutePath();
PluginClassLoader classLoader = new Pl... | xiaoyaoji | positive | 1,967 |
private void headerRefreshing() {
if (upAnimator != null) {
upAnimator.cancel();
}
mHeaderState = REFRESHING;
LayoutParams params = (LayoutParams) mHeaderView.getLayoutParams();
params.topMargin = 0;
mHeaderView.setLayoutParams(params);
invalidate();
mHeaderImageView.setVisibility(View.GONE);
mHeaderImageView.clearAnim... | private void headerRefreshing() {
if (upAnimator != null) {
upAnimator.cancel();
}
mHeaderState = REFRESHING;
<DeepExtract>
LayoutParams params = (LayoutParams) mHeaderView.getLayoutParams();
params.topMargin = 0;
mHeaderView.setLayoutParams(params);
invalidate();
</DeepExtract>
mHeaderImageView.setVisibility(View.GONE... | MyBlogDemo | positive | 1,968 |
@Override
public void set(PDU pdu, Target target, Object userHandle, ResponseListener listener) throws IOException {
pdu.setType(PDU.SET);
send(pdu, target, null, userHandle, listener);
} | @Override
public void set(PDU pdu, Target target, Object userHandle, ResponseListener listener) throws IOException {
pdu.setType(PDU.SET);
<DeepExtract>
send(pdu, target, null, userHandle, listener);
</DeepExtract>
} | tnm4j | positive | 1,969 |
@Override
StaticStructureElementInstance getElementInstance() {
return containerInstance;
} | @Override
StaticStructureElementInstance getElementInstance() {
<DeepExtract>
return containerInstance;
</DeepExtract>
} | dsl | positive | 1,970 |
private static File getDexDir(Context context, ApplicationInfo applicationInfo) throws IOException {
File cache = new File(applicationInfo.dataDir, CODE_CACHE_NAME);
try {
mkdirChecked(cache);
} catch (IOException e) {
cache = new File(context.getFilesDir(), CODE_CACHE_NAME);
mkdirChecked(cache);
}
File dexDir = new Fi... | private static File getDexDir(Context context, ApplicationInfo applicationInfo) throws IOException {
File cache = new File(applicationInfo.dataDir, CODE_CACHE_NAME);
try {
mkdirChecked(cache);
} catch (IOException e) {
cache = new File(context.getFilesDir(), CODE_CACHE_NAME);
mkdirChecked(cache);
}
File dexDir = new Fi... | fastdex | positive | 1,971 |
@Override
default float getOutlineTop() {
return getPadding().getTop();
} | @Override
default float getOutlineTop() {
<DeepExtract>
return getPadding().getTop();
</DeepExtract>
} | ph-pdf-layout | positive | 1,972 |
public void removeAllPlots() {
plots.clear();
if (linkedLegendPanel != null) {
linkedLegendPanel.updateLegends();
}
for (int i = 0; i < plots.size(); i++) {
getPlot(i).coordNoted = null;
}
repaint();
} | public void removeAllPlots() {
plots.clear();
if (linkedLegendPanel != null) {
linkedLegendPanel.updateLegends();
}
<DeepExtract>
for (int i = 0; i < plots.size(); i++) {
getPlot(i).coordNoted = null;
}
repaint();
</DeepExtract>
} | jmathplot | positive | 1,973 |
@Test
public void testUpdateFromSingleTable() {
when(db.update(anyString(), (ContentValues) anyObject(), anyString(), (String[]) anyObject())).thenReturn(2);
ContentValues values = new ContentValues();
values.put("test", "test");
provider.update(Uri.parse("content://" + "test.com/parent"), values, null, null);
provider... | @Test
public void testUpdateFromSingleTable() {
when(db.update(anyString(), (ContentValues) anyObject(), anyString(), (String[]) anyObject())).thenReturn(2);
ContentValues values = new ContentValues();
values.put("test", "test");
provider.update(Uri.parse("content://" + "test.com/parent"), values, null, null);
<DeepExt... | sqlite-provider | positive | 1,974 |
public final int findUri(int prefix) {
if (m_dataLength == 0) {
return -1;
}
int offset = m_dataLength - 1;
for (int i = m_depth; i != 0; --i) {
int count = m_data[offset];
offset -= 2;
for (; count != 0; --count) {
if (true) {
if (m_data[offset] == prefix) {
return m_data[offset + 1];
}
} else {
if (m_data[offset + 1]... | public final int findUri(int prefix) {
<DeepExtract>
if (m_dataLength == 0) {
return -1;
}
int offset = m_dataLength - 1;
for (int i = m_depth; i != 0; --i) {
int count = m_data[offset];
offset -= 2;
for (; count != 0; --count) {
if (true) {
if (m_data[offset] == prefix) {
return m_data[offset + 1];
}
} else {
if (m_da... | Xpatch | positive | 1,975 |
public void actionPerformed(java.awt.event.ActionEvent evt) {
assert SwingUtilities.isEventDispatchThread();
BacklogData data = BacklogData.create(issue.getRepository());
User myself = data.getMyself();
if (myself != null) {
setSelectedAssignee(myself);
}
} | public void actionPerformed(java.awt.event.ActionEvent evt) {
<DeepExtract>
assert SwingUtilities.isEventDispatchThread();
BacklogData data = BacklogData.create(issue.getRepository());
User myself = data.getMyself();
if (myself != null) {
setSelectedAssignee(myself);
}
</DeepExtract>
} | netbeans-backlog-plugin | positive | 1,976 |
@Test(timeout = 1000)
public void testOversizedInputs() {
List<String> c = IntStream.range(0, 100000).mapToObj(i -> "B/" + i).collect(toList());
testCase(c, c, null, true);
} | @Test(timeout = 1000)
public void testOversizedInputs() {
List<String> c = IntStream.range(0, 100000).mapToObj(i -> "B/" + i).collect(toList());
<DeepExtract>
testCase(c, c, null, true);
</DeepExtract>
} | search-extra | positive | 1,977 |
private int addStructTreeRootObject() throws Exception {
objOffset.add(byteCount);
append(objOffset.size());
append(" 0 obj\n");
append(Integer.toString("<<\n"));
append(Integer.toString("/Type /StructTreeRoot\n"));
append(Integer.toString("/ParentTree "));
append(Integer.toString(getObjNumber() + 1));
append(Integer.t... | private int addStructTreeRootObject() throws Exception {
objOffset.add(byteCount);
append(objOffset.size());
append(" 0 obj\n");
append(Integer.toString("<<\n"));
append(Integer.toString("/Type /StructTreeRoot\n"));
append(Integer.toString("/ParentTree "));
append(Integer.toString(getObjNumber() + 1));
append(Integer.t... | pdfjet | positive | 1,978 |
@Override
public MutablePair<Second, First> invert() {
return new MutablePair<First, Second>(second, first);
} | @Override
public MutablePair<Second, First> invert() {
<DeepExtract>
return new MutablePair<First, Second>(second, first);
</DeepExtract>
} | gdx-kiwi | positive | 1,979 |
@Override
public JsonGenerator writePropertyId(long id) throws JacksonException {
final String name = Long.toString(id);
if (!_streamWriteContext.writeName(name)) {
_reportError("Can not write a property name, expecting a value");
}
String ns = (_nextName == null) ? "" : _nextName.getNamespaceURI();
_nameToEncode.names... | @Override
public JsonGenerator writePropertyId(long id) throws JacksonException {
final String name = Long.toString(id);
<DeepExtract>
if (!_streamWriteContext.writeName(name)) {
_reportError("Can not write a property name, expecting a value");
}
String ns = (_nextName == null) ? "" : _nextName.getNamespaceURI();
_name... | jackson-dataformat-xml | positive | 1,980 |
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
if (value == null) {
throw new RuntimeException("Value for " + "id" + " cannot be null");
}
criteria.add(new Criterion("id >=", value));
return (Criteria) this;
} | public Criteria andIdGreaterThanOrEqualTo(Integer value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "id" + " cannot be null");
}
criteria.add(new Criterion("id >=", value));
</DeepExtract>
return (Criteria) this;
} | cloud | positive | 1,981 |
@Override
public List<GeneratedJavaFile> contextGenerateAdditionalJavaFiles(IntrospectedTable introspectedTable) {
log.info(">>>> generating extra files...");
Map<String, String> map = new HashMap<>();
for (Map.Entry<Object, Object> entry : properties.entrySet()) {
map.put(entry.getKey().toString(), entry.getValue().to... | @Override
public List<GeneratedJavaFile> contextGenerateAdditionalJavaFiles(IntrospectedTable introspectedTable) {
log.info(">>>> generating extra files...");
Map<String, String> map = new HashMap<>();
for (Map.Entry<Object, Object> entry : properties.entrySet()) {
map.put(entry.getKey().toString(), entry.getValue().to... | mybatis-generator-gui-extension | positive | 1,982 |
@Test
public void testSimpleOpenAPIImportJSON() {
OpenAPIImporter importer = null;
try {
importer = new OpenAPIImporter("target/test-classes/io/github/microcks/util/openapi/cars-openapi.json", null);
} catch (IOException ioe) {
fail("Exception should not be thrown");
}
List<Service> services = null;
try {
services = im... | @Test
public void testSimpleOpenAPIImportJSON() {
OpenAPIImporter importer = null;
try {
importer = new OpenAPIImporter("target/test-classes/io/github/microcks/util/openapi/cars-openapi.json", null);
} catch (IOException ioe) {
fail("Exception should not be thrown");
}
<DeepExtract>
List<Service> services = null;
try {... | microcks | positive | 1,983 |
public Criteria andGoodsnameNotEqualTo(String value) {
if (value == null) {
throw new RuntimeException("Value for " + "goodsname" + " cannot be null");
}
criteria.add(new Criterion("goodsName <>", value));
return (Criteria) this;
} | public Criteria andGoodsnameNotEqualTo(String value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "goodsname" + " cannot be null");
}
criteria.add(new Criterion("goodsName <>", value));
</DeepExtract>
return (Criteria) this;
} | garbage-collection | positive | 1,984 |
public StateListBuilder<V, T> longPressable(V value) {
states.add(android.R.attr.state_long_pressable);
values.add(value);
return this;
} | public StateListBuilder<V, T> longPressable(V value) {
<DeepExtract>
states.add(android.R.attr.state_long_pressable);
values.add(value);
return this;
</DeepExtract>
} | relight | positive | 1,986 |
@Override
public void actionPerformed(ActionEvent e) {
linkBuilder = new ImageViewerLinkBuilder(true);
imageList = new ImageViewerImageList(this, linkBuilder);
imageListScrollpane.setViewportView(imageList);
if (imageList.getModel().getSize() > 0) {
imageList.setSelectedIndex(0);
}
} | @Override
public void actionPerformed(ActionEvent e) {
<DeepExtract>
linkBuilder = new ImageViewerLinkBuilder(true);
imageList = new ImageViewerImageList(this, linkBuilder);
imageListScrollpane.setViewportView(imageList);
</DeepExtract>
if (imageList.getModel().getSize() > 0) {
imageList.setSelectedIndex(0);
}
} | SnippingToolPlusPlus | positive | 1,987 |
public static void main(String[] args) {
Outputer outputer = new Outputer();
new Thread(new MyRunnable("llllllllll", outputer)).start();
new Thread(new MyRunnable("oooooooooo", outputer)).start();
} | public static void main(String[] args) {
<DeepExtract>
Outputer outputer = new Outputer();
new Thread(new MyRunnable("llllllllll", outputer)).start();
new Thread(new MyRunnable("oooooooooo", outputer)).start();
</DeepExtract>
} | java-core | positive | 1,988 |
private static void racePauseResuming(final TestCallStreamObserver<?> downstream, int times) {
Observable.range(0, times).concatMapCompletable(new Function<Integer, CompletableSource>() {
@Override
public CompletableSource apply(Integer i) {
return Completable.fromAction(new Action() {
@Override
public void run() {
dow... | private static void racePauseResuming(final TestCallStreamObserver<?> downstream, int times) {
Observable.range(0, times).concatMapCompletable(new Function<Integer, CompletableSource>() {
@Override
public CompletableSource apply(Integer i) {
return Completable.fromAction(new Action() {
@Override
public void run() {
dow... | reactive-grpc | positive | 1,989 |
public static SoMap getSoMap(String key, Object value) {
if (key.toLowerCase().equals("this")) {
return this;
}
put(key, value);
return this;
} | public static SoMap getSoMap(String key, Object value) {
<DeepExtract>
if (key.toLowerCase().equals("this")) {
return this;
}
put(key, value);
return this;
</DeepExtract>
} | sa-plus | positive | 1,990 |
public void setEmptyView(View paramView) {
this.mEmptyView = paramView;
Adapter localAdapter = getAdapter();
boolean bool = (localAdapter == null) || (localAdapter.isEmpty());
if (isInFilterMode())
bool = false;
if (bool) {
if (this.mEmptyView != null) {
this.mEmptyView.setVisibility(0);
setVisibility(8);
} else {
setV... | public void setEmptyView(View paramView) {
this.mEmptyView = paramView;
Adapter localAdapter = getAdapter();
boolean bool = (localAdapter == null) || (localAdapter.isEmpty());
<DeepExtract>
if (isInFilterMode())
bool = false;
if (bool) {
if (this.mEmptyView != null) {
this.mEmptyView.setVisibility(0);
setVisibility(8);... | android-tv-launcher | positive | 1,991 |
@GenerateMicroBenchmark
public void mediumTestGroovyJavaWithoutRecursion() {
groovyJavaSer2.serialize(MEDIUM_DATA);
} | @GenerateMicroBenchmark
public void mediumTestGroovyJavaWithoutRecursion() {
<DeepExtract>
groovyJavaSer2.serialize(MEDIUM_DATA);
</DeepExtract>
} | json-parsers-benchmark | positive | 1,992 |
@Override
public void setImageDrawable(Drawable drawable) {
super.setImageDrawable(drawable);
if (drawable == null) {
mBitmap = null;
}
if (drawable instanceof BitmapDrawable) {
mBitmap = ((BitmapDrawable) drawable).getBitmap();
}
try {
Bitmap bitmap;
if (drawable instanceof ColorDrawable) {
bitmap = Bitmap.createBitma... | @Override
public void setImageDrawable(Drawable drawable) {
super.setImageDrawable(drawable);
if (drawable == null) {
mBitmap = null;
}
if (drawable instanceof BitmapDrawable) {
mBitmap = ((BitmapDrawable) drawable).getBitmap();
}
try {
Bitmap bitmap;
if (drawable instanceof ColorDrawable) {
bitmap = Bitmap.createBitma... | QiQuYing | positive | 1,993 |
public static boolean isDroidiumContainer(ContainerDef containerDef) {
if (isContainerOfType(ContainerType.DROIDIUM, containerDef) || isContainerOfType(ContainerType.ANDROID, containerDef)) {
return true;
}
Map<String, String> properties = containerDef.getContainerProperties();
if (properties.containsKey("avdName") || ... | public static boolean isDroidiumContainer(ContainerDef containerDef) {
if (isContainerOfType(ContainerType.DROIDIUM, containerDef) || isContainerOfType(ContainerType.ANDROID, containerDef)) {
return true;
}
<DeepExtract>
Map<String, String> properties = containerDef.getContainerProperties();
if (properties.containsKey(... | arquillian-droidium | positive | 1,994 |
protected String doInBackground(Marker... params) {
marker = params[0];
GeocoderNominatim geocoder = new GeocoderNominatim(userAgent);
String theAddress;
try {
double dLatitude = marker.getPosition().getLatitude();
double dLongitude = marker.getPosition().getLongitude();
List<Address> addresses = geocoder.getFromLocati... | protected String doInBackground(Marker... params) {
marker = params[0];
<DeepExtract>
GeocoderNominatim geocoder = new GeocoderNominatim(userAgent);
String theAddress;
try {
double dLatitude = marker.getPosition().getLatitude();
double dLongitude = marker.getPosition().getLongitude();
List<Address> addresses = geocoder... | osmbonuspack | positive | 1,995 |
public static void setTheme(ViewGroup root) {
AppStyles instance = new AppStyles(root.getContext());
root.setBackgroundColor(instance.settings.getBackgroundColor());
for (int pos = 0; pos < root.getChildCount(); pos++) {
View child = root.getChildAt(pos);
if (child instanceof SwitchButton) {
SwitchButton sw = (SwitchBu... | public static void setTheme(ViewGroup root) {
AppStyles instance = new AppStyles(root.getContext());
root.setBackgroundColor(instance.settings.getBackgroundColor());
<DeepExtract>
for (int pos = 0; pos < root.getChildCount(); pos++) {
View child = root.getChildAt(pos);
if (child instanceof SwitchButton) {
SwitchButton ... | Shitter | positive | 1,996 |
@Override
public void onCompleted(Response response) {
Request request = response.getRequest();
if (request != currentRequest) {
return;
}
loading = false;
currentRequest = null;
FacebookRequestError requestError = response.getError();
FacebookException exception = (requestError == null) ? null : requestError.getExcept... | @Override
public void onCompleted(Response response) {
<DeepExtract>
Request request = response.getRequest();
if (request != currentRequest) {
return;
}
loading = false;
currentRequest = null;
FacebookRequestError requestError = response.getError();
FacebookException exception = (requestError == null) ? null : requestE... | HypFacebook | positive | 1,997 |
@Override
public void onFailure(Call<ReviewResponse> call, Throwable t) {
mNotAvailableTextView.setVisibility(View.INVISIBLE);
mErrorMessageTextView.setVisibility(View.VISIBLE);
mRecyclerView.setVisibility(View.INVISIBLE);
} | @Override
public void onFailure(Call<ReviewResponse> call, Throwable t) {
<DeepExtract>
mNotAvailableTextView.setVisibility(View.INVISIBLE);
mErrorMessageTextView.setVisibility(View.VISIBLE);
mRecyclerView.setVisibility(View.INVISIBLE);
</DeepExtract>
} | Cinematic | positive | 1,998 |
public static String getCurYear(String format) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
calendar.add(Calendar.YEAR, 0);
return date2Str(calendar, format);
} | public static String getCurYear(String format) {
<DeepExtract>
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
calendar.add(Calendar.YEAR, 0);
return date2Str(calendar, format);
</DeepExtract>
} | CocoBill | positive | 1,999 |
protected int getDefItemViewType(int position) {
if (mMultiTypeDelegate != null) {
return mMultiTypeDelegate.getDefItemViewType(mData, position);
}
if (getEmptyViewCount() == 1) {
boolean header = mHeadAndEmptyEnable && getHeaderLayoutCount() != 0;
switch(position) {
case 0:
if (header) {
return HEADER_VIEW;
} else {
r... | protected int getDefItemViewType(int position) {
if (mMultiTypeDelegate != null) {
return mMultiTypeDelegate.getDefItemViewType(mData, position);
}
<DeepExtract>
if (getEmptyViewCount() == 1) {
boolean header = mHeadAndEmptyEnable && getHeaderLayoutCount() != 0;
switch(position) {
case 0:
if (header) {
return HEADER_VI... | HeavenlyModule | positive | 2,000 |
public static void main(String[] args) {
for (int i = 0; i < N; i++) {
Permutation[i] = i;
}
if (N == 0) {
print();
return;
}
generatePermutations(N - 1);
for (int i = 0; i < N - 1; i++) {
int swap = Permutation[i];
Permutation[i] = Permutation[N - 1];
Permutation[N - 1] = swap;
generatePermutations(N - 1);
swap = Perm... | public static void main(String[] args) {
for (int i = 0; i < N; i++) {
Permutation[i] = i;
}
<DeepExtract>
if (N == 0) {
print();
return;
}
generatePermutations(N - 1);
for (int i = 0; i < N - 1; i++) {
int swap = Permutation[i];
Permutation[i] = Permutation[N - 1];
Permutation[N - 1] = swap;
generatePermutations(N - 1... | Java-Translation-Sources | positive | 2,001 |
@Test
public void isConnected_afterSuccessfulConnect_returnsTrue() throws IOException {
when(channelFuture.syncUninterruptibly()).thenReturn(channelFuture);
when(channelFuture.isSuccess()).thenReturn(true);
when(channelFuture.channel()).thenReturn(channel);
when(bootstrap.connect(address)).thenReturn(channelFuture);
co... | @Test
public void isConnected_afterSuccessfulConnect_returnsTrue() throws IOException {
<DeepExtract>
when(channelFuture.syncUninterruptibly()).thenReturn(channelFuture);
when(channelFuture.isSuccess()).thenReturn(true);
when(channelFuture.channel()).thenReturn(channel);
when(bootstrap.connect(address)).thenReturn(chan... | waterrower-core | positive | 2,002 |
@Override
public void assertFalse(boolean value) {
assertTrue(!value, "");
} | @Override
public void assertFalse(boolean value) {
<DeepExtract>
assertTrue(!value, "");
</DeepExtract>
} | parse4cn1 | positive | 2,003 |
private void updateAnimation(float factor) {
float initial = mAnimationInitialValue;
float destination = mReverse ? 0f : 1f;
mCurrentScale = initial + (destination - initial) * factor;
final float currentScale = mCurrentScale;
final Path path = mPath;
final RectF rect = mRect;
final Matrix matrix = mMatrix;
path.reset(... | private void updateAnimation(float factor) {
float initial = mAnimationInitialValue;
float destination = mReverse ? 0f : 1f;
mCurrentScale = initial + (destination - initial) * factor;
<DeepExtract>
final float currentScale = mCurrentScale;
final Path path = mPath;
final RectF rect = mRect;
final Matrix matrix = mMatri... | FaceUnityLegacy | positive | 2,004 |
@Override
public void apply(@Nonnull MockServerBuilder serverBuilder, @Nonnull AtomicInteger cnt) {
return withAddress("43.43.43." + cnt.incrementAndGet(), 4, "fixed");
} | @Override
public void apply(@Nonnull MockServerBuilder serverBuilder, @Nonnull AtomicInteger cnt) {
<DeepExtract>
return withAddress("43.43.43." + cnt.incrementAndGet(), 4, "fixed");
</DeepExtract>
} | openstack-cloud-plugin | positive | 2,005 |
public Criteria andUserEmailBetween(String value1, String value2) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "userEmail" + " cannot be null");
}
criteria.add(new Criterion("USER_EMAIL between", value1, value2));
return (Criteria) this;
} | public Criteria andUserEmailBetween(String value1, String value2) {
<DeepExtract>
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "userEmail" + " cannot be null");
}
criteria.add(new Criterion("USER_EMAIL between", value1, value2));
</DeepExtract>
return (Criteria) this;
} | console | positive | 2,006 |
private byte[] serializeStratioStreamingMessage(StratioStreamingMessage message) {
List<com.stratio.decision.commons.avro.ColumnType> columns = null;
if (message.getColumns() != null) {
columns = new java.util.ArrayList<>();
ColumnType c = null;
for (ColumnNameTypeValue messageColumn : message.getColumns()) {
c = new C... | private byte[] serializeStratioStreamingMessage(StratioStreamingMessage message) {
List<com.stratio.decision.commons.avro.ColumnType> columns = null;
if (message.getColumns() != null) {
columns = new java.util.ArrayList<>();
ColumnType c = null;
for (ColumnNameTypeValue messageColumn : message.getColumns()) {
c = new C... | Decision | positive | 2,007 |
public com.yangc.bridge.comm.protocol.protobuf.ProtobufMessage.Chat getDefaultInstanceForType() {
return defaultInstance;
} | public com.yangc.bridge.comm.protocol.protobuf.ProtobufMessage.Chat getDefaultInstanceForType() {
<DeepExtract>
return defaultInstance;
</DeepExtract>
} | com.yangc.hub | positive | 2,008 |
@Override
public boolean equals(final Object obj) {
if (this == obj)
return true;
if (!(obj instanceof TableKey))
return false;
final TableKey<?> that = (TableKey<?>) obj;
assert that != null;
return Objects.equals(pktableCatNonNull(), that.pktableCatNonNull()) && Objects.equals(pktableSchemNonNull(), that.pktableSchem... | @Override
public boolean equals(final Object obj) {
if (this == obj)
return true;
if (!(obj instanceof TableKey))
return false;
final TableKey<?> that = (TableKey<?>) obj;
<DeepExtract>
assert that != null;
return Objects.equals(pktableCatNonNull(), that.pktableCatNonNull()) && Objects.equals(pktableSchemNonNull(), tha... | database-metadata-bind | positive | 2,009 |
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_equalizer, container, false);
Wave mWave = (Wave) (ViewGroup) view.findViewById(R.id.waveEqualizer);
mWave.setAboveWaveColor(0xffffffff);
mWave.setBlowWaveColor(0x... | @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_equalizer, container, false);
<DeepExtract>
Wave mWave = (Wave) (ViewGroup) view.findViewById(R.id.waveEqualizer);
mWave.setAboveWaveColor(0xffffffff);
mWave.setBl... | IdealMedia | positive | 2,010 |
@Test
public void test2CC() throws ContradictionException {
GraphModel m = new GraphModel();
int nb = 6;
UndirectedGraph GLB = new UndirectedGraph(m, nb, SetType.BITSET, false);
UndirectedGraph GUB = new UndirectedGraph(m, nb, SetType.BITSET, false);
for (int i : new int[] { 0, 3 }) GLB.addNode(i);
for (int i : new int... | @Test
public void test2CC() throws ContradictionException {
GraphModel m = new GraphModel();
int nb = 6;
UndirectedGraph GLB = new UndirectedGraph(m, nb, SetType.BITSET, false);
UndirectedGraph GUB = new UndirectedGraph(m, nb, SetType.BITSET, false);
for (int i : new int[] { 0, 3 }) GLB.addNode(i);
for (int i : new int... | choco-graph | positive | 2,012 |
public Criteria andSendtimeIsNull() {
if ("sendTime is null" == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion("sendTime is null"));
return (Criteria) this;
} | public Criteria andSendtimeIsNull() {
<DeepExtract>
if ("sendTime is null" == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion("sendTime is null"));
</DeepExtract>
return (Criteria) this;
} | webim | positive | 2,013 |
public Criteria andPhoneNotBetween(String value1, String value2) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "phone" + " cannot be null");
}
criteria.add(new Criterion("phone not between", value1, value2));
return (Criteria) this;
} | public Criteria andPhoneNotBetween(String value1, String value2) {
<DeepExtract>
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + "phone" + " cannot be null");
}
criteria.add(new Criterion("phone not between", value1, value2));
</DeepExtract>
return (Criteria) this;
} | health_online | positive | 2,014 |
public static void assertUpdate(SourceRecord record, String idValue) {
assertUpdate(record);
String actualOid = ((Struct) record.value()).getString("documentKey");
assertEquals(idValue, JsonPath.read(actualOid, "$._id.$oid"));
} | public static void assertUpdate(SourceRecord record, String idValue) {
assertUpdate(record);
<DeepExtract>
String actualOid = ((Struct) record.value()).getString("documentKey");
assertEquals(idValue, JsonPath.read(actualOid, "$._id.$oid"));
</DeepExtract>
} | flink-cdc-connectors | positive | 2,015 |
@Override
public org.w3c.dom.Node getNode(Object obj) throws JAXBException {
if (obj == null) {
throw new IllegalArgumentException(Messages.format(Messages.MUST_NOT_BE_NULL, "obj"));
}
if (Boolean.TRUE == null) {
throw new IllegalArgumentException(Messages.format(Messages.MUST_NOT_BE_NULL, "foo"));
}
throw new Unsuppor... | @Override
public org.w3c.dom.Node getNode(Object obj) throws JAXBException {
<DeepExtract>
if (obj == null) {
throw new IllegalArgumentException(Messages.format(Messages.MUST_NOT_BE_NULL, "obj"));
}
if (Boolean.TRUE == null) {
throw new IllegalArgumentException(Messages.format(Messages.MUST_NOT_BE_NULL, "foo"));
}
</De... | jaxb-api | positive | 2,017 |
private void workEvent(String line) {
logger.debug("Line for project evaluation{},line");
String project;
int indexOf = line.indexOf(PROJECT);
if (indexOf >= 0) {
indexOf += PROJECT.length();
indexOf = line.indexOf(':', indexOf);
indexOf = line.indexOf('"', indexOf);
indexOf++;
int nextSeparator = line.indexOf('/', ind... | private void workEvent(String line) {
logger.debug("Line for project evaluation{},line");
<DeepExtract>
String project;
int indexOf = line.indexOf(PROJECT);
if (indexOf >= 0) {
indexOf += PROJECT.length();
indexOf = line.indexOf(':', indexOf);
indexOf = line.indexOf('"', indexOf);
indexOf++;
int nextSeparator = line.in... | gerrit-events | positive | 2,018 |
public <T> ResponseEntity<T> createOkResponse(T body) {
return new ResponseEntity<>(body, HttpStatus.OK);
} | public <T> ResponseEntity<T> createOkResponse(T body) {
<DeepExtract>
return new ResponseEntity<>(body, HttpStatus.OK);
</DeepExtract>
} | Mastering-Microservices-with-Java-9-Second-Edition | positive | 2,019 |
@Test
public void getMode_throwsIfClosed() throws IOException {
Mma7660Fc driver = new Mma7660Fc(mI2c);
Mma7660Fc driver = new Mma7660Fc(mI2c);
driver.close();
Mockito.verify(mI2c).close();
mExpectedException.expect(IllegalStateException.class);
Mma7660Fc driver = new Mma7660Fc(mI2c);
driver.getMode();
Mockito.verify(m... | @Test
public void getMode_throwsIfClosed() throws IOException {
Mma7660Fc driver = new Mma7660Fc(mI2c);
Mma7660Fc driver = new Mma7660Fc(mI2c);
driver.close();
Mockito.verify(mI2c).close();
mExpectedException.expect(IllegalStateException.class);
<DeepExtract>
Mma7660Fc driver = new Mma7660Fc(mI2c);
driver.getMode();
Mo... | contrib-drivers | positive | 2,020 |
public void startTimer(int interval, String name) {
name = name.intern();
if (timers.containsKey(name)) {
System.out.println("already has timer " + name);
return;
}
Timer t = new Timer(interval, this);
t.start();
timers.put(name, t);
if (t instanceof JComponent) {
((JComponent) t).putClientProperty("name", name);
} els... | public void startTimer(int interval, String name) {
name = name.intern();
if (timers.containsKey(name)) {
System.out.println("already has timer " + name);
return;
}
Timer t = new Timer(interval, this);
t.start();
timers.put(name, t);
<DeepExtract>
if (t instanceof JComponent) {
((JComponent) t).putClientProperty("name"... | CaroOnline_SocketJava | positive | 2,021 |
protected void printFreeAttributesHeaderDecl(String cppName) {
privateImplHeaderFile.print("bool");
privateImplHeaderFile.print(" ");
privateImplHeaderFile.print(Util.createFreeAttributesMethodName(cppName));
privateImplHeaderFile.print("( void* " + config.getAttributeDataParameterName() + " )");
privateImplHeaderFile.... | protected void printFreeAttributesHeaderDecl(String cppName) {
privateImplHeaderFile.print("bool");
privateImplHeaderFile.print(" ");
privateImplHeaderFile.print(Util.createFreeAttributesMethodName(cppName));
<DeepExtract>
privateImplHeaderFile.print("( void* " + config.getAttributeDataParameterName() + " )");
</DeepEx... | OpenCOLLADA | positive | 2,022 |
public Nar askNow(final String termString, final AnswerHandler answered) throws Parser.InvalidInputException {
final Sentence sentenceForNewTask = new Sentence(new Narsese(this).parseTerm(termString), Symbols.QUESTION_MARK, null, new Stamp(this, memory, Tense.Present));
final BudgetValue budgetForNewTask = new BudgetVa... | public Nar askNow(final String termString, final AnswerHandler answered) throws Parser.InvalidInputException {
final Sentence sentenceForNewTask = new Sentence(new Narsese(this).parseTerm(termString), Symbols.QUESTION_MARK, null, new Stamp(this, memory, Tense.Present));
final BudgetValue budgetForNewTask = new BudgetVa... | opennars | positive | 2,024 |
public static String docTitle(String docTitle) {
if (docTitle == null || "".equals(docTitle.toString().trim())) {
return "";
}
StringBuilder adocAttr = new StringBuilder();
adocAttr.append(":");
if (Boolean.class.isAssignableFrom(docTitle.getClass())) {
boolean bool = Boolean.parseBoolean(docTitle.toString());
if (!boo... | public static String docTitle(String docTitle) {
<DeepExtract>
if (docTitle == null || "".equals(docTitle.toString().trim())) {
return "";
}
StringBuilder adocAttr = new StringBuilder();
adocAttr.append(":");
if (Boolean.class.isAssignableFrom(docTitle.getClass())) {
boolean bool = Boolean.parseBoolean(docTitle.toStrin... | cukedoctor | positive | 2,025 |
public static void setupVertex(RenderBlocks renderBlocks, double x, double y, double z, double u, double v, int vertex) {
Tessellator tessellator = Tessellator.instance;
if (renderBlocks != null && renderBlocks.enableAO) {
switch(vertex) {
case BOTTOM_CENTER:
tessellator.setColorOpaque_F((renderBlocks.colorRedBottomLef... | public static void setupVertex(RenderBlocks renderBlocks, double x, double y, double z, double u, double v, int vertex) {
Tessellator tessellator = Tessellator.instance;
if (renderBlocks != null && renderBlocks.enableAO) {
switch(vertex) {
case BOTTOM_CENTER:
tessellator.setColorOpaque_F((renderBlocks.colorRedBottomLef... | carpentersblocks | positive | 2,027 |
public void bezier(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4) {
beginShape(POLYGON);
vertexCheck();
float[] vertex = vertices[vertexCount];
if (shapeMode == POLYGON) {
if (vertexCount > 0) {
float[] pvertex = vertices[vertexCount - 1];
if ((Ma... | public void bezier(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4) {
beginShape(POLYGON);
vertexCheck();
float[] vertex = vertices[vertexCount];
if (shapeMode == POLYGON) {
if (vertexCount > 0) {
float[] pvertex = vertices[vertexCount - 1];
if ((Ma... | rainbow | positive | 2,028 |
public double[] getArray() {
double[] weights = new double[inputs.length * hiddenNeurons.length + hiddenNeurons.length * outputs.length];
int k = 0;
for (int i = 0; i < inputs.length; i++) {
for (int j = 0; j < hiddenNeurons.length; j++) {
weights[k] = firstConnectionLayer[i][j];
k++;
}
}
for (int i = 0; i < hiddenNeur... | public double[] getArray() {
<DeepExtract>
double[] weights = new double[inputs.length * hiddenNeurons.length + hiddenNeurons.length * outputs.length];
int k = 0;
for (int i = 0; i < inputs.length; i++) {
for (int j = 0; j < hiddenNeurons.length; j++) {
weights[k] = firstConnectionLayer[i][j];
k++;
}
}
for (int i = 0; ... | MCTSMario | positive | 2,029 |
@Override
public Integer component3() {
return (Integer) get(2);
} | @Override
public Integer component3() {
<DeepExtract>
return (Integer) get(2);
</DeepExtract>
} | openvsx | positive | 2,030 |
private void setUpSendButton() {
sendSMS = (ImageButton) this.findViewById(R.id.new_message_send);
if (currentActivity == ConversationView.MESSAGE_VIEW) {
if (message == null || message.length() == 0) {
Number number = dba.getNumber(selectedNumber);
message = number.getDraft();
}
EditText et = (EditText) findViewById(R... | private void setUpSendButton() {
sendSMS = (ImageButton) this.findViewById(R.id.new_message_send);
<DeepExtract>
if (currentActivity == ConversationView.MESSAGE_VIEW) {
if (message == null || message.length() == 0) {
Number number = dba.getNumber(selectedNumber);
message = number.getDraft();
}
EditText et = (EditText) ... | tinfoil-sms | positive | 2,031 |
@Override
public void setReadOnly(boolean readOnly) throws SQLException {
if (isClosed) {
throw new SQLException("No operations allowed after connection closed. you should to use a new connection");
}
if (autoCommit) {
throw new SQLException("This method cannot be called during a transaction");
} else {
this.isReadOnly... | @Override
public void setReadOnly(boolean readOnly) throws SQLException {
<DeepExtract>
if (isClosed) {
throw new SQLException("No operations allowed after connection closed. you should to use a new connection");
}
</DeepExtract>
if (autoCommit) {
throw new SQLException("This method cannot be called during a transactio... | dragon | positive | 2,032 |
public ParamSpannableStringBuilder addTextAsParam(String text, int paramIndex, Object... spans) {
int start = mBuilder.length();
mBuilder.append(text);
int end = mBuilder.length();
for (Object span : spans) {
mBuilder.setSpan(span, start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}
return this;
if (paramIndex < mParams.l... | public ParamSpannableStringBuilder addTextAsParam(String text, int paramIndex, Object... spans) {
int start = mBuilder.length();
mBuilder.append(text);
int end = mBuilder.length();
<DeepExtract>
for (Object span : spans) {
mBuilder.setSpan(span, start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
}
return this;
</DeepExtrac... | Utils-Everywhere | positive | 2,033 |
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
SafeAppendable builder = new SafeAppendable(sb);
if (statementType == null) {
return null;
}
String answer;
switch(statementType) {
case DELETE:
answer = deleteSQL(builder);
break;
case INSERT:
answer = insertSQL(builder);
break;
case SELECT:
... | @Override
public String toString() {
StringBuilder sb = new StringBuilder();
<DeepExtract>
SafeAppendable builder = new SafeAppendable(sb);
if (statementType == null) {
return null;
}
String answer;
switch(statementType) {
case DELETE:
answer = deleteSQL(builder);
break;
case INSERT:
answer = insertSQL(builder);
break;... | EasyJdbc | positive | 2,034 |
public void addComment(Comment comment) {
comments.add(comment);
this.post = this;
} | public void addComment(Comment comment) {
comments.add(comment);
<DeepExtract>
this.post = this;
</DeepExtract>
} | hibernate-master-class | positive | 2,035 |
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
mCurrentConversation = intent.getParcelableExtra(BUNDLE_CURRENT_CONVERSATION);
if (mCurrentConversation == null) {
finish();
}
mCurrentContact = mProfileManager.get(mCurrentConversation.getContactId());
ChatHandler.setCurrentVisibleChannel... | @Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
mCurrentConversation = intent.getParcelableExtra(BUNDLE_CURRENT_CONVERSATION);
if (mCurrentConversation == null) {
finish();
}
mCurrentContact = mProfileManager.get(mCurrentConversation.getContactId());
ChatHandler.setCurrentVisibleChannel... | profile-sync | positive | 2,036 |
public Criteria andWeiboGreaterThan(String value) {
if (value == null) {
throw new RuntimeException("Value for " + "weibo" + " cannot be null");
}
criteria.add(new Criterion("weibo >", value));
return (Criteria) this;
} | public Criteria andWeiboGreaterThan(String value) {
<DeepExtract>
if (value == null) {
throw new RuntimeException("Value for " + "weibo" + " cannot be null");
}
criteria.add(new Criterion("weibo >", value));
</DeepExtract>
return (Criteria) this;
} | CRM | positive | 2,037 |
public AbstractNode get(int index) {
if (index < 0 || index > size() - 1) {
throw new IndexOutOfBoundsException("Invalid index:" + index + ", size=" + size());
}
return value;
} | public AbstractNode get(int index) {
if (index < 0 || index > size() - 1) {
throw new IndexOutOfBoundsException("Invalid index:" + index + ", size=" + size());
}
<DeepExtract>
return value;
</DeepExtract>
} | BitcoinVisualizer | positive | 2,040 |
@Override
public FBPParticleDigging init() {
if (sourceState.getBlock() == Blocks.GRASS && facing != EnumFacing.UP)
return;
int i = mc.getBlockColors().colorMultiplier(this.sourceState, this.world, new BlockPos(this.posX, this.posY, this.posZ), 0);
this.particleRed *= (i >> 16 & 255) / 255.0F;
this.particleGreen *= (i ... | @Override
public FBPParticleDigging init() {
<DeepExtract>
if (sourceState.getBlock() == Blocks.GRASS && facing != EnumFacing.UP)
return;
int i = mc.getBlockColors().colorMultiplier(this.sourceState, this.world, new BlockPos(this.posX, this.posY, this.posZ), 0);
this.particleRed *= (i >> 16 & 255) / 255.0F;
this.partic... | FancyBlockParticles | positive | 2,041 |
private boolean handleSearchResult(@NonNull @SuppressWarnings("unused") YTVideoListTask ytvl, @NonNull @SuppressWarnings("unused") YTDataAdapter.VideoListReq req, @NonNull YTDataAdapter.VideoListResp resp, @NonNull Err err) {
P.bug(AUtil.isUiThread());
if (Err.NO_ERR == err && resp.vids.length <= 0)
err = Err.NO_MATCH;... | private boolean handleSearchResult(@NonNull @SuppressWarnings("unused") YTVideoListTask ytvl, @NonNull @SuppressWarnings("unused") YTDataAdapter.VideoListReq req, @NonNull YTDataAdapter.VideoListResp resp, @NonNull Err err) {
P.bug(AUtil.isUiThread());
if (Err.NO_ERR == err && resp.vids.length <= 0)
err = Err.NO_MATCH;... | netmbuddy | positive | 2,042 |
public void setLastJar(MinecraftJar jar) {
this.lastJar = jar instanceof DefaultJar ? null : jar.getName();
} | public void setLastJar(MinecraftJar jar) {
<DeepExtract>
this.lastJar = jar instanceof DefaultJar ? null : jar.getName();
</DeepExtract>
} | SKMCLauncher | positive | 2,043 |
@Test
public void testTransfer() throws InterruptedException {
SubAccount subAccountFrom = subAccountRepository.findById(1L);
subAccountFrom.setBalanceAmount(100);
subAccountFrom.setStatus(AccountStatus.NORMAL.getId());
SubAccount subAccountTo = subAccountRepository.findById(2L);
subAccountTo.setBalanceAmount(200);
sub... | @Test
public void testTransfer() throws InterruptedException {
<DeepExtract>
SubAccount subAccountFrom = subAccountRepository.findById(1L);
subAccountFrom.setBalanceAmount(100);
subAccountFrom.setStatus(AccountStatus.NORMAL.getId());
SubAccount subAccountTo = subAccountRepository.findById(2L);
subAccountTo.setBalanceAm... | tyloo | positive | 2,044 |
@Override
public double regress(Instance instance) {
double pred = intercept + w[0] * instance.getValue(attIndex) + w[1] * instance.getValue(attIndex) * instance.getValue(attIndex) + w[2] * instance.getValue(attIndex) * instance.getValue(attIndex) * instance.getValue(attIndex);
for (int i = 0; i < knots.length; i++) {
... | @Override
public double regress(Instance instance) {
<DeepExtract>
double pred = intercept + w[0] * instance.getValue(attIndex) + w[1] * instance.getValue(attIndex) * instance.getValue(attIndex) + w[2] * instance.getValue(attIndex) * instance.getValue(attIndex) * instance.getValue(attIndex);
for (int i = 0; i < knots.l... | mltk | positive | 2,045 |
private void scrollView(float distanceX, float distanceY) {
int newX = (int) distanceX + getScrollX();
int newY = (int) distanceY + getScrollY();
int maxWidth = Math.max(getMaxScrollX(), getScrollX());
if (newX > maxWidth) {
newX = maxWidth;
} else if (newX < 0) {
newX = 0;
}
int maxHeight = Math.max(getMaxScrollY(), g... | private void scrollView(float distanceX, float distanceY) {
int newX = (int) distanceX + getScrollX();
int newY = (int) distanceY + getScrollY();
int maxWidth = Math.max(getMaxScrollX(), getScrollX());
if (newX > maxWidth) {
newX = maxWidth;
} else if (newX < 0) {
newX = 0;
}
int maxHeight = Math.max(getMaxScrollY(), g... | ALuaJ | positive | 2,046 |
public void actionPerformed(java.awt.event.ActionEvent evt) {
AbstractButton abstractButton = (AbstractButton) evt.getSource();
boolean selected = abstractButton.getModel().isSelected();
if (selected) {
panelInteranlCustomSet.setVisible(true);
mannualRange = true;
populateColoumnList();
} else {
clearTogglePane();
}
} | public void actionPerformed(java.awt.event.ActionEvent evt) {
<DeepExtract>
AbstractButton abstractButton = (AbstractButton) evt.getSource();
boolean selected = abstractButton.getModel().isSelected();
if (selected) {
panelInteranlCustomSet.setVisible(true);
mannualRange = true;
populateColoumnList();
} else {
clearTogg... | HBase-Manager | positive | 2,047 |
public String getFcmToken() {
return mPrefs.getString(FCM_TOKEN, null);
} | public String getFcmToken() {
<DeepExtract>
return mPrefs.getString(FCM_TOKEN, null);
</DeepExtract>
} | kalium-android-wallet | positive | 2,048 |
@Override
protected void seekInternal(InternalKey targetKey) {
for (InternalIterator level : levels) {
level.seek(targetKey);
}
int i = 1;
for (InternalIterator level : levels) {
if (level.hasNext()) {
priorityQueue.add(new ComparableIterator(level, comparator, i++, level.next()));
}
}
} | @Override
protected void seekInternal(InternalKey targetKey) {
for (InternalIterator level : levels) {
level.seek(targetKey);
}
<DeepExtract>
int i = 1;
for (InternalIterator level : levels) {
if (level.hasNext()) {
priorityQueue.add(new ComparableIterator(level, comparator, i++, level.next()));
}
}
</DeepExtract>
} | leveldb | positive | 2,049 |
public static void main(String[] args) {
App baz = new App();
this.<Boolean>bar();
System.out.println("worked well");
} | public static void main(String[] args) {
App baz = new App();
<DeepExtract>
this.<Boolean>bar();
</DeepExtract>
System.out.println("worked well");
} | javancss | positive | 2,050 |
public void populateYeastFromRecipe(View parent, Yeast yeast, int packsAccountedFor) {
TextView view = (TextView) parent.findViewById(R.id.inventory_message);
view.setVisibility(View.GONE);
ImageView check = (ImageView) parent.findViewById(R.id.check);
check.setVisibility(View.GONE);
double inInventory = mStorage.retri... | public void populateYeastFromRecipe(View parent, Yeast yeast, int packsAccountedFor) {
TextView view = (TextView) parent.findViewById(R.id.inventory_message);
view.setVisibility(View.GONE);
ImageView check = (ImageView) parent.findViewById(R.id.check);
check.setVisibility(View.GONE);
double inInventory = mStorage.retri... | BrewShopApp | positive | 2,051 |
public void smoothOpenRightMenu() {
mSwipeMenuLayout.smoothOpenMenu(SwipeDirection.RIGHT);
} | public void smoothOpenRightMenu() {
<DeepExtract>
mSwipeMenuLayout.smoothOpenMenu(SwipeDirection.RIGHT);
</DeepExtract>
} | OmegaRecyclerView | positive | 2,052 |
public int[] mergeSort(int[] nums) {
if (nums == null || nums.length < 2) {
return new int[0];
}
if (0 == nums.length - 1) {
return;
}
int mid = 0 + ((nums.length - 1 - 0) >> 1);
sortProcess(nums, 0, mid);
sortProcess(nums, mid + 1, nums.length - 1);
merge(nums, 0, mid, nums.length - 1);
return nums;
} | public int[] mergeSort(int[] nums) {
if (nums == null || nums.length < 2) {
return new int[0];
}
<DeepExtract>
if (0 == nums.length - 1) {
return;
}
int mid = 0 + ((nums.length - 1 - 0) >> 1);
sortProcess(nums, 0, mid);
sortProcess(nums, mid + 1, nums.length - 1);
merge(nums, 0, mid, nums.length - 1);
</DeepExtract>
re... | LeetCodeAndSwordToOffer | positive | 2,053 |
@Override
public void onSmoothScrollFinished() {
if (null != mCurrentSmoothScrollRunnable) {
mCurrentSmoothScrollRunnable.stop();
}
final int oldScrollValue;
switch(getPullToRefreshScrollDirection()) {
case HORIZONTAL:
oldScrollValue = getScrollX();
break;
case VERTICAL:
default:
oldScrollValue = getScrollY();
break;
}... | @Override
public void onSmoothScrollFinished() {
<DeepExtract>
if (null != mCurrentSmoothScrollRunnable) {
mCurrentSmoothScrollRunnable.stop();
}
final int oldScrollValue;
switch(getPullToRefreshScrollDirection()) {
case HORIZONTAL:
oldScrollValue = getScrollX();
break;
case VERTICAL:
default:
oldScrollValue = getScrol... | MingQQ | positive | 2,054 |
@Override
public double getCharge(ItemStack itemStack) {
Long[] stats = getElectricStats(itemStack);
if (stats == null) {
return 0;
}
NBTTagCompound data = TGregUtils.getCompoundTag(itemStack, "TGregBattery");
return data == null ? 0 : data.getLong("currentCharge");
} | @Override
public double getCharge(ItemStack itemStack) {
<DeepExtract>
Long[] stats = getElectricStats(itemStack);
if (stats == null) {
return 0;
}
NBTTagCompound data = TGregUtils.getCompoundTag(itemStack, "TGregBattery");
return data == null ? 0 : data.getLong("currentCharge");
</DeepExtract>
} | TinkersGregworks | positive | 2,055 |
@Override
public E remove() {
final Node<E> f = first;
if (f == null) {
throw new NoSuchElementException();
}
return unlinkFirst(f);
} | @Override
public E remove() {
<DeepExtract>
final Node<E> f = first;
if (f == null) {
throw new NoSuchElementException();
}
return unlinkFirst(f);
</DeepExtract>
} | java-Kcp | positive | 2,056 |
@Override
public Matrix addColumnVector(final Matrix vector) {
if (!(vector instanceof MatrixJBLASImpl)) {
throw new IllegalArgumentException("The given matrix should be JBLAS based");
}
return new MatrixJBLASImpl(jblasMatrix.addColumnVector(((MatrixJBLASImpl) vector).jblasMatrix));
} | @Override
public Matrix addColumnVector(final Matrix vector) {
<DeepExtract>
if (!(vector instanceof MatrixJBLASImpl)) {
throw new IllegalArgumentException("The given matrix should be JBLAS based");
}
</DeepExtract>
return new MatrixJBLASImpl(jblasMatrix.addColumnVector(((MatrixJBLASImpl) vector).jblasMatrix));
} | dolphin | positive | 2,057 |
@Override
public void doReconnect(SocketConnection connection) {
try {
connect();
} catch (Exception e) {
notifyConnectException(e);
}
} | @Override
public void doReconnect(SocketConnection connection) {
<DeepExtract>
try {
connect();
} catch (Exception e) {
notifyConnectException(e);
}
</DeepExtract>
} | bizsocket | positive | 2,058 |
void smoothScrollTo(int x, int y, int velocity) {
if (getChildCount() == 0) {
setScrollingCacheEnabled(false);
return;
}
int sx = getScrollX();
int sy = getScrollY();
int dx = x - sx;
int dy = y - sy;
if (dx == 0 && dy == 0) {
completeScroll();
if (isMenuOpen()) {
if (mOpenedListener != null)
mOpenedListener.onOpened()... | void smoothScrollTo(int x, int y, int velocity) {
if (getChildCount() == 0) {
setScrollingCacheEnabled(false);
return;
}
int sx = getScrollX();
int sy = getScrollY();
int dx = x - sx;
int dy = y - sy;
if (dx == 0 && dy == 0) {
completeScroll();
if (isMenuOpen()) {
if (mOpenedListener != null)
mOpenedListener.onOpened()... | LeaugeBar_Android | positive | 2,059 |
@Override
public void windowClosed(WindowEvent arg0) {
listener.close();
} | @Override
public void windowClosed(WindowEvent arg0) {
<DeepExtract>
listener.close();
</DeepExtract>
} | Towel | positive | 2,060 |
private void updateHelpRequested(CommandSpec command) {
return (isHelpCommand == null) ? DEFAULT_IS_HELP_COMMAND : isHelpCommand;
} | private void updateHelpRequested(CommandSpec command) {
<DeepExtract>
return (isHelpCommand == null) ? DEFAULT_IS_HELP_COMMAND : isHelpCommand;
</DeepExtract>
} | eclipstyle | positive | 2,061 |
public Criteria andAphoneIn(List<String> values) {
if (values == null) {
throw new RuntimeException("Value for " + "aphone" + " cannot be null");
}
criteria.add(new Criterion("aphone in", values));
return (Criteria) this;
} | public Criteria andAphoneIn(List<String> values) {
<DeepExtract>
if (values == null) {
throw new RuntimeException("Value for " + "aphone" + " cannot be null");
}
criteria.add(new Criterion("aphone in", values));
</DeepExtract>
return (Criteria) this;
} | Hospital | positive | 2,062 |
public void setStrokeColor(int strokeColor) {
this.strokeColor = strokeColor;
StateListDrawable bg = new StateListDrawable();
setDrawable(gd_background, backgroundColor, strokeColor);
bg.addState(new int[] { -android.R.attr.state_pressed }, gd_background);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
... | public void setStrokeColor(int strokeColor) {
this.strokeColor = strokeColor;
<DeepExtract>
StateListDrawable bg = new StateListDrawable();
setDrawable(gd_background, backgroundColor, strokeColor);
bg.addState(new int[] { -android.R.attr.state_pressed }, gd_background);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.... | Shopping | positive | 2,063 |
public void onClick(View v) {
Intent openCameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
File file = new File(Environment.getExternalStorageDirectory() + "/myimage/", String.valueOf(System.currentTimeMillis()) + ".jpg");
path = file.getPath();
Uri imageUri = Uri.fromFile(file);
openCameraIntent.putExtra(Med... | public void onClick(View v) {
<DeepExtract>
Intent openCameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
File file = new File(Environment.getExternalStorageDirectory() + "/myimage/", String.valueOf(System.currentTimeMillis()) + ".jpg");
path = file.getPath();
Uri imageUri = Uri.fromFile(file);
openCameraInten... | mshopping-android | positive | 2,064 |
@Override
public void onCreateActions(List<GuidedAction> actions, Bundle savedInstanceState) {
actions.add(new GuidedAction.Builder().id(CONTINUE).title(getResources().getString(R.string.guidedstep_continue)).description(getResources().getString(R.string.guidedstep_letsdoit)).build());
actions.add(new GuidedAction.Buil... | @Override
public void onCreateActions(List<GuidedAction> actions, Bundle savedInstanceState) {
actions.add(new GuidedAction.Builder().id(CONTINUE).title(getResources().getString(R.string.guidedstep_continue)).description(getResources().getString(R.string.guidedstep_letsdoit)).build());
<DeepExtract>
actions.add(new Gui... | BuildingForAndroidTV | positive | 2,065 |
@Bean
public MapperScannerConfigurer mapperScannerConfigurer2() {
MapperScannerConfigurer mapperScannerConfigurer = new MapperScannerConfigurer();
mapperScannerConfigurer.setSqlSessionFactoryBeanName("sqlSessionFactory2");
mapperScannerConfigurer.setAnnotationClass(Mapper.class);
mapperScannerConfigurer.setBasePackage(... | @Bean
public MapperScannerConfigurer mapperScannerConfigurer2() {
<DeepExtract>
MapperScannerConfigurer mapperScannerConfigurer = new MapperScannerConfigurer();
mapperScannerConfigurer.setSqlSessionFactoryBeanName("sqlSessionFactory2");
mapperScannerConfigurer.setAnnotationClass(Mapper.class);
mapperScannerConfigurer.s... | enumdemo | positive | 2,066 |
@Override
public Store.CommandBuilder<C, T> map(Object parameters) {
checkState(m_valid, "This TransactionBuilder is no more usable");
if (parameters instanceof Map) {
Map<?, ?> map = (Map<?, ?>) parameters;
for (Map.Entry<?, ?> e : map.entrySet()) {
String key = (String) e.getKey();
setParameter(key, e.getValue());
}
... | @Override
public Store.CommandBuilder<C, T> map(Object parameters) {
<DeepExtract>
checkState(m_valid, "This TransactionBuilder is no more usable");
</DeepExtract>
if (parameters instanceof Map) {
Map<?, ?> map = (Map<?, ?>) parameters;
for (Map.Entry<?, ?> e : map.entrySet()) {
String key = (String) e.getKey();
setPar... | iron | positive | 2,067 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.