auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Object execute(Object context, API api) { String functionName = null; try { engineBindings.setJSFunctionProvider(new JsFunctionsImpl(api)); functionName = api.getRequestLookup().getRequest().isGet() ? FUNCTION_ON_GET : FUNCTION_ON_POST; if (functionName.equals(FUNCTION_ON_GET) && isOnGetFound) { return engine.invokeFunction(functionName, context); } else if (functionName.equals(FUNCTION_ON_POST) && isOnPostFound) { return engine.invokeFunction(functionName, context); } else { return null; } } catch (ScriptException e) { throw new UUFException( "An error occurred when executing the '" + functionName + "' function in JavaScript file '" + absolutePath + "' with context '" + context + "'.", e); } catch (NoSuchMethodException e) { throw new UUFException( "Cannot find the '" + functionName + "' function in the JavaScript file '" + absolutePath + "'.", e); } finally { engineBindings.removeJSFunctionProvider(); } }

Target:
public Object execute(Object context, API api) { String functionName = null; try { engineBindings.setJSFunctionProvider(new JsFunctionsImpl(api)); if (api.getRequestLookup().getRequest().isGetRequest()) { functionName = FUNCTION_ON_GET; return hasOnGetFunction ? engine.invokeFunction(FUNCTION_ON_GET, context) : null; } else { functionName = FUNCTION_ON_POST; return hasOnPostFunction ? engine.invokeFunction(FUNCTION_ON_POST, context) : null; } } catch (ScriptException e) { throw new UUFException( "An error occurred when executing the '" + functionName + "' function in JavaScript file '" + absolutePath + "' with context '" + context + "'.", e); } catch (NoSuchMethodException e) { throw new UUFException( "Cannot find the '" + functionName + "' function in the JavaScript file '" + absolutePath + "'.", e); } finally { engineBindings.removeJSFunctionProvider(); } }
Source:
public boolean include(TreeWalk walker) throws MissingObjectException, IncorrectObjectTypeException, IOException { pointer = null; if (walker.isSubtree()) { return walker.isRecursive(); } ObjectId objectId = walker.getObjectId(0); ObjectLoader object = walker.getObjectReader().open(objectId); if (object.isLarge()) { return false; } ObjectStream stream = object.openStream(); byte[] buffer = new byte[VERSION_LINES[0].length]; int read = stream.read(buffer); if (!validVersionLine(read, buffer)) { return false; } int line = 2; buffer = object.getCachedBytes(); IntList lineMap = RawParseUtils.lineMap(buffer, 0, buffer.length); int lineMapSize = lineMap.size() - 1; Integer size = null; LongObjectId oid = null; for (; line < lineMapSize; line++) { int lineStart = lineMap.get(line); if (size == null) { int match = RawParseUtils.match(buffer, lineStart, SIZE); if (match > 0) { int len = lineMap.get(line + 1) - match - 1; byte[] value = new byte[len]; System.arraycopy(buffer, match, value, 0, len); size = new Integer( RawParseUtils.parseBase10(value, 0, null)); } } if (oid == null) { int match = RawParseUtils.match(buffer, lineStart, OID); if (match > 0) { int len = lineMap.get(line + 1) - match - 1; byte[] value = new byte[len]; System.arraycopy(buffer, match, value, 0, len); oid = LongObjectId.fromString(value, 0); } } if (size != null && oid != null) { pointer = new LfsPointer(oid, size.intValue()); return true; } } return false; }

Target:
public boolean include(TreeWalk walker) throws MissingObjectException, IncorrectObjectTypeException, IOException { pointer = null; if (walker.isSubtree()) { return walker.isRecursive(); } ObjectId objectId = walker.getObjectId(0); ObjectLoader object = walker.getObjectReader().open(objectId); if (object.getSize() > 1024) { return false; } pointer = LfsPointer.parseLfsPointer(object.openStream()); return pointer != null; }
Source:
public void addChangeMarker(int lineStart, int lineEnd, EditedRegionType type) { DivElement element = null; switch (type) { case INSERTION: { element = Elements.createDivElement(resources.changeMarkersCSS().markerInsertion()); break; } case MODIFICATION: { element = Elements.createDivElement(resources.changeMarkersCSS().markerModification()); break; } case DELETION: { element = Elements.createDivElement(resources.changeMarkersCSS().markerDeletion()); break; } } hasGutter.addGutterItem(lineStart, lineEnd, VCS_CHANGE_MARKERS_GUTTER, element); }

Target:
public void addChangeMarker(int lineStart, int lineEnd, EditedRegionType type) { DivElement element; GitResources.Css css = resources.changeMarkersCSS(); switch (type) { case INSERTION: { element = Elements.createDivElement(css.marker(), css.insertion()); break; } case MODIFICATION: { element = Elements.createDivElement(css.marker(), css.modification()); break; } case DELETION: { element = Elements.createDivElement(css.marker(), css.deletion()); break; } default: { return; } } hasGutter.addGutterItem(lineStart, lineEnd, VCS_CHANGE_MARKERS_GUTTER, element); }
Source:
public void getPreviousPageNumber_returnsThePreviousPageNumber() { assertThat(new NewPagination(Optional.of(11), Optional.of(100), 100).getPreviousPageNumber(), equalTo(1)); assertThat(new NewPagination(Optional.of(11), Optional.of(100), 100).getPreviousPageNumber(), equalTo(1)); assertThat(new NewPagination(Optional.of(102), Optional.of(100), 120).getPreviousPageNumber(), equalTo(2)); }

Target:
public void getPreviousPageNumber_returnsThePreviousPageNumber() { assertThat(new NewPagination(Optional.of(11), Optional.of(100), 100).getPreviousPageNumber(), equalTo(1)); assertThat(new NewPagination(Optional.of(102), Optional.of(100), 120).getPreviousPageNumber(), equalTo(2)); }
Source:
protected static int determineMaxResponseContentLength(Message message) { Integer maxResponseContentLength = null; if (message.get(MAX_RESPONSE_CONTENT_LENGTH) != null) { Object obj = message.get(MAX_RESPONSE_CONTENT_LENGTH); try { maxResponseContentLength = Integer.parseInt(obj.toString()); } catch (NumberFormatException e) { LOG.log(Level.WARNING, "INVALID_TIMEOUT_FORMAT", new Object[] { MAX_RESPONSE_CONTENT_LENGTH, obj.toString() }); } } if (maxResponseContentLength == null) { maxResponseContentLength = SystemPropertyAction.getInteger(MAX_RESPONSE_CONTENT_LENGTH, DEFAULT_MAX_RESPONSE_CONTENT_LENGTH); } return maxResponseContentLength; }

Target:
protected static int determineMaxResponseContentLength(Message message) { Integer maxResponseContentLength = null; if (message.get(MAX_RESPONSE_CONTENT_LENGTH) != null) { Object obj = message.get(MAX_RESPONSE_CONTENT_LENGTH); try { maxResponseContentLength = Integer.parseInt(obj.toString()); } catch (NumberFormatException e) { LOG.log(Level.WARNING, "INVALID_TIMEOUT_FORMAT", new Object[] { MAX_RESPONSE_CONTENT_LENGTH, obj.toString() }); } } if (maxResponseContentLength == null) { maxResponseContentLength = DEFAULT_MAX_RESPONSE_CONTENT_LENGTH; } return maxResponseContentLength; }
Source:
public List<VCFContigHeaderLine> getContigLines() { List<VCFContigHeaderLine> contigLines = new ArrayList<>(contigMetaData.size()); contigLines.addAll(contigMetaData.values()); return Collections.unmodifiableList(contigLines); }

Target:
public List<VCFContigHeaderLine> getContigLines() { return Collections.unmodifiableList(new ArrayList<>(contigMetaData.values())); }
Source:
public void activate(ComponentContext context) throws LoginException { log.info("activate"); bctx = context.getBundleContext(); refreshCache(); log.info("Activation successful!"); }

Target:
public void activate(ComponentContext context) throws LoginException { log.trace("activate"); bctx = context.getBundleContext(); refreshCache(); log.trace("Activation successful!"); }
Source:
private HashCode getPartitionHash(PartitionContext partitionContext) { Hasher hasher = Hashing.md5().newHasher(); boolean empty = true; if (_partitionKeys.isEmpty()) { Object value = partitionContext.get(); if (value != null) { hasher.putUnencodedChars(value.toString()); empty = false; } } for (String partitionKey : _partitionKeys) { Object value = partitionContext.get(partitionKey); if (value != null) { hasher.putUnencodedChars(partitionKey); hasher.putUnencodedChars(value.toString()); empty = false; } } if (empty) { return null; } return hasher.hash(); }

Target:
private HashCode getPartitionHash(PartitionContext partitionContext) { Hasher hasher = Hashing.md5().newHasher(); boolean empty = true; if (_partitionKeys.isEmpty()) { Object value = partitionContext.get(); if (value != null) { putUnencodedChars(hasher, value.toString()); empty = false; } } for (String partitionKey : _partitionKeys) { Object value = partitionContext.get(partitionKey); if (value != null) { putUnencodedChars(hasher, partitionKey); putUnencodedChars(hasher, value.toString()); empty = false; } } if (empty) { return null; } return hasher.hash(); }
Source:
private void refreshUiFromState(View editShareView) { if (editShareView != null) { setPermissionsListening(editShareView, false); int sharePermissions = mShare.getPermissions(); boolean isFederated = mShare.getShareType().equals(ShareType.FEDERATED); CompoundButton compound; compound = (CompoundButton) editShareView.findViewById(R.id.canShareSwitch); if(isFederated) compound.setVisibility(View.INVISIBLE); compound.setChecked((sharePermissions & OCShare.SHARE_PERMISSION_FLAG) > 0); compound = (CompoundButton) editShareView.findViewById(R.id.canEditSwitch); int anyUpdatePermission = OCShare.CREATE_PERMISSION_FLAG | OCShare.UPDATE_PERMISSION_FLAG | OCShare.DELETE_PERMISSION_FLAG; boolean canEdit = (sharePermissions & anyUpdatePermission) > 0; compound.setChecked(canEdit); if (mFile.isFolder() && !isFederated) { compound = (CompoundButton) editShareView.findViewById(R.id.canEditCreateCheckBox); compound.setChecked((sharePermissions & OCShare.CREATE_PERMISSION_FLAG) > 0); compound.setVisibility(canEdit ? View.VISIBLE : View.GONE); compound = (CompoundButton) editShareView.findViewById(R.id.canEditChangeCheckBox); compound.setChecked((sharePermissions & OCShare.UPDATE_PERMISSION_FLAG) > 0); compound.setVisibility(canEdit ? View.VISIBLE : View.GONE); compound = (CompoundButton) editShareView.findViewById(R.id.canEditDeleteCheckBox); compound.setChecked((sharePermissions & OCShare.DELETE_PERMISSION_FLAG) > 0); compound.setVisibility(canEdit ? View.VISIBLE : View.GONE); } setPermissionsListening(editShareView, true); } }

Target:
private void refreshUiFromState(View editShareView) { if (editShareView != null) { setPermissionsListening(editShareView, false); int sharePermissions = mShare.getPermissions(); boolean isFederated = ShareType.FEDERATED.equals(mShare.getShareType()); CompoundButton compound; compound = (CompoundButton) editShareView.findViewById(R.id.canShareSwitch); if(isFederated) { compound.setVisibility(View.INVISIBLE); } compound.setChecked((sharePermissions & OCShare.SHARE_PERMISSION_FLAG) > 0); compound = (CompoundButton) editShareView.findViewById(R.id.canEditSwitch); int anyUpdatePermission = OCShare.CREATE_PERMISSION_FLAG | OCShare.UPDATE_PERMISSION_FLAG | OCShare.DELETE_PERMISSION_FLAG; boolean canEdit = (sharePermissions & anyUpdatePermission) > 0; compound.setChecked(canEdit); if (mFile.isFolder() && !isFederated) { compound = (CompoundButton) editShareView.findViewById(R.id.canEditCreateCheckBox); compound.setChecked((sharePermissions & OCShare.CREATE_PERMISSION_FLAG) > 0); compound.setVisibility(canEdit ? View.VISIBLE : View.GONE); compound = (CompoundButton) editShareView.findViewById(R.id.canEditChangeCheckBox); compound.setChecked((sharePermissions & OCShare.UPDATE_PERMISSION_FLAG) > 0); compound.setVisibility(canEdit ? View.VISIBLE : View.GONE); compound = (CompoundButton) editShareView.findViewById(R.id.canEditDeleteCheckBox); compound.setChecked((sharePermissions & OCShare.DELETE_PERMISSION_FLAG) > 0); compound.setVisibility(canEdit ? View.VISIBLE : View.GONE); } setPermissionsListening(editShareView, true); } }
Source:
private Aggregator(final Builder builder) { _name = builder._name; _sampling = builder._sampling; if (!_sampling.isPresent()) { _alignSampling = Optional.empty(); } else { _alignSampling = builder._alignSampling; } _otherArgs = builder._otherArgs; _alignEndTime = builder._alignEndTime; _alignStartTime = builder._alignStartTime; }

Target:
private Aggregator(final Builder builder) { _name = builder._name; _sampling = Optional.ofNullable(builder._sampling); if (!_sampling.isPresent()) { _alignSampling = Optional.empty(); } else { _alignSampling = Optional.ofNullable(builder._alignSampling); } _otherArgs = builder._otherArgs; _alignEndTime = Optional.ofNullable(builder._alignEndTime); _alignStartTime = Optional.ofNullable(builder._alignStartTime); }
Source:
public String getSecureVaultValue(SecretResolver secretResolver, OMElement propertyElement) { String value = null; OMAttribute attribute; if (propertyElement != null) { attribute = propertyElement.getAttribute( new QName(BPMNConstants.SECURE_VAULT_NS, "secretAlias") ); if (attribute != null) { value = secretResolver.resolve(attribute.getAttributeValue()); } } return value; }

Target:
private String getSecureVaultValue(SecretResolver secretResolver, OMElement propertyElement) { String value = null; OMAttribute attribute; if (propertyElement != null) { attribute = propertyElement.getAttribute( new QName(BPMNConstants.SECURE_VAULT_NS, "secretAlias") ); if (attribute != null) { value = secretResolver.resolve(attribute.getAttributeValue()); } } return value; }
Source:
public void uninstall() { super.uninstall(); textViewer.getTextWidget().removeLineBackgroundListener(fLineBackgroundListener); }

Target:
public void uninstall() { super.uninstall(); textViewer.getTextWidget().removeLineBackgroundListener(fLineBackgroundListener); textViewer.removeTextInputListener(textInputListener); }
Source:
private void scheduleInitializationCheckAndCallback() { executorService.schedule(() -> { if (isClosed.get()) { return; } if (isInitializedInternal()) { runCallback(); } else { scheduleInitializationCheckAndCallback(); } }, 1_000, TimeUnit.MILLISECONDS); }

Target:
private void scheduleInitializationCheckAndCallback() { executorService.schedule(() -> { if (status != State.INITIALIZING) { return; } if (isInitializedInternal()) { runCallback(); } else { scheduleInitializationCheckAndCallback(); } }, 1_000, TimeUnit.MILLISECONDS); }
Source:
public int getVersion() throws SQLException { try { return queue.submit(new Callable<Integer>() { @Override public Integer call() throws Exception { return db.getVersion(); } }).get(); } catch (InterruptedException e) { logger.log(Level.SEVERE,"Failed to get database version",e); throw new SQLException(e); } catch (ExecutionException e) { throw new SQLException(e); } }

Target:
public int getVersion() throws SQLException { try { return queue.submit(new Callable<Integer>() { @Override public Integer call() throws Exception { return db.getVersion(); } }).get(); } catch (InterruptedException e) { logger.log(Level.SEVERE,"Failed to get database version",e); throw new SQLException(e); } catch (ExecutionException e) { logger.log(Level.SEVERE,"Failed to get database version",e); throw new SQLException(e); } }
Source:
public static void deletePaths(final Path... paths) { for (final Path p : paths) { boolean deleted; try { deleted = Files.deleteIfExists(p); } catch (IOException e) { deleted = false; } if (!deleted) System.err.println("Could not delete file " + p); } }

Target:
public static void deletePaths(final Path... paths) { deletePaths(Arrays.asList(paths)); }
Source:
public Map<String, String> toConfig() { HashMap<String, String> configs = new HashMap<>(); configs.put(String.format(SYSTEM_CONFIG_KEY, streamId), getSystemName()); getPhysicalName().ifPresent(physicalName -> configs.put(String.format(PHYSICAL_NAME_CONFIG_KEY, streamId), physicalName)); getStreamConfigs().forEach((key, value) -> configs.put(String.format(STREAM_CONFIGS_CONFIG_KEY, streamId, key), value)); return Collections.unmodifiableMap(configs); }

Target:
public Map<String, String> toConfig() { HashMap<String, String> configs = new HashMap<>(); configs.put(String.format(SYSTEM_CONFIG_KEY, streamId), getSystemName()); this.physicalNameOptional.ifPresent(physicalName -> configs.put(String.format(PHYSICAL_NAME_CONFIG_KEY, streamId), physicalName)); this.streamConfigs.forEach((key, value) -> configs.put(String.format(STREAM_CONFIGS_CONFIG_KEY, streamId, key), value)); return Collections.unmodifiableMap(configs); }
Source:
public CompletionStage<?> loadNextBatch() throws Exception { if (allLoaded()) { return CompletableFuture.failedFuture(new IllegalStateException("BatchIterator already loaded")); } int availableThreads = this.availableThreads.getAsInt(); List<BatchIterator<T>> itToLoad = getIteratorsToLoad(iterators); List<CompletableFuture<CompletableFuture>> nestedFutures = new ArrayList<>(); if (availableThreads < itToLoad.size()) { Iterable<List<BatchIterator<T>>> iteratorsPerThread = Iterables.partition( itToLoad, itToLoad.size() / availableThreads); for (List<BatchIterator<T>> batchIterators: iteratorsPerThread) { CompletableFuture<CompletableFuture> future = supplyAsync(() -> { ArrayList<CompletableFuture<?>> futures = new ArrayList<>(batchIterators.size()); for (BatchIterator<T> batchIterator: batchIterators) { try { futures.add(batchIterator.loadNextBatch().toCompletableFuture()); } catch (Throwable t) { return CompletableFuture.failedFuture(t); } } return CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])); }, executor); nestedFutures.add(future); } } else { for (BatchIterator<T> iterator: itToLoad) { nestedFutures.add(supplyAsync(() -> { try { return iterator.loadNextBatch().toCompletableFuture(); } catch (Throwable t) { return CompletableFuture.failedFuture(t); } }, executor)); } } return CompletableFutures.allAsList(nestedFutures) .thenCompose(innerFutures -> CompletableFuture.allOf(innerFutures.toArray(new CompletableFuture[0]))); }

Target:
public CompletionStage<?> loadNextBatch() throws Exception { if (allLoaded()) { throw new IllegalStateException("BatchIterator already loaded"); } int availableThreads = this.availableThreads.getAsInt(); List<BatchIterator<T>> itToLoad = getIteratorsToLoad(iterators); List<CompletableFuture<CompletableFuture>> nestedFutures = new ArrayList<>(); if (availableThreads < itToLoad.size()) { Iterable<List<BatchIterator<T>>> iteratorsPerThread = Iterables.partition( itToLoad, itToLoad.size() / availableThreads); for (List<BatchIterator<T>> batchIterators: iteratorsPerThread) { CompletableFuture<CompletableFuture> future = supplyAsync(() -> { ArrayList<CompletableFuture<?>> futures = new ArrayList<>(batchIterators.size()); for (BatchIterator<T> batchIterator: batchIterators) { try { futures.add(batchIterator.loadNextBatch().toCompletableFuture()); } catch (Throwable t) { return CompletableFuture.failedFuture(t); } } return CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])); }, executor); nestedFutures.add(future); } } else { for (BatchIterator<T> iterator: itToLoad) { nestedFutures.add(supplyAsync(() -> { try { return iterator.loadNextBatch().toCompletableFuture(); } catch (Throwable t) { return CompletableFuture.failedFuture(t); } }, executor)); } } return CompletableFutures.allAsList(nestedFutures) .thenCompose(innerFutures -> CompletableFuture.allOf(innerFutures.toArray(new CompletableFuture[0]))); }
Source:
public static Optional<OAuthScope> fromString(String value){ try{ return Optional.of(OAuthScope.valueOf(value)); }catch (ArrayIndexOutOfBoundsException ex){ return Optional.absent(); } }

Target:
public static Optional<OAuthScope> fromString(String value){ try{ return Optional.of(OAuthScope.valueOf(value)); }catch (ArrayIndexOutOfBoundsException ex){ LOGGER.error("error=invalid-oauth-scope-value value={}", value); return Optional.absent(); } }
Source:
private void shiftReadSetToNeighors() { ReadHeadSet unflippedSet = getVertexValue().getUnflippedReadIds(); KmerFactory kmerFactory = new KmerFactory(Kmer.getKmerLength()); for (ReadHeadInfo info : unflippedSet) { VKmer destForward = kmerFactory.getSubKmerFromChain(-info.getOffset() + 1, Kmer.getKmerLength(), info.getThisReadSequence()); if (destForward == null) { continue; } VKmer destReverse = destForward.reverse(); boolean flipped = destForward.compareTo(destReverse) > 0; if (flipped) { info.resetOffset(-info.getOffset() + destReverse.getKmerLetterLength()); sendReadInfo(destReverse, flipped, info); } else { info.resetOffset(info.getOffset() - 1); sendReadInfo(destForward, flipped, info); } } ReadHeadSet flippedSet = getVertexValue().getFlippedReadIds(); for (ReadHeadInfo info : flippedSet) { VKmer destForward = kmerFactory.getSubKmerFromChain(info.getOffset() - (Kmer.getKmerLength() - 1) + 1, Kmer.getKmerLength(), info.getThisReadSequence()); VKmer destReverse = destForward.reverse(); boolean flipped = destForward.compareTo(destReverse) > 0; if (flipped) { info.resetOffset(info.getOffset() + 1); sendReadInfo(destReverse, flipped, info); } else { info.resetOffset(-(info.getOffset() + 1 - Kmer.getKmerLength() + 1)); sendReadInfo(destForward, flipped, info); } } }

Target:
private void shiftReadSetToNeighors() { ReadHeadSet unflippedSet = getVertexValue().getUnflippedReadIds(); KmerFactory kmerFactory = new KmerFactory(Kmer.getKmerLength()); for (ReadHeadInfo info : unflippedSet) { if (info.getOffset() > 0) { throw new IllegalStateException("the info's offset should be negative, now:" + info.getOffset()); } VKmer destForward = kmerFactory.getSubKmerFromChain(-info.getOffset() + 1, Kmer.getKmerLength(), info.getThisReadSequence()); if (destForward == null) { continue; } VKmer destReverse = destForward.reverse(); boolean flipped = destForward.compareTo(destReverse) > 0; if (flipped) { info.resetOffset(-info.getOffset() + destReverse.getKmerLetterLength()); sendReadInfo(destReverse, flipped, info); } else { info.resetOffset(info.getOffset() - 1); sendReadInfo(destForward, flipped, info); } } ReadHeadSet flippedSet = getVertexValue().getFlippedReadIds(); for (ReadHeadInfo info : flippedSet) { if (info.getOffset() < Kmer.getKmerLength() - 1) { throw new IllegalStateException("the info's offset should be >= than the kmerlength-1, now:" + info.getOffset()); } VKmer destForward = kmerFactory.getSubKmerFromChain(info.getOffset() - (Kmer.getKmerLength() - 1) + 1, Kmer.getKmerLength(), info.getThisReadSequence()); if (destForward == null) { continue; } VKmer destReverse = destForward.reverse(); boolean flipped = destForward.compareTo(destReverse) > 0; if (flipped) { info.resetOffset(info.getOffset() + 1); sendReadInfo(destReverse, flipped, info); } else { info.resetOffset(-(info.getOffset() + 1 - Kmer.getKmerLength() + 1)); sendReadInfo(destForward, flipped, info); } } }
Source:
public void testHeaderValue() throws Exception { setRequestHeader("Front-End-Https", "on"); _rule.setHeader("Front-End-Https"); _rule.setHeaderValue("on"); _rule.setScheme("https"); _rule.matchAndApply("/", _request, _response); assertEquals("https", _request.getScheme()); _request.setHttpURI(HttpURI.build(_request.getRequestURI()).scheme("other").asImmutable()); setRequestHeader("Front-End-Https", "off"); _rule.matchAndApply("/", _request, _response); assertEquals("other", _request.getScheme()); _request.setHttpURI(HttpURI.build(_request.getRequestURI()).scheme((String)null).asImmutable()); setRequestHeader("Front-End-Https", "any"); _rule.setHeaderValue(null); _rule.matchAndApply("/", _request, _response); assertEquals("https", _request.getScheme()); }

Target:
public void testHeaderValue() throws Exception { setRequestHeader("Front-End-Https", "on"); _rule.setHeader("Front-End-Https"); _rule.setHeaderValue("on"); _rule.setScheme("https"); _rule.matchAndApply("/", _request, _response); assertEquals("https", _request.getScheme()); _request.setHttpURI(HttpURI.build(_request.getRequestURI()).scheme("other")); setRequestHeader("Front-End-Https", "off"); _rule.matchAndApply("/", _request, _response); assertEquals("other", _request.getScheme()); _request.setHttpURI(HttpURI.build(_request.getRequestURI()).scheme((String)null)); setRequestHeader("Front-End-Https", "any"); _rule.setHeaderValue(null); _rule.matchAndApply("/", _request, _response); assertEquals("https", _request.getScheme()); }
Source:
public List<? extends Symbol> outputs() { if (output == null) { return super.outputs(); } return List.of(output); }

Target:
public List<? extends Symbol> outputs() { return List.of(outputs); }
Source:
public StandardRetryPolicy(int maxRetries) { if (maxRetries > 5) { this.maxRetries = 5; } else{ this.maxRetries = maxRetries; } }

Target:
public StandardRetryPolicy(int maxRetries) { this.maxRetries = Math.min(6, maxRetries); }
Source:
public synchronized String registerProcessorAndGetId(final ProcessorData data) { String processorId = data.getProcessorId(); if (ephemeralPath == null) { ephemeralPath = zkClient.createEphemeralSequential(keyBuilder.getProcessorsPath() + "/", data.toString()); LOG.info("Created ephemeral path: for processor: in zookeeper.", ephemeralPath, data); ProcessorNode processorNode = new ProcessorNode(data, ephemeralPath); if (shouldStopProcessor(processorNode)) { LOG.info("Processor: is duplicate. Deleting zookeeper node at path: {}.", processorId, ephemeralPath); zkClient.delete(ephemeralPath); throw new SamzaException(String.format("Processor: %s is duplicate in the group. Registration failed.", processorId)); } } else { LOG.info("Ephemeral path: exists for processor: in zookeeper.", ephemeralPath, data); } return ephemeralPath; }

Target:
public synchronized String registerProcessorAndGetId(final ProcessorData data) { String processorId = data.getProcessorId(); if (ephemeralPath == null) { ephemeralPath = zkClient.createEphemeralSequential(keyBuilder.getProcessorsPath() + "/", data.toString()); LOG.info("Created ephemeral path: for processor: in zookeeper.", ephemeralPath, data); ProcessorNode processorNode = new ProcessorNode(data, ephemeralPath); if (!isValidRegisteredProcessor(processorNode)) { LOG.info("Processor: is duplicate. Deleting zookeeper node at path: {}.", processorId, ephemeralPath); zkClient.delete(ephemeralPath); throw new SamzaException(String.format("Processor: %s is duplicate in the group. Registration failed.", processorId)); } } else { LOG.info("Ephemeral path: exists for processor: in zookeeper.", ephemeralPath, data); } return ephemeralPath; }
Source:
synchronized short allocate( PageSwapper swapper ) { SwapperMapping[] swapperMappings = this.swapperMappings; synchronized ( free ) { if ( !free.isEmpty() ) { short id = Numbers.safeCastIntToShort( free.iterator().next() ); free.remove( id ); swapperMappings[id] = new SwapperMapping( id, swapper ); this.swapperMappings = swapperMappings; return id; } } short id = safeCastLongToShort( swapperMappings.length ); if ( id + 1 > MAX_SWAPPER_ID ) { throw new IllegalStateException( "All swapper ids are allocated: " + MAX_SWAPPER_ID ); } swapperMappings = Arrays.copyOf( swapperMappings, id + 1 ); swapperMappings[id] = new SwapperMapping( id, swapper ); this.swapperMappings = swapperMappings; return id; }

Target:
synchronized short allocate( PageSwapper swapper ) { SwapperMapping[] swapperMappings = this.swapperMappings; synchronized ( free ) { if ( !free.isEmpty() ) { short id = safeCastIntToShort( free.iterator().next() ); free.remove( id ); swapperMappings[id] = new SwapperMapping( id, swapper ); this.swapperMappings = swapperMappings; return id; } } short id = safeCastIntToShort( swapperMappings.length ); if ( id + 1 > MAX_SWAPPER_ID ) { throw new IllegalStateException( "All swapper ids are allocated: " + MAX_SWAPPER_ID ); } swapperMappings = Arrays.copyOf( swapperMappings, id + 1 ); swapperMappings[id] = new SwapperMapping( id, swapper ); this.swapperMappings = swapperMappings; return id; }
Source:
public BlobDownloadHeaders() { objectReplicationPolicies = null; }

Target:
public BlobDownloadHeaders() { objectReplicationSourcePolicies = null; }
Source:
private void compute(ControlFlowGraph cfg, Set<Symbol> localVariables) { Map<Symbol, VariableDefinition> initialState = new HashMap<>(); localVariables.forEach(variable -> { if (variable.usages().stream().anyMatch(u -> u.kind() == Usage.Kind.PARAMETER)) { initialState.put(variable, VariableDefinition.DEFINED); return; } initialState.put(variable, VariableDefinition.UNDEFINED); }); Set<CfgBlock> blocks = cfg.blocks(); blocks.forEach(block -> definedVariablesPerBlock.put(block, DefinedVariables.build(block, initialState))); Deque<CfgBlock> workList = new ArrayDeque<>(blocks); while (!workList.isEmpty()) { CfgBlock currentBlock = workList.pop(); DefinedVariables definedVariables = this.definedVariablesPerBlock.get(currentBlock); boolean outHasChanged = definedVariables.propagate(this.definedVariablesPerBlock); if (outHasChanged) { currentBlock.successors().forEach(workList::push); } } }

Target:
private void compute(ControlFlowGraph cfg, Set<Symbol> localVariables) { Map<Symbol, VariableDefinition> initialState = new HashMap<>(); for (Symbol variable : localVariables) { boolean isParameter = variable.usages().stream().anyMatch(u -> u.kind() == Usage.Kind.PARAMETER); initialState.put(variable, isParameter ? VariableDefinition.DEFINED : VariableDefinition.UNDEFINED); } Set<CfgBlock> blocks = cfg.blocks(); blocks.forEach(block -> definedVariablesPerBlock.put(block, DefinedVariables.build(block, initialState))); Deque<CfgBlock> workList = new ArrayDeque<>(blocks); while (!workList.isEmpty()) { CfgBlock currentBlock = workList.pop(); DefinedVariables definedVariables = this.definedVariablesPerBlock.get(currentBlock); boolean outHasChanged = definedVariables.propagate(this.definedVariablesPerBlock); if (outHasChanged) { currentBlock.successors().forEach(workList::push); } } }
Source:
public String getConfig(String configKey) { ConfigKey<String> config = ConfigKeys.newStringConfigKey(configKey); return mgmt().getConfig().getConfig(config); }

Target:
public String getConfig(String configKey) { if (!Entitlements.isEntitled(mgmt().getEntitlementManager(), Entitlements.SEE_ALL_SERVER_INFO, null)) { throw WebResourceUtils.unauthorized("User '%s' is not authorized for this operation", Entitlements.getEntitlementContext().user()); } ConfigKey<String> config = ConfigKeys.newStringConfigKey(configKey); return mgmt().getConfig().getConfig(config); }
Source:
private String generateCoOwnersEmailsLine(String courseId) { List<InstructorAttributes> instructors = instructorsLogic.getInstructorsForCourse(courseId); StringBuffer coOwnersEmailsList = new StringBuffer(); for (InstructorAttributes instructor : instructors) { if (!instructor.hasCoownerPrivileges()) { continue; } coOwnersEmailsList.append(instructor.getName() + "(" + instructor.getEmail() + "), "); } return coOwnersEmailsList.length() == 0 ? "(No contactable instructors found)" : coOwnersEmailsList.substring(0, coOwnersEmailsList.length() - 2); }

Target:
private String generateCoOwnersEmailsLine(String courseId) { List<InstructorAttributes> coOwners = instructorsLogic.getCoOwnersForCourse(courseId); if (coOwners.isEmpty()) { return "(No contactable instructors found)"; } StringBuilder coOwnersEmailsLine = new StringBuilder(); for (InstructorAttributes coOwner : coOwners) { coOwnersEmailsLine .append(coOwner.getName()) .append('(') .append(coOwner.getEmail()) .append("), "); } return coOwnersEmailsLine.substring(0, coOwnersEmailsLine.length() - 2); }
Source:
public Set<LockToken> unlock(Set<LockToken> tokens) { Set<LeasedLockToken> leasedLockTokens = tokens.stream() .map(token -> (LeasedLockToken) token) .collect(Collectors.toSet()); leasedLockTokens.forEach(LeasedLockToken::inValidate); return delegate.unlock(leasedLockTokens.stream() .map(LeasedLockToken::serverToken) .collect(Collectors.toSet())); }

Target:
public Set<LockToken> unlock(Set<LockToken> tokens) { Set<LeasedLockToken> leasedLockTokens = leasedTokens(tokens); leasedLockTokens.forEach(LeasedLockToken::inValidate); return delegate.unlock(serverTokens(leasedLockTokens)); }
Source:
private void showDeveloperContact() { View parentLayout = findViewById(android.R.id.content); String snackbarMsg; if (developerContact.equals("")) { snackbarMsg = getString(R.string.api_version_no_developer_contact); } else { snackbarMsg = getString(R.string.api_version_developer_contact, developerContact); } Snackbar snackbar = Snackbar.make(parentLayout, snackbarMsg, 5000); View snackbarView = snackbar.getView(); TextView snackTextView = (TextView) snackbarView.findViewById(com.google.android.material.R.id.snackbar_text); snackTextView.setTextColor(Color.WHITE); snackTextView.setMaxLines(3); snackbar.setActionTextColor(Color.MAGENTA) .setAction("VIEW", view -> { Intent intent = new Intent(); intent.setAction(Intent.ACTION_VIEW); intent.addCategory(Intent.CATEGORY_BROWSABLE); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setData(Uri.parse("<LINK_0>")); getApplicationContext().startActivity(intent); }); snackbar.show(); }

Target:
private void showDeveloperContact() { View parentLayout = findViewById(android.R.id.content); String snackbarMsg; if (TextUtils.isEmpty(mCardSuppliedDeveloperContact)) { snackbarMsg = getString(R.string.api_version_no_developer_contact); } else { snackbarMsg = getString(R.string.api_version_developer_contact, mCardSuppliedDeveloperContact ); } Snackbar snackbar = Snackbar.make(parentLayout, snackbarMsg, Snackbar.LENGTH_LONG); View snackbarView = snackbar.getView(); TextView snackTextView = snackbarView.findViewById(com.google.android.material.R.id.snackbar_text); snackTextView.setTextColor(Color.WHITE); snackTextView.setMaxLines(3); snackbar.setActionTextColor(Color.MAGENTA) .setAction(getString(R.string.reviewer_invalid_api_version_visit_documentation), view -> { openUrl(Uri.parse("<LINK_0>")); }); snackbar.show(); }
Source:
public StreamingAggregate(@Nullable final Operator child, @Nonnull final int[] gfields, @Nonnull final AggregatorFactory... factories) { super(child); gFields = Objects.requireNonNull(gfields, "gfields"); gTypes = new Type[gfields.length]; this.factories = Objects.requireNonNull(factories, "factories"); Preconditions.checkArgument(gfields.length > 0, " must have at least one group by field"); Preconditions.checkArgument(factories.length > 0, "to use StreamingAggregate, must specify some aggregates"); gRange = new int[gfields.length]; for (int i = 0; i < gfields.length; ++i) { gRange[i] = i; } }

Target:
public StreamingAggregate(@Nullable final Operator child, @Nonnull final int[] gfields, @Nonnull final AggregatorFactory... factories) { super(child); gFields = Objects.requireNonNull(gfields, "gfields"); this.factories = Objects.requireNonNull(factories, "factories"); Preconditions.checkArgument(gfields.length > 0, " must have at least one group by field"); Preconditions.checkArgument(factories.length > 0, "to use StreamingAggregate, must specify some aggregates"); gRange = new int[gfields.length]; for (int i = 0; i < gRange.length; ++i) { gRange[i] = i; } }
Source:
private OAuthFederatedSource getSource(Source source) { Bundle bundle = FrameworkUtil.getBundle(OAuthPlugin.class); if (bundle == null) { return null; } BundleContext bundleContext = bundle.getBundleContext(); if (bundleContext == null) { return null; } OAuthFederatedSource oauthSource; try { Collection<ServiceReference<OAuthFederatedSource>> implementers = bundleContext.getServiceReferences(OAuthFederatedSource.class, null); oauthSource = implementers .stream() .map(bundleContext::getService) .filter(s -> s.getId().equals(source.getId())) .filter(s -> s.getAuthenticationType().equals(OAUTH)) .filter(s -> s.getOauthFlow().equals(CODE_FLOW)) .findFirst() .orElse(null); } catch (InvalidSyntaxException e) { return null; } return oauthSource; }

Target:
OAuthFederatedSource getSource(Source source) { Bundle bundle = FrameworkUtil.getBundle(OAuthPlugin.class); if (bundle == null) { return null; } BundleContext bundleContext = bundle.getBundleContext(); if (bundleContext == null) { return null; } OAuthFederatedSource oauthSource; try { Collection<ServiceReference<OAuthFederatedSource>> implementers = bundleContext.getServiceReferences(OAuthFederatedSource.class, null); oauthSource = implementers .stream() .map(bundleContext::getService) .filter(s -> s.getId().equals(source.getId())) .filter(s -> s.getAuthenticationType().equals(OAUTH)) .filter(s -> s.getOauthFlow().equals(CODE_FLOW)) .findFirst() .orElse(null); } catch (InvalidSyntaxException e) { LOGGER.warn("Error getting source.", e); return null; } return oauthSource; }
Source:
public boolean getSaveOffline() { if (pages.size() == 0) { return emptyListSavePagesState; } for (ReadingListPage page : pages) { if (!page.savedOrSaving()) { return false; } } return true; }

Target:
public boolean getSaveOffline() { if (pages.isEmpty()) { return emptyListSavePagesState; } for (ReadingListPage page : pages) { if (!page.savedOrSaving()) { return false; } } return true; }
Source:
private double getAverageTimeInMillis() { return Arrays.stream(sortedTimes).average().getAsDouble() / 1_000_000f; }

Target:
private double getAverageTimeInMillis() { return Arrays.stream(sortedTimes).average().getAsDouble() / 1_000_000.0; }
Source:
private void populateRemitAddress(PaymentWorksVendor pmwVendor, VendorDetail vendorDetail) { List<VendorAddress> remitAddresses = findAllActiveRemitAddresses(vendorDetail.getVendorAddresses()); if (remitAddresses.size() == 1) { VendorAddress remitAddress = remitAddresses.get(0); pmwVendor.setRemittanceAddressStreet1(remitAddress.getVendorLine1Address()); pmwVendor.setRemittanceAddressStreet2(remitAddress.getVendorLine2Address()); pmwVendor.setRemittanceAddressCity(remitAddress.getVendorCityName()); pmwVendor.setRemittanceAddressState(remitAddress.getVendorStateCode()); pmwVendor.setRemittanceAddressCountry(convertFipsCountryCodeToIsoCountryCode(remitAddress.getVendorCountryCode())); pmwVendor.setRemittanceAddressZipCode(remitAddress.getVendorZipCode()); } else { LOG.error("populateRemitAddress: KFS Approved PVEN does not contain one and only one Active Remit Address for vendor " + vendorDetail.getVendorHeaderGeneratedIdentifier() + "-" + vendorDetail.getVendorDetailAssignedIdentifier()); } }

Target:
private void populateRemitAddress(PaymentWorksVendor pmwVendor, VendorDetail vendorDetail) { List<VendorAddress> remitAddresses = findAllActiveRemitAddresses(vendorDetail.getVendorAddresses()); if (ObjectUtils.isNotNull(remitAddresses) && remitAddresses.size() == 1) { VendorAddress remitAddress = remitAddresses.get(0); pmwVendor.setRemittanceAddressStreet1(remitAddress.getVendorLine1Address()); pmwVendor.setRemittanceAddressStreet2(remitAddress.getVendorLine2Address()); pmwVendor.setRemittanceAddressCity(remitAddress.getVendorCityName()); pmwVendor.setRemittanceAddressState(remitAddress.getVendorStateCode()); pmwVendor.setRemittanceAddressCountry(convertFipsCountryCodeToIsoCountryCode(remitAddress.getVendorCountryCode())); pmwVendor.setRemittanceAddressZipCode(remitAddress.getVendorZipCode()); } else { LOG.error("populateRemitAddress: KFS Approved PVEN does not contain one and only one Active Remit Address for vendor " + vendorDetail.getVendorHeaderGeneratedIdentifier() + "-" + vendorDetail.getVendorDetailAssignedIdentifier()); } }
Source:
private static ApiResponseElement processLogs( String filePath, ExtensionImportLogFiles importer, LogType logType, String httpPOSTData) { String sourceFilePath = filePath; String targetfileName = sourceFilePath.substring( sourceFilePath.lastIndexOf("\\") + 1, sourceFilePath.lastIndexOf(".")) + ".txt"; String absoluteTargetFilePath = getLoggingStorageDirectory(logType) + "\\" + targetfileName; File targetFile = new File(absoluteTargetFilePath); if (!targetFile.isFile() ) { try { targetFile.createNewFile(); } catch (Exception ex) { return new ApiResponseElement( "Parsing logs files to ZAPs site tree", "Failed - Could not create file on server"); } } else { return new ApiResponseElement( "Parsing logs files to ZAPs site tree", "Not processed - File already added"); } if (httpPOSTData == null) { try (BufferedReader br = new BufferedReader(new FileReader(sourceFilePath)); BufferedWriter wr = new BufferedWriter(new FileWriter(targetFile))) { String sCurrentLine; while ((sCurrentLine = br.readLine()) != null) { wr.write(sCurrentLine); wr.newLine(); } } catch (IOException e) { log.error(e.getMessage(), e); } } else { try (FileOutputStream fop = new FileOutputStream(targetFile)) { byte[] contentInBytes = httpPOSTData.getBytes(); fop.write(contentInBytes); fop.flush(); fop.close(); } catch (IOException ex) { log.error(ex.getMessage(), ex); } } importer.processInput(targetFile, logType); return new ApiResponseElement("Parsing log files to ZAPs site tree", "Suceeded"); }

Target:
private static ApiResponseElement processLogs( String filePath, ExtensionImportLogFiles importer, LogType logType, String httpPOSTData) { String sourceFilePath = filePath; String targetfileName = sourceFilePath.substring( sourceFilePath.lastIndexOf("\\") + 1, sourceFilePath.lastIndexOf(".")) + ".txt"; String absoluteTargetFilePath = getLoggingStorageDirectory(logType) + "\\" + targetfileName; File targetFile = new File(absoluteTargetFilePath); if (!targetFile.isFile() ) { try { targetFile.createNewFile(); } catch (Exception ex) { return new ApiResponseElement( "Parsing logs files to ZAPs site tree", "Failed - Could not create file on server"); } } else { return new ApiResponseElement( "Parsing logs files to ZAPs site tree", "Not processed - File already added"); } if (httpPOSTData == null) { try (BufferedReader br = new BufferedReader(new FileReader(sourceFilePath)); BufferedWriter wr = new BufferedWriter(new FileWriter(targetFile))) { String sCurrentLine; while ((sCurrentLine = br.readLine()) != null) { wr.write(sCurrentLine); wr.newLine(); } } catch (IOException e) { log.error(e.getMessage(), e); } } else { try (FileOutputStream fop = new FileOutputStream(targetFile)) { byte[] contentInBytes = httpPOSTData.getBytes(); fop.write(contentInBytes); fop.flush(); } catch (IOException ex) { log.error(ex.getMessage(), ex); } } importer.processInput(targetFile, logType); return new ApiResponseElement("Parsing log files to ZAPs site tree", "Suceeded"); }
Source:
public void simpleTest() { VisibleAssertions.assertThrows("starting with an invalid docker-compose file throws an exception", IllegalStateException.class, () -> { DockerComposeContainer environment = new DockerComposeContainer(new File("src/test/resources/invalid-compose.yml")) .withExposedService("something", 123); }); }

Target:
public void simpleTest() { VisibleAssertions.assertThrows("starting with an invalid docker-compose file throws an exception", IllegalArgumentException.class, () -> { DockerComposeContainer environment = new DockerComposeContainer(new File("src/test/resources/invalid-compose.yml")) .withExposedService("something", 123); }); }
Source:
private void loadBufferAndDrawerState() { NetworkCollection networks = NetworkCollection.getInstance(); if (networks != null) { if (openedBuffer == -1 || networks.getBufferById(openedBuffer) == null) { Log.d(TAG, "Loading state: Empty"); openedBuffer = -1; BusProvider.getInstance().post(new BufferOpenedEvent(-1, false)); drawer.closeDrawer(Gravity.END); drawer.openDrawer(Gravity.START); } else { Log.d(TAG, "Loading state: "+openedBuffer); manager.openDrawer(openedDrawer); BusProvider.getInstance().post(new BufferOpenedEvent(openedBuffer, true)); } } }

Target:
private void loadBufferAndDrawerState() { NetworkCollection networks = NetworkCollection.getInstance(); if (networks != null) { if (openedBuffer == -1 || networks.getBufferById(openedBuffer) == null) { Log.d(TAG, "Loading state: Empty"); openedBuffer = -1; BusProvider.getInstance().post(new BufferOpenedEvent(-1, false)); manager.openDrawer(Gravity.START); } else { Log.d(TAG, "Loading state: "+openedBuffer); manager.openDrawer(openedDrawer); BusProvider.getInstance().post(new BufferOpenedEvent(openedBuffer, true)); } } }
Source:
public List<MassRepairOption> getActiveMassRepairOptions() { if (!hasActiveMassRepairOption()) { return new ArrayList<>(); } List<MassRepairOption> activeMassRepairOptions = new ArrayList<>(); for (MassRepairOption massRepairOption : getMassRepairOptions()) { if (massRepairOption.isActive()) { activeMassRepairOptions.add(massRepairOption); } } return activeMassRepairOptions; }

Target:
public List<MassRepairOption> getActiveMassRepairOptions() { if (!hasActiveMassRepairOption()) { return Collections.emptyList(); } List<MassRepairOption> activeMassRepairOptions = new ArrayList<>(); for (MassRepairOption massRepairOption : getMassRepairOptions()) { if (massRepairOption.isActive()) { activeMassRepairOptions.add(massRepairOption); } } return activeMassRepairOptions; }
Source:
public @NonNull ITmfCommonXAxisResponse fetchXY(@NonNull TimeQueryFilter filter, @Nullable IProgressMonitor monitor) { long[] xValues = filter.getTimesRequested(); int n = xValues.length; final double[] y = new double[n]; final long[] yLong = new long[n]; for (ITmfTrace trace : TmfTraceManager.getTraceSet(getTrace())) { final TmfStatisticsModule statsMod = TmfTraceUtils.getAnalysisModuleOfClass(trace, TmfStatisticsModule.class, TmfStatisticsModule.ID); if (statsMod == null) { continue; } statsMod.waitForInitialization(); final ITmfStatistics stats = Objects.requireNonNull(statsMod.getStatistics()); List<Long> values = stats.histogramQuery(filter.getStart(), filter.getEnd(), n); for (int i = 0; i < n; i++) { yLong[i] += values.get(i); } } for (int i = 0; i < n; i++) { y[i] = yLong[i]; } Map<String, IYModel> ySeries = new HashMap<>(); String name = "Number of events"; ySeries.put(name, new YModel(name, y)); return TmfCommonXAxisResponseFactory.create("New Histogram", xValues, ySeries, filter.getEnd(), true); }

Target:
public @NonNull ITmfCommonXAxisResponse fetchXY(@NonNull TimeQueryFilter filter, @Nullable IProgressMonitor monitor) { long[] xValues = filter.getTimesRequested(); int n = xValues.length; double[] y = new double[n]; long[] yLong = new long[n]; for (ITmfTrace trace : TmfTraceManager.getTraceSet(getTrace())) { final TmfStatisticsModule statsMod = TmfTraceUtils.getAnalysisModuleOfClass(trace, TmfStatisticsModule.class, TmfStatisticsModule.ID); if (statsMod == null) { continue; } statsMod.waitForInitialization(); final ITmfStatistics stats = Objects.requireNonNull(statsMod.getStatistics()); List<Long> values = stats.histogramQuery(filter.getStart(), filter.getEnd(), n); for (int i = 0; i < n; i++) { yLong[i] += values.get(i); } } for (int i = 0; i < n; i++) { y[i] = yLong[i]; } String title = Messages.HistogramDataProvider_Title; ImmutableMap.Builder<String, IYModel> ySeries = ImmutableMap.builder(); String seriesName = Messages.HistogramDataProvider_NumberOfEvent; ySeries.put(seriesName, new YModel(seriesName, y)); return TmfCommonXAxisResponseFactory.create(title, xValues, ySeries.build(), filter.getEnd(), true); }
Source:
public String getLocalTime(Date date) { Assert.notNull(date, "The provided date must not be null."); return CommonUtils.getLocalTime(date, this.clientTimeZone); }

Target:
public String getLocalTime(Date date) { return CommonUtils.getLocalTime(date, this.clientTimeZone); }