auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void resendLatestResourcePackRequest() { if (!resourcePackRequests.isEmpty()) { sendPacket(resourcePackRequests.peek()); } }

Target:
public void resendLatestResourcePackRequest() { if (!this.resourcePackRequests.isEmpty()) { this.sendPacket(this.resourcePackRequests.peek()); } }
Source:
public void registerCache(String name) { CacheDescriptor defaultDescriptor = getCacheDescriptor(DEFAULT_CACHE_ID); if (defaultDescriptor == null) { defaultDescriptor = new CacheDescriptor(); defaultDescriptor.options.put(CacheDescriptor.OPTION_MAX_SIZE, String.valueOf(CacheDescriptor.DEFAULT_MAX_SIZE)); register(XP_CACHES, defaultDescriptor); } CacheDescriptor newDescriptor = (CacheDescriptor) new CacheDescriptor().merge(defaultDescriptor); newDescriptor.name = name; register(XP_CACHES, newDescriptor); maybeStart(name); }

Target:
public void registerCache(String name) { CacheDescriptor defaultDescriptor = getCacheDescriptor(DEFAULT_CACHE_ID); if (defaultDescriptor == null) { defaultDescriptor = new CacheDescriptor(); defaultDescriptor.options.put(OPTION_MAX_SIZE, String.valueOf(DEFAULT_MAX_SIZE)); register(XP_CACHES, defaultDescriptor); } CacheDescriptor newDescriptor = (CacheDescriptor) new CacheDescriptor().merge(defaultDescriptor); newDescriptor.name = name; register(XP_CACHES, newDescriptor); maybeStart(name); }
Source:
public void loadPage(@NonNull PageTitle title, @NonNull HistoryEntry entry, boolean pushBackStack, int stagedScrollY, boolean isRefresh) { clearActivityActionBarTitle(); addTimeSpentReading(activeTimer.getElapsedSec()); activeTimer.reset(); tocHandler.setEnabled(false); errorState = false; errorView.setVisibility(View.GONE); tabLayout.enableAllTabs(); leadImagesHandler.hide(); model.setTitle(title); model.setTitleOriginal(title); model.setCurEntry(entry); model.setReadingListPage(null); model.setForceNetwork(isRefresh); updateProgressBar(true, true, 0); this.pageRefreshed = isRefresh; closePageScrollFunnel(); pageFragmentLoadState.load(pushBackStack, stagedScrollY); updateBookmarkAndMenuOptions(); if (entry.getSource() == HistoryEntry.SOURCE_RANDOM || entry.getSource() == HistoryEntry.SOURCE_FEED_RANDOM) { randomButton.show(); } else { randomButton.hide(); } }

Target:
public void loadPage(@NonNull PageTitle title, @NonNull HistoryEntry entry, boolean pushBackStack, int stagedScrollY, boolean isRefresh) { clearActivityActionBarTitle(); addTimeSpentReading(activeTimer.getElapsedSec()); activeTimer.reset(); tocHandler.setEnabled(false); errorState = false; errorView.setVisibility(View.GONE); tabLayout.enableAllTabs(); leadImagesHandler.hide(); model.setTitle(title); model.setTitleOriginal(title); model.setCurEntry(entry); model.setReadingListPage(null); model.setForceNetwork(isRefresh); updateProgressBar(true, true, 0); this.pageRefreshed = isRefresh; closePageScrollFunnel(); pageFragmentLoadState.load(pushBackStack, stagedScrollY); updateBookmarkAndMenuOptions(); if (entry.getSource() == HistoryEntry.SOURCE_RANDOM || entry.getSource() == HistoryEntry.SOURCE_FEED_RANDOM || entry.getSource() == HistoryEntry.SOURCE_APP_SHORTCUT_RANDOM) { randomButton.show(); } else { randomButton.hide(); } }
Source:
final AppConfig getAppConfig(CascadeStrategy defaultStrategy) throws ConfigException { return DefaultAppConfig.builder() .withDefaultCascadingStrategy(defaultStrategy) .withApplicationConfigName(DefaultAppConfig.DEFAULT_APP_CONFIG_NAME) .build(); }

Target:
final AppConfig getAppConfig(CascadeStrategy defaultStrategy) throws ConfigException { return DefaultAppConfig.builder() .withDefaultCascadingStrategy(defaultStrategy) .build(); }
Source:
ValidationResult validateNotRemovingUsedNetworkByVms() { Collection<String> removedNetworks = new HashSet<>(); for (NetworkAttachment removedAttachment : removedNetworkAttachments) { removedNetworks.add(existingNetworkRelatedToAttachment(removedAttachment).getName()); } final List<String> vmsNames = getVmInterfaceManager().findActiveVmsUsingNetworks(host.getId(), removedNetworks); final List<String> sortedRemovedNetworks = new ArrayList<>(removedNetworks); Collections.sort(sortedRemovedNetworks); DetachNetworkUsedByVmValidator detachNetworkUsedByVmValidator = new DetachNetworkUsedByVmValidator(vmsNames, sortedRemovedNetworks); return detachNetworkUsedByVmValidator.validate(); }

Target:
ValidationResult validateNotRemovingUsedNetworkByVms() { Collection<String> removedNetworks = new HashSet<>(); for (NetworkAttachment removedAttachment : removedNetworkAttachments) { removedNetworks.add(existingNetworkRelatedToAttachment(removedAttachment).getName()); } final List<String> vmsNames = getVmInterfaceManager().findActiveVmsUsingNetworks(host.getId(), removedNetworks); final List<String> removedNetworksList = new ArrayList<>(removedNetworks); DetachNetworkUsedByVmValidator detachNetworkUsedByVmValidator = new DetachNetworkUsedByVmValidator(vmsNames, removedNetworksList); return detachNetworkUsedByVmValidator.validate(); }
Source:
public static void main(String[] args) throws Exception { TChannel server = createServer(); TChannel client = createClient(); SubChannel subChannel = client.makeSubChannel("server"); final long start = System.currentTimeMillis(); final AtomicInteger counter = new AtomicInteger(0); TFutureCallback<RawResponse> callback = new TFutureCallback<RawResponse>() { @Override public void onResponse(RawResponse response) { if (!response.isError()) { System.out.println(String.format("Response received: response code: %s, header: %s, body: %s", response.getResponseCode(), response.getHeader(), response.getBody())); } else { System.out.println(String.format("Got error response: %s", response.toString())); } if (counter.incrementAndGet() >= 3) { synchronized (counter) { counter.notifyAll(); } } } }; for (int i = 0; i < 3; i++) { RawRequest request = new RawRequest.Builder("server", "pong") .setHeader("Marco") .setBody("Ping!") .build(); TFuture<RawResponse> future = subChannel.send(request, InetAddress.getByName("127.0.0.1"), 8888 ); future.addCallback(callback); } synchronized (counter) { counter.wait(); } System.out.println(String.format("\nTime cost: %dms", System.currentTimeMillis() - start)); server.shutdown(false); client.shutdown(false); }

Target:
public static void main(String[] args) throws Exception { TChannel server = createServer(); TChannel client = createClient(); SubChannel subChannel = client.makeSubChannel("server"); final long start = System.currentTimeMillis(); final CountDownLatch done = new CountDownLatch(3); TFutureCallback<RawResponse> callback = new TFutureCallback<RawResponse>() { @Override public void onResponse(RawResponse response) { if (!response.isError()) { System.out.println(String.format("Response received: response code: %s, header: %s, body: %s", response.getResponseCode(), response.getHeader(), response.getBody())); } else { System.out.println(String.format("Got error response: %s", response.toString())); } done.countDown(); } }; for (int i = 0; i < 3; i++) { RawRequest request = new RawRequest.Builder("server", "pong") .setHeader("Marco") .setBody("Ping!") .build(); TFuture<RawResponse> future = subChannel.send(request, InetAddress.getByName("127.0.0.1"), 8888 ); future.addCallback(callback); } done.await(); System.out.println(String.format("\nTime cost: %dms", System.currentTimeMillis() - start)); server.shutdown(false); client.shutdown(false); }
Source:
public JdbcMetadataStore(JdbcOperations jdbcOperations) { Assert.notNull(jdbcOperations, "'dataSource' must not be null"); this.jdbcTemplate = jdbcOperations; }

Target:
public JdbcMetadataStore(JdbcOperations jdbcOperations) { Assert.notNull(jdbcOperations, "'jdbcOperations' must not be null"); this.jdbcTemplate = jdbcOperations; }
Source:
public void validateEnums(WatchDog entity) { EnumValidator.validateEnum(WatchdogAction.class, entity.getAction(), true); EnumValidator.validateEnum(WatchdogModel.class, entity.getModel(), false); }

Target:
public void validateEnums(WatchDog entity) { if (entity != null) { EnumValidator.validateEnum(WatchdogAction.class, entity.getAction(), true); EnumValidator.validateEnum(WatchdogModel.class, entity.getModel(), true); } }
Source:
private void executeMethodInvocation(MethodInvocationTree mit) { setSymbolicValueOnFields(mit); final int numberOfArguments = mit.arguments().size(); final Pop pop = programState.unstackValue(numberOfArguments + 1); programState = pop.state; logState(mit); final SymbolicValue methodResult = constraintManager.createMethodSymbolicValue(mit, pop.values); programState = programState.stackValue(methodResult); }

Target:
private void executeMethodInvocation(MethodInvocationTree mit) { setSymbolicValueOnFields(mit); ProgramState.Pop unstack = programState.unstackValue(mit.arguments().size() + 1); programState = unstack.state; logState(mit); programState = programState.stackValue(constraintManager.createMethodSymbolicValue(mit, unstack.values)); }
Source:
protected boolean canDoAction() { boolean retValue = true; if (getParameters().getDescription().trim().length()==0) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_EMPTY_DESCRIPTION); retValue = false; } return retValue; }

Target:
protected boolean canDoAction() { boolean retValue = true; if (StringUtils.isEmpty(getParameters().getDescription())) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_EMPTY_DESCRIPTION); retValue = false; } return retValue; }
Source:
private Matcher<Object> alwaysFail() { return new AlwaysFailsMatcher(); }

Target:
private Matcher<Object> alwaysFail() { return new BaseMatcher<Object>() { @Override public boolean matches(Object item) { return false; } @Override public void describeTo(Description description) { } }; }
Source:
public static Configuration create(final HbaseConfig hbaseConfig) throws IOException { Configuration configuration = HBaseConfiguration.create(); if(null != hbaseConfig.getKeytabFileName() && !hbaseConfig.getKeytabFileName().isEmpty()) { File file = new File(hbaseConfig.getKeytabFileName()); if (file.exists()) { configuration.addResource(new File(hbaseConfig.getCoreSite()).toURI().toURL()); configuration.addResource(new File(hbaseConfig.getHdfsSite()).toURI().toURL()); configuration.addResource(new File(hbaseConfig.getHbasePolicy()).toURI().toURL()); configuration.addResource(new File(hbaseConfig.getHbaseSite()).toURI().toURL()); configuration.set("hbase.master.kerberos.principal", hbaseConfig.getAuthString()); configuration.set("hadoop.kerberos.kinit.command", hbaseConfig.getKinitPath()); UserGroupInformation.setConfiguration(configuration); System.setProperty("java.security.krb5.conf", hbaseConfig.getKerberosConfigFile()); if (hbaseConfig.isSecure()) { UserGroupInformation.loginUserFromKeytab( hbaseConfig.getAuthString(), hbaseConfig.getKeytabFileName()); logger.info("Logged into Hbase with User: " + UserGroupInformation.getLoginUser()); } } } return configuration; }

Target:
public static Configuration create(final HbaseConfig hbaseConfig) throws IOException { Configuration configuration = HBaseConfiguration.create(); if(hbaseConfig.isSecure() && null != hbaseConfig.getKeytabFileName() && !hbaseConfig.getKeytabFileName().isEmpty()) { File file = new File(hbaseConfig.getKeytabFileName()); if (file.exists()) { configuration.addResource(new File(hbaseConfig.getCoreSite()).toURI().toURL()); configuration.addResource(new File(hbaseConfig.getHdfsSite()).toURI().toURL()); configuration.addResource(new File(hbaseConfig.getHbasePolicy()).toURI().toURL()); configuration.addResource(new File(hbaseConfig.getHbaseSite()).toURI().toURL()); configuration.set("hbase.master.kerberos.principal", hbaseConfig.getAuthString()); configuration.set("hadoop.kerberos.kinit.command", hbaseConfig.getKinitPath()); UserGroupInformation.setConfiguration(configuration); System.setProperty("java.security.krb5.conf", hbaseConfig.getKerberosConfigFile()); if (hbaseConfig.isSecure()) { UserGroupInformation.loginUserFromKeytab( hbaseConfig.getAuthString(), hbaseConfig.getKeytabFileName()); logger.info("Logged into Hbase with User: " + UserGroupInformation.getLoginUser()); } } } return configuration; }
Source:
private QueryPlan getQueryPlan(final JobContext context, final Configuration configuration) throws IOException { Preconditions.checkNotNull(context); try { final String txnScnValue = configuration.get(PhoenixConfigurationUtil.TX_SCN_VALUE); final String currentScnValue = configuration.get(PhoenixConfigurationUtil.CURRENT_SCN_VALUE); final String snapshotName = configuration.get(PhoenixConfigurationUtil.SNAPSHOT_NAME_KEY); final Properties overridingProps = new Properties(); if(txnScnValue==null && currentScnValue!=null) { overridingProps.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, currentScnValue); } final Connection connection = ConnectionUtil.getInputConnection(configuration, overridingProps); final String selectStatement = PhoenixConfigurationUtil.getSelectStatement(configuration); Preconditions.checkNotNull(selectStatement); final Statement statement = connection.createStatement(); final PhoenixStatement pstmt = statement.unwrap(PhoenixStatement.class); final QueryPlan queryPlan = pstmt.optimizeQuery(selectStatement); final Scan scan = queryPlan.getContext().getScan(); if (txnScnValue!=null) { scan.setAttribute(BaseScannerRegionObserver.TX_SCN, Bytes.toBytes(Long.valueOf(txnScnValue))); } if(snapshotName != null) queryPlan.iterator(SnapshotMRParallelScanGrouper.init(configuration)); else queryPlan.iterator(TableMRParallelScanGrouper.getInstance()); return queryPlan; } catch (Exception exception) { LOG.error(String.format("Failed to get the query plan with error [%s]", exception.getMessage())); throw new RuntimeException(exception); } }

Target:
private QueryPlan getQueryPlan(final JobContext context, final Configuration configuration) throws IOException { Preconditions.checkNotNull(context); try { final String txnScnValue = configuration.get(PhoenixConfigurationUtil.TX_SCN_VALUE); final String currentScnValue = configuration.get(PhoenixConfigurationUtil.CURRENT_SCN_VALUE); final Properties overridingProps = new Properties(); if(txnScnValue==null && currentScnValue!=null) { overridingProps.put(PhoenixRuntime.CURRENT_SCN_ATTRIB, currentScnValue); } final Connection connection = ConnectionUtil.getInputConnection(configuration, overridingProps); final String selectStatement = PhoenixConfigurationUtil.getSelectStatement(configuration); Preconditions.checkNotNull(selectStatement); final Statement statement = connection.createStatement(); final PhoenixStatement pstmt = statement.unwrap(PhoenixStatement.class); final QueryPlan queryPlan = pstmt.optimizeQuery(selectStatement); final Scan scan = queryPlan.getContext().getScan(); if (txnScnValue!=null) { scan.setAttribute(BaseScannerRegionObserver.TX_SCN, Bytes.toBytes(Long.valueOf(txnScnValue))); } queryPlan.iterator(MapReduceParallelScanGrouper.getInstance()); return queryPlan; } catch (Exception exception) { LOG.error(String.format("Failed to get the query plan with error [%s]", exception.getMessage())); throw new RuntimeException(exception); } }
Source:
private void writeResponse(Command command, ExecutionHandlerContext context, ArrayList<ArrayList<Object>> items) { ByteBuf bigResponse = context.getByteBufAllocator().buffer(); items.forEach(item -> { ByteBuf response = null; try { response = Coder.getArrayResponse(context.getByteBufAllocator(), item); } catch (CoderException e) { e.printStackTrace(); } bigResponse.writeBytes(response); }); command.setResponse(bigResponse); }

Target:
private void writeResponse(Command command, ExecutionHandlerContext context, ArrayList<ArrayList<Object>> items) { ByteBuf aggregatedResponse = context.getByteBufAllocator().buffer(); items.forEach(item -> { ByteBuf response = null; try { response = Coder.getArrayResponse(context.getByteBufAllocator(), item); } catch (CoderException e) { logger.warn("Error encoding subscribe response", e); } aggregatedResponse.writeBytes(response); }); command.setResponse(aggregatedResponse); }
Source:
public static AdditionalFeature map(org.ovirt.engine.api.model.ClusterFeature model, AdditionalFeature template) { AdditionalFeature entity = new AdditionalFeature(); entity.setName(model.getName()); entity.setId(Guid.createGuidFromString(model.getId())); return entity; }

Target:
public static AdditionalFeature map(org.ovirt.engine.api.model.ClusterFeature model, AdditionalFeature template) { AdditionalFeature entity = template != null ? template : new AdditionalFeature(); entity.setName(model.getName()); entity.setId(Guid.createGuidFromString(model.getId())); return entity; }
Source:
public void testSendRequest() { OkHttpClient okHttpClient = Mockito.mock(OkHttpClient.class); okHttpClient.setConnectionSpecs(Collections.singletonList(ConnectionSpec.MODERN_TLS)); WebConnection webConnection = new WebConnection(okHttpClient); Call call = Mockito.mock(Call.class); Mockito.when(okHttpClient.newCall(Mockito.any(Request.class))).thenReturn(call); webConnection.setUrl(BASE_URL_TEST_HTTPS); boolean isRequestSuccessfullySend = webConnection.sendWebRequest(); assertTrue(isRequestSuccessfullySend); }

Target:
public void testSendRequest() { OkHttpClient okHttpClient = Mockito.mock(OkHttpClient.class); okHttpClient.setConnectionSpecs(Collections.singletonList(ConnectionSpec.MODERN_TLS)); WebConnection webConnection = new WebConnection(okHttpClient); Call call = Mockito.mock(Call.class); when(okHttpClient.newCall(any(Request.class))).thenReturn(call); webConnection.setUrl(BASE_URL_TEST_HTTPS); webConnection.sendWebRequest(); verify(call, times(1)).enqueue(any()); }
Source:
public static String printCommentTree(List<CommentTreeElement> cs) { String buffer = ""; for (CommentTreeElement c : cs) { buffer += printCommentTree(c, 0); } return buffer; }

Target:
public static String printCommentTree(List<CommentTreeElement> cs) { StringBuilder builder = new StringBuilder(); for (CommentTreeElement c : cs) { builder.append(printCommentTree(c, 0)); } return builder.toString(); }
Source:
public InputStream getSource(Locale locale) throws Exception { return this.resolver.resolve(locale).orElseThrow(() -> new IllegalStateException("Could not resolve source for locale " + locale + ".")); }

Target:
public InputStream getSource(Locale locale) throws Exception { checkNotNull(locale, "locale"); return this.resolver.resolve(locale).orElseThrow(() -> new IllegalStateException("Could not resolve source for locale " + locale + ".")); }
Source:
private void launchEditTagsDialog(final Context context, final AppPojo app) { AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle(context.getResources().getString(R.string.tags_add_title)); @SuppressLint("InflateParams") final View v = LayoutInflater.from(context).inflate(R.layout.tags_dialog, null); final MultiAutoCompleteTextView tagInput = v.findViewById(R.id.tag_input); ArrayAdapter<String> adapter = new ArrayAdapter<>(context, android.R.layout.simple_dropdown_item_1line, KissApplication.getApplication(context).getDataHandler().getTagsHandler().getAllTagsAsArray()); tagInput.setTokenizer(new SpaceTokenizer()); tagInput.setText(appPojo.getTags()); tagInput.setAdapter(adapter); builder.setView(v); builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); app.setTags(tagInput.getText().toString()); KissApplication.getApplication(context).getDataHandler().getTagsHandler().setTags(app.id, app.getTags()); app.displayTags = app.getTags(); String msg = context.getResources().getString(R.string.tags_confirmation_added); Toast.makeText(context, msg, Toast.LENGTH_SHORT).show(); } }); builder.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); AlertDialog dialog = builder.create(); dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); dialog.show(); }

Target:
private void launchEditTagsDialog(final Context context, final AppPojo app) { AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle(context.getResources().getString(R.string.tags_add_title)); final View v = View.inflate(context, R.layout.tags_dialog, null); final MultiAutoCompleteTextView tagInput = v.findViewById(R.id.tag_input); ArrayAdapter<String> adapter = new ArrayAdapter<>(context, android.R.layout.simple_dropdown_item_1line, KissApplication.getApplication(context).getDataHandler().getTagsHandler().getAllTagsAsArray()); tagInput.setTokenizer(new SpaceTokenizer()); tagInput.setText(appPojo.getTags()); tagInput.setAdapter(adapter); builder.setView(v); builder.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); app.setTags(tagInput.getText().toString()); KissApplication.getApplication(context).getDataHandler().getTagsHandler().setTags(app.id, app.getTags()); app.displayTags = app.getTags(); String msg = context.getResources().getString(R.string.tags_confirmation_added); Toast.makeText(context, msg, Toast.LENGTH_SHORT).show(); } }); builder.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }); AlertDialog dialog = builder.create(); dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); dialog.show(); }
Source:
public void setBiDirectionalPipe(final boolean twoWay) { biDirectionalPipe = twoWay; if (!biDirectionalPipe && (requestPolicy == RequestPolicy.ADVERTISED || requestPolicy == RequestPolicy.TIP)) requestPolicy = RequestPolicy.REACHABLE_COMMIT; }

Target:
public void setBiDirectionalPipe(final boolean twoWay) { biDirectionalPipe = twoWay; if (!biDirectionalPipe) { if (requestPolicy == RequestPolicy.ADVERTISED) requestPolicy = RequestPolicy.REACHABLE_COMMIT; else if (requestPolicy == RequestPolicy.TIP) requestPolicy = RequestPolicy.REACHABLE_COMMIT_TIP; } }
Source:
Boolean canEditColumns() { final String permission = WorkbenchFeatures.GUIDED_DECISION_TABLE_EDIT_COLUMNS; final User user = sessionInfo.getIdentity(); return authorizationManager.authorize(permission, user); }

Target:
boolean canEditColumns() { final String permission = WorkbenchFeatures.GUIDED_DECISION_TABLE_EDIT_COLUMNS; final User user = sessionInfo.getIdentity(); return authorizationManager.authorize(permission, user); }
Source:
private static ExpressionTree instanceofFound(ExpressionTree expressionTree, Tree.Kind kind) { if (Tree.Kind.CONDITIONAL_OR.equals(kind)) { if (expressionTree.is(Tree.Kind.LOGICAL_COMPLEMENT)) { return instanceofLHS(ExpressionUtils.skipParentheses(((UnaryExpressionTree) expressionTree).expression())); } else { return null; } } else { return instanceofLHS(expressionTree); } }

Target:
private static ExpressionTree instanceofFound(ExpressionTree expressionTree, Tree.Kind kind) { if (kind == Tree.Kind.CONDITIONAL_OR) { if (expressionTree.is(Tree.Kind.LOGICAL_COMPLEMENT)) { return instanceofLHS(ExpressionUtils.skipParentheses(((UnaryExpressionTree) expressionTree).expression())); } else { return null; } } else { return instanceofLHS(expressionTree); } }
Source:
public void testItemSequences() throws Exception { List<String> arrayList = new ArrayList<>(); arrayList.add("one"); arrayList.add("two"); arrayList.add("three"); arrayList.add("four"); CoreEvent in = eventBuilder(muleContext).message(of(arrayList)).build(); process(simpleForeach, in); Set<ItemSequenceInfo> sequences = processedEvents.stream() .map(e -> e.getItemSequenceInfo().orElse(null)) .collect(toSet()); assertFalse(ERR_INVALID_ITEM_SEQUENCE, sequences.contains(null)); assertEquals(ERR_NUMBER_ITEM_SEQUENCE, arrayList.size(), sequences.size()); }

Target:
public void testItemSequences() throws Exception { List<String> payload = new ArrayList<>(); payload.add("one"); payload.add("two"); payload.add("three"); payload.add("four"); CoreEvent in = eventBuilder(muleContext).message(of(payload)).build(); process(simpleForeach, in); List<Integer> sequences = processedEvents.stream() .map(e -> e.getItemSequenceInfo().map(i -> i.getPosition()).orElse(-1)) .collect(toList()); assertThat(ERR_INVALID_ITEM_SEQUENCE, sequences, is(asList(0, 1, 2, 3))); }
Source:
public boolean test() throws Exception { ICondition selectionRangeCondition = ConditionHelpers.selectionRange(fSelectionRange); if (!selectionRangeCondition.test()) { fFailureMessage = selectionRangeCondition.getFailureMessage(); return false; } TmfTraceManager instance = TmfTraceManager.getInstance(); ITmfTrace trace = instance.getActiveTrace(); if(trace == null) { fFailureMessage = "No trace opened."; return false; } @NonNull TmfTimeRange curWindowRange = instance.getTraceContext(trace).getWindowRange(); if (!curWindowRange.contains(fVisibleTime)) { fFailureMessage = "Current window range " + curWindowRange + " does not contain " + fVisibleTime; return false; } if (fView.isDirty()) { fFailureMessage = "Time graph is dirty"; return false; } return true; }

Target:
public boolean test() throws Exception { ICondition selectionRangeCondition = ConditionHelpers.selectionRange(fSelectionRange); if (!selectionRangeCondition.test()) { fFailureMessage = selectionRangeCondition.getFailureMessage(); return false; } TmfTraceManager instance = TmfTraceManager.getInstance(); ITmfTrace trace = instance.getActiveTrace(); if (trace == null) { fFailureMessage = "No trace opened."; return false; } TmfTimeRange curWindowRange = instance.getTraceContext(trace).getWindowRange(); if (!curWindowRange.contains(fVisibleTime)) { fFailureMessage = "Current window range " + curWindowRange + " does not contain " + fVisibleTime; return false; } if (fView.isDirty()) { fFailureMessage = "Time graph is dirty"; return false; } return true; }
Source:
protected SSHClient connect(String serverName) { SSHClient client = createSSHClient(); Integer timeout = Config.<Integer> GetValue(ConfigValues.ConnectToServerTimeoutInSeconds) * 1000; client.setHardTimeout(timeout); client.setSoftTimeout(timeout); client.setHost(serverName, PORT); try { client.connect(); return client; } catch (Exception e) { throw new RuntimeException(e); } }

Target:
protected SSHClient connect(String serverName) { SSHClient client = createSSHClient(); Integer timeout = Config.<Integer> GetValue(ConfigValues.ConnectToServerTimeoutInSeconds) * 1000; client.setHardTimeout(timeout); client.setSoftTimeout(timeout); client.setHost(serverName, PORT); try { client.connect(); return client; } catch (Exception e) { log.debug(String.format("Could not connect to server %1$s: %2$s", serverName, e.getMessage())); throw new RuntimeException(e); } }
Source:
public void testAllOutputsReferenced() throws Exception { tester().assertThat(new PruneAggregationColumns()) .on(p -> buildProjectedAggregation(p, Predicates.alwaysTrue())) .doesNotFire(); }

Target:
public void testAllOutputsReferenced() throws Exception { tester().assertThat(new PruneAggregationColumns()) .on(p -> buildProjectedAggregation(p, alwaysTrue())) .doesNotFire(); }
Source:
public void testDropViewIndexColumnForMultiTenantTable() throws Exception { String table = generateUniqueName(); String view = generateUniqueName(); String index = generateUniqueName(); try (Connection conn = DriverManager.getConnection(getUrl())) { conn.setAutoCommit(true); try (Statement stmt = conn.createStatement()) { stmt.execute("CREATE TABLE IF NOT EXISTS " + table + " (ID CHAR(10) NOT NULL,KEY_PREFIX CHAR(3) NOT NULL," + " CONSTRAINT PK PRIMARY KEY (ID,KEY_PREFIX)) MULTI_TENANT=TRUE"); stmt.execute( "CREATE VIEW IF NOT EXISTS " + view + " (PK1 DATE NOT NULL,PK2 CHAR(15) NOT NULL," + "NON_PK1 CHAR(15),NON_PK2 CHAR(15) CONSTRAINT PKVIEW PRIMARY KEY (PK1,PK2)) " + "AS SELECT * FROM " + table + " WHERE KEY_PREFIX = '123'"); stmt.execute("CREATE INDEX " + index + " ON " + view + " (PK2, PK1) INCLUDE (NON_PK1, NON_PK2)"); stmt.execute("ALTER VIEW " + view + " DROP COLUMN NON_PK1"); } } catch (Exception e) { fail(); } }

Target:
public void testDropViewIndexColumnForMultiTenantTable() throws Exception { String table = generateUniqueName(); String view = generateUniqueName(); String index = generateUniqueName(); try (Connection conn = DriverManager.getConnection(getUrl())) { conn.setAutoCommit(true); try (Statement stmt = conn.createStatement()) { stmt.execute("CREATE TABLE IF NOT EXISTS " + table + " (ID CHAR(10) NOT NULL,KEY_PREFIX CHAR(3) NOT NULL," + " CONSTRAINT PK PRIMARY KEY (ID,KEY_PREFIX)) MULTI_TENANT=TRUE"); stmt.execute( "CREATE VIEW IF NOT EXISTS " + view + " (PK1 DATE NOT NULL,PK2 CHAR(15) NOT NULL," + "NON_PK1 CHAR(15),NON_PK2 CHAR(15) CONSTRAINT " + "PKVIEW PRIMARY KEY (PK1,PK2)) " + "AS SELECT * FROM " + table + " WHERE KEY_PREFIX = '123'"); stmt.execute("CREATE INDEX " + index + " ON " + view + " (PK2, PK1) INCLUDE (NON_PK1, NON_PK2)"); stmt.execute("ALTER VIEW " + view + " DROP COLUMN NON_PK1"); } } }
Source:
JwtClaimIssuerConverter() { this.resolver = new DefaultBearerTokenResolver(); }

Target:
JwtClaimIssuerConverter() { this(new DefaultBearerTokenResolver()); }
Source:
public void testImagePropertiesTab() { DockerImagesTab imageTab = new DockerImagesTab(); imageTab.activate(); imageTab.refresh(); for (TableItem item : imageTab.getTableItems()) { if (item.getText(1).contains(imageName)) { item.click(); } } PropertiesView propertiesView = new PropertiesView(); propertiesView.open(); try { propertiesView.selectTab("Info"); } catch (SWTLayerException ex) { fail("Properties tab Info is not opened, is image selected in Images Tab?"); } }

Target:
public void testImagePropertiesTab() { DockerImagesTab imageTab = new DockerImagesTab(); imageTab.activate(); imageTab.refresh(); imageTab.selectImage(imageName); PropertiesView propertiesView = new PropertiesView(); propertiesView.open(); try { propertiesView.selectTab("Info"); } catch (SWTLayerException ex) { fail("Properties tab Info is not opened, is image selected in Images Tab?"); } }
Source:
public boolean isValidForAddOperation() { if (!this.isSignatureValid()) return false; MailboxStoragePayload mailboxStoragePayload = this.getMailboxStoragePayload(); if (!mailboxStoragePayload.getOwnerPubKey().equals(this.receiversPubKey)) { log.debug("Entry receiversPubKey does not match payload owner which is a requirement for adding MailboxStoragePayloads"); return false; } boolean result = mailboxStoragePayload.getSenderPubKeyForAddOperation() != null && mailboxStoragePayload.getSenderPubKeyForAddOperation().equals(this.getOwnerPubKey()); if (!result) { String res1 = this.toString(); String res2 = "null"; if (mailboxStoragePayload.getOwnerPubKey() != null) res2 = Utilities.encodeToHex(mailboxStoragePayload.getSenderPubKeyForAddOperation().getEncoded(),true); log.warn("ProtectedMailboxStorageEntry::isValidForAddOperation() failed. " + "Entry owner does not match sender key in payload:\nProtectedStorageEntry=%{}\n" + "SenderPubKeyForAddOperation=%{}", res1, res2); } return result; }

Target:
public boolean isValidForAddOperation() { if (!this.isSignatureValid()) return false; MailboxStoragePayload mailboxStoragePayload = this.getMailboxStoragePayload(); if (!mailboxStoragePayload.getOwnerPubKey().equals(this.receiversPubKey)) { log.debug("Entry receiversPubKey does not match payload owner which is a requirement for adding MailboxStoragePayloads"); return false; } boolean result = mailboxStoragePayload.getSenderPubKeyForAddOperation().equals(this.getOwnerPubKey()); if (!result) { String res1 = this.toString(); String res2 = "null"; if (mailboxStoragePayload.getOwnerPubKey() != null) res2 = Utilities.encodeToHex(mailboxStoragePayload.getSenderPubKeyForAddOperation().getEncoded(),true); log.warn("ProtectedMailboxStorageEntry::isValidForAddOperation() failed. " + "Entry owner does not match sender key in payload:\nProtectedStorageEntry=%{}\n" + "SenderPubKeyForAddOperation=%{}", res1, res2); } return result; }
Source:
public void releaseTask(final TaskSummary task) { taskService.call((Void nothing) -> { view.displayNotification(constants.TaskReleased(String.valueOf(task.getId()))); refreshGrid(); }, (Message message, Throwable throwable) -> { view.displayNotification(constants.UnableToReleaseTask(String.valueOf(task.getId()), task.getName(), throwable.getMessage())); return true; }).releaseTask(getSelectedServerTemplate(), task.getDeploymentId(), task.getId()); }

Target:
public void releaseTask(final TaskSummary task) { taskService.call((Void nothing) -> { view.displayNotification(constants.TaskReleased((String.valueOf(task.getId())))); refreshGrid(); }, (Message message, Throwable throwable) -> { view.displayNotification(constants.UnableToReleaseTask(String.valueOf(task.getId()), task.getName(), throwable.getMessage())); return true; } ).releaseTask(getSelectedServerTemplate(), task.getDeploymentId(), task.getId()); }
Source:
public int getType() { if (code.startsWith("abusefilter-warning")) { return TYPE_WARNING; } else if (code.startsWith("abusefilter-disallowed")) { return TYPE_ERROR; } else if (info.startsWith("Hit AbuseFilter")) { return TYPE_ERROR; } else { throw new RuntimeException("Unknown abusefilter response!"); } }

Target:
public int getType() { if (code.startsWith("abusefilter-warning")) { return TYPE_WARNING; } else if (code.startsWith("abusefilter-disallowed")) { return TYPE_ERROR; } else if (info.startsWith("Hit AbuseFilter")) { return TYPE_ERROR; } else { return TYPE_ERROR; } }
Source:
TestShardConsumerSubscriber(RecordsPublisher recordsPublisher, ExecutorService executorService, int bufferSize, ShardConsumer shardConsumer, int readTimeoutsToIgnoreBeforeWarning) { super(recordsPublisher, executorService, bufferSize, shardConsumer, readTimeoutsToIgnoreBeforeWarning); this.recordsPublisher = recordsPublisher; this.executorService = executorService; this.bufferSize = bufferSize; this.shardConsumer = shardConsumer; }

Target:
TestShardConsumerSubscriber(RecordsPublisher recordsPublisher, ExecutorService executorService, int bufferSize, ShardConsumer shardConsumer, int readTimeoutsToIgnoreBeforeWarning) { super(recordsPublisher, executorService, bufferSize, shardConsumer, readTimeoutsToIgnoreBeforeWarning); }
Source:
public void tailBeforeHeadCorrectIteration() { PrimitiveLongArrayQueue queue = createQueue(); for ( int i = 0; i < 14; i++ ) { queue.enqueue( i ); } for ( int i = 0; i < 10; i++ ) { assertEquals( i, queue.dequeue() ); } for ( int i = 14; i < 24 ; i++ ) { queue.enqueue( i ); } assertEquals( 14, queue.size() ); LongIterator iterator = queue.longIterator(); for ( int j = 10; j < 24; j++ ) { assertTrue( iterator.hasNext() ); Assert.assertEquals( j, iterator.next() ); } assertFalse( iterator.hasNext() ); }

Target:
public void tailBeforeHeadCorrectIteration() { PrimitiveLongArrayQueue queue = createQueue(); for ( int i = 0; i < 14; i++ ) { queue.enqueue( i ); } for ( int i = 0; i < 10; i++ ) { assertEquals( i, queue.dequeue() ); } for ( int i = 14; i < 24 ; i++ ) { queue.enqueue( i ); } assertEquals( 14, queue.size() ); LongIterator iterator = queue.longIterator(); for ( int j = 10; j < 24; j++ ) { assertTrue( iterator.hasNext() ); assertEquals( j, iterator.next() ); } assertFalse( iterator.hasNext() ); }
Source:
public static <T> Iterable<T[]> cartesian(final Class<T> clazz, final Iterable<T>... iterables) { return new Iterable<T[]>() { @Override public Iterator<T[]> iterator() { return new Iterator<T[]>() { private final Iterator<T>[] iterators = new Iterator[iterables.length]; private final T[] cached = (T[]) Array.newInstance(clazz, iterables.length); @Override public boolean hasNext() { return hasNext(0); } private boolean hasNext(int index) { if (iterators[index] == null) { iterators[index] = iterables[index].iterator(); } for (; hasMore(index); cached[index] = null) { if (index == iterables.length - 1 || hasNext(index + 1)) { return true; } } iterators[index] = null; return false; } private boolean hasMore(int index) { if (cached[index] == null && iterators[index].hasNext()) { cached[index] = iterators[index].next(); } return cached[index] != null; } @Override public T[] next() { T[] result = Arrays.copyOf(cached, cached.length); cached[cached.length - 1] = null; return result; } @Override public void remove() { throw new UnsupportedOperationException("remove"); } }; } }; }

Target:
public static <T> Iterable<T[]> cartesian(final Class<T> clazz, final Iterable<T>... iterables) { return new Iterable<T[]>() { @Override public Iterator<T[]> iterator() { return new Iterator<T[]>() { private final Iterator<T>[] iterators = new Iterator[iterables.length]; private final T[] cached = (T[]) Array.newInstance(clazz, iterables.length); private final BitSet valid = new BitSet(iterables.length); @Override public boolean hasNext() { return hasNext(0); } private boolean hasNext(int index) { if (iterators[index] == null) { iterators[index] = iterables[index].iterator(); } for (; hasMore(index); valid.clear(index)) { if (index == iterables.length - 1 || hasNext(index + 1)) { return true; } } iterators[index] = null; return false; } private boolean hasMore(int index) { return valid.get(index) || iterators[index].hasNext(); } @Override public T[] next() { for (int index = 0; index < iterables.length; index++) { if (!valid.get(index)) { cached[index] = iterators[index].next(); valid.set(index); } } T[] result = Arrays.copyOf(cached, cached.length); valid.clear(cached.length - 1); return result; } @Override public void remove() { throw new UnsupportedOperationException("remove"); } }; } }; }
Source:
private void handleCommitRetry(RetryEvent event) throws InterruptedException, ExecutionException { long startTimestamp = event.getStartTimestamp(); try { Optional<CommitTimestamp> commitTimestamp = commitTableClient.getCommitTimestamp(startTimestamp).get(); Batch batch = new Batch(1, -1); if(commitTimestamp.isPresent()) { if (commitTimestamp.get().isValid()) { LOG.trace("Valid commit TS found in Commit Table"); replyProc.addCommit(batch, startTimestamp, commitTimestamp.get().getValue(), event.getChannel(), event.getMonCtx()); } else { LOG.trace("Invalid commit TS found in Commit Table"); replyProc.addAbort(batch, startTimestamp, event.getChannel(), event.getMonCtx()); } } else { LOG.trace("No commit TS found in Commit Table"); replyProc.addAbort(batch, startTimestamp, event.getChannel(), event.getMonCtx()); } } catch (InterruptedException e) { LOG.error("Interrupted reading from commit table"); Thread.currentThread().interrupt(); } catch (ExecutionException e) { LOG.error("Error reading from commit table", e); } retriesMeter.mark(); }

Target:
private void handleCommitRetry(RetryEvent event) throws InterruptedException, ExecutionException { long startTimestamp = event.getStartTimestamp(); try { Optional<CommitTimestamp> commitTimestamp = commitTableClient.getCommitTimestamp(startTimestamp).get(); Batch batch = batchPool.getNextEmptyBatch(); if(commitTimestamp.isPresent()) { if (commitTimestamp.get().isValid()) { LOG.trace("Valid commit TS found in Commit Table"); replyProc.addCommit(batch, startTimestamp, commitTimestamp.get().getValue(), event.getChannel(), event.getMonCtx()); } else { LOG.trace("Invalid commit TS found in Commit Table"); replyProc.addAbort(batch, startTimestamp, event.getChannel(), event.getMonCtx()); } } else { LOG.trace("No commit TS found in Commit Table"); replyProc.addAbort(batch, startTimestamp, event.getChannel(), event.getMonCtx()); } } catch (InterruptedException e) { LOG.error("Interrupted reading from commit table"); Thread.currentThread().interrupt(); } catch (ExecutionException e) { LOG.error("Error reading from commit table", e); } retriesMeter.mark(); }
Source:
public void test_starting_states() throws Exception { BytecodeEGWalker walker = new BytecodeEGWalker(new BehaviorCache(null)); Symbol.MethodSymbol methodSymbol = mock(JavaSymbol.MethodJavaSymbol.class); when(methodSymbol.parameterTypes()).thenReturn(ImmutableList.of()); when(methodSymbol.isStatic()).thenReturn(false); walker.methodBehavior = new MethodBehavior(methodSymbol); ProgramState startingState = Iterables.getOnlyElement(walker.startingStates(methodSymbol, ProgramState.EMPTY_STATE)); SymbolicValue thisSv = startingState.getValue(0); assertThat(thisSv).isNotNull(); assertThat(startingState.getConstraints(thisSv).get(ObjectConstraint.class)).isEqualTo(ObjectConstraint.NOT_NULL); when(methodSymbol.isStatic()).thenReturn(true); startingState = Iterables.getOnlyElement(walker.startingStates(methodSymbol, ProgramState.EMPTY_STATE)); assertThat(startingState).isEqualTo(ProgramState.EMPTY_STATE); Symbols symbols = new Symbols(new BytecodeCompleter(new SquidClassLoader(Collections.emptyList()), new ParametrizedTypeCache())); JavaType doubleType = symbols.getPrimitiveFromDescriptor('D'); JavaType intType = symbols.getPrimitiveFromDescriptor('I'); when(methodSymbol.parameterTypes()).thenReturn(ImmutableList.of(doubleType, intType)); startingState = Iterables.getOnlyElement(walker.startingStates(methodSymbol, ProgramState.EMPTY_STATE)); assertThat(startingState.getValue(0)).isNotNull(); assertThat(startingState.getValue(1)).isNull(); assertThat(startingState.getValue(2)).isNotNull(); getMethodBehavior(5); }

Target:
public void test_starting_states() throws Exception { BytecodeEGWalker walker = new BytecodeEGWalker(new BehaviorCache(null, null)); String signature = "()V"; walker.methodBehavior = new MethodBehavior(signature); walker.methodBehavior.setStaticMethod(false); ProgramState startingState = Iterables.getOnlyElement(walker.startingStates(signature, ProgramState.EMPTY_STATE)); SymbolicValue thisSv = startingState.getValue(0); assertThat(thisSv).isNotNull(); assertThat(startingState.getConstraints(thisSv).get(ObjectConstraint.class)).isEqualTo(ObjectConstraint.NOT_NULL); walker.methodBehavior.setStaticMethod(true); startingState = Iterables.getOnlyElement(walker.startingStates(signature, ProgramState.EMPTY_STATE)); assertThat(startingState).isEqualTo(ProgramState.EMPTY_STATE); signature = "(DI)V"; walker.methodBehavior = new MethodBehavior(signature); walker.methodBehavior.setStaticMethod(true); startingState = Iterables.getOnlyElement(walker.startingStates(signature, ProgramState.EMPTY_STATE)); assertThat(startingState.getValue(0)).isNotNull(); assertThat(startingState.getValue(1)).isNull(); assertThat(startingState.getValue(2)).isNotNull(); }
Source:
DnsHeader(int id, int flags, int rcode, @NonNull int[] recordCount) { this.id = id; this.flags = flags; this.rcode = rcode; mRecordCount = recordCount; }

Target:
private DnsHeader(int id, int flags, int rcode, @NonNull int[] recordCount) { this.id = id; this.flags = flags; this.rcode = rcode; mRecordCount = recordCount; }
Source:
public void setUp() throws Exception { cluster = new LocalCluster( null, null, siteCount, hostCount, kfactor, clusterID, BackendTarget.NATIVE_EE_JNI, FailureState.ALL_RUNNING, false, false, null); cluster.setHasLocalServer(false); cluster.overrideAnyRequestForValgrind(); VoltProjectBuilder builder = new VoltProjectBuilder(); builder.setUseDDLSchema(true); cluster.compileDeploymentOnly(builder); new File(builder.getPathToDeployment()).deleteOnExit(); cluster.setExpectedToCrash(false); }

Target:
public void setUp() throws Exception { InMemoryJarfile classesFile = new InMemoryJarfile(); String cpath = File.createTempFile("preloaded-classes", ".jar").getCanonicalPath(); classesFile.writeToFile(new File(cpath)); cluster = new LocalCluster( null, cpath, true, siteCount, hostCount, kfactor, clusterID, BackendTarget.NATIVE_EE_JNI, FailureState.ALL_RUNNING, false, false, null); cluster.setHasLocalServer(true); cluster.overrideAnyRequestForValgrind(); VoltProjectBuilder builder = new VoltProjectBuilder(); builder.setUseDDLSchema(true); cluster.compileDeploymentOnly(builder); new File(builder.getPathToDeployment()).deleteOnExit(); cluster.setExpectedToCrash(false); }
Source:
public Response deleteCloudConfig(@PathParam("clusterId") String clusterId) { HelixZkClient zkClient = getHelixZkClient(); if (!ZKUtil.isClusterSetup(clusterId, zkClient)) { return notFound(); } HelixAdmin admin = getHelixAdmin(); admin.removeCloudConfig(clusterId); return OK(); }

Target:
public Response deleteCloudConfig(@PathParam("clusterId") String clusterId) { HelixAdmin admin = getHelixAdmin(); admin.removeCloudConfig(clusterId); return OK(); }
Source:
public void logSlowQuery(String sql, long startTime) { if ( logSlowQuery < 1 ) { return; } assert startTime > 0 : "startTime is invalid!"; long spent = System.currentTimeMillis() - startTime; assert spent >= 0 : "startTime is invalid!"; if ( spent > logSlowQuery ) { String logData = "SlowQuery: " + spent + " milliseconds. " + sql; LOG_SLOW.info( logData ); if ( logToStdout ) { System.out.println( logData ); } } }

Target:
public void logSlowQuery(String sql, long startTime) { if ( logSlowQuery < 1 ) { return; } assert startTime > 0 : "startTime is invalid!"; long spent = System.currentTimeMillis() - startTime; assert spent >= 0 : "startTime is invalid!"; if ( spent > logSlowQuery ) { String logData = "SlowQuery: " + spent + " milliseconds. SQL: '" + sql + "'"; LOG_SLOW.info( logData ); if ( logToStdout ) { System.out.println( logData ); } } }
Source:
public String toString() { return "DigestThread{" + "ThreadName=" + getName() + ", digest=" + digest + ", file=" + file + '}'; }

Target:
public String toString() { return "DigestThread{ ThreadName=" + getName() + ", digest=" + digest + ", file=" + file + '}'; }
Source:
private Point getPointForTime(long time) { return UIThreadRunnable.syncExec((Result<Point>) () -> { int x = widget.getXForTime(time); Rectangle bounds = widget.getItemBounds(fEntry); int y = bounds.y + bounds.height / 2; if (x >= bounds.x && x < bounds.width) { return new Point(x, y); } return null; }); }

Target:
private Point getPointForTime(long time) { return UIThreadRunnable.syncExec((Result<Point>) () -> { ITimeDataProvider timeDataProvider = widget.getTimeDataProvider(); if (timeDataProvider.getTime0() >= time || timeDataProvider.getTime1() <= time) { return null; } int x = widget.getXForTime(time); Rectangle bounds = widget.getItemBounds(fEntry); int y = bounds.y + bounds.height / 2; return new Point(x, y); }); }