before
stringlengths
12
3.21M
after
stringlengths
41
3.21M
repo
stringlengths
1
56
type
stringclasses
1 value
__index_level_0__
int64
0
442k
public int discardBodyData() throws MalformedStreamException, IOException { final InputStream istream = newInputStream(); return (int) Streams.copy(istream, null, false); }
public int discardBodyData() throws MalformedStreamException, IOException { <DeepExtract> final InputStream istream = newInputStream(); return (int) Streams.copy(istream, null, false); </DeepExtract> }
AndroidWebServ
positive
649
public String makeRedDefaultSkin() { defaultSkin = "hrRed"; FacesContext fctx = FacesContext.getCurrentInstance(); String refreshpage = fctx.getViewRoot().getViewId(); ViewHandler ViewH = fctx.getApplication().getViewHandler(); UIViewRoot UIV = ViewH.createView(fctx, refreshpage); UIV.setViewId(refreshpage); fctx.setVi...
public String makeRedDefaultSkin() { defaultSkin = "hrRed"; <DeepExtract> FacesContext fctx = FacesContext.getCurrentInstance(); String refreshpage = fctx.getViewRoot().getViewId(); ViewHandler ViewH = fctx.getApplication().getViewHandler(); UIViewRoot UIV = ViewH.createView(fctx, refreshpage); UIV.setViewId(refreshpag...
ADF-Faces-Cookbook
positive
650
@Override public PageView<Model.FieldView> getStaticFields(int objectId, int page, int pageSize) { try { return () -> { ISnapshot snapshot = context.snapshot; IObject object = snapshot.getObject(objectId); boolean isClass = object instanceof IClass; IClass clazz = isClass ? (IClass) object : object.getClazz(); List<Fie...
@Override public PageView<Model.FieldView> getStaticFields(int objectId, int page, int pageSize) { <DeepExtract> try { return () -> { ISnapshot snapshot = context.snapshot; IObject object = snapshot.getObject(objectId); boolean isClass = object instanceof IClass; IClass clazz = isClass ? (IClass) object : object.getCla...
jifa
positive
651
private void appendBlock(int pointer) { assert pointer < 0; int rootPtr = ~pointer; int numBlocks; assert rootPtr != 0 : "Invalid pointer " + rootPtr; assert rootPtr != -1 : "Invalid pointer " + rootPtr; if (rootPtr < 0) { numBlocks = getIntDataForIndexedBlock(rootPtr, INDEX_NUM_BLOCKS_OFFSET); } else { numBlocks = m_b...
private void appendBlock(int pointer) { assert pointer < 0; int rootPtr = ~pointer; <DeepExtract> int numBlocks; assert rootPtr != 0 : "Invalid pointer " + rootPtr; assert rootPtr != -1 : "Invalid pointer " + rootPtr; if (rootPtr < 0) { numBlocks = getIntDataForIndexedBlock(rootPtr, INDEX_NUM_BLOCKS_OFFSET); } else { n...
banana
positive
653
Expr term() throws IOException { Expr x; if (look.tag == '-') { move(); x = new Unary(Word.minus, unary()); } else if (look.tag == '!') { Token tok = look; move(); x = new Not(tok, unary()); } else { x = factor(); } while (look.tag == '*' || look.tag == '/') { Token tok = look; move(); x = new Arith(tok, x, unary()); }...
Expr term() throws IOException { <DeepExtract> Expr x; if (look.tag == '-') { move(); x = new Unary(Word.minus, unary()); } else if (look.tag == '!') { Token tok = look; move(); x = new Not(tok, unary()); } else { x = factor(); } </DeepExtract> while (look.tag == '*' || look.tag == '/') { Token tok = look; move(); x = ...
wheel
positive
654
public void close() { if (plusAnimationActive.compareAndSet(false, true)) { if (rotated) { imgMain.startAnimation(mainRotateRight); for (SatelliteMenuItem item : menuItems) { item.getView().startAnimation(item.getInAnimation()); } } rotated = !rotated; } }
public void close() { <DeepExtract> if (plusAnimationActive.compareAndSet(false, true)) { if (rotated) { imgMain.startAnimation(mainRotateRight); for (SatelliteMenuItem item : menuItems) { item.getView().startAnimation(item.getInAnimation()); } } rotated = !rotated; } </DeepExtract> }
Look-Around
positive
655
@Override public void onAnimationUpdate(ValueAnimator animator) { Float value = (Float) animator.getAnimatedValue(); int currentTimelineWidth = (int) (value * mTimelineViewWidth); float rightOffset = mTimelineViewWidth * (1 - value); mTimelineLayout.setTranslationX(rightOffset); mTimelineLayout.setAlpha(value); mTimeli...
@Override public void onAnimationUpdate(ValueAnimator animator) { Float value = (Float) animator.getAnimatedValue(); int currentTimelineWidth = (int) (value * mTimelineViewWidth); float rightOffset = mTimelineViewWidth * (1 - value); mTimelineLayout.setTranslationX(rightOffset); mTimelineLayout.setAlpha(value); mTimeli...
alarm-clock
positive
656
private static int calculateMinSum(int[][] m) { int[][] dp = new int[M][N]; dp[0][0] = m[0][0]; for (int i = 1; i < M; i++) { dp[i][0] = dp[i - 1][0] + m[i][0]; } for (int j = 1; j < N; j++) { dp[0][j] = dp[0][j - 1] + m[0][j]; } for (int i = 1; i < M; i++) { for (int j = 1; j < N; j++) { dp[i][j] = Math.min(dp[i - 1][...
private static int calculateMinSum(int[][] m) { int[][] dp = new int[M][N]; dp[0][0] = m[0][0]; for (int i = 1; i < M; i++) { dp[i][0] = dp[i - 1][0] + m[i][0]; } for (int j = 1; j < N; j++) { dp[0][j] = dp[0][j - 1] + m[0][j]; } for (int i = 1; i < M; i++) { for (int j = 1; j < N; j++) { dp[i][j] = Math.min(dp[i - 1][...
DataStructure
positive
658
public void actionPerformed(java.awt.event.ActionEvent evt) { save(); loadCategory("user"); }
public void actionPerformed(java.awt.event.ActionEvent evt) { <DeepExtract> save(); loadCategory("user"); </DeepExtract> }
BurpSentinel
positive
659
@Override public void onClick(View v) { if (!mIsRemoteRecording) { Log.d(TAG, " start remote record: "); mAtomOpStart = true; UCloudRtcSdkMixProfile mixProfile = UCloudRtcSdkMixProfile.getInstance().assembleMixParamsBuilder().type(UCloudRtcSdkMixProfile.MIX_TYPE_RECORD).layout(UCloudRtcSdkMixProfile.LAYOUT_CLASS_ROOM_2...
@Override public void onClick(View v) { <DeepExtract> if (!mIsRemoteRecording) { Log.d(TAG, " start remote record: "); mAtomOpStart = true; UCloudRtcSdkMixProfile mixProfile = UCloudRtcSdkMixProfile.getInstance().assembleMixParamsBuilder().type(UCloudRtcSdkMixProfile.MIX_TYPE_RECORD).layout(UCloudRtcSdkMixProfile.LAYOU...
urtc-android-demo
positive
660
@Override public ArdenValue setTime(long newPrimaryTime) { if (newPrimaryTime == NOPRIMARYTIME) return INSTANCE; else return new ArdenNull(newPrimaryTime); }
@Override public ArdenValue setTime(long newPrimaryTime) { <DeepExtract> if (newPrimaryTime == NOPRIMARYTIME) return INSTANCE; else return new ArdenNull(newPrimaryTime); </DeepExtract> }
arden2bytecode
positive
661
private void encodeFromStreamExtra(Intent intent) throws WriterException { format = BarcodeFormat.QR_CODE; Bundle bundle = intent.getExtras(); if (bundle == null) { throw new WriterException("No extras"); } Uri uri = bundle.getParcelable(Intent.EXTRA_STREAM); if (uri == null) { throw new WriterException("No EXTRA_STREA...
private void encodeFromStreamExtra(Intent intent) throws WriterException { format = BarcodeFormat.QR_CODE; Bundle bundle = intent.getExtras(); if (bundle == null) { throw new WriterException("No extras"); } Uri uri = bundle.getParcelable(Intent.EXTRA_STREAM); if (uri == null) { throw new WriterException("No EXTRA_STREA...
AndroidWebServ
positive
662
@Override public void start() { isStarted.set(true); queue.add(group, activity, timePeriodMs.get(), TimeUnit.MILLISECONDS); }
@Override public void start() { isStarted.set(true); <DeepExtract> queue.add(group, activity, timePeriodMs.get(), TimeUnit.MILLISECONDS); </DeepExtract> }
exhibitor
positive
663
@Override protected void onDraw(Canvas canvas) { this.color = borderColor; invalidate(); this.color = color; invalidate(); if (shape == ColorShape.SQUARE) { if (borderWidthPx > 0) { canvas.drawRect(drawingRect, borderPaint); } if (alphaPattern != null) { alphaPattern.draw(canvas); } canvas.drawRect(colorRect, colorPain...
@Override protected void onDraw(Canvas canvas) { this.color = borderColor; invalidate(); <DeepExtract> this.color = color; invalidate(); </DeepExtract> if (shape == ColorShape.SQUARE) { if (borderWidthPx > 0) { canvas.drawRect(drawingRect, borderPaint); } if (alphaPattern != null) { alphaPattern.draw(canvas); } canvas....
MDWechat
positive
664
public void insertUpdate(DocumentEvent e) { if (target.getText().length() > 0) { target.setColumns(0); } else { target.setColumns(1); } if (target.getParent() != null) { JPanel layer = (JPanel) target.getParent(); layer.revalidate(); } }
public void insertUpdate(DocumentEvent e) { <DeepExtract> if (target.getText().length() > 0) { target.setColumns(0); } else { target.setColumns(1); } if (target.getParent() != null) { JPanel layer = (JPanel) target.getParent(); layer.revalidate(); } </DeepExtract> }
dragmath
positive
665
@Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int parentWidth = MeasureSpec.getSize(widthMeasureSpec); int parentHeight = MeasureSpec.getSize(heightMeasureSpec); this.setMeasuredDimension(parentWidth, parentHeight); width = parentWidth; height = parentHeight; super.onMeasure(widthMea...
@Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { int parentWidth = MeasureSpec.getSize(widthMeasureSpec); int parentHeight = MeasureSpec.getSize(heightMeasureSpec); this.setMeasuredDimension(parentWidth, parentHeight); width = parentWidth; height = parentHeight; super.onMeasure(widthMea...
midisheetmusicmemo
positive
667
public Symbol parse() throws java.lang.Exception { Symbol lhs_sym = null; production_tab = production_table(); action_tab = action_table(); reduce_tab = reduce_table(); init_actions(); Symbol sym = getScanner().next_token(); return (sym != null) ? sym : getSymbolFactory().newSymbol("END_OF_FILE", EOF_sym()); stack.remo...
public Symbol parse() throws java.lang.Exception { Symbol lhs_sym = null; production_tab = production_table(); action_tab = action_table(); reduce_tab = reduce_table(); init_actions(); <DeepExtract> Symbol sym = getScanner().next_token(); return (sym != null) ? sym : getSymbolFactory().newSymbol("END_OF_FILE", EOF_sym(...
phantm
positive
668
public void testSkipAnalyzeReport() throws Exception { doConfigTest("analyze-report", "plugin-" + "analyze-report" + "-config.xml"); }
public void testSkipAnalyzeReport() throws Exception { <DeepExtract> doConfigTest("analyze-report", "plugin-" + "analyze-report" + "-config.xml"); </DeepExtract> }
maven-dependency-plugin
positive
669
public final HttpBody getHttpBody() { return null; }
public final HttpBody getHttpBody() { <DeepExtract> return null; </DeepExtract> }
android-lite-http
positive
671
@Override public CompletableFuture<Subscription> subscribe(String topic, BiConsumer<List<Object>, EventDetails> handler) { throwIfNotConnected(); CompletableFuture<Subscription> future = new CompletableFuture<>(); long requestID = mIDGenerator.next(); mSubscribeRequests.put(requestID, new SubscribeRequest(requestID, to...
@Override public CompletableFuture<Subscription> subscribe(String topic, BiConsumer<List<Object>, EventDetails> handler) { <DeepExtract> throwIfNotConnected(); CompletableFuture<Subscription> future = new CompletableFuture<>(); long requestID = mIDGenerator.next(); mSubscribeRequests.put(requestID, new SubscribeRequest...
autobahn-java
positive
673
@Test @SmallTest public void testSetLocalOfferMakesVideoFlowLocally() throws InterruptedException { Log.d(TAG, "testSetLocalOfferMakesVideoFlowLocally"); MockSink localRenderer = new MockSink(EXPECTED_VIDEO_FRAMES, LOCAL_RENDERER_NAME); List<PeerConnection.IceServer> iceServers = new ArrayList<>(); SignalingParameters ...
@Test @SmallTest public void testSetLocalOfferMakesVideoFlowLocally() throws InterruptedException { Log.d(TAG, "testSetLocalOfferMakesVideoFlowLocally"); MockSink localRenderer = new MockSink(EXPECTED_VIDEO_FRAMES, LOCAL_RENDERER_NAME); <DeepExtract> List<PeerConnection.IceServer> iceServers = new ArrayList<>(); Signal...
glass-enterprise-samples
positive
674
public void mouseClicked(java.awt.event.MouseEvent evt) { if (curPetDetail != null) { String u1 = curPetDetail.u_name + " (Fire)"; String p2 = SwManager.petFamily.get(u1); if (p2 != null) { LoadPetDetail(p2); } } }
public void mouseClicked(java.awt.event.MouseEvent evt) { <DeepExtract> if (curPetDetail != null) { String u1 = curPetDetail.u_name + " (Fire)"; String p2 = SwManager.petFamily.get(u1); if (p2 != null) { LoadPetDetail(p2); } } </DeepExtract> }
sw_optimize
positive
675
@Override protected final void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); onSetContentView(); mToolBar = onFindToolBarView(); setSupportActionBar(mToolBar); mActionBar = getSupportActionBar(); onFindViews(); onBindContent(); }
@Override <DeepExtract> </DeepExtract> protected final void onCreate(Bundle savedInstanceState) { <DeepExtract> </DeepExtract> super.onCreate(savedInstanceState); <DeepExtract> </DeepExtract> onSetContentView(); <DeepExtract> </DeepExtract> mToolBar = onFindToolBarView(); <DeepExtract> </DeepExtract> setSupportActionBa...
LightUtils
positive
676
@Test public void selection() throws Exception { Iterable<Integer> it = () -> new Iterator<Integer>() { private int[] a = new int[] { 1, 2, 3 }; private int index = 0; @Override public boolean hasNext() { return index < a.length; } @Override public Integer next() { return a[index++]; } }; Tmp tmp = new Tmp(); o = it; S...
@Test public void selection() throws Exception { Iterable<Integer> it = () -> new Iterator<Integer>() { private int[] a = new int[] { 1, 2, 3 }; private int index = 0; @Override public boolean hasNext() { return index < a.length; } @Override public Integer next() { return a[index++]; } }; Tmp tmp = new Tmp(); <DeepExtr...
syncer
positive
677
public void errorSave(Order newOrder) throws HibernateException { Session session = HibernateUtil.getSessionFactory().getCurrentSession(); Session session = HibernateUtil.getSessionFactory().getCurrentSession(); session.save(newOrder); session.flush(); return newOrder; session.flush(); throw new HibernateException("err...
public void errorSave(Order newOrder) throws HibernateException { Session session = HibernateUtil.getSessionFactory().getCurrentSession(); <DeepExtract> Session session = HibernateUtil.getSessionFactory().getCurrentSession(); session.save(newOrder); session.flush(); return newOrder; </DeepExtract> session.flush(); thro...
zkbooks
positive
678
public void print(char c, int width, int fill) { int oldw = width; width = width; return oldw; int oldf = fill; fill = fill; return oldf; print(c); width = 0; precision = 4; fill = ' '; jstyle = Format.STANDARD; }
public void print(char c, int width, int fill) { int oldw = width; width = width; return oldw; int oldf = fill; fill = fill; return oldf; print(c); <DeepExtract> width = 0; precision = 4; fill = ' '; jstyle = Format.STANDARD; </DeepExtract> }
programmingIT
positive
679
@Override public ZSetEntry next() { return map.get(min++); }
@Override public ZSetEntry next() { <DeepExtract> return map.get(min++); </DeepExtract> }
redis-protocol
positive
680
public Criteria andAddressBetween(String value1, String value2) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + "address" + " cannot be null"); } criteria.add(new Criterion("address between", value1, value2)); return (Criteria) this; }
public Criteria andAddressBetween(String value1, String value2) { <DeepExtract> if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + "address" + " cannot be null"); } criteria.add(new Criterion("address between", value1, value2)); </DeepExtract> return (Criteria) this; }
Whome
positive
681
public void methodAA() { }
public void methodAA() { <DeepExtract> </DeepExtract> }
WS18Computer
positive
682
@Override public View getView(int arg0, View convertView, ViewGroup arg2) { if (convertView == null) { convertView = (RelativeLayout) MainActivity.inflater.inflate(R.layout.bookmark_item, null); holder = new ViewHolder(); holder.title = ((TextView) (convertView.findViewById(R.id.bookmark_title))); holder.url = ((TextVi...
@Override public View getView(int arg0, View convertView, ViewGroup arg2) { if (convertView == null) { convertView = (RelativeLayout) MainActivity.inflater.inflate(R.layout.bookmark_item, null); holder = new ViewHolder(); holder.title = ((TextView) (convertView.findViewById(R.id.bookmark_title))); holder.url = ((TextVi...
Lucid-Browser
positive
684
public void onPageVisible() { callFunction("Rexxar.Lifecycle.onPageVisible", null); }
public void onPageVisible() { <DeepExtract> callFunction("Rexxar.Lifecycle.onPageVisible", null); </DeepExtract> }
rexxar-android
positive
685
public void restoreState() { if (false) setup_progress_bar_limit.setVisibility(View.VISIBLE); else setup_progress_bar_limit.setVisibility(View.GONE); getBtnForward().setEnabled(true); Utils.setImageWithTint(getBtnForward(), R.drawable.ic_chevron_left_black_24dp, Color.DKGRAY); getBtnNext().setEnabled(true); getBtnNext(...
public void restoreState() { <DeepExtract> if (false) setup_progress_bar_limit.setVisibility(View.VISIBLE); else setup_progress_bar_limit.setVisibility(View.GONE); </DeepExtract> getBtnForward().setEnabled(true); Utils.setImageWithTint(getBtnForward(), R.drawable.ic_chevron_left_black_24dp, Color.DKGRAY); getBtnNext()....
audiohq_md2
positive
686
@Override public void done(Object response) { callback.done(response); if (RpcResult.class.isInstance(response)) { RpcResult rpcResult = (RpcResult) response; Map<String, String> ns = rpcResult.getNotifications(); if (ns != null && ns.size() > 0) { Notifications.set(ns); } if (CompileConfig.isDebug) { if (ns != null) {...
@Override public void done(Object response) { callback.done(response); <DeepExtract> if (RpcResult.class.isInstance(response)) { RpcResult rpcResult = (RpcResult) response; Map<String, String> ns = rpcResult.getNotifications(); if (ns != null && ns.size() > 0) { Notifications.set(ns); } if (CompileConfig.isDebug) { if ...
net.pocrd.core
positive
687
private static int[] parseIds(String url) throws Exception { int[] ids = new int[2]; String dest = ""; if (url.split(new String("&image="))[0] != null) { dest = url.split(new String("&image="))[0].replaceAll("[^0-9]", ""); } return Integer.valueOf(dest); String dest = ""; if (url.split(new String("&image="))[1] != null...
private static int[] parseIds(String url) throws Exception { int[] ids = new int[2]; String dest = ""; if (url.split(new String("&image="))[0] != null) { dest = url.split(new String("&image="))[0].replaceAll("[^0-9]", ""); } return Integer.valueOf(dest); <DeepExtract> String dest = ""; if (url.split(new String("&image=...
FingerColoring-Android
positive
688
@Override public List<SysRelation> getRelationListByObjectId(String objectId) { LambdaQueryWrapper<SysRelation> lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(SysRelation::getObjectId, objectId); if (ObjectUtil.isNotEmpty(null)) { lambdaQueryWrapper.eq(SysRelation::getCategory, null); } return t...
@Override public List<SysRelation> getRelationListByObjectId(String objectId) { <DeepExtract> LambdaQueryWrapper<SysRelation> lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(SysRelation::getObjectId, objectId); if (ObjectUtil.isNotEmpty(null)) { lambdaQueryWrapper.eq(SysRelation::getCategory, nul...
xiaonuo-vue
positive
689
public double Frechet(List<T> t1, List<T> t2) { double[][] ca = new double[t2.size()][t1.size()]; for (int i = 0; i < t2.size(); ++i) { for (int j = 0; j < t1.size(); ++j) { ca[i][j] = -1.0D; } } if (ca[t2.size() - 1][t1.size() - 1] > -1.0D) return ca[t2.size() - 1][t1.size() - 1]; if (t2.size() - 1 == 0 && t1.size() -...
public double Frechet(List<T> t1, List<T> t2) { double[][] ca = new double[t2.size()][t1.size()]; for (int i = 0; i < t2.size(); ++i) { for (int j = 0; j < t1.size(); ++j) { ca[i][j] = -1.0D; } } <DeepExtract> if (ca[t2.size() - 1][t1.size() - 1] > -1.0D) return ca[t2.size() - 1][t1.size() - 1]; if (t2.size() - 1 == 0 ...
torchtrajectory
positive
690
private void init() { CharSequence t = getTitle(); if (t == null || t.length() <= 0) setTitle(R.string.filter_cat); sum = getSummary(); if (sum == null || sum.length() <= 0) sum = A.s(R.string.filter_sum); setSummary(sum + " (" + A.s(A.is(filterKey()) ? R.string.active : R.string.inactive) + ')'); setPersistent(false);...
private void init() { CharSequence t = getTitle(); if (t == null || t.length() <= 0) setTitle(R.string.filter_cat); sum = getSummary(); if (sum == null || sum.length() <= 0) sum = A.s(R.string.filter_sum); <DeepExtract> setSummary(sum + " (" + A.s(A.is(filterKey()) ? R.string.active : R.string.inactive) + ')'); </DeepE...
sanity
positive
691
public void setPositionAndScaleMatrix(Matrix matrix) { final float[] values = new float[9]; matrix.getValues(values); float scale = values[Matrix.MSCALE_X]; horizontalScrollRange = (int) (mapScheme.getWidth() * scale); verticalScrollRange = (int) (mapScheme.getHeight() * scale); horizontalScrollOffset = (int) -values[M...
public void setPositionAndScaleMatrix(Matrix matrix) { <DeepExtract> final float[] values = new float[9]; matrix.getValues(values); float scale = values[Matrix.MSCALE_X]; horizontalScrollRange = (int) (mapScheme.getWidth() * scale); verticalScrollRange = (int) (mapScheme.getHeight() * scale); horizontalScrollOffset = (...
ametro
positive
692
@Override protected void writeMonkeyRunnerCommand() { int oldVal = target.getValue(); int max = target.getMax(); if (targetVal == -1 || targetVal >= max || targetVal < 0) { targetVal = ACInstrumentation.getSelf().random.nextInt(max); } if (touchX == -1) { GetLocationRunnable glr = new GetLocationRunnable(target); instr...
@Override protected void writeMonkeyRunnerCommand() { int oldVal = target.getValue(); <DeepExtract> int max = target.getMax(); if (targetVal == -1 || targetVal >= max || targetVal < 0) { targetVal = ACInstrumentation.getSelf().random.nextInt(max); } if (touchX == -1) { GetLocationRunnable glr = new GetLocationRunnable(...
appdoctor
positive
693
public String flushQiniuToken(String spaceName) throws Exception { String currentToken = null; if (ValidationUtil.isEmpty(currentToken)) { currentToken = this.getAuth().uploadToken(spaceName); } return currentToken; }
public String flushQiniuToken(String spaceName) throws Exception { <DeepExtract> String currentToken = null; if (ValidationUtil.isEmpty(currentToken)) { currentToken = this.getAuth().uploadToken(spaceName); } return currentToken; </DeepExtract> }
tyboot
positive
694
public Jar addEntry(String path, byte[] content) throws IOException { verifyNotSealed(); if (jos != null) return; if (os == null) this.os = new ByteArrayOutputStream(); writePrefix(os); if (getAttribute(ATTR_MANIFEST_VERSION) == null) setAttribute(ATTR_MANIFEST_VERSION, "1.0"); jos = new JarOutputStream(os, manifest); ...
public Jar addEntry(String path, byte[] content) throws IOException { <DeepExtract> verifyNotSealed(); if (jos != null) return; if (os == null) this.os = new ByteArrayOutputStream(); writePrefix(os); if (getAttribute(ATTR_MANIFEST_VERSION) == null) setAttribute(ATTR_MANIFEST_VERSION, "1.0"); jos = new JarOutputStream(o...
capsule
positive
695
private void initializeStreamIfNeeded() { if (null != parser) { return; } time = min.minusHours(1); Path file; do { time = time.plusHours(1); if (time.compareTo(max) > 0) { throw new NoSuchElementException(); } file = Paths.get(historyFolder, fileName(client, pair, time)); } while (!file.toFile().exists()); parser = ne...
private void initializeStreamIfNeeded() { if (null != parser) { return; } time = min.minusHours(1); <DeepExtract> Path file; do { time = time.plusHours(1); if (time.compareTo(max) > 0) { throw new NoSuchElementException(); } file = Paths.get(historyFolder, fileName(client, pair, time)); } while (!file.toFile().exists()...
GTC-all-repo
positive
697
public void dropTable(Class<?> clazz) { if (!tableIsExist(TableInfo.get(clazz))) { String sql = SqlBuilder.getCreatTableSQL(clazz); debugSql(sql); db.execSQL(sql); } TableInfo table = TableInfo.get(clazz); String sql = "DROP TABLE " + table.getTableName(); if (config != null && config.isDebug()) Log.d("Debug SQL", ">>>...
public void dropTable(Class<?> clazz) { if (!tableIsExist(TableInfo.get(clazz))) { String sql = SqlBuilder.getCreatTableSQL(clazz); debugSql(sql); db.execSQL(sql); } TableInfo table = TableInfo.get(clazz); String sql = "DROP TABLE " + table.getTableName(); <DeepExtract> if (config != null && config.isDebug()) Log.d("De...
JJEvent
positive
698
private void readZrlePalette(int[] palette, int palSize) throws Exception { if (bytesPerPixel == 1) { if (palSize > readPixelsBuffer.length) { readPixelsBuffer = new byte[palSize]; } zrleInStream.readBytes(readPixelsBuffer, 0, palSize); for (int i = 0; i < palSize; i++) { palette[i] = (int) readPixelsBuffer[i] & 0xFF; ...
private void readZrlePalette(int[] palette, int palSize) throws Exception { <DeepExtract> if (bytesPerPixel == 1) { if (palSize > readPixelsBuffer.length) { readPixelsBuffer = new byte[palSize]; } zrleInStream.readBytes(readPixelsBuffer, 0, palSize); for (int i = 0; i < palSize; i++) { palette[i] = (int) readPixelsBuff...
androidVNC
positive
699
public Criteria andDropGreaterThanColumn(TestEntity.Column column) { if (new StringBuilder("`drop` > ").append(column.getEscapedColumnName()).toString() == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion(new StringBuilder("`drop` > ").append(column.getEscapedColumn...
public Criteria andDropGreaterThanColumn(TestEntity.Column column) { <DeepExtract> if (new StringBuilder("`drop` > ").append(column.getEscapedColumnName()).toString() == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion(new StringBuilder("`drop` > ").append(column.ge...
mybatis-generator-gui-extension
positive
700
public static void callSub(Dispatch dispatchTarget, String name, Object... attributes) { if (dispatchTarget == null) { throw new IllegalArgumentException("Can't pass in null Dispatch object"); } else if (dispatchTarget.isAttached()) { return; } else { throw new IllegalStateException("Dispatch not hooked to windows memo...
public static void callSub(Dispatch dispatchTarget, String name, Object... attributes) { if (dispatchTarget == null) { throw new IllegalArgumentException("Can't pass in null Dispatch object"); } else if (dispatchTarget.isAttached()) { return; } else { throw new IllegalStateException("Dispatch not hooked to windows memo...
jacob
positive
701
public static String getMethodTypeByIMethodDefIdx(ConstantPool cp, int mdIdx) { ConstantInfo methodInfo = cp.infos[mdIdx - 1]; InterfaceMethodDef methodDef = (InterfaceMethodDef) methodInfo; int idx = ((NameAndType) cp.infos[methodDef.nameAndTypeIndex - 1]).descriptionIndex; return getString(cp, idx); }
public static String getMethodTypeByIMethodDefIdx(ConstantPool cp, int mdIdx) { ConstantInfo methodInfo = cp.infos[mdIdx - 1]; InterfaceMethodDef methodDef = (InterfaceMethodDef) methodInfo; <DeepExtract> int idx = ((NameAndType) cp.infos[methodDef.nameAndTypeIndex - 1]).descriptionIndex; return getString(cp, idx); </D...
mini-jvm
positive
702
@Override public void run() { cacheService.shutdown(); executorStart = false; }
@Override public void run() { <DeepExtract> cacheService.shutdown(); executorStart = false; </DeepExtract> }
opensharding-spi-impl
positive
703
@Override public void onGlobalLayout() { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) { getViewTreeObserver().removeGlobalOnLayoutListener(this); } else { getViewTreeObserver().removeOnGlobalLayoutListener(this); } currentPosition = pager.getCurrentItem(); if (tabCount == 0) { return; } View v = tabsCont...
@Override public void onGlobalLayout() { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) { getViewTreeObserver().removeGlobalOnLayoutListener(this); } else { getViewTreeObserver().removeOnGlobalLayoutListener(this); } currentPosition = pager.getCurrentItem(); <DeepExtract> if (tabCount == 0) { return; } Vie...
SunmiUI
positive
704
private List getTorrentContents(final ContentsListCallback callback) { final List<ContentFile> contentFiles = new ArrayList<>(); String url = MainActivity.buildURL(); url = url + "/api/v2/torrents/files?hash=" + hash; JsonArrayRequest jsArrayRequest = new JsonArrayRequest(Request.Method.GET, url, null, new Response.Lis...
private List getTorrentContents(final ContentsListCallback callback) { final List<ContentFile> contentFiles = new ArrayList<>(); String url = MainActivity.buildURL(); url = url + "/api/v2/torrents/files?hash=" + hash; JsonArrayRequest jsArrayRequest = new JsonArrayRequest(Request.Method.GET, url, null, new Response.Lis...
qBittorrent-Controller
positive
705
public static <T> T decode(String json, Class<T> clazz) throws DecodeException { JsonParser parser = null; try { parser = factory.createParser(json); parser.nextToken(); res = parseAny(parser); remaining = parser.nextToken(); } catch (IOException e) { throw new DecodeException("Failed to decode:" + e.getMessage(), e); ...
public static <T> T decode(String json, Class<T> clazz) throws DecodeException { JsonParser parser = null; try { parser = factory.createParser(json); parser.nextToken(); res = parseAny(parser); remaining = parser.nextToken(); } catch (IOException e) { throw new DecodeException("Failed to decode:" + e.getMessage(), e); ...
Lealone-Plugins
positive
706
public double getMoneyOfPlayer(UUID playerUUID) { OfflinePlayer player = PlayerUtils.getOfflinePlayer(playerUUID); Boolean ret = this.economy.hasAccount(player); if (!ret && true) this.economy.createPlayerAccount(player); return ret; return this.economy.getBalance(player); }
public double getMoneyOfPlayer(UUID playerUUID) { OfflinePlayer player = PlayerUtils.getOfflinePlayer(playerUUID); <DeepExtract> Boolean ret = this.economy.hasAccount(player); if (!ret && true) this.economy.createPlayerAccount(player); return ret; </DeepExtract> return this.economy.getBalance(player); }
GlobalMarketChest
positive
707
public static AnnotationCollection fetchByUserAndProject(User user, Project project) throws CytomineException { Map<String, Object> parameters = new HashMap<>(); parameters.put(user.getClass().getSimpleName().toLowerCase(), user.getId()); parameters.put(project.getClass().getSimpleName().toLowerCase(), project.getId())...
public static AnnotationCollection fetchByUserAndProject(User user, Project project) throws CytomineException { Map<String, Object> parameters = new HashMap<>(); parameters.put(user.getClass().getSimpleName().toLowerCase(), user.getId()); parameters.put(project.getClass().getSimpleName().toLowerCase(), project.getId())...
Cytomine-java-client
positive
708
@Override public long toKB(long size) { if (size > MAX / (C2 / C1)) return Long.MAX_VALUE; if (size < -MAX / (C2 / C1)) return Long.MIN_VALUE; return size * C2 / C1; }
@Override public long toKB(long size) { <DeepExtract> if (size > MAX / (C2 / C1)) return Long.MAX_VALUE; if (size < -MAX / (C2 / C1)) return Long.MIN_VALUE; return size * C2 / C1; </DeepExtract> }
csdn_common
positive
709
@Override public void onSurfaceChanged(GL10 gl, int width, int height) { super.onSurfaceChanged(gl, width, height); if (CameraEngine.getCamera() == null) CameraEngine.openCamera(); CameraInfo info = CameraEngine.getCameraInfo(); if (info.orientation == 90 || info.orientation == 270) { imageWidth = info.previewHeight; i...
@Override public void onSurfaceChanged(GL10 gl, int width, int height) { super.onSurfaceChanged(gl, width, height); <DeepExtract> if (CameraEngine.getCamera() == null) CameraEngine.openCamera(); CameraInfo info = CameraEngine.getCameraInfo(); if (info.orientation == 90 || info.orientation == 270) { imageWidth = info.pr...
MagicCamera-ImageReader
positive
710
@Deprecated public static int[] readInts() { String[] fields = readAllStrings(); int[] vals = new int[fields.length]; for (int i = 0; i < fields.length; i++) vals[i] = Integer.parseInt(fields[i]); return vals; }
@Deprecated public static int[] readInts() { <DeepExtract> String[] fields = readAllStrings(); int[] vals = new int[fields.length]; for (int i = 0; i < fields.length; i++) vals[i] = Integer.parseInt(fields[i]); return vals; </DeepExtract> }
CS112-Rutgers
positive
711
@Override public Integer value7() { return (Integer) get(6); }
@Override public Integer value7() { <DeepExtract> return (Integer) get(6); </DeepExtract> }
wdumper
positive
712
public void set(long index, Value value) { self.put((String) get(index), unwrapValue(value)); }
public void set(long index, Value value) { <DeepExtract> self.put((String) get(index), unwrapValue(value)); </DeepExtract> }
es4x
positive
713
private void scrollReleaseToLoadMoreToLoadingMore() { removeCallbacks(this); mmLastY = 0; if (!mScroller.isFinished()) { mScroller.forceFinished(true); } mScroller.startScroll(0, 0, 0, -mFooterOffset - mFooterHeight, mReleaseToLoadMoreToLoadingMoreScrollingDuration); post(this); mRunning = true; }
private void scrollReleaseToLoadMoreToLoadingMore() { <DeepExtract> removeCallbacks(this); mmLastY = 0; if (!mScroller.isFinished()) { mScroller.forceFinished(true); } mScroller.startScroll(0, 0, 0, -mFooterOffset - mFooterHeight, mReleaseToLoadMoreToLoadingMoreScrollingDuration); post(this); mRunning = true; </DeepExt...
SwipeToLoadLayout
positive
714
int read_frame_data(int bytesize) throws BitstreamException { int numread = 0; int nRead = 0; try { while (bytesize > 0) { int bytesread = source.read(frame_bytes, 0, bytesize); if (bytesread == -1) { while (bytesize-- > 0) { frame_bytes[0++] = 0; } break; } nRead = nRead + bytesread; 0 += bytesread; bytesize -= bytesr...
int read_frame_data(int bytesize) throws BitstreamException { int numread = 0; <DeepExtract> int nRead = 0; try { while (bytesize > 0) { int bytesread = source.read(frame_bytes, 0, bytesize); if (bytesread == -1) { while (bytesize-- > 0) { frame_bytes[0++] = 0; } break; } nRead = nRead + bytesread; 0 += bytesread; byte...
MineTunes
positive
715
public Criteria andSINGLENotEqualTo(String value) { if (value == null) { throw new RuntimeException("Value for " + "SINGLE" + " cannot be null"); } criteria.add(new Criterion("SINGLE <>", value)); return (Criteria) this; }
public Criteria andSINGLENotEqualTo(String value) { <DeepExtract> if (value == null) { throw new RuntimeException("Value for " + "SINGLE" + " cannot be null"); } criteria.add(new Criterion("SINGLE <>", value)); </DeepExtract> return (Criteria) this; }
mybatis-generator-gui-extension
positive
718
@Before public void before() { return createHelper(LocalIntObj.class); }
@Before public void before() { <DeepExtract> return createHelper(LocalIntObj.class); </DeepExtract> }
Squeaky
positive
719
public static Fragment hideAllShowFragment(@NonNull Fragment fragment) { List<Fragment> fragments = getFragments(fragment.getFragmentManager()); if (fragments.isEmpty()) { return; } for (int i = fragments.size() - 1; i >= 0; --i) { Fragment fragment = fragments.get(i); if (fragment != null) { hideFragment(fragment); } ...
public static Fragment hideAllShowFragment(@NonNull Fragment fragment) { <DeepExtract> List<Fragment> fragments = getFragments(fragment.getFragmentManager()); if (fragments.isEmpty()) { return; } for (int i = fragments.size() - 1; i >= 0; --i) { Fragment fragment = fragments.get(i); if (fragment != null) { hideFragment...
MVVMArms
positive
720
public int totalNQueens(int n) { boolean[] cols = new boolean[n]; boolean[] d1 = new boolean[2 * n]; boolean[] d2 = new boolean[2 * n]; if (0 == n) { res++; return; } for (int col = 0; col < n; col++) { int id1 = col - 0 + n; int id2 = col + 0; if (cols[col] || d1[id1] || d2[id2]) continue; cols[col] = true; d1[id1] = ...
public int totalNQueens(int n) { boolean[] cols = new boolean[n]; boolean[] d1 = new boolean[2 * n]; boolean[] d2 = new boolean[2 * n]; <DeepExtract> if (0 == n) { res++; return; } for (int col = 0; col < n; col++) { int id1 = col - 0 + n; int id2 = col + 0; if (cols[col] || d1[id1] || d2[id2]) continue; cols[col] = tr...
cspiration
positive
721
public Criteria andCollegeidIn(List<Integer> values) { if (values == null) { throw new RuntimeException("Value for " + "collegeid" + " cannot be null"); } criteria.add(new Criterion("collegeID in", values)); return (Criteria) this; }
public Criteria andCollegeidIn(List<Integer> values) { <DeepExtract> if (values == null) { throw new RuntimeException("Value for " + "collegeid" + " cannot be null"); } criteria.add(new Criterion("collegeID in", values)); </DeepExtract> return (Criteria) this; }
examination_system-
positive
722
@Test public void testEventuallyCollect() throws Exception { setupEventuallyCollect(20, 10); assertEquals(future, underTest.eventuallyCollect(callables, consumer, supplier, 10)); verifyEventuallyCollect(20, 10); }
@Test public void testEventuallyCollect() throws Exception { <DeepExtract> setupEventuallyCollect(20, 10); assertEquals(future, underTest.eventuallyCollect(callables, consumer, supplier, 10)); verifyEventuallyCollect(20, 10); </DeepExtract> }
tiny-async-java
positive
723
public void toggleShowingComplexSetup() { this.complex.toggleShowingComplexSetup(); this.changed = true; fireState(); fireComplexState(); final int c = this.textPane.getCaretPosition(); final Map<String, Object> model = new HashMap<String, Object>(); final Config config = Config.getInstance(); model.put("complex", this...
public void toggleShowingComplexSetup() { this.complex.toggleShowingComplexSetup(); this.changed = true; fireState(); fireComplexState(); <DeepExtract> final int c = this.textPane.getCaretPosition(); final Map<String, Object> model = new HashMap<String, Object>(); final Config config = Config.getInstance(); model.put("...
xadrian
positive
724
public void update(GameContainer container, int delta) throws SlickException { previousx = x; previousy = y; if (stateManager.isActive()) { stateManager.update(container, delta); return; } if (currentAnim != null) { Animation anim = animations.get(currentAnim); if (anim != null) { anim.update(delta); } } if (speed != n...
public void update(GameContainer container, int delta) throws SlickException { previousx = x; previousy = y; if (stateManager.isActive()) { stateManager.update(container, delta); return; } <DeepExtract> if (currentAnim != null) { Animation anim = animations.get(currentAnim); if (anim != null) { anim.update(delta); } } ...
MarteEngine
positive
725
@Override public void deleteElogFile(Integer eLogId) { elogMapper.deleteElog(eLogId); }
@Override public void deleteElogFile(Integer eLogId) { <DeepExtract> elogMapper.deleteElog(eLogId); </DeepExtract> }
warmerblog
positive
726
public void onClick(View v) { if (Constants.LOG_V) Log.v(TAG, "onStartNewGameButton()"); savePuzzlePreferences(); String puzzleSourceId = getSelectedPuzzleSource(); new GameLauncher(this, db).startNewGame(puzzleSourceId); }
public void onClick(View v) { <DeepExtract> if (Constants.LOG_V) Log.v(TAG, "onStartNewGameButton()"); savePuzzlePreferences(); String puzzleSourceId = getSelectedPuzzleSource(); new GameLauncher(this, db).startNewGame(puzzleSourceId); </DeepExtract> }
andoku
positive
727
@Override public void actionPerformed(java.awt.event.ActionEvent evt) { JFileChooser chooser = new JFileChooser(); chooser.setDialogTitle("Directory Select"); chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); chooser.setAcceptAllFileFilterUsed(false); if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_...
@Override public void actionPerformed(java.awt.event.ActionEvent evt) { <DeepExtract> JFileChooser chooser = new JFileChooser(); chooser.setDialogTitle("Directory Select"); chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); chooser.setAcceptAllFileFilterUsed(false); if (chooser.showOpenDialog(this) == JFileCh...
OkapiBarcode
positive
728
@Override public final void asyncSubmit(final List list) { if (list == null) throw new IllegalArgumentException("list must not be null"); if (this.port == null) throw new UsbDisconnectedException(); for (final Object item : list) { if (!(item instanceof UsbControlIrp)) throw new IllegalArgumentException("List contains ...
@Override public final void asyncSubmit(final List list) { if (list == null) throw new IllegalArgumentException("list must not be null"); <DeepExtract> if (this.port == null) throw new UsbDisconnectedException(); </DeepExtract> for (final Object item : list) { if (!(item instanceof UsbControlIrp)) throw new IllegalArgu...
usb4java-javax
positive
729
public ImageIcon LeftIcon() { try { URL iconPath = getClass().getClassLoader().getResource(Left); return new ImageIcon(new ImageIcon(iconPath).getImage()); } catch (Exception ex) { LogWriter.WriteToLog(ex.fillInStackTrace()); return new ImageIcon(createTransparentImage(1, 1)); } }
public ImageIcon LeftIcon() { <DeepExtract> try { URL iconPath = getClass().getClassLoader().getResource(Left); return new ImageIcon(new ImageIcon(iconPath).getImage()); } catch (Exception ex) { LogWriter.WriteToLog(ex.fillInStackTrace()); return new ImageIcon(createTransparentImage(1, 1)); } </DeepExtract> }
MQAdminTool
positive
730
private void checkMojo(MojoDescriptor mojoDescriptor) { assertEquals("test:testGoal", mojoDescriptor.getFullGoalName()); assertEquals("org.apache.maven.tools.plugin.generator.TestMojo", mojoDescriptor.getImplementation()); assertEquals("per-lookup", mojoDescriptor.getInstantiationStrategy()); assertNotNull(mojoDescript...
private void checkMojo(MojoDescriptor mojoDescriptor) { assertEquals("test:testGoal", mojoDescriptor.getFullGoalName()); assertEquals("org.apache.maven.tools.plugin.generator.TestMojo", mojoDescriptor.getImplementation()); assertEquals("per-lookup", mojoDescriptor.getInstantiationStrategy()); assertNotNull(mojoDescript...
maven-plugin-tools
positive
731
@Test public void testEntityReference1() throws Exception { QuickTestConfiguration.setXsdLocation("./data/general/empty.xsd"); QuickTestConfiguration.setXmlLocation("./data/general/entityReference1.xml"); QuickTestConfiguration.setExiLocation("./out/general/entityReference1.xml.exi"); FidelityOptions noValidOptions = F...
@Test public void testEntityReference1() throws Exception { <DeepExtract> QuickTestConfiguration.setXsdLocation("./data/general/empty.xsd"); QuickTestConfiguration.setXmlLocation("./data/general/entityReference1.xml"); QuickTestConfiguration.setExiLocation("./out/general/entityReference1.xml.exi"); </DeepExtract> Fidel...
exificient
positive
732
public Criteria andConfDescNotEqualTo(String value) { if (value == null) { throw new RuntimeException("Value for " + "confDesc" + " cannot be null"); } criteria.add(new Criterion("conf_desc <>", value)); return (Criteria) this; }
public Criteria andConfDescNotEqualTo(String value) { <DeepExtract> if (value == null) { throw new RuntimeException("Value for " + "confDesc" + " cannot be null"); } criteria.add(new Criterion("conf_desc <>", value)); </DeepExtract> return (Criteria) this; }
lightconf
positive
733
public <T> void register(Class<T> clazz, List<Class<?>> typeClasses, JsonReader reader) { Node<Class<?>, JsonReader<?>> typeTree = typedReaders.get(clazz); if (typeTree == null) { typeTree = new Node<Class<?>, JsonReader<?>>(clazz); } Node<Class<?>, T> child = typeTree.addChildNode(typeClasses.get(0)); if (typeClasses....
public <T> void register(Class<T> clazz, List<Class<?>> typeClasses, JsonReader reader) { Node<Class<?>, JsonReader<?>> typeTree = typedReaders.get(clazz); if (typeTree == null) { typeTree = new Node<Class<?>, JsonReader<?>>(clazz); } <DeepExtract> Node<Class<?>, T> child = typeTree.addChildNode(typeClasses.get(0)); if...
piriti
positive
734
public CollectionComposer<MapComposer<PARENT>, ?> startArrayProperty(String propName) { if (_child != null) { Object value = _child._finish(); _map.put(_propName, value); _child = null; } _propName = propName; CollectionComposer<MapComposer<PARENT>, ?> child = _startCollection(this); _map.put(propName, child._collectio...
public CollectionComposer<MapComposer<PARENT>, ?> startArrayProperty(String propName) { if (_child != null) { Object value = _child._finish(); _map.put(_propName, value); _child = null; } _propName = propName; CollectionComposer<MapComposer<PARENT>, ?> child = _startCollection(this); <DeepExtract> _map.put(propName, ch...
jackson-jr
positive
735
public static ChartPanel get(String title, String xLabel, String yLabel, Map<String, WordStatistic> data, Type type) { JFreeChart lineChart = ChartFactory.createXYLineChart(title, xLabel, yLabel, createDataset(getMap(data, type), type), PlotOrientation.VERTICAL, false, true, false); ((XYPlot) lineChart.getPlot()).getDo...
public static ChartPanel get(String title, String xLabel, String yLabel, Map<String, WordStatistic> data, Type type) { JFreeChart lineChart = ChartFactory.createXYLineChart(title, xLabel, yLabel, createDataset(getMap(data, type), type), PlotOrientation.VERTICAL, false, true, false); <DeepExtract> ((XYPlot) lineChart.ge...
university
positive
736
public static String getMD5AndSalt(String str, String salt) { byte[] data = encryptMD5(str).concat(salt).getBytes(); MessageDigest md5 = null; try { md5 = MessageDigest.getInstance("MD5"); md5.update(data); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } byte[] resultBytes = md5.digest(); StringBuilder bu...
public static String getMD5AndSalt(String str, String salt) { <DeepExtract> byte[] data = encryptMD5(str).concat(salt).getBytes(); MessageDigest md5 = null; try { md5 = MessageDigest.getInstance("MD5"); md5.update(data); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } byte[] resultBytes = md5.digest(); St...
ChuMuYa
positive
737
@Override public Future<Long> llen(byte[] key) { return execCmd(objectConverter, encode(channel.alloc(), longConverter, encode(channel.alloc(), LLEN.raw, key))); }
@Override public Future<Long> llen(byte[] key) { <DeepExtract> return execCmd(objectConverter, encode(channel.alloc(), longConverter, encode(channel.alloc(), LLEN.raw, key))); </DeepExtract> }
nedis
positive
738
public void init(boolean forEncryption, CipherParameters params) { if (!(params instanceof KeyParameter)) { throw new IllegalArgumentException("invalid parameter passed to RC6 init - " + params.getClass().getName()); } KeyParameter p = (KeyParameter) params; this.forEncryption = forEncryption; BigInteger[] L = new BigI...
public void init(boolean forEncryption, CipherParameters params) { if (!(params instanceof KeyParameter)) { throw new IllegalArgumentException("invalid parameter passed to RC6 init - " + params.getClass().getName()); } KeyParameter p = (KeyParameter) params; this.forEncryption = forEncryption; <DeepExtract> BigInteger[...
continent
positive
739
public Criteria andIdGreaterThan(Long value) { if (value == null) { throw new RuntimeException("Value for " + "id" + " cannot be null"); } criteria.add(new Criterion("id >", value)); return (Criteria) this; }
public Criteria andIdGreaterThan(Long value) { <DeepExtract> if (value == null) { throw new RuntimeException("Value for " + "id" + " cannot be null"); } criteria.add(new Criterion("id >", value)); </DeepExtract> return (Criteria) this; }
MarketServer
positive
740
@Override protected void replaceConfigurationImpl(BucketConfiguration newConfiguration, TokensInheritanceStrategy tokensInheritanceStrategy) { if (implicitConfigurationReplacement != null) { new ReplaceConfigurationCommand(newConfiguration, tokensInheritanceStrategy) = new CheckConfigurationVersionAndExecuteCommand<T>(...
@Override protected void replaceConfigurationImpl(BucketConfiguration newConfiguration, TokensInheritanceStrategy tokensInheritanceStrategy) { <DeepExtract> if (implicitConfigurationReplacement != null) { new ReplaceConfigurationCommand(newConfiguration, tokensInheritanceStrategy) = new CheckConfigurationVersionAndExec...
bucket4j
positive
741
private void drawTopRightRoundRect(Canvas canvas, Paint paint, float right, float bottom) { float right = mRadius - mMargin; float bottom = paint - mMargin; switch(mCornerType) { case ALL: new RectF(right - mDiameter, mMargin, right, mMargin + mDiameter).drawRoundRect(new RectF(mMargin, mMargin, right, bottom), mRadius...
private void drawTopRightRoundRect(Canvas canvas, Paint paint, float right, float bottom) { <DeepExtract> float right = mRadius - mMargin; float bottom = paint - mMargin; switch(mCornerType) { case ALL: new RectF(right - mDiameter, mMargin, right, mMargin + mDiameter).drawRoundRect(new RectF(mMargin, mMargin, right, bo...
SteamGifts
positive
743
public List<Integer> getAllElements(TreeNode root1, TreeNode root2) { List<Integer> list1 = new ArrayList(); if (root1 == null) return; inorder(root1.left, list1); list1.add(root1.val); inorder(root1.right, list1); List<Integer> list2 = new ArrayList(); if (root2 == null) return; inorder(root2.left, list2); list2.add(r...
public List<Integer> getAllElements(TreeNode root1, TreeNode root2) { List<Integer> list1 = new ArrayList(); if (root1 == null) return; inorder(root1.left, list1); list1.add(root1.val); inorder(root1.right, list1); List<Integer> list2 = new ArrayList(); if (root2 == null) return; inorder(root2.left, list2); list2.add(r...
youtube
positive
744
@Override public void onClick(View v) { ActionBar bar = getLeftNavBar(); int options = bar.getDisplayOptions(); boolean hadOption = (options & ActionBar.DISPLAY_HOME_AS_UP) != 0; bar.setDisplayOptions(hadOption ? 0 : ActionBar.DISPLAY_HOME_AS_UP, ActionBar.DISPLAY_HOME_AS_UP); }
@Override public void onClick(View v) { <DeepExtract> ActionBar bar = getLeftNavBar(); int options = bar.getDisplayOptions(); boolean hadOption = (options & ActionBar.DISPLAY_HOME_AS_UP) != 0; bar.setDisplayOptions(hadOption ? 0 : ActionBar.DISPLAY_HOME_AS_UP, ActionBar.DISPLAY_HOME_AS_UP); </DeepExtract> }
googletv-android-samples
positive
745
public void postSetSelection(final int position) { clearFocus(); post(new Runnable() { @Override public void run() { setSelection(position); } }); mScrollStateChangedRunnable.doScrollStateChange(this, OnScrollListener.SCROLL_STATE_IDLE); }
public void postSetSelection(final int position) { clearFocus(); post(new Runnable() { @Override public void run() { setSelection(position); } }); <DeepExtract> mScrollStateChangedRunnable.doScrollStateChange(this, OnScrollListener.SCROLL_STATE_IDLE); </DeepExtract> }
HijriDatePicker
positive
746
public String listFields() { StringBuilder text = new StringBuilder(); int count = 0; for (PluginField field : screenFields) text.append(String.format("%3d %s%n", count++, field)); if (text.length() > 0) text.deleteCharAt(text.length() - 1); StringBuilder text = new StringBuilder(); text.append(String.format("Sequence...
public String listFields() { StringBuilder text = new StringBuilder(); int count = 0; for (PluginField field : screenFields) text.append(String.format("%3d %s%n", count++, field)); if (text.length() > 0) text.deleteCharAt(text.length() - 1); <DeepExtract> StringBuilder text = new StringBuilder(); text.append(String.fo...
dm3270
positive
747
public HPacket appendString(String s, Charset charset) { isEdited = true; isEdited = true; packetInBytes = Arrays.copyOf(packetInBytes, packetInBytes.length + 2); ByteBuffer byteBuffer = ByteBuffer.allocate(4).putInt(s.getBytes(charset).length); for (int j = 2; j < 4; j++) { packetInBytes[packetInBytes.length - 4 + j] ...
public HPacket appendString(String s, Charset charset) { isEdited = true; isEdited = true; packetInBytes = Arrays.copyOf(packetInBytes, packetInBytes.length + 2); ByteBuffer byteBuffer = ByteBuffer.allocate(4).putInt(s.getBytes(charset).length); for (int j = 2; j < 4; j++) { packetInBytes[packetInBytes.length - 4 + j] ...
G-Earth
positive
749
public Criteria andQqBetween(String value1, String value2) { if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + "qq" + " cannot be null"); } criteria.add(new Criterion("qq between", value1, value2)); return (Criteria) this; }
public Criteria andQqBetween(String value1, String value2) { <DeepExtract> if (value1 == null || value2 == null) { throw new RuntimeException("Between values for " + "qq" + " cannot be null"); } criteria.add(new Criterion("qq between", value1, value2)); </DeepExtract> return (Criteria) this; }
uccn
positive
750
@Test public void totallyOrdered4() throws Exception { expected = true; middle = tree.right.left; possible1 = tree.right.left; possible2 = tree.right.left.right; assertEquals(expected, AreNodesOrdered.totallyOrdered(possible1, possible2, middle)); }
@Test public void totallyOrdered4() throws Exception { expected = true; middle = tree.right.left; possible1 = tree.right.left; possible2 = tree.right.left.right; <DeepExtract> assertEquals(expected, AreNodesOrdered.totallyOrdered(possible1, possible2, middle)); </DeepExtract> }
elements-of-programming-interviews-solutions
positive
752
public List<Object2LongEntry<K>> zrevrangeByRank(int start, int end) { final int zslLength = zsl.length(); start = ZSetUtils.convertStartRank(start, zslLength); end = ZSetUtils.convertEndRank(end, zslLength); if (ZSetUtils.isRankRangeEmpty(start, end, zslLength)) { return new ArrayList<>(); } int rangeLen = end - start...
public List<Object2LongEntry<K>> zrevrangeByRank(int start, int end) { <DeepExtract> final int zslLength = zsl.length(); start = ZSetUtils.convertStartRank(start, zslLength); end = ZSetUtils.convertEndRank(end, zslLength); if (ZSetUtils.isRankRangeEmpty(start, end, zslLength)) { return new ArrayList<>(); } int rangeLen...
gamioo
positive
753
public void setupServer() throws Exception { server = new Server(); ServerConnector connector = new ServerConnector(server); connector.setPort(0); server.addConnector(connector); servlet = new FakeJiraServlet(j); ServletContextHandler context = new ServletContextHandler(); ServletHolder servletHolder = new ServletHolde...
public void setupServer() throws Exception { server = new Server(); ServerConnector connector = new ServerConnector(server); connector.setPort(0); server.addConnector(connector); servlet = new FakeJiraServlet(j); ServletContextHandler context = new ServletContextHandler(); ServletHolder servletHolder = new ServletHolde...
jira-plugin
positive
754
@Override public void onSuccess(Object result) { sessionActive = true; initMenu(); String hash = Location.getHash(); String application = ""; if (hash != null && hash.length() > 0) { application = hash.substring(1); } if (application.length() > 0) { showApplication(application); } else { showApplication("ActivityApplic...
@Override public void onSuccess(Object result) { <DeepExtract> sessionActive = true; initMenu(); String hash = Location.getHash(); String application = ""; if (hash != null && hash.length() > 0) { application = hash.substring(1); } if (application.length() > 0) { showApplication(application); } else { showApplication("...
osw-web
positive
755
public static void main(String[] args) { a = new Dog(); System.out.println("eating..."); a = new Cat(); System.out.println("eating..."); a = new Lion(); System.out.println("eating..."); }
public static void main(String[] args) { a = new Dog(); <DeepExtract> System.out.println("eating..."); </DeepExtract> a = new Cat(); <DeepExtract> System.out.println("eating..."); </DeepExtract> a = new Lion(); <DeepExtract> System.out.println("eating..."); </DeepExtract> }
PGR-103-2020
positive
756
@Override public void onFinished() { if (emitter instanceof FlowableEmitter) { FlowableEmitter flowableEmitter = (FlowableEmitter) emitter; if (flowableEmitter.isCancelled()) { terminate(); } } else if (emitter instanceof ObservableEmitter) { ObservableEmitter observableEmitter = (ObservableEmitter) emitter; if (observ...
@Override public void onFinished() { <DeepExtract> if (emitter instanceof FlowableEmitter) { FlowableEmitter flowableEmitter = (FlowableEmitter) emitter; if (flowableEmitter.isCancelled()) { terminate(); } } else if (emitter instanceof ObservableEmitter) { ObservableEmitter observableEmitter = (ObservableEmitter) emitt...
App-Architecture
positive
757
@Override public Boolean call() throws Exception { return options.getAutoPort(); }
@Override public Boolean call() throws Exception { <DeepExtract> return options.getAutoPort(); </DeepExtract> }
gwt-gradle-plugin
positive
758
public void run() { UIManager.put("swing.boldMetal", Boolean.FALSE); JFrame frame = new JFrame("CMU GeoLocator version 3.0 Running Helper"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Dimension minimumSize = new Dimension(); minimumSize.setSize(1000, 1000); frame.setMinimumSize(minimumSize); frame.add(new Ne...
public void run() { UIManager.put("swing.boldMetal", Boolean.FALSE); <DeepExtract> JFrame frame = new JFrame("CMU GeoLocator version 3.0 Running Helper"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Dimension minimumSize = new Dimension(); minimumSize.setSize(1000, 1000); frame.setMinimumSize(minimumSize); fr...
geolocator-3.0
positive
759
public static String getCertIdByKeyStoreMap(String certPath, String certPwd) { if (!certKeyStoreMap.containsKey(certPath)) { loadRsaCert(certPath, certPwd); } Enumeration<String> aliasenum = null; try { aliasenum = certKeyStoreMap.get(certPath).aliases(); String keyAlias = null; if (aliasenum.hasMoreElements()) { keyAl...
public static String getCertIdByKeyStoreMap(String certPath, String certPwd) { if (!certKeyStoreMap.containsKey(certPath)) { loadRsaCert(certPath, certPwd); } <DeepExtract> Enumeration<String> aliasenum = null; try { aliasenum = certKeyStoreMap.get(certPath).aliases(); String keyAlias = null; if (aliasenum.hasMoreEleme...
pay
positive
760