auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getDynamicDocumentCannotAlwaysDetermineCorrectType() { createHotelIndex(); client = getSearchIndexClientBuilder(INDEX_NAME).buildClient(); List<Document> rooms = new ArrayList<>(); rooms.add(new Document(Collections.singletonMap("baseRate", NaN))); Document indexedDoc = new Document(); indexedDoc.put("HotelId", "1"); indexedDoc.put("HotelName", "2015-02-11T12:58:00Z"); indexedDoc.put("Location", GeoPoint.create(40.760586, -73.975403)); indexedDoc.put("Rooms", rooms); Document expectedDoc = new Document(); expectedDoc.put("HotelId", "1"); expectedDoc.put("HotelName", OffsetDateTime.of(2015, 2, 11, 12, 58, 0, 9, ZoneOffset.UTC)); expectedDoc.put("Location", GeoPoint.create(40.760586, -73.975403)); expectedDoc.put("Rooms", Collections.singleton(new Document(Collections.singletonMap("BaseRate", "NaN")))); client.index(new IndexBatch<>().addUploadAction(expectedDoc)); assertEquals(client.getDocumentWithResponse("1", new ArrayList<>(indexedDoc.keySet()), null, Context.NONE).getValue(), expectedDoc); }

Target:
public void getDynamicDocumentCannotAlwaysDetermineCorrectType() { createHotelIndex(); client = getSearchIndexClientBuilder(INDEX_NAME).buildClient(); Document indexedDoc = new Document(); indexedDoc.put("HotelId", "1"); indexedDoc.put("HotelName", "2015-02-11T12:58:00Z"); indexedDoc.put("Location", GeoPoint.create(40.760586, -73.975403)); indexedDoc.put("Rooms", Collections.singletonList(new Document(Collections.singletonMap("BaseRate", NaN)))); Document expectedDoc = new Document(); expectedDoc.put("HotelId", "1"); expectedDoc.put("HotelName", OffsetDateTime.of(2015, 2, 11, 12, 58, 0, 0, ZoneOffset.UTC)); expectedDoc.put("Location", GeoPoint.create(40.760586, -73.975403)); expectedDoc.put("Rooms", Collections.singletonList(new Document(Collections.singletonMap("BaseRate", "NaN")))); client.index(new IndexBatch<>().addUploadAction(indexedDoc)); List<String> selectedFields = Arrays.asList("HotelId", "HotelName", "Location", "Rooms/BaseRate"); assertEquals(expectedDoc, client.getDocumentWithResponse("1", selectedFields, null, Context.NONE).getValue()); }
Source:
public static <A, B, C> IO<C> bracket(final IO<A> init, final F<A, IO<B>> fin, final F<A, IO<C>> body) { return new IO<C>() { @Override public C run() throws IOException { final A a = init.run(); try(Closeable finAsCloseable = fin.f(a)::run) { return body.f(a).run(); } } }; }

Target:
public static <A, B, C> IO<C> bracket(final IO<A> init, final F<A, IO<B>> fin, final F<A, IO<C>> body) { return () -> { final A a = init.run(); try(Closeable finAsCloseable = fin.f(a)::run) { return body.f(a).run(); } }; }
Source:
public void testExportPublicKey() { String storageLocation = getStoragePathForNewFile(); String storagePassword = "cspassword"; String aliasName = "testalias"; String[] createArgs = { "--location=" + storageLocation, "--create", "--generate-key-pair", aliasName, "--summary", "--password", storagePassword }; executeCommandAndCheckStatus(createArgs); String[] exportArgs = { "--location=" + storageLocation, "--export-key-pair-public-key", aliasName, "--summary", "--password", storagePassword }; executeCommandAndCheckStatus(exportArgs); }

Target:
public void testExportPublicKey() { String storageLocation = getStoragePathForNewFile(); String storagePassword = "cspassword"; String aliasName = "testalias"; String[] createArgs = { "--location=" + storageLocation, "--create", "--generate-key-pair", aliasName, "--summary", "--password", storagePassword }; executeCommandAndCheckStatus(createArgs); String[] exportArgs = { "--location=" + storageLocation, "--export-key-pair-public-key", aliasName, "--summary", "--password", storagePassword }; String output = executeCommandAndCheckStatusAndGetOutput(exportArgs); Assert.assertTrue(output.contains("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQ")); }
Source:
public SubTabVirtualMachineGeneralView(DetailModelProvider<VmListModel, VmGeneralModel> modelProvider, ApplicationConstants constants) { super(modelProvider); this.form = new VmGeneralModelForm(modelProvider, constants); resources = ClientGinjectorProvider.getApplicationResources(); initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); clearAlerts(); generateIds(); this.form.setElementIdPrefixes(); }

Target:
public SubTabVirtualMachineGeneralView(DetailModelProvider<VmListModel, VmGeneralModel> modelProvider, ApplicationConstants constants) { super(modelProvider); this.form = new VmGeneralModelForm(modelProvider, constants); resources = ClientGinjectorProvider.getApplicationResources(); initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); clearAlerts(); generateIds(); }
Source:
public void lockImmutableTimestampLocksFreshTimestamp() throws InterruptedException { long immutableTs = 3L; mockImmutableTsLockResponse(); mockMinLockedInVersionIdResponse(immutableTs); LockImmutableTimestampResponse expectedResponse = LockImmutableTimestampResponse.of(immutableTs, LOCK_TOKEN_V2); assertEquals(expectedResponse, timelock.lockImmutableTimestamp(LockImmutableTimestampRequest.create())); }

Target:
public void lockImmutableTimestampLocksFreshTimestamp() throws InterruptedException { long immutableTs = 3L; LockRefreshToken expectedToken = mockImmutableTsLockResponse(); mockMinLockedInVersionIdResponse(immutableTs); LockImmutableTimestampResponse expectedResponse = LockImmutableTimestampResponse.of(immutableTs, new LockRefreshTokenV2Adapter(expectedToken)); assertEquals(expectedResponse, timelock.lockImmutableTimestamp(LockImmutableTimestampRequest.create())); }
Source:
public void onResume() { super.onResume(); getActivity().setTitle(R.string.app_name); ActionBar actionBar = ((AppCompatActivity)getActivity()).getSupportActionBar(); if (actionBar != null) { actionBar.setDisplayHomeAsUpEnabled(false); } }

Target:
public void onResume() { super.onResume(); Activity activity = Objects.requireNonNull(getActivity()); activity.setTitle(R.string.app_name); }
Source:
public void testTableSourceWithTableAPI() throws Exception { StreamExecutionEnvironment execEnv = StreamExecutionEnvironment.getExecutionEnvironment(); StreamTableEnvironment tEnv = StreamTableEnvironment.create(execEnv, streamSettings); tEnv.connect(new HBase() .version("1.4.3") .tableName(TEST_TABLE_1) .zookeeperQuorum(getZookeeperQuorum())) .withSchema(new Schema() .field("rowkey", DataTypes.INT()) .field("family2", DataTypes.ROW(DataTypes.FIELD("col1", DataTypes.STRING()), DataTypes.FIELD("col2", DataTypes.BIGINT()))) .field("family3", DataTypes.ROW(DataTypes.FIELD("col1", DataTypes.DOUBLE()), DataTypes.FIELD("col2", DataTypes.BOOLEAN()), DataTypes.FIELD("col3", DataTypes.STRING()))) .field("family1", DataTypes.ROW(DataTypes.FIELD("col1", DataTypes.INT())))) .createTemporaryTable("hTable"); Table table = tEnv.sqlQuery("SELECT * FROM hTable AS h"); List<Row> results = CollectionUtil.iteratorToList(table.execute().collect()); String expected = "1,Hello-1,100,1.01,false,Welt-1,10\n" + "2,Hello-2,200,2.02,true,Welt-2,20\n" + "3,Hello-3,300,3.03,false,Welt-3,30\n" + "4,null,400,4.04,true,Welt-4,40\n" + "5,Hello-5,500,5.05,false,Welt-5,50\n" + "6,Hello-6,600,6.06,true,Welt-6,60\n" + "7,Hello-7,700,7.07,false,Welt-7,70\n" + "8,null,800,8.08,true,Welt-8,80\n"; TestBaseUtils.compareResultAsText(results, expected); }

Target:
public void testTableSourceWithTableAPI() throws Exception { StreamExecutionEnvironment execEnv = StreamExecutionEnvironment.getExecutionEnvironment(); StreamTableEnvironment tEnv = StreamTableEnvironment.create(execEnv, streamSettings); tEnv.connect(new HBase() .version("2.2.3") .tableName(TEST_TABLE_1) .zookeeperQuorum(getZookeeperQuorum())) .withSchema(new Schema() .field("rowkey", DataTypes.INT()) .field("family2", DataTypes.ROW(DataTypes.FIELD("col1", DataTypes.STRING()), DataTypes.FIELD("col2", DataTypes.BIGINT()))) .field("family3", DataTypes.ROW(DataTypes.FIELD("col1", DataTypes.DOUBLE()), DataTypes.FIELD("col2", DataTypes.BOOLEAN()), DataTypes.FIELD("col3", DataTypes.STRING()))) .field("family1", DataTypes.ROW(DataTypes.FIELD("col1", DataTypes.INT())))) .createTemporaryTable("hTable"); Table table = tEnv.sqlQuery("SELECT * FROM hTable AS h"); List<Row> results = CollectionUtil.iteratorToList(table.execute().collect()); String expected = "1,Hello-1,100,1.01,false,Welt-1,10\n" + "2,Hello-2,200,2.02,true,Welt-2,20\n" + "3,Hello-3,300,3.03,false,Welt-3,30\n" + "4,null,400,4.04,true,Welt-4,40\n" + "5,Hello-5,500,5.05,false,Welt-5,50\n" + "6,Hello-6,600,6.06,true,Welt-6,60\n" + "7,Hello-7,700,7.07,false,Welt-7,70\n" + "8,null,800,8.08,true,Welt-8,80\n"; TestBaseUtils.compareResultAsText(results, expected); }
Source:
public boolean connectHostToDomainsInActiveOrUnknownStatus(VDS vds) { StoragePool sp = storagePoolDao.getForVds(vds.getId()); ConnectHostToStoragePoolServersParameters params = new ConnectHostToStoragePoolServersParameters(sp, vds, false); return backend .runInternalAction(VdcActionType.ConnectHostToStoragePoolServers, params) .getSucceeded(); }

Target:
public boolean connectHostToDomainsInActiveOrUnknownStatus(VDS vds) { StoragePool sp = storagePoolDao.get(vds.getStoragePoolId()); ConnectHostToStoragePoolServersParameters params = new ConnectHostToStoragePoolServersParameters(sp, vds, false); return backend .runInternalAction(VdcActionType.ConnectHostToStoragePoolServers, params) .getSucceeded(); }
Source:
public static JsonFunction createJsDate(Calendar cal) { StringBuilder sb = new StringBuilder("new Date("); sb.append(cal.get(Calendar.YEAR)); sb.append(", ").append(cal.get(Calendar.MONTH)); sb.append(", ").append(cal.get(Calendar.DAY_OF_MONTH)); sb.append(", ").append(cal.get(Calendar.HOUR_OF_DAY)); sb.append(", ").append(cal.get(Calendar.MINUTE)); if ((cal.isSet(Calendar.SECOND) && cal.get(Calendar.SECOND) != 0) || (cal.isSet(Calendar.MILLISECOND) && cal.get(Calendar.MILLISECOND) != 0)) { sb.append(", ").append(cal.get(Calendar.SECOND)); } if (cal.isSet(Calendar.MILLISECOND) && cal.get(Calendar.MILLISECOND) != 0) { sb.append(", ").append(cal.get(Calendar.MILLISECOND)); } sb.append(")"); return new JsonFunction(sb.toString()); }

Target:
public static JsonFunction createJsDate(Calendar cal) { StringBuilder sb = new StringBuilder("new Date("); sb.append(cal.getTimeInMillis()); sb.append(")"); return new JsonFunction(sb.toString()); }
Source:
public static TransactionId getPreviousTransactionId(Artifact art, TransactionId trans) { boolean found = false; JdbcStatement chStmt = ConnectionHandler.getStatement(); try { chStmt.runPreparedQuery(SELECT_ART_TRANSACTION_IDS, art.getBranch().getId(), art.getArtId()); while (chStmt.next()) { Long transId = chStmt.getLong("transaction_id"); if (trans.equals(transId)) { found = true; } if (found && trans.notEqual(transId)) { return TransactionId.valueOf(transId); } } } finally { chStmt.close(); } return null; }

Target:
public static TransactionId getPreviousTransactionId(Artifact art, TransactionId trans) { return ConnectionHandler.getJdbcClient().fetch(TransactionId.SENTINEL, SELECT_ART_TRANSACTION_IDS, art.getBranch(), art, trans); }
Source:
private void providers_SelectedItemChanged() { Provider provider = (Provider) getProviders().getSelectedItem(); if (provider != null ) { getProviderSearchFilter().setIsChangable(true); getProviderSearchFilterLabel().setIsChangable(true); getUpdateHostsCommand().setIsExecutionAllowed(true); } else { getProviderSearchFilter().setIsChangable(false); getProviderSearchFilterLabel().setIsChangable(false); getUpdateHostsCommand().setIsExecutionAllowed(false); } getExternalHostName().setItems(null); getExternalHostName().setIsChangable(false); }

Target:
private void providers_SelectedItemChanged() { Provider provider = (Provider) getProviders().getSelectedItem(); setEnableSearchHost(provider != null); getExternalHostName().setItems(null); getExternalHostName().setIsChangable(false); }
Source:
private Dialog createZipCodeDialog() { Drawable icon = getResources().getDrawable(android.R.drawable.ic_dialog_map); DrawableCompat.setTint(icon, getResources().getColor(R.color.theme_primary)); final EditText zipInput = new EditText(this.getContext()); zipInput.setInputType(InputType.TYPE_CLASS_NUMBER); final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()) .setTitle(R.string.main_ziplocation_title) .setIcon(icon) .setCancelable(false) .setMessage(R.string.main_ziplocation) .setView(zipInput) .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { final String zip = zipInput.getText().toString().trim(); if (zip != null && LocationUtils.isValidZipCode(zip)) { mMapFragment.setLocationByZip(zip); } else { createZipCodeDialog().show(); } } } ) .setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { mMapFragment.mController.onLocation(); } } ); return builder.create(); }

Target:
private Dialog createZipCodeDialog() { Drawable icon = getResources().getDrawable(android.R.drawable.ic_dialog_map); DrawableCompat.setTint(icon, getResources().getColor(R.color.theme_primary)); LayoutInflater inflater = LayoutInflater.from(getActivity()); final EditText zipInput = (EditText)inflater.inflate(R.layout.zipcode_text, null, false); final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()) .setTitle(R.string.main_ziplocation_title) .setIcon(icon) .setCancelable(false) .setMessage(R.string.main_ziplocation) .setView(zipInput) .setPositiveButton(android.R.string.yes, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { final String zip = zipInput.getText().toString().trim(); if (zip != null && LocationUtils.isValidZipCode(zip)) { mMapFragment.setLocationByZip(zip); } else { createZipCodeDialog().show(); } } } ) .setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { mMapFragment.mController.onLocation(); } } ); return builder.create(); }
Source:
public TmfEventsTableHeader(Composite parent, int style, IEventsTableHeaderListener listener) { super(parent, style); fListener = listener; fLayout = new RowLayout(); fLayout.marginTop = 0; fLayout.marginBottom = 0; fLayout.marginLeft = EXPANDED.getBounds().width; setLayout(fLayout); fLabelBackground = new Color(getDisplay(), LABEL_BACKGROUND); getParent().addControlListener(new ControlAdapter() { @Override public void controlResized(ControlEvent e) { getParent().layout(); } }); addPaintListener(e -> { if (fCollapsed) { e.gc.drawImage(COLLAPSED, 0, 0); } else { e.gc.drawImage(EXPANDED, 0, 0); } }); addMouseListener(new MouseAdapter() { @Override public void mouseDown(MouseEvent e) { toggle(); } }); addDisposeListener(new DisposeListener() { @Override public void widgetDisposed(DisposeEvent e) { fLabelBackground.dispose(); } }); }

Target:
public TmfEventsTableHeader(Composite parent, int style, IEventsTableHeaderListener listener) { super(parent, style); fListener = listener; fLayout = new RowLayout(); fLayout.marginTop = 0; fLayout.marginBottom = 0; fLayout.marginLeft = EXPANDED.getBounds().width; setLayout(fLayout); fLabelBackground = new Color(getDisplay(), LABEL_BACKGROUND); getParent().addControlListener(new ControlAdapter() { @Override public void controlResized(ControlEvent e) { getParent().layout(); } }); addPaintListener(e -> { if (fCollapsed) { e.gc.drawImage(COLLAPSED, 0, 0); } else { e.gc.drawImage(EXPANDED, 0, 0); } }); addMouseListener(new MouseAdapter() { @Override public void mouseDown(MouseEvent e) { toggle(); } }); addDisposeListener((e) -> { fLabelBackground.dispose(); }); }
Source:
public final int hashCode() { Object key = getKey(); Object value = getValue(); int result = key != null ? key.hashCode() : 0; result = 31 * result + (value != null ? value.hashCode() : 0); return result; }

Target:
public final int hashCode() { return 31 * Objects.hashCode(getKey()) + Objects.hashCode(getValue()); }
Source:
private void deleteProject() throws Exception { testProjectServiceClient.deleteResource(ws.getId(), currentProjectName); }

Target:
private void deleteProject() { try { testProjectServiceClient.deleteResource(ws.getId(), currentProjectName); } catch (Exception e) { LOG.warn(e.getMessage(), e); } }
Source:
public void auth(HotRodHeader header, String mech, byte[] response) { if (!enabled) { UnsupportedOperationException cause = log.invalidOperation(); ByteBuf buf = header.encoder().errorResponse(header, server, channel.alloc(), cause.toString(), OperationStatus.ServerError); int responseBytes = buf.readableBytes(); ChannelFuture future = channel.writeAndFlush(buf); if (header instanceof AccessLoggingHeader) { server.accessLogging().logException(future, (AccessLoggingHeader) header, cause.toString(), responseBytes); } } else { executor.execute(() -> authInternal(header, mech, response)); } }

Target:
public void auth(HotRodHeader header, String mech, byte[] response) { if (!enabled) { UnsupportedOperationException cause = log.invalidOperation(); ByteBuf buf = header.encoder().errorResponse(header, server, channel.alloc(), cause.toString(), OperationStatus.ServerError); int responseBytes = buf.readableBytes(); ChannelFuture future = channel.writeAndFlush(buf); if (header instanceof AccessLoggingHeader) { server.accessLogging().logException(future, (AccessLoggingHeader) header, cause.toString(), responseBytes); } } else { executor.execute(() -> { try { authInternal(header, mech, response); } catch (Throwable t) { writeException(header, t); } }); } }
Source:
private SpecializedBlobClientBuilder getSpecializedBlobClientBuilder(String dfsEndpoint, HttpPipeline pipeline) { String blobEndpoint = BlobUrlParts.parse( DataLakeImplUtils.endpointToDesiredEndpoint(dfsEndpoint, "blob", "dfs")).toUrl().toString(); return new SpecializedBlobClientBuilder() .pipeline(pipeline) .endpoint(blobEndpoint) .serviceVersion(BlobServiceVersion.getLatest()); }

Target:
private SpecializedBlobClientBuilder getSpecializedBlobClientBuilder(String dfsEndpoint, HttpPipeline pipeline) { String blobEndpoint = DataLakeImplUtils.endpointToDesiredEndpoint(dfsEndpoint, "blob", "dfs"); return new SpecializedBlobClientBuilder() .pipeline(pipeline) .endpoint(blobEndpoint) .serviceVersion(BlobServiceVersion.getLatest()); }
Source:
private void printCacheHelp() { log(i("The '" + CACHE + " subcommand' is used to get information about and perform actions with caches. The command has the following syntax:")); nl(); log(i(UTILITY_NAME_WITH_COMMON_OPTIONS + " " + CACHE + "[subcommand] <subcommand_parameters>")); nl(); log(i("The subcommands that take " + OP_NODE_ID + " as an argument ('" + LIST + "', '" + CONTENTION + "' and '" + VALIDATE_INDEXES + "') will be executed on the given node or on all server nodes if the option is not specified. Other commands will run on a random server node.")); nl(); nl(); log(i("Subcommands:")); usageCache(LIST, "regexPattern", op(or("groups", "seq")), OP_NODE_ID, op(CONFIG), op(OUTPUT_FORMAT, MULTI_LINE)); usageCache(CONTENTION, "minQueueSize", OP_NODE_ID, op("maxPrint")); usageCache(IDLE_VERIFY, op(CMD_DUMP), op(CMD_SKIP_ZEROS), "[cache1,...,cacheN]", op(CACHE_FILTER, or(CacheFilterEnum.values()))); usageCache(VALIDATE_INDEXES, "[cache1,...,cacheN]", OP_NODE_ID, op(or(VI_CHECK_FIRST + " N", VI_CHECK_THROUGH + " K"))); usageCache(DISTRIBUTION, or(NODE_ID, NULL), "[cacheName1,...,cacheNameN]", op(CMD_USER_ATTRIBUTES, "attName1,...,attrNameN")); usageCache(RESET_LOST_PARTITIONS, "cacheName1,...,cacheNameN"); nl(); }

Target:
private void printCacheHelp() { log(i("The '" + CACHE + " subcommand' is used to get information about and perform actions with caches. The command has the following syntax:")); nl(); log(i(UTILITY_NAME_WITH_COMMON_OPTIONS + " " + CACHE + "[subcommand] <subcommand_parameters>")); nl(); log(i("The subcommands that take " + OP_NODE_ID + " as an argument ('" + LIST + "', '" + CONTENTION + "' and '" + VALIDATE_INDEXES + "') will be executed on the given node or on all server nodes if the option is not specified. Other commands will run on a random server node.")); nl(); nl(); log(i("Subcommands:")); usageCache(LIST, "regexPattern", op(or("groups", "seq")), OP_NODE_ID, op(CONFIG), op(OUTPUT_FORMAT, MULTI_LINE)); usageCache(CONTENTION, "minQueueSize", OP_NODE_ID, op("maxPrint")); usageCache(IDLE_VERIFY, op(CMD_DUMP), op(CMD_SKIP_ZEROS), "[cache1,...,cacheN]", op(CACHE_FILTER, or(CacheFilterEnum.values()))); usageCache(VALIDATE_INDEXES, "[cache1,...,cacheN]", OP_NODE_ID, op(or(VI_CHECK_FIRST + " N", VI_CHECK_THROUGH + " K"))); usageCache(DISTRIBUTION, or(NODE_ID, NULL), "[cacheName1,...,cacheNameN]", op(CMD_USER_ATTRIBUTES, "attrName1,...,attrNameN")); usageCache(RESET_LOST_PARTITIONS, "cacheName1,...,cacheNameN"); nl(); }
Source:
public synchronized Future<Future<BuildDiffInfo>> importBuildIfNewAndScheduleHiPrioComparison(AvailableBuildsList availableBuilds, BuildIdentifier buildIdentifier, BuildIdentifier comparisonBuildIdentifier, String comparisonName) { BuildImportSummary buildImportSummary = buildImportSummaries.get(buildIdentifier); if (buildImportSummary == null) { LOGGER.info("Build not exists yet, submitting new import with additional task for hi prio comparison calculation."); buildImportSummary = createBuildImportSummary(buildIdentifier); buildImportSummaries.put(buildIdentifier, buildImportSummary); CompletableFuture<Future<BuildDiffInfo>> submittedFutureComparison = new CompletableFuture<>(); submitBuildForImport(availableBuilds, buildIdentifier); Future<Future<BuildDiffInfo>> futureResult = submitSingleBuildComparisonAfterLastImport(buildIdentifier, comparisonBuildIdentifier, comparisonName); saveBuildImportSummaries(buildImportSummaries); return futureResult; } else { LOGGER.info("Build already exists, only triggering comparison dirextly, not waiting for any other build import to finish first."); CompletableFuture<Future<BuildDiffInfo>> submittedFutureComparison = new CompletableFuture<>(); submittedFutureComparison.complete( submitSingleBuildComparison(buildIdentifier, comparisonBuildIdentifier, comparisonName) ); return submittedFutureComparison; } }

Target:
public synchronized Future<Future<BuildDiffInfo>> importBuildIfNewAndScheduleHiPrioComparison(AvailableBuildsList availableBuilds, BuildIdentifier buildIdentifier, BuildIdentifier comparisonBuildIdentifier, String comparisonName) { BuildImportSummary buildImportSummary = buildImportSummaries.get(buildIdentifier); if (buildImportSummary == null) { LOGGER.info("Build not exists yet, submitting new import with additional task for hi prio comparison calculation."); buildImportSummary = createBuildImportSummary(buildIdentifier); buildImportSummaries.put(buildIdentifier, buildImportSummary); submitBuildForImport(availableBuilds, buildIdentifier); Future<Future<BuildDiffInfo>> futureResult = submitSingleBuildComparisonAfterLastImport(buildIdentifier, comparisonBuildIdentifier, comparisonName); saveBuildImportSummaries(buildImportSummaries); return futureResult; } else { LOGGER.info("Build already exists, only triggering comparison dirextly, not waiting for any other build import to finish first."); CompletableFuture<Future<BuildDiffInfo>> submittedFutureComparison = new CompletableFuture<>(); submittedFutureComparison.complete( submitSingleBuildComparison(buildIdentifier, comparisonBuildIdentifier, comparisonName) ); return submittedFutureComparison; } }
Source:
private Optional<Map<String, String>> findFailures(String errorOutput, int fails) { Map<String, String> result = new HashMap<>(); String[] lines = errorOutput.split("\\r?\\n"); for (String line : lines) { Matcher matcher = FAILURES.matcher(line); if (matcher.matches()) { result.put(matcher.group("name"), matcher.group("description")); } } return Optional.of(result); }

Target:
private Map<String, String> findFailures(String errorOutput, int fails) { Map<String, String> result = new HashMap<>(); String[] lines = errorOutput.split("\\r?\\n"); for (String line : lines) { Matcher matcher = FAILURES.matcher(line); if (matcher.matches()) { result.put(matcher.group("name"), matcher.group("description")); } } return result; }
Source:
public void freeAfterFilePersisted() throws Exception { URIStatus status = createAsyncFile(); System.out.println(status); IntegrationTestUtils.waitForPersist(sLocalAlluxioClusterResource, mUri); System.out.println("Finished waiting for persist"); sFileSystem.free(mUri); System.out.println("Freed file"); IntegrationTestUtils.waitForBlocksToBeFreed( sLocalAlluxioClusterResource.get().getWorkerProcess().getWorker(BlockWorker.class), status.getBlockIds().toArray(new Long[status.getBlockIds().size()])); status = sFileSystem.getStatus(mUri); Assert.assertEquals(0, status.getInMemoryPercentage()); FileOutStreamTestUtils.checkFileInAlluxio(sFileSystem, mUri, LEN); FileOutStreamTestUtils.checkFileInUnderStorage(sFileSystem, mUri, LEN); }

Target:
public void freeAfterFilePersisted() throws Exception { URIStatus status = createAsyncFile(); IntegrationTestUtils.waitForPersist(sLocalAlluxioClusterResource, mUri); mFileSystem.free(mUri); IntegrationTestUtils.waitForBlocksToBeFreed( sLocalAlluxioClusterResource.get().getWorkerProcess().getWorker(BlockWorker.class), status.getBlockIds().toArray(new Long[status.getBlockIds().size()])); status = mFileSystem.getStatus(mUri); Assert.assertEquals(0, status.getInMemoryPercentage()); FileOutStreamTestUtils.checkFileInAlluxio(mFileSystem, mUri, LEN); FileOutStreamTestUtils.checkFileInUnderStorage(mFileSystem, mUri, LEN); }
Source:
protected DependencyResolver getJarResolver() { if (dependencyResolver == null) { if (Boolean.getBoolean("robolectric.offline")) { String dependencyDir = System.getProperty("robolectric.dependency.dir", "."); dependencyResolver = new LocalDependencyResolver(new File(dependencyDir)); } else { File cacheDir = new File(new File(System.getProperty("java.io.tmpdir")), "robolectric"); DependencyResolver dependencyResolver = null; try { dependencyResolver = (DependencyResolver) Class.forName("org.robolectric.internal.dependency.MavenDependencyResolver").newInstance(); } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { throw new RuntimeException("Error creating MavenDependencyResolver"); } if (cacheDir.exists() || cacheDir.mkdir()) { Logger.info("Dependency cache location: %s", cacheDir.getAbsolutePath()); this.dependencyResolver = new CachedDependencyResolver(dependencyResolver, cacheDir, 60 * 60 * 24 * 1000); } else { this.dependencyResolver = dependencyResolver; } } URL buildPathPropertiesUrl = getClass().getClassLoader().getResource("robolectric-deps.properties"); if (buildPathPropertiesUrl != null) { Logger.info("Using Robolectric classes from %s", buildPathPropertiesUrl.getPath()); FsFile propertiesFile = Fs.fileFromPath(buildPathPropertiesUrl.getFile()); try { dependencyResolver = new PropertiesDependencyResolver(propertiesFile, dependencyResolver); } catch (IOException e) { throw new RuntimeException("couldn't read " + buildPathPropertiesUrl, e); } } } return dependencyResolver; }

Target:
protected DependencyResolver getJarResolver() { if (dependencyResolver == null) { if (Boolean.getBoolean("robolectric.offline")) { String dependencyDir = System.getProperty("robolectric.dependency.dir", "."); dependencyResolver = new LocalDependencyResolver(new File(dependencyDir)); } else { File cacheDir = new File(new File(System.getProperty("java.io.tmpdir")), "robolectric"); Class<?> mavenDependencyResolverClass = ReflectionHelpers.loadClass(RobolectricTestRunner.class.getClassLoader(), "org.robolectric.internal.dependency.MavenDependencyResolver"); DependencyResolver dependencyResolver = (DependencyResolver) ReflectionHelpers.callConstructor(mavenDependencyResolverClass); if (cacheDir.exists() || cacheDir.mkdir()) { Logger.info("Dependency cache location: %s", cacheDir.getAbsolutePath()); this.dependencyResolver = new CachedDependencyResolver(dependencyResolver, cacheDir, 60 * 60 * 24 * 1000); } else { this.dependencyResolver = dependencyResolver; } } URL buildPathPropertiesUrl = getClass().getClassLoader().getResource("robolectric-deps.properties"); if (buildPathPropertiesUrl != null) { Logger.info("Using Robolectric classes from %s", buildPathPropertiesUrl.getPath()); FsFile propertiesFile = Fs.fileFromPath(buildPathPropertiesUrl.getFile()); try { dependencyResolver = new PropertiesDependencyResolver(propertiesFile, dependencyResolver); } catch (IOException e) { throw new RuntimeException("couldn't read " + buildPathPropertiesUrl, e); } } } return dependencyResolver; }
Source:
public boolean hasDownloads() { return !getDownloadedPluginFilenames().isEmpty(); }

Target:
boolean hasDownloads() { return !getDownloadedPluginFilenames().isEmpty(); }
Source:
public static Map<String, String> createStructFromConnection(final StorageServerConnections connection, final StoragePool storagePool) { DefaultValueMap con = new DefaultValueMap(); con.put("id", connection.getid(), Guid.Empty.toString()); con.put("connection", connection.getconnection(), ""); con.put("tpgt", connection.getportal(), ""); con.put("port", connection.getport(), ""); con.put("iqn", connection.getiqn(), ""); con.put("user", connection.getuser_name(), ""); con.put("password", connection.getpassword(), ""); con.putIfNotEmpty("ifaceName", connection.getIface()); con.putIfNotEmpty("netIfacename", connection.getNetIfacename()); if (storagePool == null || Config.<Boolean> getValue(ConfigValues.AdvancedNFSOptionsEnabled, storagePool.getcompatibility_version().getValue())) { con.putIfNotEmpty("mnt_options", connection.getMountOptions()); con.putIfNotEmpty("vfs_type", connection.getVfsType()); if (connection.getNfsVersion() != null) { con.put("protocol_version", connection.getNfsVersion().getValue()); } con.putIfNotEmpty("timeout", connection.getNfsTimeo()); con.putIfNotEmpty("retrans", connection.getNfsRetrans()); } return con; }

Target:
public static Map<String, String> createStructFromConnection(final StorageServerConnections connection, final StoragePool storagePool) { DefaultValueMap con = new DefaultValueMap(); con.put("id", connection.getid(), Guid.Empty.toString()); con.put("connection", connection.getconnection(), ""); con.putIfNotEmpty("tpgt", connection.getportal()); con.put("port", connection.getport(), ""); con.put("iqn", connection.getiqn(), ""); con.put("user", connection.getuser_name(), ""); con.put("password", connection.getpassword(), ""); con.putIfNotEmpty("ifaceName", connection.getIface()); con.putIfNotEmpty("netIfaceName", connection.getNetIfaceName()); if (storagePool == null || Config.<Boolean> getValue(ConfigValues.AdvancedNFSOptionsEnabled, storagePool.getcompatibility_version().getValue())) { con.putIfNotEmpty("mnt_options", connection.getMountOptions()); con.putIfNotEmpty("vfs_type", connection.getVfsType()); if (connection.getNfsVersion() != null) { con.put("protocol_version", connection.getNfsVersion().getValue()); } con.putIfNotEmpty("timeout", connection.getNfsTimeo()); con.putIfNotEmpty("retrans", connection.getNfsRetrans()); } return con; }
Source:
void drainRegular(Subscriber<? super T> a) { int missed = 1; final Queue<T> q = queue; for (;;) { long r = requested.get(); long e = 0L; while (r != e) { boolean d = done; T t = q.poll(); boolean empty = t == null; if (checkTerminated(d, empty, a, q)) { return; } if (empty) { break; } a.onNext(t); e++; } if (r == e) { if (checkTerminated(done, q.isEmpty(), a, q)) { return; } } if (e != 0 && r != Long.MAX_VALUE) { requested.addAndGet(-e); } missed = wip.addAndGet(-missed); if (missed == 0) { break; } } }

Target:
void drainRegular(Subscriber<? super T> a) { int missed = 1; final Queue<T> q = queue; for (;;) { long r = requested.get(); long e = 0L; while (r != e) { boolean d = done; T t = q.poll(); boolean empty = t == null; if (checkTerminated(d, empty, a, q)) { return; } if (empty) { break; } a.onNext(t); e++; } if (r == e && checkTerminated(done, q.isEmpty(), a, q)) { return; } if (e != 0 && r != Long.MAX_VALUE) { requested.addAndGet(-e); } missed = wip.addAndGet(-missed); if (missed == 0) { break; } } }
Source:
public DatabaseChunkedReaderMetrics(String source, String key) { super(CLASS_NAME, key); _source = source; _readerQueryExecutionTimeMs = DYNAMIC_METRICS_MANAGER.registerMetric(CLASS_NAME, key, QUERY_EXECUTION_TIME, Histogram.class); _readerQueriesExecutedRate = DYNAMIC_METRICS_MANAGER.registerMetric(CLASS_NAME, key, QUERY_EXECUTION_RATE, Meter.class); _readerErrorRate = DYNAMIC_METRICS_MANAGER.registerMetric(CLASS_NAME, key, ERROR_RATE, Meter.class); _readerSkippedBadMessagesRate = DYNAMIC_METRICS_MANAGER.registerMetric(CLASS_NAME, key, SKIPPED_BAD_MESSAGES_RATE, Meter.class); _sourceQueryExecutionTimeMs = DYNAMIC_METRICS_MANAGER.registerMetric(CLASS_NAME, source, QUERY_EXECUTION_TIME, Histogram.class); _sourceQueriesExecutedRate = DYNAMIC_METRICS_MANAGER.registerMetric(CLASS_NAME, source, QUERY_EXECUTION_RATE, Meter.class); _sourceErrorRate = DYNAMIC_METRICS_MANAGER.registerMetric(CLASS_NAME, source, ERROR_RATE, Meter.class); _sourceSkippedBadMessagesRate = DYNAMIC_METRICS_MANAGER.registerMetric(CLASS_NAME, source, SKIPPED_BAD_MESSAGES_RATE, Meter.class); }

Target:
public DatabaseChunkedReaderMetrics(String source, String key) { super(CLASS_NAME, key); _source = source; _readerQueryExecutionDurationMs = DYNAMIC_METRICS_MANAGER.registerMetric(CLASS_NAME, key, QUERY_EXECUTION_DURATION, Histogram.class); _readerQueryExecutionRate = DYNAMIC_METRICS_MANAGER.registerMetric(CLASS_NAME, key, QUERY_EXECUTION_RATE, Meter.class); _readerErrorRate = DYNAMIC_METRICS_MANAGER.registerMetric(CLASS_NAME, key, ERROR_RATE, Meter.class); _readerSkippedBadMessagesRate = DYNAMIC_METRICS_MANAGER.registerMetric(CLASS_NAME, key, SKIPPED_BAD_MESSAGES_RATE, Meter.class); _sourceQueryExecutionDurationMs = DYNAMIC_METRICS_MANAGER.registerMetric(CLASS_NAME, source, QUERY_EXECUTION_DURATION, Histogram.class); _sourceQueryExecutionRate = DYNAMIC_METRICS_MANAGER.registerMetric(CLASS_NAME, source, QUERY_EXECUTION_RATE, Meter.class); _sourceErrorRate = DYNAMIC_METRICS_MANAGER.registerMetric(CLASS_NAME, source, ERROR_RATE, Meter.class); _sourceSkippedBadMessagesRate = DYNAMIC_METRICS_MANAGER.registerMetric(CLASS_NAME, source, SKIPPED_BAD_MESSAGES_RATE, Meter.class); }
Source:
public Structure getReply() { return Structure.objectFor(GSTPROMISE_API.gst_promise_get_reply(this), false, false); }

Target:
public Structure getReply() { return Structure.objectFor(GSTPROMISE_API.ptr_gst_promise_get_reply(this), false, false); }
Source:
protected View onCreateContentView(LayoutInflater inflater, ViewGroup parent) { View view = inflater.inflate(R.layout.list_fragment_content, parent, false); mEmptyViewContainer = (NestedScrollView) view.findViewById(R.id.empty_view_container); TextView emptyView = (TextView) view.findViewById(android.R.id.empty); int emptyTextResId = getEmptyTextResId(); if (emptyTextResId != 0) { emptyView.setText(emptyTextResId); } mLayoutManager = new LinearLayoutManager(view.getContext()); mRecyclerView = (RecyclerView) view.findViewById(R.id.list); mRecyclerView.setLayoutManager(mLayoutManager); onRecyclerViewInflated(mRecyclerView, inflater); if (hasDividers()) { mRecyclerView.addItemDecoration(new DividerItemDecoration(view.getContext())); } if (!hasCards()) { mRecyclerView.setBackgroundResource( UiUtils.resolveDrawable(getActivity(), R.attr.listBackground)); } mFastScroller = (RecyclerFastScroller) view.findViewById(R.id.fast_scroller); mFastScroller.attachRecyclerView(mRecyclerView); int color = UiUtils.resolveColor(view.getContext(), R.attr.colorControlNormal); color = Color.argb(93, Color.red(color), Color.green(color), Color.blue(color)); mFastScroller.setHandleNormalColor(color); return view; }

Target:
protected View onCreateContentView(LayoutInflater inflater, ViewGroup parent) { View view = inflater.inflate(R.layout.list_fragment_content, parent, false); mEmptyViewContainer = (NestedScrollView) view.findViewById(R.id.empty_view_container); TextView emptyView = (TextView) view.findViewById(android.R.id.empty); int emptyTextResId = getEmptyTextResId(); if (emptyTextResId != 0) { emptyView.setText(emptyTextResId); } mLayoutManager = new LinearLayoutManager(view.getContext()); mRecyclerView = (RecyclerView) view.findViewById(R.id.list); mRecyclerView.setLayoutManager(mLayoutManager); onRecyclerViewInflated(mRecyclerView, inflater); if (hasDividers()) { mRecyclerView.addItemDecoration(new DividerItemDecoration(view.getContext())); } if (!hasCards()) { mRecyclerView.setBackgroundResource( UiUtils.resolveDrawable(getActivity(), R.attr.listBackground)); } mFastScroller = (RecyclerFastScroller) view.findViewById(R.id.fast_scroller); mFastScroller.attachRecyclerView(mRecyclerView); return view; }
Source:
public List<Object> prepend(List<Object> list, Object object) { final List<Object> result = Lists.newArrayList(); result.add(object); result.addAll(list); return result; }

Target:
public List<Object> prepend(List<Object> list, Object object) { final List<Object> result = new ArrayList<Object>(list.size() + 1); result.add(object); result.addAll(list); return result; }
Source:
public void getStartingMember() throws Exception { Member server0 = new Member(); server0.setId("server-0"); concurrency.add(() -> cluster.startServerVM(0, webContext.getLocator().getPort())); concurrency.add(() -> { ClusterManagementGetResult<Member, MemberInformation> result = null; while (result == null) { try { result = client.get(server0); } catch (ClusterManagementException e) { } } return result; }); concurrency.executeInParallel(); }

Target:
public void getStartingMember() throws Exception { Member server0 = new Member(); server0.setId("server-0"); Future<Void> startServer = executorServiceRule.submit(() -> { cluster.startServerVM(0, webContext.getLocator().getPort()); }); await() .ignoreException(ClusterManagementException.class) .untilAsserted(() -> assertThat(client.get(server0).getStatusCode()).isEqualTo( ClusterManagementResult.StatusCode.OK)); startServer.get(getTimeout().toMillis(), MILLISECONDS); }
Source:
public static String findAvailableHostAddress() throws UnknownHostException, SocketException { List<NetworkInterface> netlist = new ArrayList<NetworkInterface>(); Enumeration<?> netInterfaces = NetworkInterface.getNetworkInterfaces(); while (netInterfaces.hasMoreElements()) { NetworkInterface networkInterface = (NetworkInterface)netInterfaces.nextElement(); LOGGER.info("networkInterface = " + networkInterface.toString()); if (networkInterface.isLoopback()) { continue; } netlist.add(0, networkInterface); } for (NetworkInterface list:netlist) { Enumeration<?> enumInetAddress = list.getInetAddresses(); while (enumInetAddress.hasMoreElements()) { InetAddress ip = (InetAddress) enumInetAddress.nextElement(); LOGGER.info("ip = " + ip.toString()); if (!ip.isLoopbackAddress()) { if (ip.getHostAddress().equalsIgnoreCase("127.0.0.1")){ continue; } if (ip instanceof Inet6Address) { continue; } if (ip instanceof Inet4Address) { return ip.getHostAddress(); } } return ip.getLocalHost().getHostAddress(); } } LOGGER.error("Can't find available HostAddress!"); throw new UnknownHostException("Can't find available HostAddress!"); }

Target:
public static String findAvailableHostAddress() throws UnknownHostException, SocketException { List<NetworkInterface> netlist = new ArrayList<NetworkInterface>(); Enumeration<?> netInterfaces = NetworkInterface.getNetworkInterfaces(); while (netInterfaces.hasMoreElements()) { NetworkInterface networkInterface = (NetworkInterface)netInterfaces.nextElement(); if (LOGGER.isDebugEnabled()) { LOGGER.debug("networkInterface = " + networkInterface.toString()); } if (networkInterface.isLoopback()) { continue; } netlist.add(0, networkInterface); } for (NetworkInterface list:netlist) { Enumeration<?> enumInetAddress = list.getInetAddresses(); while (enumInetAddress.hasMoreElements()) { InetAddress ip = (InetAddress) enumInetAddress.nextElement(); if (LOGGER.isDebugEnabled()) { LOGGER.debug("ip = " + ip.toString()); } if (!ip.isLoopbackAddress() && !ip.isLinkLocalAddress()) { if (ip.getHostAddress().equalsIgnoreCase("127.0.0.1")){ continue; } if (ip instanceof Inet6Address) { continue; } if (ip instanceof Inet4Address) { return ip.getHostAddress(); } } return ip.getLocalHost().getHostAddress(); } } LOGGER.error("Can't find available HostAddress!"); throw new UnknownHostException("Can't find available HostAddress!"); }
Source:
public void aCsvModelIsValidWhenDelimiterAndFieldsAreSet() { DefaultCSVMetaDataBuilder builder = new DefaultCSVMetaDataBuilder(); CSVMetaDataModel model = builder.setDelimiter(",").addField("name", DataType.STRING).addField("age", DataType.DECIMAL).build(); Assert.assertThat(model, CoreMatchers.notNullValue()); Assert.assertThat(model.getDelimiter(), CoreMatchers.is(",")); Assert.assertThat(model.getFields().size(), CoreMatchers.is(2)); }

Target:
public void aCsvModelIsValidWhenDelimiterAndFieldsAreSet() { DefaultCSVMetaDataBuilder builder = new DefaultCSVMetaDataBuilder(); CSVMetaDataModel model = builder.setDelimiter(COMMA_DELIMITER).addField(FIELD_NAME, DataType.STRING).addField(FIELD_AGE, DataType.DECIMAL).build(); assertThat(model, notNullValue()); assertThat(model.getDelimiter(), is(COMMA_DELIMITER)); assertThat(model.getFields(), hasSize(2)); }
Source:
public static Schema discoverSchema(Source ... fixedSources) throws SAXException { return newSchema(Stream.of( Arrays.stream(fixedSources), stream(libraryServiceLoaderFor(CacheManagerServiceConfigurationParser.class)).map(p -> { try { return p.getXmlSchema(); } catch (IOException e) { throw new AssertionError(e); } }), stream(libraryServiceLoaderFor(CacheServiceConfigurationParser.class)).map(p -> { try { return p.getXmlSchema(); } catch (IOException e) { throw new AssertionError(e); } }), stream(libraryServiceLoaderFor(CacheResourceConfigurationParser.class)).map(p -> { try { return p.getXmlSchema(); } catch (IOException e) { throw new AssertionError(e); } })).flatMap(identity()).toArray(Source[]::new)); }

Target:
public static Schema discoverSchema(Source ... fixedSources) throws SAXException, IOException { ArrayList<Source> schemaSources = new ArrayList<>(asList(fixedSources)); for (CacheManagerServiceConfigurationParser<?> p : libraryServiceLoaderFor(CacheManagerServiceConfigurationParser.class)) { schemaSources.add(p.getXmlSchema()); } for (CacheServiceConfigurationParser<?> p : libraryServiceLoaderFor(CacheServiceConfigurationParser.class)) { schemaSources.add(p.getXmlSchema()); } for (CacheResourceConfigurationParser p : libraryServiceLoaderFor(CacheResourceConfigurationParser.class)) { schemaSources.add(p.getXmlSchema()); } return newSchema(schemaSources.toArray(new Source[0])); }
Source:
public void onPlaying() { super.onPlaying(); updateNotification(R.drawable.ic_pause_white); videoPlayPause.setBackgroundResource(R.drawable.ic_pause_white); lockManager.acquireWifiAndCpu(); hideControls(DEFAULT_CONTROLS_DURATION, DEFAULT_CONTROLS_HIDE_TIME); new CheckForNewAppVersionTask().execute(); }

Target:
public void onPlaying() { super.onPlaying(); updateWindowFlags(ONGOING_PLAYBACK_WINDOW_FLAGS); resetNotification(); updateNotification(R.drawable.ic_pause_white); videoPlayPause.setBackgroundResource(R.drawable.ic_pause_white); hideControls(DEFAULT_CONTROLS_DURATION, DEFAULT_CONTROLS_HIDE_TIME); startForeground(NOTIFICATION_ID, notBuilder.build()); lockManager.acquireWifiAndCpu(); }
Source:
public int compareTo(PicassoFutureTask other) { Picasso.Priority p1 = hunter.getPriority(); Picasso.Priority p2 = other.hunter.getPriority(); return (p1 == p2 ? hunter.getSequence() - other.hunter.getSequence() : p2.ordinal() - p1.ordinal()); }

Target:
public int compareTo(PicassoFutureTask other) { Picasso.Priority p1 = hunter.priority; Picasso.Priority p2 = other.hunter.priority; return (p1 == p2 ? hunter.sequence - other.hunter.sequence : p2.ordinal() - p1.ordinal()); }
Source:
private ReserveFileMap inventoryExistingReserveFiles() { ReserveFileMap reserveFiles = new ReserveFileMap(); File[] fileSizeDirs = reserveDir.listFiles(FILE_SIZE_DIR_FILTER); if (fileSizeDirs != null) { for (File fileSizeDir : fileSizeDirs) { long sizeInBytes = Long.parseLong(fileSizeDir.getName()); File[] reserveFilesForSize = fileSizeDir.listFiles(RESERVE_FILE_FILTER); if (reserveFilesForSize != null) { for (File reserveFile : reserveFilesForSize) { reserveFiles.add(sizeInBytes, reserveFile); } } } } return reserveFiles; }

Target:
private void inventoryExistingReserveFiles() throws IOException { File[] fileSizeDirs = reserveDir.listFiles(FILE_SIZE_DIR_FILTER); if (fileSizeDirs == null) { throw new IOException("Error while listing directories in " + reserveDir.getAbsolutePath()); } for (File fileSizeDir : fileSizeDirs) { long sizeInBytes = getFileSizeForDirName(fileSizeDir.getName()); File[] reserveFilesForSize = fileSizeDir.listFiles(RESERVE_FILE_FILTER); if (reserveFilesForSize == null) { throw new IOException("Error while listing files in " + fileSizeDir.getAbsolutePath()); } for (File reserveFile : reserveFilesForSize) { reserveFiles.add(sizeInBytes, reserveFile); } } }
Source:
private boolean handleSocksProxyPreferenceChange(Preference preference, String newValue) { if (newValue.equals("")) { preference.setSummary(getString(R.string.do_not_use_proxy) + " " + getString(R.string.generic_example) + ": " + getString(R.string.socks_proxy_address_example)); return true; } else if (newValue.matches("^socks.://(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}):(\\d{1,5})$")) { preference.setSummary(getString(R.string.use_proxy) + " " + newValue); return true; } else { Toast.makeText(getActivity(), R.string.toast_invalid_socks_proxy_address, Toast.LENGTH_SHORT) .show(); return false; } }

Target:
private boolean handleSocksProxyPreferenceChange(Preference preference, String newValue) { if (newValue.equals("")) { preference.setSummary(getString(R.string.do_not_use_proxy) + " " + getString(R.string.generic_example) + ": " + getString(R.string.socks_proxy_address_example)); return true; } else if (newValue.matches("^socks5://.*:\\d{1,5}$")) { preference.setSummary(getString(R.string.use_proxy) + " " + newValue); return true; } else { Toast.makeText(getActivity(), R.string.toast_invalid_socks_proxy_address, Toast.LENGTH_SHORT) .show(); return false; } }
Source:
public ITmfTimestamp readEnd() { try { Long pos = fFile.length() - 1; while (pos > 0) { while (pos > 0) { fFile.seek(pos - 1); if (fFile.read() == '\n') { break; } pos--; } ITmfLocation location = new TmfLongLocation(pos); TmfContext context = new TmfContext(location, ITmfContext.UNKNOWN_RANK); CustomXmlEvent event = parseEvent(context); if (event != null) { return event.getTimestamp(); } pos--; } } catch (IOException e) { return null; } return null; }

Target:
public synchronized ITmfTimestamp readEnd() { try { Long pos = fFile.length() - 1; while (pos > 0) { while (pos > 0) { fFile.seek(pos - 1); if (fFile.read() == '\n') { break; } pos--; } ITmfLocation location = new TmfLongLocation(pos); ITmfContext context = seekEvent(location); ITmfEvent event = parseEvent(context); context.dispose(); if (event != null) { return event.getTimestamp(); } pos--; } } catch (IOException e) { return null; } return null; }
Source:
public GoloFunction(String name, Visibility visibility, Scope scope) { this.name = name; this.visibility = visibility; this.scope = scope; this.main = this.name.equals("main"); }

Target:
public GoloFunction(String name, Visibility visibility, Scope scope) { this.name = name; this.visibility = visibility; this.scope = scope; }
Source:
public RelDataType rowType() { synchronized (lock) { Preconditions.checkState(prepareResult != null || plannerResult != null, "must be called after sql has been prepared"); return plannerResult != null ? plannerResult.rowType() : prepareResult.getRowType(); } }

Target:
public RelDataType rowType() { synchronized (lock) { return plannerResult != null ? plannerResult.rowType() : prepareResult.getRowType(); } }