auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getProcessSource(Process process, OutputStream outputStream) { notNull(process, "process"); try { final File tempFile = createTempFile("processSource", ".zip"); tempFile.deleteOnExit(); final InputStream response = restTemplate.execute(process.getSourceLink(), HttpMethod.GET, noopRequestCallback, new FileResponseExtractor(tempFile)); FileCopyUtils.copy(response, outputStream); } catch (IOException | GoodDataException | RestClientException e) { throw new GoodDataException("Unable to get process source " + process.getSourceLink(), e); } }

Target:
public void getProcessSource(Process process, OutputStream outputStream) { notNull(process, "process"); notNull(outputStream, "outputStream"); try { restTemplate.execute(process.getSourceLink(), HttpMethod.GET, noopRequestCallback, new OutputStreamResponseExtractor(outputStream)); } catch (GoodDataException | RestClientException e) { throw new GoodDataException("Unable to get process source " + process.getSourceLink(), e); } }
Source:
public void markAsRead() { try { synchronized (mSyncLock) { mNoteJSON.put("read", 1); } } catch (JSONException e) { Log.e(TAG, "Unable to update note read property", e); return; } if (getBucket() != null) save(); }

Target:
public void markAsRead() { try { synchronized (mSyncLock) { mNoteJSON.put("read", 1); } } catch (JSONException e) { Log.e(TAG, "Unable to update note read property", e); return; } if (getBucket() != null) { save(); } }
Source:
protected boolean refreshRoot(IWorkspaceRoot target, int depth, boolean updateAliases, IProgressMonitor monitor) throws CoreException { monitor = Policy.monitorFor(monitor); IProject[] projects = target.getProjects(IContainer.INCLUDE_HIDDEN); int totalWork = projects.length; String title = Messages.localstore_refreshingRoot; try { SubMonitor subMonitor = SubMonitor.convert(monitor, title, totalWork); if (depth == IResource.DEPTH_ZERO) return false; boolean changed = false; depth = depth == IResource.DEPTH_ONE ? IResource.DEPTH_ZERO : depth; for (int i = 0; i < projects.length; i++) { changed |= refresh(projects[i], depth, updateAliases, subMonitor.newChild(1)); } return changed; } finally { monitor.done(); } }

Target:
protected boolean refreshRoot(IWorkspaceRoot target, int depth, boolean updateAliases, IProgressMonitor monitor) throws CoreException { IProject[] projects = target.getProjects(IContainer.INCLUDE_HIDDEN); String title = Messages.localstore_refreshingRoot; SubMonitor subMonitor = SubMonitor.convert(monitor, title, projects.length); if (depth == IResource.DEPTH_ZERO) return false; boolean changed = false; depth = depth == IResource.DEPTH_ONE ? IResource.DEPTH_ZERO : depth; for (int i = 0; i < projects.length; i++) { changed |= refresh(projects[i], depth, updateAliases, subMonitor.newChild(1)); } return changed; }
Source:
public final void insertSample(double sample) { int i = index.getAndIncrement(); if (i < numSpot) reservoir[i] = sample; else { int rand_generated = rand.nextInt(i + 2); if (rand_generated < numSpot) { reservoir[rand_generated] = sample; } } }

Target:
public synchronized final void insertSample(double sample) { int i = index.getAndIncrement(); if (i < reservoir.length) reservoir[i] = sample; else { int randGenerated = random.nextInt(i + 2); if (randGenerated < reservoir.length) { reservoir[randGenerated] = sample; } } }
Source:
@Override public int compareTo (DataNodeId o){ if (o == null) { throw new NullPointerException("input argument null"); } DataNode other = (DataNode) o; int compare = (port < other.port) ? -1 : ((port == other.port) ? 0 : 1); if (compare == 0) { compare = hostname.compareTo(other.hostname); } return compare; }

Target:
public int compareTo(DataNodeId o) { if (o == null) { throw new NullPointerException("input argument null"); } DataNode other = (DataNode) o; int compare = (port < other.port) ? -1 : ((port == other.port) ? 0 : 1); if (compare == 0) { compare = hostname.compareTo(other.hostname); } return compare; }
Source:
private int findMaxTabletId(KeyExtent extent, List<Path> recoveryLogs) throws IOException { int tid = -1; try (RecoveryLogsIterator rli = new RecoveryLogsIterator(fs, recoveryLogs, DEFINE_TABLET)) { KeyExtent alternative = extent; if (extent.isRootTablet()) { alternative = RootTable.OLD_EXTENT; } while (rli.hasNext()) { LogFileKey key = rli.next().getKey(); checkState(key.event == DEFINE_TABLET); if (key.tablet.equals(extent) || key.tablet.equals(alternative)) { checkState(key.tid >= 0, "Tid %s for %s is negative", key.tid, extent); checkState(tid == -1 || key.tid >= tid); if (tid != key.tid) { tid = key.tid; } } } } return tid; }

Target:
private int findMaxTabletId(KeyExtent extent, List<Path> recoveryLogs) throws IOException { int tabletId = -1; try (RecoveryLogsIterator rli = new RecoveryLogsIterator(fs, recoveryLogs, minKey(DEFINE_TABLET), maxKey(DEFINE_TABLET))) { KeyExtent alternative = extent; if (extent.isRootTablet()) { alternative = RootTable.OLD_EXTENT; } while (rli.hasNext()) { LogFileKey key = rli.next().getKey(); checkState(key.event == DEFINE_TABLET); if (key.tablet.equals(extent) || key.tablet.equals(alternative)) { checkState(key.tabletId >= 0, "tabletId %s for %s is negative", key.tabletId, extent); checkState(tabletId == -1 || key.tabletId >= tabletId); if (tabletId != key.tabletId) { tabletId = key.tabletId; } } } } return tabletId; }
Source:
public FSRegisteredPackage(FSPackageRegistry registry, FSInstallState installState) throws IOException, RepositoryException { this.installState = installState; this.registry = registry; }

Target:
public FSRegisteredPackage(FSPackageRegistry registry, FSInstallState installState) throws IOException, RepositoryException { this.id = installState.getPackageId(); this.filepath = installState.getFilePath(); this.registry = registry; }
Source:
public boolean writeJobCoordinatorMetadata(JobCoordinatorMetadata metadata) { Preconditions.checkNotNull(metadata, "Job coordinator metadata cannot be null"); boolean writeSucceeded = false; try { String metadataValueString = metadataMapper.writeValueAsString(metadata); metadataStore.put(clusterType, valueSerde.toBytes(metadataValueString)); writeSucceeded = true; } catch (Exception e) { LOG.error("Failed to write the job coordinator metadata to metadata store due to ", e); } LOG.info("Successfully written job coordinator metadata: for cluster {}.", metadata, clusterType); return writeSucceeded; }

Target:
public void writeJobCoordinatorMetadata(JobCoordinatorMetadata metadata) { Preconditions.checkNotNull(metadata, "Job coordinator metadata cannot be null"); try { String metadataValueString = metadataMapper.writeValueAsString(metadata); metadataStore.put(clusterType.name(), valueSerde.toBytes(metadataValueString)); LOG.info("Successfully written job coordinator metadata: for cluster {}.", metadata, clusterType); } catch (Exception e) { LOG.error("Failed to write the job coordinator metadata to metadata store due to ", e); throw new SamzaException("Failed to write the job coordinator metadata.", e); } }
Source:
private static boolean isInvalidDate(final MeasurementVariable var, final String value) { final Date parsedDate = Util.tryParseDate(value, Util.FRONTEND_DATE_FORMAT); final boolean isDateParseable = parsedDate != null; return var.getDataTypeId() != null && var.getDataTypeId() == TermId.DATE_VARIABLE.getId() && !Util.isValidDate(value) && !isDateParseable; }

Target:
private static boolean isInvalidDate(final MeasurementVariable var, final String value) { return var.getDataTypeId() != null && var.getDataTypeId() == TermId.DATE_VARIABLE.getId() && !Util.isValidDate(value); }
Source:
protected Response createFromAppSpec(ApplicationSpec applicationSpec) { checkApplicationTypesAreValid(applicationSpec); checkLocationsAreValid(applicationSpec); List<Location> locations = brooklyn().getLocations(applicationSpec); Application app = brooklyn().create(applicationSpec); Task<?> t = brooklyn().start(app, locations); TaskSummary ts = TaskTransformer.FROM_TASK.apply(t); UriBuilder locationBuilder = uriInfo.getBaseUriBuilder(); locationBuilder = locationBuilder.path(ApplicationApi.class); locationBuilder = locationBuilder.path(ApplicationApi.class, "get"); URI ref = locationBuilder.build(app.getApplicationId()); return created(ref).entity(ts).build(); }

Target:
protected Response createFromAppSpec(ApplicationSpec applicationSpec) { checkApplicationTypesAreValid(applicationSpec); checkLocationsAreValid(applicationSpec); List<Location> locations = brooklyn().getLocations(applicationSpec); Application app = brooklyn().create(applicationSpec); Task<?> t = brooklyn().start(app, locations); TaskSummary ts = TaskTransformer.FROM_TASK.apply(t); URI ref = uriInfo.getBaseUriBuilder() .path(ApplicationApi.class) .path(ApplicationApi.class, "get") .build(app.getApplicationId()); return created(ref).entity(ts).build(); }
Source:
private void updateActionAvailability() { boolean isItemSelected = getSelectedItems() != null && getSelectedItems() != null && getSelectedItems().size() > 0; boolean isDomainActive = getEntity() != null && getEntity().getStorageDomainSharedStatus() == StorageDomainSharedStatus.Active; getImportCommand().setIsExecutionAllowed(isItemSelected && isDomainActive); getRemoveCommand().setIsExecutionAllowed(isItemSelected && isDomainActive); }

Target:
private void updateActionAvailability() { boolean isItemSelected = getSelectedItems() != null && getSelectedItems() != null && getSelectedItems().size() > 0; boolean isDomainActive = getEntity() != null && getEntity().getStorageDomainSharedStatus() == StorageDomainSharedStatus.Active; boolean isExecutionAllowed = isItemSelected && isDomainActive; getImportCommand().setIsExecutionAllowed(isExecutionAllowed); getRemoveCommand().setIsExecutionAllowed(isExecutionAllowed); }
Source:
public void testCatalogServiceDirectory() throws ServiceException, CatalogApiException { final DefaultCatalogService service = new DefaultCatalogService(new CatalogConfig() { @Override public String getCatalogURI() { return "file:catalog/src/test/resources/versionedCatalog"; } }, tenantInternalApi, catalogCache, cacheInvalidationCallback); service.loadCatalog(); Assert.assertNotNull(service.getFullCatalog(internalCallContext)); Assert.assertEquals(service.getFullCatalog(internalCallContext).getCatalogName(), "WeaponsHireSmall"); }

Target:
public void testCatalogServiceDirectory() throws ServiceException, CatalogApiException { final DefaultCatalogService service = new DefaultCatalogService(new CatalogConfig() { @Override public String getCatalogURI() { return "file:src/test/resources/versionedCatalog"; } }, tenantInternalApi, catalogCache, cacheInvalidationCallback); service.loadCatalog(); Assert.assertNotNull(service.getFullCatalog(internalCallContext)); Assert.assertEquals(service.getFullCatalog(internalCallContext).getCatalogName(), "WeaponsHireSmall"); }
Source:
protected void doSetValue(PreparedStatement ps, int parameterPosition, Object argValue) throws SQLException { if (argValue instanceof SqlParameterValue) { SqlParameterValue paramValue = (SqlParameterValue) argValue; if (paramValue.getSqlType() == Types.BLOB) { if (paramValue.getValue() != null) { Assert.isInstanceOf(byte[].class, paramValue.getValue(), "Value of blob parameter must be byte[]"); } byte[] valueBytes = (byte[]) paramValue.getValue(); this.lobCreator.setBlobAsBytes(ps, parameterPosition, valueBytes); } } super.doSetValue(ps, parameterPosition, argValue); }

Target:
protected void doSetValue(PreparedStatement ps, int parameterPosition, Object argValue) throws SQLException { if (argValue instanceof SqlParameterValue) { SqlParameterValue paramValue = (SqlParameterValue) argValue; if (paramValue.getSqlType() == Types.BLOB) { if (paramValue.getValue() != null) { Assert.isInstanceOf(byte[].class, paramValue.getValue(), "Value of blob parameter must be byte[]"); } byte[] valueBytes = (byte[]) paramValue.getValue(); this.lobCreator.setBlobAsBytes(ps, parameterPosition, valueBytes); return; } } super.doSetValue(ps, parameterPosition, argValue); }
Source:
private void checkAssignments(Object data, Set<String> loopVariables, ASTStatement loopBody, boolean checkIncrement, IgnoreFlags... ignoreFlags) { for (ASTAssignmentOperator operator : loopBody.findDescendantsOfType(ASTAssignmentOperator.class)) { final String operatorImage = operator.getImage(); final boolean isIncrement = "+=".equals(operatorImage) || "-=".equals(operatorImage); if (isIncrement != checkIncrement) { continue; } if (ignoreNode(operator, loopBody, ignoreFlags)) { continue; } final ASTPrimaryExpression primaryExpression = operator.jjtGetParent().getFirstChildOfType(ASTPrimaryExpression.class); final ASTName name = primaryExpression.getFirstDescendantOfType(ASTName.class); checkVariable(data, loopVariables, name); } }

Target:
private void checkAssignments(Object data, Set<String> loopVariables, ASTStatement loopBody, boolean checkIncrement, IgnoreFlags... ignoreFlags) { for (ASTAssignmentOperator operator : loopBody.findDescendantsOfType(ASTAssignmentOperator.class)) { final String operatorImage = operator.getImage(); final boolean isIncrement = "+=".equals(operatorImage) || "-=".equals(operatorImage); if (isIncrement != checkIncrement) { continue; } if (ignoreNode(operator, loopBody, ignoreFlags)) { continue; } final ASTPrimaryExpression primaryExpression = operator.jjtGetParent().getFirstChildOfType(ASTPrimaryExpression.class); checkVariable(data, loopVariables, singleVariableName(primaryExpression)); } }
Source:
private int getItemIndex(T item, Stream<T> stream) { Objects.requireNonNull(item, NULL_ITEM_ERROR_MESSAGE); AtomicInteger index = new AtomicInteger(-1); if (!stream.peek(t -> index.incrementAndGet()) .filter(t -> equals(item, t)) .findFirst().isPresent()) { return -1; } return index.get(); }

Target:
private int getItemIndex(T item, Stream<T> stream) { Objects.requireNonNull(item, NULL_ITEM_ERROR_MESSAGE); AtomicInteger index = new AtomicInteger(-1); if (!stream.peek(nextItem -> index.incrementAndGet()) .filter(nextItem -> equals(item, nextItem)) .findFirst().isPresent()) { return -1; } return index.get(); }
Source:
protected void executeCommand() { QuotaDAO dao = DbFacade.getInstance().getQuotaDAO(); dao.remove(getParameters().getQuotaId()); }

Target:
protected void executeCommand() { getQuotaDAO().remove(getParameters().getQuotaId()); }
Source:
public boolean isEnabled() { if (!unstagedViewer.getTree().isFocusControl()) return false; IStructuredSelection selection = getSelection(); if (selection.isEmpty()) return false; for (Object element : selection.toList()) { if (!(element instanceof StagingEntry)) { return false; } StagingEntry entry = (StagingEntry) element; if (!entry.getAvailableActions().contains(StagingEntry.Action.DELETE)) return false; } return true; }

Target:
public boolean isEnabled() { if (!unstagedViewer.getTree().isFocusControl()) return false; IStructuredSelection selection = getSelection(); if (selection.isEmpty()) return false; for (Object element : selection.toList()) { if (!(element instanceof StagingEntry)) return false; StagingEntry entry = (StagingEntry) element; if (!entry.getAvailableActions().contains(StagingEntry.Action.DELETE)) return false; } return true; }
Source:
public void migrate(Handle handle, MigrationContext context) { handle.update( context.newCreateTableBuilder("delayed_sssion_attempts") .addLongIdNoAutoIncrement("id", "references session_attempts (id)") .addLong("dependent_session_id", "") .addLong("next_run_time", "not null") .addTimestamp("updated_at", "not null") .build()); handle.update("create index delayed_sssion_attempts_on_next_run_time on delayed_sssion_attempts (next_run_time)"); }

Target:
public void migrate(Handle handle, MigrationContext context) { handle.update( context.newCreateTableBuilder("delayed_session_attempts") .addLongIdNoAutoIncrement("id", "references session_attempts (id)") .addLong("dependent_session_id", "") .addLong("next_run_time", "not null") .addTimestamp("updated_at", "not null") .build()); handle.update("create index delayed_session_attempts_on_next_run_time on delayed_session_attempts (next_run_time)"); }
Source:
public List<Drug> getDrugs(String drugName, Concept concept, boolean searchOnPhrase, boolean searchDrugConceptNames, boolean includeRetired, Integer start, Integer length) throws DAOException { Criteria searchCriteria = sessionFactory.getCurrentSession().createCriteria(Drug.class, "drug"); searchCriteria.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY); if (StringUtils.isBlank(drugName) && concept == null) return Collections.emptyList(); if (includeRetired == false) searchCriteria.add(Restrictions.eq("drug.retired", false)); if (concept != null) searchCriteria.add(Restrictions.eq("drug.concept", concept)); MatchMode matchMode = MatchMode.START; if (searchOnPhrase) matchMode = MatchMode.ANYWHERE; if (!StringUtils.isBlank(drugName)) { Disjunction searchPhraseDisjunction = Restrictions.disjunction(); searchPhraseDisjunction.add(Restrictions.ilike("drug.name", drugName, matchMode)); if (searchDrugConceptNames) { searchCriteria.createCriteria("concept", "concept").createAlias("concept.names", "names"); searchPhraseDisjunction.add(Restrictions.ilike("names.name", drugName, matchMode)); } searchCriteria.add(searchPhraseDisjunction); } if (start != null) searchCriteria.setFirstResult(start); if (length != null && length > 0) searchCriteria.setMaxResults(length); return searchCriteria.list(); }

Target:
public List<Drug> getDrugs(String drugName, Concept concept, boolean searchOnPhrase, boolean searchDrugConceptNames, boolean includeRetired, Integer start, Integer length) throws DAOException { if (StringUtils.isBlank(drugName) && concept == null) return Collections.emptyList(); Criteria searchCriteria = getSearchCriteria(drugName, concept, searchOnPhrase, searchDrugConceptNames, includeRetired); searchCriteria.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY); if (start != null) searchCriteria.setFirstResult(start); if (length != null && length > 0) searchCriteria.setMaxResults(length); return searchCriteria.list(); }
Source:
private Set<QualifiedTablePrefix> calculatePrefixesWithSchemaName( ConnectorSession connectorSession, TupleDomain<ColumnHandle> constraint, Optional<Predicate<Map<ColumnHandle, NullableValue>>> predicate) { Optional<Set<String>> schemas = filterString(constraint, SCHEMA_COLUMN_HANDLE); if (schemas.isPresent()) { return schemas.get().stream() .map(schema -> schema.toLowerCase(ENGLISH)) .map(schema -> new QualifiedTablePrefix(catalogName, schema)) .collect(toImmutableSet()); } Session session = ((FullConnectorSession) connectorSession).getSession(); return metadata.listSchemaNames(session, catalogName).stream() .filter(schema -> !predicate.isPresent() || predicate.get().test(schemaAsFixedValues(schema))) .map(schema -> new QualifiedTablePrefix(catalogName, schema)) .collect(toImmutableSet()); }

Target:
private Set<QualifiedTablePrefix> calculatePrefixesWithSchemaName( ConnectorSession connectorSession, TupleDomain<ColumnHandle> constraint, Optional<Predicate<Map<ColumnHandle, NullableValue>>> predicate) { Optional<Set<String>> schemas = filterString(constraint, SCHEMA_COLUMN_HANDLE); if (schemas.isPresent()) { return schemas.get().stream() .filter(this::isLowerCase) .map(schema -> new QualifiedTablePrefix(catalogName, schema)) .collect(toImmutableSet()); } Session session = ((FullConnectorSession) connectorSession).getSession(); return metadata.listSchemaNames(session, catalogName).stream() .filter(schema -> !predicate.isPresent() || predicate.get().test(schemaAsFixedValues(schema))) .map(schema -> new QualifiedTablePrefix(catalogName, schema)) .collect(toImmutableSet()); }
Source:
public Response toResponse(MalformedIdException exception) { log.error( "Malformed id detected while processing \"{}\" request for path \"{}\"", request.getMethod(), uriInfo.getPath() ); log.error("Exception", exception); final Fault fault = new Fault(); fault.setReason("Operation Failed"); fault.setDetail(exception.getCause().getMessage()); return Response.status(Status.BAD_REQUEST).entity(fault).build(); }

Target:
public Response toResponse(MalformedIdException exception) { log.error( "Malformed id detected while processing \"{}\" request for path \"{}\"", request.getMethod(), uriInfo.getPath() ); log.error("Exception", exception); final Fault fault = new Fault(); fault.setReason("Operation failed"); fault.setDetail(exception.getCause().getMessage()); return Response.status(Status.BAD_REQUEST).entity(fault).build(); }
Source:
private Map<IFile, IEditorReference> findAllEditorReferences() { IEditorReference[] editorReferences = activePage.getEditorReferences(); Map<IFile, IEditorReference> fileEditors = new HashMap<>(); for (IEditorReference editorReference : editorReferences) { try { IEditorInput editorInput = editorReference.getEditorInput(); if (editorInput instanceof IFileEditorInput) { IFileEditorInput fileEditorInput = (IFileEditorInput) editorInput; IFile file = fileEditorInput.getFile(); fileEditors.put(file, editorReference); } } catch (PartInitException e) { e.printStackTrace(); } } return fileEditors; }

Target:
private Map<IFile, IEditorReference> findAllEditorReferences() { IEditorReference[] editorReferences = activePage.getEditorReferences(); Map<IFile, IEditorReference> fileEditors = new HashMap<>(); for (IEditorReference editorReference : editorReferences) { try { IEditorInput editorInput = editorReference.getEditorInput(); if (editorInput instanceof IFileEditorInput) { IFileEditorInput fileEditorInput = (IFileEditorInput) editorInput; IFile file = fileEditorInput.getFile(); fileEditors.put(file, editorReference); } } catch (PartInitException e) { Activator.logError("PartInitException - should not happen", e); } } return fileEditors; }
Source:
public static void assertEqualsIgnoreOrder(Iterable<?> actual, Iterable<?> expected, String message) { assertNotNull(actual, "actual is null"); assertNotNull(expected, "expected is null"); ImmutableMultiset<?> actualSet = ImmutableMultiset.copyOf(actual); ImmutableMultiset<?> expectedSet = ImmutableMultiset.copyOf(expected); if (!actualSet.equals(expectedSet)) { Multiset<?> actualDiff = Multisets.difference(actualSet, expectedSet); Multiset<?> expectedDiff = Multisets.difference(expectedSet, actualSet); int limit = 100; fail(format( "%snot equal\n" + "Actual %s rows (only up to %s differing rows shown):\n %s\n" + "Expected %s rows (only up to %s differing rows shown):\n %s\n", message == null ? "" : (message + "\n"), actualSet.size(), limit, Joiner.on("\n ").join(Iterables.limit(actualDiff, limit)), expectedSet.size(), limit, Joiner.on("\n ").join(Iterables.limit(expectedDiff, limit)))); } }

Target:
public static void assertEqualsIgnoreOrder(Iterable<?> actual, Iterable<?> expected, String message) { assertNotNull(actual, "actual is null"); assertNotNull(expected, "expected is null"); ImmutableMultiset<?> actualSet = ImmutableMultiset.copyOf(actual); ImmutableMultiset<?> expectedSet = ImmutableMultiset.copyOf(expected); if (!actualSet.equals(expectedSet)) { Multiset<?> unexpectedRows = Multisets.difference(actualSet, expectedSet); Multiset<?> missingRows = Multisets.difference(expectedSet, actualSet); int limit = 100; fail(format( "%snot equal\n" + "Actual rows (up to %s of %s extra rows shown, %s matching and extra rows in total):\n %s\n" + "Expected rows (up to %s of %s missing rows shown, %s matching and missing rows in total):\n %s\n", message == null ? "" : (message + "\n"), limit, unexpectedRows.size(), actualSet.size(), Joiner.on("\n ").join(Iterables.limit(unexpectedRows, limit)), limit, missingRows.size(), expectedSet.size(), Joiner.on("\n ").join(Iterables.limit(missingRows, limit)))); } }
Source:
public void setTaskScheduler(TaskScheduler taskScheduler) { Assert.notNull(taskScheduler, "taskScheduler must not be null"); this.taskScheduler = taskScheduler; }

Target:
protected void setTaskScheduler(TaskScheduler taskScheduler) { Assert.notNull(taskScheduler, "taskScheduler must not be null"); this.taskScheduler = taskScheduler; }
Source:
public JavaRDD<StructuredRecord> transform( SparkExecutionPluginContext sparkExecutionPluginContext, JavaRDD<StructuredRecord> javaRDD) throws Exception { StorageLevel storageLevel = config.getStorageLevel(); if (storageLevel == StorageLevel.NONE()) { throw new RuntimeException(String.format("Invalid storage level '%s'. Please select a valid value")); } javaRDD.persist(storageLevel); return javaRDD; }

Target:
public JavaRDD<StructuredRecord> transform(SparkExecutionPluginContext sparkExecutionPluginContext, JavaRDD<StructuredRecord> javaRDD) throws Exception { StorageLevel storageLevel = StorageLevel.MEMORY_AND_DISK(); if (config.storageLevel.isEmpty()) { StorageLevel.fromString(config.storageLevel); } if (storageLevel == StorageLevel.NONE()) { throw new RuntimeException( String.format("Invalid storage level '%s'. Please select a valid value", config.storageLevel)); } javaRDD.persist(storageLevel); return javaRDD; }
Source:
private Set<EObject> getSemanticElementsToDestroy(final DDiagramElement currentDiagramElement) { Set<EObject> elementsToDestroy = Sets.newLinkedHashSet(); return appendSemanticElementsToDestroy(currentDiagramElement, elementsToDestroy) ? elementsToDestroy : null; }

Target:
private Set<EObject> getSemanticElementsToDestroy(final DDiagramElement currentDiagramElement) { Set<EObject> elementsToDestroy = Sets.newLinkedHashSet(); boolean canDelete = appendSemanticElementsToDestroy(currentDiagramElement, elementsToDestroy); return canDelete ? elementsToDestroy : null; }
Source:
private static java.net.HttpURLConnection createDefaultConnection(String url, RequestOptions options) throws IOException { URL lobURL = new URL(url); HttpURLConnection conn = (HttpURLConnection) (options.getProxy() == null ? lobURL.openConnection() : lobURL.openConnection(options.getProxy())); conn.setUseCaches(false); for (Map.Entry<String, String> header : getHeaders(options).entrySet()) { conn.setRequestProperty(header.getKey(), header.getValue()); } return conn; }

Target:
private static java.net.HttpURLConnection createDefaultConnection(String url, RequestOptions options) throws IOException { URL lobURL = new URL(url); HttpURLConnection conn = (HttpURLConnection) (options.getProxy() ? lobURL.openConnection(options.getProxy()) : lobURL.openConnection()); conn.setUseCaches(false); for (Map.Entry<String, String> header : getHeaders(options).entrySet()) { conn.setRequestProperty(header.getKey(), header.getValue()); } return conn; }
Source:
public OpenSshCertificate loadCertificate(SessionContext session, String keyType) throws IOException, GeneralSecurityException { return StreamSupport.stream(loadCertificates(session).spliterator(), false) .filter(pubKey -> pubKey.getKeyType().equals(keyType)) .findFirst().orElse(null); }

Target:
public OpenSshCertificate loadCertificate(SessionContext session, String keyType) throws IOException, GeneralSecurityException { return StreamSupport.stream(loadCertificates(session).spliterator(), false) .filter(pubKey -> Objects.equals(pubKey.getKeyType(), keyType)) .findFirst().orElse(null); }
Source:
@Test public void invalidClientAuthEvents() throws Throwable { server.enqueue(new MockResponse().setBody("abc")); clientCert = new HeldCertificate.Builder() .signedBy(clientIntermediateCa) .serialNumber(4L) .commonName("Jethro Willis") .addSubjectAlternativeName("jethrowillis.com") .validityInterval(1, 2) .build(); OkHttpClient client = buildClient(clientCert, clientIntermediateCa.certificate()); RecordingEventListener listener = new RecordingEventListener(); client = client.newBuilder() .eventListener(listener) .build(); SSLSocketFactory socketFactory = buildServerSslSocketFactory(); server.useHttps(socketFactory, false); server.requireClientAuth(); Call call = client.newCall(new Request.Builder().url(server.url("/")).build()); try { call.execute(); fail(); } catch (IOException expected) { } assertEquals(asList( "CallStart", "ProxySelectStart", "ProxySelectEnd", "DnsStart", "DnsEnd", "ConnectStart", "SecureConnectStart", "SecureConnectEnd", "ConnectFailed", "CallFailed" ), listener.recordedEventTypes()); }

Target:
@Test public void invalidClientAuthEvents() throws Throwable { server.enqueue(new MockResponse().setBody("abc")); clientCert = new HeldCertificate.Builder() .signedBy(clientIntermediateCa) .serialNumber(4L) .commonName("Jethro Willis") .addSubjectAlternativeName("jethrowillis.com") .validityInterval(1, 2) .build(); OkHttpClient client = buildClient(clientCert, clientIntermediateCa.certificate()); RecordingEventListener listener = new RecordingEventListener(); client = client.newBuilder() .eventListener(listener) .build(); SSLSocketFactory socketFactory = buildServerSslSocketFactory(); server.useHttps(socketFactory, false); server.requireClientAuth(); Call call = client.newCall(new Request.Builder().url(server.url("/")).build()); try { call.execute(); fail(); } catch (IOException expected) { } List<String> recordedEventTypes = listener.recordedEventTypes(); assertThat(recordedEventTypes).startsWith( "CallStart", "ProxySelectStart", "ProxySelectEnd", "DnsStart", "DnsEnd", "ConnectStart", "SecureConnectStart"); assertThat(recordedEventTypes).endsWith("CallFailed"); }
Source:
private void generateClassEquals(String className, StructSpec struct, boolean elementKeysAreEqual) { buffer.printf("@Override%n"); buffer.printf("public boolean %s(Object obj) {%n", elementKeysAreEqual ? "elementKeysAreEqual" : "equals"); buffer.incrementIndent(); buffer.printf("if (!(obj instanceof %s)) return false;%n", className); if (!struct.fields().isEmpty()) { buffer.printf("%s other = (%s) obj;%n", className, className); for (FieldSpec field : struct.fields()) { if ((!elementKeysAreEqual) || field.mapKey()) { generateFieldEquals(field); } } } buffer.printf("return true;%n"); buffer.decrementIndent(); buffer.printf("}%n"); }

Target:
private void generateClassEquals(String className, StructSpec struct, boolean elementKeysAreEqual) { buffer.printf("@Override%n"); buffer.printf("public boolean %s(Object obj) {%n", elementKeysAreEqual ? "elementKeysAreEqual" : "equals"); buffer.incrementIndent(); buffer.printf("if (!(obj instanceof %s)) return false;%n", className); if (!struct.fields().isEmpty()) { buffer.printf("%s other = (%s) obj;%n", className, className); for (FieldSpec field : struct.fields()) { if (!elementKeysAreEqual || field.mapKey()) { generateFieldEquals(field); } } } buffer.printf("return true;%n"); buffer.decrementIndent(); buffer.printf("}%n"); }
Source:
protected void doWakeUp() { IJobManager jobManager = Job.getJobManager(); jobManager.wakeUp(TestJob.FAMILY_TEST_JOB); }

Target:
protected void doWakeUp() { Job.getJobManager().wakeUp(TestJob.FAMILY_TEST_JOB); }
Source:
protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); try { outState.putInt("tab", mPager.getCurrentItem()); }catch (NoClassDefFoundError e){ Log.w(TAG, "Busgnag is unsupported when building from Eclipse", e); } }

Target:
protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); try { outState.putInt("tab", mPager.getCurrentItem()); }catch (NoClassDefFoundError e){ Log.w(TAG, "Failing to get current page "); e.printStackTrace(); } }
Source:
public void testImport() { testModules( "import name from 'other'; use(name);", LINE_JOINER.join("goog.require('module$other');", "use(module$other.default);")); testModules("import {n as name} from 'other';", "goog.require('module$other');"); testModules( "import x, {f as foo, b as bar} from 'other'; use(x);", LINE_JOINER.join("goog.require('module$other');", "use(module$other.default);")); testModules( "import {default as name} from 'other'; use(name);", LINE_JOINER.join("goog.require('module$other');", "use(module$other.default);")); }

Target:
public void testImport() { testModules( "import name from 'other'; use(name);", "goog.require('module$other'); use(module$other.default);"); testModules("import {n as name} from 'other';", "goog.require('module$other');"); testModules( "import x, {f as foo, b as bar} from 'other'; use(x);", "goog.require('module$other'); use(module$other.default);"); testModules( "import {default as name} from 'other'; use(name);", "goog.require('module$other'); use(module$other.default);"); testModules( "import {class as name} from 'other'; use(name);", "goog.require('module$other'); use(module$other.class);"); }
Source:
public CompletableFuture<Void> initiate() { ReadLastConfirmedOp rlcop = new ReadLastConfirmedOp(lh, clientCtx.getBookieClient(), lh.getCurrentEnsemble(), new ReadLastConfirmedOp.LastConfirmedDataCallback() { public void readLastConfirmedDataComplete(int rc, RecoveryData data) { if (rc == BKException.Code.OK) { synchronized (lh) { lh.lastAddPushed = lh.lastAddConfirmed = data.getLastAddConfirmed(); lh.length = data.getLength(); lh.pendingAddsSequenceHead = lh.lastAddConfirmed; startEntryToRead = endEntryToRead = lh.lastAddConfirmed; } metadataForRecovery = new LedgerMetadata(lh.getLedgerMetadata()); doRecoveryRead(); } else if (rc == BKException.Code.UnauthorizedAccessException) { submitCallback(rc); } else { submitCallback(BKException.Code.ReadException); } } }); rlcop.initiateWithFencing(); return promise; }

Target:
public CompletableFuture<LedgerHandle> initiate() { ReadLastConfirmedOp rlcop = new ReadLastConfirmedOp(lh, clientCtx.getBookieClient(), lh.getCurrentEnsemble(), new ReadLastConfirmedOp.LastConfirmedDataCallback() { public void readLastConfirmedDataComplete(int rc, RecoveryData data) { if (rc == BKException.Code.OK) { synchronized (lh) { lh.lastAddPushed = lh.lastAddConfirmed = data.getLastAddConfirmed(); lh.length = data.getLength(); lh.pendingAddsSequenceHead = lh.lastAddConfirmed; startEntryToRead = endEntryToRead = lh.lastAddConfirmed; } metadataForRecovery = new LedgerMetadata(lh.getLedgerMetadata()); doRecoveryRead(); } else if (rc == BKException.Code.UnauthorizedAccessException) { submitCallback(rc); } else { submitCallback(BKException.Code.ReadException); } } }); rlcop.initiateWithFencing(); return promise; }
Source:
private String buildCustomizedRelation(final boolean caseSensitive, IConditionFieldAutoCompleter conditionFieldAC, IConditionValueAutoCompleter conditionValueAC, String fieldName, SyntaxObject previous, SyntaxObjectType prevType) { String customizedRelation; if (prevType != SyntaxObjectType.CONDITION_RELATION) { customizedRelation = "="; } else { customizedRelation = previous.getBody(); } if(conditionValueAC == null && ("".equals(fieldName) || String.class.equals(conditionFieldAC.getDbFieldType(fieldName)))) { if ("=".equals(customizedRelation)) { customizedRelation = BaseConditionFieldAutoCompleter.getLikeSyntax(caseSensitive); } else if ("!=".equals(customizedRelation)) { customizedRelation = "NOT " + BaseConditionFieldAutoCompleter.getLikeSyntax(caseSensitive); } } return customizedRelation; }

Target:
private String buildCustomizedRelation(final boolean caseSensitive, IConditionFieldAutoCompleter conditionFieldAC, IConditionValueAutoCompleter conditionValueAC, String fieldName, SyntaxObject previous, SyntaxObjectType prevType) { String customizedRelation = "="; if (prevType == SyntaxObjectType.CONDITION_RELATION) { customizedRelation = previous.getBody(); } if(conditionValueAC == null && ("".equals(fieldName) || String.class.equals(conditionFieldAC.getDbFieldType(fieldName)))) { if ("=".equals(customizedRelation)) { customizedRelation = BaseConditionFieldAutoCompleter.getLikeSyntax(caseSensitive); } else if ("!=".equals(customizedRelation)) { customizedRelation = "NOT " + BaseConditionFieldAutoCompleter.getLikeSyntax(caseSensitive); } } return customizedRelation; }
Source:
private static void executeCopyTask(TableReference srcTable, TableReference dstTable, CopyStats stats, CopyTask task, MutableRange range) throws InterruptedException { final RangeRequest request = range.getRangeRequest(); long startTime = System.currentTimeMillis(); PartialCopyStats partialStats = task.call(request, range); stats.rowsCopied.addAndGet(partialStats.rowsCopied); stats.cellsCopied.addAndGet(partialStats.cellsCopied); log.info("Copied rows, cells from to in ms.", partialStats.rowsCopied, partialStats.cellsCopied, srcTable, dstTable, System.currentTimeMillis() - startTime); }

Target:
private static void executeCopyTask(TableReference srcTable, TableReference dstTable, CopyStats stats, CopyTask task, MutableRange range) throws InterruptedException { long startTime = System.currentTimeMillis(); PartialCopyStats partialStats = task.call(range.getRangeRequest(), range); stats.rowsCopied.addAndGet(partialStats.rowsCopied); stats.cellsCopied.addAndGet(partialStats.cellsCopied); log.info("Copied rows, cells from to in ms.", SafeArg.of("rowsCopied", partialStats.rowsCopied), SafeArg.of("cellsCopied", partialStats.cellsCopied), LoggingArgs.tableRef("srcTable", srcTable), LoggingArgs.tableRef("dstTable", dstTable), SafeArg.of("timeTaken", System.currentTimeMillis() - startTime)); }
Source:
private Boolean shouldLogMultiPart() { return parseBoolean(System.getProperty(CLIENT_LOGGING_LOG_MULTIPART, "false")); }

Target:
private Boolean shouldLogMultiPart() { return Boolean.getBoolean(CLIENT_LOGGING_LOG_MULTIPART); }
Source:
public Object[][] createData() { if(System.getProperty("os.name").contains("indows")) return new Object[][] { { "normal" } }; else return new Object[][] { { "normal" }, { "sp ace" }, { "qu?stion" }, { "unic₪de" }, { "path/foo" }, { "colon:" }, { "asteri*k" }, { "quote\"" }, { "{great<r}" }, { "lesst>en" }, { "p|pe" } }; }

Target:
public Object[][] createData() { if (System.getProperty("os.name").toLowerCase().contains("windows")) { return new Object[][] { { "normal" }, { "sp ace" } }; } else { return new Object[][] { { "normal" }, { "sp ace" }, { "qu?stion" }, { "unic₪de" }, { "path/foo" }, { "colon:" }, { "asteri*k" }, { "quote\"" }, { "{great<r}" }, { "lesst>en" }, { "p|pe" } }; } }
Source:
public void postProcessPersistenceUnitInfo() { MutablePersistenceUnitInfo persistenceUnitInfo = new MutablePersistenceUnitInfo(); TaskAssigningPersistenceUnitPostProcessor processor = new TaskAssigningPersistenceUnitPostProcessor(); processor.postProcessPersistenceUnitInfo(persistenceUnitInfo); assertTrue(persistenceUnitInfo.getManagedClassNames().contains(PlanningTaskImpl.class.getName())); }

Target:
public void postProcessPersistenceUnitInfo() { MutablePersistenceUnitInfo persistenceUnitInfo = new MutablePersistenceUnitInfo(); TaskAssigningPersistenceUnitPostProcessor processor = new TaskAssigningPersistenceUnitPostProcessor(); processor.postProcessPersistenceUnitInfo(persistenceUnitInfo); assertTrue("Class: " + PlanningTaskImpl.class.getName() + " is expected to have been added as managed class.", persistenceUnitInfo.getManagedClassNames().contains(PlanningTaskImpl.class.getName())); }
Source:
@Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if (response instanceof HttpServletResponse) { HttpServletResponse r = (HttpServletResponse) response; r.addHeader("X-Content-Security-Policy", "default-src 'self'"); r.addHeader(HttpHeaders.X_XSS_PROTECTION, "0"); r.addHeader(HttpHeaders.X_CONTENT_TYPE_OPTIONS, "nosniff"); r.addHeader("Frame-Options", "DENY"); r.addHeader(HttpHeaders.X_FRAME_OPTIONS, "DENY"); r.addHeader(HttpHeaders.STRICT_TRANSPORT_SECURITY, format("max-age=%d; includeSubDomains", YEAR_OF_SECONDS)); chain.doFilter(request, response); } }

Target:
@Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if (response instanceof HttpServletResponse) { HttpServletResponse r = (HttpServletResponse) response; r.addHeader("X-Content-Security-Policy", "default-src 'self'"); r.addHeader(HttpHeaders.X_XSS_PROTECTION, "0"); r.addHeader(HttpHeaders.X_CONTENT_TYPE_OPTIONS, "nosniff"); r.addHeader("Frame-Options", "DENY"); r.addHeader(HttpHeaders.X_FRAME_OPTIONS, "DENY"); r.addHeader(HttpHeaders.STRICT_TRANSPORT_SECURITY, format("max-age=%d; includeSubDomains", YEAR_OF_SECONDS)); } chain.doFilter(request, response); }
Source:
private void applyNumberOfNames() { String numOfNamesPerGroup = namesPerGroup.getText().toString(); int inputtedNumber = numOfNamesPerGroup.isEmpty() ? 0 : Integer.parseInt(namesPerGroup.getText().toString()); if (inputtedNumber <= 0) { namesPerGroup.setText(R.string.default_number_of_names_per_group); settings.setNumOfNamesPerGroup(context.getResources().getInteger(R.integer.default_number_of_names_per_group)); } else { namesPerGroup.setText(String.valueOf(inputtedNumber)); settings.setNumOfNamesPerGroup(inputtedNumber); } namesPerGroup.clearFocus(); }

Target:
private void applyNumberOfNames() { String numOfNamesPerGroup = namesPerGroup.getText().toString(); int inputtedNumber = numOfNamesPerGroup.isEmpty() ? 0 : Integer.parseInt(namesPerGroup.getText().toString()); if (inputtedNumber <= 0) { namesPerGroup.setText(R.string.default_number_of_names_per_group); settings.setNumOfNamesPerGroup(settings.getNumOfNamesPerGroup()); } else { namesPerGroup.setText(String.valueOf(inputtedNumber)); settings.setNumOfNamesPerGroup(inputtedNumber); } namesPerGroup.clearFocus(); }
Source:
public void start(Stage primaryStage) throws Exception { primaryStage.setTitle(DNAINATOR); primaryStage.getIcons().add(new Image(getClass().getResourceAsStream(ICON))); primaryStage.setMinWidth(MIN_WIDTH); primaryStage.setMinHeight(MIN_HEIGHT); try { BorderPane rootLayout = FXMLLoader.load(getClass().getResource(FXML)); Scene scene = new Scene(rootLayout, getScreenWidth(), getScreenHeight()); primaryStage.setScene(scene); } catch (IOException e) { e.printStackTrace(); } primaryStage.show(); }

Target:
public void start(Stage primaryStage) throws Exception { primaryStage.setTitle(DNAINATOR); primaryStage.getIcons().add(new Image(getClass().getResourceAsStream(ICON))); try { BorderPane rootLayout = FXMLLoader.load(getClass().getResource(FXML)); Scene scene = new Scene(rootLayout, getScreenWidth(), getScreenHeight()); primaryStage.setScene(scene); } catch (IOException e) { e.printStackTrace(); } primaryStage.show(); }
Source:
static void call(final Button b, final String project) { b.setEnabled(false); ChangeApi.createChange(project, "refs/meta/config", Util.C.editConfigMessage(), null, new GerritCallback<ChangeInfo>() { @Override public void onSuccess(ChangeInfo result) { Gerrit.display(Dispatcher.toEditScreen( new PatchSet.Id(result.legacy_id(), 1), "project.config")); } @Override public void onFailure(Throwable caught) { b.setEnabled(true); super.onFailure(caught); } }); }

Target:
static void call(final Button b, final String project) { b.setEnabled(false); ChangeApi.createChange(project, RefNames.REFS_CONFIG, Util.C.editConfigMessage(), null, new GerritCallback<ChangeInfo>() { @Override public void onSuccess(ChangeInfo result) { Gerrit.display(Dispatcher.toEditScreen( new PatchSet.Id(result.legacy_id(), 1), "project.config")); } @Override public void onFailure(Throwable caught) { b.setEnabled(true); super.onFailure(caught); } }); }
Source:
public Collection<IAEItemStack> findFuzzy( IAEItemStack filter, FuzzyMode fuzzy ) { throw new UnsupportedOperationException(); }

Target:
public Collection<IAEItemStack> findFuzzy( IAEItemStack filter, FuzzyMode fuzzy ) { throw new UnsupportedOperationException( "Unsupported on an unsorted collection" ); }
Source:
public UUID getLastOwner(String warp) throws WarpNotFoundException, InvalidWorldException { EssentialsConf conf = warpPoints.get(new StringIgnoreCase(warp)); if (conf == null) { throw new WarpNotFoundException(); } UUID uuid = null; try { uuid = UUID.fromString(conf.getString("lastowner")); } catch (Exception ex) return uuid; }

Target:
public UUID getLastOwner(String warp) throws WarpNotFoundException { EssentialsConf conf = warpPoints.get(new StringIgnoreCase(warp)); if (conf == null) { throw new WarpNotFoundException(); } UUID uuid = null; try { uuid = UUID.fromString(conf.getString("lastowner")); } catch (Exception ex) return uuid; }
Source:
private static Long getLongValue(NamedNodeMap attrs, String attr) { return Math.round(Double.valueOf(attrs.getNamedItem(attr).getTextContent())); }

Target:
private static Long getLongValue(NamedNodeMap attrs, String attr) { String content = attrs.getNamedItem(attr).getTextContent(); try { return Math.round(Double.valueOf(content)); } catch (NumberFormatException e) { throw new IllegalStateException(content + " is not a valid coverage number", e); } }
Source:
public static void copyOldItemData(DispoItem sourceItem, DispoItemData destItem, OperationReport report) throws JSONException { StringBuilder message = new StringBuilder(); JSONObject destItemDiscrepancies = destItem.getDiscrepanciesList(); JSONArray sourceAnnotations = sourceItem.getAnnotationsList(); Boolean needsReview = false; HashMap<String, Integer> idsToUpdate = matchupOldDiscrepancies(sourceItem.getDiscrepanciesList(), destItemDiscrepancies, sourceAnnotations, message, needsReview); updateTestPointNumbersForAnntations(idsToUpdate, sourceAnnotations, destItemDiscrepancies, message); destItem.setAnnotationsList(sourceAnnotations); if(needsReview) { report.add } report.addMessageForItem(destItem.getName(), message.toString()); }

Target:
public static void copyOldItemData(DispoItem sourceItem, DispoItemData destItem, OperationReport report) throws JSONException { StringBuilder message = new StringBuilder(); JSONObject destItemDiscrepancies = destItem.getDiscrepanciesList(); JSONArray sourceAnnotations = sourceItem.getAnnotationsList(); Boolean needsReview = false; HashMap<String, Integer> idsToUpdate = matchupOldDiscrepancies(sourceItem.getDiscrepanciesList(), destItemDiscrepancies, sourceAnnotations, message, needsReview); updateTestPointNumbersForAnntations(idsToUpdate, sourceAnnotations, destItemDiscrepancies, message); destItem.setAnnotationsList(sourceAnnotations); report.addMessageForItem(destItem.getName(), message.toString()); }
Source:
private Table updatePropertiesInTable(Table table, ReplicationSpec additionalPropertiesProvider) { Map<String, String> parameters = table.getParameters(); if (parameters != null) { Map<String, String> tmpParameters = new HashMap<>(parameters); tmpParameters.entrySet() .removeIf(e -> e.getKey().equals(ReplUtils.REPL_CHECKPOINT_KEY)); table.setParameters(tmpParameters); } if (additionalPropertiesProvider.isInReplicationScope()) { if (additionalPropertiesProvider.getReplSpecType() != ReplicationSpec.Type.INCREMENTAL_DUMP) { table.putToParameters( ReplicationSpec.KEY.CURR_STATE_ID.toString(), additionalPropertiesProvider.getCurrentReplicationState()); } if (isExternalTable(table)) { table.putToParameters("EXTERNAL", "FALSE"); } if (isExternalTableType(table)) { table.setTableType(TableType.MANAGED_TABLE.toString()); } } else { } return table; }

Target:
private Table updatePropertiesInTable(Table table, ReplicationSpec additionalPropertiesProvider) { Map<String, String> parameters = table.getParameters(); if (parameters != null) { parameters.entrySet() .removeIf(e -> e.getKey().equals(ReplUtils.REPL_CHECKPOINT_KEY)); } if (additionalPropertiesProvider.isInReplicationScope()) { if (additionalPropertiesProvider.getReplSpecType() != ReplicationSpec.Type.INCREMENTAL_DUMP) { table.putToParameters( ReplicationSpec.KEY.CURR_STATE_ID.toString(), additionalPropertiesProvider.getCurrentReplicationState()); } if (isExternalTable(table)) { table.putToParameters("EXTERNAL", "FALSE"); } if (isExternalTableType(table)) { table.setTableType(TableType.MANAGED_TABLE.toString()); } } else { } return table; }