before
stringlengths
12
3.21M
after
stringlengths
41
3.21M
repo
stringlengths
1
56
type
stringclasses
1 value
__index_level_0__
int64
0
442k
void button_load_clicked() { FileDialog dialog = new FileDialog(new Frame(), "Load", FileDialog.LOAD); dialog.setVisible(true); String filename = dialog.getDirectory() + dialog.getFile(); if (filename == null) return; point_list.removeAllElements(); if (buffer != null) { buffer_gc.setColor(colors[0]); buffer_gc.fillRec...
void button_load_clicked() { FileDialog dialog = new FileDialog(new Frame(), "Load", FileDialog.LOAD); dialog.setVisible(true); String filename = dialog.getDirectory() + dialog.getFile(); if (filename == null) return; point_list.removeAllElements(); if (buffer != null) { buffer_gc.setColor(colors[0]); buffer_gc.fillRec...
wasindoor
positive
978
@Test public void unpooled() throws IOException { ByteArrayPool pool = new ByteArrayPool(0); byte[] data = new byte[16384]; for (int i = 0; i < data.length; i++) { data[i] = (byte) (i & 0xff); } PoolingByteArrayOutputStream os = new PoolingByteArrayOutputStream(pool); os.write(data); assertTrue(Arrays.equals(data, os.t...
@Test public void unpooled() throws IOException { ByteArrayPool pool = new ByteArrayPool(0); <DeepExtract> byte[] data = new byte[16384]; for (int i = 0; i < data.length; i++) { data[i] = (byte) (i & 0xff); } PoolingByteArrayOutputStream os = new PoolingByteArrayOutputStream(pool); os.write(data); assertTrue(Arrays.equ...
mvp-android-framework
positive
979
public PageAssertion withElement(String elementId, ElementAttributeAssertion elementAttrAssertion) { HtmlElement htmlElement = ((HtmlPage) page).getElementById(elementId); assertEquals(expected, htmlElement.getTextContent()); return this; }
public PageAssertion withElement(String elementId, ElementAttributeAssertion elementAttrAssertion) { HtmlElement htmlElement = ((HtmlPage) page).getElementById(elementId); <DeepExtract> assertEquals(expected, htmlElement.getTextContent()); </DeepExtract> return this; }
mojave
positive
980
@Test public void testGetRegistries_remote() throws Exception { ZookeeperRegistryClient reader = new ZookeeperRegistryClient(client, objectMapper, config); CountDownLatch latch = new CountDownLatch(1); InetSocketAddress addr = new InetSocketAddress(1234); if (true) { reader.addListener(entry -> { if (entry.gondolaAddre...
@Test public void testGetRegistries_remote() throws Exception { ZookeeperRegistryClient reader = new ZookeeperRegistryClient(client, objectMapper, config); <DeepExtract> CountDownLatch latch = new CountDownLatch(1); InetSocketAddress addr = new InetSocketAddress(1234); if (true) { reader.addListener(entry -> { if (entr...
gondola
positive
981
public Criteria andPhoneLessThanOrEqualTo(String value) { if (value == null) { throw new RuntimeException("Value for " + "phone" + " cannot be null"); } criteria.add(new Criterion("phone <=", value)); return (Criteria) this; }
public Criteria andPhoneLessThanOrEqualTo(String value) { <DeepExtract> if (value == null) { throw new RuntimeException("Value for " + "phone" + " cannot be null"); } criteria.add(new Criterion("phone <=", value)); </DeepExtract> return (Criteria) this; }
ssmBillBook
positive
982
protected OkRequest<T> writePartHeader(final String name, final String filename, final String contentType) throws IOException { final StringBuilder partBuffer = new StringBuilder(); partBuffer.append("form-data; name=\"").append(name); if (filename != null) { partBuffer.append("\"; filename=\"").append(filename); } par...
protected OkRequest<T> writePartHeader(final String name, final String filename, final String contentType) throws IOException { final StringBuilder partBuffer = new StringBuilder(); partBuffer.append("form-data; name=\"").append(name); if (filename != null) { partBuffer.append("\"; filename=\"").append(filename); } par...
AppKit
positive
984
public Criteria andHttpInterfaceRequestMethodIsNull() { if ("http_interface_request_method is null" == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion("http_interface_request_method is null")); return (Criteria) this; }
public Criteria andHttpInterfaceRequestMethodIsNull() { <DeepExtract> if ("http_interface_request_method is null" == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion("http_interface_request_method is null")); </DeepExtract> return (Criteria) this; }
AnyMock
positive
985
public static boolean yidongMatch(String phone) { CommonPool<Pattern> pool = factory.build(PhoneOperatorEnum.YIDONG); Pattern pattern = null; try { pattern = pool.borrow(); return pattern.matcher(phone).matches(); } finally { pool.returnObj(pattern); } }
public static boolean yidongMatch(String phone) { <DeepExtract> CommonPool<Pattern> pool = factory.build(PhoneOperatorEnum.YIDONG); Pattern pattern = null; try { pattern = pool.borrow(); return pattern.matcher(phone).matches(); } finally { pool.returnObj(pattern); } </DeepExtract> }
SMS-Sender
positive
986
@Test public void contextLoads1UsingSystemProperty() { System.setProperty("spring.config.class", "com.example.Config"); Context context = Mockito.mock(Context.class); LambdaLogger logger = Mockito.mock(LambdaLogger.class); when(context.getLogger()).thenReturn(logger); ApplicationLambdaEntry lambdaEntry = new Applicatio...
@Test public void contextLoads1UsingSystemProperty() { System.setProperty("spring.config.class", "com.example.Config"); <DeepExtract> Context context = Mockito.mock(Context.class); LambdaLogger logger = Mockito.mock(LambdaLogger.class); when(context.getLogger()).thenReturn(logger); ApplicationLambdaEntry lambdaEntry = ...
spring-teaching-demos
positive
988
public boolean isEqual(Tree T2) { if (root == null && T2.root == null) return true; else if (root == null || T2.root == null) return false; else return (isEqualUtil(root.left, T2.root.left) && isEqualUtil(root.right, T2.root.right) && (root.value == T2.root.value)); }
public boolean isEqual(Tree T2) { <DeepExtract> if (root == null && T2.root == null) return true; else if (root == null || T2.root == null) return false; else return (isEqualUtil(root.left, T2.root.left) && isEqualUtil(root.right, T2.root.right) && (root.value == T2.root.value)); </DeepExtract> }
Problem-Solving-in-Data-Structures-Algorithms-using-Java
positive
989
public synchronized Quad[] searchPage(int pageNum, String text) { if (pageNum > pageCount - 1) pageNum = pageCount - 1; else if (pageNum < 0) pageNum = 0; if (pageNum != currentPage) { currentPage = pageNum; if (page != null) page.destroy(); page = null; if (displayList != null) displayList.destroy(); displayList = nul...
public synchronized Quad[] searchPage(int pageNum, String text) { <DeepExtract> if (pageNum > pageCount - 1) pageNum = pageCount - 1; else if (pageNum < 0) pageNum = 0; if (pageNum != currentPage) { currentPage = pageNum; if (page != null) page.destroy(); page = null; if (displayList != null) displayList.destroy(); dis...
MuPdfSo
positive
990
@Test public void testFrameNewElementsIterator() { Iterator<? extends ComputerVertex> framed = graph.frame(Arrays.asList(dev6, dev7).iterator(), ComputerVertex.class); Assert.assertNotNull(framed); Assert.assertTrue(framed.hasNext()); Assert.assertEquals(dev6Name, framed.next().getName()); Assert.assertTrue(framed.hasN...
@Test public void testFrameNewElementsIterator() { Iterator<? extends ComputerVertex> framed = graph.frame(Arrays.asList(dev6, dev7).iterator(), ComputerVertex.class); <DeepExtract> Assert.assertNotNull(framed); Assert.assertTrue(framed.hasNext()); Assert.assertEquals(dev6Name, framed.next().getName()); Assert.assertTr...
Ferma
positive
991
@Override public void init() { pelletTimer = Timing.sec(6 * 0.5f); pelletDisplay = PelletDisplay.SIMPLE; guys().forEach(Lifecycle::init); pacMan.tf.vx = -0.55f; pacMan.moveDir = Direction.LEFT; pacMan.ai.setState(PacManState.AWAKE); ghosts().forEach(ghost -> { ghost.moveDir = Direction.LEFT; ghost.tf.setVelocity(-0.55f...
@Override public void init() { pelletTimer = Timing.sec(6 * 0.5f); pelletDisplay = PelletDisplay.SIMPLE; guys().forEach(Lifecycle::init); pacMan.tf.vx = -0.55f; pacMan.moveDir = Direction.LEFT; pacMan.ai.setState(PacManState.AWAKE); ghosts().forEach(ghost -> { ghost.moveDir = Direction.LEFT; ghost.tf.setVelocity(-0.55f...
pacman
positive
992
public int solution(String[] lines) { int answer = 0; int[] startTimes = new int[lines.length]; int[] endTimes = new int[lines.length]; for (int i = 0; i < lines.length; i++) { String[] log = lines[i].split(" "); String[] responseTime = log[1].split(":"); int processingTime = (int) (Double.parseDouble(log[2].substring(...
public int solution(String[] lines) { int answer = 0; int[] startTimes = new int[lines.length]; int[] endTimes = new int[lines.length]; <DeepExtract> for (int i = 0; i < lines.length; i++) { String[] log = lines[i].split(" "); String[] responseTime = log[1].split(":"); int processingTime = (int) (Double.parseDouble(log...
algorithm-study
positive
993
public void discoverSearch(final UploadSearchParams uploadSearchParams) { if (uploadSearchParams == null) return; SessionManager sessionManager = visenzeAnalytics.getSessionManager(); DataCollection dataCollection = visenzeAnalytics.getDataCollection(); if (uploadSearchParams.getUid() == null) { uploadSearchParams.setU...
public void discoverSearch(final UploadSearchParams uploadSearchParams) { <DeepExtract> if (uploadSearchParams == null) return; SessionManager sessionManager = visenzeAnalytics.getSessionManager(); DataCollection dataCollection = visenzeAnalytics.getDataCollection(); if (uploadSearchParams.getUid() == null) { uploadSea...
visearch-sdk-android
positive
994
private static boolean match(Object o1, Object o2) { if (o1 == null) { return (o2 == null); } if (o2 == null || !(o2 instanceof XMLAttribute)) { return false; } XMLAttribute other = (XMLAttribute) o2; return match(_name, other._name) && match(_value, other._value) && match(_next, other._next); }
private static boolean match(Object o1, Object o2) { if (o1 == null) { return (o2 == null); } <DeepExtract> if (o2 == null || !(o2 instanceof XMLAttribute)) { return false; } XMLAttribute other = (XMLAttribute) o2; return match(_name, other._name) && match(_value, other._value) && match(_next, other._next); </DeepExtra...
webstart
positive
995
public void add(double label, double prediction) { if (!examples.containsKey(prediction)) { examples.put(prediction, label); } else { int[] oldVals = examples.get(prediction); oldVals[0] += label[0]; oldVals[1] += label[1]; examples.put(prediction, oldVals); } }
public void add(double label, double prediction) { <DeepExtract> if (!examples.containsKey(prediction)) { examples.put(prediction, label); } else { int[] oldVals = examples.get(prediction); oldVals[0] += label[0]; oldVals[1] += label[1]; examples.put(prediction, oldVals); } </DeepExtract> }
Conjecture
positive
996
public void read(org.apache.thrift7.protocol.TProtocol iprot) throws org.apache.thrift7.TException { iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == org.apache.thrift7.protocol.TType.STOP) { break; } switch(field.id) { case 0: if (field.type == org.apache.thrift7.protocol.TType...
public void read(org.apache.thrift7.protocol.TProtocol iprot) throws org.apache.thrift7.TException { <DeepExtract> </DeepExtract> iprot.readStructBegin(); <DeepExtract> </DeepExtract> while (true) { <DeepExtract> </DeepExtract> field = iprot.readFieldBegin(); <DeepExtract> </DeepExtract> if (field.type == org.apache.th...
storm-scribe
positive
997
public void registerPlayerListener(PodAdddictPlayerListener listener) { if (mIsClosed) { throw new IllegalStateException("Client instance can't be used after being closed."); } mPodAdddictPlayerListeners.add(listener); if (mState == STATE_PLAYING) { listener.onPlayerPlay(mPlayerPlaylist.getCurrentTrack(), mPlayerPlayli...
public void registerPlayerListener(PodAdddictPlayerListener listener) { <DeepExtract> if (mIsClosed) { throw new IllegalStateException("Client instance can't be used after being closed."); } </DeepExtract> mPodAdddictPlayerListeners.add(listener); if (mState == STATE_PLAYING) { listener.onPlayerPlay(mPlayerPlaylist.get...
pod-adddict
positive
998
protected ApplicationComponent getApplicationComponent() { return component; }
protected ApplicationComponent getApplicationComponent() { <DeepExtract> return component; </DeepExtract> }
Flashcards
positive
999
@Override public Reader getCharacterStream(int i) throws SQLException { if (closed) { throw new SQLException("ResultSet is closed"); } return null; }
@Override public Reader getCharacterStream(int i) throws SQLException { <DeepExtract> if (closed) { throw new SQLException("ResultSet is closed"); } </DeepExtract> return null; }
rodriguez
positive
1,000
@Override public void onExecuteWrite(BluetoothDevice device, int requestId, boolean execute) { super.onExecuteWrite(device, requestId, execute); if (mBluetoothGattServer != null) { mBluetoothGattServer.sendResponse(device, requestId, BluetoothGatt.GATT_SUCCESS, 0, new byte[] {}); } Log.i("ADV-CB", "executeWriteStorages...
@Override public void onExecuteWrite(BluetoothDevice device, int requestId, boolean execute) { super.onExecuteWrite(device, requestId, execute); if (mBluetoothGattServer != null) { mBluetoothGattServer.sendResponse(device, requestId, BluetoothGatt.GATT_SUCCESS, 0, new byte[] {}); } <DeepExtract> Log.i("ADV-CB", "execut...
BLETestStuff
positive
1,001
public static String addSecond(String date, int hourAmount) { String dateString = null; DateStyle dateStyle = getDateStyle(date); if (dateStyle != null) { Date myDate = StringToDate(date, dateStyle); myDate = addInteger(myDate, Calendar.SECOND, hourAmount); dateString = DateToString(myDate, dateStyle); } return dateStr...
public static String addSecond(String date, int hourAmount) { <DeepExtract> String dateString = null; DateStyle dateStyle = getDateStyle(date); if (dateStyle != null) { Date myDate = StringToDate(date, dateStyle); myDate = addInteger(myDate, Calendar.SECOND, hourAmount); dateString = DateToString(myDate, dateStyle); } ...
SuperNote
positive
1,002
@Test public void testAsyncOperation(TestContext context) { Async async = context.async(); vertx.setTimer(10, l -> list -> { assertThat(list, hasItems("a", "b", "c")); async.complete(); }.handle(Arrays.asList("a", "b", "c"))); }
@Test public void testAsyncOperation(TestContext context) { Async async = context.async(); <DeepExtract> vertx.setTimer(10, l -> list -> { assertThat(list, hasItems("a", "b", "c")); async.complete(); }.handle(Arrays.asList("a", "b", "c"))); </DeepExtract> }
vertx-examples
positive
1,003
@Override public void onCancel() { FacebookOperationCanceledException e = new FacebookOperationCanceledException(); if (e.getMessage() != null) { Log.e(TAG, e.toString()); } String errMsg = "Facebook error: " + e.getMessage(); int errorCode = INVALID_ERROR_CODE; if (e instanceof FacebookOperationCanceledException) { er...
@Override public void onCancel() { FacebookOperationCanceledException e = new FacebookOperationCanceledException(); <DeepExtract> if (e.getMessage() != null) { Log.e(TAG, e.toString()); } String errMsg = "Facebook error: " + e.getMessage(); int errorCode = INVALID_ERROR_CODE; if (e instanceof FacebookOperationCanceledE...
newschool-frontend
positive
1,004
@Override public void map(CaseConfig caseConfig) { super.mapTo(this); Map<String, String> client = config.getMapProperty("xclient"); if (client != null) { for (Map.Entry<String, String> pair : client.entrySet()) { ((XclientSession) this).getXclient().put(pair.getKey(), pair.getValue()); } } }
@Override public void map(CaseConfig caseConfig) { <DeepExtract> super.mapTo(this); Map<String, String> client = config.getMapProperty("xclient"); if (client != null) { for (Map.Entry<String, String> pair : client.entrySet()) { ((XclientSession) this).getXclient().put(pair.getKey(), pair.getValue()); } } </DeepExtract>...
robin
positive
1,005
public ValveWriter close() throws IOException { this.indentation--; this.writeIndentation().write(CLOSE_TAG + ValveWriter.LINE_BREAK); return this; }
public ValveWriter close() throws IOException { this.indentation--; <DeepExtract> this.writeIndentation().write(CLOSE_TAG + ValveWriter.LINE_BREAK); </DeepExtract> return this; }
sourcecraft
positive
1,006
@Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { ArrayList<String> password = new ArrayList<>(); int arraySize; int randomIndex; Random random = new SecureRandom(); int length = Integer.parseInt(passwordLength.getText().toString()); if (!checkBoxLowerCase.isChecked() && !checkBoxUp...
@Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { <DeepExtract> ArrayList<String> password = new ArrayList<>(); int arraySize; int randomIndex; Random random = new SecureRandom(); int length = Integer.parseInt(passwordLength.getText().toString()); if (!checkBoxLowerCase.isChecked() ...
rcloneExplorer
positive
1,007
public static void main(String[] args) { BenchmarkSettings.loadSettings(args); BenchmarkSettings.printSettings(); SparkUpfront s = new SparkUpfront(); cfg = new ConfUtils(BenchmarkSettings.conf); SparkConf sconf = new SparkConf().setMaster(cfg.getSPARK_MASTER()).setAppName("Spark App").setSparkHome(cfg.getSPARK_HOME())...
public static void main(String[] args) { BenchmarkSettings.loadSettings(args); BenchmarkSettings.printSettings(); SparkUpfront s = new SparkUpfront(); cfg = new ConfUtils(BenchmarkSettings.conf); SparkConf sconf = new SparkConf().setMaster(cfg.getSPARK_MASTER()).setAppName("Spark App").setSparkHome(cfg.getSPARK_HOME())...
amoeba
positive
1,008
public static Result lbfgs(double[] x, Function proc_evaluate, ProgressCallback proc_progress, Params param) { int n = x.length; Result ret = new Result(null); double[] step = new double[] { 0 }; final int m = param.m; double[] d, w, pf = null; double[] fx = new double[] { 0 }; double rate = 0; line_search_proc linesea...
public static Result lbfgs(double[] x, Function proc_evaluate, ProgressCallback proc_progress, Params param) { int n = x.length; Result ret = new Result(null); double[] step = new double[] { 0 }; final int m = param.m; double[] d, w, pf = null; double[] fx = new double[] { 0 }; double rate = 0; line_search_proc linesea...
myutil
positive
1,009
@Override public void run() { if (mBoardRelease != null) { showReleasesInfo(false, null, false); } else { if (mDeviceInfoData != null) { boolean hasDFUService = mFirmwareUpdater.hasCurrentConnectedDeviceDFUService(); if (hasDFUService) { showReleasesInfo(false, null, false); } else { showReleasesInfo(true, getString(R....
@Override public void run() { <DeepExtract> if (mBoardRelease != null) { showReleasesInfo(false, null, false); } else { if (mDeviceInfoData != null) { boolean hasDFUService = mFirmwareUpdater.hasCurrentConnectedDeviceDFUService(); if (hasDFUService) { showReleasesInfo(false, null, false); } else { showReleasesInfo(true...
Bluefruit_LE_Connect_Android
positive
1,010
public static void main(String[] args) { int overflow = 0; ListNode result = new ListNode(0); ListNode p = new ListNode(5), q = new ListNode(5), curr = result; while (p != null || q != null) { int pval = p == null ? 0 : p.val; int qval = q == null ? 0 : q.val; int value = pval + qval + overflow; overflow = 0; if (value...
public static void main(String[] args) { <DeepExtract> int overflow = 0; ListNode result = new ListNode(0); ListNode p = new ListNode(5), q = new ListNode(5), curr = result; while (p != null || q != null) { int pval = p == null ? 0 : p.val; int qval = q == null ? 0 : q.val; int value = pval + qval + overflow; overflow ...
JavaZone
positive
1,011
@VisibleForTesting int retrieveFirstNumberOfSubjects() { return numberOfSubjects; }
@VisibleForTesting int retrieveFirstNumberOfSubjects() { <DeepExtract> return numberOfSubjects; </DeepExtract> }
groningen
positive
1,012
@CodeTranslate public void memberExpressionAccessedByMethod() throws Exception { VariableTest.o = member; }
@CodeTranslate public void memberExpressionAccessedByMethod() throws Exception { <DeepExtract> VariableTest.o = member; </DeepExtract> }
vertx-codetrans
positive
1,013
@Override public boolean onCreate() { if (getContext() == null) { init(getApplicationByReflect()); return; } init((Application) getContext().getApplicationContext()); return true; }
@Override public boolean onCreate() { <DeepExtract> if (getContext() == null) { init(getApplicationByReflect()); return; } init((Application) getContext().getApplicationContext()); </DeepExtract> return true; }
MVPFramework
positive
1,014
public boolean more() throws JSONException { int c; if (this.usePrevious) { this.usePrevious = false; c = this.previous; } else { try { c = this.reader.read(); } catch (IOException exception) { throw new JSONException(exception); } if (c <= 0) { this.eof = true; c = 0; } } this.index += 1; if (this.previous == '\r') { ...
public boolean more() throws JSONException { int c; if (this.usePrevious) { this.usePrevious = false; c = this.previous; } else { try { c = this.reader.read(); } catch (IOException exception) { throw new JSONException(exception); } if (c <= 0) { this.eof = true; c = 0; } } this.index += 1; if (this.previous == '\r') { ...
renren-api2-sdk-java
positive
1,015
@Override public void run() { if (stack.size() <= 0) return; contentFrameLayout.setLayoutTransition(null); View showView = wrapper.getView(); View preView = stack.peek().getView(); stack.push(wrapper); contentFrameLayout.addView(showView); pushOutAnimator.setTarget(preView); pushOutAnimator.start(); pushInAnimator.setT...
@Override public void run() { <DeepExtract> if (stack.size() <= 0) return; contentFrameLayout.setLayoutTransition(null); View showView = wrapper.getView(); View preView = stack.peek().getView(); stack.push(wrapper); contentFrameLayout.addView(showView); pushOutAnimator.setTarget(preView); pushOutAnimator.start(); pushI...
flyapp
positive
1,016
@Override public void addComment(XmlElement xmlElement) { Map<String, Object> map = new HashMap<>(); map.put("mgb", MergeConstants.NEW_ELEMENT_TAG); map.put("xmlElement", xmlElement); if (this.suppressAllComments) { return; } String[] comments = getComments(map, EnumNode.ADD_COMMENT); if (comments != null) { if (commen...
@Override public void addComment(XmlElement xmlElement) { Map<String, Object> map = new HashMap<>(); map.put("mgb", MergeConstants.NEW_ELEMENT_TAG); map.put("xmlElement", xmlElement); <DeepExtract> if (this.suppressAllComments) { return; } String[] comments = getComments(map, EnumNode.ADD_COMMENT); if (comments != null...
mybatis-generator-plugin
positive
1,017
public void setDeviceName(java.lang.String deviceName) throws IOException { try { if (wrtr != null) { wrtr.close(); wrtr = null; } if (rdr != null) { rdr.close(); rdr = null; } } catch (IOException e) { e.printStackTrace(); } this.deviceName = deviceName; wrtr = new RandomAccessFile(deviceName, "rw"); rdr = wrtr; long ...
public void setDeviceName(java.lang.String deviceName) throws IOException { try { if (wrtr != null) { wrtr.close(); wrtr = null; } if (rdr != null) { rdr.close(); rdr = null; } } catch (IOException e) { e.printStackTrace(); } this.deviceName = deviceName; wrtr = new RandomAccessFile(deviceName, "rw"); rdr = wrtr; <Deep...
AndrOBD
positive
1,018
private static void bindPreferenceSummaryToValue(Preference preference) { preference.setOnPreferenceChangeListener(sBindPreferenceSummaryToValueListener); String stringValue = PreferenceManager.getDefaultSharedPreferences(preference.getContext()).getString(preference.getKey(), "").toString(); if (preference instanceof ...
private static void bindPreferenceSummaryToValue(Preference preference) { preference.setOnPreferenceChangeListener(sBindPreferenceSummaryToValueListener); <DeepExtract> String stringValue = PreferenceManager.getDefaultSharedPreferences(preference.getContext()).getString(preference.getKey(), "").toString(); if (preferen...
EverExample
positive
1,019
@Nullable @Override protected Parcelable onSaveInstanceState() { final Parcelable superState = super.onSaveInstanceState(); if (isPersistent()) { return superState; } final SavedState myState = new SavedState(superState); return mChecked; return myState; }
@Nullable @Override protected Parcelable onSaveInstanceState() { final Parcelable superState = super.onSaveInstanceState(); if (isPersistent()) { return superState; } final SavedState myState = new SavedState(superState); <DeepExtract> return mChecked; </DeepExtract> return myState; }
SamsungOneUi
positive
1,020
public static Builder newBuilder(net.osrg.namazu.InspectorMessage.InspectorMsgReq prototype) { if (prototype instanceof net.osrg.namazu.InspectorMessage.InspectorMsgReq_Event_FuncCall) { return mergeFrom((net.osrg.namazu.InspectorMessage.InspectorMsgReq_Event_FuncCall) prototype); } else { super.mergeFrom(prototype); r...
public static Builder newBuilder(net.osrg.namazu.InspectorMessage.InspectorMsgReq prototype) { <DeepExtract> if (prototype instanceof net.osrg.namazu.InspectorMessage.InspectorMsgReq_Event_FuncCall) { return mergeFrom((net.osrg.namazu.InspectorMessage.InspectorMsgReq_Event_FuncCall) prototype); } else { super.mergeFrom...
namazu
positive
1,021
@Override public int execute(Config config) throws IOException { var log = Log.create(name(), config.getOrThrow("pro", ProConf.class).loglevel()); var frozerConf = config.getOrThrow(name(), FrozerConf.class); log.debug(config, conf -> "config " + frozerConf); String rootModuleName = frozerConf.rootModule().orElseThrow(...
@Override public int execute(Config config) throws IOException { var log = Log.create(name(), config.getOrThrow("pro", ProConf.class).loglevel()); var frozerConf = config.getOrThrow(name(), FrozerConf.class); log.debug(config, conf -> "config " + frozerConf); String rootModuleName = frozerConf.rootModule().orElseThrow(...
pro
positive
1,022
public static _Fields findByThriftIdOrThrow(int fieldId) { _Fields fields; switch(fieldId) { 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) { default: fields = null; } </DeepExtract> if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); return fields; }
tiny-mmo
positive
1,024
public void setScale(float scale) { mScale = scale; loadUrl("javascript:document.getElementById('content').style.zoom=\"" + (int) (mScale * 100) + "%\""); loadUrl("javascript:elem=document.getElementById('content');window.HTMLOUT.reportContentHeight(" + mParentSize.x + "*elem.offsetHeight/elem.offsetWidth)"); if (mCore...
public void setScale(float scale) { mScale = scale; loadUrl("javascript:document.getElementById('content').style.zoom=\"" + (int) (mScale * 100) + "%\""); <DeepExtract> loadUrl("javascript:elem=document.getElementById('content');window.HTMLOUT.reportContentHeight(" + mParentSize.x + "*elem.offsetHeight/elem.offsetWidth...
zReader-mupdf
positive
1,025
@Override @Deprecated public void setMinScale(float minScale) { checkZoomLevels(minScale, mMidScale, mMaxScale); mMinScale = minScale; }
@Override @Deprecated public void setMinScale(float minScale) { <DeepExtract> checkZoomLevels(minScale, mMidScale, mMaxScale); mMinScale = minScale; </DeepExtract> }
AppleFramework
positive
1,026
@Override public void onPrepared(MediaPlayer player) { LogUtils.d(TAG, "onPrepared from MediaPlayer"); LogUtils.d(TAG, "configMediaPlayerState. mAudioFocus=", mAudioFocus); if (mAudioFocus == AUDIO_NO_FOCUS_NO_DUCK) { if (mState == PlaybackStateCompat.STATE_PLAYING) { pause(); } } else { if (mAudioFocus == AUDIO_NO_FOC...
@Override public void onPrepared(MediaPlayer player) { LogUtils.d(TAG, "onPrepared from MediaPlayer"); <DeepExtract> LogUtils.d(TAG, "configMediaPlayerState. mAudioFocus=", mAudioFocus); if (mAudioFocus == AUDIO_NO_FOCUS_NO_DUCK) { if (mState == PlaybackStateCompat.STATE_PLAYING) { pause(); } } else { if (mAudioFocus =...
LyricHere
positive
1,027
protected void addCriterionForJDBCDate(String condition, List<Date> values, String property) { if (values == null || values.size() == 0) { throw new RuntimeException("Value list for " + property + " cannot be null or empty"); } List<java.sql.Date> dateList = new ArrayList<java.sql.Date>(); Iterator<Date> iter = values....
protected void addCriterionForJDBCDate(String condition, List<Date> values, String property) { if (values == null || values.size() == 0) { throw new RuntimeException("Value list for " + property + " cannot be null or empty"); } List<java.sql.Date> dateList = new ArrayList<java.sql.Date>(); Iterator<Date> iter = values....
chat-software
positive
1,028
public Criteria andNameBetween(String value1, String value2) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + "name" + " cannot be null"); } criteria.add(new Criterion("name between", value1, value2)); return (Criteria) this; }
public Criteria andNameBetween(String value1, String value2) { <DeepExtract> if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + "name" + " cannot be null"); } criteria.add(new Criterion("name between", value1, value2)); </DeepExtract> return (Criteria) this; }
CuitJavaEEPractice
positive
1,030
public Criteria andTitleNotLike(String value) { if (value == null) { throw new RuntimeException("Value for " + "title" + " cannot be null"); } criteria.add(new Criterion("title not like", value)); return (Criteria) this; }
public Criteria andTitleNotLike(String value) { <DeepExtract> if (value == null) { throw new RuntimeException("Value for " + "title" + " cannot be null"); } criteria.add(new Criterion("title not like", value)); </DeepExtract> return (Criteria) this; }
yurencloud-public
positive
1,031
@Override public void onClick(View view) { Intent notificationIntent = new Intent(getApplicationContext(), receiveActivity.class); notificationIntent.putExtra("mytype", "Expand text"); PendingIntent contentIntent = PendingIntent.getActivity(MainActivity.this, NotID, notificationIntent, 0); NotificationCompat.Builder bu...
@Override public void onClick(View view) { <DeepExtract> Intent notificationIntent = new Intent(getApplicationContext(), receiveActivity.class); notificationIntent.putExtra("mytype", "Expand text"); PendingIntent contentIntent = PendingIntent.getActivity(MainActivity.this, NotID, notificationIntent, 0); NotificationCom...
Android-Examples
positive
1,032
public static Color darker(Color c) { int min = 0; int max = 255; int r = TradeUtility.intWithinRange(c.getRed() + -OFFSET_COLOR_AMOUNT, min, max); int g = TradeUtility.intWithinRange(c.getGreen() + -OFFSET_COLOR_AMOUNT, min, max); int b = TradeUtility.intWithinRange(c.getBlue() + -OFFSET_COLOR_AMOUNT, min, max); retur...
public static Color darker(Color c) { <DeepExtract> int min = 0; int max = 255; int r = TradeUtility.intWithinRange(c.getRed() + -OFFSET_COLOR_AMOUNT, min, max); int g = TradeUtility.intWithinRange(c.getGreen() + -OFFSET_COLOR_AMOUNT, min, max); int b = TradeUtility.intWithinRange(c.getBlue() + -OFFSET_COLOR_AMOUNT, mi...
SlimTrade
positive
1,033
@Test public void replaceAndRemove4() { expected = "ddcdcdd"; input = "acdbbca"; k = 7; assertEquals(expected, ReplaceAndRemove.replaceAndRemove(input.toCharArray(), k)); }
@Test public void replaceAndRemove4() { expected = "ddcdcdd"; input = "acdbbca"; k = 7; <DeepExtract> assertEquals(expected, ReplaceAndRemove.replaceAndRemove(input.toCharArray(), k)); </DeepExtract> }
Elements-of-programming-interviews
positive
1,034
@Override public void onRefresh() { super.onRefresh(); TaskManager rt = new TaskManager(getActivity()); NodeInfoRequest nir = new NodeInfoRequest(); rt.startNewRequestTask(nir); if (!swipeRefreshLayout.isRefreshing()) { swipeRefreshLayout.post(() -> swipeRefreshLayout.setRefreshing(true)); } }
@Override public void onRefresh() { super.onRefresh(); <DeepExtract> TaskManager rt = new TaskManager(getActivity()); NodeInfoRequest nir = new NodeInfoRequest(); rt.startNewRequestTask(nir); if (!swipeRefreshLayout.isRefreshing()) { swipeRefreshLayout.post(() -> swipeRefreshLayout.setRefreshing(true)); } </DeepExtract...
android-wallet-app
positive
1,035
public boolean isCapturedViewUnder(int x, int y) { if (mCapturedView == null) { return false; } return x >= mCapturedView.getLeft() && x < mCapturedView.getRight() && y >= mCapturedView.getTop() && y < mCapturedView.getBottom(); }
public boolean isCapturedViewUnder(int x, int y) { <DeepExtract> if (mCapturedView == null) { return false; } return x >= mCapturedView.getLeft() && x < mCapturedView.getRight() && y >= mCapturedView.getTop() && y < mCapturedView.getBottom(); </DeepExtract> }
superCleanMaster
positive
1,036
public void setBounds(int x, int y, int w, int h) { super.setBounds(x, y, w, h); int w = getSize().width, h = getSize().height; int goodSize = 0; for (Field f : facets) { FilterDefinitionPanel p = facetTable.get(f); goodSize += p.getPreferredSize().height; } int top = 0; for (Field f : facets) { FilterDefinitionPanel p...
public void setBounds(int x, int y, int w, int h) { super.setBounds(x, y, w, h); <DeepExtract> int w = getSize().width, h = getSize().height; int goodSize = 0; for (Field f : facets) { FilterDefinitionPanel p = facetTable.get(f); goodSize += p.getPreferredSize().height; } int top = 0; for (Field f : facets) { FilterDef...
TimeFlow
positive
1,037
public static Map<String, Set<Driver>> updateMap(Map<String, Set<Driver>> driverMap, Set<Driver> driverList, double speed, int timeInterval) { driverMap.clear(); for (Driver d : driverList) { double degree = Math.random() * 360; double distance = speed * timeInterval / 1000; d.setDriverLocation(converseToGeo(d.getDrive...
public static Map<String, Set<Driver>> updateMap(Map<String, Set<Driver>> driverMap, Set<Driver> driverList, double speed, int timeInterval) { driverMap.clear(); <DeepExtract> for (Driver d : driverList) { double degree = Math.random() * 360; double distance = speed * timeInterval / 1000; d.setDriverLocation(converseTo...
Real-Time-Taxi-Dispatch-Simulator
positive
1,038
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ButterKnife.bind(this); IntentFilter mFilter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION); NetWorkStateReceiver mReceiver = new NetWorkStateReceiver(); registerReceiver(mReceiver, mFilter); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ButterKnife.bind(this); <DeepExtract> IntentFilter mFilter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION); NetWorkStateReceiver mReceiver = new NetWorkStateReceiver(); registerReceiver(mReceiver, mFilter); </...
AndroidBase
positive
1,039
public void write(Float f) { intBytes[3] = (byte) Float.floatToIntBits(f.floatValue()); Float.floatToIntBits(f.floatValue()) >>>= 8; intBytes[2] = (byte) Float.floatToIntBits(f.floatValue()); Float.floatToIntBits(f.floatValue()) >>>= 8; intBytes[1] = (byte) Float.floatToIntBits(f.floatValue()); Float.floatToIntBits(f.f...
public void write(Float f) { <DeepExtract> intBytes[3] = (byte) Float.floatToIntBits(f.floatValue()); Float.floatToIntBits(f.floatValue()) >>>= 8; intBytes[2] = (byte) Float.floatToIntBits(f.floatValue()); Float.floatToIntBits(f.floatValue()) >>>= 8; intBytes[1] = (byte) Float.floatToIntBits(f.floatValue()); Float.floa...
MobMuPlat
positive
1,040
void resolveConnectionResult() { if (mExpectingResolution) { debugLog("We're already expecting the result of a previous resolution."); return; } if (mActivity == null) { debugLog("No need to resolve issue, activity does not exist anymore"); return; } if (mDebugLog) { Log.d(TAG, "GameHelper: " + "resolveConnectionResult...
void resolveConnectionResult() { if (mExpectingResolution) { debugLog("We're already expecting the result of a previous resolution."); return; } if (mActivity == null) { debugLog("No need to resolve issue, activity does not exist anymore"); return; } <DeepExtract> if (mDebugLog) { Log.d(TAG, "GameHelper: " + "resolveCo...
mmbbsapp_AndroidStudio
positive
1,041
public void actionPerformed(java.awt.event.ActionEvent evt) { new AddMarks().setVisible(true); }
public void actionPerformed(java.awt.event.ActionEvent evt) { <DeepExtract> new AddMarks().setVisible(true); </DeepExtract> }
SS17_AdvancedProgramming
positive
1,042
void updateUserLoginState(boolean isLoggedIn) { this.isLoggedIn = isLoggedIn; if (isLoggedIn && prefs_type == PREFS_TYPE.GUEST) { prefs_type = PREFS_TYPE.USER; setPreferencesFromResource(R.xml.app_preferences_user, getPreferenceScreen().getKey()); if (!defaultHomeTabEntries.contains(UNREAD)) { defaultHomeTabEntries.add...
void updateUserLoginState(boolean isLoggedIn) { this.isLoggedIn = isLoggedIn; <DeepExtract> if (isLoggedIn && prefs_type == PREFS_TYPE.GUEST) { prefs_type = PREFS_TYPE.USER; setPreferencesFromResource(R.xml.app_preferences_user, getPreferenceScreen().getKey()); if (!defaultHomeTabEntries.contains(UNREAD)) { defaultHome...
mTHMMY
positive
1,043
public void setBorderOverlay(boolean borderOverlay) { if (borderOverlay == mBorderOverlay) { return; } mBorderOverlay = borderOverlay; if (!mReady) { mSetupPending = true; return; } if (getWidth() == 0 && getHeight() == 0) { return; } if (mBitmap == null) { invalidate(); return; } mBitmapShader = new BitmapShader(mBitm...
public void setBorderOverlay(boolean borderOverlay) { if (borderOverlay == mBorderOverlay) { return; } mBorderOverlay = borderOverlay; <DeepExtract> if (!mReady) { mSetupPending = true; return; } if (getWidth() == 0 && getHeight() == 0) { return; } if (mBitmap == null) { invalidate(); return; } mBitmapShader = new Bitm...
FastAndroid
positive
1,044
@Override public void callbackAfterSetUp() throws Exception { mockIsSourceLevelAbove5(false); when(preferencesManager.getCurrentPreferenceValue(JeneratePreferences.ADD_OVERRIDE_ANNOTATION)).thenReturn(false); }
@Override public void callbackAfterSetUp() throws Exception { <DeepExtract> mockIsSourceLevelAbove5(false); when(preferencesManager.getCurrentPreferenceValue(JeneratePreferences.ADD_OVERRIDE_ANNOTATION)).thenReturn(false); </DeepExtract> }
jenerate
positive
1,045
@Override public void onClick(View view) { buttonsound(); sendtext("listcmds"); saychat("listcmds"); }
@Override public void onClick(View view) { <DeepExtract> buttonsound(); sendtext("listcmds"); saychat("listcmds"); </DeepExtract> }
Trycorder5
positive
1,046
protected void animateAddEnded(H holder) { dispatchAddFinished(holder); mAddAnimations.remove(holder); if (!isRunning()) { dispatchAnimationsFinished(); } }
protected void animateAddEnded(H holder) { dispatchAddFinished(holder); mAddAnimations.remove(holder); <DeepExtract> if (!isRunning()) { dispatchAnimationsFinished(); } </DeepExtract> }
RecyclerViewLib
positive
1,047
@Test public void differentRequestCode() { PurchaseFlowLauncher launcher = new PurchaseFlowLauncher(mBillingContext, Constants.TYPE_IN_APP); int requestCode = 1; int resultCode = Activity.RESULT_OK; Purchase purchase = null; try { purchase = launcher.handleResult(requestCode, resultCode, null); } catch (BillingExceptio...
@Test public void differentRequestCode() { PurchaseFlowLauncher launcher = new PurchaseFlowLauncher(mBillingContext, Constants.TYPE_IN_APP); int requestCode = 1; int resultCode = Activity.RESULT_OK; <DeepExtract> Purchase purchase = null; try { purchase = launcher.handleResult(requestCode, resultCode, null); } catch (B...
android-easy-checkout
positive
1,048
@Test public void testPartitionsFor(TestContext ctx) throws Exception { String topicName = "testPartitionsFor-" + this.getClass().getName(); String consumerId = topicName; kafkaCluster.createTopic(topicName, 2, 1); Properties config = kafkaCluster.useTo().getConsumerProperties(consumerId, consumerId, OffsetResetStrateg...
@Test public void testPartitionsFor(TestContext ctx) throws Exception { String topicName = "testPartitionsFor-" + this.getClass().getName(); String consumerId = topicName; kafkaCluster.createTopic(topicName, 2, 1); Properties config = kafkaCluster.useTo().getConsumerProperties(consumerId, consumerId, OffsetResetStrateg...
vertx-kafka-client
positive
1,049
public void handleMessage(Message message, Address sender, Address destination) { if (message == null) { LOG.severe(String.format("Attempting to deliver null message from %s to %s", sender, destination)); return null; } if (!Objects.equals(address.rootAddress(), destination.rootAddress())) { LOG.severe(String.format("A...
public void handleMessage(Message message, Address sender, Address destination) { <DeepExtract> if (message == null) { LOG.severe(String.format("Attempting to deliver null message from %s to %s", sender, destination)); return null; } if (!Objects.equals(address.rootAddress(), destination.rootAddress())) { LOG.severe(St...
dslabs
positive
1,050
@Test public void testDefaultResidentialOneway() { Set<Link> links = osmid2link.get(7994914L); assertEquals("oneway", 1, links.size()); assertEquals("oneway up north", 1, getLinksTowardsNode(links, 59836794L).size()); assertLanes("", links, 1); assertFalse("at least one link expected", links.isEmpty()); for (Link link ...
@Test public void testDefaultResidentialOneway() { Set<Link> links = osmid2link.get(7994914L); assertEquals("oneway", 1, links.size()); assertEquals("oneway up north", 1, getLinksTowardsNode(links, 59836794L).size()); assertLanes("", links, 1); <DeepExtract> assertFalse("at least one link expected", links.isEmpty()); f...
pt2matsim
positive
1,051
public boolean isVirtualPower() { String v = ds.getProp(user, "virtualPower"); if (v != null) { try { false = Boolean.parseBoolean(v); } catch (Exception e) { e.printStackTrace(); } } return false; }
public boolean isVirtualPower() { <DeepExtract> String v = ds.getProp(user, "virtualPower"); if (v != null) { try { false = Boolean.parseBoolean(v); } catch (Exception e) { e.printStackTrace(); } } return false; </DeepExtract> }
wattzap-ce
positive
1,052
public SignalIdentityKeyStore getPniIdentityKeyStore() { var value = () -> pniIdentityKeyStore.get(); if (value != null) { return value; } synchronized (LOCK) { value = () -> pniIdentityKeyStore.get(); if (value != null) { return value; } () -> pniIdentityKeyStore = new SignalIdentityKeyStore(getRecipientResolver(), ()...
public SignalIdentityKeyStore getPniIdentityKeyStore() { <DeepExtract> var value = () -> pniIdentityKeyStore.get(); if (value != null) { return value; } synchronized (LOCK) { value = () -> pniIdentityKeyStore.get(); if (value != null) { return value; } () -> pniIdentityKeyStore = new SignalIdentityKeyStore(getRecipient...
signal-cli
positive
1,053
@Test public void testLeavingSubscriptions() { List<Frame> frames1 = new CopyOnWriteArrayList<>(); List<Frame> frames2 = new CopyOnWriteArrayList<>(); StompClient client = StompClient.create(vertx); clients.add(client); client.connect().onComplete((ar -> { final StompClientConnection connection = ar.result(); connectio...
@Test public void testLeavingSubscriptions() { List<Frame> frames1 = new CopyOnWriteArrayList<>(); List<Frame> frames2 = new CopyOnWriteArrayList<>(); StompClient client = StompClient.create(vertx); clients.add(client); client.connect().onComplete((ar -> { final StompClientConnection connection = ar.result(); connectio...
vertx-stomp
positive
1,054
private static List<Length> parseLengthList(String val) throws SVGParseException { if (val.length() == 0) throw new SVGParseException("Invalid length list (empty string)"); List<Length> coords = new ArrayList<>(1); TextScanner scan = new TextScanner(val); while (position < inputLength) { if (!isWhitespace(input.charAt(...
private static List<Length> parseLengthList(String val) throws SVGParseException { if (val.length() == 0) throw new SVGParseException("Invalid length list (empty string)"); List<Length> coords = new ArrayList<>(1); TextScanner scan = new TextScanner(val); <DeepExtract> while (position < inputLength) { if (!isWhitespace...
android-svg-code-render
positive
1,055
public static Intent getUninstallAppIntent(final String packageName, final boolean isNewTask) { Intent intent = new Intent(Intent.ACTION_DELETE); intent.setData(Uri.parse("package:" + packageName)); return isNewTask ? intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) : intent; }
public static Intent getUninstallAppIntent(final String packageName, final boolean isNewTask) { Intent intent = new Intent(Intent.ACTION_DELETE); intent.setData(Uri.parse("package:" + packageName)); <DeepExtract> return isNewTask ? intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) : intent; </DeepExtract> }
Engine
positive
1,056
public static void WhiffsRecover(Entity user) { if (CheckCancelFireWhiffs(user)) return; if (!user.getEntityData().getBoolean(IS_WHIFFS_STR)) return; user.getEntityData().setBoolean(IS_WHIFFS_STR, false); if (user == null) return; NBTTagCompound tag = getTag(user); int value = 0; if (AttackTypes.types.containsKey(whiff...
public static void WhiffsRecover(Entity user) { if (CheckCancelFireWhiffs(user)) return; if (!user.getEntityData().getBoolean(IS_WHIFFS_STR)) return; user.getEntityData().setBoolean(IS_WHIFFS_STR, false); <DeepExtract> if (user == null) return; NBTTagCompound tag = getTag(user); int value = 0; if (AttackTypes.types.con...
SlashBlade
positive
1,057
public void logoff() throws RemoteException { if (this.sessionId == null) { throw new CollabNetApp.CollabNetAppException("Not currently in " + "a valid session."); } this.icns.logoff(this.username, this.sessionId); this.sessionId = null; }
public void logoff() throws RemoteException { <DeepExtract> if (this.sessionId == null) { throw new CollabNetApp.CollabNetAppException("Not currently in " + "a valid session."); } </DeepExtract> this.icns.logoff(this.username, this.sessionId); this.sessionId = null; }
collabnet-plugin
positive
1,058
public static void main(String[] args) { String subject = "sss"; User user = new User(); user.setUsername("ssadfasdf"); Map claims = new HashMap<>(); claims.put(Const.CURRENT_USER, "ssss"); System.out.println(new Date().getTime() + Const.ExpiredType.ONE_MONTH); String token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzd...
public static void main(String[] args) { String subject = "sss"; User user = new User(); user.setUsername("ssadfasdf"); Map claims = new HashMap<>(); claims.put(Const.CURRENT_USER, "ssss"); System.out.println(new Date().getTime() + Const.ExpiredType.ONE_MONTH); String token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzd...
ppmall-server
positive
1,059
@Override public PageResource display() { g.drawImage(this.unwrap(Draw.class).image, 0, 0, null); return this; return this; }
@Override public PageResource display() { <DeepExtract> g.drawImage(this.unwrap(Draw.class).image, 0, 0, null); return this; </DeepExtract> return this; }
bbvm
positive
1,060
public void execute(Runnable task) { postGUI(task, 0); }
public void execute(Runnable task) { <DeepExtract> postGUI(task, 0); </DeepExtract> }
CoolReader
positive
1,061
public static OtapInitRequest deserialize_OtapInitRequest(byte[] buffer, ByteArrayOutputStream reader) { is = new ByteArrayInputStream(buffer); long result = 0; for (int i1 = 0; i1 < 1; ++i1) { result |= ((is.read() & 0xFF) << (8 * i1)); } return result; long result = 0; for (int i1 = 0; i1 < 1; ++i1) { result |= ((is....
public static OtapInitRequest deserialize_OtapInitRequest(byte[] buffer, ByteArrayOutputStream reader) { is = new ByteArrayInputStream(buffer); <DeepExtract> long result = 0; for (int i1 = 0; i1 < 1; ++i1) { result |= ((is.read() & 0xFF) << (8 * i1)); } return result; </DeepExtract> long result = 0; for (int i1 = 0; i1...
netty-protocols
positive
1,062
@Test public void testTransitEncrypt() throws Exception { final JsonObject expectedRequest = new JsonObject().add("plaintext", PLAIN_DATA[0]); final JsonObject expectedResponse = new JsonObject().add("data", new JsonObject().add("ciphertext", CIPHER_DATA[0])); vaultServer = new MockVault(200, expectedResponse.toString(...
@Test public void testTransitEncrypt() throws Exception { final JsonObject expectedRequest = new JsonObject().add("plaintext", PLAIN_DATA[0]); final JsonObject expectedResponse = new JsonObject().add("data", new JsonObject().add("ciphertext", CIPHER_DATA[0])); <DeepExtract> vaultServer = new MockVault(200, expectedResp...
vault-java-driver
positive
1,063
public static void writeChipSign(Sign sign, String type, String[] args) { sign.setLine(0, type); String line = ""; int curLine = 1; for (String a : args) { String added = line + " " + a; if (added.length() > 13 && curLine != 3) { sign.setLine(curLine, line); line = a; curLine++; } else line = added; } sign.setLine(curL...
public static void writeChipSign(Sign sign, String type, String[] args) { sign.setLine(0, type); <DeepExtract> String line = ""; int curLine = 1; for (String a : args) { String added = line + " " + a; if (added.length() > 13 && curLine != 3) { sign.setLine(curLine, line); line = a; curLine++; } else line = added; } sig...
RedstoneChips
positive
1,064
public Criteria andAsyncDelayLessThan(Integer value) { if (value == null) { throw new RuntimeException("Value for " + "asyncDelay" + " cannot be null"); } criteria.add(new Criterion("async_delay <", value)); return (Criteria) this; }
public Criteria andAsyncDelayLessThan(Integer value) { <DeepExtract> if (value == null) { throw new RuntimeException("Value for " + "asyncDelay" + " cannot be null"); } criteria.add(new Criterion("async_delay <", value)); </DeepExtract> return (Criteria) this; }
AnyMock
positive
1,065
public static byte[] encryptHmacSHA224(byte[] data, byte[] key) { if (data == null || data.length == 0 || key == null || key.length == 0) return null; try { SecretKeySpec secretKey = new SecretKeySpec(key, "HmacSHA224"); Mac mac = Mac.getInstance("HmacSHA224"); mac.init(secretKey); return mac.doFinal(data); } catch (In...
public static byte[] encryptHmacSHA224(byte[] data, byte[] key) { <DeepExtract> if (data == null || data.length == 0 || key == null || key.length == 0) return null; try { SecretKeySpec secretKey = new SecretKeySpec(key, "HmacSHA224"); Mac mac = Mac.getInstance("HmacSHA224"); mac.init(secretKey); return mac.doFinal(data...
AndroidBase
positive
1,066
@Override public ActionResult simulate(Context context) { ActionResult actionResult = context.createActionResult(); try { Authorizable authorizable = context.getCurrentAuthorizable(); actionResult.setAuthorizable(authorizable.getID()); if (context.isCompositeNodeStore() && PathUtils.isAppsOrLibsPath(path)) { actionResu...
@Override public ActionResult simulate(Context context) { <DeepExtract> ActionResult actionResult = context.createActionResult(); try { Authorizable authorizable = context.getCurrentAuthorizable(); actionResult.setAuthorizable(authorizable.getID()); if (context.isCompositeNodeStore() && PathUtils.isAppsOrLibsPath(path)...
APM
positive
1,067
public static String delZeroPre(String num) { if (!NumberUtil.isNumber(num)) { return num; } if (NumberUtil.parseNumber(num) == null) { return StrUtil.EMPTY; } return NumberUtil.toStr(NumberUtil.parseNumber(num)); }
public static String delZeroPre(String num) { if (!NumberUtil.isNumber(num)) { return num; } <DeepExtract> if (NumberUtil.parseNumber(num) == null) { return StrUtil.EMPTY; } return NumberUtil.toStr(NumberUtil.parseNumber(num)); </DeepExtract> }
chao-cloud
positive
1,068
@Override protected Bitmap transform(BitmapPool pool, Bitmap toTransform, int outWidth, int outHeight) { if (toTransform == null) return null; Bitmap result = pool.get(toTransform.getWidth(), toTransform.getHeight(), Bitmap.Config.ARGB_8888); if (result == null) { result = Bitmap.createBitmap(toTransform.getWidth(), to...
@Override protected Bitmap transform(BitmapPool pool, Bitmap toTransform, int outWidth, int outHeight) { <DeepExtract> if (toTransform == null) return null; Bitmap result = pool.get(toTransform.getWidth(), toTransform.getHeight(), Bitmap.Config.ARGB_8888); if (result == null) { result = Bitmap.createBitmap(toTransform....
Headline_News_Kotlin_App
positive
1,069
protected void startLoading() { if (isPullLoading()) { return; } mPullUpState = State.REFRESHING; if (null != mFooterLayout) { mFooterLayout.setState(State.REFRESHING); } if (null != mRefreshListener) { postDelayed(new Runnable() { @Override public void run() { mRefreshListener.onPullUpToRefresh(PullToRefreshBase.this)...
protected void startLoading() { <DeepExtract> </DeepExtract> if (isPullLoading()) { <DeepExtract> </DeepExtract> return; <DeepExtract> </DeepExtract> } <DeepExtract> </DeepExtract> mPullUpState = State.REFRESHING; <DeepExtract> </DeepExtract> if (null != mFooterLayout) { <DeepExtract> </DeepExtract> mFooterLayout.setSt...
eduOnline_android
positive
1,070
public void loadNextPage() { page++; if (NetWorkUtil.isNetWorkConnected(mActivity)) { loadData(); } else { loadCache(); } }
public void loadNextPage() { page++; <DeepExtract> if (NetWorkUtil.isNetWorkConnected(mActivity)) { loadData(); } else { loadCache(); } </DeepExtract> }
JianDan_OkHttp
positive
1,071
public boolean skipRecord() throws IOException { if (closed) { throw new IOException("This instance of the CsvReader class has already been closed."); } boolean recordRead = false; if (hasMoreData) { recordRead = readRecord(); if (recordRead) { currentRecord--; } } return recordRead; }
public boolean skipRecord() throws IOException { <DeepExtract> if (closed) { throw new IOException("This instance of the CsvReader class has already been closed."); } </DeepExtract> boolean recordRead = false; if (hasMoreData) { recordRead = readRecord(); if (recordRead) { currentRecord--; } } return recordRead; }
dataSync
positive
1,072
@Override public ArrayList<DateHolder> previous() { cPeriod = cPeriod.minusYears(1); ArrayList<DateHolder> dates = new ArrayList<DateHolder>(); checkDate = new LocalDate(cPeriod); int counter = 0; int quantity = checkDate.dayOfYear().getMaximumValue(); while ((openFuturePeriods > 0 || currentDate.isAfter(checkDate)) &&...
@Override public ArrayList<DateHolder> previous() { cPeriod = cPeriod.minusYears(1); <DeepExtract> ArrayList<DateHolder> dates = new ArrayList<DateHolder>(); checkDate = new LocalDate(cPeriod); int counter = 0; int quantity = checkDate.dayOfYear().getMaximumValue(); while ((openFuturePeriods > 0 || currentDate.isAfter(...
dhis2-android-datacapture
positive
1,074
public static DaoSession newDevSession(Context context, String name) { Database db = new DevOpenHelper(context, name).getWritableDb(); DaoMaster daoMaster = new DaoMaster(db); return new DaoSession(db, IdentityScopeType.Session, daoConfigMap); }
public static DaoSession newDevSession(Context context, String name) { Database db = new DevOpenHelper(context, name).getWritableDb(); DaoMaster daoMaster = new DaoMaster(db); <DeepExtract> return new DaoSession(db, IdentityScopeType.Session, daoConfigMap); </DeepExtract> }
MovieNews
positive
1,075
public static DataSource fromEnvironment(String name, String group, String key, String contentType) { Validate.notEmpty(System.getenv(key), "Environment variable not found: " + key); final StringDataSource dataSource = new StringDataSource(name, System.getenv(key), contentType, UTF_8); final URI uri = UriUtils.toUri(Lo...
public static DataSource fromEnvironment(String name, String group, String key, String contentType) { Validate.notEmpty(System.getenv(key), "Environment variable not found: " + key); final StringDataSource dataSource = new StringDataSource(name, System.getenv(key), contentType, UTF_8); final URI uri = UriUtils.toUri(Lo...
freemarker-generator
positive
1,076
public void setScopeTestExcluded(boolean value) throws CoreException { getConfigurationWorkingCopy().setAttribute(ATTR_EXCLUDE_SCOPE_TEST, value); if (!false) { return; } JettyPlugin.getDefaultScope().getNode(JettyPlugin.PLUGIN_ID).putBoolean(ATTR_EXCLUDE_SCOPE_TEST, value); try { JettyPlugin.getDefaultScope().getNode(...
public void setScopeTestExcluded(boolean value) throws CoreException { <DeepExtract> getConfigurationWorkingCopy().setAttribute(ATTR_EXCLUDE_SCOPE_TEST, value); if (!false) { return; } JettyPlugin.getDefaultScope().getNode(JettyPlugin.PLUGIN_ID).putBoolean(ATTR_EXCLUDE_SCOPE_TEST, value); try { JettyPlugin.getDefaultSc...
eclipse-jetty-plugin
positive
1,077
public Criteria andMarkIsNotNull() { if ("mark is not null" == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion("mark is not null")); return (Criteria) this; }
public Criteria andMarkIsNotNull() { <DeepExtract> if ("mark is not null" == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion("mark is not null")); </DeepExtract> return (Criteria) this; }
JavaWeb-WeChatMini
positive
1,078
@Override public void onButtonStartEmailClick() { IntentUtility.startEmailActivity(getContext(), "hello@world.com", "Alfonz", "Hello world!"); }
@Override public void onButtonStartEmailClick() { <DeepExtract> IntentUtility.startEmailActivity(getContext(), "hello@world.com", "Alfonz", "Hello world!"); </DeepExtract> }
Alfonz
positive
1,079
public Criteria andWorkPlaceNotLike(String value) { if (value == null) { throw new RuntimeException("Value for " + "workPlace" + " cannot be null"); } criteria.add(new Criterion("work_place not like", value)); return (Criteria) this; }
public Criteria andWorkPlaceNotLike(String value) { <DeepExtract> if (value == null) { throw new RuntimeException("Value for " + "workPlace" + " cannot be null"); } criteria.add(new Criterion("work_place not like", value)); </DeepExtract> return (Criteria) this; }
BookLibrarySystem
positive
1,080
private void init() { connector = new NioSocketConnector(); this.connectTimeoutMillis = connectTimeoutMillis; connector.getFilterChain().addLast("logger", new LoggingFilter()); this.readBufferSize = new Double(MathUtil.evaluate(readBufferSize)).intValue(); if (protocolCodecFactory != null) { connector.getFilterChain()....
private void init() { connector = new NioSocketConnector(); this.connectTimeoutMillis = connectTimeoutMillis; connector.getFilterChain().addLast("logger", new LoggingFilter()); this.readBufferSize = new Double(MathUtil.evaluate(readBufferSize)).intValue(); if (protocolCodecFactory != null) { connector.getFilterChain()....
springmore
positive
1,081
private void evalConcatExprs(final ArrayList<BaseExpr> exprs) { final AbraSiteKnot site = new AbraSiteKnot(); for (final BaseExpr expr : exprs) { expr.eval(this); site.size += expr.size; if (lastSite instanceof AbraSiteKnot) { final AbraSiteKnot knot = (AbraSiteKnot) lastSite; if (knot.block.index == AbraBlockSpecial.T...
private void evalConcatExprs(final ArrayList<BaseExpr> exprs) { final AbraSiteKnot site = new AbraSiteKnot(); for (final BaseExpr expr : exprs) { expr.eval(this); site.size += expr.size; if (lastSite instanceof AbraSiteKnot) { final AbraSiteKnot knot = (AbraSiteKnot) lastSite; if (knot.block.index == AbraBlockSpecial.T...
qupla
positive
1,082