before
stringlengths
12
3.21M
after
stringlengths
41
3.21M
repo
stringlengths
1
56
type
stringclasses
1 value
__index_level_0__
int64
0
442k
@Override public void onInitializeClient() { try { Path file = FabricLoader.getInstance().getConfigDir().resolve("libgui.json5"); if (Files.notExists(file)) saveConfig(new LibGuiConfig()); JsonObject json; try (InputStream in = Files.newInputStream(file)) { json = jankson.load(in); } config = jankson.fromJson(json, Lib...
@Override public void onInitializeClient() { <DeepExtract> try { Path file = FabricLoader.getInstance().getConfigDir().resolve("libgui.json5"); if (Files.notExists(file)) saveConfig(new LibGuiConfig()); JsonObject json; try (InputStream in = Files.newInputStream(file)) { json = jankson.load(in); } config = jankson.from...
LibGui
positive
5,473
public Builder filename(String filename, long partSize) throws IOException { validateNotEmptyString(filename, "filename"); if (!Files.isRegularFile(Paths.get(filename))) { throw new IllegalArgumentException(filename + " not a regular file"); } final long objectSize = Files.size(Paths.get(filename)); long[] partinfo = g...
public Builder filename(String filename, long partSize) throws IOException { <DeepExtract> validateNotEmptyString(filename, "filename"); if (!Files.isRegularFile(Paths.get(filename))) { throw new IllegalArgumentException(filename + " not a regular file"); } </DeepExtract> final long objectSize = Files.size(Paths.get(fi...
minio-java
positive
5,474
@Test public void testCreateCookie() { String cookieName = "testCookie"; String cookieValue = "testCookieValue"; HttpPost request = new HttpPost(DEFAULT_HOST_URL + "/setCookie?cookieName=" + cookieName + "&cookieValue=" + cookieValue); try { HttpResponse response = httpClient.execute(request); assertEquals(200, respons...
@Test public void testCreateCookie() { String cookieName = "testCookie"; String cookieValue = "testCookieValue"; HttpPost request = new HttpPost(DEFAULT_HOST_URL + "/setCookie?cookieName=" + cookieName + "&cookieValue=" + cookieValue); try { HttpResponse response = httpClient.execute(request); assertEquals(200, respons...
spark
positive
5,475
public Criteria andTry_countLessThan(Integer value) { if (value == null) { throw new RuntimeException("Value for " + "try_count" + " cannot be null"); } criteria.add(new Criterion("try_count <", value)); return (Criteria) this; }
public Criteria andTry_countLessThan(Integer value) { <DeepExtract> if (value == null) { throw new RuntimeException("Value for " + "try_count" + " cannot be null"); } criteria.add(new Criterion("try_count <", value)); </DeepExtract> return (Criteria) this; }
SpringBootLearning
positive
5,476
@Test public void noToKeyDoesNotAlterContext() throws Exception { command.setFromKey("one"); assertEquals(Processing.CONTINUE, command.execute(context)); assertEquals(originalContext, context); }
@Test public void noToKeyDoesNotAlterContext() throws Exception { command.setFromKey("one"); <DeepExtract> assertEquals(Processing.CONTINUE, command.execute(context)); </DeepExtract> assertEquals(originalContext, context); }
commons-chain
positive
5,477
public static KeyPair generatePair() { KeyPairGenerator keyGen = null; try { keyGen = KeyPairGenerator.getInstance("RSA"); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } keyGen.initialize(2048); return keyGen.generateKeyPair(); }
public static KeyPair generatePair() { <DeepExtract> KeyPairGenerator keyGen = null; try { keyGen = KeyPairGenerator.getInstance("RSA"); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } keyGen.initialize(2048); return keyGen.generateKeyPair(); </DeepExtract> }
oauth2-server
positive
5,478
private void setGeometry(int index, int value) { if (!geometry_.isModifiable()) { geometry_ = com.google.protobuf.GeneratedMessageLite.mutableCopy(geometry_); } geometry_.setInt(index, value); }
private void setGeometry(int index, int value) { <DeepExtract> if (!geometry_.isModifiable()) { geometry_ = com.google.protobuf.GeneratedMessageLite.mutableCopy(geometry_); } </DeepExtract> geometry_.setInt(index, value); }
carma-cloud
positive
5,479
public Criteria andUsernameLessThan(String value) { if (value == null) { throw new RuntimeException("Value for " + "username" + " cannot be null"); } criteria.add(new Criterion("username <", value)); return (Criteria) this; }
public Criteria andUsernameLessThan(String value) { <DeepExtract> if (value == null) { throw new RuntimeException("Value for " + "username" + " cannot be null"); } criteria.add(new Criterion("username <", value)); </DeepExtract> return (Criteria) this; }
garbage-collection
positive
5,480
public String getLabel() throws UnsupportedOperationException { if (!isRoot()) { throw new UnsupportedOperationException("only supported on root directories"); } return volumeLabel; }
public String getLabel() throws UnsupportedOperationException { <DeepExtract> if (!isRoot()) { throw new UnsupportedOperationException("only supported on root directories"); } </DeepExtract> return volumeLabel; }
fat32-lib
positive
5,481
protected void finalize() { if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; globalJNI.delete_BinaryRelation(swigCPtr); } swigCPtr = 0; } }
protected void finalize() { <DeepExtract> if (swigCPtr != 0) { if (swigCMemOwn) { swigCMemOwn = false; globalJNI.delete_BinaryRelation(swigCPtr); } swigCPtr = 0; } </DeepExtract> }
TextAnalyzer
positive
5,482
public static boolean assignment_statement(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "assignment_statement")) return false; Marker m = enter_section_(b, l, _NONE_, ASSIGNMENT_STATEMENT, "<assignment statement>"); if (!recursion_guard_(b, l + 1, "assignment_statement_0")) r = false; private_command(b, l + 1 + 1...
public static boolean assignment_statement(PsiBuilder b, int l) { if (!recursion_guard_(b, l, "assignment_statement")) return false; Marker m = enter_section_(b, l, _NONE_, ASSIGNMENT_STATEMENT, "<assignment statement>"); <DeepExtract> if (!recursion_guard_(b, l + 1, "assignment_statement_0")) r = false; private_comman...
arma-intellij-plugin
positive
5,483
public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields; switch(fieldId) { case 1: fields = QUEUE_NAME; case 2: fields = ITEMS; case 3: fields = EXPIRATION_MSEC; default: fields = null; } if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; }
public static _Fields findByThriftIdOrThrow(int fieldId) { <DeepExtract> _Fields fields; switch(fieldId) { case 1: fields = QUEUE_NAME; case 2: fields = ITEMS; case 3: fields = EXPIRATION_MSEC; default: fields = null; } </DeepExtract> if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't...
storm-kestrel
positive
5,484
@Override protected void init(Bundle state) { Intent intent = getIntent(); String message = ""; photo = (File) intent.getSerializableExtra("photo"); message = intent.getStringExtra("message"); if (state != null) { if (photo == null) { photo = (File) state.getSerializable("photo"); } if (message == null) { message = sta...
@Override protected void init(Bundle state) { Intent intent = getIntent(); String message = ""; photo = (File) intent.getSerializableExtra("photo"); message = intent.getStringExtra("message"); if (state != null) { if (photo == null) { photo = (File) state.getSerializable("photo"); } if (message == null) { message = sta...
simplefacebook
positive
5,486
public void fitScreen() { Matrix save = mFitScreenMatrixBuffer; mViewPortHandler.fitScreen(save); mViewPortHandler.refresh(save, this, false); if (!mCustomViewPortEnabled) { float offsetLeft = 0f, offsetRight = 0f, offsetTop = 0f, offsetBottom = 0f; calculateLegendOffsets(mOffsetsBuffer); offsetLeft += mOffsetsBuffer.l...
public void fitScreen() { Matrix save = mFitScreenMatrixBuffer; mViewPortHandler.fitScreen(save); mViewPortHandler.refresh(save, this, false); <DeepExtract> if (!mCustomViewPortEnabled) { float offsetLeft = 0f, offsetRight = 0f, offsetTop = 0f, offsetBottom = 0f; calculateLegendOffsets(mOffsetsBuffer); offsetLeft += mO...
cgm-scanner
positive
5,487
public static void main(String[] args) { DEBUG_MODE_V = DebugMode.SCREEN; Log.initScreen(); if (DEBUG_MODE_V == DebugMode.SCREEN || DEBUG_MODE_V == DebugMode.FILE || DEBUG_MODE_V == DebugMode.EVERYWHERE) { Field[] options = getAllNonHiddenOptions(Config.class); printVerboseLine(); if (null != null && null.exists()) { p...
public static void main(String[] args) { DEBUG_MODE_V = DebugMode.SCREEN; Log.initScreen(); <DeepExtract> if (DEBUG_MODE_V == DebugMode.SCREEN || DEBUG_MODE_V == DebugMode.FILE || DEBUG_MODE_V == DebugMode.EVERYWHERE) { Field[] options = getAllNonHiddenOptions(Config.class); printVerboseLine(); if (null != null && null...
ekstazi
positive
5,488
public boolean setModuleScope(String packageName, String scopePackageName, int userId) { if (scopePackageName == null) return false; int mid; if (packageName.equals("lspd")) mid = -1; if (db.inTransaction()) { Log.w(TAG, "get module id should not be called inside transaction"); mid = -1; } try (Cursor cursor = db.query...
public boolean setModuleScope(String packageName, String scopePackageName, int userId) { if (scopePackageName == null) return false; int mid; if (packageName.equals("lspd")) mid = -1; if (db.inTransaction()) { Log.w(TAG, "get module id should not be called inside transaction"); mid = -1; } try (Cursor cursor = db.query...
LSPosed
positive
5,489
@Override public boolean onLongClick(View v) { callback.invoke($.with(v), eventData); EventCenter.unbind(event, this, null); return true; }
@Override public boolean onLongClick(View v) { <DeepExtract> callback.invoke($.with(v), eventData); EventCenter.unbind(event, this, null); </DeepExtract> return true; }
droidQuery
positive
5,490
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); this.head.rotateAngleX = f4 / 45f / (float) Math.PI; this.head.rotateAngleY = f3 / 45f / (float) Math.PI; this.footL.rotateA...
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); <DeepExtract> super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); this.head.rotateAngleX = f4 / 45f / (float) Math.PI; this.head.rotateAngleY = f3 / 45f / (float) Math.PI; this...
BakaInTouhou
positive
5,491
@Override public void testFloatArray(float[] v) throws Exception { MessagePack msgpack = new MessagePack(); Template<float[]> tmpl = FloatArrayTemplate.instance; ByteArrayOutputStream out = new ByteArrayOutputStream(); Packer packer = msgpack.createPacker(out); tmpl.write(packer, v); byte[] bytes = out.toByteArray(); B...
@Override public void testFloatArray(float[] v) throws Exception { MessagePack msgpack = new MessagePack(); Template<float[]> tmpl = FloatArrayTemplate.instance; ByteArrayOutputStream out = new ByteArrayOutputStream(); Packer packer = msgpack.createPacker(out); tmpl.write(packer, v); byte[] bytes = out.toByteArray(); B...
msgpack-java
positive
5,492
@Test public void testBufferPackUnpack() throws Exception { super.testLong(); }
@Test public void testBufferPackUnpack() throws Exception { <DeepExtract> super.testLong(); </DeepExtract> }
msgpack-java
positive
5,493
private void to(final String id) { currentIndex = 0; while (currentIndex < entriesView.size()) { final Entry<T> entry = entriesView.get(currentIndex); if (entry.id().equals(id)) { return; } ++currentIndex; } }
private void to(final String id) { <DeepExtract> currentIndex = 0; </DeepExtract> while (currentIndex < entriesView.size()) { final Entry<T> entry = entriesView.get(currentIndex); if (entry.id().equals(id)) { return; } ++currentIndex; } }
xoom-symbio
positive
5,494
public void showError() { if (mErrorView == null) { mVbError.setLayoutResource(mErrorLayoutId); mErrorView = mVbError.inflate(); TextView textError = mErrorView.findViewById(R.id.dialog_error_tv_id); if (textError != null && !TextUtils.isEmpty(mErrorTextStr)) { textError.setText(mErrorTextStr); } mErrorView.setOnClickL...
public void showError() { if (mErrorView == null) { mVbError.setLayoutResource(mErrorLayoutId); mErrorView = mVbError.inflate(); TextView textError = mErrorView.findViewById(R.id.dialog_error_tv_id); if (textError != null && !TextUtils.isEmpty(mErrorTextStr)) { textError.setText(mErrorTextStr); } mErrorView.setOnClickL...
AndroidStudy
positive
5,495
public static <E> void assertEqualElements(Collection<E> expected, Collection<E> actual) { expected.removeAll(actual); if (junit4) { org.junit.Assert.assertTrue("collections expected to contain the same elements, but didn't", expected.isEmpty()); } else { junit.framework.Assert.assertTrue("collections expected to conta...
public static <E> void assertEqualElements(Collection<E> expected, Collection<E> actual) { expected.removeAll(actual); <DeepExtract> if (junit4) { org.junit.Assert.assertTrue("collections expected to contain the same elements, but didn't", expected.isEmpty()); } else { junit.framework.Assert.assertTrue("collections exp...
droid-fu
positive
5,498
@Override public void openCamera() { Log.d(TAG, "openCamera cameraId: " + mCameraId); mCamera = Camera.open(mCameraId); mCameraInfo = new CameraInfo(); Camera.getCameraInfo(mCameraId, mCameraInfo); Log.v(TAG, "initConfig"); try { mParameters = mCamera.getParameters(); List<String> supportedFlashModes = mParameters.getS...
@Override public void openCamera() { Log.d(TAG, "openCamera cameraId: " + mCameraId); mCamera = Camera.open(mCameraId); mCameraInfo = new CameraInfo(); Camera.getCameraInfo(mCameraId, mCameraInfo); Log.v(TAG, "initConfig"); try { mParameters = mCamera.getParameters(); List<String> supportedFlashModes = mParameters.getS...
EasyOpengl
positive
5,499
@Override public final WatchKey poll(long timeout, TimeUnit unit) throws InterruptedException { if (closed.get()) throw new ClosedWatchServiceException(); if (CLOSE_KEY == pendingKeys.poll(timeout, unit)) pendingKeys.offer(pendingKeys.poll(timeout, unit)); checkOpen(); return pendingKeys.poll(timeout, unit); }
@Override public final WatchKey poll(long timeout, TimeUnit unit) throws InterruptedException { if (closed.get()) throw new ClosedWatchServiceException(); <DeepExtract> if (CLOSE_KEY == pendingKeys.poll(timeout, unit)) pendingKeys.offer(pendingKeys.poll(timeout, unit)); checkOpen(); return pendingKeys.poll(timeout, uni...
safs
positive
5,501
public Object visitAliasNode(AliasNode node) { hashCode = hashCode * 13 + 0; return this; }
public Object visitAliasNode(AliasNode node) { <DeepExtract> hashCode = hashCode * 13 + 0; return this; </DeepExtract> }
rsense
positive
5,503
public Criteria andBookTypeBetween(Integer value1, Integer value2) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + "bookType" + " cannot be null"); } criteria.add(new Criterion("book_type between", value1, value2)); return (Criteria) this; }
public Criteria andBookTypeBetween(Integer value1, Integer value2) { <DeepExtract> if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + "bookType" + " cannot be null"); } criteria.add(new Criterion("book_type between", value1, value2)); </DeepExtract> return (Criteria) this; }
Maven_SSM
positive
5,504
private void showTopology() { dataBox.clear(); groupLocationMap.clear(); for (Map.Entry<String, List<InstanceEntity>> entry : globalInstanceMap.entrySet()) { String serviceId = entry.getKey(); List<InstanceEntity> instances = entry.getValue(); addService(globalFilter, serviceId, instances); } List<TGroup> groups = TEle...
private void showTopology() { dataBox.clear(); groupLocationMap.clear(); for (Map.Entry<String, List<InstanceEntity>> entry : globalInstanceMap.entrySet()) { String serviceId = entry.getKey(); List<InstanceEntity> instances = entry.getValue(); addService(globalFilter, serviceId, instances); } <DeepExtract> List<TGroup>...
Discovery-redis
positive
5,505
public Criteria andLocationNotEqualTo(String value) { if (value == null) { throw new RuntimeException("Value for " + "location" + " cannot be null"); } criteria.add(new Criterion("location <>", value)); return (Criteria) this; }
public Criteria andLocationNotEqualTo(String value) { <DeepExtract> if (value == null) { throw new RuntimeException("Value for " + "location" + " cannot be null"); } criteria.add(new Criterion("location <>", value)); </DeepExtract> return (Criteria) this; }
emotional_analysis
positive
5,506
public String toAttributeString(double scale) { StringBuffer LineTypeOutput = new StringBuffer(); if (EleNum > 0) { if (true) LineTypeOutput.append(" stroke-dasharray=\""); else LineTypeOutput.append("stroke-dasharray:"); for (int i = 0; i < Dashs.size(); i++) { String tmp = (String) Dashs.get(i); double dash = Double....
public String toAttributeString(double scale) { <DeepExtract> StringBuffer LineTypeOutput = new StringBuffer(); if (EleNum > 0) { if (true) LineTypeOutput.append(" stroke-dasharray=\""); else LineTypeOutput.append("stroke-dasharray:"); for (int i = 0; i < Dashs.size(); i++) { String tmp = (String) Dashs.get(i); double ...
dxf2svg
positive
5,507
public static String getFormattedLatitude(double decimaldegrees) { switch(PreferenceHelper.getInstance().getDisplayLatLongFormat()) { case DEGREES_MINUTES_SECONDS: return getDegreesMinutesSeconds(decimaldegrees, true); case DEGREES_DECIMAL_MINUTES: return getDegreesDecimalMinutes(decimaldegrees, true); case DECIMAL_DEG...
public static String getFormattedLatitude(double decimaldegrees) { <DeepExtract> switch(PreferenceHelper.getInstance().getDisplayLatLongFormat()) { case DEGREES_MINUTES_SECONDS: return getDegreesMinutesSeconds(decimaldegrees, true); case DEGREES_DECIMAL_MINUTES: return getDegreesDecimalMinutes(decimaldegrees, true); ca...
gpslogger
positive
5,508
@Test public void shouldFailOnBadParent() throws IOException, InterruptedException { final Path root = createTempDirectory("test"); root.toFile().deleteOnExit(); createDirectories(root); final Path packaj = root.resolve("tests"); packaj.toFile().mkdir(); final Path yml = packaj.resolve("BadParent.yml"); copy(getClass()...
@Test public void shouldFailOnBadParent() throws IOException, InterruptedException { final Path root = createTempDirectory("test"); root.toFile().deleteOnExit(); createDirectories(root); final Path packaj = root.resolve("tests"); packaj.toFile().mkdir(); final Path yml = packaj.resolve("BadParent.yml"); copy(getClass()...
binkley
positive
5,509
public boolean isValidSequence(TreeNode root, int[] arr) { if (root == null) { return arr.length == 0; } if ((root.left == null && root.right == null) && (0 == arr.length - 1 && root.val == arr[0])) { return true; } return (0 < arr.length && (root.val == arr[0] && (existPath(root.left, arr, 0 + 1) || existPath(root.rig...
public boolean isValidSequence(TreeNode root, int[] arr) { <DeepExtract> if (root == null) { return arr.length == 0; } if ((root.left == null && root.right == null) && (0 == arr.length - 1 && root.val == arr[0])) { return true; } return (0 < arr.length && (root.val == arr[0] && (existPath(root.left, arr, 0 + 1) || exis...
leetcode-java
positive
5,510
@Test public void tellsViewToShowIncorrectAnswerMessage_WhenUserAnswersTrueAndItsIncorrect() { model = mock(QuestionModel.class); when(model.isCorrectAnswer(false)).thenReturn(false); view = mock(QuestionView.class); new QuestionPresenter(view, model); ArgumentCaptor<DataEventListener<Boolean>> argument = ArgumentCapto...
@Test public void tellsViewToShowIncorrectAnswerMessage_WhenUserAnswersTrueAndItsIncorrect() { model = mock(QuestionModel.class); when(model.isCorrectAnswer(false)).thenReturn(false); view = mock(QuestionView.class); new QuestionPresenter(view, model); <DeepExtract> ArgumentCaptor<DataEventListener<Boolean>> argument =...
presenter-first-android
positive
5,512
public void close() throws IOException { if (_reader != null) { return; } Charset encoding; byte[] data = new byte[BOM_SIZE]; int n; int unread; n = _stream.read(data, 0, data.length); Bom bom = Bom.find(data); if (bom == null) { encoding = _defaultEncoding; unread = n; } else { encoding = bom._charset; unread = data.l...
public void close() throws IOException { <DeepExtract> if (_reader != null) { return; } Charset encoding; byte[] data = new byte[BOM_SIZE]; int n; int unread; n = _stream.read(data, 0, data.length); Bom bom = Bom.find(data); if (bom == null) { encoding = _defaultEncoding; unread = n; } else { encoding = bom._charset; u...
MobClient
positive
5,513
public String getApplicationBuildTimestamp() { return properties.getProperty("timestamp", "1970-01-01 00:00:00"); }
public String getApplicationBuildTimestamp() { <DeepExtract> return properties.getProperty("timestamp", "1970-01-01 00:00:00"); </DeepExtract> }
Alpine
positive
5,515
@Test public void testAllocationRequest() { final Class<?> clazz = new AllocationRequest.Allocate("control", 10).getClass().isAnonymousClass() ? new AllocationRequest.Allocate("control", 10).getClass().getSuperclass() : new AllocationRequest.Allocate("control", 10).getClass(); assertJson(new AllocationRequest.Allocate(...
@Test public void testAllocationRequest() { final Class<?> clazz = new AllocationRequest.Allocate("control", 10).getClass().isAnonymousClass() ? new AllocationRequest.Allocate("control", 10).getClass().getSuperclass() : new AllocationRequest.Allocate("control", 10).getClass(); assertJson(new AllocationRequest.Allocate(...
alchemy
positive
5,516
@EventHandler private void mcMMOLevelUp(McMMOPlayerLevelUpEvent event) { if (!Config.mcmmoGainExp) { Player player = event.getPlayer(); if (playerManager.hasPlayerData(player.getUniqueId())) { event.setCancelled(true); } } }
@EventHandler private void mcMMOLevelUp(McMMOPlayerLevelUpEvent event) { <DeepExtract> if (!Config.mcmmoGainExp) { Player player = event.getPlayer(); if (playerManager.hasPlayerData(player.getUniqueId())) { event.setCancelled(true); } } </DeepExtract> }
HungerGames
positive
5,517
public static void between(Number value, Number min, Number max) { if (value == null) { throw new IllegalArgumentException("Argument is null."); } if (min == null) { throw new IllegalArgumentException("Argument is null."); } if (max == null) { throw new IllegalArgumentException("Argument is null."); } double valueDoubl...
public static void between(Number value, Number min, Number max) { if (value == null) { throw new IllegalArgumentException("Argument is null."); } if (min == null) { throw new IllegalArgumentException("Argument is null."); } <DeepExtract> if (max == null) { throw new IllegalArgumentException("Argument is null."); } </D...
bird-java
positive
5,518
@Override public void onErrorViewClick(View view) { setErrorResponse(null); if (isNotNull(mPaginatorEmitter) && !mPaginatorEmitter.isLoading()) { mPaginatorEmitter.reset(); mPaginatorEmitter.setLoading(true); getPresenter().request(); } else { mSwipeRefreshLayout.setRefreshing(true); } }
@Override public void onErrorViewClick(View view) { <DeepExtract> setErrorResponse(null); if (isNotNull(mPaginatorEmitter) && !mPaginatorEmitter.isLoading()) { mPaginatorEmitter.reset(); mPaginatorEmitter.setLoading(true); getPresenter().request(); } else { mSwipeRefreshLayout.setRefreshing(true); } </DeepExtract> }
android-starter-kit
positive
5,519
@Test void Success() throws PMException { pap -> { pap.graph().createPolicyClass("pc1"); pap.graph().createPolicyClass("pc2"); pap.graph().createObjectAttribute("oa1", "pc1", "pc2"); pap.graph().deassign("oa1", "pc1"); assertEquals(List.of("pc2"), pap.graph().getParents("oa1")); assertFalse(pap.graph().getParents("oa1"...
@Test void Success() throws PMException { <DeepExtract> pap -> { pap.graph().createPolicyClass("pc1"); pap.graph().createPolicyClass("pc2"); pap.graph().createObjectAttribute("oa1", "pc1", "pc2"); pap.graph().deassign("oa1", "pc1"); assertEquals(List.of("pc2"), pap.graph().getParents("oa1")); assertFalse(pap.graph().ge...
policy-machine-core
positive
5,520
@Override protected void seekInternal(Slice targetKey) { iterator.seek(new InternalKey(targetKey, snapshot.getLastSequence(), ValueType.VALUE)); if (!iterator.hasNext()) { return; } do { InternalKey internalKey = iterator.peek().getKey(); if (internalKey.getSequenceNumber() > snapshot.getLastSequence()) { iterator.next...
@Override protected void seekInternal(Slice targetKey) { iterator.seek(new InternalKey(targetKey, snapshot.getLastSequence(), ValueType.VALUE)); <DeepExtract> if (!iterator.hasNext()) { return; } do { InternalKey internalKey = iterator.peek().getKey(); if (internalKey.getSequenceNumber() > snapshot.getLastSequence()) {...
Yasp
positive
5,521
private static void checkStatus(StudentEditModel studentEditModel) { if (!EnumUtils.isValidEnum(StudentStatus.class, String.valueOf(studentEditModel.getStatus()))) { log.warn("Tried to save student with invalid status {} {}", studentEditModel.getFacultyNumber(), String.valueOf(studentEditModel.getStatus())); throw new ...
private static void checkStatus(StudentEditModel studentEditModel) { <DeepExtract> if (!EnumUtils.isValidEnum(StudentStatus.class, String.valueOf(studentEditModel.getStatus()))) { log.warn("Tried to save student with invalid status {} {}", studentEditModel.getFacultyNumber(), String.valueOf(studentEditModel.getStatus()...
zhcet-web
positive
5,522
private UpdateColleagueCompetencyEvalCommand updateColleagueCompeEvalCmdWithDone() { return createUpdateCommand(true, true, false, COLLEAGUE_ID); }
private UpdateColleagueCompetencyEvalCommand updateColleagueCompeEvalCmdWithDone() { <DeepExtract> return createUpdateCommand(true, true, false, COLLEAGUE_ID); </DeepExtract> }
evaluation
positive
5,523
public void setRightBottomCorner(int rightBottomCorner) { mRightBottomCorner = rightBottomCorner; mCorners = new float[] { mLeftTopCorner, mLeftTopCorner, mRightTopCorner, mRightTopCorner, mRightBottomCorner, mRightBottomCorner, mLeftBottomCorner, mLeftBottomCorner }; addRoundRectPath(getWidth(), getHeight()); invalida...
public void setRightBottomCorner(int rightBottomCorner) { mRightBottomCorner = rightBottomCorner; <DeepExtract> mCorners = new float[] { mLeftTopCorner, mLeftTopCorner, mRightTopCorner, mRightTopCorner, mRightBottomCorner, mRightBottomCorner, mLeftBottomCorner, mLeftBottomCorner }; addRoundRectPath(getWidth(), getHeigh...
MeiWidgetView
positive
5,524
@Override public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float scale) { float scale = 0.1F; GL11.glPushMatrix(); GL11.glTranslatef((float) x + 0.5f, (float) y - 0.5F, (float) z + 0.5f); GL11.glScalef(scale, scale, scale); FMLClientHandler.instance().getClient().renderEngine.bindText...
@Override public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float scale) { <DeepExtract> float scale = 0.1F; GL11.glPushMatrix(); GL11.glTranslatef((float) x + 0.5f, (float) y - 0.5F, (float) z + 0.5f); GL11.glScalef(scale, scale, scale); FMLClientHandler.instance().getClient().renderE...
Sanguimancy
positive
5,525
private void setQushiContent() { if (!mHasNext) { mListView.onFootLoadingComplete(true); return; } mQuShiService.getCommentByJokeId(mHandler, mJokeId, mPageId, mCount); mLoadProgressBar.setVisibility(View.GONE); mScrollView.setVisibility(View.VISIBLE); BitmapUtil.display(mUserPortraitIV, mJoke.getPortraitUrl()); mUserN...
private void setQushiContent() { <DeepExtract> if (!mHasNext) { mListView.onFootLoadingComplete(true); return; } mQuShiService.getCommentByJokeId(mHandler, mJokeId, mPageId, mCount); </DeepExtract> mLoadProgressBar.setVisibility(View.GONE); mScrollView.setVisibility(View.VISIBLE); BitmapUtil.display(mUserPortraitIV, mJ...
QiQuYing
positive
5,527
@Test public void simple_post() throws Exception { TestHandler testHandler = new TestHandler(); server = new Server(); connector = new ServerConnector(server, connectionFactory); server.addConnector(connector); server.setHandler(testHandler); server.start(); ApacheAsyncHttpClient httpClient = new ApacheAsyncHttpClient(...
@Test public void simple_post() throws Exception { TestHandler testHandler = new TestHandler(); <DeepExtract> server = new Server(); connector = new ServerConnector(server, connectionFactory); server.addConnector(connector); server.setHandler(testHandler); server.start(); </DeepExtract> ApacheAsyncHttpClient httpClient...
jira-plugin
positive
5,529
@Override public boolean tryLock() { int state = getState(); final Thread current = Thread.currentThread(); if (state == 0) { if (compareAndSetState(0, 1)) { setExclusiveOwnerThread(Thread.currentThread()); return true; } } else if (current == getExclusiveOwnerThread()) { int currentState = state + 1; setState(currentS...
@Override public boolean tryLock() { <DeepExtract> int state = getState(); final Thread current = Thread.currentThread(); if (state == 0) { if (compareAndSetState(0, 1)) { setExclusiveOwnerThread(Thread.currentThread()); return true; } } else if (current == getExclusiveOwnerThread()) { int currentState = state + 1; set...
interview
positive
5,532
@Override public void onPausedSeek() { super.onPausedSeek(); if (DEBUG) Log.d(TAG, "updateNotification() called with: drawableId = [" + R.drawable.ic_play_arrow_white + "]"); if (notBuilder == null || notRemoteView == null) return; if (R.drawable.ic_play_arrow_white != -1) notRemoteView.setImageViewResource(R.id.notifi...
@Override public void onPausedSeek() { super.onPausedSeek(); <DeepExtract> if (DEBUG) Log.d(TAG, "updateNotification() called with: drawableId = [" + R.drawable.ic_play_arrow_white + "]"); if (notBuilder == null || notRemoteView == null) return; if (R.drawable.ic_play_arrow_white != -1) notRemoteView.setImageViewResour...
Float-Tube
positive
5,533
@Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { mScaleRect.setPivotX(progress / FINENESS); mIsChanged = true; Rect rect = mScaleRect.getRect(mDisplaySize); mDetectionArea.setX(rect.left); mDetectionArea.setY(rect.top); ViewGroup.LayoutParams lp = mDetectionArea.getLayoutParams...
@Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { mScaleRect.setPivotX(progress / FINENESS); mIsChanged = true; <DeepExtract> Rect rect = mScaleRect.getRect(mDisplaySize); mDetectionArea.setX(rect.left); mDetectionArea.setY(rect.top); ViewGroup.LayoutParams lp = mDetectionArea.g...
ForceTouch
positive
5,534
public Future<Long> llen(K key) { CommandArgs<K, V> args = new CommandArgs<K, V>(codec).addKey(key); return dispatch(LLEN, new IntegerOutput<K, V>(codec), args); }
public Future<Long> llen(K key) { <DeepExtract> CommandArgs<K, V> args = new CommandArgs<K, V>(codec).addKey(key); return dispatch(LLEN, new IntegerOutput<K, V>(codec), args); </DeepExtract> }
lettuce
positive
5,535
static public boolean checkStrLength(String str, int min, int max) { String regex = "[\\w\u4e00-\u9fa5]{" + min + "," + max + "}"; boolean tem = false; Pattern pattern = Pattern.compile(regex); Matcher matcher = pattern.matcher(str); tem = matcher.matches(); return tem; }
static public boolean checkStrLength(String str, int min, int max) { String regex = "[\\w\u4e00-\u9fa5]{" + min + "," + max + "}"; <DeepExtract> boolean tem = false; Pattern pattern = Pattern.compile(regex); Matcher matcher = pattern.matcher(str); tem = matcher.matches(); return tem; </DeepExtract> }
Car-eye-pusher-android
positive
5,536
public Criteria andCreateByGreaterThanOrEqualTo(Date value) { if (value == null) { throw new RuntimeException("Value for " + "createBy" + " cannot be null"); } criteria.add(new Criterion("create_by >=", value)); return (Criteria) this; }
public Criteria andCreateByGreaterThanOrEqualTo(Date value) { <DeepExtract> if (value == null) { throw new RuntimeException("Value for " + "createBy" + " cannot be null"); } criteria.add(new Criterion("create_by >=", value)); </DeepExtract> return (Criteria) this; }
MyBlog
positive
5,537
public static void main(String[] args) { int[] array = { 3, 1, 2, 5, 7, 23, 123, 45, 2, 15, 12 }; int len = array.length; for (int i = 1; i < len; i++) { for (int j = i; j > 0; j--) { if (array[j] < array[j - 1]) { int tmp = array[j]; array[j] = array[j - 1]; array[j - 1] = tmp; } } } System.out.println(Arrays.toString...
public static void main(String[] args) { int[] array = { 3, 1, 2, 5, 7, 23, 123, 45, 2, 15, 12 }; <DeepExtract> int len = array.length; for (int i = 1; i < len; i++) { for (int j = i; j > 0; j--) { if (array[j] < array[j - 1]) { int tmp = array[j]; array[j] = array[j - 1]; array[j - 1] = tmp; } } } </DeepExtract> Syste...
learning-note
positive
5,538
@BeforeEach public void setUp() throws Exception { MockitoAnnotations.initMocks(this); PluginInfo.setUcfgPluginVersion(null); when(eslintBridgeServerMock.isAlive()).thenReturn(true); when(eslintBridgeServerMock.analyzeTypeScript(any())).thenReturn(new AnalysisResponse()); when(eslintBridgeServerMock.getCommandInfo()).t...
@BeforeEach public void setUp() throws Exception { MockitoAnnotations.initMocks(this); PluginInfo.setUcfgPluginVersion(null); when(eslintBridgeServerMock.isAlive()).thenReturn(true); when(eslintBridgeServerMock.analyzeTypeScript(any())).thenReturn(new AnalysisResponse()); when(eslintBridgeServerMock.getCommandInfo()).t...
SonarJS
positive
5,539
private static void end() { return System.currentTimeMillis(); }
private static void end() { <DeepExtract> return System.currentTimeMillis(); </DeepExtract> }
nestedvm
positive
5,540
private static void test_options2() { int save = failCount; try { innerCheck("a(?i:b)c", 0 | Pattern.MULTILINE | Pattern.DOTALL, "abc", new int[] { 0, 3, -2, -2 }); } catch (Exception e) { ++failCount; } if (failCount > save) { System.err.println("Regex=\"" + "a(?i:b)c" + "\"String=\"" + "abc" + "\""); } int save = fai...
private static void test_options2() { int save = failCount; try { innerCheck("a(?i:b)c", 0 | Pattern.MULTILINE | Pattern.DOTALL, "abc", new int[] { 0, 3, -2, -2 }); } catch (Exception e) { ++failCount; } if (failCount > save) { System.err.println("Regex=\"" + "a(?i:b)c" + "\"String=\"" + "abc" + "\""); } int save = fai...
com.florianingerl.util.regex
positive
5,541
public boolean isMessageTimestampRequired() { return mProperties.getBoolean("message.timestamp.required"); }
public boolean isMessageTimestampRequired() { <DeepExtract> return mProperties.getBoolean("message.timestamp.required"); </DeepExtract> }
secor
positive
5,545
public void setSelectedOption(int k) { selectedIndex = k; if (selectedIndex > options.length - 1) selectedIndex = 0; if (selectedIndex < 0) selectedIndex = options.length - 1; selectedOption = options[selectedIndex]; updateViewText(); if (selectedIndex > unlockedCount && !isOnOffToggle) { lockImage.setVisibility(View.V...
public void setSelectedOption(int k) { selectedIndex = k; if (selectedIndex > options.length - 1) selectedIndex = 0; if (selectedIndex < 0) selectedIndex = options.length - 1; <DeepExtract> selectedOption = options[selectedIndex]; updateViewText(); if (selectedIndex > unlockedCount && !isOnOffToggle) { lockImage.setVis...
gravitydefied
positive
5,546
@Override public synchronized void stop() { if (!running) { throw new IllegalStateException("not running"); } synchronized (this) { long increment = (long) ((getCurrent() - startTime) * getRatio()); cumulativeTime += increment; startTime = getCurrent(); } running = false; }
@Override public synchronized void stop() { if (!running) { throw new IllegalStateException("not running"); } <DeepExtract> synchronized (this) { long increment = (long) ((getCurrent() - startTime) * getRatio()); cumulativeTime += increment; startTime = getCurrent(); } </DeepExtract> running = false; }
appengine-java-vm-runtime
positive
5,547
@Override public void onClick(View v) { if (!((ClinicApplication) getApplication()).xRayDetailContractReady()) { Toast.makeText(this, R.string.retry_xray, Toast.LENGTH_LONG).show(); return; } Intent intent = new Intent(this, XRayActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); if (0 < -1) { Curs...
@Override public void onClick(View v) { <DeepExtract> if (!((ClinicApplication) getApplication()).xRayDetailContractReady()) { Toast.makeText(this, R.string.retry_xray, Toast.LENGTH_LONG).show(); return; } Intent intent = new Intent(this, XRayActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); if (...
Examples
positive
5,548
@Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { latLon = null; List<? extends ForecastLocation> newList = locationDb.getLocations(regionAdapter.getItem(position).getRegionCode()); locationsAdapter.reset(newList); filterText.removeTextChangedListener(this); filterText.setT...
@Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { <DeepExtract> latLon = null; List<? extends ForecastLocation> newList = locationDb.getLocations(regionAdapter.getItem(position).getRegionCode()); locationsAdapter.reset(newList); filterText.removeTextChangedListener(this); f...
CanadaWeather
positive
5,550
public void onClick(DialogInterface dialogInterface, int i) { String provider = mSelectedProvider.getName(); mSession.signOutUserForProvider(provider); }
public void onClick(DialogInterface dialogInterface, int i) { <DeepExtract> String provider = mSelectedProvider.getName(); mSession.signOutUserForProvider(provider); </DeepExtract> }
engage.android
positive
5,551
@Override public void execute(Machine machine) { if (pairwise) { resultParts = execPairwise(machine); } else { resultParts = execRegisterWise(machine); } int[] resultWords = DataTypeTools.createWordsFromOnePartPerWord(size, resultParts); machine.getNEONRegisterSet().setRegisterValues(destinationRegisterType, true, dest...
@Override public void execute(Machine machine) { if (pairwise) { resultParts = execPairwise(machine); } else { resultParts = execRegisterWise(machine); } int[] resultWords = DataTypeTools.createWordsFromOnePartPerWord(size, resultParts); machine.getNEONRegisterSet().setRegisterValues(destinationRegisterType, true, dest...
nevada
positive
5,552
@Override public void parseServiceTask(Element serviceTaskElement, ScopeImpl scope, ActivityImpl activity) { activity.addExecutionListener(ExecutionListener.EVENTNAME_START, createExecutionListener(activity)); activity.addExecutionListener(ExecutionListener.EVENTNAME_END, createExecutionListener(activity)); }
@Override public void parseServiceTask(Element serviceTaskElement, ScopeImpl scope, ActivityImpl activity) { activity.addExecutionListener(ExecutionListener.EVENTNAME_START, createExecutionListener(activity)); <DeepExtract> activity.addExecutionListener(ExecutionListener.EVENTNAME_END, createExecutionListener(activity)...
camunda-bpm-platform-osgi
positive
5,553
public static Context getApplicationContext() { return getConfigurator().getConfiguration(ConfigKeys.APPLICATION_CONTEXT); }
public static Context getApplicationContext() { <DeepExtract> return getConfigurator().getConfiguration(ConfigKeys.APPLICATION_CONTEXT); </DeepExtract> }
FastEC
positive
5,554
public static void drawFluidBar(FluidStack fs, float barHeight, int xPos, int yPos, ResourceLocation displayImage, GUIContainer guiContainer, int x, int y, float zLevel) { final int w = 16; final int barSlotHeight = 60; final int h = (int) (barSlotHeight * barHeight); if (fs == null || fs.getFluid() == null) return; Re...
public static void drawFluidBar(FluidStack fs, float barHeight, int xPos, int yPos, ResourceLocation displayImage, GUIContainer guiContainer, int x, int y, float zLevel) { final int w = 16; final int barSlotHeight = 60; final int h = (int) (barSlotHeight * barHeight); <DeepExtract> if (fs == null || fs.getFluid() == nu...
PowerAdvantageAPI
positive
5,555
public PolyElement<E> setToOne() { int k = coefficients.size(); while (k < 1) { coefficients.add((E) field.getTargetField().newElement()); k++; } while (k > 1) { k--; coefficients.remove(coefficients.size() - 1); } coefficients.get(0).setToOne(); return this; }
public PolyElement<E> setToOne() { <DeepExtract> int k = coefficients.size(); while (k < 1) { coefficients.add((E) field.getTargetField().newElement()); k++; } while (k > 1) { k--; coefficients.remove(coefficients.size() - 1); } </DeepExtract> coefficients.get(0).setToOne(); return this; }
BLS_signature_aggregation
positive
5,556
public void NSrlA1() { String atomFeature = "NSrlA1"; if (true) { mFeatureNames.add(atomFeature); } if (true) { mFeatureNames.add(atomFeature + PROPER); } if (true) { mFeatureNames.add(atomFeature + NOMINAL); } }
public void NSrlA1() { String atomFeature = "NSrlA1"; <DeepExtract> if (true) { mFeatureNames.add(atomFeature); } if (true) { mFeatureNames.add(atomFeature + PROPER); } if (true) { mFeatureNames.add(atomFeature + NOMINAL); } </DeepExtract> }
cross-document-coreference-resolution
positive
5,557
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_profile_telegram); setSupportActionBar((Toolbar) findViewById(R.id.toolbar)); getSupportActionBar().setDisplayHomeAsUpEnabled(true); setTitle(null); findViewById(R.id.linearLayout_phone).s...
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_profile_telegram); <DeepExtract> setSupportActionBar((Toolbar) findViewById(R.id.toolbar)); getSupportActionBar().setDisplayHomeAsUpEnabled(true); setTitle(null); findViewById(R.id.linearL...
Android-development-with-example
positive
5,558
@Test void test() throws Exception { driver1.get("https://bonigarcia.dev/selenium-webdriver-java/"); Wait<WebDriver> wait = new WebDriverWait(driver1, Duration.ofSeconds(30)); wait.until(d -> d.getTitle().contains("Selenium WebDriver")); URL dockerSessionUrl = wdm.getDockerNoVncUrl(driver1); log.debug("The noVNC URL is...
@Test void test() throws Exception { driver1.get("https://bonigarcia.dev/selenium-webdriver-java/"); Wait<WebDriver> wait = new WebDriverWait(driver1, Duration.ofSeconds(30)); wait.until(d -> d.getTitle().contains("Selenium WebDriver")); URL dockerSessionUrl = wdm.getDockerNoVncUrl(driver1); log.debug("The noVNC URL is...
webdrivermanager
positive
5,560
public static void functionRestore(OutputStream out, ByteBuffers value, boolean replace) { Outputs.write(STAR, out); if (replace) { Outputs.write(FOUR, out); } else { Outputs.write(THREE, out); } Outputs.write('\r', out); Outputs.write('\n', out); Outputs.write(DOLLAR, out); Outputs.write(String.valueOf(FUNCTION_BUF.re...
public static void functionRestore(OutputStream out, ByteBuffers value, boolean replace) { Outputs.write(STAR, out); if (replace) { Outputs.write(FOUR, out); } else { Outputs.write(THREE, out); } Outputs.write('\r', out); Outputs.write('\n', out); Outputs.write(DOLLAR, out); Outputs.write(String.valueOf(FUNCTION_BUF.re...
redis-rdb-cli
positive
5,561
public void draw() { pg.beginDraw(); alphaFade(pg); PVector translate = sliderXYZ("translate"); PVector rotate = sliderXYZ("rotate").add(sliderXYZ("rotate speed")); pg.translate(width * .5f + translate.x, height * .5f + translate.y, translate.z); pg.rotateX(rotate.x); pg.rotateY(rotate.y); pg.rotateZ(rotate.z); splitPa...
public void draw() { pg.beginDraw(); alphaFade(pg); PVector translate = sliderXYZ("translate"); PVector rotate = sliderXYZ("rotate").add(sliderXYZ("rotate speed")); pg.translate(width * .5f + translate.x, height * .5f + translate.y, translate.z); pg.rotateX(rotate.x); pg.rotateY(rotate.y); pg.rotateZ(rotate.z); splitPa...
ProcessingSketches
positive
5,562
public boolean canJump1(int[] nums) { if (nums == null || nums.length == 0) return true; if (nums[0] >= nums.length - 1) return true; if (nums[0] == 0) return false; int father = nums[0]; for (int i = 0; i <= nums[0]; i++) { father = Math.max(father, nums[i] + i); } return helper(nums[0], father, nums); }
public boolean canJump1(int[] nums) { if (nums == null || nums.length == 0) return true; <DeepExtract> if (nums[0] >= nums.length - 1) return true; if (nums[0] == 0) return false; int father = nums[0]; for (int i = 0; i <= nums[0]; i++) { father = Math.max(father, nums[i] + i); } return helper(nums[0], father, nums); <...
leetcode-cn
positive
5,563
@Override public void onBackPressed() { super.onBackPressed(); super.finish(); exist(); }
@Override public void onBackPressed() { super.onBackPressed(); <DeepExtract> super.finish(); exist(); </DeepExtract> }
HwTxtReader
positive
5,564
public JComponent getComponent(Lookup masterLookup) { if (panel == null) { panel = new EN4JPanel(this); } return panel; }
public JComponent getComponent(Lookup masterLookup) { <DeepExtract> if (panel == null) { panel = new EN4JPanel(this); } return panel; </DeepExtract> }
en4j
positive
5,565
@Override public VoucherResponse method() { return executeSyncApiCall(api.addLoyaltyMember(id, addMember)); }
@Override public VoucherResponse method() { <DeepExtract> return executeSyncApiCall(api.addLoyaltyMember(id, addMember)); </DeepExtract> }
voucherify-java-sdk
positive
5,566
@Override public String toString() { return this.name; }
@Override public String toString() { <DeepExtract> return this.name; </DeepExtract> }
spring-boot-startup-bench
positive
5,567
public void loadRedditPreferences(Context context, HttpClient client) { SharedPreferences sessionPrefs = PreferenceManager.getDefaultSharedPreferences(context); this.username = sessionPrefs.getString("username", null); this.modhash = sessionPrefs.getString("modhash", null); String cookieValue = sessionPrefs.getString("...
public void loadRedditPreferences(Context context, HttpClient client) { SharedPreferences sessionPrefs = PreferenceManager.getDefaultSharedPreferences(context); this.username = sessionPrefs.getString("username", null); this.modhash = sessionPrefs.getString("modhash", null); String cookieValue = sessionPrefs.getString("...
reddit-is-fun
positive
5,568
@Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Log.i(TAG, "clicked position " + position); if (position == 0) { if (searchOnClickHeader) this.geocodeText(); } else { ForecastLocation l = locationsAdapter.getItem(position - 1); Intent data = new Intent(); data.setData(l.getU...
@Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { <DeepExtract> Log.i(TAG, "clicked position " + position); </DeepExtract> if (position == 0) { if (searchOnClickHeader) this.geocodeText(); } else { ForecastLocation l = locationsAdapter.getItem(position - 1); Intent data = new ...
CanadaWeather
positive
5,569
public void loadData(List<LineChartLine> data) { this.data = data; minDataPoint = 0; maxDataPoint = 0; for (LineChartLine line : data) { for (Integer dataPoint : line.getDataPoints()) { if (dataPoint < minDataPoint) { minDataPoint = dataPoint; } if (dataPoint > maxDataPoint) { maxDataPoint = dataPoint; } } } if (minDat...
public void loadData(List<LineChartLine> data) { this.data = data; minDataPoint = 0; maxDataPoint = 0; for (LineChartLine line : data) { for (Integer dataPoint : line.getDataPoints()) { if (dataPoint < minDataPoint) { minDataPoint = dataPoint; } if (dataPoint > maxDataPoint) { maxDataPoint = dataPoint; } } } if (minDat...
KeepScore
positive
5,570
public Criteria andBirthdayLessThanOrEqualTo(Date value) { if (value == null) { throw new RuntimeException("Value for " + "birthday" + " cannot be null"); } criteria.add(new Criterion("`birthday` <=", value)); return (Criteria) this; }
public Criteria andBirthdayLessThanOrEqualTo(Date value) { <DeepExtract> if (value == null) { throw new RuntimeException("Value for " + "birthday" + " cannot be null"); } criteria.add(new Criterion("`birthday` <=", value)); </DeepExtract> return (Criteria) this; }
blockhealth
positive
5,573
public Criteria andStatusNotBetween(Byte value1, Byte value2) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + "status" + " cannot be null"); } criteria.add(new Criterion("status not between", value1, value2)); return (Criteria) this; }
public Criteria andStatusNotBetween(Byte value1, Byte value2) { <DeepExtract> if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + "status" + " cannot be null"); } criteria.add(new Criterion("status not between", value1, value2)); </DeepExtract> return (Criteria) this; }
uccn
positive
5,574
public void logout() { prefeditor.putString(PREF_AUTH_TOKEN, null).commit(); prefeditor.putString(PREF_USERNAME, null).commit(); }
public void logout() { prefeditor.putString(PREF_AUTH_TOKEN, null).commit(); <DeepExtract> prefeditor.putString(PREF_USERNAME, null).commit(); </DeepExtract> }
Hummingbird-for-Android
positive
5,575
public ServletOutputStream createOutputStream() throws IOException { if (debug > 1) { System.out.println("createOutputStream gets called"); } CompressionResponseStream compressedStream = new CompressionResponseStream(origResponse); this.debug = debug; compressedStream.setBuffer(threshold); return compressedStream; }
public ServletOutputStream createOutputStream() throws IOException { if (debug > 1) { System.out.println("createOutputStream gets called"); } CompressionResponseStream compressedStream = new CompressionResponseStream(origResponse); <DeepExtract> this.debug = debug; </DeepExtract> compressedStream.setBuffer(threshold); ...
javaeecookbook
positive
5,576
public void reset(SessionConfig config) throws IOException { if (VERBOSE) Log.i(TAG, "reset"); if (mThreadRunning) Log.e(TAG, "reset called before stop completed"); mEncoderCore = new AudioEncoderCore(config.getNumAudioChannels(), config.getAudioBitrate(), config.getAudioSamplerate(), config.getMuxer()); mMediaCodec = ...
public void reset(SessionConfig config) throws IOException { if (VERBOSE) Log.i(TAG, "reset"); if (mThreadRunning) Log.e(TAG, "reset called before stop completed"); <DeepExtract> mEncoderCore = new AudioEncoderCore(config.getNumAudioChannels(), config.getAudioBitrate(), config.getAudioSamplerate(), config.getMuxer()); ...
MediaCodec
positive
5,577
@Override public void bindDouble(int index, double value) { if (index < 1 || index > mNumParameters) { throw new IllegalArgumentException("Cannot bind argument at index " + index + " because the index is out of range. " + "The statement has " + mNumParameters + " parameters."); } mBindArgs[index - 1] = value; }
@Override public void bindDouble(int index, double value) { <DeepExtract> if (index < 1 || index > mNumParameters) { throw new IllegalArgumentException("Cannot bind argument at index " + index + " because the index is out of range. " + "The statement has " + mNumParameters + " parameters."); } mBindArgs[index - 1] = v...
sqlite-android
positive
5,578
public static SMSUserAction getAction(EntityDamageByEntityEvent event) { if ((Player) event.getDamager().isSneaking()) new StringBuilder("sms.actions.leftclick.").append("sneak"); else new StringBuilder("sms.actions.leftclick.").append("normal"); String s = ScrollingMenuSign.getInstance().getConfig().getString(new Stri...
public static SMSUserAction getAction(EntityDamageByEntityEvent event) { <DeepExtract> if ((Player) event.getDamager().isSneaking()) new StringBuilder("sms.actions.leftclick.").append("sneak"); else new StringBuilder("sms.actions.leftclick.").append("normal"); String s = ScrollingMenuSign.getInstance().getConfig().getS...
ScrollingMenuSign
positive
5,579
public Criteria andMailcodeLike(String value) { if (value == null) { throw new RuntimeException("Value for " + "mailcode" + " cannot be null"); } criteria.add(new Criterion("mailcode like", value)); return (Criteria) this; }
public Criteria andMailcodeLike(String value) { <DeepExtract> if (value == null) { throw new RuntimeException("Value for " + "mailcode" + " cannot be null"); } criteria.add(new Criterion("mailcode like", value)); </DeepExtract> return (Criteria) this; }
ssmBillBook
positive
5,580
void setupEndValue(Object target) { if (mProperty != null) { mKeyframeSet.mKeyframes.get(mKeyframeSet.mKeyframes.size() - 1).setValue(mProperty.get(target)); } try { if (mGetter == null) { Class targetClass = target.getClass(); setupGetter(targetClass); } mKeyframeSet.mKeyframes.get(mKeyframeSet.mKeyframes.size() - 1)....
void setupEndValue(Object target) { <DeepExtract> if (mProperty != null) { mKeyframeSet.mKeyframes.get(mKeyframeSet.mKeyframes.size() - 1).setValue(mProperty.get(target)); } try { if (mGetter == null) { Class targetClass = target.getClass(); setupGetter(targetClass); } mKeyframeSet.mKeyframes.get(mKeyframeSet.mKeyframe...
GenericDrawerLayout
positive
5,581
public static TokenInfoDictionary newInstance(ResourceResolver resolver) throws IOException { TokenInfoDictionary dictionary = new TokenInfoDictionary(); tokenInfoBuffer = new TokenInfoBuffer(resolver.resolve(TOKEN_INFO_DICTIONARY_FILENAME)); stringValues = new StringValueMapBuffer(resolver.resolve(FEATURE_MAP_FILENAME...
public static TokenInfoDictionary newInstance(ResourceResolver resolver) throws IOException { TokenInfoDictionary dictionary = new TokenInfoDictionary(); <DeepExtract> tokenInfoBuffer = new TokenInfoBuffer(resolver.resolve(TOKEN_INFO_DICTIONARY_FILENAME)); stringValues = new StringValueMapBuffer(resolver.resolve(FEATUR...
kuromoji
positive
5,582
@Test public void testGoodQuery() throws Exception { when(meta.getParameterCount()).thenReturn(2); String sql = "select * from blah where ? = ?"; runner.query(sql, handler, "unit", "test"); verify(prepStmt, times(1)).executeQuery(); verify(results, times(1)).close(); verify(prepStmt, times(1)).close(); verify(conn, tim...
@Test public void testGoodQuery() throws Exception { <DeepExtract> when(meta.getParameterCount()).thenReturn(2); String sql = "select * from blah where ? = ?"; runner.query(sql, handler, "unit", "test"); verify(prepStmt, times(1)).executeQuery(); verify(results, times(1)).close(); verify(prepStmt, times(1)).close(); ve...
commons-dbutils
positive
5,583
public void test_new_link() throws InterruptedException { openBaseURL(); clickAndWait("link=Entity Grid Ajax with Edit"); for (int i = 0; i < new String[] { "Name", "Id", "Address", "Age", "Gender" }.length; ++i) { assertText(String.format("xpath=//table[@class='t-data-grid'][1]/thead[1]/tr[1]/th[%d]/a[1]", i + 1), new...
public void test_new_link() throws InterruptedException { openBaseURL(); clickAndWait("link=Entity Grid Ajax with Edit"); for (int i = 0; i < new String[] { "Name", "Id", "Address", "Age", "Gender" }.length; ++i) { assertText(String.format("xpath=//table[@class='t-data-grid'][1]/thead[1]/tr[1]/th[%d]/a[1]", i + 1), new...
tawus
positive
5,584
void putinplace(Code nt, boolean headonly) { if (sel != null) { nt.dec(); find(lastx, lasty, nt, false, headonly); sel = null; } else { tvc.add(nt); } recalctree(darea.getGraphics()); repainttree(true); }
void putinplace(Code nt, boolean headonly) { if (sel != null) { nt.dec(); find(lastx, lasty, nt, false, headonly); sel = null; } else { tvc.add(nt); } <DeepExtract> recalctree(darea.getGraphics()); repainttree(true); </DeepExtract> }
aarded
positive
5,585
public static void init() { if (instance == null) { instance = new ModItems(); } return instance; }
public static void init() { <DeepExtract> if (instance == null) { instance = new ModItems(); } return instance; </DeepExtract> }
WurmServerModLauncher
positive
5,586
public void insert(int elementNum, String stringPart, Image imagePart) { items.add(elementNum, new CompoundItem(stringPart, imagePart)); for (DataSetObserver observer : observers) { observer.onChanged(); } }
public void insert(int elementNum, String stringPart, Image imagePart) { items.add(elementNum, new CompoundItem(stringPart, imagePart)); <DeepExtract> for (DataSetObserver observer : observers) { observer.onChanged(); } </DeepExtract> }
J2meLoader
positive
5,587
public void alloc_opt_list(int count) { boolean printYear = false; if (verbose) { System.out.print("R"); if (624 < 1000) { System.out.print(" "); } else if (624 > 2000) { 624 = 624 / 1000; printYear = true; } } System.out.print(624); if (printYear) System.out.print("-F2008"); if (verbose) { System.out.print(":" + "allo...
public void alloc_opt_list(int count) { boolean printYear = false; if (verbose) { System.out.print("R"); if (624 < 1000) { System.out.print(" "); } else if (624 > 2000) { 624 = 624 / 1000; printYear = true; } } System.out.print(624); if (printYear) System.out.print("-F2008"); if (verbose) { System.out.print(":" + "allo...
open-fortran-parser
positive
5,588
@Test public void testReferenceCycleTypeFieldsClassBufferPackBufferUnpack() throws Exception { super.testReferenceCycleTypeFieldsClass(); }
@Test public void testReferenceCycleTypeFieldsClassBufferPackBufferUnpack() throws Exception { <DeepExtract> super.testReferenceCycleTypeFieldsClass(); </DeepExtract> }
msgpack-java
positive
5,589
public boolean saveBindId(Object entity) { if (!tableIsExist(TableInfo.get(entity.getClass()))) { String sql = SqlBuilder.getCreatTableSQL(entity.getClass()); debugSql(sql); db.execSQL(sql); } List<KeyValue> entityKvList = SqlBuilder.getSaveKeyValueListByEntity(entity); if (entityKvList != null && entityKvList.size() >...
public boolean saveBindId(Object entity) { <DeepExtract> if (!tableIsExist(TableInfo.get(entity.getClass()))) { String sql = SqlBuilder.getCreatTableSQL(entity.getClass()); debugSql(sql); db.execSQL(sql); } </DeepExtract> List<KeyValue> entityKvList = SqlBuilder.getSaveKeyValueListByEntity(entity); if (entityKvList != ...
KJFrameForAndroid_Modify
positive
5,590