before
stringlengths
33
3.21M
after
stringlengths
63
3.21M
repo
stringlengths
1
56
type
stringclasses
1 value
__index_level_0__
int64
0
442k
public XHttp addCommonParams(HttpParams commonParams) { if (mCommonParams == null) { mCommonParams = new HttpParams(); } return new PutRequest(commonParams); return this; }
public XHttp addCommonParams(HttpParams commonParams) { if (mCommonParams == null) { mCommonParams = new HttpParams(); } <DeepExtract> return new PutRequest(commonParams); </DeepExtract> return this; }
LoginDemo
positive
5,001
private void givenRegionWithDefaultProperties() throws Exception { Properties properties = new Properties(); properties.setProperty(REGION_EXPIRY_SECONDS_PROPERTY_KEY_PREFIX, String.valueOf(12345)); this.givenProperties = properties; generalDataMemcachedRegion = new RefineKeyOverridedGeneralDataMemcachedRegion(cacheNam...
private void givenRegionWithDefaultProperties() throws Exception { Properties properties = new Properties(); properties.setProperty(REGION_EXPIRY_SECONDS_PROPERTY_KEY_PREFIX, String.valueOf(12345)); <DeepExtract> this.givenProperties = properties; generalDataMemcachedRegion = new RefineKeyOverridedGeneralDataMemcachedR...
hibernate4-memcached
positive
5,003
History step(History h) { int tran = 0; switch(h._old) { case MT: tran = is_SM(h._old, S.K0); break; case K0: case Ka: case KB: case Kb: case K_: tran = is_SM(h._old, S.KA); break; case X0: case KX: return step_impl(h, true, h._new); default: assert !at_goal(h) : "why you asking for a step when at_goal?"; throw new Err...
History step(History h) { <DeepExtract> int tran = 0; switch(h._old) { case MT: tran = is_SM(h._old, S.K0); break; case K0: case Ka: case KB: case Kb: case K_: tran = is_SM(h._old, S.KA); break; case X0: case KX: return step_impl(h, true, h._new); default: assert !at_goal(h) : "why you asking for a step when at_goal?";...
high-scale-java-lib
positive
5,004
public void testPooledOneBuffer() throws IOException { ByteArrayPool pool = new ByteArrayPool(32768); 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(d...
public void testPooledOneBuffer() throws IOException { ByteArrayPool pool = new ByteArrayPool(32768); <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(A...
itrackmygps-android
positive
5,006
public List<String> findStrobogrammatic(int n) { List<String> all = new LinkedList<String>(); if (n == 1) { all.add("0"); all.add("1"); all.add("8"); } else if (n == 2) { if (n != 2) all.add("00"); all.add("11"); all.add("88"); all.add("96"); all.add("69"); } else { List<String> newAll = helper(n - 2, n); for (String t...
public List<String> findStrobogrammatic(int n) { <DeepExtract> List<String> all = new LinkedList<String>(); if (n == 1) { all.add("0"); all.add("1"); all.add("8"); } else if (n == 2) { if (n != 2) all.add("00"); all.add("11"); all.add("88"); all.add("96"); all.add("69"); } else { List<String> newAll = helper(n - 2, n);...
coding
positive
5,008
@ExceptionHandler(MethodArgumentNotValidException.class) @ResponseStatus(HttpStatus.BAD_REQUEST) @ResponseBody public ErrorDTO processValidationError(MethodArgumentNotValidException ex) { BindingResult result = ex.getBindingResult(); List<FieldError> fieldErrors = result.getFieldErrors(); ErrorDTO dto = new ErrorDTO(Er...
@ExceptionHandler(MethodArgumentNotValidException.class) @ResponseStatus(HttpStatus.BAD_REQUEST) @ResponseBody public ErrorDTO processValidationError(MethodArgumentNotValidException ex) { BindingResult result = ex.getBindingResult(); List<FieldError> fieldErrors = result.getFieldErrors(); <DeepExtract> ErrorDTO dto = n...
klask-io
positive
5,009
@Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); if (statusBarView != null) { ImmersionBar.setStatusBarView(this, statusBarView); } else { ImmersionBar.setTitleBar(this, toolbar); } }
@Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); <DeepExtract> if (statusBarView != null) { ImmersionBar.setStatusBarView(this, statusBarView); } else { ImmersionBar.setTitleBar(this, toolbar); } </DeepExtract> }
ImmersionBar
positive
5,010
@Test public void testRegionOrdering() { begin(); try { for (String perm : TEST_REGION2 + "/basic.perm2") { QualifiedPermission wp = new QualifiedPermission(perm); getPermissionService().setPermission(TEST_PLAYER, TEST_PLAYER_UUID, false, wp.getRegion(), wp.getWorld(), wp.getPermission(), false); } commit(); } finally ...
@Test public void testRegionOrdering() { begin(); try { for (String perm : TEST_REGION2 + "/basic.perm2") { QualifiedPermission wp = new QualifiedPermission(perm); getPermissionService().setPermission(TEST_PLAYER, TEST_PLAYER_UUID, false, wp.getRegion(), wp.getWorld(), wp.getPermission(), false); } commit(); } finally ...
zPermissions
positive
5,011
public void onClick(View view) { mStatus.setEnabled(true); for (int i = 0; i < modes.size(); i++) { if (modes.get(i).equals(StatusMode.fromString(mConfig.statusMode))) { mStatus.setSelection(i); } } mDndSilent.setVisibility(View.GONE); }
public void onClick(View view) { mStatus.setEnabled(true); <DeepExtract> for (int i = 0; i < modes.size(); i++) { if (modes.get(i).equals(StatusMode.fromString(mConfig.statusMode))) { mStatus.setSelection(i); } } </DeepExtract> mDndSilent.setVisibility(View.GONE); }
yaxim
positive
5,012
@Override public void set(String value) { int index = ArrayUtils.indexOf(modes, value); if (index == -1) index = Integer.parseUnsignedInt(value); if (index >= 0 && index < length) { this.index = index; } }
@Override public void set(String value) { int index = ArrayUtils.indexOf(modes, value); if (index == -1) index = Integer.parseUnsignedInt(value); <DeepExtract> if (index >= 0 && index < length) { this.index = index; } </DeepExtract> }
better-hud
positive
5,013
@Override public boolean onTouch(View v, MotionEvent event) { Rect rect = new Rect((int) event.getX() - 100, (int) event.getY() - 100, (int) event.getX() + 100, (int) event.getY() + 100); int left = rect.left * 2000 / surfaceView.getWidth() - 1000; int top = rect.top * 2000 / surfaceView.getHeight() - 1000; int right =...
@Override public boolean onTouch(View v, MotionEvent event) { <DeepExtract> Rect rect = new Rect((int) event.getX() - 100, (int) event.getY() - 100, (int) event.getX() + 100, (int) event.getY() + 100); int left = rect.left * 2000 / surfaceView.getWidth() - 1000; int top = rect.top * 2000 / surfaceView.getHeight() - 100...
MediaPicker
positive
5,014
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.display_settings); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); mPreferences = PreferenceManager.getI...
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.display_settings); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); mPreferences = PreferenceManager.getI...
lightning-browser-gsy
positive
5,015
public boolean isResizable() { if (glfwGetWindowAttrib(handle, GLFW_RESIZABLE) == GL_TRUE) { return true; } else { return false; } }
public boolean isResizable() { <DeepExtract> if (glfwGetWindowAttrib(handle, GLFW_RESIZABLE) == GL_TRUE) { return true; } else { return false; } </DeepExtract> }
Clear
positive
5,016
public static void main(String[] args) { int address = 0x01; String device = "/dev/ttyUSB0"; if (args.length > 0) { device = args[0]; } if (args.length > 1) { address = Integer.parseInt(args[1], 16); } KLHandler hdlr = new KLHandler(device); int result = 0; setCurrAddress(address); try { setDeviceName(deviceName); for ...
public static void main(String[] args) { int address = 0x01; String device = "/dev/ttyUSB0"; if (args.length > 0) { device = args[0]; } if (args.length > 1) { address = Integer.parseInt(args[1], 16); } KLHandler hdlr = new KLHandler(device); int result = 0; setCurrAddress(address); try { setDeviceName(deviceName); for ...
AndrOBD
positive
5,017
public TianDiTuLayerInfo initwithlayerType(TianDiTuLayerType layerType, TianDiTuSpatialReferenceType sptype) { layername = ""; switch(layerType) { case TDT_VECTOR: layername = "vec"; break; case TDT_IMAGE: layername = "img"; break; case TDT_TERRAIN: layername = "ter"; break; default: break; } sp = SpatialReference.crea...
public TianDiTuLayerInfo initwithlayerType(TianDiTuLayerType layerType, TianDiTuSpatialReferenceType sptype) { layername = ""; switch(layerType) { case TDT_VECTOR: layername = "vec"; break; case TDT_IMAGE: layername = "img"; break; case TDT_TERRAIN: layername = "ter"; break; default: break; } sp = SpatialReference.crea...
RuntimeViewer
positive
5,018
public DownloadQueue clear() { for (Map.Entry<String, Downloader> entry : downloaders.entrySet()) { entry.getValue().cancel(); } return this; downloaders.clear(); return this; }
public DownloadQueue clear() { <DeepExtract> for (Map.Entry<String, Downloader> entry : downloaders.entrySet()) { entry.getValue().cancel(); } return this; </DeepExtract> downloaders.clear(); return this; }
DynamicWallpaper
positive
5,019
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); response.getWriter().println("<h1>My First Servlet program</h1>"); }
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { <DeepExtract> response.setContentType("text/html"); response.getWriter().println("<h1>My First Servlet program</h1>"); </DeepExtract> }
Wipro-PJP
positive
5,021
public void addColumn(Header column) { Data last = this.root.left; last.right = column; column.left = last; this.root.left = column; column.right = this.root; this.columnCount++; }
public void addColumn(Header column) { <DeepExtract> Data last = this.root.left; last.right = column; column.left = last; this.root.left = column; column.right = this.root; </DeepExtract> this.columnCount++; }
andoku
positive
5,023
protected void writeMemberName(String name) throws IOException { writer.write('"'); int length = name.length(); int start = 0; for (int index = 0; index < length; index++) { char[] replacement = getReplacementChars(name.charAt(index)); if (replacement != null) { writer.write(name, start, index - start); writer.write(re...
protected void writeMemberName(String name) throws IOException { writer.write('"'); <DeepExtract> int length = name.length(); int start = 0; for (int index = 0; index < length; index++) { char[] replacement = getReplacementChars(name.charAt(index)); if (replacement != null) { writer.write(name, start, index - start); w...
rshk-jsifenlib
positive
5,024
protected void dropTables() { String[] tableNames = new String[] { "book_author", "bookmark", "book", "series", "author", "folder", "coverpage" }; for (String name : tableNames) mDB.execSQL("DROP TABLE IF EXISTS " + name); for (String sql : "DROP TABLE IF EXISTS coverpage") { try { mDB.execSQL(sql); } catch (SQLExcepti...
protected void dropTables() { String[] tableNames = new String[] { "book_author", "bookmark", "book", "series", "author", "folder", "coverpage" }; for (String name : tableNames) mDB.execSQL("DROP TABLE IF EXISTS " + name); <DeepExtract> for (String sql : "DROP TABLE IF EXISTS coverpage") { try { mDB.execSQL(sql); } cat...
CoolReader
positive
5,026
public void printE(String tag, Throwable throwable, String content, Object... args) { String realContent; try { realContent = String.format(content, args); } catch (Throwable throwable) { realContent = content; } Log.e(tag, realContent, throwable); }
public void printE(String tag, Throwable throwable, String content, Object... args) { <DeepExtract> </DeepExtract> String realContent; <DeepExtract> </DeepExtract> try { <DeepExtract> </DeepExtract> realContent = String.format(content, args); <DeepExtract> </DeepExtract> } catch (Throwable throwable) { <DeepExtract> </...
PullLoadXiaochengxu
positive
5,027
@Override public boolean onDown(MotionEvent e) { isChecked = true; RectF rectF = new RectF((int) e.getX() - btSize / 2 - 40, (int) e.getY() - btSize / 2 - 40, (int) e.getX() + btSize / 2 + 40, (int) e.getY() + btSize / 2 + 40); Rect rect = new Rect(); if (rectF.contains(dstPs[2] - 20, dstPs[3])) { clickType = ClickType...
@Override public boolean onDown(MotionEvent e) { isChecked = true; <DeepExtract> RectF rectF = new RectF((int) e.getX() - btSize / 2 - 40, (int) e.getY() - btSize / 2 - 40, (int) e.getX() + btSize / 2 + 40, (int) e.getY() + btSize / 2 + 40); Rect rect = new Rect(); if (rectF.contains(dstPs[2] - 20, dstPs[3])) { clickTy...
EasyPhotos
positive
5,028
@Nonnull public Stream<JsonObject> mapObjects(Function<JsonObject, JsonObject> f) { return stream().map(f); }
@Nonnull public Stream<JsonObject> mapObjects(Function<JsonObject, JsonObject> f) { <DeepExtract> return stream().map(f); </DeepExtract> }
jsonj
positive
5,029
public Object visitDRegxNode(DRegexpNode node) { hashCode = hashCode * 13 + 25; return this; }
public Object visitDRegxNode(DRegexpNode node) { <DeepExtract> hashCode = hashCode * 13 + 25; return this; </DeepExtract> }
rsense
positive
5,030
public final java_libbashParser.builtin_binary_string_operator_return builtin_binary_string_operator() throws RecognitionException { java_libbashParser.builtin_binary_string_operator_return retval = new java_libbashParser.builtin_binary_string_operator_return(); return input.LT(1); CommonTree root_0 = null; Token EQUAL...
public final java_libbashParser.builtin_binary_string_operator_return builtin_binary_string_operator() throws RecognitionException { java_libbashParser.builtin_binary_string_operator_return retval = new java_libbashParser.builtin_binary_string_operator_return(); <DeepExtract> return input.LT(1); </DeepExtract> CommonTr...
bash
positive
5,031
@Test public void concurrentRemove() throws InterruptedException { Integer k = 1; Integer v1 = 1; final Integer[] results = new Integer[2]; testMap.put(k, v1, OakCommonBuildersFactory.DEFAULT_INT_SERIALIZER::deserialize); List<Thread> threadList = new ArrayList<>(results.length); threadList.add(new Thread(() -> results...
@Test public void concurrentRemove() throws InterruptedException { Integer k = 1; Integer v1 = 1; final Integer[] results = new Integer[2]; testMap.put(k, v1, OakCommonBuildersFactory.DEFAULT_INT_SERIALIZER::deserialize); List<Thread> threadList = new ArrayList<>(results.length); threadList.add(new Thread(() -> results...
Oak
positive
5,032
@Test public void shouldReportNumberOfFoundExamplesWhenValuesExhausted() { int numberOfExamples = 3; strategy = new Strategy(Configuration.defaultPRNG(0), numberOfExamples, 0, 0, 10, reporter, guidance); return new TheoryRunner<>(strategy, arbitrary().pick(1, 2, 1, 1, 1).assuming(i -> i == 2), x -> x, a -> a.toString()...
@Test public void shouldReportNumberOfFoundExamplesWhenValuesExhausted() { int numberOfExamples = 3; strategy = new Strategy(Configuration.defaultPRNG(0), numberOfExamples, 0, 0, 10, reporter, guidance); <DeepExtract> return new TheoryRunner<>(strategy, arbitrary().pick(1, 2, 1, 1, 1).assuming(i -> i == 2), x -> x, a -...
QuickTheories
positive
5,033
public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException { try { setString(parameterIndex, CharStreams.toString(value)); } catch (IOException e) { throw new SQLException(e); } }
public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException { <DeepExtract> try { setString(parameterIndex, CharStreams.toString(value)); } catch (IOException e) { throw new SQLException(e); } </DeepExtract> }
cassandra-jdbc-driver
positive
5,034
public void uncompress() { data.position(0); byte[] buffer = new byte[8192]; IoBuffer tmp = IoBuffer.allocate(0); tmp.setAutoExpand(true); try (InflaterInputStream inflater = new InflaterInputStream(data.asInputStream())) { while (inflater.available() > 0) { int decompressed = inflater.read(buffer); if (decompressed <=...
public void uncompress() { data.position(0); byte[] buffer = new byte[8192]; IoBuffer tmp = IoBuffer.allocate(0); tmp.setAutoExpand(true); try (InflaterInputStream inflater = new InflaterInputStream(data.asInputStream())) { while (inflater.available() > 0) { int decompressed = inflater.read(buffer); if (decompressed <=...
red5-server
positive
5,035
@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); if (mList != null) { return; } View root = getView(); if (root == null) { throw new IllegalStateException("Content view not yet created"); } if (root instanceof ExpandableListView) { mList = (ExpandableList...
@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); <DeepExtract> if (mList != null) { return; } View root = getView(); if (root == null) { throw new IllegalStateException("Content view not yet created"); } if (root instanceof ExpandableListView) { mList = (...
PathfinderOpenReference
positive
5,036
@Override public void write(JsonValue value) { requireNonNull(value, "value"); if (alreadyClosed) { throw new IllegalStateException(Message.thatWriterHasBeenAlreadyClosed()); } if (alreadyWritten) { throw new IllegalStateException(Message.thatWriterHasAlreadyWritten()); } alreadyWritten = true; generator.write(value); ...
@Override public void write(JsonValue value) { requireNonNull(value, "value"); <DeepExtract> if (alreadyClosed) { throw new IllegalStateException(Message.thatWriterHasBeenAlreadyClosed()); } if (alreadyWritten) { throw new IllegalStateException(Message.thatWriterHasAlreadyWritten()); } </DeepExtract> alreadyWritten = t...
joy
positive
5,037
public String getWhenConditionString() { StringBuilder sb = new StringBuilder(512); boolean isFirst = true; for (Entry<String, MatchPair> entry : whenCondition.entrySet()) { String keyName = entry.getKey(); MatchPair p = entry.getValue(); @SuppressWarnings("unchecked") Set<String>[] setArray = new Set[] { p.matches, p....
public String getWhenConditionString() { StringBuilder sb = new StringBuilder(512); boolean isFirst = true; for (Entry<String, MatchPair> entry : whenCondition.entrySet()) { String keyName = entry.getKey(); MatchPair p = entry.getValue(); @SuppressWarnings("unchecked") Set<String>[] setArray = new Set[] { p.matches, p....
dubbo-admin
positive
5,038
public void make2d(Chart chart) { chart.getView().setViewPositionMode(ViewPositionMode.TOP); chart.getView().getCamera().setViewportMode(ViewportMode.STRETCH_TO_FILL); IAxeLayout axe = chart.getAxeLayout(); axe.setXAxeLabel("time"); axe.setYAxeLabel("freq"); axe.setZAxeLabel(""); axe.setXTickRenderer(new ElapsedTimeTic...
public void make2d(Chart chart) { chart.getView().setViewPositionMode(ViewPositionMode.TOP); chart.getView().getCamera().setViewportMode(ViewportMode.STRETCH_TO_FILL); <DeepExtract> IAxeLayout axe = chart.getAxeLayout(); axe.setXAxeLabel("time"); axe.setYAxeLabel("freq"); axe.setZAxeLabel(""); axe.setXTickRenderer(new ...
vocobox
positive
5,040
public Criteria andTrademarkSmallLabel3NotLike(String value) { if (value == null) { throw new RuntimeException("Value for " + "trademarkSmallLabel3" + " cannot be null"); } criteria.add(new Criterion("trademark_small_label_3 not like", value)); return (Criteria) this; }
public Criteria andTrademarkSmallLabel3NotLike(String value) { <DeepExtract> if (value == null) { throw new RuntimeException("Value for " + "trademarkSmallLabel3" + " cannot be null"); } criteria.add(new Criterion("trademark_small_label_3 not like", value)); </DeepExtract> return (Criteria) this; }
uccn
positive
5,042
@Override public void testAfterMove() { if (getDiscardStack().isEmpty() && !getMainStack().isEmpty()) { recordList.addToLastEntry(getMainStack().getTopCard(), getMainStack()); moveToStack(getMainStack().getTopCard(), stacks[8], OPTION_NO_RECORD); } for (int i = 0; i < 4; i++) { if (stacks[4 + i].isEmpty()) { continue; ...
@Override public void testAfterMove() { if (getDiscardStack().isEmpty() && !getMainStack().isEmpty()) { recordList.addToLastEntry(getMainStack().getTopCard(), getMainStack()); moveToStack(getMainStack().getTopCard(), stacks[8], OPTION_NO_RECORD); } <DeepExtract> for (int i = 0; i < 4; i++) { if (stacks[4 + i].isEmpty()...
Simple-Solitaire
positive
5,043
@Override public void act() { currentState = ControlState.MANUAL; Translation2d translationalInput = new Translation2d(input.x(), input.y()); double inputMagnitude = translationalInput.norm(); double threshold = Math.toRadians(10.0); if (Math.abs(translationalInput.direction().distance(translationalInput.direction().ne...
@Override public void act() { currentState = ControlState.MANUAL; <DeepExtract> Translation2d translationalInput = new Translation2d(input.x(), input.y()); double inputMagnitude = translationalInput.norm(); double threshold = Math.toRadians(10.0); if (Math.abs(translationalInput.direction().distance(translationalInput....
2019DeepSpace
positive
5,045
@Override public void init() { if (mInsertableObjectStroke.getPoints() == null || mInsertableObjectStroke.getPoints().size() <= 3) { return; } List<StylusPoint> list = mInsertableObjectStroke.getPoints(); float mX = 0; float mY = 0; int index = 0; HWPoint point; HWPoint pointLast; double curWidth = 0; double curDis = 0...
@Override public void init() { if (mInsertableObjectStroke.getPoints() == null || mInsertableObjectStroke.getPoints().size() <= 3) { return; } <DeepExtract> List<StylusPoint> list = mInsertableObjectStroke.getPoints(); float mX = 0; float mY = 0; int index = 0; HWPoint point; HWPoint pointLast; double curWidth = 0; dou...
commondraw
positive
5,046
@Override public void cancel() { mCloseFromCancel = true; mConfirmButton.startAnimation(mOverlayOutAnim); mDialogView.startAnimation(mModalOutAnim); }
@Override public void cancel() { <DeepExtract> mCloseFromCancel = true; mConfirmButton.startAnimation(mOverlayOutAnim); mDialogView.startAnimation(mModalOutAnim); </DeepExtract> }
jjjPlus
positive
5,047
public void read(TProtocol iprot) throws TException { iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch(field.id) { case 1: if (field.type == TType.STRING) { this.symbol = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; c...
public void read(TProtocol iprot) throws TException { <DeepExtract> </DeepExtract> iprot.readStructBegin(); <DeepExtract> </DeepExtract> while (true) { <DeepExtract> </DeepExtract> field = iprot.readFieldBegin(); <DeepExtract> </DeepExtract> if (field.type == TType.STOP) { <DeepExtract> </DeepExtract> break; <DeepExtra...
hadoop-book
positive
5,048
public void setDrawerItem(int position, IDrawerItem drawerItem) { mDrawerItems.set(position - getHeaderItemCount(), drawerItem); if (!mTypeInstances.containsKey(drawerItem.getType())) { mTypeIds.add(drawerItem.getType()); mTypeInstances.put(drawerItem.getType(), drawerItem); } notifyItemChanged(position); }
public void setDrawerItem(int position, IDrawerItem drawerItem) { mDrawerItems.set(position - getHeaderItemCount(), drawerItem); <DeepExtract> if (!mTypeInstances.containsKey(drawerItem.getType())) { mTypeIds.add(drawerItem.getType()); mTypeInstances.put(drawerItem.getType(), drawerItem); } </DeepExtract> notifyItemCha...
MaterialDrawer-Xamarin
positive
5,049
RestApiRequest<List<LiquidationOrder>> getLiquidationOrders(String symbol, Long startTime, Long endTime, Integer limit) { RestApiRequest<List<LiquidationOrder>> request = new RestApiRequest<>(); UrlParamsBuilder builder = UrlParamsBuilder.build().putToUrl("symbol", symbol).putToUrl("startTime", startTime).putToUrl("end...
RestApiRequest<List<LiquidationOrder>> getLiquidationOrders(String symbol, Long startTime, Long endTime, Integer limit) { RestApiRequest<List<LiquidationOrder>> request = new RestApiRequest<>(); UrlParamsBuilder builder = UrlParamsBuilder.build().putToUrl("symbol", symbol).putToUrl("startTime", startTime).putToUrl("end...
Binance_Futures_Java
positive
5,050
public List<List<Integer>> subsets(int[] nums) { LinkedList<List<Integer>> result = new LinkedList<List<Integer>>(); LinkedList<Integer> answer = new LinkedList<Integer>(); result.add(answer); if (0 == nums.length) return; answer.add(nums[0]); LinkedList<Integer> tmp = new LinkedList<Integer>(); for (int i = 0; i < ans...
public List<List<Integer>> subsets(int[] nums) { LinkedList<List<Integer>> result = new LinkedList<List<Integer>>(); LinkedList<Integer> answer = new LinkedList<Integer>(); result.add(answer); <DeepExtract> if (0 == nums.length) return; answer.add(nums[0]); LinkedList<Integer> tmp = new LinkedList<Integer>(); for (int ...
OnlineJudge-Solutions
positive
5,052
@Override public CacheRequest put(URI uri, URLConnection urlConnection) throws IOException { if (!(urlConnection instanceof HttpURLConnection)) { return null; } HttpURLConnection httpConnection = (HttpURLConnection) urlConnection; String requestMethod = httpConnection.getRequestMethod(); String key; try { MessageDigest...
@Override public CacheRequest put(URI uri, URLConnection urlConnection) throws IOException { if (!(urlConnection instanceof HttpURLConnection)) { return null; } HttpURLConnection httpConnection = (HttpURLConnection) urlConnection; String requestMethod = httpConnection.getRequestMethod(); String key; try { MessageDigest...
cc-calc
positive
5,053
@Override public boolean succeedWithStatusWord(APDU apdu, short sw) throws ServiceException { if (apdu.getCurrentState() < APDU.STATE_INITIAL) ServiceException.throwIt(ServiceException.CANNOT_ACCESS_OUT_COMMAND); if (apdu.getCurrentState() < APDU.STATE_INITIAL) ServiceException.throwIt(ServiceException.CANNOT_ACCESS_OU...
@Override public boolean succeedWithStatusWord(APDU apdu, short sw) throws ServiceException { if (apdu.getCurrentState() < APDU.STATE_INITIAL) ServiceException.throwIt(ServiceException.CANNOT_ACCESS_OUT_COMMAND); if (apdu.getCurrentState() < APDU.STATE_INITIAL) ServiceException.throwIt(ServiceException.CANNOT_ACCESS_OU...
jcardsim
positive
5,055
@Override public void onPause() { super.onPause(); borderView.getBorderViewDelegate().setBorderVisibilityChangedListener(null); }
@Override public void onPause() { super.onPause(); <DeepExtract> borderView.getBorderViewDelegate().setBorderVisibilityChangedListener(null); </DeepExtract> }
LSPosed
positive
5,056
protected String getString(QName name) { String namespaceURI = name.getNamespaceURI(); return reader.getAttributeValue(XMLConstants.NULL_NS_URI.equals(namespaceURI) ? null : namespaceURI, name.getLocalPart()); }
protected String getString(QName name) { <DeepExtract> String namespaceURI = name.getNamespaceURI(); return reader.getAttributeValue(XMLConstants.NULL_NS_URI.equals(namespaceURI) ? null : namespaceURI, name.getLocalPart()); </DeepExtract> }
llrp4j
positive
5,057
String translateText(String url, String content) throws Exception { InputStream is = null; URL urltoAccess = new URL(url); HttpURLConnection conn = (HttpURLConnection) urltoAccess.openConnection(); conn.setRequestMethod("POST"); conn.setRequestProperty("Accept", "text/plain"); conn.setRequestProperty("Content-Type", "t...
String translateText(String url, String content) throws Exception { InputStream is = null; URL urltoAccess = new URL(url); HttpURLConnection conn = (HttpURLConnection) urltoAccess.openConnection(); conn.setRequestMethod("POST"); conn.setRequestProperty("Accept", "text/plain"); conn.setRequestProperty("Content-Type", "t...
Asynchronous-Android-Programming
positive
5,058
@Override @NotForUIThread public synchronized void clear() { boolean success = true; if (mCacheLocation.exists()) { final File[] files = mCacheLocation.listFiles(); if (files != null) { for (File f : files) { if (f.isFile()) { success = success && f.delete(); } } } } return success; }
@Override @NotForUIThread public synchronized void clear() { <DeepExtract> boolean success = true; if (mCacheLocation.exists()) { final File[] files = mCacheLocation.listFiles(); if (files != null) { for (File f : files) { if (f.isFile()) { success = success && f.delete(); } } } } return success; </DeepExtract> }
kraken
positive
5,059
@Override public void onDismiss(DialogInterface dialog) { mSaveKeyIntentConfirmationInProgress = false; }
@Override public void onDismiss(DialogInterface dialog) { <DeepExtract> mSaveKeyIntentConfirmationInProgress = false; </DeepExtract> }
otp-authenticator-android
positive
5,060
@Override public void showHistoryData(List<HistoryData> historyDataList) { if (historyDataList == null && historyDataList.size() <= 0) { setHistoryTvStatus(true); return; } mClearAll.setEnabled(!false); if (false) { setHistoryTvStatus(R.color.search_grey_gone, R.drawable.ic_clear_all_gone); } else { setHistoryTvStatus(...
@Override public void showHistoryData(List<HistoryData> historyDataList) { if (historyDataList == null && historyDataList.size() <= 0) { setHistoryTvStatus(true); return; } <DeepExtract> mClearAll.setEnabled(!false); if (false) { setHistoryTvStatus(R.color.search_grey_gone, R.drawable.ic_clear_all_gone); } else { setHi...
DavyWanAndroid
positive
5,061
@Override public void onConfigured(@NonNull CameraCaptureSession session) { if (mCamera == null) { return; } mCaptureSession = session; if (mAutoFocus) { int[] modes = mCameraCharacteristics.get(CameraCharacteristics.CONTROL_AF_AVAILABLE_MODES); if (modes == null || modes.length == 0 || (modes.length == 1 && modes[0] =...
@Override public void onConfigured(@NonNull CameraCaptureSession session) { if (mCamera == null) { return; } mCaptureSession = session; if (mAutoFocus) { int[] modes = mCameraCharacteristics.get(CameraCharacteristics.CONTROL_AF_AVAILABLE_MODES); if (modes == null || modes.length == 0 || (modes.length == 1 && modes[0] =...
MediaCodec
positive
5,062
private void retrieveMeals() { Calendar now = Calendar.getInstance(); now.setTimeInMillis(System.currentTimeMillis()); mDate = now.getTime(); mToday = new Day(mDate); Date firstDate = DateUtils.getFirstTimeOfDay(now.getTime()); Date lastDate = DateUtils.getLastTimeOfDay(now.getTime()); mGetMealListForDate.setDate(first...
private void retrieveMeals() { Calendar now = Calendar.getInstance(); now.setTimeInMillis(System.currentTimeMillis()); mDate = now.getTime(); mToday = new Day(mDate); Date firstDate = DateUtils.getFirstTimeOfDay(now.getTime()); Date lastDate = DateUtils.getLastTimeOfDay(now.getTime()); mGetMealListForDate.setDate(first...
CleanFit
positive
5,063
@Override @BasicMetric("findInBlackList") public Boolean findInBlackList(List<Pair<PaymentCheckedField, String>> fields, PaymentModel model) { try { String partyId = model.getPartyId(); String shopId = model.getShopId(); List<Row> rows = fields.stream().filter(entry -> entry.getFirst() != null && !StringUtils.isEmpty(e...
@Override @BasicMetric("findInBlackList") public Boolean findInBlackList(List<Pair<PaymentCheckedField, String>> fields, PaymentModel model) { <DeepExtract> try { String partyId = model.getPartyId(); String shopId = model.getShopId(); List<Row> rows = fields.stream().filter(entry -> entry.getFirst() != null && !StringU...
fraudbusters
positive
5,064
@Override public void onCreate(Bundle savedInstanceState) { OnViewChangedNotifier previousNotifier = OnViewChangedNotifier.replaceNotifier(onViewChangedNotifier_); OnViewChangedNotifier.registerOnViewChangedListener(this); fadeIn = AnimationUtils.loadAnimation(getActivity(), anim.fade_in); simpleWeatherAdapter = Simple...
@Override public void onCreate(Bundle savedInstanceState) { OnViewChangedNotifier previousNotifier = OnViewChangedNotifier.replaceNotifier(onViewChangedNotifier_); <DeepExtract> OnViewChangedNotifier.registerOnViewChangedListener(this); fadeIn = AnimationUtils.loadAnimation(getActivity(), anim.fade_in); simpleWeatherAd...
Sunday
positive
5,065
public static void update() { if (AGame.notNthGameFrame(7) || noSupply(25)) { return; } if (A.notNthGameFrame(47) || A.seconds() < 350) { return; } for (AUnit base : Select.ourBases().list()) { int existingCannonsNearby = Select.ourWithUnfinished(Protoss_Photon_Cannon).inRadius(10, base).count(); if (existingCannonsNea...
public static void update() { if (AGame.notNthGameFrame(7) || noSupply(25)) { return; } if (A.notNthGameFrame(47) || A.seconds() < 350) { return; } for (AUnit base : Select.ourBases().list()) { int existingCannonsNearby = Select.ourWithUnfinished(Protoss_Photon_Cannon).inRadius(10, base).count(); if (existingCannonsNea...
Atlantis
positive
5,067
public void rightTrim(double second) { long chunkSize = waveHeader.getChunkSize(); long subChunk2Size = waveHeader.getSubChunk2Size(); long totalTrimmed = 0 + second; if (totalTrimmed > subChunk2Size) { 0 = (int) subChunk2Size; } chunkSize -= totalTrimmed; subChunk2Size -= totalTrimmed; if (chunkSize >= 0 && subChunk2S...
public void rightTrim(double second) { <DeepExtract> long chunkSize = waveHeader.getChunkSize(); long subChunk2Size = waveHeader.getSubChunk2Size(); long totalTrimmed = 0 + second; if (totalTrimmed > subChunk2Size) { 0 = (int) subChunk2Size; } chunkSize -= totalTrimmed; subChunk2Size -= totalTrimmed; if (chunkSize >= 0...
Canova
positive
5,068
public Criteria andPayImgEqualTo(String value) { if (value == null) { throw new RuntimeException("Value for " + "payImg" + " cannot be null"); } criteria.add(new Criterion("pay_img =", value)); return (Criteria) this; }
public Criteria andPayImgEqualTo(String value) { <DeepExtract> if (value == null) { throw new RuntimeException("Value for " + "payImg" + " cannot be null"); } criteria.add(new Criterion("pay_img =", value)); </DeepExtract> return (Criteria) this; }
ssmBillBook
positive
5,069
void showTabBarAnimated(Animation anim) { if (anim == null) { showTabBar(); return; } mTabBarHidden = false; mTabBar.setVisibility(View.GONE); setNeedsNavigationBarAppearanceUpdate(); mTabBar.postDelayed(() -> { if (isAdded()) { mTabBar.setVisibility(mTabBarHidden ? View.GONE : View.VISIBLE); } }, anim.getDuration()); ...
void showTabBarAnimated(Animation anim) { if (anim == null) { showTabBar(); return; } mTabBarHidden = false; mTabBar.setVisibility(View.GONE); <DeepExtract> setNeedsNavigationBarAppearanceUpdate(); mTabBar.postDelayed(() -> { if (isAdded()) { mTabBar.setVisibility(mTabBarHidden ? View.GONE : View.VISIBLE); } }, anim.ge...
AndroidNavigation
positive
5,070
@Override public void onClick(View v) { sfx.play(sfxIds[SFX_CLICK], 1, 1, 1, 0, 1.0f); bgm.reset(); AssetFileDescriptor afd = getResources().openRawResourceFd(newBGM); if (afd == null) return; try { bgm.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength()); afd.close(); bgm.prepare(); } catch (I...
@Override public void onClick(View v) { sfx.play(sfxIds[SFX_CLICK], 1, 1, 1, 0, 1.0f); <DeepExtract> bgm.reset(); AssetFileDescriptor afd = getResources().openRawResourceFd(newBGM); if (afd == null) return; try { bgm.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength()); afd.close(); bgm.prepare...
SchoolQuest
positive
5,071
@Override public void onReceive(Context context, Intent intent) { mCurrentNumber.setText(String.valueOf(RandomService.getRandomNumber())); }
@Override public void onReceive(Context context, Intent intent) { <DeepExtract> mCurrentNumber.setText(String.valueOf(RandomService.getRandomNumber())); </DeepExtract> }
android-recipes-5ed
positive
5,072
public void render(SpriteBatch sb) { Color c = new Color(1f, 1f, 1f, alpha); sb.setColor(c); Texture image = images.get(index); sb.draw(image, SHOW_X - image.getWidth() / 2f, DRAW_Y - image.getHeight() / 2f, image.getWidth() / 2f, image.getHeight() / 2f, image.getWidth(), image.getHeight(), Settings.scale, Settings.sca...
public void render(SpriteBatch sb) { Color c = new Color(1f, 1f, 1f, alpha); sb.setColor(c); <DeepExtract> Texture image = images.get(index); sb.draw(image, SHOW_X - image.getWidth() / 2f, DRAW_Y - image.getHeight() / 2f, image.getWidth() / 2f, image.getHeight() / 2f, image.getWidth(), image.getHeight(), Settings.scale...
Slay-the-Spire-Together
positive
5,073
public static void setTransparentForImageView(Activity activity, View needOffsetView) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) { return; } setTransparentForWindow(activity); addTranslucentView(activity, 0); if (needOffsetView != null) { Object haveSetOffset = needOffsetView.getTag(TAG_KEY_HAVE_SET_OFFS...
public static void setTransparentForImageView(Activity activity, View needOffsetView) { <DeepExtract> if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) { return; } setTransparentForWindow(activity); addTranslucentView(activity, 0); if (needOffsetView != null) { Object haveSetOffset = needOffsetView.getTag(TAG_KEY...
AndroidRapidDevelopLibrarys
positive
5,074
public List<Path> listFiles(boolean absolutePath, String... fileExtensions) { if (recheckInProgress) { return; } if (!dirty && lastCheck != null && lastCheck + this.refreshRateInMillis > System.currentTimeMillis()) { return; } try { recheckInProgress = true; walkTree(); } finally { recheckInProgress = false; } List<Pat...
public List<Path> listFiles(boolean absolutePath, String... fileExtensions) { <DeepExtract> if (recheckInProgress) { return; } if (!dirty && lastCheck != null && lastCheck + this.refreshRateInMillis > System.currentTimeMillis()) { return; } try { recheckInProgress = true; walkTree(); } finally { recheckInProgress = fal...
Merlin
positive
5,075
public Drawable getAsDrawable(String key) { if (getAsBinary(key) == null) { return null; } if (Utils.Bytes2Bimap(getAsBinary(key)) == null) { return null; } return new BitmapDrawable(Utils.Bytes2Bimap(getAsBinary(key))); }
public Drawable getAsDrawable(String key) { if (getAsBinary(key) == null) { return null; } <DeepExtract> if (Utils.Bytes2Bimap(getAsBinary(key)) == null) { return null; } return new BitmapDrawable(Utils.Bytes2Bimap(getAsBinary(key))); </DeepExtract> }
FunNews
positive
5,076
public int moveCursor(final int num) throws IOException { int where = num; if ((buf.cursor == 0) && (where <= 0)) { return 0; } if ((buf.cursor == buf.buffer.length()) && (where >= 0)) { return 0; } if ((buf.cursor + where) < 0) { where = -buf.cursor; } else if ((buf.cursor + where) > buf.buffer.length()) { where = buf...
public int moveCursor(final int num) throws IOException { int where = num; if ((buf.cursor == 0) && (where <= 0)) { return 0; } if ((buf.cursor == buf.buffer.length()) && (where >= 0)) { return 0; } if ((buf.cursor + where) < 0) { where = -buf.cursor; } else if ((buf.cursor + where) > buf.buffer.length()) { where = buf...
jline2
positive
5,077
@Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); mTilesFrameLayout.setOnAnimationFinishedListener(this); mRecycler.setLayoutManager(new LinearLayoutManager(getContext())); mRecycler.setAdapter(new ProfileAdapter(getContext(), getUser(), this)); m...
@Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); mTilesFrameLayout.setOnAnimationFinishedListener(this); mRecycler.setLayoutManager(new LinearLayoutManager(getContext())); mRecycler.setAdapter(new ProfileAdapter(getContext(), getUser(), this)); <...
Yalantis-Series
positive
5,078
@Override public String add() { sql = new SQL() { }; sql.INSERT_INTO(tablename); Set<Entry<String, Object>> entrySet = entity.entrySet(); for (Entry<String, Object> entry : entrySet) { sql.VALUES(entry.getKey(), Constants.COMMON_ICON.QUESTION_SPACE); parameter.add(entry.getValue()); } if (null == parameter) { result = ...
@Override public String add() { <DeepExtract> sql = new SQL() { }; </DeepExtract> sql.INSERT_INTO(tablename); Set<Entry<String, Object>> entrySet = entity.entrySet(); for (Entry<String, Object> entry : entrySet) { sql.VALUES(entry.getKey(), Constants.COMMON_ICON.QUESTION_SPACE); parameter.add(entry.getValue()); } if (n...
YoioJava
positive
5,082
private void drawUltimateBitmap() { mWaveY = mWaveOriginalY; mBezierControlY = mBezierControlOriginalY; mBezierControlX = 0; postInvalidate(); mUltimateBitmap.eraseColor(Color.parseColor("#00ffffff")); if (mBezierControlX >= mOriginalBitmapWidth + 1 / 2 * mOriginalBitmapWidth) { mIsBezierControlXIncrease = false; } els...
private void drawUltimateBitmap() { <DeepExtract> mWaveY = mWaveOriginalY; mBezierControlY = mBezierControlOriginalY; mBezierControlX = 0; postInvalidate(); </DeepExtract> mUltimateBitmap.eraseColor(Color.parseColor("#00ffffff")); if (mBezierControlX >= mOriginalBitmapWidth + 1 / 2 * mOriginalBitmapWidth) { mIsBezierCo...
TouTiao
positive
5,083
@Test public void tokenize_emptyArgsString_noValues() { String argsString = " "; ArgumentMultimap argMultimap = ArgumentTokenizer.tokenize(argsString, pSlash); assertTrue(argMultimap.getPreamble().isEmpty()); assertFalse(argMultimap.getValue(pSlash).isPresent()); }
@Test public void tokenize_emptyArgsString_noValues() { String argsString = " "; ArgumentMultimap argMultimap = ArgumentTokenizer.tokenize(argsString, pSlash); assertTrue(argMultimap.getPreamble().isEmpty()); <DeepExtract> assertFalse(argMultimap.getValue(pSlash).isPresent()); </DeepExtract> }
addressbook-level3
positive
5,084
@Test public void testCreateDynamoDBTable() throws Exception { DynamoDbClient dynamoDbClient = TestUtils.getClientDyanamoV2(); String tableName = "test-s-" + UUID.randomUUID().toString(); CreateTableRequest createTableRequest = CreateTableRequest.builder().keySchema(KeySchemaElement.builder().keyType(KeyType.HASH).attr...
@Test public void testCreateDynamoDBTable() throws Exception { DynamoDbClient dynamoDbClient = TestUtils.getClientDyanamoV2(); <DeepExtract> String tableName = "test-s-" + UUID.randomUUID().toString(); CreateTableRequest createTableRequest = CreateTableRequest.builder().keySchema(KeySchemaElement.builder().keyType(KeyT...
localstack-java-utils
positive
5,085
public void actionPerformed(java.awt.event.ActionEvent evt) { if (jtPorcentaje.getText().equals("")) JOptionPane.showMessageDialog(this, "Debe completar el campo 'Porcentaje'"); else { float porc = 0; try { porc = Float.parseFloat(jtPorcentaje.getText()); } catch (NumberFormatException e) { JOptionPane.showMessageDialo...
public void actionPerformed(java.awt.event.ActionEvent evt) { <DeepExtract> if (jtPorcentaje.getText().equals("")) JOptionPane.showMessageDialog(this, "Debe completar el campo 'Porcentaje'"); else { float porc = 0; try { porc = Float.parseFloat(jtPorcentaje.getText()); } catch (NumberFormatException e) { JOptionPane.sh...
Diplo_NT_Intro_Programacion
positive
5,087
protected static void bounceServer() throws Exception { String curIndexName = server.curIndexName; Path curIndexPath = server.curIndexPath; if (server == null) { throw new IllegalStateException("server was not started"); } server.shutdown(); server = null; server = new RunServer(new Random(random().nextLong()), "test",...
protected static void bounceServer() throws Exception { String curIndexName = server.curIndexName; Path curIndexPath = server.curIndexPath; if (server == null) { throw new IllegalStateException("server was not started"); } server.shutdown(); server = null; <DeepExtract> server = new RunServer(new Random(random().nextLo...
luceneserver
positive
5,088
public static void dumpFilter(final FilterType f) { logger.debug("<filter>"); final StringBuilder sb = new StringBuilder(" "); sb.append("<comp-filter name=\""); sb.append(f.getCompFilter().getName()); sb.append("\">"); logger.debug(sb.toString()); if (f.getCompFilter().getIsNotDefined() != null) { logger.debug(" " +...
public static void dumpFilter(final FilterType f) { logger.debug("<filter>"); <DeepExtract> final StringBuilder sb = new StringBuilder(" "); sb.append("<comp-filter name=\""); sb.append(f.getCompFilter().getName()); sb.append("\">"); logger.debug(sb.toString()); if (f.getCompFilter().getIsNotDefined() != null) { logge...
bw-caldav
positive
5,089
public static Date getTheDayOfMonth(int year, int month, int day) { Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.YEAR, year); calendar.set(Calendar.MONTH, month - 1); calendar.set(Calendar.DATE, day); calendar.set(Calendar.HOUR, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0)...
public static Date getTheDayOfMonth(int year, int month, int day) { Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.YEAR, year); calendar.set(Calendar.MONTH, month - 1); calendar.set(Calendar.DATE, day); calendar.set(Calendar.HOUR, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0)...
springboot-gatherdemo
positive
5,090
@Override public boolean getAutoCommit() throws SQLException { if (!pooledObject.isBorrowed()) { throw new SQLException("PooledConnection has been returned to pool"); } return connection.getAutoCommit(); }
@Override public boolean getAutoCommit() throws SQLException { <DeepExtract> if (!pooledObject.isBorrowed()) { throw new SQLException("PooledConnection has been returned to pool"); } </DeepExtract> return connection.getAutoCommit(); }
jsql
positive
5,091
private void videoDefinitionSelected(PineMediaPlayerBean pineMediaPlayerBean) { if (pineMediaPlayerBean == null) { return; } this.pineMediaPlayerBean = pineMediaPlayerBean; this.mData = pineMediaPlayerBean.getMediaUriSourceList(); mDefinitionListInPlayerAdapter.notifyDataSetChanged(); mPlayer.resetPlayingMediaAndResume...
private void videoDefinitionSelected(PineMediaPlayerBean pineMediaPlayerBean) { if (pineMediaPlayerBean == null) { return; } <DeepExtract> this.pineMediaPlayerBean = pineMediaPlayerBean; this.mData = pineMediaPlayerBean.getMediaUriSourceList(); </DeepExtract> mDefinitionListInPlayerAdapter.notifyDataSetChanged(); mPlay...
PinePlayer
positive
5,092
public static BlockOutline createBlock(Class<?> clazz) { DescriptorOutline descriptor = new DescriptorOutline(); descriptor.setPackageName(clazz.getPackage().getName() + ".builder"); AnnotationIntrospector introspector = new AnnotationIntrospector(); boolean found = introspector.handleClass(descriptor, clazz); if (!cla...
public static BlockOutline createBlock(Class<?> clazz) { <DeepExtract> DescriptorOutline descriptor = new DescriptorOutline(); descriptor.setPackageName(clazz.getPackage().getName() + ".builder"); AnnotationIntrospector introspector = new AnnotationIntrospector(); boolean found = introspector.handleClass(descriptor, cl...
Flapi
positive
5,093
@Test public void testPublishDateSortMapping() throws InvocationTargetException, IllegalAccessException, FileNotFoundException, ParserConfigurationException, SAXException, JAXBException { cfg = helper.readFusionSchemaWithoutValidation("fusion-schema-uni-leipzig.xml"); searchServerConfig = cfg.getSearchServerConfigByNam...
@Test public void testPublishDateSortMapping() throws InvocationTargetException, IllegalAccessException, FileNotFoundException, ParserConfigurationException, SAXException, JAXBException { cfg = helper.readFusionSchemaWithoutValidation("fusion-schema-uni-leipzig.xml"); searchServerConfig = cfg.getSearchServerConfigByNam...
solr-fusion
positive
5,094
@Override public void visitPropertyRead(AstPropertyRead instruction) { if (AstIPASSAPropagationCallGraphBuilder.DEBUG_PROPERTIES) { Position instructionPosition = getInstructionPosition(instruction); if (instructionPosition != null) { System.err.println("processing read instruction " + instruction + ", position " + ins...
@Override public void visitPropertyRead(AstPropertyRead instruction) { if (AstIPASSAPropagationCallGraphBuilder.DEBUG_PROPERTIES) { Position instructionPosition = getInstructionPosition(instruction); if (instructionPosition != null) { System.err.println("processing read instruction " + instruction + ", position " + ins...
Incremental_Points_to_Analysis
positive
5,095
void addBody(final CodeBlock block) { final StringBlock b = new StringBlock(block); final String varName = TEMP_VAR_PREFIX + intermediateVariableCounter.getAndIncrement(); declarations.computeIfAbsent(b, (k) -> new ArrayList<>()).add(varName); return declarations.get(b).get(0); }
void addBody(final CodeBlock block) { final StringBlock b = new StringBlock(block); <DeepExtract> final String varName = TEMP_VAR_PREFIX + intermediateVariableCounter.getAndIncrement(); declarations.computeIfAbsent(b, (k) -> new ArrayList<>()).add(varName); return declarations.get(b).get(0); </DeepExtract> }
declarative-cluster-management
positive
5,096
public static <T> Result<T> failed(String msg) { Result<T> result = new Result<>(); result.setCode(ResultCode.SYSTEM_EXECUTION_ERROR.getCode()); result.setData(null); result.setMsg(msg); return result; }
public static <T> Result<T> failed(String msg) { <DeepExtract> Result<T> result = new Result<>(); result.setCode(ResultCode.SYSTEM_EXECUTION_ERROR.getCode()); result.setData(null); result.setMsg(msg); return result; </DeepExtract> }
youlai-mall
positive
5,097
public ProgressionConfigurator setDefaultMultiThreadedMode() { setThreads(-1); setWorkers(32); return this; return this; }
public ProgressionConfigurator setDefaultMultiThreadedMode() { <DeepExtract> setThreads(-1); setWorkers(32); return this; </DeepExtract> return this; }
PerformanceTools
positive
5,098
public static Map<String, Function<InputStream, Stream<Resource>>> createDefaultLogFmtRegistry() { Map<String, Function<InputStream, Stream<Resource>>> result = new HashMap<>(); Map<String, Function<InputStream, Stream<Resource>>> tmp = result == null ? new HashMap<>() : result; WebLogParser.loadRegistry(RDFDataMgr.loa...
public static Map<String, Function<InputStream, Stream<Resource>>> createDefaultLogFmtRegistry() { Map<String, Function<InputStream, Stream<Resource>>> result = new HashMap<>(); <DeepExtract> Map<String, Function<InputStream, Stream<Resource>>> tmp = result == null ? new HashMap<>() : result; WebLogParser.loadRegistry(...
LSQ
positive
5,100
public void addCardFilesSelectionListener(CategoryTreeSelectionListener l) { if (l == null) return; cardSelectionListeners.add(l); Set<Category> selCategories = new HashSet<Category>(); TreePath[] selectionPaths = getSelectionPaths(); if (selectionPaths == null) { return; } List<Category> allCats = CategoryUtils.recurs...
public void addCardFilesSelectionListener(CategoryTreeSelectionListener l) { if (l == null) return; cardSelectionListeners.add(l); <DeepExtract> Set<Category> selCategories = new HashSet<Category>(); TreePath[] selectionPaths = getSelectionPaths(); if (selectionPaths == null) { return; } List<Category> allCats = Catego...
opencards
positive
5,101
public void notifyDiscordWithActivePart() { PlatformUI.getWorkbench().getDisplay().syncExec(this::findActivePart); IEditorPart activePart = lastSelectedEditor; lastSelectedEditor = null; if (!(activePart instanceof IEditorPart) || activePart.equals(lastSelectedEditor)) { return; } try { lastSelectedEditor = (IEditorPar...
public void notifyDiscordWithActivePart() { PlatformUI.getWorkbench().getDisplay().syncExec(this::findActivePart); IEditorPart activePart = lastSelectedEditor; lastSelectedEditor = null; <DeepExtract> if (!(activePart instanceof IEditorPart) || activePart.equals(lastSelectedEditor)) { return; } try { lastSelectedEditor...
eclipse-discord-integration
positive
5,102
@Test public void testOneToEmpty() throws IOException, DbException, TransactionAbortedException { ArrayList<ArrayList<Integer>> sourceTuples = new ArrayList<ArrayList<Integer>>(); HeapFile source = SystemTestUtil.createRandomHeapFile(3, 1, null, sourceTuples); assert sourceTuples.size() == 1; ArrayList<ArrayList<Intege...
@Test public void testOneToEmpty() throws IOException, DbException, TransactionAbortedException { <DeepExtract> ArrayList<ArrayList<Integer>> sourceTuples = new ArrayList<ArrayList<Integer>>(); HeapFile source = SystemTestUtil.createRandomHeapFile(3, 1, null, sourceTuples); assert sourceTuples.size() == 1; ArrayList<Ar...
cs143-simpledb
positive
5,103
@Override public Fragment getItem(int position) { Fragment fragment = null; switch(position + 1) { case 1: fragment = new AmarilloFragment(); break; case 2: fragment = new AzulFragment(); break; case 3: fragment = new RojoFragment(); break; case 4: fragment = new GreenFragment(); break; } return fragment; }
@Override public Fragment getItem(int position) { <DeepExtract> Fragment fragment = null; switch(position + 1) { case 1: fragment = new AmarilloFragment(); break; case 2: fragment = new AzulFragment(); break; case 3: fragment = new RojoFragment(); break; case 4: fragment = new GreenFragment(); break; } return fragment;...
curso-android-codejavu
positive
5,106
@Override public int getCount() { switch(getState()) { case STATE_EMPTY_ITEM: return getDataSize() + 1; case STATE_NETWORK_ERROR: case STATE_LOAD_MORE: return getDataSize() + 1; case STATE_NO_DATA: return 0; case STATE_NO_MORE: return getDataSize() + 1; case STATE_LESS_ONE_PAGE: return getDataSize(); default: break; } ...
@Override public int getCount() { switch(getState()) { case STATE_EMPTY_ITEM: return getDataSize() + 1; case STATE_NETWORK_ERROR: case STATE_LOAD_MORE: return getDataSize() + 1; case STATE_NO_DATA: return 0; case STATE_NO_MORE: return getDataSize() + 1; case STATE_LESS_ONE_PAGE: return getDataSize(); default: break; } ...
Cotable
positive
5,107
@Test public void testDeserializationAsFloat02WithTimeZone() throws Exception { OffsetDateTime date = OffsetDateTime.ofInstant(Instant.ofEpochSecond(123456789L, 183917322), Z2); OffsetDateTime value = MAPPER.readerFor(OffsetDateTime.class).with(TimeZone.getDefault()).readValue("123456789.183917322"); assertTrue("The va...
@Test public void testDeserializationAsFloat02WithTimeZone() throws Exception { OffsetDateTime date = OffsetDateTime.ofInstant(Instant.ofEpochSecond(123456789L, 183917322), Z2); OffsetDateTime value = MAPPER.readerFor(OffsetDateTime.class).with(TimeZone.getDefault()).readValue("123456789.183917322"); <DeepExtract> asse...
jackson-modules-java8
positive
5,108
public void setValueFrom(BerDataValue dataValue, Object obj) throws Asn1DecodingException { int readTagClass = dataValue.getTagClass(); if (mBerTagNumber != -1) { int readTagNumber = dataValue.getTagNumber(); if ((readTagClass != mBerTagClass) || (readTagNumber != mBerTagNumber)) { throw new Asn1UnexpectedTagException(...
public void setValueFrom(BerDataValue dataValue, Object obj) throws Asn1DecodingException { int readTagClass = dataValue.getTagClass(); if (mBerTagNumber != -1) { int readTagNumber = dataValue.getTagNumber(); if ((readTagClass != mBerTagClass) || (readTagNumber != mBerTagNumber)) { throw new Asn1UnexpectedTagException(...
apk-parser
positive
5,109
public static void blur(Context context, Bitmap bkg, View view) { long startMs = System.currentTimeMillis(); float radius = 15; float scaleFactor = 8; bkg = DrawableProvider.getReSizeBitmap(bkg, view.getMeasuredWidth(), view.getMeasuredHeight()); Bitmap overlay = Bitmap.createBitmap((int) (view.getMeasuredWidth() / sca...
public static void blur(Context context, Bitmap bkg, View view) { long startMs = System.currentTimeMillis(); float radius = 15; float scaleFactor = 8; bkg = DrawableProvider.getReSizeBitmap(bkg, view.getMeasuredWidth(), view.getMeasuredHeight()); Bitmap overlay = Bitmap.createBitmap((int) (view.getMeasuredWidth() / sca...
MVPArms_Fragment
positive
5,110
public synchronized void connect() throws IllegalArgumentException, UnknownHostException, JIException, AlreadyConnectedException { if (isConnected()) { throw new AlreadyConnectedException(); } final int socketTimeout = Integer.getInteger("rpc.socketTimeout", 0); logger.info(String.format("Socket timeout: %s ", socketTi...
public synchronized void connect() throws IllegalArgumentException, UnknownHostException, JIException, AlreadyConnectedException { if (isConnected()) { throw new AlreadyConnectedException(); } final int socketTimeout = Integer.getInteger("rpc.socketTimeout", 0); logger.info(String.format("Socket timeout: %s ", socketTi...
OPC_Client
positive
5,111
public AbstractMsgBuilder image(File path) throws IOException { return this.append(String.valueOf(code.image(path))); return this; }
public AbstractMsgBuilder image(File path) throws IOException { <DeepExtract> return this.append(String.valueOf(code.image(path))); </DeepExtract> return this; }
jcq-coolq
positive
5,112
public SFTPv3FileAttributes stat(String path) throws IOException { int req_id = generateNextRequestID(); TypesWriter tw = new TypesWriter(); tw.writeString(path, charsetName); log.debug("Sending SSH_FXP_STAT/SSH_FXP_LSTAT..."); sendMessage(Packet.SSH_FXP_STAT, req_id, tw.getBytes()); byte[] resp = receiveMessage(34000)...
public SFTPv3FileAttributes stat(String path) throws IOException { <DeepExtract> int req_id = generateNextRequestID(); TypesWriter tw = new TypesWriter(); tw.writeString(path, charsetName); log.debug("Sending SSH_FXP_STAT/SSH_FXP_LSTAT..."); sendMessage(Packet.SSH_FXP_STAT, req_id, tw.getBytes()); byte[] resp = receive...
Testingbot-Tunnel
positive
5,113
@Test public void test4_13_21() throws Exception { List<String> crls = new ArrayList<String>(); for (int i = 1; i < new String[] { "nameConstraintsRFC822CA1Cert", "nameConstraintsRFC822CA1CRL" }.length; i++) crls.add(new String[] { "nameConstraintsRFC822CA1Cert", "nameConstraintsRFC822CA1CRL" }[i]); crls.add(TRUST_ANCH...
@Test public void test4_13_21() throws Exception { <DeepExtract> List<String> crls = new ArrayList<String>(); for (int i = 1; i < new String[] { "nameConstraintsRFC822CA1Cert", "nameConstraintsRFC822CA1CRL" }.length; i++) crls.add(new String[] { "nameConstraintsRFC822CA1Cert", "nameConstraintsRFC822CA1CRL" }[i]); crls....
canl-java
positive
5,114
public void testSearchClientsWithOptions() throws SecurityException, NoSuchMethodException, IOException { Invokable<?, ?> method = method(ChefApi.class, "searchClients", SearchOptions.class); GeneratedHttpRequest httpRequest = processor.apply(Invocation.create(method, ImmutableList.<Object>of(SearchOptions.Builder.quer...
public void testSearchClientsWithOptions() throws SecurityException, NoSuchMethodException, IOException { Invokable<?, ?> method = method(ChefApi.class, "searchClients", SearchOptions.class); GeneratedHttpRequest httpRequest = processor.apply(Invocation.create(method, ImmutableList.<Object>of(SearchOptions.Builder.quer...
legacy-jclouds-chef
positive
5,116
@Override public void call(Subscriber<? super Integer> sub) { next.set(true); subscriber.unsubscribe(); }
@Override <DeepExtract> </DeepExtract> public void call(Subscriber<? super Integer> sub) { <DeepExtract> </DeepExtract> next.set(true); <DeepExtract> </DeepExtract> subscriber.unsubscribe(); <DeepExtract> </DeepExtract> }
rtree
positive
5,117
public Criteria andG_nameNotBetween(String value1, String value2) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + "g_name" + " cannot be null"); } criteria.add(new Criterion("g_name not between", value1, value2)); return (Criteria) this; }
public Criteria andG_nameNotBetween(String value1, String value2) { <DeepExtract> if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + "g_name" + " cannot be null"); } criteria.add(new Criterion("g_name not between", value1, value2)); </DeepExtract> return (Criteria) this; }
BaiChengNews
positive
5,118
@Override public void onErrorResponse(VolleyError error) { Response<JSONObject> resp; if (error.networkResponse == null || error.networkResponse.data == null) { resp = Response.error(new ParseError(new Exception("Unknown error or no network"))); } try { String jsonString = new String(error.networkResponse.data, HttpHea...
@Override public void onErrorResponse(VolleyError error) { <DeepExtract> Response<JSONObject> resp; if (error.networkResponse == null || error.networkResponse.data == null) { resp = Response.error(new ParseError(new Exception("Unknown error or no network"))); } try { String jsonString = new String(error.networkResponse...
Rando-android
positive
5,119
@Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); CircularMenuView actionMenu = findViewById(R.id.actionMenu); actionMenu.setOnMenuItemClickListe...
@Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = findViewById(R.id.toolbar); setSupportActionBar(toolbar); CircularMenuView actionMenu = findViewById(R.id.actionMenu); actionMenu.setOnMenuItemClickListe...
cardroid
positive
5,120