before
stringlengths
33
3.21M
after
stringlengths
63
3.21M
repo
stringlengths
1
56
type
stringclasses
1 value
__index_level_0__
int64
0
442k
private void readDataFile() { String[] temp = null; File file = new File(filePath); ArrayList<String[]> dataArray = new ArrayList<String[]>(); try { BufferedReader in = new BufferedReader(new FileReader(file)); String str; String[] tempArray; while ((str = in.readLine()) != null) { tempArray = str.split(" "); dataArray...
private void readDataFile() { String[] temp = null; <DeepExtract> File file = new File(filePath); ArrayList<String[]> dataArray = new ArrayList<String[]>(); try { BufferedReader in = new BufferedReader(new FileReader(file)); String str; String[] tempArray; while ((str = in.readLine()) != null) { tempArray = str.split("...
datamining-18algorithms
positive
4,659
@SuppressWarnings("unchecked") public void scheme(Object scheme) { if (!(scheme instanceof List<?>)) { if (!((String) scheme).matches("^[a-zA-Z]+$")) { throw new IllegalArgumentException("The scheme only allows the letters 'a-z'. Was: " + scheme); } this.scheme.add((String) scheme); } else { this.scheme.addAll((List<St...
@SuppressWarnings("unchecked") public void scheme(Object scheme) { if (!(scheme instanceof List<?>)) { if (!((String) scheme).matches("^[a-zA-Z]+$")) { throw new IllegalArgumentException("The scheme only allows the letters 'a-z'. Was: " + scheme); } this.scheme.add((String) scheme); } else { this.scheme.addAll((List<St...
SetupBuilder
positive
4,660
public final int readShort() throws IOException { if (2 < 0 || 2 > 4) { throw new IllegalArgumentException(); } int result = 0; if (m_bigEndian) { for (int i = (2 - 1) * 8; i >= 0; i -= 8) { int b = m_stream.read(); if (b == -1) { throw new EOFException(); } m_position += 1; result |= (b << i); } } else { 2 *= 8; for (...
public final int readShort() throws IOException { <DeepExtract> if (2 < 0 || 2 > 4) { throw new IllegalArgumentException(); } int result = 0; if (m_bigEndian) { for (int i = (2 - 1) * 8; i >= 0; i -= 8) { int b = m_stream.read(); if (b == -1) { throw new EOFException(); } m_position += 1; result |= (b << i); } } else {...
EHBDroid
positive
4,661
public static double getAbilityDamageOrDefault(LivingEntity entity, double _default) { try { return entity.getAttribute(FBAttributes.ABILITY_DAMAGE).getValue(); } catch (NullPointerException e) { return _default; } }
public static double getAbilityDamageOrDefault(LivingEntity entity, double _default) { <DeepExtract> try { return entity.getAttribute(FBAttributes.ABILITY_DAMAGE).getValue(); } catch (NullPointerException e) { return _default; } </DeepExtract> }
ForgeBlock
positive
4,663
public void addPluginResult(PluginResult result, String callbackId) { if (callbackId == null) { Log.e(LOG_TAG, "Got plugin result with no callbackId", new Throwable()); return; } boolean noResult = result.getStatus() == PluginResult.Status.NO_RESULT.ordinal(); boolean keepCallback = result.getKeepCallback(); if (noResu...
public void addPluginResult(PluginResult result, String callbackId) { if (callbackId == null) { Log.e(LOG_TAG, "Got plugin result with no callbackId", new Throwable()); return; } boolean noResult = result.getStatus() == PluginResult.Status.NO_RESULT.ordinal(); boolean keepCallback = result.getKeepCallback(); if (noResu...
cc-calc
positive
4,664
private static GameObject buildCube(IRenderingEngine renderingEngine) throws IOException { File cubeFile = new File("Demos/res/cube.obj"); File diffuseVertFile = new File("Demos/res/diffuse.vert"); File diffuseFragFile = new File("Demos/res/diffuse.frag"); File grassFile = new File("Demos/res/grass.png"); ModelLoader m...
private static GameObject buildCube(IRenderingEngine renderingEngine) throws IOException { File cubeFile = new File("Demos/res/cube.obj"); File diffuseVertFile = new File("Demos/res/diffuse.vert"); File diffuseFragFile = new File("Demos/res/diffuse.frag"); File grassFile = new File("Demos/res/grass.png"); ModelLoader m...
WraithEngine
positive
4,665
public Criteria andCreateTimeGreaterThan(Date value) { if (value == null) { throw new RuntimeException("Value for " + "createTime" + " cannot be null"); } criteria.add(new Criterion("CREATE_TIME >", value)); return (Criteria) this; }
public Criteria andCreateTimeGreaterThan(Date value) { <DeepExtract> if (value == null) { throw new RuntimeException("Value for " + "createTime" + " cannot be null"); } criteria.add(new Criterion("CREATE_TIME >", value)); </DeepExtract> return (Criteria) this; }
ECPS
positive
4,666
public AbstractIntegerAssert<?> asInt() { isPrimitive(); if (!actual.getAsJsonPrimitive().isNumber()) { failWithMessage(shouldBeNumberButIs(actual.getAsString())); } return myself; return new JsonElementAssert(actual.getAsInt()); }
public AbstractIntegerAssert<?> asInt() { isPrimitive(); if (!actual.getAsJsonPrimitive().isNumber()) { failWithMessage(shouldBeNumberButIs(actual.getAsString())); } return myself; <DeepExtract> return new JsonElementAssert(actual.getAsInt()); </DeepExtract> }
inject-resources
positive
4,667
public void startActivity(Context context, Intent intent) { checkInit(); String plugIdOrPkg; String actName; ComponentName origComp = intent.getComponent(); if (origComp != null) { plugIdOrPkg = origComp.getPackageName(); actName = origComp.getClassName(); } else { throw new IllegalArgumentException("plug intent must s...
public void startActivity(Context context, Intent intent) { <DeepExtract> checkInit(); String plugIdOrPkg; String actName; ComponentName origComp = intent.getComponent(); if (origComp != null) { plugIdOrPkg = origComp.getPackageName(); actName = origComp.getClassName(); } else { throw new IllegalArgumentException("plug...
AndroidPlugin
positive
4,668
@Override protected void compute() { final Thread thread = Thread.currentThread(); ForkJoinThread forkJoinThread = threadMap.get(thread); if (forkJoinThread == null) { forkJoinThread = new ForkJoinThread(thread); threadMap.put(thread, forkJoinThread); } ForkJoinSprite sprite = new ForkJoinSprite(start, end, level); for...
@Override protected void compute() { final Thread thread = Thread.currentThread(); ForkJoinThread forkJoinThread = threadMap.get(thread); if (forkJoinThread == null) { forkJoinThread = new ForkJoinThread(thread); threadMap.put(thread, forkJoinThread); } ForkJoinSprite sprite = new ForkJoinSprite(start, end, level); for...
java-concurrent-animated
positive
4,669
@Test public void testCreateTable() throws Exception { super.setUp(); hive = createHiveUtil(); TopicPartition tp = new TopicPartition(TOPIC, PARTITION); DataWriter hdfsWriter = createWriter(context, avroData); hdfsWriter.recover(tp); List<SinkRecord> sinkRecords = createSinkRecords(7); hdfsWriter.write(sinkRecords); hd...
@Test public void testCreateTable() throws Exception { super.setUp(); hive = createHiveUtil(); <DeepExtract> TopicPartition tp = new TopicPartition(TOPIC, PARTITION); DataWriter hdfsWriter = createWriter(context, avroData); hdfsWriter.recover(tp); List<SinkRecord> sinkRecords = createSinkRecords(7); hdfsWriter.write(si...
kafka-connect-hdfs
positive
4,670
@Restricted(NoExternalUse.class) public static void throwUnlessUserHasPermissionToAccessJob(final Item context) { final AccessControlled ac = context instanceof AccessControlled ? (AccessControlled) context : Jenkins.getInstance(); ac.checkPermission(Item.READ); }
@Restricted(NoExternalUse.class) public static void throwUnlessUserHasPermissionToAccessJob(final Item context) { <DeepExtract> final AccessControlled ac = context instanceof AccessControlled ? (AccessControlled) context : Jenkins.getInstance(); ac.checkPermission(Item.READ); </DeepExtract> }
vsphere-cloud-plugin
positive
4,671
public String getFullIdentifier() { String fullId = id; if (agency != null) fullId = agency + '/' + fullId; if (version != null) fullId = fullId + '/' + version; return fullId; }
public String getFullIdentifier() { <DeepExtract> String fullId = id; if (agency != null) fullId = agency + '/' + fullId; if (version != null) fullId = fullId + '/' + version; return fullId; </DeepExtract> }
SDMX
positive
4,672
public void pong() throws org.apache.thrift.TException { pong_args args = new pong_args(); sendBase("pong", args); pong_result result = new pong_result(); receiveBase(result, "pong"); return; }
public void pong() throws org.apache.thrift.TException { pong_args args = new pong_args(); sendBase("pong", args); <DeepExtract> pong_result result = new pong_result(); receiveBase(result, "pong"); return; </DeepExtract> }
Thrift-Connection-Pool
positive
4,673
@Override public void run() { currentQuery = query; return null; if (task == null) { loading = false; } }
@Override public void run() { currentQuery = query; <DeepExtract> return null; </DeepExtract> if (task == null) { loading = false; } }
uservoice-android-sdk
positive
4,674
private void setChords() { AbstractButton chords = m_SourceButtons.getElements().nextElement(); m_SourceButtons.setSelected(chords.getModel(), true); ButtonModel sourceSelected = m_SourceButtons.getSelection(); if (sourceSelected == null) { m_DelayItem.setEnabled(false); m_TwidlitInit.setChords(); return; } switch(sour...
private void setChords() { AbstractButton chords = m_SourceButtons.getElements().nextElement(); m_SourceButtons.setSelected(chords.getModel(), true); <DeepExtract> ButtonModel sourceSelected = m_SourceButtons.getSelection(); if (sourceSelected == null) { m_DelayItem.setEnabled(false); m_TwidlitInit.setChords(); return;...
twidlit
positive
4,675
private boolean leaveChannel() { joinedChannel = false; enableLocalAudio = false; NERtcEx.getInstance().enableLocalAudio(enableLocalAudio); enableAudioIb.setImageResource(false ? R.drawable.selector_meeting_mute : R.drawable.selector_meeting_unmute); enableLocalVideo = false; NERtcEx.getInstance().enableLocalVideo(enab...
private boolean leaveChannel() { joinedChannel = false; enableLocalAudio = false; NERtcEx.getInstance().enableLocalAudio(enableLocalAudio); enableAudioIb.setImageResource(false ? R.drawable.selector_meeting_mute : R.drawable.selector_meeting_unmute); <DeepExtract> enableLocalVideo = false; NERtcEx.getInstance().enableL...
FUNimDemoDroid
positive
4,676
public static ValueType fromURI(final URI uri) { final ValueType[] values = ValueType.values(); for (final ValueType value : values) { if (value.uri.equals(uri.toString())) { return value; } } return null; }
public static ValueType fromURI(final URI uri) { <DeepExtract> final ValueType[] values = ValueType.values(); for (final ValueType value : values) { if (value.uri.equals(uri.toString())) { return value; } } return null; </DeepExtract> }
lyo.core
positive
4,678
public _Fields fieldForId(int fieldId) { switch(fieldId) { case 1: return ID; default: return null; } }
public _Fields fieldForId(int fieldId) { <DeepExtract> switch(fieldId) { case 1: return ID; default: return null; } </DeepExtract> }
tiny-mmo
positive
4,680
@Override public Map<String, Integer> getDroppedMessages() { logger.finest(" getDroppedMessages()"); Map<String, Integer> res = new HashMap<String, Integer>(); JsonArray arr = client.getJsonArray("/messaging_service/messages/dropped_by_ver"); for (int i = 0; i < arr.size(); i++) { JsonObject obj = arr.getJsonObject(i);...
@Override public Map<String, Integer> getDroppedMessages() { <DeepExtract> logger.finest(" getDroppedMessages()"); </DeepExtract> Map<String, Integer> res = new HashMap<String, Integer>(); JsonArray arr = client.getJsonArray("/messaging_service/messages/dropped_by_ver"); for (int i = 0; i < arr.size(); i++) { JsonObjec...
scylla-jmx
positive
4,681
@Test public void findAllCss_example() { browser.visit(InteractionTestsPage()); final String shouldFind = "#inspectingContent ul#cssTest li"; List<ElementScope> all = browser.findAllCss(shouldFind); assertThat(all.size(), is(equalTo(3))); assertThat(all.get(1).getText(), is(equalTo("two"))); assertThat(all.get(2).getTe...
@Test public void findAllCss_example() { <DeepExtract> browser.visit(InteractionTestsPage()); </DeepExtract> final String shouldFind = "#inspectingContent ul#cssTest li"; List<ElementScope> all = browser.findAllCss(shouldFind); assertThat(all.size(), is(equalTo(3))); assertThat(all.get(1).getText(), is(equalTo("two")))...
coypu-jvm
positive
4,682
@Override public K firstKey() { if (size == -1 || PatriciaTrie.this.modCount != expectedModCount) { Iterator<Map.Entry<K, V>> it = entrySet().iterator(); size = 0; Map.Entry<K, V> entry = null; if (it.hasNext()) { entry = it.next(); size = 1; } fromKey = entry == null ? null : entry.getKey(); if (fromKey != null) { Tri...
@Override public K firstKey() { <DeepExtract> if (size == -1 || PatriciaTrie.this.modCount != expectedModCount) { Iterator<Map.Entry<K, V>> it = entrySet().iterator(); size = 0; Map.Entry<K, V> entry = null; if (it.hasNext()) { entry = it.next(); size = 1; } fromKey = entry == null ? null : entry.getKey(); if (fromKey ...
sasi
positive
4,683
public void actionPerformed(java.awt.event.ActionEvent evt) { if (jDynamicTable.getSelectedRow() == -1) { messageComponent.showWarning("Pilih salah satu"); } else { DetailBarang detailBarang = dynamicTableModel.get(jDynamicTable.convertRowIndexToModel(jDynamicTable.getSelectedRow())); int jumlah = Integer.valueOf(jForm...
public void actionPerformed(java.awt.event.ActionEvent evt) { <DeepExtract> if (jDynamicTable.getSelectedRow() == -1) { messageComponent.showWarning("Pilih salah satu"); } else { DetailBarang detailBarang = dynamicTableModel.get(jDynamicTable.convertRowIndexToModel(jDynamicTable.getSelectedRow())); int jumlah = Integer...
simple-pos
positive
4,684
public static void main(String[] args) { int[] arr = { 1, 5, 4, 3, 2 }; for (int i = 0; i < arr.length; i++) { map.put(arr[i], i); } System.out.println(map); int i = 0, minswap = 0; }
public static void main(String[] args) { int[] arr = { 1, 5, 4, 3, 2 }; <DeepExtract> for (int i = 0; i < arr.length; i++) { map.put(arr[i], i); } System.out.println(map); int i = 0, minswap = 0; </DeepExtract> }
Java-Solutions
positive
4,685
private void collectStatistics(Node node) { if (node == null) { return; } InstanceIdentifier<Node> nodeID = InstanceIdentifier.create(Nodes.class).child(Node.class, node.key()); FlowCapableNode fcnode = node.augmentation(FlowCapableNode.class); if (fcnode != null) { processMeters(node, nodeID, fcnode); processTables(no...
private void collectStatistics(Node node) { if (node == null) { return; } InstanceIdentifier<Node> nodeID = InstanceIdentifier.create(Nodes.class).child(Node.class, node.key()); FlowCapableNode fcnode = node.augmentation(FlowCapableNode.class); if (fcnode != null) { processMeters(node, nodeID, fcnode); processTables(no...
tsdr
positive
4,686
@Override public A onFieldAccess(Expr base, String fieldName) { return this.returnValue; }
@Override public A onFieldAccess(Expr base, String fieldName) { <DeepExtract> return this.returnValue; </DeepExtract> }
dhallj
positive
4,687
private Parent createContent() { Pane root = new Pane(); root.setPrefSize(GRID_WIDTH * TILE_SIZE, GRID_HEIGHT * TILE_SIZE); Canvas canvas = new Canvas(GRID_WIDTH * TILE_SIZE, GRID_HEIGHT * TILE_SIZE); g = canvas.getGraphicsContext2D(); root.getChildren().addAll(canvas); original.add(new Tetromino(Color.GREEN, new Piece...
private Parent createContent() { Pane root = new Pane(); root.setPrefSize(GRID_WIDTH * TILE_SIZE, GRID_HEIGHT * TILE_SIZE); Canvas canvas = new Canvas(GRID_WIDTH * TILE_SIZE, GRID_HEIGHT * TILE_SIZE); g = canvas.getGraphicsContext2D(); root.getChildren().addAll(canvas); original.add(new Tetromino(Color.GREEN, new Piece...
FXTutorials
positive
4,688
int getStartLine(int def) { if (mCachedStart != INVALID_LINE) { return mCachedStart; } if (mViews.size() == 0) { return def; } final View startView = mViews.get(0); final LayoutParams lp = getLayoutParams(startView); mCachedStart = mPrimaryOrientation.getDecoratedStart(startView); if (lp.mFullSpan) { LazySpanLookup.Ful...
int getStartLine(int def) { if (mCachedStart != INVALID_LINE) { return mCachedStart; } if (mViews.size() == 0) { return def; } <DeepExtract> final View startView = mViews.get(0); final LayoutParams lp = getLayoutParams(startView); mCachedStart = mPrimaryOrientation.getDecoratedStart(startView); if (lp.mFullSpan) { Lazy...
SamsungOneUi
positive
4,689
public Criteria andCreateTimeNotIn(List<Date> values) { if (values == null) { throw new RuntimeException("Value for " + "createTime" + " cannot be null"); } addCriterion("create_time not in", new java.sql.Date(values.getTime()), "createTime"); return (Criteria) this; }
public Criteria andCreateTimeNotIn(List<Date> values) { <DeepExtract> if (values == null) { throw new RuntimeException("Value for " + "createTime" + " cannot be null"); } addCriterion("create_time not in", new java.sql.Date(values.getTime()), "createTime"); </DeepExtract> return (Criteria) this; }
SSM_BookSystem
positive
4,690
public String apply(final String markup) { if (tags.isEmpty()) { return markup; } if (null == tagletPattern) { tagletPattern = Pattern.compile(createTagletPattern(), Pattern.MULTILINE); } final Matcher matcher = tagletPattern.matcher(markup); if (!matcher.find()) { return markup; } matcher.reset(); final StringBuffer r...
public String apply(final String markup) { if (tags.isEmpty()) { return markup; } if (null == tagletPattern) { tagletPattern = Pattern.compile(createTagletPattern(), Pattern.MULTILINE); } final Matcher matcher = tagletPattern.matcher(markup); if (!matcher.find()) { return markup; } matcher.reset(); <DeepExtract> final ...
markdown-doclet
positive
4,691
public void setTopRightRadius(int topRightRadius) { mRCHelper.radii[2] = topRightRadius; mRCHelper.radii[3] = topRightRadius; if (null != mRCHelper) { mRCHelper.refreshRegion(this); } super.invalidate(); }
public void setTopRightRadius(int topRightRadius) { mRCHelper.radii[2] = topRightRadius; mRCHelper.radii[3] = topRightRadius; <DeepExtract> if (null != mRCHelper) { mRCHelper.refreshRegion(this); } super.invalidate(); </DeepExtract> }
RxMVVM
positive
4,692
protected float getScale(Matrix matrix) { matrix.getValues(mMatrixValues); return mMatrixValues[Matrix.MSCALE_X]; }
protected float getScale(Matrix matrix) { <DeepExtract> matrix.getValues(mMatrixValues); return mMatrixValues[Matrix.MSCALE_X]; </DeepExtract> }
Playground
positive
4,693
public static Stream<BufferedImage> getValidationStream2014Image() { Path[] paths = Arrays.stream(new File(Crohme.DIRECTORY_2019, "Task1_and_Task2/Task2_offlineRec/MainTask_formula/Train/IMGS/data_png_TestINKMLGT_2013")).flatMap((d) -> { try { return Files.list(d.toPath()); } catch (IOException ex) { Logger.getLogger(O...
public static Stream<BufferedImage> getValidationStream2014Image() { <DeepExtract> Path[] paths = Arrays.stream(new File(Crohme.DIRECTORY_2019, "Task1_and_Task2/Task2_offlineRec/MainTask_formula/Train/IMGS/data_png_TestINKMLGT_2013")).flatMap((d) -> { try { return Files.list(d.toPath()); } catch (IOException ex) { Logg...
mathocr-myscript
positive
4,694
@Override protected int computeHorizontalScrollOffset() { return isHorizontalMode() ? mCurrentScrollOffset : 0; }
@Override protected int computeHorizontalScrollOffset() { <DeepExtract> return isHorizontalMode() ? mCurrentScrollOffset : 0; </DeepExtract> }
ExpectLauncher
positive
4,695
public void childEvent(CuratorFramework curatorFramework, PathChildrenCacheEvent pathChildrenCacheEvent) throws Exception { logger.debug("received path change from zookeeper, key : " + REVERSE_MESSAGE_SOURCE_NAME_ZK_PATH); String partPath = REVERSE_MESSAGE_SOURCE_NAME_ZK_PATH.replace(REVERSE_MESSAGE_ZK_PATH + "/", "");...
public void childEvent(CuratorFramework curatorFramework, PathChildrenCacheEvent pathChildrenCacheEvent) throws Exception { <DeepExtract> logger.debug("received path change from zookeeper, key : " + REVERSE_MESSAGE_SOURCE_NAME_ZK_PATH); String partPath = REVERSE_MESSAGE_SOURCE_NAME_ZK_PATH.replace(REVERSE_MESSAGE_ZK_PA...
banyan
positive
4,696
@Override public void onViewTap(View view, float x, float y) { if (isImgHaveLoad) { if (isBarShow) { isBarShow = false; ObjectAnimator.ofFloat(ll_bottom_bar, "translationY", 0, ll_bottom_bar.getHeight()).setDuration(ANIMATION_DURATION).start(); ObjectAnimator.ofFloat(rl_top_bar, "translationY", 0, -rl_top_bar.getHeight...
@Override public void onViewTap(View view, float x, float y) { <DeepExtract> if (isImgHaveLoad) { if (isBarShow) { isBarShow = false; ObjectAnimator.ofFloat(ll_bottom_bar, "translationY", 0, ll_bottom_bar.getHeight()).setDuration(ANIMATION_DURATION).start(); ObjectAnimator.ofFloat(rl_top_bar, "translationY", 0, -rl_top...
JianDan_OkHttpWithVolley
positive
4,697
public static HttpResponse ok(HttpResponse response, Object data) { ResultCode resultCode = ResultCode.SUCCESS; Map<String, Object> json = new HashMap<>(4); json.put("code", resultCode.getResultCode()); json.put("data", data); response.addHeader(HeaderName.Content_Type, HeaderValue.Content_Type.TEXT_PLAIN_JSON); respon...
public static HttpResponse ok(HttpResponse response, Object data) { ResultCode resultCode = ResultCode.SUCCESS; Map<String, Object> json = new HashMap<>(4); json.put("code", resultCode.getResultCode()); json.put("data", data); <DeepExtract> response.addHeader(HeaderName.Content_Type, HeaderValue.Content_Type.TEXT_PLAIN...
mica-mqtt
positive
4,698
private void rebuild(int newLength) { int[] oldKeys = keys; int[] oldValues = values; byte[] oldStatus = status; keys = new int[newLength]; values = new int[newLength]; status = new byte[newLength]; size = 0; removedCount = 0; mask = newLength - 1; for (int i = 0; i < oldKeys.length; i++) { if (oldStatus[i] == FILLED) ...
private void rebuild(int newLength) { int[] oldKeys = keys; int[] oldValues = values; byte[] oldStatus = status; <DeepExtract> keys = new int[newLength]; values = new int[newLength]; status = new byte[newLength]; size = 0; removedCount = 0; mask = newLength - 1; </DeepExtract> for (int i = 0; i < oldKeys.length; i++) {...
ez-collections
positive
4,699
@Override public void completed(Line result, Object attachment) { Log.i("DHT: open new link to node " + result.getRemotePeerNode()); if (linkExists(result.getRemotePeerNode())) { Log.w("DHT: link exists"); if (null != null) { null.signal(); } return; } Link link = new Link(this, result.getRemotePeerNode()); link.setTri...
@Override public void completed(Line result, Object attachment) { <DeepExtract> Log.i("DHT: open new link to node " + result.getRemotePeerNode()); if (linkExists(result.getRemotePeerNode())) { Log.w("DHT: link exists"); if (null != null) { null.signal(); } return; } Link link = new Link(this, result.getRemotePeerNode()...
telehash-java
positive
4,700
@Test public void testInheritDifferentScopeResolve2() { begin(); try { for (String perm : "basic.perm1") { QualifiedPermission wp = new QualifiedPermission(perm); getPermissionService().setPermission(TEST_PLAYER, TEST_PLAYER_UUID, false, wp.getRegion(), wp.getWorld(), wp.getPermission(), true); } commit(); } finally { ...
@Test public void testInheritDifferentScopeResolve2() { begin(); try { for (String perm : "basic.perm1") { QualifiedPermission wp = new QualifiedPermission(perm); getPermissionService().setPermission(TEST_PLAYER, TEST_PLAYER_UUID, false, wp.getRegion(), wp.getWorld(), wp.getPermission(), true); } commit(); } finally { ...
zPermissions
positive
4,701
@RequestMapping(method = RequestMethod.GET, produces = JSON_API_MEDIA_TYPE, value = { "/{entity}", "/{entity}/{id}/relationships/{entity2}", "/{entity}/{id}/{child}", "/{entity}/{id}" }) @Cacheable(cacheResolver = "elideCacheResolver", keyGenerator = GetCacheKeyGenerator.NAME) public ResponseEntity<String> get(@Request...
@RequestMapping(method = RequestMethod.GET, produces = JSON_API_MEDIA_TYPE, value = { "/{entity}", "/{entity}/{id}/relationships/{entity2}", "/{entity}/{id}/{child}", "/{entity}/{id}" }) @Cacheable(cacheResolver = "elideCacheResolver", keyGenerator = GetCacheKeyGenerator.NAME) public ResponseEntity<String> get(@Request...
faf-java-api
positive
4,702
@Override public void run() { mEGL = (EGL10) EGLContext.getEGL(); mEGLDisplay = mEGL.eglGetCurrentDisplay(); mEGLContext = mEGL.eglGetCurrentContext(); mEGLScreenSurface = mEGL.eglGetCurrentSurface(EGL10.EGL_DRAW); if (recordStatus != RecordStatus.Stoped) { return; } recordStatus = RecordStatus.Capturing; videoFileInde...
@Override public void run() { <DeepExtract> mEGL = (EGL10) EGLContext.getEGL(); mEGLDisplay = mEGL.eglGetCurrentDisplay(); mEGLContext = mEGL.eglGetCurrentContext(); mEGLScreenSurface = mEGL.eglGetCurrentSurface(EGL10.EGL_DRAW); </DeepExtract> if (recordStatus != RecordStatus.Stoped) { return; } recordStatus = RecordSt...
Meishi_VideoEdit_SDK
positive
4,703
@Override protected void insertFacebookConnection2() { Connection<TestFacebookApi> facebookConnection = getFacebookConnectionFactory().createConnection(FACEBOOK_DATA_2); usersConnectionRepository.createConnectionRepository(getUserId1()).addConnection(facebookConnection); }
@Override protected void insertFacebookConnection2() { <DeepExtract> Connection<TestFacebookApi> facebookConnection = getFacebookConnectionFactory().createConnection(FACEBOOK_DATA_2); usersConnectionRepository.createConnectionRepository(getUserId1()).addConnection(facebookConnection); </DeepExtract> }
spring-social
positive
4,704
@SuppressWarnings("unchecked") @Test public void testNormal() { int capacity = 100; DirectBucketAllocator bucketAllocator = new DirectBucketAllocator(capacity); SortedMap<Integer, Integer> usedSpaces = bucketAllocator.getUsedSpace(); SortedMap<Integer, Integer> freeSpaces = bucketAllocator.getFreeSpaces(); int expected...
@SuppressWarnings("unchecked") @Test public void testNormal() { int capacity = 100; DirectBucketAllocator bucketAllocator = new DirectBucketAllocator(capacity); SortedMap<Integer, Integer> usedSpaces = bucketAllocator.getUsedSpace(); SortedMap<Integer, Integer> freeSpaces = bucketAllocator.getFreeSpaces(); int expected...
flink-spillable-statebackend
positive
4,705
private int fixupExprList(int start, int end) { int i, tkType; int[] indices = new int[2]; Token tk = null; for (i = start; i < end; i++) { tk = tokens.getToken(i); tkType = tk.getType(); if (tkType == FortranLexer.T_COMMA || tkType == FortranLexer.T_EOS) continue; indices[0] = i; indices[1] = end; if (arrayConstructor...
private int fixupExprList(int start, int end) { <DeepExtract> int i, tkType; int[] indices = new int[2]; Token tk = null; for (i = start; i < end; i++) { tk = tokens.getToken(i); tkType = tk.getType(); if (tkType == FortranLexer.T_COMMA || tkType == FortranLexer.T_EOS) continue; indices[0] = i; indices[1] = end; if (ar...
open-fortran-parser
positive
4,706
public Criteria andProduct_idGreaterThan(Integer value) { if (value == null) { throw new RuntimeException("Value for " + "product_id" + " cannot be null"); } criteria.add(new Criterion("product_id >", value)); return (Criteria) this; }
public Criteria andProduct_idGreaterThan(Integer value) { <DeepExtract> if (value == null) { throw new RuntimeException("Value for " + "product_id" + " cannot be null"); } criteria.add(new Criterion("product_id >", value)); </DeepExtract> return (Criteria) this; }
Tmall_SSM
positive
4,708
public static Calendar getInstance(@Nullable Date date) { Calendar calendar = Calendar.getInstance(); if (date != null) { calendar.setTime(date); } int year = getYear(calendar); int month = getMonth(calendar); int day = getDay(calendar); calendar.clear(); calendar.set(year, month, day); return calendar; }
public static Calendar getInstance(@Nullable Date date) { Calendar calendar = Calendar.getInstance(); if (date != null) { calendar.setTime(date); } <DeepExtract> int year = getYear(calendar); int month = getMonth(calendar); int day = getDay(calendar); calendar.clear(); calendar.set(year, month, day); </DeepExtract> ret...
BMWidget
positive
4,710
public SliceValue setTarget(float target) { this.value = value; this.originValue = value; this.diff = 0; return this; this.diff = target - originValue; return this; }
public SliceValue setTarget(float target) { <DeepExtract> this.value = value; this.originValue = value; this.diff = 0; return this; </DeepExtract> this.diff = target - originValue; return this; }
hellocharts-android
positive
4,711
@Override protected void executeOnLoadDataSuccess(Entity entity) { mBlogDetail = (BlogDetail) entity; String content = AppContext.getFromAssets(CONTENT_TEMPLATE); if (content == null) content = ""; content = content.replace("{%skin%}", "day"); content = content.replace("{%title%}", mBlogTitle); content = content.replac...
@Override protected void executeOnLoadDataSuccess(Entity entity) { mBlogDetail = (BlogDetail) entity; <DeepExtract> String content = AppContext.getFromAssets(CONTENT_TEMPLATE); if (content == null) content = ""; content = content.replace("{%skin%}", "day"); content = content.replace("{%title%}", mBlogTitle); content = ...
Cotable
positive
4,712
public static sizzle.types.SizzleLocation.Location parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { if (!isInitialized()) { throw new com.google.protobuf.UninitializedMessageException(result).asInvalidProtocolBufferException(); } return buildPartial(); }
public static sizzle.types.SizzleLocation.Location parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { <DeepExtract> if (!isInitialized()) { throw new com.google.protobuf.UninitializedMessageException(result).asInvalidProtocolBufferException(); } return buildPartia...
Sizzle
positive
4,713
public void setContext(String[] context) { this.context = context; length = target.length(); for (String c : context) length += c.length(); }
public void setContext(String[] context) { this.context = context; <DeepExtract> length = target.length(); for (String c : context) length += c.length(); </DeepExtract> }
OpenEphyra
positive
4,715
private void heapSort() { int start = heapSize / 2 - 1; for (int x = start; x >= 0; x--) { maxHeapify(x); } for (int x = heapSize - 1; x > 0; x--) { swap(0, heapSize - 1); heapSize = heapSize - 1; maxHeapify(0); } heapSize = array.length; }
private void heapSort() { <DeepExtract> int start = heapSize / 2 - 1; for (int x = start; x >= 0; x--) { maxHeapify(x); } </DeepExtract> for (int x = heapSize - 1; x > 0; x--) { swap(0, heapSize - 1); heapSize = heapSize - 1; maxHeapify(0); } heapSize = array.length; }
Algorithms-and-Data-Structures-in-Java
positive
4,716
public Criteria andRoleIsNotNull() { if ("role is not null" == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion("role is not null")); return (Criteria) this; }
public Criteria andRoleIsNotNull() { <DeepExtract> if ("role is not null" == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion("role is not null")); </DeepExtract> return (Criteria) this; }
Examination_System
positive
4,717
private TransactionStatement parseCommit() { if (readIf("TRANSACTION")) { command = new TransactionStatement(session, SQLStatement.COMMIT_TRANSACTION); command.setTransactionName(readUniqueIdentifier()); return command; } command = new TransactionStatement(session, SQLStatement.COMMIT); if (!currentTokenQuoted && equal...
private TransactionStatement parseCommit() { if (readIf("TRANSACTION")) { command = new TransactionStatement(session, SQLStatement.COMMIT_TRANSACTION); command.setTransactionName(readUniqueIdentifier()); return command; } command = new TransactionStatement(session, SQLStatement.COMMIT); <DeepExtract> if (!currentTokenQ...
Lealone-Plugins
positive
4,718
public static FileTransfer[] getAllActiveFileTransfers() throws SkypeException { try { String command = "SEARCH " + "ACTIVEFILETRANSFERS"; String responseHeader = "FILETRANSFERS "; String response = getConnectorInstance().execute(command, responseHeader); String data = response.substring(responseHeader.length()); Strin...
public static FileTransfer[] getAllActiveFileTransfers() throws SkypeException { <DeepExtract> try { String command = "SEARCH " + "ACTIVEFILETRANSFERS"; String responseHeader = "FILETRANSFERS "; String response = getConnectorInstance().execute(command, responseHeader); String data = response.substring(responseHeader.le...
skype-java-api
positive
4,719
public Boolean move(final String key, final int dbIndex) { if (client.getIntegerReply(RedisCommand.MOVE, key, String.valueOf(dbIndex)) == null) { return null; } else { return client.getIntegerReply(RedisCommand.MOVE, key, String.valueOf(dbIndex)) == 1; } }
public Boolean move(final String key, final int dbIndex) { <DeepExtract> if (client.getIntegerReply(RedisCommand.MOVE, key, String.valueOf(dbIndex)) == null) { return null; } else { return client.getIntegerReply(RedisCommand.MOVE, key, String.valueOf(dbIndex)) == 1; } </DeepExtract> }
rjc
positive
4,721
public List<String> binaryTreePaths(TreeNode root) { List<String> res = new ArrayList<>(); if (root == null) { return res; } if (root.left == null && root.right == null) { res.add("" + root.val); } "" += root.val + "->"; if (root.left != null) { helper(root.left, res, ""); } if (root.right != null) { helper(root.right,...
public List<String> binaryTreePaths(TreeNode root) { List<String> res = new ArrayList<>(); if (root == null) { return res; } <DeepExtract> if (root.left == null && root.right == null) { res.add("" + root.val); } "" += root.val + "->"; if (root.left != null) { helper(root.left, res, ""); } if (root.right != null) { help...
Leetcode-for-Fun
positive
4,722
public boolean isEmbedField(Class<?> clazz, String fieldName) { boolean result = false; Field[] fields; String name = clazz.getName(); Field[] fields; boolean recycled = false; SoftReference<Field[]> sr = cache.get(name); if (sr != null) { fields = sr.get(); if (fields == null) { recycled = true; } else { fields = fiel...
public boolean isEmbedField(Class<?> clazz, String fieldName) { boolean result = false; <DeepExtract> Field[] fields; String name = clazz.getName(); Field[] fields; boolean recycled = false; SoftReference<Field[]> sr = cache.get(name); if (sr != null) { fields = sr.get(); if (fields == null) { recycled = true; } else {...
bugu-mongo
positive
4,723
@Override public void update(List<T> values) throws Exception { list.clear(); clearCalled = true; if (values != null) { list.addAll(values); } }
@Override public void update(List<T> values) throws Exception { list.clear(); clearCalled = true; <DeepExtract> if (values != null) { list.addAll(values); } </DeepExtract> }
amazon-kinesis-connector-flink
positive
4,724
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { view = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_setting, null); appUninstall = (ImageButton) view.findViewById(R.id.setting_uninstall); setNet = (ImageButton) view.findViewById(R.id.setting_...
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { view = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_setting, null); appUninstall = (ImageButton) view.findViewById(R.id.setting_uninstall); setNet = (ImageButton) view.findViewById(R.id.setting_...
android-tv-launcher
positive
4,725
public String getMakeSdCardPath() { File sdkPath = new File(getPlatformConfiguration().getAndroidSdkHome()); File[] possiblePaths = { new File(sdkPath, MessageFormat.format("tools/{0}", "mksdcard")), new File(sdkPath, MessageFormat.format("tools/{0}.exe", "mksdcard")), new File(sdkPath, MessageFormat.format("tools/{0}....
public String getMakeSdCardPath() { <DeepExtract> File sdkPath = new File(getPlatformConfiguration().getAndroidSdkHome()); File[] possiblePaths = { new File(sdkPath, MessageFormat.format("tools/{0}", "mksdcard")), new File(sdkPath, MessageFormat.format("tools/{0}.exe", "mksdcard")), new File(sdkPath, MessageFormat.form...
arquillian-droidium
positive
4,726
private static Pair<String, Integer> getParameterPropertyDirective(final String propertyKey, final String propertyKeyPrefix) { Pair<String, Integer> result = null; if (propertyKey.startsWith(propertyKeyPrefix)) { final String directive = propertyKey.substring(propertyKeyPrefix.length()); final int index = directive.ind...
private static Pair<String, Integer> getParameterPropertyDirective(final String propertyKey, final String propertyKeyPrefix) { <DeepExtract> Pair<String, Integer> result = null; if (propertyKey.startsWith(propertyKeyPrefix)) { final String directive = propertyKey.substring(propertyKeyPrefix.length()); final int index =...
www-project-csrfguard
positive
4,727
@Scheduled(cron = "${handle.testPrefix.expiration.cron}") @Override public void purgeOld() { if (expirationDays < 0) return; Date now = new Date(); Date old = DateUtils.addDays(now, -expirationDays); long count = 0; log.info("Start deleting datasets older than " + old); List<Dataset> datasets = Dataset.findDatasetsByPr...
@Scheduled(cron = "${handle.testPrefix.expiration.cron}") @Override public void purgeOld() { if (expirationDays < 0) return; Date now = new Date(); Date old = DateUtils.addDays(now, -expirationDays); <DeepExtract> long count = 0; log.info("Start deleting datasets older than " + old); List<Dataset> datasets = Dataset.fi...
mds
positive
4,728
@Override public void setElement(WebElement element) { this.element = element; return element.getAttribute("id"); }
@Override public void setElement(WebElement element) { this.element = element; <DeepExtract> return element.getAttribute("id"); </DeepExtract> }
nuxeo-distribution
positive
4,731
@Override public ExecutionPlan generatePlan() { if (activeParticipants.isEmpty()) { int mostReads = 0; for (int i = 0; i < readsPerNodes.length; i++) { if (readsPerNodes[i] > readsPerNodes[mostReads]) mostReads = i; } activeParticipants.add(mostReads); } if (activeParticipants.contains(localNodeId)) { execPlan.setParti...
@Override public ExecutionPlan generatePlan() { if (activeParticipants.isEmpty()) { int mostReads = 0; for (int i = 0; i < readsPerNodes.length; i++) { if (readsPerNodes[i] > readsPerNodes[mostReads]) mostReads = i; } activeParticipants.add(mostReads); } if (activeParticipants.contains(localNodeId)) { execPlan.setParti...
elasql
positive
4,733
@Override public void widgetSelected(SelectionEvent e) { browser.stop(); }
@Override public void widgetSelected(SelectionEvent e) { <DeepExtract> browser.stop(); </DeepExtract> }
DJ-Sweet
positive
4,735
@Override public Action getAction() { if ((isDelete || isPlay) && null == index) { throw new IllegalArgumentException("Time fragment index is expected, please type -i to specify"); } if (isTimeTunnel) { if (isBlank(classPattern)) { throw new IllegalArgumentException("Class-pattern is expected, please type the wildcard ...
@Override public Action getAction() { <DeepExtract> if ((isDelete || isPlay) && null == index) { throw new IllegalArgumentException("Time fragment index is expected, please type -i to specify"); } if (isTimeTunnel) { if (isBlank(classPattern)) { throw new IllegalArgumentException("Class-pattern is expected, please type...
greys-anatomy
positive
4,736
public Criteria andFphmLessThan(String value) { if (value == null) { throw new RuntimeException("Value for " + "fphm" + " cannot be null"); } criteria.add(new Criterion("fphm <", value)); return (Criteria) this; }
public Criteria andFphmLessThan(String value) { <DeepExtract> if (value == null) { throw new RuntimeException("Value for " + "fphm" + " cannot be null"); } criteria.add(new Criterion("fphm <", value)); </DeepExtract> return (Criteria) this; }
einvoice
positive
4,737
@Ignore @Test public void signOut() throws CandybeanException { try { if (isLeftMenuOpen()) return; swipe(0.1, 0.5, 0.9, 0.5, 0.2); iface.pause(1000); } catch (WebDriverException e) { return; } WebElement userDropDown = iface.wd.findElement(By.id("com.evernote:id/signed_in_user_area")); userDropDown.click(); iface.paus...
@Ignore @Test public void signOut() throws CandybeanException { try { if (isLeftMenuOpen()) return; swipe(0.1, 0.5, 0.9, 0.5, 0.2); iface.pause(1000); } catch (WebDriverException e) { return; } WebElement userDropDown = iface.wd.findElement(By.id("com.evernote:id/signed_in_user_area")); userDropDown.click(); iface.paus...
candybean
positive
4,738
public static void initYarnConf(Configuration yarnConf) { URL coreDefault = Utils.class.getClassLoader().getResource(Constants.CORE_DEFAULT_CONF); if (coreDefault != null) { yarnConf.addResource(coreDefault); } if (new File(Constants.CORE_SITE_CONF).exists()) { yarnConf.addResource(new Path(Constants.CORE_SITE_CONF)); ...
public static void initYarnConf(Configuration yarnConf) { URL coreDefault = Utils.class.getClassLoader().getResource(Constants.CORE_DEFAULT_CONF); if (coreDefault != null) { yarnConf.addResource(coreDefault); } if (new File(Constants.CORE_SITE_CONF).exists()) { yarnConf.addResource(new Path(Constants.CORE_SITE_CONF)); ...
TonY
positive
4,739
@Override public void onDrawerOpened(View drawerView) { if (mDrawerImage == null) { super.onDrawerOpened(drawerView); return; } if (animateEnabled) { mDrawerImage.setProgress(1.f); } if (mActivity != null && mActivity.getActionBar() != null) { try { Method setHomeActionContentDescription = ActionBar.class.getDeclaredMe...
@Override public void onDrawerOpened(View drawerView) { if (mDrawerImage == null) { super.onDrawerOpened(drawerView); return; } if (animateEnabled) { mDrawerImage.setProgress(1.f); } <DeepExtract> if (mActivity != null && mActivity.getActionBar() != null) { try { Method setHomeActionContentDescription = ActionBar.class...
Dali-Doodle
positive
4,740
public void refine(GraphicsContext3D gc) { long startTime = 0; if (DEBUG_PRINT) { startTime = System.currentTimeMillis(); System.out.println("refine.begin[" + startTime + "]"); } long start = System.currentTimeMillis(); m_renderList.beginFrame(); { Transform3D transform = m_parameters.getObjectToEyeTransform(); boolean...
public void refine(GraphicsContext3D gc) { long startTime = 0; if (DEBUG_PRINT) { startTime = System.currentTimeMillis(); System.out.println("refine.begin[" + startTime + "]"); } long start = System.currentTimeMillis(); m_renderList.beginFrame(); { Transform3D transform = m_parameters.getObjectToEyeTransform(); boolean...
walrus
positive
4,741
@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { if (gossipRetryCount.getAndIncrement() < maxRetry) { retryExecutor.schedule(() -> { initializeGossipClient(); }, retryInterval, TimeUnit.MILLISECONDS); } else { LOG.debug("Could not connect to gossip server after max retries."); } }
@Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { <DeepExtract> if (gossipRetryCount.getAndIncrement() < maxRetry) { retryExecutor.schedule(() -> { initializeGossipClient(); }, retryInterval, TimeUnit.MILLISECONDS); } else { LOG.debug("Could not connect to gossip server after max retri...
bigio
positive
4,742
public ResultSet getExportedKeys(String catalog, String schema, String table) throws SQLException { if (_conn == null || _conn.isClosed()) { throw CassandraErrors.connectionClosedException(); } if (!quiet) { throw CassandraErrors.notSupportedException(); } return CassandraUtils.DUMMY_RESULT_SET; }
public ResultSet getExportedKeys(String catalog, String schema, String table) throws SQLException { <DeepExtract> if (_conn == null || _conn.isClosed()) { throw CassandraErrors.connectionClosedException(); } </DeepExtract> if (!quiet) { throw CassandraErrors.notSupportedException(); } return CassandraUtils.DUMMY_RESULT...
cassandra-jdbc-driver
positive
4,743
@JmsListener(destination = "${queue.engineRequestQueue}", concurrency = "${jms-listener.concurrency}") public void receive(final Message msg) { if (msg == null) { logger.error("Received null message!"); return; } String correlationId; try { correlationId = msg.getJMSCorrelationID(); } catch (Exception ignore) { correla...
@JmsListener(destination = "${queue.engineRequestQueue}", concurrency = "${jms-listener.concurrency}") public void receive(final Message msg) { if (msg == null) { logger.error("Received null message!"); return; } <DeepExtract> String correlationId; try { correlationId = msg.getJMSCorrelationID(); } catch (Exception ign...
alfresco-transform-core
positive
4,744
@Override public String getString() { return "NULL"; }
@Override public String getString() { <DeepExtract> return "NULL"; </DeepExtract> }
Rider
positive
4,746
@Commit public void commit() { StringBuilder sb = new StringBuilder(); for (int i = 0; i < name.length(); i++) { char charAt = name.charAt(i); if (i == 0 && true) sb.append(Character.toUpperCase(charAt)); else if (charAt == '.' || charAt == '_') sb.append(Character.toUpperCase(name.charAt(++i))); else sb.append(charAt)...
@Commit public void commit() { <DeepExtract> StringBuilder sb = new StringBuilder(); for (int i = 0; i < name.length(); i++) { char charAt = name.charAt(i); if (i == 0 && true) sb.append(Character.toUpperCase(charAt)); else if (charAt == '.' || charAt == '_') sb.append(Character.toUpperCase(name.charAt(++i))); else sb....
Piwigo-Java
positive
4,747
@Override public void configure(B builder) throws Exception { super.configure(builder); }
@Override <DeepExtract> </DeepExtract> public void configure(B builder) throws Exception { <DeepExtract> </DeepExtract> super.configure(builder); <DeepExtract> </DeepExtract> }
spring-security-javaconfig
positive
4,748
public Criteria andReadNumIsNotNull() { if ("read_num is not null" == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion("read_num is not null")); return (Criteria) this; }
public Criteria andReadNumIsNotNull() { <DeepExtract> if ("read_num is not null" == null) { throw new RuntimeException("Value for condition cannot be null"); } criteria.add(new Criterion("read_num is not null")); </DeepExtract> return (Criteria) this; }
Maven_SSM
positive
4,749
@Test(expected = IllegalArgumentException.class) public void testRTriangle_IllegalArgumentException_1() { return new RTriangle(new RPoint2D(0, 0), new RPoint2D(2, 0), new RPoint2D(1, 0)); }
@Test(expected = IllegalArgumentException.class) public void testRTriangle_IllegalArgumentException_1() { <DeepExtract> return new RTriangle(new RPoint2D(0, 0), new RPoint2D(2, 0), new RPoint2D(1, 0)); </DeepExtract> }
CompGeom
positive
4,750
@Test public void testTryConsume_SynchronizedLimited() throws Throwable { int threadCount = 4; Function<Bucket, Long> action = b -> b.asBlocking().tryConsumeUninterruptibly(1, Duration.ofMillis(50), UninterruptibleBlockingStrategy.PARKING) ? 1L : 0L; int durationSeconds = System.getenv("CI") == null ? 5 : 1; Consumptio...
@Test public void testTryConsume_SynchronizedLimited() throws Throwable { int threadCount = 4; Function<Bucket, Long> action = b -> b.asBlocking().tryConsumeUninterruptibly(1, Duration.ofMillis(50), UninterruptibleBlockingStrategy.PARKING) ? 1L : 0L; <DeepExtract> int durationSeconds = System.getenv("CI") == null ? 5 :...
bucket4j
positive
4,751
@Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { String value; if (mEntryValues == null) { value = null; } else { value = mEntryValues[position].toString(); } if (position != mSelectedIndex && callChangeListener(value)) { setValue(position, value); } }
@Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { <DeepExtract> String value; if (mEntryValues == null) { value = null; } else { value = mEntryValues[position].toString(); } </DeepExtract> if (position != mSelectedIndex && callChangeListener(value)) { setValue(position, val...
ShadowsocksRR
positive
4,752
default T modify(Function<? super T, ? extends T> mutator) { T modified = mutator.apply(get()); delegate.set(converter.revertNonNull(modified)); return modified; }
default T modify(Function<? super T, ? extends T> mutator) { T modified = mutator.apply(get()); <DeepExtract> delegate.set(converter.revertNonNull(modified)); </DeepExtract> return modified; }
durian
positive
4,753
public Spell setCurrentSpellPosition(Player player, int id) throws IllegalArgumentException { PlayerSpellConfig psc = (PlayerSpellConfig) HPS.ConfigurationManager.getConfig(ConfigurationType.PLAYER_SPELL); List<String> spellsTheyKnow = psc.getStringListOrEmpty(player.getName()); if (spellsTheyKnow == null || id >= spel...
public Spell setCurrentSpellPosition(Player player, int id) throws IllegalArgumentException { PlayerSpellConfig psc = (PlayerSpellConfig) HPS.ConfigurationManager.getConfig(ConfigurationType.PLAYER_SPELL); List<String> spellsTheyKnow = psc.getStringListOrEmpty(player.getName()); if (spellsTheyKnow == null || id >= spel...
HarryPotterSpells
positive
4,754
@Override public int scrollHorizontallyBy(int dx, Recycler recycler, State state) { if (DEBUG) Log.v(getTag(), "scrollHorizontallyBy " + dx); if (!mLayoutEnabled || !hasDoneFirstLayout()) { return 0; } if (mRecycler != null || mState != null) { Log.e(TAG, "Recycler information was not released, bug!"); } mRecycler = re...
@Override public int scrollHorizontallyBy(int dx, Recycler recycler, State state) { if (DEBUG) Log.v(getTag(), "scrollHorizontallyBy " + dx); if (!mLayoutEnabled || !hasDoneFirstLayout()) { return 0; } if (mRecycler != null || mState != null) { Log.e(TAG, "Recycler information was not released, bug!"); } mRecycler = re...
tv-waterfall-layout
positive
4,755
ItemInfo infoForAnyChild(View child) { while ((parent = child.getParent()) != this) { if (parent == null || !(parent instanceof View)) { return null; } child = (View) parent; } for (int i = 0; i < mItems.size(); i++) { ItemInfo ii = mItems.get(i); if (mAdapter.isViewFromObject(child, ii.object)) { return ii; } } return...
ItemInfo infoForAnyChild(View child) { while ((parent = child.getParent()) != this) { if (parent == null || !(parent instanceof View)) { return null; } child = (View) parent; } <DeepExtract> for (int i = 0; i < mItems.size(); i++) { ItemInfo ii = mItems.get(i); if (mAdapter.isViewFromObject(child, ii.object)) { return ...
OkCalendar
positive
4,756
public Page<D> search(SearchPageable searchPageable) { Assert.notNull(searchPageable, "searchPageable must not be null."); final StringBuilder whereClause = new StringBuilder("WHERE "); final List<String> params = new ArrayList<>(); final Iterator<String> columnIterator = searchPageable.getColumns().iterator(); while (...
public Page<D> search(SearchPageable searchPageable) { Assert.notNull(searchPageable, "searchPageable must not be null."); final StringBuilder whereClause = new StringBuilder("WHERE "); final List<String> params = new ArrayList<>(); final Iterator<String> columnIterator = searchPageable.getColumns().iterator(); while (...
spring-cloud-dashboard
positive
4,757
public static void main(String[] args) { AntCompiler comp = new AntCompiler("ant-build.xml", "Izpack"); project.executeTarget("izpack-standalone"); }
public static void main(String[] args) { AntCompiler comp = new AntCompiler("ant-build.xml", "Izpack"); <DeepExtract> project.executeTarget("izpack-standalone"); </DeepExtract> }
setupmaker
positive
4,758
public static boolean isMobile4GConnected() { getConnectivityManager(); return isConnected(Mobile4G, sConnectivityManager.getActiveNetworkInfo()); }
public static boolean isMobile4GConnected() { <DeepExtract> getConnectivityManager(); return isConnected(Mobile4G, sConnectivityManager.getActiveNetworkInfo()); </DeepExtract> }
NoHttp
positive
4,759
public String encodeFullBech32m() { byte[] payload = new byte[1 + script.codeHash.length + 1 + script.args.length]; payload[0] = 0x00; int pos = 1; System.arraycopy(script.codeHash, 0, payload, pos, script.codeHash.length); pos += script.codeHash.length; payload[pos] = script.hashType.pack(); pos++; System.arraycopy(sc...
public String encodeFullBech32m() { byte[] payload = new byte[1 + script.codeHash.length + 1 + script.args.length]; payload[0] = 0x00; int pos = 1; System.arraycopy(script.codeHash, 0, payload, pos, script.codeHash.length); pos += script.codeHash.length; payload[pos] = script.hashType.pack(); pos++; System.arraycopy(sc...
ckb-sdk-java
positive
4,760
public void rewind() { i = null; i = tuples.iterator(); }
public void rewind() { i = null; <DeepExtract> i = tuples.iterator(); </DeepExtract> }
SimpleDB-Database-System
positive
4,761
public static boolean isMount(String url) { Pattern pattern = Pattern.compile(MOUNT_REGEX); Matcher matcher = pattern.matcher(url); return matcher.matches(); }
public static boolean isMount(String url) { <DeepExtract> Pattern pattern = Pattern.compile(MOUNT_REGEX); Matcher matcher = pattern.matcher(url); return matcher.matches(); </DeepExtract> }
B4D
positive
4,762
@Override public void onRefresh() { mRefreshLayout.setRefreshing(true); fetchFirstPage(); }
@Override public void onRefresh() { <DeepExtract> mRefreshLayout.setRefreshing(true); fetchFirstPage(); </DeepExtract> }
Derpibooru
positive
4,763
private void run() throws FileNotFoundException { System.out.println("GenerateFiles v0.01"); System.out.println(String.format("%d keywords loaded", keywords.length)); final File dataDir = new File(dataDirName, dataSetName); if (!dataDir.exists()) { dataDir.mkdirs(); println(String.format("Created dataset dir: %s", data...
private void run() throws FileNotFoundException { System.out.println("GenerateFiles v0.01"); System.out.println(String.format("%d keywords loaded", keywords.length)); final File dataDir = new File(dataDirName, dataSetName); if (!dataDir.exists()) { dataDir.mkdirs(); println(String.format("Created dataset dir: %s", data...
Mensa
positive
4,764
@Override public void removeUpdate(final DocumentEvent e) { if (!this.documentHasBeenChangedFlag) { this.documentHasBeenChangedFlag = true; if (this.currentOpenedFile != null) { this.menuFileSave.setEnabled(true); } setTitle("*" + getTitle()); } }
@Override public void removeUpdate(final DocumentEvent e) { <DeepExtract> if (!this.documentHasBeenChangedFlag) { this.documentHasBeenChangedFlag = true; if (this.currentOpenedFile != null) { this.menuFileSave.setEnabled(true); } setTitle("*" + getTitle()); } </DeepExtract> }
jprol
positive
4,765
public StridedInterval getValueOfGlobalRegion() { if (isTop()) { return StridedInterval.getTop(dataWidth); } else if (!valueSet.containsKey(GlobalRegion.getGlobalRegion())) { return StridedInterval.getTop(dataWidth); } return valueSet.get(GlobalRegion.getGlobalRegion()); }
public StridedInterval getValueOfGlobalRegion() { <DeepExtract> if (isTop()) { return StridedInterval.getTop(dataWidth); } else if (!valueSet.containsKey(GlobalRegion.getGlobalRegion())) { return StridedInterval.getTop(dataWidth); } return valueSet.get(GlobalRegion.getGlobalRegion()); </DeepExtract> }
bjoern
positive
4,767
@Test public void testSelfishMiner2() { final double[] pows = new double[] { 0.01, 0.50 }; final int runs = 2; final int hours = 5; final String nlName = RegistryNetworkLatencies.name(RegistryNetworkLatencies.Type.UNIFORM, 2000); final String bdlName = RegistryNodeBuilders.name(RegistryNodeBuilders.Location.RANDOM, tru...
@Test public void testSelfishMiner2() { <DeepExtract> final double[] pows = new double[] { 0.01, 0.50 }; final int runs = 2; final int hours = 5; final String nlName = RegistryNetworkLatencies.name(RegistryNetworkLatencies.Type.UNIFORM, 2000); final String bdlName = RegistryNodeBuilders.name(RegistryNodeBuilders.Locati...
wittgenstein
positive
4,768
private void initAbsListView() { setClickable(true); setFocusableInTouchMode(true); setWillNotDraw(false); setAlwaysDrawnWithCacheEnabled(false); if (mScrollingCacheEnabled && !true) { clearScrollingCache(); } mScrollingCacheEnabled = true; final ViewConfiguration configuration = ViewConfiguration.get(getContext()); mT...
private void initAbsListView() { setClickable(true); setFocusableInTouchMode(true); setWillNotDraw(false); setAlwaysDrawnWithCacheEnabled(false); <DeepExtract> if (mScrollingCacheEnabled && !true) { clearScrollingCache(); } mScrollingCacheEnabled = true; </DeepExtract> final ViewConfiguration configuration = ViewConfig...
MoGuJie
positive
4,769
public boolean query(char letter) { list.add(letter); if (list.size() - 1 < 0) return false; char ch = list.get(list.size() - 1); TrieNode cur = root.get(ch); if (cur == null) return false; if (cur.getEnd()) return true; return search(cur, list.size() - 1 - 1); }
public boolean query(char letter) { list.add(letter); <DeepExtract> if (list.size() - 1 < 0) return false; char ch = list.get(list.size() - 1); TrieNode cur = root.get(ch); if (cur == null) return false; if (cur.getEnd()) return true; return search(cur, list.size() - 1 - 1); </DeepExtract> }
OnlineJudge-Solutions
positive
4,770
public void run() { LOG.trace("Executing shutdown hook..."); stopAwait(); if (runner != null) { LOG.debug("Bringing down Runner..."); runner.shutdown(); runner = null; LOG.info("Pax Runner daemon stopped."); } }
public void run() { LOG.trace("Executing shutdown hook..."); <DeepExtract> stopAwait(); if (runner != null) { LOG.debug("Bringing down Runner..."); runner.shutdown(); runner = null; LOG.info("Pax Runner daemon stopped."); } </DeepExtract> }
org.ops4j.pax.runner
positive
4,771