auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public BlobServiceAsyncClient buildAsyncClient() { BuilderHelper.validateCpk(customerProvidedKey, endpoint); BlobServiceVersion serviceVersion = version != null ? version : BlobServiceVersion.getLatest(); HttpPipeline pipeline = (httpPipeline != null) ? httpPipeline : BuilderHelper.buildPipeline( storageSharedKeyCredential, tokenCredential, sasTokenCredential, endpoint, retryOptions, logOptions, httpClient, additionalPolicies, configuration, serviceVersion); return new BlobServiceAsyncClient(pipeline, endpoint, serviceVersion, accountName, customerProvidedKey); }

Target:
public BlobServiceAsyncClient buildAsyncClient() { BuilderHelper.validateCpk(customerProvidedKey, endpoint); if (Objects.isNull(storageSharedKeyCredential) && Objects.isNull(tokenCredential) && Objects.isNull(sasTokenCredential)) { throw logger.logExceptionAsError(new IllegalArgumentException("Blob Service Client cannot be accessed " + "anonymously. Please provide a form of authentication")); } BlobServiceVersion serviceVersion = version != null ? version : BlobServiceVersion.getLatest(); HttpPipeline pipeline = (httpPipeline != null) ? httpPipeline : BuilderHelper.buildPipeline( storageSharedKeyCredential, tokenCredential, sasTokenCredential, endpoint, retryOptions, logOptions, httpClient, additionalPolicies, configuration, serviceVersion); return new BlobServiceAsyncClient(pipeline, endpoint, serviceVersion, accountName, customerProvidedKey); }
Source:
public IntervalLoadRule( @JsonProperty("interval") Interval interval, @JsonProperty("tieredReplicants") Map<String, Integer> tieredReplicants ) { this.tieredReplicants = tieredReplicants == null ? Maps.<String, Integer>newHashMap() : tieredReplicants; validateTieredReplicants(this.tieredReplicants); this.interval = interval; }

Target:
public IntervalLoadRule( @JsonProperty("interval") Interval interval, @JsonProperty("tieredReplicants") Map<String, Integer> tieredReplicants ) { this.tieredReplicants = tieredReplicants == null ? ImmutableMap.of(DruidServer.DEFAULT_TIER, DruidServer.DEFAULT_NUM_REPLICANTS) : tieredReplicants; validateTieredReplicants(this.tieredReplicants); this.interval = interval; }
Source:
private boolean isServicesBasedDeployment(List<String> services) { return services != null && services.size() > 0; }

Target:
private boolean isServicesBasedDeployment(List<String> services) { return services != null && !services.isEmpty(); }
Source:
public void testCreateVolume() { assertNotNull(dataCenter); testVolume = volumeApi().createVolume( Volume.Request.creatingBuilder() .dataCenterId(dataCenter.id()) .name("jclouds-volume") .size(3) .licenceType(LicenceType.LINUX) .type("HDD") .build()); assertNotNull(testVolume); assertEquals(testVolume.properties().name(), "jclouds-volume"); assertVolumeAvailable(testVolume); }

Target:
public void testCreateVolume() { assertNotNull(dataCenter); List<Image> images = api.imageApi().getList(new DepthOptions().depth(5)); Image testImage = null; for (Image image : images) { if ( image.metadata().state() == State.AVAILABLE && image.properties().isPublic() && image.properties().imageType() == Image.Type.HDD && image.properties().location() == TestLocation && image.properties().licenceType() == LicenceType.LINUX && ( testImage == null || testImage.properties().size() > image.properties().size() ) ) { testImage = image; } } HashSet<String> sshKeys = new HashSet<String>(); sshKeys.add("hQGOEJeFL91EG3+l9TtRbWNjzhDVHeLuL3NWee6bekA="); testVolume = volumeApi().createVolume( Volume.Request.creatingBuilder() .dataCenterId(dataCenter.id()) .name("jclouds-volume") .size(4) .licenceType(LicenceType.LINUX) .type(VolumeType.HDD) .image(testImage.id()) .sshKeys(sshKeys) .build()); assertNotNull(testVolume); assertEquals(testVolume.properties().name(), "jclouds-volume"); assertVolumeAvailable(testVolume); }
Source:
private void handleInvalidResponse(HttpResponse response, String url) throws IOException { try (StringWriter sw = new StringWriter(); PrintWriter out = new PrintWriter(sw) ) { out.print("Problem accessing server at "); out.println(url); if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { LOG.info("Response code: " + response.getStatusLine().getStatusCode()); out.println("Few Possible Causes: "); out.println("1. Your Go Server is down or not accessible."); out.println("2. This agent might be incompatible with your Go Server. Please fix the version mismatch between Go Server and Go Agent."); throw new ClientProtocolException(sw.toString()); } else if (response.getFirstHeader(MD5_HEADER) == null || response.getFirstHeader(SSL_PORT_HEADER) == null) { out.print("Missing required headers '"); out.print(MD5_HEADER); out.print("' and '"); out.print(SSL_PORT_HEADER); out.println("' in response."); throw new ClientProtocolException(sw.toString()); } } }

Target:
private void handleInvalidResponse(HttpResponse response, String url) throws IOException { StringWriter sw = new StringWriter(); try (PrintWriter out = new PrintWriter(sw)) { out.print("Problem accessing server at "); out.println(url); if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { LOG.info("Response code: " + response.getStatusLine().getStatusCode()); out.println("Few Possible Causes: "); out.println("1. Your Go Server is down or not accessible."); out.println("2. This agent might be incompatible with your Go Server. Please fix the version mismatch between Go Server and Go Agent."); throw new ClientProtocolException(sw.toString()); } else if (response.getFirstHeader(MD5_HEADER) == null || response.getFirstHeader(SSL_PORT_HEADER) == null) { out.print("Missing required headers '"); out.print(MD5_HEADER); out.print("' and '"); out.print(SSL_PORT_HEADER); out.println("' in response."); throw new ClientProtocolException(sw.toString()); } } }
Source:
private void updateProjectAccessible( final boolean blockWorkbenchStartup ) { if ( blockWorkbenchStartup ) { workbench.addStartupBlocker( LibraryMonitor.class ); } libraryService.call( new RemoteCallback<Boolean>() { @Override public void callback( Boolean thereIsAProjectInTheWorkbench ) { thereIsAtLeastOneProjectAccessible = thereIsAProjectInTheWorkbench; if ( blockWorkbenchStartup ) { workbench.removeStartupBlocker( LibraryMonitor.class ); } } } ).thereIsAProjectInTheWorkbench(); }

Target:
private void updateProjectAccessible( final boolean blockWorkbenchStartup ) { if ( blockWorkbenchStartup ) { workbench.addStartupBlocker( LibraryMonitor.class ); } libraryService.call( new RemoteCallback<Boolean>() { @Override public void callback( Boolean thereIsAProjectInTheWorkbench ) { thereIsAtLeastOneProjectAccessible = thereIsAProjectInTheWorkbench; if ( blockWorkbenchStartup ) { workbench.removeStartupBlocker( LibraryMonitor.class ); } } }, ( o, throwable ) -> { setThereIsAtLeastOneProjectAccessible( true ); LOGGER.log( Level.SEVERE, "Error while checking for projects: ", throwable ); if ( blockWorkbenchStartup ) { workbench.removeStartupBlocker( LibraryMonitor.class ); } return false; } ).thereIsAProjectInTheWorkbench(); }
Source:
protected void updateReferenceTimes(ScannedFileInfo fileInfo) { Map<String, Long> referenceTimeMap; if ((referenceTimeMap = referenceTimes.get(fileInfo.getDirectoryPath())) == null) { referenceTimeMap = Maps.newHashMap(); } referenceTimeMap.put(fileInfo.getFilePath(), fileInfo.modifiedTime); referenceTimes.put(fileInfo.getDirectoryPath(), referenceTimeMap); }

Target:
protected void updateReferenceTimes(ScannedFileInfo fileInfo) { Map<String, Long> referenceTimePerInputDir; if ((referenceTimePerInputDir = referenceTimes.get(fileInfo.getDirectoryPath())) == null) { referenceTimePerInputDir = Maps.newHashMap(); } referenceTimePerInputDir.put(fileInfo.getFilePath(), fileInfo.modifiedTime); referenceTimes.put(fileInfo.getDirectoryPath(), referenceTimePerInputDir); }
Source:
public void clickViewStudentCheckBoxInSectionLevel(int instrNum, int sectionLevelIndex) { this.sectionLevelIndexPanelCheckBox(instrNum, sectionLevelIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_STUDENT_IN_SECTIONS).click(); }

Target:
public void clickViewStudentCheckBoxInSectionLevel(int instrNum, int sectionLevelIndex) { this.sectionLevelPanelCheckBox(instrNum, sectionLevelIndex, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_STUDENT_IN_SECTIONS).click(); }
Source:
private static String getArrayNotEqualReason(Object actual, Object expected){ if(actual == expected) return null; if(null == expected) { return "expected a null array, but not null found"; } if(null == actual) { return "expected not null array, but null found"; } if (!actual.getClass().isArray()) { return "not an array"; } int expectedLength = Array.getLength(expected); if (expectedLength != Array.getLength(actual)) { return "array lengths are not the same"; } for (int i = 0; i < expectedLength; i++) { Object _actual = Array.get( actual, i ); Object _expected = Array.get( expected, i ); if(!areEqual( _actual, _expected )){ return "(values at index " + i + " are not the same)"; } } return null; }

Target:
private static String getArrayNotEqualReason(Object actual, Object expected) { if (actual == expected) { return null; } if (null == expected) { return "expected a null array, but not null found"; } if (null == actual) { return "expected not null array, but null found"; } if (!actual.getClass().isArray()) { return "not an array"; } int expectedLength = Array.getLength(expected); if (expectedLength != Array.getLength(actual)) { return "array lengths are not the same"; } for (int i = 0; i < expectedLength; i++) { Object _actual = Array.get(actual, i); Object _expected = Array.get(expected, i); if (!areEqual(_actual, _expected)) { return "(values at index " + i + " are not the same)"; } } return null; }
Source:
public void testColumnRangeReadUnsupported() { Transaction t1 = startTransaction(); try { t1.getRowsColumnRange(TEST_TABLE, ImmutableList.of(PtBytes.toBytes("row1")), new ColumnRangeSelection(PtBytes.EMPTY_BYTE_ARRAY, PtBytes.EMPTY_BYTE_ARRAY), 1); } catch (UnsupportedOperationException e) { } }

Target:
public void testColumnRangeReadUnsupported() { Transaction t1 = startTransaction(); try { t1.getRowsColumnRange(TEST_TABLE, ImmutableList.of(PtBytes.toBytes("row1")), new ColumnRangeSelection(PtBytes.EMPTY_BYTE_ARRAY, PtBytes.EMPTY_BYTE_ARRAY), 1); fail(); } catch (UnsupportedOperationException e) { } }
Source:
private void updatePublishDateTextView() { if (!isAdded()) { return; } PostModel postModel = getPost(); String labelToUse = "%s"; String dateCreated = postModel.getDateCreated(); if (!TextUtils.isEmpty(dateCreated)) { String formattedDate = DateUtils.formatDateTime(getActivity(), DateTimeUtils.timestampFromIso8601Millis(dateCreated), getDateTimeFlags()); PostStatus status = PostStatus.fromPost(postModel); if (status == PostStatus.SCHEDULED) { labelToUse = getString(R.string.scheduled_for, formattedDate); } else if (status == PostStatus.PUBLISHED || status == PostStatus.PRIVATE) { labelToUse = getString(R.string.published_on, formattedDate); } else if (postModel.isLocalDraft() && PostUtils.shouldPublishImmediately(postModel)) { mPublishDateTextView.setText(R.string.immediately); return; } else if (PostUtils.isPublishDateInTheFuture(postModel)) { labelToUse = getString(R.string.schedule_for, formattedDate); } else { labelToUse = getString(R.string.publish_on, formattedDate); } mPublishDateTextView.setText(labelToUse); } else if (PostUtils.shouldPublishImmediatelyOptionBeAvailable(postModel)) { mPublishDateTextView.setText(R.string.immediately); } }

Target:
private void updatePublishDateTextView() { if (!isAdded()) { return; } PostModel postModel = getPost(); String labelToUse; String dateCreated = postModel.getDateCreated(); if (!TextUtils.isEmpty(dateCreated)) { String formattedDate = DateUtils.formatDateTime(getActivity(), DateTimeUtils.timestampFromIso8601Millis(dateCreated), getDateTimeFlags()); PostStatus status = PostStatus.fromPost(postModel); if (status == PostStatus.SCHEDULED) { labelToUse = getString(R.string.scheduled_for, formattedDate); } else if (status == PostStatus.PUBLISHED || status == PostStatus.PRIVATE) { labelToUse = getString(R.string.published_on, formattedDate); } else if (postModel.isLocalDraft() && PostUtils.shouldPublishImmediately(postModel)) { labelToUse = getString(R.string.immediately); } else if (PostUtils.isPublishDateInTheFuture(postModel)) { labelToUse = getString(R.string.schedule_for, formattedDate); } else { labelToUse = getString(R.string.publish_on, formattedDate); } } else if (PostUtils.shouldPublishImmediatelyOptionBeAvailable(postModel)) { labelToUse = getString(R.string.immediately); } else { labelToUse = ""; } mPublishDateTextView.setText(labelToUse); }
Source:
public static int numOracles(CuratorFramework curator) { int numOracles = 0; try { if (curator.checkExists().forPath(ZookeeperPath.ORACLE_SERVER) != null) { LeaderLatch leaderLatch = new LeaderLatch(curator, ZookeeperPath.ORACLE_SERVER); numOracles = leaderLatch.getParticipants().size(); } } catch (Exception e) { throw new RuntimeException(e); } return numOracles; }

Target:
private static int numOracles(CuratorFramework curator) { try { LeaderLatch leaderLatch = new LeaderLatch(curator, ZookeeperPath.ORACLE_SERVER); return leaderLatch.getParticipants().size(); } catch (Exception e) { throw new RuntimeException(e); } }
Source:
public DynamicConfigServiceImpl(NodeContext nodeContext, LicenseService licenseService, NomadServerManager nomadServerManager, ObjectMapperFactory objectMapperFactory) { this.upcomingNodeContext = requireNonNull(nodeContext); this.runtimeNodeContext = requireNonNull(nodeContext); this.licenseService = requireNonNull(licenseService); this.nomadServerManager = requireNonNull(nomadServerManager); this.licensePath = nomadServerManager.getConfigurationManager().getLicensePath().resolve(LICENSE_FILE_NAME); this.objectMapper = objectMapperFactory.create(); if (hasLicenseFile()) { validateAgainstLicense(upcomingNodeContext.getCluster()); } }

Target:
public DynamicConfigServiceImpl(NodeContext nodeContext, LicenseService licenseService, NomadServerManager nomadServerManager, ObjectMapperFactory objectMapperFactory) { this.upcomingNodeContext = requireNonNull(nodeContext); this.runtimeNodeContext = requireNonNull(nodeContext); this.licenseService = requireNonNull(licenseService); this.nomadServerManager = requireNonNull(nomadServerManager); this.licensePath = nomadServerManager.getConfigurationManager().getLicensePath().resolve(LICENSE_FILE_NAME); this.objectMapper = objectMapperFactory.create(); if (hasLicenseFile()) { validateAgainstLicense(upcomingNodeContext.getCluster()); } new ClusterValidator(nodeContext.getCluster()).validate(); }
Source:
public Expanded expanded(String ori) { final Map<SqlParserPos, SqlIdentifier> identifiers = new HashMap<>(); final SqlNode oriNode; final SqlNode validated; oriNode = planner.parser().parse(ori); validated = planner.validate(planner.parser().parse(ori)); validated.accept(new SqlBasicVisitor<Void>() { @Override public Void visit(SqlIdentifier identifier) { identifiers.putIfAbsent(identifier.getParserPosition(), identifier); return null; } }); return new Expanded(planner.config().getParserConfig(), oriNode, identifiers); }

Target:
public Expanded expanded(String ori) { final Map<SqlParserPos, SqlIdentifier> identifiers = new HashMap<>(); final Map<String, SqlIdentifier> funcNameToId = new HashMap<>(); final SqlNode oriNode = planner.parser().parse(ori); final SqlNode validated = planner.validate(planner.parser().parse(ori)); validated.accept(new SqlBasicVisitor<Void>() { @Override public Void visit(SqlCall call) { SqlOperator operator = call.getOperator(); if (operator instanceof BridgingSqlFunction) { final SqlIdentifier functionID = ((BridgingSqlFunction) operator) .getSqlIdentifier(); if (!functionID.isSimple()) { funcNameToId.put(Util.last(functionID.names), functionID); } } return super.visit(call); } @Override public Void visit(SqlIdentifier identifier) { identifiers.putIfAbsent(identifier.getParserPosition(), identifier); return null; } }); return new Expanded(oriNode, identifiers, funcNameToId); }
Source:
public static ApiResultWrapper makeApiCall(HttpUriRequest clientRequest){ HttpResponse response; String errMsg = ""; int statusCode; String apiResponse = ""; try { response = Utils.executeApiCall(clientRequest); if (response == null) { errMsg = String.format("{\"errorMsg\":\"The request %s failed with errors\"}", clientRequest.getURI().toString()); return new ApiResultWrapper(Utils.API_UNKNOWN_ERROR, errMsg, ""); } statusCode = response.getStatusLine().getStatusCode(); errMsg = "{\"errorMsg\":\"The request %s has failed to extract the response due to %s\"}"; apiResponse = EntityUtils.toString(response.getEntity(), "UTF-8"); } catch (IOException e) { return new ApiResultWrapper(Utils.API_EXCEPTION_ERROR, String.format(errMsg, clientRequest.getURI().toString(), e.getMessage()), ""); } catch (Exception e) { return new ApiResultWrapper(Utils.API_EXCEPTION_ERROR, String.format(errMsg, clientRequest.getURI().toString(), e.getMessage()), ""); } return new ApiResultWrapper(statusCode, "", apiResponse); }

Target:
public static ApiResultWrapper makeApiCall(HttpUriRequest clientRequest){ HttpResponse response; String errMsg = ""; int statusCode; String apiResponse = ""; try { response = Utils.executeApiCall(clientRequest); if (response == null) { errMsg = String.format("{\"errorMsg\":\"The request %s failed with errors\"}", clientRequest.getURI().toString()); return new ApiResultWrapper(Utils.API_UNKNOWN_ERROR, errMsg, ""); } statusCode = response.getStatusLine().getStatusCode(); errMsg = "{\"errorMsg\":\"The request %s has failed to extract the response due to %s\"}"; apiResponse = EntityUtils.toString(response.getEntity(), CONSTANT_UTF_8); } catch (IOException e) { return new ApiResultWrapper(Utils.API_EXCEPTION_ERROR, String.format(errMsg, clientRequest.getURI().toString(), e.getMessage()), ""); } catch (Exception e) { return new ApiResultWrapper(Utils.API_EXCEPTION_ERROR, String.format(errMsg, clientRequest.getURI().toString(), e.getMessage()), ""); } return new ApiResultWrapper(statusCode, "", apiResponse); }
Source:
private boolean isRedirectedToHomePage() { String nextUrl = getRequestParamValue(Const.ParamsNames.NEXT_URL); boolean isHomePageUrl = nextUrl != null && nextUrl.equals(Const.ActionURIs.INSTRUCTOR_HOME_PAGE); return isHomePageUrl; }

Target:
private boolean isRedirectedToHomePage() { String nextUrl = getRequestParamValue(Const.ParamsNames.NEXT_URL); boolean isHomePageUrl = (nextUrl != null && nextUrl.equals(Const.ActionURIs.INSTRUCTOR_HOME_PAGE)); return isHomePageUrl; }
Source:
public PMetaData addTable(PTable table) throws SQLException { Map<String,PTable> tables = Maps.newHashMap(metaData); PTable oldTable = tables.put(table.getName().getString(), table); if (table.getType() == INDEX && table.getParentName() != null) { String parentName = table.getParentName().getString(); PTable parentTable = tables.get(parentName); List<PTable> oldIndexes = parentTable.getIndexes(); List<PTable> newIndexes = Lists.newArrayListWithExpectedSize(oldIndexes.size() + 1); newIndexes.addAll(oldIndexes); if (oldTable != null) { newIndexes.remove(oldTable); } newIndexes.add(table); tables.put(parentName, PTableImpl.makePTable(parentTable, table.getTimeStamp(), newIndexes)); } for (PTable index : table.getIndexes()) { tables.put(index.getName().getString(), index); } return new PMetaDataImpl(tables); }

Target:
public PMetaData addTable(PTable table) throws SQLException { Map<String,PTable> tables = Maps.newHashMap(metaData); PTable oldTable = tables.put(table.getName().getString(), table); if (table.getParentName() != null) { String parentName = table.getParentName().getString(); PTable parentTable = tables.get(parentName); if (parentTable != null) { List<PTable> oldIndexes = parentTable.getIndexes(); List<PTable> newIndexes = Lists.newArrayListWithExpectedSize(oldIndexes.size() + 1); newIndexes.addAll(oldIndexes); if (oldTable != null) { newIndexes.remove(oldTable); } newIndexes.add(table); tables.put(parentName, PTableImpl.makePTable(parentTable, table.getTimeStamp(), newIndexes)); } } for (PTable index : table.getIndexes()) { tables.put(index.getName().getString(), index); } return new PMetaDataImpl(tables); }
Source:
private static <T extends Nameable> List<ClusterEditWarnings.Warning> getProblematicEntities( VDSGroup oldCluster, VDSGroup newCluster, Iterable<ClusterEditChecker<T>> checkers, ClusterEntityResolver<T> entityResolver) { List<ClusterEditWarnings.Warning> warnings = new ArrayList<>(); List<ClusterEditChecker<T>> applicableChecks = stream(checkers.spliterator(), false) .filter(checker -> checker.isApplicable(oldCluster, newCluster)) .collect(toList()); if (!applicableChecks.isEmpty()) { List<T> entities = entityResolver.getClusterEntities(oldCluster); for (ClusterEditChecker<T> checker : applicableChecks) { ClusterEditWarnings.Warning warning = new ClusterEditWarnings.Warning(checker.getMainMessage()); entities.stream().filter(entity -> !checker.check(entity)).forEach(entity -> { warning.getDetailsByName().put(entity.getName(), checker.getDetailMessage(entity)); }); if (!warning.isEmpty()) { warnings.add(warning); } } } return warnings; }

Target:
private static <T extends Nameable> List<ClusterEditWarnings.Warning> getProblematicEntities( VDSGroup oldCluster, VDSGroup newCluster, Iterable<ClusterEditChecker<T>> checkers, ClusterEntityResolver<T> entityResolver) { List<ClusterEditWarnings.Warning> warnings = new ArrayList<>(); List<ClusterEditChecker<T>> applicableChecks = stream(checkers.spliterator(), false) .filter(checker -> checker.isApplicable(oldCluster, newCluster)) .collect(toList()); if (!applicableChecks.isEmpty()) { List<T> entities = entityResolver.getClusterEntities(oldCluster); for (ClusterEditChecker<T> checker : applicableChecks) { ClusterEditWarnings.Warning warning = new ClusterEditWarnings.Warning(checker.getMainMessage()); entities.stream().filter(entity -> !checker.check(entity)).forEach(entity -> warning.getDetailsByName().put(entity.getName(), checker.getDetailMessage(entity))); if (!warning.isEmpty()) { warnings.add(warning); } } } return warnings; }
Source:
public int hashCode() { int result = Objects.hash(tripId, serviceDate); return result; }

Target:
public int hashCode() { int result = Objects.hash(tripId, serviceDate, feedId); return result; }
Source:
public void putFailureTest() throws Exception { RestRequest restRequest = new BadRestRequest(); MockRestResponseChannel restResponseChannel = new MockRestResponseChannel(); responseHandler.reset(); ambryBlobStorageService.handlePut(restRequest, restResponseChannel); Exception e = restResponseChannel.getException(); assertTrue("Unexpected exception", e instanceof RestServiceException); }

Target:
public void putFailureTest() throws Exception { RestRequest restRequest = createRestRequest(RestMethod.PUT, "/", null, null); MockRestResponseChannel restResponseChannel = new MockRestResponseChannel(); try { doOperation(restRequest, restResponseChannel); fail("PUT should have failed because Ambry does not support it"); } catch (RestServiceException e) { assertEquals("PUT is an unsupported method", RestServiceErrorCode.UnsupportedHttpMethod, e.getErrorCode()); } }
Source:
public void init() throws Exception { apiStore = new APIStoreRestClient(storeURL); apiPublisher = new APIPublisherRestClient(publisherURL); createUserWithSubscriberRole(SUBSCRIBER_USERNAME, SUBSCRIBER_PASSWORD, ADMIN_LOGIN_USERNAME, ADMIN_PASSWORD); createUserWithPublisherAndCreatorRole(API_DEVELOPER_USERNAME, API_DEVELOPER_PASSWORD, ADMIN_LOGIN_USERNAME, ADMIN_PASSWORD); apiStore.login(SUBSCRIBER_USERNAME, SUBSCRIBER_PASSWORD); apiPublisher.login(API_DEVELOPER_USERNAME, API_DEVELOPER_PASSWORD); String swaggerFilePath = System.getProperty("framework.resource.location") + "swaggerFiles" + File.separator + "phoneverify-swagger.json"; File swaggerFile = new File(swaggerFilePath); String swaggerContent = readFromFile(swaggerFile.getAbsolutePath()); JSONObject swaggerJson = new JSONObject(swaggerContent); apiPublisher.developSampleAPI(swaggerJson, API_DEVELOPER_USERNAME, backendEndPoint, true, "public"); createApplication(TEST_APPLICATION_NAME); isAPIVisibleInStore(TEST_API_1_NAME, apiStore); SubscriptionRequest subscriptionRequest = new SubscriptionRequest(TEST_API_1_NAME, TEST_API_1_VERSION, API_DEVELOPER_USERNAME, TEST_APPLICATION_NAME, APIMIntegrationConstants.APPLICATION_TIER.UNLIMITED); HttpResponse addSubscriptionResponse = apiStore.subscribe(subscriptionRequest); verifyResponse(addSubscriptionResponse); log.info(TEST_APPLICATION_NAME + " is subscribed to " + TEST_API_1_NAME); accessToken = generateAppKeys(); }

Target:
public void init() throws Exception { apiStore = new APIStoreRestClient(storeURL); apiPublisher = new APIPublisherRestClient(publisherURL); createUserWithSubscriberRole(SUBSCRIBER_USERNAME, SUBSCRIBER_PASSWORD, ADMIN_LOGIN_USERNAME, ADMIN_PASSWORD); createUserWithPublisherAndCreatorRole(API_DEVELOPER_USERNAME, API_DEVELOPER_PASSWORD, ADMIN_LOGIN_USERNAME, ADMIN_PASSWORD); apiStore.login(SUBSCRIBER_USERNAME, SUBSCRIBER_PASSWORD); apiPublisher.login(API_DEVELOPER_USERNAME, API_DEVELOPER_PASSWORD); String swaggerFilePath = System.getProperty("framework.resource.location") + "swaggerFiles" + File.separator + "phoneverify-swagger.json"; File swaggerFile = new File(swaggerFilePath); String swaggerContent = readFromFile(swaggerFile.getAbsolutePath()); JSONObject swaggerJson = new JSONObject(swaggerContent); apiPublisher.developSampleAPI(swaggerJson, API_DEVELOPER_USERNAME, backendEndPoint, true, "public"); createApplication(TEST_APPLICATION_NAME); isAPIVisibleInStore(TEST_API_1_NAME, apiStore); SubscriptionRequest subscriptionRequest = new SubscriptionRequest(TEST_API_1_NAME, TEST_API_1_VERSION, API_DEVELOPER_USERNAME, TEST_APPLICATION_NAME, APIMIntegrationConstants.APPLICATION_TIER.UNLIMITED); HttpResponse addSubscriptionResponse = apiStore.subscribe(subscriptionRequest); verifyResponse(addSubscriptionResponse); if (log.isDebugEnabled()) { log.debug(TEST_APPLICATION_NAME + " is subscribed to " + TEST_API_1_NAME); } accessToken = generateAppKeys(); }
Source:
private <T extends ComputerLauncher> void selectType(Class<T> type) { findCaption(type, new Resolver() { @Override protected void resolve(String caption) { launchMethod.select(caption); } }); }

Target:
private <T extends ComputerLauncher> void selectType(Class<T> type) throws NoSuchElementException { findCaption(type, new Resolver() { @Override protected void resolve(String caption) { launchMethod.select(caption); } }); }
Source:
private Expression readRank(boolean isPercent) { SortAndSlice sortAndSlice = null; read(); readThis(Tokens.OPENBRACKET); readThis(Tokens.CLOSEBRACKET); readThis(Tokens.OVER); readThis(Tokens.OPENBRACKET); List<Expression> partitionByList = new ArrayList<Expression>(); if (token.tokenType == Tokens.PARTITION) { read(); readThis(Tokens.BY); while (true) { Expression e = XreadValueExpression(); partitionByList.add(e); if (token.tokenType == Tokens.COMMA) { read(); continue; } break; } } if (token.tokenType != Tokens.ORDER) { throw unexpectedToken(); } assert(token.tokenType == Tokens.ORDER); read(); readThis(Tokens.BY); sortAndSlice = XreadOrderBy(); readThis(Tokens.CLOSEBRACKET); ExpressionRank erank = new ExpressionRank(sortAndSlice, partitionByList, isPercent); return erank; }

Target:
private Expression readRank(boolean isPercent) { SortAndSlice sortAndSlice = null; read(); readThis(Tokens.OPENBRACKET); readThis(Tokens.CLOSEBRACKET); readThis(Tokens.OVER); readThis(Tokens.OPENBRACKET); List<Expression> partitionByList = new ArrayList<Expression>(); if (token.tokenType == Tokens.PARTITION) { read(); readThis(Tokens.BY); while (true) { Expression e = XreadValueExpression(); partitionByList.add(e); if (token.tokenType == Tokens.COMMA) { read(); continue; } break; } } if (token.tokenType != Tokens.ORDER) { throw unexpectedToken(); } read(); readThis(Tokens.BY); sortAndSlice = XreadOrderBy(); readThis(Tokens.CLOSEBRACKET); ExpressionRank erank = new ExpressionRank(sortAndSlice, partitionByList, isPercent); return erank; }
Source:
public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); mImageGetter = new HttpImageGetter(getActivity()); fillData(); setContentShown(true); mLoadPullRequestsCount = result -> { Log.d("TEST", "getPullRequest onNext called: " + result); View v = getView(); v.findViewById(R.id.issues_progress).setVisibility(View.GONE); v.findViewById(R.id.pull_requests_progress).setVisibility(View.GONE); TextView tvIssuesCount = (TextView) mContentView.findViewById(R.id.tv_issues_count); tvIssuesCount.setText(String.valueOf(mRepository.getOpenIssues() - (Integer) result)); TextView tvPullRequestsCountView = (TextView) v.findViewById(R.id.tv_pull_requests_count); tvPullRequestsCountView.setText(String.valueOf(result)); }; mReadmeConsumer = result -> { Log.d("TEST-RE", "readme flatMap called"); setContentShown(true); TextView readmeView = (TextView) mContentView.findViewById(R.id.readme); View progress = mContentView.findViewById(R.id.pb_readme); if (result != null) mImageGetter.encode(getContext(), mRepository.getId(), String.valueOf(result)); if (result != null) { readmeView.setMovementMethod(UiUtils.CHECKING_LINK_METHOD); mImageGetter.bind(readmeView, String.valueOf(result), mRepository.getId()); } else { readmeView.setText(R.string.repo_no_readme); readmeView.setTypeface(Typeface.DEFAULT, Typeface.ITALIC); } readmeView.setVisibility(View.VISIBLE); progress.setVisibility(View.GONE); }; loadReadme() .compose(RxTools.handle(getActivity(), RepositoryService.LOAD_README)) .subscribe(mReadmeConsumer, e -> { Log.d("TEST-RE", "error readme: " + e); }); loadPullRequestsCount() .compose(RxTools.handle(getActivity(), RepositoryService.LOAD_PULL_REQUESTS_COUNT)) .subscribe(mLoadPullRequestsCount, e -> {}); }

Target:
public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); mImageGetter = new HttpImageGetter(getActivity()); fillData(); setContentShown(true); loadReadme(false); loadPullRequestsCount(false); }
Source:
private boolean isServerInteresting(GerritTriggeredEvent event) { return event.getProvider().getName().equals(serverName); }

Target:
private boolean isServerInteresting(GerritTriggeredEvent event) { Provider provider = initializeProvider(event); return provider.getName().equals(serverName); }
Source:
public MarshallableEntry<K, V> loadEntry(Object key) { String lockingKey = key2Str(key); Connection conn = null; PreparedStatement ps = null; ResultSet rs = null; MarshallableEntry<K, V> storedValue = null; try { String sql = tableManager.getSelectRowSql(); conn = connectionFactory.getConnection(); ps = conn.prepareStatement(sql); ps.setString(1, lockingKey); rs = ps.executeQuery(); if (rs.next()) { InputStream inputStream = rs.getBinaryStream(2); StoreEntry entry = unmarshall(inputStream); storedValue = marshalledEntryFactory.create(key, entry.getValue(), entry.getMetadata(), entry.getCreated(), entry.getLastUsed()); } } catch (SQLException e) { log.sqlFailureReadingKey(key, lockingKey, e); throw new PersistenceException(String.format( "SQL error while fetching stored entry with key: %s, lockingKey: %s", key, lockingKey), e); } finally { JdbcUtil.safeClose(rs); JdbcUtil.safeClose(ps); connectionFactory.releaseConnection(conn); } if (storedValue != null && storedValue.metadata() != null && storedValue.isExpired(timeService.wallClockTime())) { return null; } return storedValue; }

Target:
public MarshallableEntry<K, V> loadEntry(Object key) { String lockingKey = key2Str(key); Connection conn = null; PreparedStatement ps = null; ResultSet rs = null; MarshallableEntry<K, V> entry = null; try { String sql = tableManager.getSelectRowSql(); conn = connectionFactory.getConnection(); ps = conn.prepareStatement(sql); ps.setString(1, lockingKey); rs = ps.executeQuery(); if (rs.next()) { InputStream inputStream = rs.getBinaryStream(2); entry = marshalledEntryFactory.create(key, unmarshall(inputStream)); } } catch (SQLException e) { log.sqlFailureReadingKey(key, lockingKey, e); throw new PersistenceException(String.format( "SQL error while fetching stored entry with key: %s, lockingKey: %s", key, lockingKey), e); } finally { JdbcUtil.safeClose(rs); JdbcUtil.safeClose(ps); connectionFactory.releaseConnection(conn); } if (entry != null && entry.getMetadata() != null && entry.isExpired(timeService.wallClockTime())) { return null; } return entry; }
Source:
public boolean applyTo(Project project) throws FileNotFoundException { final Module[] modules = ModuleManager.getInstance(project).getModules(); for (Module module : modules) { ModuleData data = myData.get(module.getName()); if (data == null) { return false; } AndroidFacet androidFacet = AndroidFacet.getInstance(module); String moduleFilePath = module.getModuleFilePath(); if (androidFacet != null) { if (data.myAndroidProject != null) { File moduleFile = new File(moduleFilePath); assert moduleFile.getParent() != null : moduleFile.getPath(); File moduleRootDirPath = moduleFile.getParentFile(); IdeaAndroidProject ideaAndroidProject = new IdeaAndroidProject(module.getName(), moduleRootDirPath, data.myAndroidProject, data.mySelectedVariant); androidFacet.setIdeaAndroidProject(ideaAndroidProject); } else { return false; } } AndroidGradleFacet gradleFacet = AndroidGradleFacet.getInstance(module); if (gradleFacet != null) { gradleFacet.setGradleProject(data.myIdeaGradleProject); } JavaGradleFacet javaFacet = JavaGradleFacet.getInstance(module); if (javaFacet != null && data.myJavaModel != null) { javaFacet.setJavaModel(data.myJavaModel); } } GradleSyncState syncState = GradleSyncState.getInstance(project); syncState.setLastGradleSyncTimestamp(myLastGradleSyncTimestamp); return true; }

Target:
public boolean applyTo(Project project) { final Module[] modules = ModuleManager.getInstance(project).getModules(); for (Module module : modules) { ModuleData data = myData.get(module.getName()); if (data == null) { return false; } AndroidFacet androidFacet = AndroidFacet.getInstance(module); String moduleFilePath = module.getModuleFilePath(); if (androidFacet != null) { if (data.myAndroidProject != null) { File moduleFile = new File(moduleFilePath); assert moduleFile.getParent() != null : moduleFile.getPath(); File moduleRootDirPath = moduleFile.getParentFile(); IdeaAndroidProject ideaAndroidProject = new IdeaAndroidProject(module.getName(), moduleRootDirPath, data.myAndroidProject, data.mySelectedVariant); androidFacet.setIdeaAndroidProject(ideaAndroidProject); } else { return false; } } AndroidGradleFacet gradleFacet = AndroidGradleFacet.getInstance(module); if (gradleFacet != null) { gradleFacet.setGradleProject(data.myIdeaGradleProject); } JavaGradleFacet javaFacet = JavaGradleFacet.getInstance(module); if (javaFacet != null && data.myJavaModel != null) { javaFacet.setJavaModel(data.myJavaModel); } } GradleSyncState syncState = GradleSyncState.getInstance(project); syncState.setLastGradleSyncTimestamp(myLastGradleSyncTimestamp); return true; }
Source:
public EventBus getEventBus() { return eventBus; }

Target:
protected final EventBus getEventBus() { return eventBus; }
Source:
private void setupLoaders() { final LoaderManager manager = this.getSupportLoaderManager(); Bundle args = new Bundle(4); args.putString("measurementId", measurementId); args.putString("ministryId", ministryId); args.putString("mcc", mcc); args.putString("period", period); manager.initLoader(LOADER_MEASUREMENT_DETAILS, args, measurementDetailsLoaderCallback); }

Target:
private void setupLoaders() { final LoaderManager manager = this.getSupportLoaderManager(); Bundle args = new Bundle(4); args.putString(Constants.ARG_MEASUREMENT_ID, measurementId); args.putString(Constants.ARG_MINISTRY_ID, ministryId); args.putString(Constants.ARG_MCC, mcc); args.putString(Constants.ARG_PERIOD, period); manager.initLoader(LOADER_MEASUREMENT_DETAILS, args, measurementDetailsLoaderCallback); }
Source:
public void bulkImport(Collection<T> items) { User authenticatedUser = new User(); authenticatedUser.setUsername(AuthenticatedRequest.getSpinnakerUser().orElse("anonymous")); if (service instanceof BulkStorageService) { items.forEach( item -> { item.setLastModifiedBy(AuthenticatedRequest.getSpinnakerUser().orElse("anonymous")); item.setLastModified(System.currentTimeMillis()); }); ((BulkStorageService) service).storeObjects(objectType, items); return; } Observable.from(items) .buffer(10) .flatMap( itemSet -> Observable.from(itemSet) .flatMap( item -> { try { return AuthenticatedRequest.propagate( () -> { update(item.getId(), item); return Observable.just(item); }, true, authenticatedUser) .call(); } catch (Exception e) { throw new RuntimeException(e); } }) .subscribeOn(scheduler)) .subscribeOn(scheduler) .toList() .toBlocking() .single(); }

Target:
public void bulkImport(Collection<T> items) { User authenticatedUser = new User(); authenticatedUser.setUsername(AuthenticatedRequest.getSpinnakerUser().orElse("anonymous")); if (service instanceof BulkStorageService) { String lastModifiedBy = AuthenticatedRequest.getSpinnakerUser().orElse("anonymous"); Long lastModified = System.currentTimeMillis(); items.forEach( item -> { item.setLastModifiedBy(lastModifiedBy); item.setLastModified(lastModified); }); ((BulkStorageService) service).storeObjects(objectType, items); return; } Observable.from(items) .buffer(10) .flatMap( itemSet -> Observable.from(itemSet) .flatMap( item -> { try { return AuthenticatedRequest.propagate( () -> { update(item.getId(), item); return Observable.just(item); }, true, authenticatedUser) .call(); } catch (Exception e) { throw new RuntimeException(e); } }) .subscribeOn(scheduler)) .subscribeOn(scheduler) .toList() .toBlocking() .single(); }
Source:
public RequestInfo execute(Context context) { Map<String, Object> params = new HashMap<String, Object>(); params.put("now", new Date()); params.put("owner", ExecutorService.EXECUTOR_ID); RequestInfo request = null; try { org.jbpm.shared.services.impl.JpaPersistenceContext ctx = (org.jbpm.shared.services.impl.JpaPersistenceContext) context; if ("org.jbpm.persistence.jpa.hibernate.DisabledFollowOnLockOracle10gDialect".equals(ctx.get("hibernate.dialect"))) { Object[] lockedRequest = (Object[])ctx.nativeQueryAndLockWithParametersInTransaction("NativePendingRequestsForProcessing", params, true, Object.class); if (lockedRequest != null && lockedRequest.length > 0) { try { request = ctx.find(org.jbpm.executor.entities.RequestInfo.class, ((Number)lockedRequest[0]).longValue()); } catch(NumberFormatException nfe) { } } } else { params.put("firstResult", 0); params.put("maxResults", 1); request = ctx.queryAndLockWithParametersInTransaction("PendingRequestsForProcessing", params, true, RequestInfo.class); } if (request != null) { request.setStatus(STATUS.RUNNING); ((org.jbpm.executor.entities.RequestInfo) request).setTime(new Date()); ctx.merge(request); } } catch (NoResultException e) { } return request; }

Target:
public RequestInfo execute(Context context) { Map<String, Object> params = new HashMap<String, Object>(); params.put("now", new Date()); params.put("owner", ExecutorService.EXECUTOR_ID); RequestInfo request = null; try { org.jbpm.shared.services.impl.JpaPersistenceContext ctx = (org.jbpm.shared.services.impl.JpaPersistenceContext) context; if ("org.jbpm.persistence.jpa.hibernate.DisabledFollowOnLockOracle10gDialect".equals(ctx.get("hibernate.dialect"))) { Object[] lockedRequest = (Object[])ctx.nativeQueryAndLockWithParametersInTransaction("NativePendingRequestsForProcessing", params, true, Object.class); if (lockedRequest != null && lockedRequest.length > 0) { try { request = ctx.find(org.jbpm.executor.entities.RequestInfo.class, ((Number)lockedRequest[0]).longValue()); } catch(NumberFormatException nfe) { logger.error("Error while retrieving request id", nfe); } } } else { params.put("firstResult", 0); params.put("maxResults", 1); request = ctx.queryAndLockWithParametersInTransaction("PendingRequestsForProcessing", params, true, RequestInfo.class); } if (request != null) { request.setStatus(STATUS.RUNNING); ((org.jbpm.executor.entities.RequestInfo) request).setTime(new Date()); ctx.merge(request); } } catch (NoResultException e) { } return request; }
Source:
public void actionPerformed(ActionEvent e) { if (seq != null && seq.getKey() != null) { Iterator<MapillaryAbstractImage> iterator; iterator = seq.getImages().iterator(); if (isSeqDeleted()) { while (iterator.hasNext()) { MapillaryAbstractImage img = iterator.next(); if (img instanceof MapillaryImage) { ((MapillaryImage) img).unmarkDeleted(); } } } else { while (iterator.hasNext()) { MapillaryAbstractImage img = iterator.next(); if (img instanceof MapillaryImage) { ((MapillaryImage) img).markDeleted(); } } } updateText(); MapillaryLayer.getInstance().invalidate(); } }

Target:
public void actionPerformed(ActionEvent e) { if (seq != null && seq.getKey() != null) { if (isSeqDeleted()) { for (MapillaryAbstractImage img : seq.getImages()) { if (img instanceof MapillaryImage) { ((MapillaryImage) img).unmarkDeleted(); } } } else { for (MapillaryAbstractImage img : seq.getImages()) { if (img instanceof MapillaryImage) { ((MapillaryImage) img).unmarkDeleted(); } } } updateText(); MapillaryLayer.getInstance().invalidate(); } }
Source:
public SymmetricHashJoin construct(final ConstructArgs args) { SymmetricHashJoin join = new SymmetricHashJoin( null, null, argColumns1, argColumns2, argSelect1, argSelect2, argSetSemanticsLeft, argSetSemanticsRight, argColumnNames); join.setPullOrder(argOrder); return join; }

Target:
public SymmetricHashJoin construct(final ConstructArgs args) { return new SymmetricHashJoin( null, null, argColumns1, argColumns2, argSelect1, argSelect2, argSetSemanticsLeft, argSetSemanticsRight, argColumnNames, argOrder); }
Source:
public PersistentUpperLimit(TimestampBoundStore tbs, Clock clock, TimestampAllocationFailures allocationFailures) { DebugLogger.logger.info("Creating PersistentUpperLimit object on thread {}. This should only happen once." + " If you are running embedded AtlasDB, this should only happen once." + " If you are using Timelock, this should happen once per client per leadership election", Thread.currentThread().getName()); this.tbs = tbs; this.clock = clock; this.allocationFailures = checkNotNull(allocationFailures); cachedValue = tbs.getUpperLimit(); lastIncreasedTime = clock.getTimeMillis(); }

Target:
public PersistentUpperLimit(TimestampBoundStore tbs, Clock clock, TimestampAllocationFailures allocationFailures) { DebugLogger.logger.info("Creating PersistentUpperLimit object on thread {}." + " If you are running embedded AtlasDB, this should only happen once." + " If you are using Timelock, this should happen once per client per leadership election", Thread.currentThread().getName()); this.tbs = tbs; this.clock = clock; this.allocationFailures = checkNotNull(allocationFailures); cachedValue = tbs.getUpperLimit(); lastIncreasedTime = clock.getTimeMillis(); }
Source:
public static void main(String[] args) { HealthCheck healthCheckHandler = new HealthCheck(); Karyon.forRequestHandler(8888, new RxNettyHandler("/healthcheck", new HealthCheckEndpoint(healthCheckHandler)), new KaryonBootstrapModule(healthCheckHandler), new ArchaiusBootstrapModule("hello-netflix-oss"), Karyon.toBootstrapModule(KaryonWebAdminModule.class), ShutdownModule.asBootstrapModule(), KaryonServoModule.asBootstrapModule(), Karyon.toBootstrapModule(HealthCheckStrategyModule.class) ) .startAndWaitTillShutdown(); }

Target:
public static void main(String[] args) { HealthCheck healthCheckHandler = new HealthCheck(); Karyon.forRequestHandler(8888, new RxNettyHandler("/healthcheck", new HealthCheckEndpoint(healthCheckHandler)), new KaryonBootstrapModule(healthCheckHandler), new ArchaiusBootstrapModule("hello-netflix-oss"), Karyon.toBootstrapModule(KaryonWebAdminModule.class), ShutdownModule.asBootstrapModule(), KaryonServoModule.asBootstrapModule(), Karyon.toBootstrapModule(HealthCheckHandlerModule.class) ) .startAndWaitTillShutdown(); }
Source:
private boolean attributeLineCommentToNodeOrChild(Node node, LineComment lineComment) { if (node.getRange().get().begin.line == lineComment.getRange().get().begin.line && !node.hasComment()) { if (!(node instanceof Comment)) { node.setComment(lineComment); } return true; } else { List<Node> children = new LinkedList<>(); children.addAll(node.getChildNodes()); PositionUtils.sortByBeginPosition(children); Collections.reverse(children); for (Node child : children) { if (attributeLineCommentToNodeOrChild(child, lineComment)) { return true; } } return false; } }

Target:
private boolean attributeLineCommentToNodeOrChild(Node node, LineComment lineComment) { if (node.getBegin().get().line == lineComment.getBegin().get().line && !node.hasComment()) { if (!(node instanceof Comment)) { node.setComment(lineComment); } return true; } else { List<Node> children = new LinkedList<>(); children.addAll(node.getChildNodes()); PositionUtils.sortByBeginPosition(children); Collections.reverse(children); for (Node child : children) { if (attributeLineCommentToNodeOrChild(child, lineComment)) { return true; } } return false; } }
Source:
int findItemIndex(ITimeGraphEntry entry) { Item item = fItemMap.get(entry); if (item == null) { return -1; } return item.fExpandedIndex; }

Target:
public int findItemIndex(ITimeGraphEntry entry) { Item item = fItemMap.get(entry); if (item == null) { return -1; } return item.fExpandedIndex; }
Source:
public void persistBaseline(Map<String, ResourceAssignment> globalBaseline) { _globalBaseline = globalBaseline; HelixProperty combinedAssignments = combineAssignments(BASELINE_KEY, globalBaseline); try { _dataAccessor.compressedBucketWrite(_baselinePath, combinedAssignments); } catch (IOException e) { throw new HelixException("Failed to persist baseline!", e); } }

Target:
public void persistBaseline(Map<String, ResourceAssignment> globalBaseline) { HelixProperty combinedAssignments = combineAssignments(BASELINE_KEY, globalBaseline); try { _dataAccessor.compressedBucketWrite(_baselinePath, combinedAssignments); } catch (IOException e) { throw new HelixException("Failed to persist baseline!", e); } _globalBaseline = globalBaseline; }
Source:
public void select() { log.info("Select view menu with text " + getText()); if (item == null) { mh.select(menuItem); } else { if ((item.getAction().getStyle() == IAction.AS_CHECK_BOX) || (item.getAction().getStyle() == IAction.AS_RADIO_BUTTON)) { Display.syncExec(new Runnable() { @Override public void run() { item.getAction().setChecked(!item.getAction().isChecked()); item.getAction().run(); } }); } else { mh.select(item); } } }

Target:
public void select() { log.info("Select view menu with text " + getText()); if (item == null) { mh.select(menuItem); } else { mh.select(item); } }
Source:
public void reset() { activeLoadId.incrementAndGet(); adapter.clear(); hasMoreItems = true; loading = false; loadMore(); }

Target:
public void reset() { activeLoadId.incrementAndGet(); adapter.clear(); hasMoreItems = true; loading = true; onLoadMore(); }
Source:
ParsedRegistryID(String id) { try { id = URLDecoder.decode(id, StandardCharsets.UTF_8.displayName()); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } List<String> textSegments = Splitter.on('/').omitEmptyStrings().splitToList(id); if (textSegments.get(0).equalsIgnoreCase("#workflow")) { tool = false; registry = textSegments.get(1); organization = textSegments.get(2); name = textSegments.get(3); toolName = textSegments.size() > 4 ? textSegments.get(4) : ""; } else { registry = textSegments.get(0); organization = textSegments.get(1); name = textSegments.get(2); toolName = textSegments.size() > 3 ? textSegments.get(3) : ""; } }

Target:
ParsedRegistryID(String id) { try { id = URLDecoder.decode(id, StandardCharsets.UTF_8.displayName()); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } List<String> textSegments = Splitter.on('/').omitEmptyStrings().splitToList(id); List<String> list = new ArrayList<>(textSegments); if (list.get(0).equalsIgnoreCase("#workflow")) { list.remove(0); tool = false; } registry = list.get(0); organization = list.get(1); name = list.get(2); toolName = list.size() > SEGMENTS_IN_ID ? list.get(SEGMENTS_IN_ID) : ""; }