auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Stream<CacheEntry<K, V>> buildStream(Set<Integer> segmentsToFilter, Set<?> keysToFilter) { Stream<CacheEntry<K, V>> stream; if (keysToFilter != null) { AdvancedCache<K, V> advancedCache = cache.getAdvancedCache().withFlags(Flag.CACHE_MODE_LOCAL); log.tracef("Applying key filtering %s", keysToFilter); stream = keysToFilter.stream().map(advancedCache::getCacheEntry).filter(e -> e != null); } else { stream = supplier.get(); } if (segmentsToFilter != null && hash != null) { log.tracef("Applying segment filter %s", segmentsToFilter); BitSet bitSet = new BitSet(hash.getNumSegments()); segmentsToFilter.forEach(bitSet::set); stream = stream.filter(k -> bitSet.get(hash.getSegment(k.getKey()))); } return stream; }

Target:
public Stream<CacheEntry<K, V>> buildStream(Set<Integer> segmentsToFilter, Set<?> keysToFilter) { Stream<CacheEntry<K, V>> stream; if (keysToFilter != null) { AdvancedCache<K, V> advancedCache = cache.getAdvancedCache().withFlags(Flag.CACHE_MODE_LOCAL); if (trace) { log.tracef("Applying key filtering %s", keysToFilter); } stream = keysToFilter.stream().map(advancedCache::getCacheEntry).filter(e -> e != null); } else { stream = supplier.get(); } if (segmentsToFilter != null && hash != null) { if (trace) { log.tracef("Applying segment filter %s", segmentsToFilter); } BitSet bitSet = new BitSet(hash.getNumSegments()); segmentsToFilter.forEach(bitSet::set); stream = stream.filter(k -> bitSet.get(hash.getSegment(k.getKey()))); } return stream; }
Source:
private void testFileChecksum( GcsFileChecksumType checksumType, Function<String, byte[]> checksumFn) throws Exception { Configuration config = getConfigurationWtihImplementation(); config.set("fs.gs.checksum.type", checksumType.name()); GoogleHadoopFileSystem myGhfs = new GoogleHadoopFileSystem(); myGhfs.initialize(ghfs.getUri(), config); URI fileUri = GoogleCloudStorageFileSystemIntegrationTest.getTempFilePath(); Path filePath = ghfsHelper.castAsHadoopPath(fileUri); String fileContent = "foo-testFileChecksum-" + checksumType; ghfsHelper.writeFile(filePath, fileContent, 1, true); FileChecksum fileChecksum = myGhfs.getFileChecksum(filePath); assertThat(fileChecksum.getAlgorithmName()).isEqualTo(checksumType.getAlgorithmName()); assertThat(fileChecksum.getLength()).isEqualTo(checksumType.getByteLength()); assertThat(fileChecksum.getBytes()).isEqualTo(checksumFn.apply(fileContent)); assertThat(fileChecksum.toString()).containsMatch(String.format("%s: *",checksumType.getAlgorithmName())); assertThat(ghfs.delete(filePath, true)).isTrue(); }

Target:
private void testFileChecksum( GcsFileChecksumType checksumType, Function<String, byte[]> checksumFn) throws Exception { Configuration config = getConfigurationWtihImplementation(); config.set("fs.gs.checksum.type", checksumType.name()); GoogleHadoopFileSystem myGhfs = new GoogleHadoopFileSystem(); myGhfs.initialize(ghfs.getUri(), config); URI fileUri = GoogleCloudStorageFileSystemIntegrationTest.getTempFilePath(); Path filePath = ghfsHelper.castAsHadoopPath(fileUri); String fileContent = "foo-testFileChecksum-" + checksumType; ghfsHelper.writeFile(filePath, fileContent, 1, true); FileChecksum fileChecksum = myGhfs.getFileChecksum(filePath); assertThat(fileChecksum.getAlgorithmName()).isEqualTo(checksumType.getAlgorithmName()); assertThat(fileChecksum.getLength()).isEqualTo(checksumType.getByteLength()); assertThat(fileChecksum.getBytes()).isEqualTo(checksumFn.apply(fileContent)); assertThat(fileChecksum.toString()) .contains(String.format("%s: ", checksumType.getAlgorithmName())); assertThat(ghfs.delete(filePath, true)).isTrue(); }
Source:
public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env) throws IOException { super.init(source, options, env); IteratorEnvironment sampleEnv = env.newIEWithSamplingEnabled(); sampleDC = source.deepCopy(sampleEnv); }

Target:
public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env) throws IOException { super.init(source, options, env); IteratorEnvironment sampleEnv = env.cloneWithSamplingEnabled(); sampleDC = source.deepCopy(sampleEnv); }
Source:
public long advance() { long current = index; long currentMax = iterators[0].getIndex(); long max = AscendingLongIterator.END; while (currentMax != max) { max = currentMax; for (AscendingLongIterator iterator : iterators) { currentMax = iterator.advanceAtLeastTo(currentMax); if (currentMax == AscendingLongIterator.END) { index = AscendingLongIterator.END; return current; } } } iterators[0].advance(); index = max; return current; }

Target:
public long advance() { long current = index; long min = first.iterator.getIndex(); long max = last.iterator.getIndex(); while (min != max && min != AscendingLongIterator.END && max != AscendingLongIterator.END) { max = first.iterator.advanceAtLeastTo(max); Node second = first.next; first.next = null; last.next = first; last = first; first = second; min = first.iterator.getIndex(); } if (max == AscendingLongIterator.END) { index = AscendingLongIterator.END; return current; } if (min != AscendingLongIterator.END) { last.iterator.advance(); } index = min; return current; }
Source:
private LandmarkUpdateOperation createAddLandmarkMarkerOperation(final IInteractionElement node) { if (node == null || node.getContentType() == null) { return null; } if (JavaStructureBridge.CONTENT_TYPE.equals(node.getContentType())) { final IJavaElement element = JavaCore.create(node.getHandleIdentifier()); if (!element.exists()) { return null; } if (element instanceof IMember) { try { final ISourceRange range = ((IMember) element).getNameRange(); IResource resource = element.getUnderlyingResource(); if (resource instanceof IFile) { LandmarkUpdateOperation runnable = new LandmarkUpdateOperation(resource) { public void run(IProgressMonitor monitor) throws CoreException { try { IMarker marker = getResource().createMarker(ID_MARKER_LANDMARK); if (marker != null && range != null) { marker.setAttribute(IMarker.CHAR_START, range.getOffset()); marker.setAttribute(IMarker.CHAR_END, range.getOffset() + range.getLength()); marker.setAttribute(IMarker.MESSAGE, Messages.LandmarkMarkerManager_Mylyn_Landmark); marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_INFO); markerMap.put(node, marker.getId()); } } catch (Throwable t) { StatusHandler.log(new Status(IStatus.ERROR, JavaUiBridgePlugin.ID_PLUGIN, "Could not create add landmark markers", t)); } } }; return runnable; } } catch (JavaModelException e) { StatusHandler .log(new Status(IStatus.ERROR, JavaUiBridgePlugin.ID_PLUGIN, "Could not update marker", e)); } } } return null; }

Target:
private LandmarkUpdateOperation createAddLandmarkMarkerOperation(final IInteractionElement node) { if (node == null || node.getContentType() == null) { return null; } if (JavaStructureBridge.CONTENT_TYPE.equals(node.getContentType())) { final IJavaElement element = JavaCore.create(node.getHandleIdentifier()); if (!element.exists()) { return null; } if (element instanceof IMember) { try { final ISourceRange range = ((IMember) element).getNameRange(); IResource resource = element.getUnderlyingResource(); if (resource instanceof IFile) { LandmarkUpdateOperation runnable = new LandmarkUpdateOperation(resource) { public void run(IProgressMonitor monitor) throws CoreException { try { IMarker marker = getResource().createMarker(ID_MARKER_LANDMARK); if (marker != null && range != null) { marker.setAttribute(IMarker.CHAR_START, range.getOffset()); marker.setAttribute(IMarker.CHAR_END, range.getOffset() + range.getLength()); marker.setAttribute(IMarker.MESSAGE, Messages.LandmarkMarkerManager_Mylyn_Landmark); marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_INFO); markerMap.put(node, marker.getId()); } } catch (CoreException e) { StatusHandler.log(new Status(IStatus.ERROR, JavaUiBridgePlugin.ID_PLUGIN, "Could not create add landmark markers", e)); } } }; return runnable; } } catch (JavaModelException e) { StatusHandler .log(new Status(IStatus.ERROR, JavaUiBridgePlugin.ID_PLUGIN, "Could not update marker", e)); } } } return null; }
Source:
protected Config buildGlobalConfig() { return new Config.Builder() .setSdk(21) .setManifest(Config.NONE) .build(); }

Target:
protected Config buildGlobalConfig() { return new Config.Builder() .setSdk(22) .setManifest(Config.NONE) .build(); }
Source:
public void testErrorReceived() { TestObserver<Object> ts = new TestObserver<Object>(); TestException ex = new TestException("boo"); Flowable.error(ex).ignoreElements().subscribe(ts); ts.assertNoValues(); ts.assertTerminated();; ts.assertError(TestException.class); ts.assertErrorMessage("boo"); }

Target:
public void testErrorReceived() { TestObserver<Object> ts = new TestObserver<Object>(); TestException ex = new TestException("boo"); Flowable.error(ex).ignoreElements().subscribe(ts); ts.assertNoValues(); ts.assertTerminated(); ts.assertError(TestException.class); ts.assertErrorMessage("boo"); }
Source:
private void doGet(File outputFile) throws Exception { String[] segments = this.url.split("/"); String file = segments[segments.length - 1]; String repoUrl = this.url.substring(0, this.url.length() - file.length() - 1); Repository repository = new Repository(repoUrl, repoUrl); Wagon wagon = this.wagonManager.getWagon(repository.getProtocol()); if (readTimeOut > 0) { wagon.setReadTimeout(readTimeOut); getLog().info( "Read Timeout is set to " + readTimeOut + " milliseconds (apprx " + Math.round(readTimeOut * 1.66667e-5) + " minutes)"); } com.googlecode.ConsoleDownloadMonitor downloadMonitor = new com.googlecode.ConsoleDownloadMonitor(); if (session.getSettings().isInteractiveMode()) { wagon.addTransferListener(downloadMonitor); } wagon.connect(repository, this.wagonManager.getProxy(repository.getProtocol())); wagon.get(file, outputFile); wagon.disconnect(); if (session.getSettings().isInteractiveMode()) { wagon.removeTransferListener(downloadMonitor); } }

Target:
private void doGet(File outputFile) throws Exception { String[] segments = this.url.split("/"); String file = segments[segments.length - 1]; String repoUrl = this.url.substring(0, this.url.length() - file.length() - 1); Repository repository = new Repository(repoUrl, repoUrl); Wagon wagon = this.wagonManager.getWagon(repository.getProtocol()); if (readTimeOut > 0) { wagon.setReadTimeout(readTimeOut); getLog().info( "Read Timeout is set to " + readTimeOut + " milliseconds (apprx " + Math.round(readTimeOut * 1.66667e-5) + " minutes)"); } ConsoleDownloadMonitor downloadMonitor = null; if (this.session.getSettings().isInteractiveMode()) { downloadMonitor = new ConsoleDownloadMonitor(); wagon.addTransferListener(downloadMonitor); } wagon.connect(repository, this.wagonManager.getProxy(repository.getProtocol())); wagon.get(file, outputFile); wagon.disconnect(); if (downloadMonitor != null) { wagon.removeTransferListener(downloadMonitor); } }
Source:
public File gitPrefix() throws IOException { String path = SystemReader.getInstance().getenv("PATH"); String gitExe = scanPath(path, "git.exe", "git.cmd"); if (gitExe != null) return new File(gitExe).getAbsoluteFile().getParentFile() .getParentFile(); return super.gitPrefix(); }

Target:
public File gitPrefix() { String path = SystemReader.getInstance().getenv("PATH"); File gitExe = searchPath(path, "git.exe", "git.cmd"); if (gitExe != null) return gitExe.getParentFile().getParentFile(); return super.gitPrefix(); }
Source:
SummedDistributedEphemeralCounter summedDistributedEphemeralCounter(ZookeeperClientManager manager) { List<CuratorFramework> curatorClients = manager.getClients().stream() .map(ZookeeperClient::getCuratorFramework) .collect(toList()); return new SummedDistributedEphemeralCounter(curatorClients); }

Target:
SummedDistributedEphemeralCounter summedDistributedEphemeralCounter(ZookeeperClientManager manager) { return new SummedDistributedEphemeralCounter(getCuratorClients(manager)); }
Source:
public Set<MetricNameDto> getCustomMetricsNamesOldModel(List<TaskDataDto> tests) { Set<Long> taskIds = new HashSet<Long>(); Set<String> sessionIds = new HashSet<String>(); for (TaskDataDto tdd : tests) { taskIds.addAll(tdd.getIds()); sessionIds.addAll(tdd.getSessionIds()); } long temp = System.currentTimeMillis(); List<Object[]> metricNames = entityManager.createNativeQuery( "select dre.name, selected.id from DiagnosticResultEntity dre join " + " (" + " select wd.workloaddataID, td.id from " + " (" + " select distinct wd.id as workloaddataID, wd.sessionId, wd.taskId from WorkloadData wd where wd.sessionId in (:sessionIds)" + " ) as wd join " + " ( " + " select td.taskId, td.sessionId, td.id from TaskData td where td.id in (:taskIds)" + " ) as td on wd.taskId=td.taskId and wd.sessionId=td.sessionId" + " ) as selected on dre.workloadData_id=selected.workloaddataID") .setParameter("taskIds", taskIds) .setParameter("sessionIds", sessionIds) .getResultList(); if (metricNames.isEmpty()) { return Collections.EMPTY_SET; } Set<MetricNameDto> metrics = new HashSet<MetricNameDto>(metricNames.size()); log.debug("{} ms spent for fetching custom metrics", System.currentTimeMillis() - temp, metricNames.size()); for (Object[] name : metricNames){ if (name == null || name[0] == null) continue; for (TaskDataDto td : tests) { if (td.getIds().contains(((BigInteger)name[1]).longValue())) { MetricNameDto metric = new MetricNameDto(); metric.setTest(td); metric.setMetricName((String) name[0]); metric.setOrigin(MetricNameDto.Origin.METRIC); metrics.add(metric); break; } } } return metrics; }

Target:
public Set<MetricNameDto> getCustomMetricsNamesOldModel(List<TaskDataDto> tests) { Set<Long> taskIds = new HashSet<Long>(); Set<String> sessionIds = new HashSet<String>(); for (TaskDataDto tdd : tests) { taskIds.addAll(tdd.getIds()); sessionIds.addAll(tdd.getSessionIds()); } long temp = System.currentTimeMillis(); List<Object[]> metricNames = entityManager.createNativeQuery( "select dre.name, selected.id from DiagnosticResultEntity dre join " + " (" + " select wd.workloaddataID, td.id from " + " (" + " select wd.id as workloaddataID, wd.sessionId, wd.taskId from WorkloadData wd where wd.sessionId in (:sessionIds)" + " ) as wd join " + " ( " + " select td.taskId, td.sessionId, td.id from TaskData td where td.id in (:taskIds)" + " ) as td on wd.taskId=td.taskId and wd.sessionId=td.sessionId" + " ) as selected on dre.workloadData_id=selected.workloaddataID") .setParameter("taskIds", taskIds) .setParameter("sessionIds", sessionIds) .getResultList(); if (metricNames.isEmpty()) { return Collections.EMPTY_SET; } Set<MetricNameDto> metrics = new HashSet<MetricNameDto>(metricNames.size()); log.debug("{} ms spent for fetching custom metrics", System.currentTimeMillis() - temp, metricNames.size()); for (Object[] name : metricNames){ if (name == null || name[0] == null) continue; for (TaskDataDto td : tests) { if (td.getIds().contains(((BigInteger)name[1]).longValue())) { MetricNameDto metric = new MetricNameDto(); metric.setTest(td); metric.setMetricName((String) name[0]); metric.setOrigin(MetricNameDto.Origin.METRIC); metrics.add(metric); break; } } } return metrics; }
Source:
public void bindTo(MeterRegistry registry) { stoppedCounter = Counter.builder(workspaceMetric("stopped.total")) .description("The count of stopped workspaces") .register(registry); eventService.subscribe( event -> { if (event.getPrevStatus() == WorkspaceStatus.STOPPING && event.getStatus() == WorkspaceStatus.STOPPED) { stoppedCounter.increment(); } }, WorkspaceStatusEvent.class); }

Target:
public void bindTo(MeterRegistry registry) { stoppedCounter = Counter.builder(workspaceMetric("stopped.total")) .description("The count of stopped workspaces") .register(registry); eventService.subscribe( event -> { if ((event.getError() == null) && (event.getPrevStatus() == WorkspaceStatus.STOPPING && event.getStatus() == WorkspaceStatus.STOPPED)) { stoppedCounter.increment(); } }, WorkspaceStatusEvent.class); }
Source:
private void handleCreateTableMutationCode(MetaDataMutationResult result, MutationCode code, CreateTableStatement statement, String schemaName, String tableName, PTable parent) throws SQLException { switch(code) { case NEWER_TABLE_FOUND: if (!statement.ifNotExists()) { throw new NewerTableAlreadyExistsException(schemaName, tableName, result.getTable()); } case UNALLOWED_TABLE_MUTATION: throw new SQLExceptionInfo.Builder(SQLExceptionCode.CANNOT_MUTATE_TABLE) .setSchemaName(schemaName).setTableName(tableName).build().buildException(); case CONCURRENT_TABLE_MUTATION: addTableToCache(result); throw new ConcurrentTableMutationException(schemaName, tableName); case AUTO_PARTITION_SEQUENCE_NOT_FOUND: case CANNOT_COERCE_AUTO_PARTITION_ID: case UNABLE_TO_CREATE_CHILD_LINK: case PARENT_TABLE_NOT_FOUND: case TABLE_NOT_IN_REGION: throwsSQLExceptionUtil(String.valueOf(code), schemaName, tableName); case TOO_MANY_INDEXES: case UNABLE_TO_UPDATE_PARENT_TABLE: throwsSQLExceptionUtil(String.valueOf(code), SchemaUtil.getSchemaNameFromFullName( parent.getPhysicalName().getString()),SchemaUtil.getTableNameFromFullName( parent.getPhysicalName().getString())); default: throw new SQLException("Exception occurred while creating table Mutation code:" + code.toString()); } }

Target:
public boolean handleCreateTableMutationCode(MetaDataMutationResult result, MutationCode code, CreateTableStatement statement, String schemaName, String tableName, PTable parent) throws SQLException { switch(code) { case TABLE_ALREADY_EXISTS: if(result.getTable() != null) { addTableToCache(result); } if(!statement.ifNotExists()) { throw new TableAlreadyExistsException(schemaName, tableName, result.getTable()); } return true; case NEWER_TABLE_FOUND: if (!statement.ifNotExists()) { throw new NewerTableAlreadyExistsException(schemaName, tableName, result.getTable()); } return false; case UNALLOWED_TABLE_MUTATION: throwsSQLExceptionUtil("CANNOT_MUTATE_TABLE",schemaName,tableName); case CONCURRENT_TABLE_MUTATION: addTableToCache(result); throw new ConcurrentTableMutationException(schemaName, tableName); case AUTO_PARTITION_SEQUENCE_NOT_FOUND: throw new SQLExceptionInfo.Builder(SQLExceptionCode.AUTO_PARTITION_SEQUENCE_UNDEFINED) .setSchemaName(schemaName).setTableName(tableName).build().buildException(); case CANNOT_COERCE_AUTO_PARTITION_ID: case UNABLE_TO_CREATE_CHILD_LINK: case PARENT_TABLE_NOT_FOUND: case TABLE_NOT_IN_REGION: throwsSQLExceptionUtil(String.valueOf(code), schemaName, tableName); case TOO_MANY_INDEXES: case UNABLE_TO_UPDATE_PARENT_TABLE: throwsSQLExceptionUtil(String.valueOf(code), SchemaUtil.getSchemaNameFromFullName( parent.getPhysicalName().getString()),SchemaUtil.getTableNameFromFullName( parent.getPhysicalName().getString())); default: throw new SQLExceptionInfo.Builder(SQLExceptionCode.UNEXPECTED_MUTATION_CODE) .setSchemaName(schemaName).setTableName(tableName).setMessage("mutation code: " + code).build().buildException(); } }
Source:
protected void process(final SpaceReference source, final SpaceReference destination) { visitDocuments(source, new Visitor<DocumentReference>() { @Override public void visit(DocumentReference oldChildReference) { DocumentReference newChildReference = oldChildReference.replaceParent(source, destination); if (MoveJob.this.hasAccess(Right.VIEW, newChildReference)) { maybeMove(oldChildReference, newChildReference); } } }); }

Target:
protected void process(final SpaceReference source, final SpaceReference destination) { visitDocuments(source, new Visitor<DocumentReference>() { @Override public void visit(DocumentReference oldChildReference) { DocumentReference newChildReference = oldChildReference.replaceParent(source, destination); maybeMove(oldChildReference, newChildReference); } }); }
Source:
File remove(long sizeInBytes) { rwLock.writeLock().lock(); try { File reserveFile = null; Queue<File> reserveFilesForSize = internalMap.get(sizeInBytes); if (reserveFilesForSize != null) { if (reserveFilesForSize.size() != 0) { reserveFile = reserveFilesForSize.remove(); } if (reserveFilesForSize.size() == 0) { internalMap.remove(sizeInBytes); } } return reserveFile; } finally { rwLock.writeLock().unlock(); } }

Target:
File remove(long sizeInBytes) { File reserveFile = null; Queue<File> reserveFilesForSize = internalMap.get(sizeInBytes); if (reserveFilesForSize != null && reserveFilesForSize.size() != 0) { reserveFile = reserveFilesForSize.remove(); } return reserveFile; }
Source:
public List<NameValuePair> extract(EpdqTemplateData templateData) { List<NameValuePair> nameValuePairs = super.extract(templateData); EpdqParameterBuilder parameterBuilder = newParameterBuilder(nameValuePairs) .add(BROWSER_COLOR_DEPTH, getBrowserColorDepth(templateData)); if (isNotBlank(templateData.getAuthCardDetails().getJsNavigatorLanguage())) { parameterBuilder.add(BROWSER_LANGUAGE, getBrowserLanguage(templateData)); } return parameterBuilder.build(); }

Target:
public List<NameValuePair> extract(EpdqTemplateData templateData) { List<NameValuePair> nameValuePairs = super.extract(templateData); EpdqParameterBuilder parameterBuilder = newParameterBuilder(nameValuePairs) .add(BROWSER_COLOR_DEPTH, getBrowserColorDepth(templateData)); Optional.ofNullable(templateData.getAuthCardDetails().getJsNavigatorLanguage()) .map(Locale::forLanguageTag).map(Locale::toLanguageTag).ifPresent(lang -> parameterBuilder.add(BROWSER_LANGUAGE, lang)); return parameterBuilder.build(); }
Source:
public SpeakerViewHolder(View itemView, Context context) { super(itemView); ButterKnife.bind(this, itemView); this.context = context; itemView.setOnClickListener(view -> { String speakerName = speaker.getName(); Intent intent = new Intent(this.context, SpeakerDetailsActivity.class); intent.putExtra(Speaker.Companion.getSPEAKER(), speakerName); try{ if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP){ Bundle bundle = ActivityOptions.makeSceneTransitionAnimation((Activity) this.context, speakerImage, speakerImage.getTransitionName()).toBundle(); this.context.startActivity(intent, bundle); } else{ this.context.startActivity(intent); } } catch(Exception e){ Timber.d("Speaker's transition doesnt occur"); } }); }

Target:
public SpeakerViewHolder(View itemView, Context context) { super(itemView); ButterKnife.bind(this, itemView); this.context = context; itemView.setOnClickListener(view -> { String speakerName = speaker.getName(); Intent intent = new Intent(this.context, SpeakerDetailsActivity.class); intent.putExtra(Speaker.SPEAKER, speakerName); try{ if(android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP){ Bundle bundle = ActivityOptions.makeSceneTransitionAnimation((Activity) this.context, speakerImage, speakerImage.getTransitionName()).toBundle(); this.context.startActivity(intent, bundle); } else{ this.context.startActivity(intent); } } catch(Exception e){ Timber.d("Speaker's transition doesnt occur"); } }); }
Source:
public static boolean needToAnalyze(Result result) { if (getInstance().doNotAnalyzeAbortedJob()) { return result != Result.SUCCESS && result != Result.ABORTED; } else { return result != Result.SUCCESS; } }

Target:
public static boolean needToAnalyze(Result result) { if (getInstance().isDoNotAnalyzeAbortedJob()) { return result != Result.SUCCESS && result != Result.ABORTED; } else { return result != Result.SUCCESS; } }
Source:
public String setMoveTooltip(MergeMode mode, Diff diff, boolean isFromLeft) { EObject right = null; EObject left = null; EObject ancestor = null; String tooltip; boolean isContainmentReference = false; if (diff instanceof ReferenceChange) { if (((ReferenceChange)diff).getReference().isContainment()) { isContainmentReference = true; Match valueMatch = diff.getMatch().getComparison().getMatch( ((ReferenceChange)diff).getValue()); left = valueMatch.getLeft(); right = valueMatch.getRight(); ancestor = valueMatch.getOrigin(); } } if (isContainmentReference && isContainerMove(isFromLeft, ancestor, right, left)) { tooltip = setMoveContainerTooltip(mode, diff, isFromLeft, left, right, ancestor); } else { tooltip = setMovePositionTooltip(mode, diff, isFromLeft); } return tooltip; }

Target:
public String setMoveTooltip(MergeMode mode, Diff diff, boolean isFromLeft) { EObject right = null; EObject left = null; EObject ancestor = null; String tooltip; boolean isContainmentReference = isContainmentReferenceChange(diff); if (isContainmentReference) { Match valueMatch = diff.getMatch().getComparison().getMatch(((ReferenceChange)diff).getValue()); left = valueMatch.getLeft(); right = valueMatch.getRight(); ancestor = valueMatch.getOrigin(); } if (isContainmentReference && isContainerMove(isFromLeft, ancestor, right, left)) { tooltip = setMoveContainerTooltip(mode, diff, isFromLeft, left, right, ancestor); } else { tooltip = setMovePositionTooltip(mode, diff, isFromLeft); } return tooltip; }
Source:
private void addJoinFieldMapping(XContentBuilder builder, ElasticsearchPersistentProperty property) throws IOException { JoinTypeRelation[] joinTypeRelations = property.getRequiredAnnotation(JoinTypeRelations.class).relations(); if (joinTypeRelations.length == 0) { return; } builder.startObject(property.getFieldName()); builder.field(FIELD_PARAM_TYPE, TYPE_VALUE_JOIN); builder.startObject(JOIN_TYPE_RELATIONS); for (JoinTypeRelation joinTypeRelation: joinTypeRelations) { String parent = joinTypeRelation.parent(); String[] children = joinTypeRelation.children(); if (children.length > 1) { builder.array(parent, children); } else if (children.length == 1) { builder.field(parent, children[0]); } } builder.endObject(); builder.endObject(); }

Target:
private void addJoinFieldMapping(XContentBuilder builder, ElasticsearchPersistentProperty property) throws IOException { JoinTypeRelation[] joinTypeRelations = property.getRequiredAnnotation(JoinTypeRelations.class).relations(); if (joinTypeRelations.length == 0) { logger.warn("Property {}s type is JoinField but its annotation JoinTypeRelation is " + "not properly maintained", property.getFieldName()); return; } builder.startObject(property.getFieldName()); builder.field(FIELD_PARAM_TYPE, TYPE_VALUE_JOIN); builder.startObject(JOIN_TYPE_RELATIONS); for (JoinTypeRelation joinTypeRelation: joinTypeRelations) { String parent = joinTypeRelation.parent(); String[] children = joinTypeRelation.children(); if (children.length > 1) { builder.array(parent, children); } else if (children.length == 1) { builder.field(parent, children[0]); } } builder.endObject(); builder.endObject(); }
Source:
public void testSchemaTypePromotion() throws Exception { LOG.debug("########## testSchemaTypePromotion ##############"); InputStream stream = new ByteArrayInputStream(csvLines2.getBytes("utf8")); Schema schema = CSVUtil.inferSchema("TestRecord", stream, new CSVProperties.Builder().hasHeader().build()); Assert.assertNotNull(schema.getField("long")); Assert.assertNotNull(schema.getField("nullable_double")); Assert.assertNotNull(schema.getField("nullable_double2")); Assert.assertNotNull(schema.getField("string")); Assert.assertEquals("Should infer a long", schema(Schema.Type.LONG), schema.getField("long").schema()); Assert.assertEquals("Should infer a double (third row is decimal)", nullable(Schema.Type.DOUBLE), schema.getField("nullable_double").schema()); Assert.assertEquals("Should infer a double (second row is decimal)", nullable(Schema.Type.DOUBLE), schema.getField("nullable_double2").schema()); Assert.assertEquals("Should infer a nullable string (third row is string)", schema(Schema.Type.STRING), schema.getField("string").schema()); LOG.debug("########## END typePromotion ############"); }

Target:
public void testSchemaTypePromotion() throws Exception { InputStream stream = new ByteArrayInputStream(csvLines2.getBytes("utf8")); Schema schema = CSVUtil.inferSchema("TestRecord", stream, new CSVProperties.Builder().hasHeader().build()); Assert.assertNotNull(schema.getField("long")); Assert.assertNotNull(schema.getField("nullable_double")); Assert.assertNotNull(schema.getField("nullable_double2")); Assert.assertNotNull(schema.getField("string")); Assert.assertEquals("Should infer a long", schema(Schema.Type.LONG), schema.getField("long").schema()); Assert.assertEquals("Should infer a double (third row is decimal)", nullable(Schema.Type.DOUBLE), schema.getField("nullable_double").schema()); Assert.assertEquals("Should infer a double (second row is decimal)", nullable(Schema.Type.DOUBLE), schema.getField("nullable_double2").schema()); Assert.assertEquals("Should infer a nullable string (third row is string)", schema(Schema.Type.STRING), schema.getField("string").schema()); }
Source:
public void deleteLoadBalancerDomainFromFreeIPA(Stack stack) { if (manageCertificateAndDnsInPem()) { Set<LoadBalancer> loadBalancers = loadBalancerPersistenceService.findByStackId(stack.getId()); if (!loadBalancers.isEmpty()) { Optional<LoadBalancer> loadBalancerOptional = selectLoadBalancer(loadBalancers); if (loadBalancerOptional.isEmpty()) { LOGGER.debug("Unabled to determine load balancer type. Load balancer will not be deleted from FreeIPA."); return; } LoadBalancer loadBalancer = loadBalancerOptional.get(); String endpoint = loadBalancer.getEndpoint(); String domain = getDomainFromStack(stack); if (StringUtils.isNotEmpty(loadBalancer.getDns())) { dnsV1Endpoint.deleteDnsCnameRecord(stack.getEnvironmentCrn(), domain, endpoint); } else if (StringUtils.isNotEmpty(loadBalancer.getIp())) { dnsV1Endpoint.deleteDnsARecord(stack.getEnvironmentCrn(), domain, endpoint); } else { LOGGER.debug("Unable to find DNS or IP for load balancer. Load balancer will not be deleted from FreeIPA."); } } } }

Target:
public void deleteLoadBalancerDomainFromFreeIPA(Stack stack) { if (manageCertificateAndDnsInPem()) { Set<LoadBalancer> loadBalancers = loadBalancerPersistenceService.findByStackId(stack.getId()); if (!loadBalancers.isEmpty()) { Optional<LoadBalancer> loadBalancerOptional = loadBalancerConfigService.selectLoadBalancer(loadBalancers, LoadBalancerType.PRIVATE); if (loadBalancerOptional.isPresent()) { LoadBalancer loadBalancer = loadBalancerOptional.get(); String endpoint = loadBalancer.getEndpoint(); String domain = getDomainFromStack(stack); try { if (StringUtils.isNotEmpty(loadBalancer.getDns())) { LOGGER.debug("Deleted load balancer with CNAME from FreeIPA", endpoint); dnsV1Endpoint.deleteDnsCnameRecord(stack.getEnvironmentCrn(), domain, endpoint); } else if (StringUtils.isNotEmpty(loadBalancer.getIp())) { LOGGER.debug("Deleted load balancer with A record from FreeIPA", endpoint); dnsV1Endpoint.deleteDnsARecord(stack.getEnvironmentCrn(), domain, endpoint); } else { LOGGER.debug("Unable to find DNS or IP for load balancer. Load balancer will not be deleted from FreeIPA."); } } catch (Exception e) { LOGGER.error("Unable to delete load balancer domain from FreeIPA", e); } } else { LOGGER.debug("Unable to determine load balancer type. Load balancer will not be deleted from FreeIPA."); } } } }
Source:
public CompilePanel(CompileOutputDisplay outputDisplay) { panel_ = new FocusPanel(); outputDisplay_ = outputDisplay; panel_.setWidget(outputDisplay_.asWidget()); errorList_ = new SourceMarkerList(); initWidget(panel_); }

Target:
public CompilePanel(CompileOutputDisplay outputDisplay) { panel_ = new SimplePanel(); outputDisplay_ = outputDisplay; panel_.setWidget(outputDisplay_.asWidget()); errorList_ = new SourceMarkerList(); initWidget(panel_); }
Source:
public void init(IActionBars bars, IWorkbenchPage page) { for (Object element : cache) { ((EditorContribution) element).contribute(bars.getMenuManager(), false, bars.getToolBarManager(), true); } }

Target:
public void init(IActionBars bars, IWorkbenchPage page) { for (Object contribution : cache) { ((EditorContribution) contribution).contribute(bars.getMenuManager(), false, bars.getToolBarManager(), true); } }
Source:
public void download(Batch batch, Map<DownloadBatchId, DownloadBatch> downloadBatchMap) { DownloadBatch runningDownloadBatch = downloadBatchMap.get(batch.downloadBatchId()); if (runningDownloadBatch != null) { Log.w("Ignoring duplicate batch with id " + batch.downloadBatchId()); return; } CallbackThrottle callbackThrottle = callbackThrottleCreator.create(); DownloadBatch downloadBatch = DownloadBatchFactory.newInstance( batch, fileOperations, downloadsBatchPersistence, downloadsFilePersistence, callbackThrottle, connectionChecker ); downloadBatch.persist(); download(downloadBatch, downloadBatchMap); }

Target:
public void download(Batch batch, Map<DownloadBatchId, DownloadBatch> downloadBatchMap) { DownloadBatch runningDownloadBatch = downloadBatchMap.get(batch.downloadBatchId()); if (runningDownloadBatch != null) { Log.w(String.format( "Already running download for DownloadBatchId: %s, ensure you are not duplicating identifiers.", batch.downloadBatchId().rawId() )); return; } CallbackThrottle callbackThrottle = callbackThrottleCreator.create(); DownloadBatch downloadBatch = DownloadBatchFactory.newInstance( batch, fileOperations, downloadsBatchPersistence, downloadsFilePersistence, callbackThrottle, connectionChecker ); downloadBatch.persist(); download(downloadBatch, downloadBatchMap); }
Source:
public ServerPermission(String name, String actions) { super(name, actions); }

Target:
public ServerPermission(String name, String actions) { super(validatePermissionName(name), validatePermissionActions(actions)); }
Source:
public FunctionImplementationType getFunctionImplementationType() { return SQL; }

Target:
public FunctionImplementationType getFunctionImplementationType() { return FunctionImplementationType.SQL; }
Source:
public Boolean getSabbatical() { return _sabbatical; }

Target:
public boolean getSabbatical() { return _sabbatical; }
Source:
public Collection<Ref> call() throws GitAPIException, JGitInternalException { checkCallable(); Transport transport = null; try { transport = Transport.open(repo, remote); transport.setOptionUploadPack(uploadPack); configure(transport); Collection<RefSpec> refSpecs = new ArrayList<RefSpec>(1); if (tags) refSpecs.add(new RefSpec( "refs/tags/*:refs/remotes/origin/tags/*")); if (heads) refSpecs.add(new RefSpec("refs/heads/*:refs/remotes/origin/*")); Collection<Ref> refs; Map<String, Ref> refmap = new HashMap<String, Ref>(); FetchConnection fc = transport.openFetch(); try { refs = fc.getRefs(); if (refSpecs.isEmpty()) for (Ref r : refs) refmap.put(r.getName(), r); else for (Ref r : refs) for (RefSpec rs : refSpecs) if (rs.matchSource(r)) { refmap.put(r.getName(), r); break; } } finally { fc.close(); } return refmap.values(); } catch (URISyntaxException e) { throw new InvalidRemoteException(MessageFormat.format( JGitText.get().invalidRemote, remote)); } catch (TransportException e) { throw new JGitInternalException( JGitText.get().exceptionCaughtDuringExecutionOfLsRemoteCommand, e); } catch (NotSupportedException e) { throw new JGitInternalException( JGitText.get().exceptionCaughtDuringExecutionOfLsRemoteCommand, e); } finally { if (transport != null) transport.close(); } }

Target:
public Collection<Ref> call() throws GitAPIException, JGitInternalException { checkCallable(); Transport transport = null; FetchConnection fc = null; try { transport = Transport.open(repo, remote); transport.setOptionUploadPack(uploadPack); configure(transport); Collection<RefSpec> refSpecs = new ArrayList<RefSpec>(1); if (tags) refSpecs.add(new RefSpec( "refs/tags/*:refs/remotes/origin/tags/*")); if (heads) refSpecs.add(new RefSpec("refs/heads/*:refs/remotes/origin/*")); Collection<Ref> refs; Map<String, Ref> refmap = new HashMap<String, Ref>(); fc = transport.openFetch(); refs = fc.getRefs(); if (refSpecs.isEmpty()) for (Ref r : refs) refmap.put(r.getName(), r); else for (Ref r : refs) for (RefSpec rs : refSpecs) if (rs.matchSource(r)) { refmap.put(r.getName(), r); break; } return refmap.values(); } catch (URISyntaxException e) { throw new InvalidRemoteException(MessageFormat.format( JGitText.get().invalidRemote, remote)); } catch (TransportException e) { throw new JGitInternalException( JGitText.get().exceptionCaughtDuringExecutionOfLsRemoteCommand, e); } catch (NotSupportedException e) { throw new JGitInternalException( JGitText.get().exceptionCaughtDuringExecutionOfLsRemoteCommand, e); } finally { if (fc != null) fc.close(); if (transport != null) transport.close(); } }
Source:
public void process(String programmeId) { Map<String, Identified> resolvedContent = contentResolver.findByCanonicalUris(ImmutableSet.of(PaHelper.getFilmUri(programmeId), PaHelper.getEpisodeUri(programmeId))).asResolvedMap(); try { Item item = (Item) Iterables.getOnlyElement(resolvedContent.values()); Broadcast broadcast = BY_BROADCAST_DATE.min(Iterables.concat(Iterables.transform(item.getVersions(), Version.TO_BROADCASTS))); if (featureDate.contains(broadcast.getTransmissionTime())) { contentGroup.addContent(item.childRef()); } } catch (NoSuchElementException e) { log .error("No content found for programme Id: " + programmeId, e); } }

Target:
public void process(String programmeId) { Map<String, Identified> resolvedContent = contentResolver.findByCanonicalUris(ImmutableSet.of(PaHelper.getFilmUri(programmeId), PaHelper.getEpisodeUri(programmeId))).asResolvedMap(); Item item = (Item) Iterables.getOnlyElement(resolvedContent.values()); Broadcast broadcast = BY_BROADCAST_DATE.min(Iterables.concat(Iterables.transform(item.getVersions(), Version.TO_BROADCASTS))); if (featureDate.contains(broadcast.getTransmissionTime())) { contentGroup.addContent(item.childRef()); } }
Source:
private Optional<String> getSystemDefaultStreamProperty(String systemName, String propertyName) { Map<String, String> defaultStreamProperties = getDefaultStreamProperties(systemName); String defaultStreamProperty = defaultStreamProperties.get(propertyName); if (StringUtils.isNotEmpty(defaultStreamProperty)) { return Optional.of(defaultStreamProperty); } else { String fallbackStreamProperty = get(String.format(SYSTEMS_PREFIX + "%s.%s", systemName, propertyName)); if (StringUtils.isNotEmpty(fallbackStreamProperty)) { return Optional.of(fallbackStreamProperty); } else { return Optional.empty(); } } }

Target:
private Optional<String> getSystemDefaultStreamProperty(String systemName, String propertyName) { Map<String, String> defaultStreamProperties = getDefaultStreamProperties(systemName); String defaultStreamProperty = defaultStreamProperties.get(propertyName); if (StringUtils.isNotEmpty(defaultStreamProperty)) { return Optional.of(defaultStreamProperty); } else { String fallbackStreamProperty = get(String.format(SYSTEM_ID_PREFIX, systemName) + propertyName); if (StringUtils.isNotEmpty(fallbackStreamProperty)) { return Optional.of(fallbackStreamProperty); } else { return Optional.empty(); } } }
Source:
public void validate_shouldFailIfDestDoesNotMatchAFilePattern() { ArtifactPlan artifactPlan = new ArtifactPlan("foo/bar", ".."); artifactPlan.validate(null); assertThat(artifactPlan.errors().on(ArtifactPlan.DEST), is("Invalid destination path. Destination path should match the pattern " + FilePathTypeValidator.PATH_PATTERN)); }

Target:
public void validate_shouldFailIfDestDoesNotMatchAFilePattern() { ArtifactPlan artifactPlan = new ArtifactPlan("foo/bar", ".."); artifactPlan.validate(null); assertThat(artifactPlan.errors().on(ArtifactPlan.DEST), is("Invalid destination path. Destination path should match the pattern (([.]\\/)?[.][^. ]+)|([^. ].+[^. ])|([^. ][^. ])|([^. ])")); }
Source:
public void onSiteChanged(OnSiteChanged event) { if (getSelectedSite() == null && mSiteStore.hasSite()) { setSelectedSite(mSiteStore.getSites().get(0)); } if (getSelectedSite() == null) { return; } SiteModel site = mSiteStore.getSiteByLocalId(getSelectedSite().getId()); if (site != null) { mSelectedSite = site; } if (getMySiteFragment() != null) { getMySiteFragment().onSiteChanged(); } }

Target:
public void onSiteChanged(OnSiteChanged event) { if (getSelectedSite() == null && mSiteStore.hasSite()) { setSelectedSite(mSiteStore.getSites().get(0)); } if (getSelectedSite() == null) { return; } SiteModel site = mSiteStore.getSiteByLocalId(getSelectedSite().getId()); if (site != null) { mSelectedSite = site; } if (getMySiteFragment() != null) { getMySiteFragment().onSiteChanged(site); } }
Source:
public int compare(ScanNode o1, ScanNode o2) { return (int) (GlobalPlanRewriteUtil.getTableVolume(o1) - GlobalPlanRewriteUtil.getTableVolume(o2)); }

Target:
public int compare(ScanNode o1, ScanNode o2) { long compare = GlobalPlanRewriteUtil.getTableVolume(o1) - GlobalPlanRewriteUtil.getTableVolume(o2); if (compare == 0) { return 0; } else if (compare > 0) { return 1; } else { return -1; } }
Source:
public Map<Long, Number> mapping(Map<Long, Number> originalDatapoints, List<String> constants) { SystemAssert.requireArgument(constants != null && constants.size() == 1, "If constants provided for diff transform, only exactly one constant allowed."); Map<Long, Number> diffDatapoints = new HashMap<>(); Number subtrahend; try { subtrahend = Long.parseLong(constants.get(0)); } catch (NumberFormatException nfe) { try { subtrahend = Double.parseDouble(constants.get(0)); } catch (NumberFormatException nfe2) { throw new SystemException("Illegal constant value " + constants.get(0) + " supplied to diff transform."); } } for (Map.Entry<Long, Number> entry : originalDatapoints.entrySet()) { diffDatapoints.put(entry.getKey(), NumberOperations.subtract(entry.getValue(), subtrahend)); } return diffDatapoints; }

Target:
public Map<Long, Number> mapping(Map<Long, Number> originalDatapoints, List<String> constants) { SystemAssert.requireArgument(constants != null && constants.size() == 1, "If constants provided for diff transform, only exactly one constant allowed."); Map<Long, Number> diffDatapoints = new HashMap<>(); Number subtrahend; try { subtrahend = NumberOperations.parseConstant(constants.get(0)); } catch (IllegalArgumentException iae) { throw new SystemException("Illegal constant supplied to Diff Value Reducer: " + constants.get(0)); } for (Map.Entry<Long, Number> entry : originalDatapoints.entrySet()) { diffDatapoints.put(entry.getKey(), NumberOperations.subtract(entry.getValue(), subtrahend)); } return diffDatapoints; }
Source:
private void runPendingTasks() { runPendingTasksExec.submit( new Callable<Void>() { @Override public Void call() throws Exception { try { List<RemoteTaskRunnerWorkItem> copy = Lists.newArrayList(pendingTasks.values()); for (RemoteTaskRunnerWorkItem taskRunnerWorkItem : copy) { String taskId = taskRunnerWorkItem.getTaskId(); try { if (tryAssignTasks.putIfAbsent(taskId, taskId) == null && tryAssignTask(pendingTaskPayloads.get(taskId), taskRunnerWorkItem)) { pendingTaskPayloads.remove(taskId); } } catch (Exception e) { log.makeAlert(e, "Exception while trying to assign task") .addData("taskId", taskRunnerWorkItem.getTaskId()) .emit(); RemoteTaskRunnerWorkItem workItem = pendingTasks.remove(taskId); taskComplete(workItem, null, TaskStatus.failure(taskId)); } finally { tryAssignTasks.remove(taskId); } } } catch (Exception e) { log.makeAlert(e, "Exception in running pending tasks").emit(); } return null; } } ); }

Target:
private void runPendingTasks() { runPendingTasksExec.submit( new Callable<Void>() { @Override public Void call() throws Exception { try { List<RemoteTaskRunnerWorkItem> copy = Lists.newArrayList(pendingTasks.values()); for (RemoteTaskRunnerWorkItem taskRunnerWorkItem : copy) { String taskId = taskRunnerWorkItem.getTaskId(); if (tryAssignTasks.putIfAbsent(taskId, taskId) == null) { try { if (tryAssignTask(pendingTaskPayloads.get(taskId), taskRunnerWorkItem)) { pendingTaskPayloads.remove(taskId); } } catch (Exception e) { log.makeAlert(e, "Exception while trying to assign task") .addData("taskId", taskRunnerWorkItem.getTaskId()) .emit(); RemoteTaskRunnerWorkItem workItem = pendingTasks.remove(taskId); taskComplete(workItem, null, TaskStatus.failure(taskId)); } finally { tryAssignTasks.remove(taskId); } } } } catch (Exception e) { log.makeAlert(e, "Exception in running pending tasks").emit(); } return null; } } ); }
Source:
public BugzillaRestTaskEditorPage(TaskEditor editor, String connectorKind) { super(editor, connectorKind); setNeedsPrivateSection(false); setNeedsSubmitButton(false); }

Target:
public BugzillaRestTaskEditorPage(TaskEditor editor, String connectorKind) { super(editor, connectorKind); setNeedsPrivateSection(true); setNeedsSubmitButton(true); }
Source:
protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_project_management); pref = PreferenceManager.getDefaultSharedPreferences(this); db = ((TranslationRecorderApp)getApplication()).getDatabase(); Toolbar mToolbar = (Toolbar) findViewById(R.id.project_management_toolbar); setSupportActionBar(mToolbar); if (getSupportActionBar() != null) { ImageView imageView = findViewById(R.id.identicon); getSupportActionBar().setDisplayShowTitleEnabled(false); int userId = pref.getInt(Settings.KEY_PROFILE, -1); final User user = db.getUser(userId); String svg = Jdenticon.Companion.toSvg(user.getHash(), 512, 0f); imageView.setBackground(Sharp.loadString(svg).getDrawable()); imageView.setLayerType(View.LAYER_TYPE_SOFTWARE, null); imageView.setOnClickListener(identiconPlayerClick(user.getAudio().toString())); } if (savedInstanceState != null) { mZipping = savedInstanceState.getBoolean(STATE_ZIPPING, false); mExporting = savedInstanceState.getBoolean(STATE_EXPORTING, false); mProgress = savedInstanceState.getInt(STATE_PROGRESS, 0); mProgressTitle = savedInstanceState.getString(STATE_PROGRESS_TITLE, null); mDbResyncing = savedInstanceState.getBoolean(STATE_RESYNC, false); } }

Target:
protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_project_management); pref = PreferenceManager.getDefaultSharedPreferences(this); db = ((TranslationRecorderApp)getApplication()).getDatabase(); Toolbar mToolbar = (Toolbar) findViewById(R.id.project_management_toolbar); setSupportActionBar(mToolbar); if (getSupportActionBar() != null) { getSupportActionBar().setDisplayShowTitleEnabled(false); initializeIdenticon(); } if (savedInstanceState != null) { mZipping = savedInstanceState.getBoolean(STATE_ZIPPING, false); mExporting = savedInstanceState.getBoolean(STATE_EXPORTING, false); mProgress = savedInstanceState.getInt(STATE_PROGRESS, 0); mProgressTitle = savedInstanceState.getString(STATE_PROGRESS_TITLE, null); mDbResyncing = savedInstanceState.getBoolean(STATE_RESYNC, false); } }
Source:
public UserAccount getCurrentUser() { final Account account = getCurrentAccount(); return account == null ? null : buildUserAccount(account); }

Target:
public UserAccount getCurrentUser() { return buildUserAccount(getCurrentAccount()); }
Source:
public void writeExecutionEnvironmentContainerIdMapping(String processorId, String executionEnvContainerId) { Preconditions.checkNotNull(processorId, "Container's logical processor id can not be null."); Preconditions.checkNotNull(executionEnvContainerId, "Container's physical execution environment container id can not be null."); LOG.info("Container has executionEnvContainerId as {}", processorId, executionEnvContainerId); metadataStore.put(processorId, valueSerde.toBytes(executionEnvContainerId)); metadataStore.flush(); }

Target:
public void writeExecutionEnvironmentContainerIdMapping(String processorId, String executionEnvContainerId) { Preconditions.checkNotNull(processorId, "Container's logical processor id can not be null."); Preconditions.checkNotNull(executionEnvContainerId, "Container's physical execution environment container id can not be null."); LOG.info("Processor has executionEnvContainerId as {}", processorId, executionEnvContainerId); metadataStore.put(processorId, valueSerde.toBytes(executionEnvContainerId)); metadataStore.flush(); }