before
stringlengths
12
3.21M
after
stringlengths
41
3.21M
repo
stringlengths
1
56
type
stringclasses
1 value
__index_level_0__
int64
0
442k
@Deprecated public void setSwipeListener(SwipeListener listener) { if (mListeners == null) { mListeners = new ArrayList<SwipeListener>(); } mListeners.add(listener); }
@Deprecated public void setSwipeListener(SwipeListener listener) { <DeepExtract> if (mListeners == null) { mListeners = new ArrayList<SwipeListener>(); } mListeners.add(listener); </DeepExtract> }
9GAG
positive
4,920
@Override public int getDestroyBaseScore(Base card) { int defaultScore = card.getCost(); CardRules cardRules = getCardRules(card, destroyBaseRulesMap); if (cardRules != null) { return getCardScore(card, cardRules, defaultScore); } return defaultScore; }
@Override public int getDestroyBaseScore(Base card) { int defaultScore = card.getCost(); <DeepExtract> CardRules cardRules = getCardRules(card, destroyBaseRulesMap); if (cardRules != null) { return getCardScore(card, cardRules, defaultScore); } return defaultScore; </DeepExtract> }
star-realms-simulator
positive
4,921
private void loadProperties() { final ApplicationVersion currentApplicationVersion = CoreUtils.getCurrentApplicationVersion(); currentVersionLabel.setText(currentApplicationVersion.getVersion()); currentBetaLabel.setVisible(currentApplicationVersion.isBeta()); final Beta beta = currentApplicationVersion.getBeta(); curr...
private void loadProperties() { <DeepExtract> final ApplicationVersion currentApplicationVersion = CoreUtils.getCurrentApplicationVersion(); currentVersionLabel.setText(currentApplicationVersion.getVersion()); currentBetaLabel.setVisible(currentApplicationVersion.isBeta()); final Beta beta = currentApplicationVersion.g...
WeblocOpener
positive
4,922
public void valueChanged(javax.swing.event.TreeSelectionEvent evt) { DefaultMutableTreeNode node = (DefaultMutableTreeNode) wallsTree.getLastSelectedPathComponent(); if (node != null && node.isLeaf() && node.getUserObject() != WallUpdater.currentData) { mapPanel.getLoop().syncAndExecute(() -> { WallUpdater.currentData ...
public void valueChanged(javax.swing.event.TreeSelectionEvent evt) { <DeepExtract> DefaultMutableTreeNode node = (DefaultMutableTreeNode) wallsTree.getLastSelectedPathComponent(); if (node != null && node.isLeaf() && node.getUserObject() != WallUpdater.currentData) { mapPanel.getLoop().syncAndExecute(() -> { WallUpdate...
DeedPlanner-2
positive
4,923
private static int BL_BASE(int nextInfo) { return BYTE_LOOKUP_BASE(WORD_ADDR(nextInfo)); }
private static int BL_BASE(int nextInfo) { <DeepExtract> return BYTE_LOOKUP_BASE(WORD_ADDR(nextInfo)); </DeepExtract> }
jcodings
positive
4,924
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); trackCount = new SimpleIntegerProperty(); albumCount = new SimpleIntegerProperty(); totalLength = new SimpleIntegerProperty(); name = new SimpleStringProperty(); albums = FXCollections.observableArrayList(...
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); trackCount = new SimpleIntegerProperty(); albumCount = new SimpleIntegerProperty(); totalLength = new SimpleIntegerProperty(); name = new SimpleStringProperty(); albums = FXCollections.observableArrayList(...
HypnosMusicPlayer
positive
4,925
public float getInertia() { float userValueScale = (float) (USER_VALUE_MAX - inertia.getCurrentValue()) / (float) (USER_VALUE_MAX); return ((3f - 0.75f) * userValueScale) + 0.75f; }
public float getInertia() { <DeepExtract> float userValueScale = (float) (USER_VALUE_MAX - inertia.getCurrentValue()) / (float) (USER_VALUE_MAX); return ((3f - 0.75f) * userValueScale) + 0.75f; </DeepExtract> }
Alien-Ark
positive
4,926
public static void logError(String text) { try { if (DBG) { if (true) { Log.println(Log.ERROR, TAG, text); } else { final int chunkSize = 1000; if (text.length() > chunkSize) log("Splitting logError into chunks. Length: " + text.length()); for (int i = 0; i < text.length(); i += chunkSize) Log.println(Log.ERROR, TAG, t...
public static void logError(String text) { <DeepExtract> try { if (DBG) { if (true) { Log.println(Log.ERROR, TAG, text); } else { final int chunkSize = 1000; if (text.length() > chunkSize) log("Splitting logError into chunks. Length: " + text.length()); for (int i = 0; i < text.length(); i += chunkSize) Log.println(Log...
librus-client
positive
4,927
@ParameterizedTest @MethodSource("makeBoardDecoratorTestContexts") void IfFieldIsNotMarkedOnTheBoard_ItShouldBeNotMarkedEither(BoardDecoratorTestContext cxt) { this.decoree = cxt.getDecoree(); this.sut = cxt.getSut(); boolean actual = sut.isMarked(new Field(0, 0)); assertFalse(actual); this.decoree = null; this.sut = n...
@ParameterizedTest @MethodSource("makeBoardDecoratorTestContexts") void IfFieldIsNotMarkedOnTheBoard_ItShouldBeNotMarkedEither(BoardDecoratorTestContext cxt) { this.decoree = cxt.getDecoree(); this.sut = cxt.getSut(); boolean actual = sut.isMarked(new Field(0, 0)); assertFalse(actual); <DeepExtract> this.decoree = null...
BoardGames.TDD-London-School
positive
4,928
public Builder mergeFrom(com.game.pb.server.rpc.hello.HelloReply other) { if (other == com.game.pb.server.rpc.hello.HelloReply.getDefaultInstance()) return this; if (!other.getMessage().isEmpty()) { message_ = other.message_; onChanged(); } return super.mergeUnknownFields(other.unknownFields); onChanged(); return this;...
public Builder mergeFrom(com.game.pb.server.rpc.hello.HelloReply other) { if (other == com.game.pb.server.rpc.hello.HelloReply.getDefaultInstance()) return this; if (!other.getMessage().isEmpty()) { message_ = other.message_; onChanged(); } <DeepExtract> return super.mergeUnknownFields(other.unknownFields); </DeepExtra...
game-server
positive
4,929
@Override public void run() { if (getViewState() == STATE_LOADING && MultiStateView.STATE_CONTENT != STATE_LOADING) { long diff = System.currentTimeMillis() - mLoadingStartTime; if (diff < MIN_SHOW_TIME) { mTargetState = MultiStateView.STATE_CONTENT; postDelayed(mLoadingHide, MIN_DELAY); } else { super.setViewState(Mul...
@Override public void run() { <DeepExtract> if (getViewState() == STATE_LOADING && MultiStateView.STATE_CONTENT != STATE_LOADING) { long diff = System.currentTimeMillis() - mLoadingStartTime; if (diff < MIN_SHOW_TIME) { mTargetState = MultiStateView.STATE_CONTENT; postDelayed(mLoadingHide, MIN_DELAY); } else { super.se...
DavyNews
positive
4,930
@Override public void run() { root_layout.invalidate(); }
@Override <DeepExtract> </DeepExtract> public void run() { <DeepExtract> </DeepExtract> root_layout.invalidate(); <DeepExtract> </DeepExtract> }
android-mvc-framework
positive
4,931
@Override public void onClick(View v) { tvJaxx.setSelected(false); ivJaxx.setVisibility(View.GONE); tvLedger.setSelected(false); ivLedger.setVisibility(View.GONE); tvCustom.setSelected(false); ivCustom.setVisibility(View.GONE); switch(v.getId()) { case R.id.rl_jaxx: selection = 0; tvJaxx.setSelected(true); ivJaxx.setVi...
@Override public void onClick(View v) { <DeepExtract> tvJaxx.setSelected(false); ivJaxx.setVisibility(View.GONE); tvLedger.setSelected(false); ivLedger.setVisibility(View.GONE); tvCustom.setSelected(false); ivCustom.setVisibility(View.GONE); </DeepExtract> switch(v.getId()) { case R.id.rl_jaxx: selection = 0; tvJaxx.se...
ETHWallet
positive
4,932
@Override public void onAdCompleted() { if (DEBUG) { Log.i(TAG, "Ad completed"); } if (mCurrentChannel != null && mNeedToCheckChannelAd) { SharedPreferences.Editor editor = mContext.getSharedPreferences(Constants.PREFERENCES_FILE_KEY, Context.MODE_PRIVATE).edit(); editor.putLong(Constants.SHARED_PREFERENCES_KEY_LAST_CH...
@Override public void onAdCompleted() { if (DEBUG) { Log.i(TAG, "Ad completed"); } if (mCurrentChannel != null && mNeedToCheckChannelAd) { SharedPreferences.Editor editor = mContext.getSharedPreferences(Constants.PREFERENCES_FILE_KEY, Context.MODE_PRIVATE).edit(); editor.putLong(Constants.SHARED_PREFERENCES_KEY_LAST_CH...
Tsutaeru
positive
4,933
public static void setUserName(String username) { Map<String, Object> map = getLocalMap(); map.put(SecurityConstants.DETAILS_USERNAME, username == null ? StringUtils.EMPTY : username); }
public static void setUserName(String username) { <DeepExtract> Map<String, Object> map = getLocalMap(); map.put(SecurityConstants.DETAILS_USERNAME, username == null ? StringUtils.EMPTY : username); </DeepExtract> }
PassJava-Platform
positive
4,934
public final void showNoNetwork(View view, ViewGroup.LayoutParams layoutParams) { if (null == view) { throw new NullPointerException("No network view is null!"); } mViewStatus = STATUS_NO_NETWORK; if (null == mNoNetworkView) { mNoNetworkView = view; View noNetworkRetryView = mNoNetworkView.findViewById(R.id.no_network_...
public final void showNoNetwork(View view, ViewGroup.LayoutParams layoutParams) { if (null == view) { throw new NullPointerException("No network view is null!"); } mViewStatus = STATUS_NO_NETWORK; if (null == mNoNetworkView) { mNoNetworkView = view; View noNetworkRetryView = mNoNetworkView.findViewById(R.id.no_network_...
Football-Lottery
positive
4,935
private static void reduceNamedOnly(OWLOntology ontology, OWLReasonerFactory reasonerFactory, boolean preserveAnnotatedAxioms) { Map<OWLClass, Map<OWLClass, Set<OWLSubClassOfAxiom>>> assertions = new HashMap<>(); Set<OWLSubClassOfAxiom> assertedSubClassAxioms = ontology.getAxioms(AxiomType.SUBCLASS_OF); for (OWLSubClas...
private static void reduceNamedOnly(OWLOntology ontology, OWLReasonerFactory reasonerFactory, boolean preserveAnnotatedAxioms) { Map<OWLClass, Map<OWLClass, Set<OWLSubClassOfAxiom>>> assertions = new HashMap<>(); Set<OWLSubClassOfAxiom> assertedSubClassAxioms = ontology.getAxioms(AxiomType.SUBCLASS_OF); for (OWLSubClas...
robot
positive
4,936
public static void main(String[] args) { TextJustification clz = new TextJustification(); List<String> result = new ArrayList<String>(); int last = 0; int currLen = 0; for (int i = 0; i < new String[] { "a", "b", "c", "d", "e" }.length; i++) { String word = new String[] { "a", "b", "c", "d", "e" }[i]; if (word.length()...
public static void main(String[] args) { TextJustification clz = new TextJustification(); <DeepExtract> List<String> result = new ArrayList<String>(); int last = 0; int currLen = 0; for (int i = 0; i < new String[] { "a", "b", "c", "d", "e" }.length; i++) { String word = new String[] { "a", "b", "c", "d", "e" }[i]; if ...
interviewprep
positive
4,937
public Criteria andRealReturnTimeIn(List<Date> values) { if (values == null) { throw new RuntimeException("Value for " + "realReturnTime" + " cannot be null"); } criteria.add(new Criterion("real_return_time in", values)); return (Criteria) this; }
public Criteria andRealReturnTimeIn(List<Date> values) { <DeepExtract> if (values == null) { throw new RuntimeException("Value for " + "realReturnTime" + " cannot be null"); } criteria.add(new Criterion("real_return_time in", values)); </DeepExtract> return (Criteria) this; }
SSM_BookSystem
positive
4,938
public void initializeFromTrainingData() { documentD = 0; ArrayList<Integer> wordVectorT = new ArrayList<Integer>(), documentVectorT = new ArrayList<Integer>(), sentenceVectorT = new ArrayList<Integer>(); while ((dataReader = trainDirReader.nextDocumentReader()) != null) { try { String[][] sentence; while ((sentence = ...
public void initializeFromTrainingData() { documentD = 0; ArrayList<Integer> wordVectorT = new ArrayList<Integer>(), documentVectorT = new ArrayList<Integer>(), sentenceVectorT = new ArrayList<Integer>(); while ((dataReader = trainDirReader.nextDocumentReader()) != null) { try { String[][] sentence; while ((sentence = ...
acceptability_prediction
positive
4,939
public int sumBetween(int a, int b) { if (b <= a) { throw new IllegalArgumentException("b must be greater than or equal to a"); } int sum = 0; for (int i = a; i < b; i++) { sum += i; } return sum; }
public int sumBetween(int a, int b) { <DeepExtract> if (b <= a) { throw new IllegalArgumentException("b must be greater than or equal to a"); } </DeepExtract> int sum = 0; for (int i = a; i < b; i++) { sum += i; } return sum; }
spork
positive
4,940
@Override public void computeScroll() { if (mScroller.isFinished()) { return; } mScroller.computeScrollOffset(); final int y = mScroller.getCurrY(); int unconsumed = y - mLastScrollerY; mLastScrollerY = y; mScrollConsumed[1] = 0; return mChildHelper.dispatchNestedPreScroll(0, unconsumed, mScrollConsumed, null, ViewComp...
@Override public void computeScroll() { if (mScroller.isFinished()) { return; } mScroller.computeScrollOffset(); final int y = mScroller.getCurrY(); int unconsumed = y - mLastScrollerY; mLastScrollerY = y; mScrollConsumed[1] = 0; <DeepExtract> return mChildHelper.dispatchNestedPreScroll(0, unconsumed, mScrollConsumed, ...
CoordinatorLayoutExample
positive
4,941
@Override public boolean checkArgs(RampartStageArgs args) { return args.getClass().getSimpleName().equals(Amp.Args.class.getSimpleName()); }
@Override public boolean checkArgs(RampartStageArgs args) { <DeepExtract> return args.getClass().getSimpleName().equals(Amp.Args.class.getSimpleName()); </DeepExtract> }
RAMPART
positive
4,942
@Override public void render(PoseStack matrices, int mouseX, int mouseY, float delta) { super.render(matrices, mouseX, mouseY, delta); int mid = width / 2; int top = leftButtonYOffset; int colorsLeft = mid - ((colors.size() * 21) / 2); if (hasScreenshot) { colorsTop = top + 117; coordsTop = top + 141; } else if (atEntr...
@Override public void render(PoseStack matrices, int mouseX, int mouseY, float delta) { super.render(matrices, mouseX, mouseY, delta); int mid = width / 2; int top = leftButtonYOffset; int colorsLeft = mid - ((colors.size() * 21) / 2); if (hasScreenshot) { colorsTop = top + 117; coordsTop = top + 141; } else if (atEntr...
Strange
positive
4,943
public String chooseClientAlias(String[] keyTypes, Principal[] issuers, Socket socket) { out.print("TestKeyManager.chooseClientAlias"); out.print(" | keyTypes: "); for (String keyType : keyTypes) { out.print(keyType); out.print(' '); } out.print(" | issuers: "); if (issuers == null) { out.print("null"); return; } for (...
public String chooseClientAlias(String[] keyTypes, Principal[] issuers, Socket socket) { out.print("TestKeyManager.chooseClientAlias"); out.print(" | keyTypes: "); for (String keyType : keyTypes) { out.print(keyType); out.print(' '); } out.print(" | issuers: "); if (issuers == null) { out.print("null"); return; } for (...
HttpResponseCache
positive
4,944
@Override public int getTransportControlFlags() { while (true) { if (mState == State.DONE) { return mResult; } else if (mState == State.IDLE) { start(); } try { wait(500); } catch (InterruptedException e) { } } }
@Override public int getTransportControlFlags() { <DeepExtract> while (true) { if (mState == State.DONE) { return mResult; } else if (mState == State.IDLE) { start(); } try { wait(500); } catch (InterruptedException e) { } } </DeepExtract> }
PlayerHater
positive
4,945
public static void rotateArray(int[] a, int n, int k) { for (int i = 0, j = k - 1; i < j; i++, j--) { int temp = a[i]; a[i] = a[j]; a[j] = temp; } for (int i = k, j = n - 1; i < j; i++, j--) { int temp = a[i]; a[i] = a[j]; a[j] = temp; } for (int i = 0, j = n - 1; i < j; i++, j--) { int temp = a[i]; a[i] = a[j]; a[j] =...
public static void rotateArray(int[] a, int n, int k) { for (int i = 0, j = k - 1; i < j; i++, j--) { int temp = a[i]; a[i] = a[j]; a[j] = temp; } for (int i = k, j = n - 1; i < j; i++, j--) { int temp = a[i]; a[i] = a[j]; a[j] = temp; } <DeepExtract> for (int i = 0, j = n - 1; i < j; i++, j--) { int temp = a[i]; a[i] ...
Problem-Solving-in-Data-Structures-Algorithms-using-Java
positive
4,946
@Override public void onClick(View view) { MediaPlayer mediaPlayer = new MediaPlayer(); try { mediaPlayer.setDataSource(listData.get(position).getContent()); mediaPlayer.prepare(); mediaPlayer.start(); } catch (IOException e) { e.printStackTrace(); } }
@Override public void onClick(View view) { <DeepExtract> MediaPlayer mediaPlayer = new MediaPlayer(); try { mediaPlayer.setDataSource(listData.get(position).getContent()); mediaPlayer.prepare(); mediaPlayer.start(); } catch (IOException e) { e.printStackTrace(); } </DeepExtract> }
CoolChat
positive
4,947
@Override public void onRoomDisconnected() { Log.d(LOG_TAG, "Room disconnected."); DCHECK(callbackExecutor); synchronized (statesLock) { this.roomStates = RoomStates.DISCONNECTED; } callbackExecutor.execute(() -> { closeInternal(); for (ConferenceClientObserver observer : observers) { observer.onServerDisconnected(); }...
@Override public void onRoomDisconnected() { Log.d(LOG_TAG, "Room disconnected."); DCHECK(callbackExecutor); <DeepExtract> synchronized (statesLock) { this.roomStates = RoomStates.DISCONNECTED; } </DeepExtract> callbackExecutor.execute(() -> { closeInternal(); for (ConferenceClientObserver observer : observers) { obser...
owt-client-android
positive
4,948
@Override public void closeInventory(EntityPlayer player) { this.isTrading = false; }
@Override public void closeInventory(EntityPlayer player) { <DeepExtract> this.isTrading = false; </DeepExtract> }
MrCrayfishFurnitureMod
positive
4,949
@Override public void cancelRequest() { responseFuture.cancel(true); if (listener != null) { listener.onActionEvent(new QQActionEvent(QQActionEvent.Type.EVT_CANCELED, null, actionFuture)); } }
@Override public void cancelRequest() { responseFuture.cancel(true); <DeepExtract> if (listener != null) { listener.onActionEvent(new QQActionEvent(QQActionEvent.Type.EVT_CANCELED, null, actionFuture)); } </DeepExtract> }
webqq-core
positive
4,950
@Override protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(w, h, oldw, oldh); if (!mReady) { mSetupPending = true; return; } if (mBitmap == null) { return; } mBitmapShader = new BitmapShader(mBitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP); mBitmapPaint.setAntiAlias(true); mBit...
@Override protected void onSizeChanged(int w, int h, int oldw, int oldh) { super.onSizeChanged(w, h, oldw, oldh); <DeepExtract> if (!mReady) { mSetupPending = true; return; } if (mBitmap == null) { return; } mBitmapShader = new BitmapShader(mBitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP); mBitmapPaint.setAntiAli...
BabySay
positive
4,952
private void init() { filterLayout = (LinearLayout) findViewById(R.id.layout_filter); filterListView = (RecyclerView) findViewById(R.id.filter_listView); btnShutter = (ImageView) findViewById(R.id.camera_shutter); btnMode = (ImageView) findViewById(R.id.camera_mode); btnFilter = (ImageView) findViewById(R.id.camera_fil...
private void init() { filterLayout = (LinearLayout) findViewById(R.id.layout_filter); filterListView = (RecyclerView) findViewById(R.id.filter_listView); btnShutter = (ImageView) findViewById(R.id.camera_shutter); btnMode = (ImageView) findViewById(R.id.camera_mode); btnFilter = (ImageView) findViewById(R.id.camera_fil...
MagicShow
positive
4,953
static int qChecksum(@NonNull byte[] data) { int crc = 0xffff; int crcHighBitMask = 0x8000; for (byte b : data) { int c = reflect(b, 8); for (int j = 0x80; j > 0; j >>= 1) { int highBit = crc & crcHighBitMask; crc <<= 1; if ((c & j) > 0) { highBit ^= crcHighBitMask; } if (highBit > 0) { crc ^= 0x1021; } } } int j = 1, ...
static int qChecksum(@NonNull byte[] data) { int crc = 0xffff; int crcHighBitMask = 0x8000; for (byte b : data) { int c = reflect(b, 8); for (int j = 0x80; j > 0; j >>= 1) { int highBit = crc & crcHighBitMask; crc <<= 1; if ((c & j) > 0) { highBit ^= crcHighBitMask; } if (highBit > 0) { crc ^= 0x1021; } } } <DeepExtrac...
QuasselDroid
positive
4,956
public boolean isValidBST(TreeNode root) { if (root == null) { return; } inOrder(root.left); result.add(root.val); inOrder(root.right); for (int i = 1; i < result.size(); i++) { if (result.get(i) <= result.get(i - 1)) { return false; } } return true; }
public boolean isValidBST(TreeNode root) { <DeepExtract> if (root == null) { return; } inOrder(root.left); result.add(root.val); inOrder(root.right); </DeepExtract> for (int i = 1; i < result.size(); i++) { if (result.get(i) <= result.get(i - 1)) { return false; } } return true; }
DataStructureAlgorithmsJava
positive
4,957
public Criteria andOuterTitleNotLike(String value) { if (value == null) { throw new RuntimeException("Value for " + "outerTitle" + " cannot be null"); } criteria.add(new Criterion("OUTER_TITLE not like", value)); return (Criteria) this; }
public Criteria andOuterTitleNotLike(String value) { <DeepExtract> if (value == null) { throw new RuntimeException("Value for " + "outerTitle" + " cannot be null"); } criteria.add(new Criterion("OUTER_TITLE not like", value)); </DeepExtract> return (Criteria) this; }
communitycode
positive
4,958
public String getSQLForWhereAppend() { StringBuilder sql = new StringBuilder(); if (InnerCommonUtils.isNotBlank(condition)) { sql.append(" AND "); if (isOrExpression) { sql.append("("); } sql.append(condition); if (isOrExpression) { sql.append(")"); } } if (InnerCommonUtils.isNotEmpty(groupBy)) { sql.append(" GROUP BY ...
public String getSQLForWhereAppend() { StringBuilder sql = new StringBuilder(); if (InnerCommonUtils.isNotBlank(condition)) { sql.append(" AND "); if (isOrExpression) { sql.append("("); } sql.append(condition); if (isOrExpression) { sql.append(")"); } } if (InnerCommonUtils.isNotEmpty(groupBy)) { sql.append(" GROUP BY ...
nimble-orm
positive
4,960
@Override public String toString() { StringWriter sw = new StringWriter(); new PrintWriter(sw).println(Util.getSpaces(0) + "Cardholder Verification Rule"); String indentStr = Util.getSpaces(0 + Log.INDENT_SIZE); new PrintWriter(sw).println(indentStr + "Rule: " + getRuleString()); new PrintWriter(sw).println(indentStr +...
@Override public String toString() { StringWriter sw = new StringWriter(); <DeepExtract> new PrintWriter(sw).println(Util.getSpaces(0) + "Cardholder Verification Rule"); String indentStr = Util.getSpaces(0 + Log.INDENT_SIZE); new PrintWriter(sw).println(indentStr + "Rule: " + getRuleString()); new PrintWriter(sw).print...
javaemvreader
positive
4,961
public LocalTime withSecond(int second) { if (this.second == second) { return this; } SECOND_OF_MINUTE.checkValidValue(second); if ((this.minute | second | this.nano) == 0) { return HOURS[this.hour]; } return new LocalTime(this.hour, this.minute, second, this.nano); }
public LocalTime withSecond(int second) { if (this.second == second) { return this; } SECOND_OF_MINUTE.checkValidValue(second); <DeepExtract> if ((this.minute | second | this.nano) == 0) { return HOURS[this.hour]; } return new LocalTime(this.hour, this.minute, second, this.nano); </DeepExtract> }
gwt-time
positive
4,963
public void drawScreen(int mouseX, int mouseY, float partialTicks) { block3: { int dWheel; block2: { dWheel = Mouse.getDWheel(); if (dWheel >= 0) break block2; for (Component component : this.components) { component.setY(component.getY() - 10); } break block3; } if (dWheel <= 0) break block3; for (Component component :...
public void drawScreen(int mouseX, int mouseY, float partialTicks) { <DeepExtract> block3: { int dWheel; block2: { dWheel = Mouse.getDWheel(); if (dWheel >= 0) break block2; for (Component component : this.components) { component.setY(component.getY() - 10); } break block3; } if (dWheel <= 0) break block3; for (Compone...
TrollGodCC-v1.5.4-Source-Code
positive
4,964
public static int maxNumber1(int[] arr, int limit) { tmp = 0; Arrays.sort(arr); limit--; int offset = 1; while (offset <= limit / 10) { offset *= 10; } if (offset == 0) { if (0 <= limit) { tmp = Math.max(tmp, 0); } } else { for (int cur : arr) { process1(arr, 0 * 10 + cur, offset / 10, limit); } } if (tmp == 0) { int r...
public static int maxNumber1(int[] arr, int limit) { tmp = 0; Arrays.sort(arr); limit--; int offset = 1; while (offset <= limit / 10) { offset *= 10; } <DeepExtract> if (offset == 0) { if (0 <= limit) { tmp = Math.max(tmp, 0); } } else { for (int cur : arr) { process1(arr, 0 * 10 + cur, offset / 10, limit); } } </DeepE...
publicclass2020
positive
4,965
@Test public void testSynthesize1() throws SynthesiseException { ApiSynthesizerJustReturn inner = new ApiSynthesizerJustReturn(); String result = new ApiSynthesizerRewriteEvidenceDecorator(inner).synthesise("nothing", ONE).iterator().next(); Assert.assertEquals("nothing", result); result = new ApiSynthesizerRewriteEvid...
@Test public void testSynthesize1() throws SynthesiseException { <DeepExtract> ApiSynthesizerJustReturn inner = new ApiSynthesizerJustReturn(); String result = new ApiSynthesizerRewriteEvidenceDecorator(inner).synthesise("nothing", ONE).iterator().next(); Assert.assertEquals("nothing", result); result = new ApiSynthesi...
bayou
positive
4,966
@Override public Path immediatelyBeforeSibling(Path path) { verifyRelationBetweenElements(path); String myXpath = getXPath().get(); boolean isInside = insideXpath.isPresent(); String processedXpath = isInside ? format("%s[ancestor::%s]", getXPathWithoutInsideClause().get(), insideXpath.get()) : myXpath; String newAlter...
@Override public Path immediatelyBeforeSibling(Path path) { <DeepExtract> verifyRelationBetweenElements(path); String myXpath = getXPath().get(); boolean isInside = insideXpath.isPresent(); String processedXpath = isInside ? format("%s[ancestor::%s]", getXPathWithoutInsideClause().get(), insideXpath.get()) : myXpath; S...
dollarx
positive
4,967
public BranchNode applyTransform(AffineTransform at) { this.suggestedPoint = at.transform(getSuggestedPoint(), null); for (BranchNode c : this.getChildren()) { c.applyTransform(at); } return this; }
public BranchNode applyTransform(AffineTransform at) { <DeepExtract> this.suggestedPoint = at.transform(getSuggestedPoint(), null); </DeepExtract> for (BranchNode c : this.getChildren()) { c.applyTransform(at); } return this; }
molvec
positive
4,968
public EodStagingInputBuilder withDisciminator1(String discriminator1) { setInput(EodInput.DISCRIMINATOR_1.toString(), discriminator1); return this; }
public EodStagingInputBuilder withDisciminator1(String discriminator1) { <DeepExtract> setInput(EodInput.DISCRIMINATOR_1.toString(), discriminator1); </DeepExtract> return this; }
staging-client-java
positive
4,969
@Override public void destroySessionBack(final C context, final String ticket) { String trackSessionId = (String) store.get(ticket); if (StringUtils.isEmpty(trackSessionId)) { logger.error("No trackSessionId available for this web context"); return; } store.remove(ticket); final SessionStore sessionStore = context.getS...
@Override public void destroySessionBack(final C context, final String ticket) { <DeepExtract> String trackSessionId = (String) store.get(ticket); if (StringUtils.isEmpty(trackSessionId)) { logger.error("No trackSessionId available for this web context"); return; } store.remove(ticket); final SessionStore sessionStore ...
colossus-shop
positive
4,970
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { if (mListener != null) { mListener.onNavigationItemSelected(position, id); } View selected = mView.getSelectedView(); if (selected == null) { return; } selected.setActivated(mExpanded); }
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { if (mListener != null) { mListener.onNavigationItemSelected(position, id); } <DeepExtract> View selected = mView.getSelectedView(); if (selected == null) { return; } selected.setActivated(mExpanded); </DeepExtract> }
android-demos
positive
4,971
@Override public void actionPerformed(ActionEvent e) { MessageHandler.addInfo(""); tablePaste.setEnabled(false); ClipboardData<DataTable> clipboardData = InMemoryClipboard.getData(); if (clipboardData != null) { DataTable table = clipboardData.getData(); owner.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); ...
@Override public void actionPerformed(ActionEvent e) { MessageHandler.addInfo(""); <DeepExtract> tablePaste.setEnabled(false); ClipboardData<DataTable> clipboardData = InMemoryClipboard.getData(); if (clipboardData != null) { DataTable table = clipboardData.getData(); owner.setCursor(Cursor.getPredefinedCursor(Cursor.W...
hrider
positive
4,972
private void startCutscene() { getPlayfieldEl().setVisibility(false); canvasEl.setVisibility(true); canvasEl.showChrome(false); canvasEl.createCutsceneField(); cutscene = CUTSCENES.get(Integer.valueOf(cutsceneId)); cutsceneSequenceId = -1; frightModeTime = levelConfig.frightTotalTime; getCutsceneFieldEl().createActors(...
private void startCutscene() { getPlayfieldEl().setVisibility(false); canvasEl.setVisibility(true); canvasEl.showChrome(false); canvasEl.createCutsceneField(); cutscene = CUTSCENES.get(Integer.valueOf(cutsceneId)); cutsceneSequenceId = -1; frightModeTime = levelConfig.frightTotalTime; getCutsceneFieldEl().createActors(...
google-pacman
positive
4,973
public void copyPosAndAllele(Snp snp) throws DataInconsistencyException { copyPosition(snp); boolean snpHasBeenSeenInGWAS = false; if (minorAllele_ != 'N' || majorAllele_ != 'N') { snpHasBeenSeenInGWAS = true; } if (Pascal.set.withZScore_ && minorAllele_ != snp.getMinorAllele()) { if (snp.getMinorAllele() != majorAllel...
public void copyPosAndAllele(Snp snp) throws DataInconsistencyException { copyPosition(snp); <DeepExtract> boolean snpHasBeenSeenInGWAS = false; if (minorAllele_ != 'N' || majorAllele_ != 'N') { snpHasBeenSeenInGWAS = true; } if (Pascal.set.withZScore_ && minorAllele_ != snp.getMinorAllele()) { if (snp.getMinorAllele()...
Pascal
positive
4,975
@Override public void onClick(View v) { Intent intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); startActivityForResult(intent, PICK_PHOTO); }
@Override public void onClick(View v) { <DeepExtract> Intent intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); startActivityForResult(intent, PICK_PHOTO); </DeepExtract> }
ndn-photo-app
positive
4,976
private void renderArc() { batch.begin(); if (!pause) { moveArcPosition(); adjustRotationIfNeccessary(); } if (isThrusting) { exhaustSprite.draw(batch); } sprite.draw(batch); if (index == 0 && App.TUTORIAL_CONTROLLER.isForcedPlanet01()) { markerScale = (markerScale + 0.01f) % 1f; planetMarkerSprite.setPosition(sprite.g...
private void renderArc() { batch.begin(); if (!pause) { moveArcPosition(); adjustRotationIfNeccessary(); } if (isThrusting) { exhaustSprite.draw(batch); } <DeepExtract> sprite.draw(batch); if (index == 0 && App.TUTORIAL_CONTROLLER.isForcedPlanet01()) { markerScale = (markerScale + 0.01f) % 1f; planetMarkerSprite.setPos...
Alien-Ark
positive
4,977
public RetCode macdExt(int startIdx, int endIdx, float[] inReal, int optInFastPeriod, MAType optInFastMAType, int optInSlowPeriod, MAType optInSlowMAType, int optInSignalPeriod, MAType optInSignalMAType, MInteger outBegIdx, MInteger outNBElement, double[] outMACD, double[] outMACDSignal, double[] outMACDHist) { MIntege...
public RetCode macdExt(int startIdx, int endIdx, float[] inReal, int optInFastPeriod, MAType optInFastMAType, int optInSlowPeriod, MAType optInSlowMAType, int optInSignalPeriod, MAType optInSignalMAType, MInteger outBegIdx, MInteger outNBElement, double[] outMACD, double[] outMACDSignal, double[] outMACDHist) { MIntege...
clj-ta-lib
positive
4,978
public static void loadConfig(boolean shouldChange) { mirrorEnabled = config.getBoolean("mirror-enabled", CATEGORY_SETTINGS, true, "Determines whether the mirror will be rendered."); mirrorClouds = config.getBoolean("mirror-clouds", CATEGORY_SETTINGS, false, "Set whether the mirror should render clouds."); mirrorFov = ...
public static void loadConfig(boolean shouldChange) { mirrorEnabled = config.getBoolean("mirror-enabled", CATEGORY_SETTINGS, true, "Determines whether the mirror will be rendered."); mirrorClouds = config.getBoolean("mirror-clouds", CATEGORY_SETTINGS, false, "Set whether the mirror should render clouds."); mirrorFov = ...
MrCrayfishFurnitureMod
positive
4,980
@Override public void localeChange(LocaleChangeEvent event) { titleLabel.setText(getTranslation("new.blog.post.title")); contentLabel.setText(getTranslation("new.blog.post.content")); save.setText(getTranslation("common.save")); reset.setText(getTranslation("common.reset")); }
@Override public void localeChange(LocaleChangeEvent event) { <DeepExtract> titleLabel.setText(getTranslation("new.blog.post.title")); contentLabel.setText(getTranslation("new.blog.post.content")); save.setText(getTranslation("common.save")); reset.setText(getTranslation("common.reset")); </DeepExtract> }
flow-demo
positive
4,981
@Override public void actionPerformed(ActionEvent e) { try { KeyStore keystore = keyStoreDialog.getKeyStore(); String alias = keyStoreDialog.getAlias(); if (keystore != null) { String className = this.getParameter(AppletConfig.PARAM_APPLET_ACTION_EXECUTE.getKey()); AppletExecute appletExecute = AppletExecuteFactory.fac...
@Override public void actionPerformed(ActionEvent e) { <DeepExtract> try { KeyStore keystore = keyStoreDialog.getKeyStore(); String alias = keyStoreDialog.getAlias(); if (keystore != null) { String className = this.getParameter(AppletConfig.PARAM_APPLET_ACTION_EXECUTE.getKey()); AppletExecute appletExecute = AppletExec...
certificate
positive
4,983
@Override public void handle(ActionEvent arg0) { if (callbackBeforeSave == null) return; callbackBeforeSave.run(); FileChooser fileChooser = new FileChooser(); fileChooser.setTitle("Insert save path"); fileChooser.setInitialDirectory(new File(System.getProperty("user.home"))); fileChooser.getExtensionFilters().addAll(e...
@Override public void handle(ActionEvent arg0) { <DeepExtract> if (callbackBeforeSave == null) return; callbackBeforeSave.run(); </DeepExtract> FileChooser fileChooser = new FileChooser(); fileChooser.setTitle("Insert save path"); fileChooser.setInitialDirectory(new File(System.getProperty("user.home"))); fileChooser.g...
Dluid
positive
4,984
protected void tearDown() throws Exception { super.tearDown(); GeoMysqlAdapterTest.geoMySqlAdapter = null; }
protected void tearDown() throws Exception { super.tearDown(); <DeepExtract> GeoMysqlAdapterTest.geoMySqlAdapter = null; </DeepExtract> }
opensoc-streaming
positive
4,985
@Override public void draw(Graphics2D g, int width, int height) { Rectangle bounds = getOwner().getAbsoluteBackgroundBounds(); CSSDecoder dec = new CSSDecoder(getOwner().getVisualContext()); if (position == BackgroundPosition.LEFT) imgx = 0; else if (position == BackgroundPosition.RIGHT) imgx = bounds.width - getIntrin...
@Override public void draw(Graphics2D g, int width, int height) { Rectangle bounds = getOwner().getAbsoluteBackgroundBounds(); <DeepExtract> CSSDecoder dec = new CSSDecoder(getOwner().getVisualContext()); if (position == BackgroundPosition.LEFT) imgx = 0; else if (position == BackgroundPosition.RIGHT) imgx = bounds.wid...
CSSBox
positive
4,986
public static MapDeserialiser<Boolean> readingBooleans() { return new MapDeserialiser<>(Deserialisers.ofBoolean); }
public static MapDeserialiser<Boolean> readingBooleans() { <DeepExtract> return new MapDeserialiser<>(Deserialisers.ofBoolean); </DeepExtract> }
octarine
positive
4,987
public Criteria andCategoryIdGreaterThan(Integer value) { if (value == null) { throw new RuntimeException("Value for " + "categoryId" + " cannot be null"); } criteria.add(new Criterion("category_id >", value)); return (Criteria) this; }
public Criteria andCategoryIdGreaterThan(Integer value) { <DeepExtract> if (value == null) { throw new RuntimeException("Value for " + "categoryId" + " cannot be null"); } criteria.add(new Criterion("category_id >", value)); </DeepExtract> return (Criteria) this; }
zheng-lite
positive
4,988
public boolean isExecBlacklisted(String exec) { try { PreparedStatement pSt = connection.prepareStatement("SELECT count(*) FROM BlacklistedExec WHERE Command LIKE ?"); pSt.setString(1, exec); try (ResultSet rs = pSt.executeQuery()) { if (rs.next()) { if (rs.getInt("count(*)") > 0) { return true; } } } } catch (SQLExcep...
public boolean isExecBlacklisted(String exec) { <DeepExtract> try { PreparedStatement pSt = connection.prepareStatement("SELECT count(*) FROM BlacklistedExec WHERE Command LIKE ?"); pSt.setString(1, exec); try (ResultSet rs = pSt.executeQuery()) { if (rs.next()) { if (rs.getInt("count(*)") > 0) { return true; } } } } c...
MCAntiMalware
positive
4,989
public Builder setStop(int index, com.conveyal.transitwand.TransitWandProtos.Upload.Route.Stop.Builder builderForValue) { if (!((bitField0_ & 0x00000004) == 0x00000004)) { stop_ = new java.util.ArrayList<com.conveyal.transitwand.TransitWandProtos.Upload.Route.Stop>(stop_); bitField0_ |= 0x00000004; } stop_.set(index, b...
public Builder setStop(int index, com.conveyal.transitwand.TransitWandProtos.Upload.Route.Stop.Builder builderForValue) { <DeepExtract> if (!((bitField0_ & 0x00000004) == 0x00000004)) { stop_ = new java.util.ArrayList<com.conveyal.transitwand.TransitWandProtos.Upload.Route.Stop>(stop_); bitField0_ |= 0x00000004; } </De...
transit-wand
positive
4,990
@Override public String imageZoomOut(String relativeFilePath, int maxWidth, int maxHeight) { String newRelativeFilePath = localAttachmentFileStoreService.imageZoomOut(relativeFilePath, maxWidth, maxHeight); if (StringUtils.isBlank(bucketName)) { return newRelativeFilePath; } boolean found = buildOssClient().doesObjectE...
@Override public String imageZoomOut(String relativeFilePath, int maxWidth, int maxHeight) { String newRelativeFilePath = localAttachmentFileStoreService.imageZoomOut(relativeFilePath, maxWidth, maxHeight); <DeepExtract> if (StringUtils.isBlank(bucketName)) { return newRelativeFilePath; } boolean found = buildOssClient...
s2jh4net
positive
4,991
private void readEngagement(ModelRootImpl modelRoot, JsonNode engagementNode, int readModelVersion) { String engagementName = engagementNode.get("engagementName").asText(null); String engagementType = engagementNode.get("engagementType").asText(null); String clientName = engagementNode.get("clientName").asText(null); S...
private void readEngagement(ModelRootImpl modelRoot, JsonNode engagementNode, int readModelVersion) { String engagementName = engagementNode.get("engagementName").asText(null); String engagementType = engagementNode.get("engagementType").asText(null); String clientName = engagementNode.get("clientName").asText(null); S...
solicitor
positive
4,992
public void limparBusca() { mTextoBusca = TextUtils.isEmpty(null) ? null : null; getLoaderManager().restartLoader(0, null, this); }
public void limparBusca() { <DeepExtract> mTextoBusca = TextUtils.isEmpty(null) ? null : null; getLoaderManager().restartLoader(0, null, this); </DeepExtract> }
dominando_android
positive
4,993
public Move setX(double x) { this.x = x; __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __X_ISSET_ID, true); return this; }
public Move setX(double x) { this.x = x; <DeepExtract> __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __X_ISSET_ID, true); </DeepExtract> return this; }
tiny-mmo
positive
4,994
private void shouldHandleMultipleSessions(final int iteration) throws Exception { if (client != null) { client.close(); } client = Vertx.vertx().createHttpClient(new HttpClientOptions().setMaxPoolSize(ACTIVE_CLIENT_COUNT)); final List<WebSocket> clientSockets = new ArrayList<>(); for (int i = 0; i < ACTIVE_CLIENT_COUNT...
private void shouldHandleMultipleSessions(final int iteration) throws Exception { <DeepExtract> if (client != null) { client.close(); } client = Vertx.vertx().createHttpClient(new HttpClientOptions().setMaxPoolSize(ACTIVE_CLIENT_COUNT)); </DeepExtract> final List<WebSocket> clientSockets = new ArrayList<>(); for (int i...
babl
positive
4,995
@RequestMapping(value = "/add", method = RequestMethod.PUT) public JsonResponse addJob(@RequestBody final JobConfig config) { if (Strings.isNullOrEmpty(config.getDependency()) && Strings.isNullOrEmpty(config.getCron())) { return JsonResponse.notOk("Dependency or cron need to be configured,and only one be configured.");...
@RequestMapping(value = "/add", method = RequestMethod.PUT) public JsonResponse addJob(@RequestBody final JobConfig config) { if (Strings.isNullOrEmpty(config.getDependency()) && Strings.isNullOrEmpty(config.getCron())) { return JsonResponse.notOk("Dependency or cron need to be configured,and only one be configured.");...
cronner
positive
4,996
@Test public void testOneToOne() throws IOException, DbException, TransactionAbortedException { ArrayList<ArrayList<Integer>> sourceTuples = new ArrayList<ArrayList<Integer>>(); HeapFile source = SystemTestUtil.createRandomHeapFile(1, 1, null, sourceTuples); assert sourceTuples.size() == 1; ArrayList<ArrayList<Integer>...
@Test public void testOneToOne() throws IOException, DbException, TransactionAbortedException { <DeepExtract> ArrayList<ArrayList<Integer>> sourceTuples = new ArrayList<ArrayList<Integer>>(); HeapFile source = SystemTestUtil.createRandomHeapFile(1, 1, null, sourceTuples); assert sourceTuples.size() == 1; ArrayList<Arra...
cs143-simpledb
positive
4,997
private void toggleLines() { hasLines = !hasLines; data = new ComboLineColumnChartData(generateColumnData(), generateLineData()); if (hasAxes) { Axis axisX = new Axis(); Axis axisY = new Axis().setHasLines(true); if (hasAxesNames) { axisX.setName("Axis X"); axisY.setName("Axis Y"); } data.setAxisXBottom(axisX); data.se...
private void toggleLines() { hasLines = !hasLines; <DeepExtract> data = new ComboLineColumnChartData(generateColumnData(), generateLineData()); if (hasAxes) { Axis axisX = new Axis(); Axis axisY = new Axis().setHasLines(true); if (hasAxesNames) { axisX.setName("Axis X"); axisY.setName("Axis Y"); } data.setAxisXBottom(a...
hellocharts-android
positive
4,998
public static void error() { File f = new File(error); if (f.canRead()) { try { Clip clip = AudioSystem.getClip(); AudioInputStream inputStream = AudioSystem.getAudioInputStream(f); clip.open(inputStream); clip.start(); } catch (Exception e) { } } }
public static void error() { <DeepExtract> File f = new File(error); if (f.canRead()) { try { Clip clip = AudioSystem.getClip(); AudioInputStream inputStream = AudioSystem.getAudioInputStream(f); clip.open(inputStream); clip.start(); } catch (Exception e) { } } </DeepExtract> }
AML-Project
positive
4,999
protected GLM refitGaussianRegressor(int[] attrs, boolean[] selected, int[][] indices, double[][] values, double[] y, int maxNumIters) { List<int[]> indicesList = new ArrayList<>(); List<double[]> valuesList = new ArrayList<>(); for (int j = 0; j < attrs.length; j++) { if (selected[j]) { indicesList.add(indices[j]); va...
protected GLM refitGaussianRegressor(int[] attrs, boolean[] selected, int[][] indices, double[][] values, double[] y, int maxNumIters) { List<int[]> indicesList = new ArrayList<>(); List<double[]> valuesList = new ArrayList<>(); for (int j = 0; j < attrs.length; j++) { if (selected[j]) { indicesList.add(indices[j]); va...
mltk
positive
5,000
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 static void main(String[] args) { runScriptExample(CORE_EXAMPLES_JS_DIR, "io/vertx/example/core/eventbus/pointtopoint/receiver.js", new VertxOptions().setClustered(true)); }
public static void main(String[] args) { <DeepExtract> runScriptExample(CORE_EXAMPLES_JS_DIR, "io/vertx/example/core/eventbus/pointtopoint/receiver.js", new VertxOptions().setClustered(true)); </DeepExtract> }
vertx-examples
positive
5,007
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