auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void recoverFromError() { VDS vds = DbFacade.getInstance().getVdsDao().get(getVdsId()); if (vds.getStatus() == VDSStatus.Error) { mFailedToRunVmAttempts.set(0); setStatus(VDSStatus.Up, vds); DbFacade.getInstance().getVdsDynamicDao().updateStatus(getVdsId(), VDSStatus.Up); log.infoFormat("Settings host {0} to up after {1} failed attempts to run a VM", vds.getName(), mFailedToRunVmAttempts); } }

Target:
public void recoverFromError() { VDS vds = DbFacade.getInstance().getVdsDao().get(getVdsId()); if (vds.getStatus() == VDSStatus.Error) { setStatus(VDSStatus.Up, vds); DbFacade.getInstance().getVdsDynamicDao().updateStatus(getVdsId(), VDSStatus.Up); log.infoFormat("Settings host {0} to up after {1} failed attempts to run a VM", vds.getName(), mFailedToRunVmAttempts); mFailedToRunVmAttempts.set(0); } }
Source:
protected PageableResult doSearch(RequestContext ctx) { List<Drug> drugs = Context.getConceptService().getDrugs(ctx.getParameter("q"), null, true, false, false, ctx.getStartIndex(), ctx.getLimit()); return new AlreadyPaged<Drug>(ctx, drugs, false); }

Target:
protected PageableResult doSearch(RequestContext ctx) { boolean searchOnPhrase = true; boolean searchDrugConceptNames = false; boolean includeRetired = ctx.getIncludeAll(); Integer startIndex = ctx.getStartIndex(); Integer limit = ctx.getLimit(); String drugName = ctx.getParameter("q"); Integer countOfDrugs = Context.getConceptService().getCountOfDrugs(drugName, null, searchOnPhrase, searchDrugConceptNames, includeRetired); List<Drug> drugs = Context.getConceptService().getDrugs(drugName, null, searchOnPhrase, searchDrugConceptNames, includeRetired, startIndex, limit); boolean hasMore = countOfDrugs > startIndex + limit; return new AlreadyPaged<Drug>(ctx, drugs, hasMore); }
Source:
public ITmfTimestamp normalize(final long offset, final int scale) { long value = fValue; if (fScale == scale && offset == 0) { return this; } if (this.equals(BIG_BANG) || this.equals(BIG_CRUNCH)) { return this; } if (fScale != scale) { final int scaleDiff = Math.abs(fScale - scale); if (scaleDiff >= scalingFactors.length) { throw new ArithmeticException("Scaling exception"); } final long scalingFactor = scalingFactors[scaleDiff]; if (scale < fScale) { value *= scalingFactor; } else { value /= scalingFactor; } } value = saturatedAdd(value, offset); return new TmfTimestamp(value, scale); }

Target:
public ITmfTimestamp normalize(final long offset, final int scale) { long value = getValue(); if (getScale() == scale && offset == 0) { return this; } if (this.equals(BIG_BANG) || this.equals(BIG_CRUNCH)) { return this; } if (value == 0) { return new TmfTimestamp(offset, scale); } if (getScale() != scale) { final int scaleDiff = Math.abs(getScale() - scale); if (scaleDiff >= scalingFactors.length) { if (getScale() < scale) { value = 0; } else { value = value > 0 ? Long.MAX_VALUE : Long.MIN_VALUE; } } else { final long scalingFactor = scalingFactors[scaleDiff]; if (getScale() < scale) { value /= scalingFactor; } else { value = saturatedMult(scalingFactor, value); } } } value = saturatedAdd(value, offset); return new TmfTimestamp(value, scale); }
Source:
public void init() { context.put(ExtensionProperties.AUTHOR, "oVirt"); context.put(ExtensionProperties.EXTENSION_NAME, "Internal Authentication"); context.put(ExtensionProperties.LICENSE, "ASL 2.0"); context.put(ExtensionProperties.HOME, "<LINK_0>"); context.put(ExtensionProperties.VERSION, "1.0"); }

Target:
public void init() { context.put(ExtensionProperties.AUTHOR, "The oVirt Project"); context.put(ExtensionProperties.EXTENSION_NAME, "Internal Authentication (Built-in)"); context.put(ExtensionProperties.LICENSE, "ASL 2.0"); context.put(ExtensionProperties.HOME, "<LINK_0>"); context.put(ExtensionProperties.VERSION, "N/A"); }
Source:
public void next(EdgeIteratorState edge, int index, int prevEdgeId) { for (i = 0; i < calculators.size(); i++) { calc = calculators.get(i); if (calc.edgeIsDifferentToLastEdge(edge)) { details.get(i).endInterval(numberOfPoints); details.get(i).startInterval(calc.getCurrentValue()); numberOfPoints = 0; } } numberOfPoints += edge.fetchWayGeometry(2).size(); }

Target:
public void next(EdgeIteratorState edge, int index, int prevEdgeId) { for (PathDetailsBuilder calc : calculators) { if (calc.isEdgeDifferentToLastEdge(edge)) { calc.endInterval(lastIndex); calc.startInterval(lastIndex); } } lastIndex += edge.fetchWayGeometry(2).size(); }
Source:
static int countBitstreamSmallerThanMinSize(Context context, BundleName bundleName, Item item, String mimeList, String prop) { long size = ConfigurationManager.getLongProperty("rest", prop); int count = 0; try { for(Bundle bundle: item.getBundles()){ if (!bundle.getName().equals(bundleName.name())){ continue; } for(Bitstream bit: bundle.getBitstreams()) { for(String mime: mimeList.split(",")) { if (bit.getFormat(context).getMIMEType().equals(mime)) { if (bit.getSize() < size) { count++; } } } } } } catch (SQLException e) { } return count; }

Target:
static int countBitstreamSmallerThanMinSize(Context context, BundleName bundleName, Item item, String mimeList, String prop) { long size = ConfigurationManager.getLongProperty("rest", prop); int count = 0; try { for(Bundle bundle: item.getBundles()){ if (!bundle.getName().equals(bundleName.name())){ continue; } for(Bitstream bit: bundle.getBitstreams()) { for(String mime: mimeList.split(",")) { if (bit.getFormat(context).getMIMEType().equals(mime.trim())) { if (bit.getSize() < size) { count++; } } } } } } catch (SQLException e) { } return count; }
Source:
public static TimestampFormat getTimestampFormat(ReadableConfig config){ String timestampFormat = config.get(TIMESTAMP_FORMAT); switch (timestampFormat){ case SQL: return TimestampFormat.SQL; case ISO_8601: return TimestampFormat.ISO_8601; } throw new TableException( String.format("Unsupported timestamp format '%s'. Validator should have checked that.", timestampFormat)); }

Target:
public static TimestampFormat getTimestampFormat(ReadableConfig config){ String timestampFormat = config.get(TIMESTAMP_FORMAT); switch (timestampFormat){ case SQL: return TimestampFormat.SQL; case ISO_8601: return TimestampFormat.ISO_8601; default: throw new TableException( String.format("Unsupported timestamp format '%s'. Validator should have checked that.", timestampFormat)); } }
Source:
private void addToAntiTombstoneCache(DataCell data) throws IOException{ long txnId=data.version(); if(antiTombstonedTxnRows.isEmpty() && !tombstonedTxnRows.contains(txnId) && isVisible(txnId)){ antiTombstonedTxnRows.add(txnId); } }

Target:
private void addToAntiTombstoneCache(DataCell data) throws IOException{ long txnId=data.version(); boolean empty = antiTombstonedTxnRow == null; boolean tombstoned = tombstonedTxnRow != null && tombstonedTxnRow == txnId; if(empty && !tombstoned && isVisible(txnId)){ antiTombstonedTxnRow = txnId; } }
Source:
private void showNendAdInterstitial() { NendAdInterstitialShowResult result = NendAdInterstitial.showAd(mActivity, new NendAdInterstitial.OnClickListener() { @Override public void onClick(NendAdInterstitialClickType clickType) { switch (clickType) { case CLOSE: adClosed(); break; case DOWNLOAD: adClosed(); adLeftApplication(); break; case INFORMATION: adClosed(); adLeftApplication(); break; default: break; } } }); switch (result) { case AD_SHOW_SUCCESS: adOpened(); break; case AD_SHOW_ALREADY: break; case AD_FREQUENCY_NOT_RECHABLE: break; case AD_REQUEST_INCOMPLETE: break; case AD_LOAD_INCOMPLETE: break; case AD_DOWNLOAD_INCOMPLETE: break; default: break; } }

Target:
private void showNendAdInterstitial() { NendAdInterstitialShowResult result = NendAdInterstitial.showAd(mActivity, new NendAdInterstitial.OnClickListener() { @Override public void onClick(NendAdInterstitialClickType clickType) { switch (clickType) { case CLOSE: adClosed(); break; case DOWNLOAD: adLeftApplication(); adClosed(); break; case INFORMATION: adLeftApplication(); adClosed(); break; default: break; } } }); switch (result) { case AD_SHOW_SUCCESS: adOpened(); break; case AD_SHOW_ALREADY: break; case AD_FREQUENCY_NOT_RECHABLE: break; case AD_REQUEST_INCOMPLETE: break; case AD_LOAD_INCOMPLETE: break; case AD_DOWNLOAD_INCOMPLETE: break; default: break; } }
Source:
public CatalogEntitySummary( @JsonProperty("symbolicName") String symbolicName, @JsonProperty("version") String version, @JsonProperty("name") String name, @JsonProperty("javaType") String javaType, @JsonProperty("planYaml") String planYaml, @JsonProperty("description") String description, @JsonProperty("iconUrl") String iconUrl, @JsonProperty("tags") Set<Object> tags, @JsonProperty("config") Set<EntityConfigSummary> config, @JsonProperty("sensors") Set<SensorSummary> sensors, @JsonProperty("effectors") Set<EffectorSummary> effectors, @JsonProperty("deprecated") boolean deprecated, @JsonProperty("links") Map<String, URI> links ) { super(symbolicName, version, name, javaType, planYaml, description, iconUrl, deprecated, links); this.tags = (tags == null) ? ImmutableList.of() : ImmutableList.<Object> copyOf(tags); this.config = config; this.sensors = sensors; this.effectors = effectors; }

Target:
public CatalogEntitySummary( @JsonProperty("symbolicName") String symbolicName, @JsonProperty("version") String version, @JsonProperty("name") String name, @JsonProperty("javaType") String javaType, @JsonProperty("planYaml") String planYaml, @JsonProperty("description") String description, @JsonProperty("iconUrl") String iconUrl, @JsonProperty("tags") Set<Object> tags, @JsonProperty("config") Set<EntityConfigSummary> config, @JsonProperty("sensors") Set<SensorSummary> sensors, @JsonProperty("effectors") Set<EffectorSummary> effectors, @JsonProperty("deprecated") boolean deprecated, @JsonProperty("links") Map<String, URI> links ) { super(symbolicName, version, name, javaType, planYaml, description, iconUrl, tags, deprecated, links); this.config = config; this.sensors = sensors; this.effectors = effectors; }
Source:
public FilterEntry(String eventName, boolean exclude, String transport, String name) { this.eventName = eventName; this.exclude = exclude; this.recipient = new Recipient(transport, name); }

Target:
public FilterEntry(String eventName, boolean exclude, String transport, String name) { this(eventName, exclude, new Recipient(transport, name)); }
Source:
private HtmlBlockModel getHtmlUnit() throws CourseContentNotValidException { try { courseData = executeStrict(courseAPI.getEnrolledCourses()).get(0); } catch (Exception e) { throw new RuntimeException(e); } String courseId = courseData.getCourse().getId(); CourseStructureV1Model model; try { model = executeStrict(courseAPI.getCourseStructure(config.getApiUrlVersionConfig().getBlocksApiVersion(), courseId)); } catch (Exception e) { throw new RuntimeException(e); } CourseComponent courseComponent = (CourseComponent) CourseAPI.normalizeCourseStructure(model, courseId); List<CourseComponent> htmlBlockUnits = new ArrayList<>(); courseComponent.fetchAllLeafComponents(htmlBlockUnits, EnumSet.of(BlockType.HTML)); return (HtmlBlockModel) htmlBlockUnits.get(0); }

Target:
private HtmlBlockModel getHtmlUnit() throws CourseContentNotValidException { String courseId = courseData.getCourse().getId(); CourseStructureV1Model model; try { model = executeStrict(courseAPI.getCourseStructure(config.getApiUrlVersionConfig().getBlocksApiVersion(), courseId)); } catch (Exception e) { throw new RuntimeException(e); } CourseComponent courseComponent = (CourseComponent) CourseAPI.normalizeCourseStructure(model, courseId); List<CourseComponent> htmlBlockUnits = new ArrayList<>(); courseComponent.fetchAllLeafComponents(htmlBlockUnits, EnumSet.of(BlockType.HTML)); return (HtmlBlockModel) htmlBlockUnits.get(0); }
Source:
static CacheEvictor create(AlluxioConfiguration conf) { return CommonUtils.createNewClassInstance( conf.getClass(PropertyKey.USER_CLIENT_CACHE_EVICTOR_CLASS), new Class[0], new Object[0]); }

Target:
static CacheEvictor create(AlluxioConfiguration conf) { return CommonUtils.createNewClassInstance( conf.getClass(PropertyKey.USER_CLIENT_CACHE_EVICTOR_CLASS), null, null); }
Source:
public void produceContent(ContentEncoder encoder, IOControl ioctrl) throws IOException { Objects.requireNonNull( encoder ); writer.out = encoder; writer.resumePendingWrites(); if ( writer.flowControlPushingBack ) { return; } while ( nextBodyToEncodeIndex < bodyParts.size() ) { JsonObject bodyPart = bodyParts.get( nextBodyToEncodeIndex++ ); gson.toJson( bodyPart, writer ); writer.insertNewline(); if ( writer.flowControlPushingBack ) { return; } } encoder.complete(); this.contentLength = writer.getTotalWrittenAndReset(); this.nextBodyToEncodeIndex = 0; }

Target:
public void produceContent(ContentEncoder encoder, IOControl ioctrl) throws IOException { Objects.requireNonNull( encoder ); writer.out = encoder; writer.resumePendingWrites(); if ( writer.flowControlPushingBack ) { return; } triggerFullWrite(); if ( writer.flowControlPushingBack ) { return; } writer.flushToOutput(); if ( writer.flowControlPushingBack ) { return; } encoder.complete(); this.nextBodyToEncodeIndex = 0; }
Source:
protected void executeCommand() { VDSStatus lastStatus = getVds().getStatus(); VDSReturnValue vdsReturnValue = null; try { setStatus(); if (StringUtils.isEmpty(getVds().getPmSecondaryIp())){ handleSingleAgent(lastStatus, vdsReturnValue); } else { if (getVds().isPmSecondaryConcurrent()){ handleMultipleConcurrentAgents(lastStatus, vdsReturnValue); } else { handleMultipleSequentialAgents(lastStatus, vdsReturnValue); } } setSucceeded(getFenceSucceeded()); } finally { if (!getSucceeded()) { setStatus(lastStatus); AlertIfPowerManagementOperationFailed(); } else if (EnumSet.of(FenceActionType.Restart, FenceActionType.Stop).contains(getParameters().getAction()) && getParameters().getKeepPolicyPMEnabled() == false){ getVds().setPowerManagementControlledByPolicy(false); DbFacade.getInstance().getVdsDynamicDao().update(getVds().getDynamicData()); } } }

Target:
protected void executeCommand() { VDSStatus lastStatus = getVds().getStatus(); VDSReturnValue vdsReturnValue = null; try { setStatus(); if (StringUtils.isEmpty(getVds().getPmSecondaryIp())){ handleSingleAgent(lastStatus, vdsReturnValue); } else { if (getVds().isPmSecondaryConcurrent()){ handleMultipleConcurrentAgents(lastStatus, vdsReturnValue); } else { handleMultipleSequentialAgents(lastStatus, vdsReturnValue); } } setSucceeded(getFenceSucceeded()); } finally { if (!getSucceeded()) { setStatus(lastStatus); AlertIfPowerManagementOperationFailed(); } else if ((getParameters().getAction() == FenceActionType.Restart || getParameters().getAction() == FenceActionType.Stop) && getParameters().getKeepPolicyPMEnabled() == false){ getVds().setPowerManagementControlledByPolicy(false); getDbFacade().getVdsDynamicDao().updateVdsDynamicPowerManagementPolicyFlag( getVdsId(), getVds().getDynamicData().isPowerManagementControlledByPolicy()); } } }
Source:
public String getSourceIP() { try { return InetAddress.getByAddress(getRawSourceIP()).getHostAddress(); } catch (UnknownHostException e) { return null; } }

Target:
public String getSourceIP() { try { return InetAddress.getByAddress(getRawSourceIP()).getHostAddress(); } catch (final UnknownHostException e) { return null; } }
Source:
private void refreshTopicMetadata() { TopicMetadataRequest request = new TopicMetadataRequest(Collections.singletonList(kafkaRequest.getTopic())); TopicMetadataResponse response = simpleConsumer.send(request); TopicMetadata metadata = response.topicsMetadata().get(0); for (PartitionMetadata partitionMetadata : metadata.partitionsMetadata()) { if (partitionMetadata.partitionId() == kafkaRequest.getPartition()) { simpleConsumer = new SimpleConsumer(partitionMetadata.leader().host(), partitionMetadata.leader().port(), CamusJob.getKafkaTimeoutValue(context), CamusJob.getKafkaBufferSize(context), CamusJob.getKafkaClientName(context)); break; } } }

Target:
private void refreshTopicMetadata() { TopicMetadataRequest request = new TopicMetadataRequest(Collections.singletonList(kafkaRequest.getTopic())); TopicMetadataResponse response; try { response = simpleConsumer.send(request); } catch (Exception e) { log.error("Exception caught when refreshing metadata for topic " + request.topics().get(0) + ": " + e.getMessage()); return; } TopicMetadata metadata = response.topicsMetadata().get(0); for (PartitionMetadata partitionMetadata : metadata.partitionsMetadata()) { if (partitionMetadata.partitionId() == kafkaRequest.getPartition()) { simpleConsumer = new SimpleConsumer(partitionMetadata.leader().host(), partitionMetadata.leader().port(), CamusJob.getKafkaTimeoutValue(context), CamusJob.getKafkaBufferSize(context), CamusJob.getKafkaClientName(context)); break; } } }
Source:
public void testHappyFlow() throws ProtocolAdapterException { BundleMessageDataContainerDto dto = new BundleMessageDataContainerDto(makeActions()); List<ActionResponseDto> result = callExecutors(dto); Assert.assertTrue(result != null); }

Target:
public void testHappyFlow() throws ProtocolAdapterException { final List<ActionDto> actionDtoList = this.makeActions(); BundleMessageDataContainerDto dto = new BundleMessageDataContainerDto(actionDtoList); List<ActionResponseDto> result = callExecutors(dto); Assert.assertTrue(result != null); Assert.assertEquals(actionDtoList.size(), result.size()); }
Source:
public boolean equals(final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) { return false; } final GroupByConfig gbconfig = (GroupByConfig) o; final boolean result = Objects.equal(aggregator, gbconfig.getAggregator()) && Objects.equal(infectious_nan, gbconfig.getInfectiousNan()) && Objects.equal(merge_ids, gbconfig.getMergeIds()) && Objects.equal(full_merge, gbconfig.getFullMerge()); if (!result) { return false; } Set<String> otherTagkeys = gbconfig.getTagKeys(); if (!Objects.equal(tag_keys, otherTagkeys)) { return false; } List<byte[]> otherEncodedkeys = gbconfig.getEncodedTagKeys(); if (encoded_tag_keys != null && otherEncodedkeys == null || encoded_tag_keys == null && otherEncodedkeys != null) { return false; } if (encoded_tag_keys != null) { if (!Arrays.deepEquals(encoded_tag_keys.toArray(), otherEncodedkeys.toArray())) { return false; } } return true; }

Target:
public boolean equals(final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) { return false; } final GroupByConfig gbconfig = (GroupByConfig) o; final boolean result = Objects.equal(aggregator, gbconfig.getAggregator()) && Objects.equal(infectious_nan, gbconfig.getInfectiousNan()) && Objects.equal(merge_ids, gbconfig.getMergeIds()) && Objects.equal(full_merge, gbconfig.getFullMerge()); if (!result) { return false; } Set<String> otherTagkeys = gbconfig.getTagKeys(); if (!Objects.equal(tag_keys, otherTagkeys)) { return false; } return true; }
Source:
public ContainerRequest filter(ContainerRequest request) { if (getAuthConfig().isEnabled()) { final String dataSourceName; if (request.getPath().startsWith("druid/indexer/v1/task/")) { final String taskId = request.getPathSegments().get(4).getPath(); Preconditions.checkNotNull(taskId); Optional<Task> taskOptional = taskStorageQueryAdapter.getTask(taskId); if (!taskOptional.isPresent()) { throw new WebApplicationException( Response.status(Response.Status.BAD_REQUEST) .entity(String.format("Cannot find any task with id: [%s]", taskId)) .build() ); } dataSourceName = taskOptional.get().getDataSource(); } else { throw new WebApplicationException( Response.status(Response.Status.BAD_REQUEST) .entity(String.format( "Do not know how to extract task information " + "for authorization check for request path: [%s]", request.getPath() )) .build() ); } final AuthorizationInfo authorizationInfo = (AuthorizationInfo) getReq().getAttribute(AuthConfig.DRUID_AUTH_TOKEN); Preconditions.checkNotNull( authorizationInfo, "Security is enabled but no authorization info found in the request" ); final Access authResult = authorizationInfo.isAuthorized( new Resource(dataSourceName, ResourceType.DATASOURCE), getAction(request) ); if (!authResult.isAllowed()) { throw new WebApplicationException(Response.status(Response.Status.FORBIDDEN) .entity( String.format("Access-Check-Result: %s", authResult.toString()) ) .build()); } } return request; }

Target:
public ContainerRequest filter(ContainerRequest request) { if (getAuthConfig().isEnabled()) { final String taskId = Preconditions.checkNotNull( request.getPathSegments() .get( Iterables.indexOf( request.getPathSegments(), new Predicate<PathSegment>() { @Override public boolean apply(PathSegment input) { return input.getPath().equals("task"); } } ) + 1 ).getPath() ); Optional<Task> taskOptional = taskStorageQueryAdapter.getTask(taskId); if (!taskOptional.isPresent()) { throw new WebApplicationException( Response.status(Response.Status.BAD_REQUEST) .entity(String.format("Cannot find any task with id: [%s]", taskId)) .build() ); } final String dataSourceName = Preconditions.checkNotNull(taskOptional.get().getDataSource()); final AuthorizationInfo authorizationInfo = (AuthorizationInfo) getReq().getAttribute(AuthConfig.DRUID_AUTH_TOKEN); Preconditions.checkNotNull( authorizationInfo, "Security is enabled but no authorization info found in the request" ); final Access authResult = authorizationInfo.isAuthorized( new Resource(dataSourceName, ResourceType.DATASOURCE), getAction(request) ); if (!authResult.isAllowed()) { throw new WebApplicationException(Response.status(Response.Status.FORBIDDEN) .entity( String.format("Access-Check-Result: %s", authResult.toString()) ) .build()); } } return request; }
Source:
public boolean performFinish() { try { IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IProject project = root.getProject(projectName); project.create(null); project.open(null); Bundle bundle = Platform.getBundle("info.limpet.sample_data"); if (bundle == null) { return true; } URL entry = bundle.getEntry("/"); File file = new File(FileLocator.resolve(entry).toURI()); if (file.isDirectory()) { CopyFilesAndFoldersOperation operation = new CopyFilesAndFoldersOperation( getShell()); List<URI> uris = new ArrayList<URI>(); File f = new File(file, "data"); if (f.isDirectory()) { uris.add(f.toURI()); } f = new File(file, "americas_cup"); if (f.isDirectory()) { uris.add(f.toURI()); } if (uris.size() == 0) { return true; } operation.copyFiles(uris.toArray(new URI[0]), project); } } catch (CoreException | URISyntaxException | IOException e) { MessageDialog.openError(getShell(), "Error", "Cannot create project. Reason: " + e.getMessage()); Activator.log(e); return false; } return true; }

Target:
public boolean performFinish() { try { IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IProject project = root.getProject(projectName); project.create(null); project.open(null); Bundle bundle = Platform.getBundle("info.limpet.sample_data"); if (bundle == null) { MessageDialog.openWarning(getShell(), "Warning", "The sample_data plugin is missing. Please check your installation"); return true; } URL entry = bundle.getEntry("/"); File file = new File(FileLocator.resolve(entry).toURI()); if (file.isDirectory()) { CopyFilesAndFoldersOperation operation = new CopyFilesAndFoldersOperation( getShell()); List<URI> uris = new ArrayList<URI>(); File f = new File(file, "data"); if (f.isDirectory()) { uris.add(f.toURI()); } f = new File(file, "americas_cup"); if (f.isDirectory()) { uris.add(f.toURI()); } if (uris.size() == 0) { return true; } operation.copyFiles(uris.toArray(new URI[0]), project); } } catch (CoreException | URISyntaxException | IOException e) { MessageDialog.openError(getShell(), "Error", "Cannot create project. Reason: " + e.getMessage()); Activator.log(e); return false; } return true; }
Source:
private List<Link> createLinksFrom(Object parseResult, String rel) { if (parseResult instanceof JSONArray) { return ((JSONArray) parseResult).stream() .flatMap(o -> { if (o instanceof JSONArray) { return ((JSONArray) o).stream(); } else { return Stream.of(o); } }) .map(element -> extractLink((Map<String, String>) element, rel)) .collect(Collectors.collectingAndThen(Collectors.toList(), Collections::unmodifiableList)); } else if (parseResult instanceof Map) { return Collections.singletonList(extractLink((Map<String, String>) parseResult, rel)); } return Collections.unmodifiableList(Collections.singletonList(new Link(parseResult.toString(), rel))); }

Target:
private List<Link> createLinksFrom(Object parseResult, String rel) { if (parseResult instanceof JSONArray) { return ((JSONArray) parseResult).stream() .flatMap(o -> { if (o instanceof JSONArray) { return ((JSONArray) o).stream(); } else { return Stream.of(o); } }) .map(element -> extractLink(element, rel)) .collect(Collectors.collectingAndThen(Collectors.toList(), Collections::unmodifiableList)); } else if (parseResult instanceof Map) { return Collections.singletonList(extractLink(parseResult, rel)); } return Collections.unmodifiableList(Collections.singletonList(new Link(parseResult.toString(), rel))); }
Source:
protected void unbufferedWrite(ChannelHandlerContext ctx, HttpStreamsHandler<HttpRequest, HttpResponse>.Outgoing out) { if (out.message instanceof WebSocketHttpResponse) { if ((lastRequest instanceof FullHttpRequest) || !hasBody(lastRequest)) { handleWebSocketResponse(ctx, out); } else { webSocketResponse = out; } } else { String connection = out.message.headers().get(HttpHeaders.Names.CONNECTION); if (lastRequest.getProtocolVersion().isKeepAliveDefault()) { if ("close".equalsIgnoreCase(connection)) { close = true; } } else { if (!"keep-alive".equalsIgnoreCase(connection)) { close = true; } } if (inFlight == 1 && continueExpected) { HttpHeaders.setKeepAlive(out.message, false); close = true; continueExpected = false; } int status = out.message.getStatus().code(); if (!HttpHeaders.isContentLengthSet(out.message) && !HttpHeaders.isTransferEncodingChunked(out.message) && !(status < 200 || status == 204 || status == 304)) { HttpHeaders.setKeepAlive(out.message, false); close = true; } super.unbufferedWrite(ctx, out); } }

Target:
protected void unbufferedWrite(ChannelHandlerContext ctx, HttpStreamsHandler<HttpRequest, HttpResponse>.Outgoing out) { if (out.message instanceof WebSocketHttpResponse) { if ((lastRequest instanceof FullHttpRequest) || !hasBody(lastRequest)) { handleWebSocketResponse(ctx, out); } else { webSocketResponse = out; } } else { String connection = out.message.headers().get(HttpHeaders.Names.CONNECTION); if (lastRequest.getProtocolVersion().isKeepAliveDefault()) { if ("close".equalsIgnoreCase(connection)) { close = true; } } else { if (!"keep-alive".equalsIgnoreCase(connection)) { close = true; } } if (inFlight == 1 && continueExpected) { HttpHeaders.setKeepAlive(out.message, false); close = true; continueExpected = false; } if (!HttpHeaders.isContentLengthSet(out.message) && !HttpHeaders.isTransferEncodingChunked(out.message) && canHaveBody(out.message)) { HttpHeaders.setKeepAlive(out.message, false); close = true; } super.unbufferedWrite(ctx, out); } }
Source:
public void validate(Object object, Errors errors) { ValidationUtils.rejectIfEmptyOrWhitespace(errors, "condition", "field.required"); ValidationUtils.rejectIfEmptyOrWhitespace(errors, "clinicalStatus", "field.required"); if(object == null){ throw new IllegalArgumentException("The object parameter should not be null"); } if(!(object instanceof Condition)){ throw new IllegalArgumentException("The object parameter should be of type " + Condition.class); } }

Target:
public void validate(Object object, Errors errors) { if(object == null){ throw new IllegalArgumentException("The object parameter should not be null"); } if(!(object instanceof Condition)){ throw new IllegalArgumentException("The object parameter should be of type " + Condition.class); } }
Source:
public final <R> Flowable<R> concatMapEager(Function<? super T, ? extends Publisher<? extends R>> mapper, int maxConcurrency, int prefetch) { ObjectHelper.verifyPositive(maxConcurrency, "maxConcurrency"); return RxJavaPlugins.onAssembly(new FlowableConcatMapEager<T, R>(this, mapper, maxConcurrency, prefetch, ErrorMode.IMMEDIATE)); }

Target:
public final <R> Flowable<R> concatMapEager(Function<? super T, ? extends Publisher<? extends R>> mapper, int maxConcurrency, int prefetch) { ObjectHelper.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(maxConcurrency, "maxConcurrency"); ObjectHelper.verifyPositive(prefetch, "prefetch"); return RxJavaPlugins.onAssembly(new FlowableConcatMapEager<T, R>(this, mapper, maxConcurrency, prefetch, ErrorMode.IMMEDIATE)); }
Source:
public Object execute(ExecutionEvent event) throws ExecutionException { IStructuredSelection selection = getSelection(getPage()); if (selection.size() < 1) return null; Object input = getInput(event); if (!(input instanceof IFile)) return null; IFile resource = (IFile) input; final RepositoryMapping map = RepositoryMapping.getMapping(resource); final String gitPath = map.getRepoRelativePath(resource); Iterator<?> it = selection.iterator(); boolean errorOccured = false; List<ObjectId> ids = new ArrayList<ObjectId>(); while (it.hasNext()) { RevCommit commit = (RevCommit) it.next(); IFileRevision rev = null; try { rev = CompareUtils.getFileRevision(gitPath, commit, map .getRepository(), null); } catch (IOException e) { Activator.logError(NLS.bind( UIText.GitHistoryPage_errorLookingUpPath, gitPath, commit.getId()), e); errorOccured = true; } if (rev != null) { try { EgitUiEditorUtils.openTextEditor(getPart(event).getSite() .getPage(), rev, null); } catch (CoreException e) { Activator.logError(e.getMessage(), e); errorOccured = true; } } else { ids.add(commit.getId()); } } if (errorOccured) Activator.showError(UIText.GitHistoryPage_openFailed, null); if (ids.size() > 0) { String idList = ""; for (ObjectId objectId : ids) { idList += objectId.getName() + " "; } MessageDialog.openError(getPart(event).getSite().getShell(), UIText.GitHistoryPage_fileNotFound, NLS.bind( UIText.GitHistoryPage_notContainedInCommits, gitPath, idList)); } return null; }

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { IStructuredSelection selection = getSelection(getPage()); if (selection.size() < 1) return null; Object input = getInput(event); if (!(input instanceof IFile)) return null; IFile resource = (IFile) input; final RepositoryMapping map = RepositoryMapping.getMapping(resource); final String gitPath = map.getRepoRelativePath(resource); Iterator<?> it = selection.iterator(); boolean errorOccured = false; List<ObjectId> ids = new ArrayList<ObjectId>(); while (it.hasNext()) { RevCommit commit = (RevCommit) it.next(); IFileRevision rev = null; try { rev = CompareUtils.getFileRevision(gitPath, commit, map .getRepository(), null); } catch (IOException e) { Activator.logError(NLS.bind( UIText.GitHistoryPage_errorLookingUpPath, gitPath, commit.getId()), e); errorOccured = true; } if (rev != null) { try { EgitUiEditorUtils.openTextEditor(getPart(event).getSite() .getPage(), rev, null); } catch (CoreException e) { Activator.logError(e.getMessage(), e); errorOccured = true; } } else { ids.add(commit.getId()); } } if (errorOccured) Activator.showError(UIText.GitHistoryPage_openFailed, null); if (ids.size() > 0) { String idList = ""; for (ObjectId objectId : ids) idList += objectId.getName() + " "; MessageDialog.openError(getPart(event).getSite().getShell(), UIText.GitHistoryPage_fileNotFound, NLS.bind( UIText.GitHistoryPage_notContainedInCommits, gitPath, idList)); } return null; }
Source:
public String pkToJsonArray() throws IOException { JsonGenerator g = jsonGeneratorThreadLocal.get(); g.writeStartArray(); g.writeString(database); g.writeString(table); g.writeStartArray(); for (String pk : pkColumns) { Object pkValue = null; if ( data.containsKey(pk) ) pkValue = data.get(pk); g.writeStartObject(); g.writeObjectField(pk.toLowerCase(), pkValue); g.writeEndObject(); } g.writeEndArray(); g.writeEndArray(); g.flush(); return jsonFromStream(); }

Target:
private String pkToJsonArray() throws IOException { JsonGenerator g = jsonGeneratorThreadLocal.get(); g.writeStartArray(); g.writeString(database); g.writeString(table); g.writeStartArray(); for (String pk : pkColumns) { Object pkValue = null; if ( data.containsKey(pk) ) pkValue = data.get(pk); g.writeStartObject(); g.writeObjectField(pk.toLowerCase(), pkValue); g.writeEndObject(); } g.writeEndArray(); g.writeEndArray(); g.flush(); return jsonFromStream(); }
Source:
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) { if (sourceViewer == null) { return null; } Map<?, ?> targets = getHyperlinkDetectorTargets(sourceViewer); HyperlinkDetectorRegistry hlDetectorRegistry = EditorsUI.getHyperlinkDetectorRegistry(); HyperlinkDetectorDescriptor[] hlDetectorDescriptor = hlDetectorRegistry.getHyperlinkDetectorDescriptors(); List<IHyperlinkDetector> tempHDList = new ArrayList<IHyperlinkDetector>(); for (Object key : targets.keySet()) { for (HyperlinkDetectorDescriptor hdd : hlDetectorDescriptor) { try { AbstractHyperlinkDetector ahld = hdd.createHyperlinkDetector(); if (hdd.getTargetId().equals(key) && !(ahld instanceof URLHyperlinkDetector)) { ahld.setContext((IAdaptable)targets.get(key)); tempHDList.add(ahld); } } catch (CoreException e) { SpecfileLog.logError(e); } } } if (!tempHDList.isEmpty()) { IHyperlinkDetector[] rc = new IHyperlinkDetector[tempHDList.size()]; rc = tempHDList.toArray(rc); return rc; } else { return null; } }

Target:
public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) { if (sourceViewer == null) { return null; } Map<?, ?> targets = getHyperlinkDetectorTargets(sourceViewer); HyperlinkDetectorRegistry hlDetectorRegistry = EditorsUI.getHyperlinkDetectorRegistry(); HyperlinkDetectorDescriptor[] hlDetectorDescriptor = hlDetectorRegistry.getHyperlinkDetectorDescriptors(); List<IHyperlinkDetector> tempHDList = new ArrayList<IHyperlinkDetector>(); for (Map.Entry<?, ?> entry : targets.entrySet()) { for (HyperlinkDetectorDescriptor hdd : hlDetectorDescriptor) { try { AbstractHyperlinkDetector ahld = hdd.createHyperlinkDetector(); if (hdd.getTargetId().equals(entry.getKey()) && !(ahld instanceof URLHyperlinkDetector)) { ahld.setContext((IAdaptable)entry.getValue()); tempHDList.add(ahld); } } catch (CoreException e) { SpecfileLog.logError(e); } } } if (!tempHDList.isEmpty()) { IHyperlinkDetector[] rc = new IHyperlinkDetector[tempHDList.size()]; rc = tempHDList.toArray(rc); return rc; } else { return null; } }
Source:
public void orderFromCartDraft(){ withFilledCart(client(), cart -> { final OrderFromCartDraft orderFromCartDraft = OrderFromCartDraftBuilder.of(cart.getId(),cart.getVersion() ).shipmentState(ShipmentState.SHIPPED).build(); final Order order = client().executeBlocking(OrderFromCartCreateCommand.of(cart).withDraft(orderFromCartDraft)); assertThat(order).isNotNull(); assertThat(order.getShipmentState()).isEqualByComparingTo(ShipmentState.SHIPPED); }); }

Target:
public void orderFromCartDraft(){ withFilledCart(client(), cart -> { final OrderFromCartDraft orderFromCartDraft = OrderFromCartDraftBuilder.of(cart.getId(),cart.getVersion() ).shipmentState(ShipmentState.SHIPPED).build(); final Order order = client().executeBlocking(OrderFromCartCreateCommand.of(cart).withDraft(orderFromCartDraft)); assertThat(order).isNotNull(); assertThat(order.getShipmentState()).isEqualTo(ShipmentState.SHIPPED); }); }
Source:
public String getQuestionResultStatisticsHtml(List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question, String studentEmail, FeedbackSessionResultsBundle bundle, String view) { if ("student".equals(view) || responses.isEmpty()) { return ""; } Map<String, Integer> answerFrequency = new LinkedHashMap<String, Integer>(); int numChoicesSelected = getQuestionResultStatistics(responses, answerFrequency); if (numChoicesSelected == -1) { return ""; } else { DecimalFormat df = new DecimalFormat("#.##"); StringBuilder fragments = new StringBuilder(); for (Entry<String, Integer> entry : answerFrequency.entrySet()) { fragments.append(Templates.populateTemplate(FormTemplates.MCQ_RESULT_STATS_OPTIONFRAGMENT, Slots.MCQ_CHOICE_VALUE, entry.getKey(), Slots.COUNT, entry.getValue().toString(), Slots.PERCENTAGE, df.format(100 * divideOrReturnZero(numChoicesSelected, (double) entry.getValue())))); } return Templates.populateTemplate(FormTemplates.MCQ_RESULT_STATS, Slots.FRAGMENTS, fragments.toString()); } }

Target:
public String getQuestionResultStatisticsHtml(List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question, String studentEmail, FeedbackSessionResultsBundle bundle, String view) { if ("student".equals(view) || responses.isEmpty()) { return ""; } Map<String, Integer> answerFrequency = new LinkedHashMap<String, Integer>(); int totalChoicesSelected = getQuestionResultStatistics(responses, answerFrequency); if (totalChoicesSelected == -1) { return ""; } DecimalFormat df = new DecimalFormat("#.##"); StringBuilder fragments = new StringBuilder(); for (Entry<String, Integer> entry : answerFrequency.entrySet()) { fragments.append(Templates.populateTemplate(FormTemplates.MCQ_RESULT_STATS_OPTIONFRAGMENT, Slots.MCQ_CHOICE_VALUE, entry.getKey(), Slots.COUNT, entry.getValue().toString(), Slots.PERCENTAGE, df.format(100 * divideOrReturnZero((double) entry.getValue(), totalChoicesSelected)))); } return Templates.populateTemplate(FormTemplates.MCQ_RESULT_STATS, Slots.FRAGMENTS, fragments.toString()); }
Source:
protected void executeQueryCommand() { clusterId = getParameters().getClusterId(); detailRequired = getParameters().isDetailRequired(); volumeId = getParameters().getVolumeId(); if (volumeId != null) { GlusterVolumeEntity volume = getGlusterVolumeDao().getById(volumeId); if (volume == null) { throw new RuntimeException(String.format("Invalid volume id %s", volumeId)); } brick = getBrick(getParameters().getBrickId()); getQueryReturnValue().setReturnValue(fetchAdvancedDetails(volume.getName())); } else { GlusterVolumeAdvancedDetails serviceDetails = getServiceInfo(); if (serviceDetails != null) { List<GlusterServerService> serviceList = serviceDetails.getServiceInfo(); if (serviceList != null) { for (GlusterServerService service : serviceList) { String hostName = GlusterDBUtils.getInstance().getHostNameOrIP(service.getGlusterHostUuid()); if (hostName != null) { service.setHostName(hostName); } } } } getQueryReturnValue().setReturnValue(serviceDetails); } }

Target:
protected void executeQueryCommand() { clusterId = getParameters().getClusterId(); detailRequired = getParameters().isDetailRequired(); volumeId = getParameters().getVolumeId(); if (volumeId != null) { GlusterVolumeEntity volume = getGlusterVolumeDao().getById(volumeId); if (volume == null) { throw new RuntimeException(VdcBllMessages.GLUSTER_VOLUME_ID_INVALID.toString()); } brick = getBrick(getParameters().getBrickId()); getQueryReturnValue().setReturnValue(fetchAdvancedDetails(volume.getName())); } else { GlusterVolumeAdvancedDetails advancedDetails = getServiceInfo(); if (advancedDetails != null) { List<GlusterServerService> serviceList = advancedDetails.getServiceInfo(); if (serviceList != null) { for (GlusterServerService service : serviceList) { String hostName = GlusterDBUtils.getInstance().getHostNameOrIP(service.getGlusterHostUuid()); if (hostName != null) { service.setHostName(hostName); } } } } getQueryReturnValue().setReturnValue(advancedDetails); } }
Source:
public void validate() { if (coreThreads < 0) throw log.illegalValueThreadPoolParameter("core threads", ">= 0"); if (maxThreads <= 0) throw log.illegalValueThreadPoolParameter("max threads", "> 0"); if (maxThreads < coreThreads) throw log.illegalValueThreadPoolParameter( "max threads and core threads", "max threads >= core threads"); if (keepAlive < 0) throw log.illegalValueThreadPoolParameter("keep alive time", ">= 0"); }

Target:
public void validate() { if (coreThreads < 0) throw log.illegalValueThreadPoolParameter("core threads", ">= 0"); if (maxThreads <= 0) throw log.illegalValueThreadPoolParameter("max threads", "> 0"); if (maxThreads < coreThreads) throw log.illegalValueThreadPoolParameter( "max threads and core threads", "max threads >= core threads"); if (keepAlive < 0) throw log.illegalValueThreadPoolParameter("keep alive time", ">= 0"); if (queueLength < 0) throw log.illegalValueThreadPoolParameter("work queue length", ">= 0"); }
Source:
protected State setupAction(AnActionEvent e) { State state = new State(); Project project = e.getProject(); state.myIdeFrame = WindowManagerEx.getInstanceEx().findFrameFor(project); if (e.getProject() == ProjectManager.getInstance().getDefaultProject()) { state.myStateComponent = e.getProject().getComponent(ApplicationStateComponent.class); state.myNavigationHelper = new ApplicationNavigationUtil(state.myIdeFrame); } else { state.myStateComponent = e.getProject().getComponent(ProjectStateComponent.class); state.myNavigationHelper = new ProjectNavigationUtil(e.getProject(), state.myIdeFrame); } state.myTaskContext = e; return state; }

Target:
protected State setupAction(AnActionEvent e) { State state = new State(); Project project = e.getProject(); state.myIdeFrame = WindowManagerEx.getInstanceEx().findFrameFor(project); if (e.getProject() == null) { state.myStateComponent = ApplicationManager.getApplication().getComponent(ApplicationComponent.class); state.myNavigationHelper = new ApplicationNavigationUtil((JFrame)state.myIdeFrame); } else { state.myStateComponent = e.getProject().getComponent(ProjectComponent.class); state.myNavigationHelper = new ProjectNavigationUtil(e.getProject(), (JFrame)state.myIdeFrame); } state.myTaskContext = e; return state; }
Source:
void onDateChanged(final Moment nativeDate) { getInputBind().value = nativeDate.format("HH:mm:ss"); if (!Objects.isNull(onDateChanged)) { onDateChanged.accept(nativeDate); } }

Target:
void onDateChanged(final Moment nativeDate) { getInputBind().value = nativeDate.format(TIME_FORMAT); if (!Objects.isNull(onDateChanged)) { onDateChanged.accept(nativeDate); } }
Source:
private int executeIncrementalLoad(DriverContext driverContext) { try { if (work.needCleanTablesFromBootstrap) { cleanTablesFromBootstrap(); work.needCleanTablesFromBootstrap = false; } IncrementalLoadTasksBuilder builder = work.incrementalLoadTasksBuilder(); if (!builder.hasMoreWork() && !work.getPathsToCopyIterator().hasNext()) { if (work.hasBootstrapLoadTasks()) { LOG.debug("Current incremental dump have tables to be bootstrapped. Switching to bootstrap " + "mode after applying all events."); return executeBootStrapLoad(driverContext, true); } } List<Task<? extends Serializable>> childTasks = new ArrayList<>(); int maxTasks = conf.getIntVar(HiveConf.ConfVars.REPL_APPROX_MAX_LOAD_TASKS); TaskTracker tracker = new TaskTracker(maxTasks); if (work.getPathsToCopyIterator().hasNext()) { childTasks.addAll(new ExternalTableCopyTaskBuilder(work, conf).tasks(tracker)); } else { childTasks.add(builder.build(driverContext, getHive(), LOG, tracker)); } if (builder.hasMoreWork() || work.getPathsToCopyIterator().hasNext() || work.hasBootstrapLoadTasks()) { DAGTraversal.traverse(childTasks, new AddDependencyToLeaves(TaskFactory.get(work, conf))); } this.childTasks = childTasks; return 0; } catch (Exception e) { LOG.error("failed replication", e); setException(e); return 1; } }

Target:
private int executeIncrementalLoad(DriverContext driverContext) { try { if (work.needCleanTablesFromBootstrap) { cleanTablesFromBootstrap(); work.needCleanTablesFromBootstrap = false; } IncrementalLoadTasksBuilder builder = work.incrementalLoadTasksBuilder(); if (!builder.hasMoreWork() && !work.getPathsToCopyIterator().hasNext()) { if (work.hasBootstrapLoadTasks()) { LOG.debug("Current incremental dump have tables to be bootstrapped. Switching to bootstrap " + "mode after applying all events."); return executeBootStrapLoad(driverContext); } } List<Task<? extends Serializable>> childTasks = new ArrayList<>(); int maxTasks = conf.getIntVar(HiveConf.ConfVars.REPL_APPROX_MAX_LOAD_TASKS); TaskTracker tracker = new TaskTracker(maxTasks); if (work.getPathsToCopyIterator().hasNext()) { childTasks.addAll(new ExternalTableCopyTaskBuilder(work, conf).tasks(tracker)); } else { childTasks.add(builder.build(driverContext, getHive(), LOG, tracker)); } if (builder.hasMoreWork() || work.getPathsToCopyIterator().hasNext() || work.hasBootstrapLoadTasks()) { DAGTraversal.traverse(childTasks, new AddDependencyToLeaves(TaskFactory.get(work, conf))); } this.childTasks = childTasks; return 0; } catch (Exception e) { LOG.error("failed replication", e); setException(e); return 1; } }
Source:
public Builder withHeader(Map<String, Object> headerClaims) { if (headerClaims == null) return this; for (Map.Entry<String, Object> entry : headerClaims.entrySet()) { if (entry.getValue() == null) { this.headerClaims.remove(entry.getKey()); } else { this.headerClaims.put(entry.getKey(), entry.getValue()); } } return this; }

Target:
public Builder withHeader(Map<String, Object> headerClaims) { if (headerClaims == null) { return this; } for (Map.Entry<String, Object> entry : headerClaims.entrySet()) { if (entry.getValue() == null) { this.headerClaims.remove(entry.getKey()); } else { this.headerClaims.put(entry.getKey(), entry.getValue()); } } return this; }
Source:
protected void setComparator(Comparator comparator) { this.comparator = comparator; Iterable items = getItems(); if (items == null) { return; } Iterable identicalItems = (comparator == null) ? new ArrayList() : new TreeSet(comparator); for (Object item : items) { setItems(identicalItems); } }

Target:
protected void setComparator(Comparator comparator) { if (comparator == this.comparator) { return; } this.comparator = comparator; Iterable items = getItems(); if (items == null) { return; } Collection identicalItems = (comparator == null) ? new ArrayList() : new TreeSet(comparator); for (Object item : items) { identicalItems.add(item); } setItems(identicalItems); }
Source:
public OpaqueBlocksNode(Context context) { renderQueues = context.get(RenderQueuesHelper.class); worldRenderer = context.get(WorldRenderer.class); wireframeStateChange = new SetWireframe(true); renderingDebugConfig = context.get(Config.class).getRendering().getDebug(); new WireframeTrigger(renderingDebugConfig, this); playerCamera = worldRenderer.getActiveCamera(); addDesiredStateChange(new LookThrough(playerCamera)); addDesiredStateChange(new BindFBO(READONLY_GBUFFER, context.get(DisplayResolutionDependentFBOs.class))); addDesiredStateChange(new EnableMaterial(CHUNK_MATERIAL)); chunkShader = getMaterial(CHUNK_MATERIAL); }

Target:
public OpaqueBlocksNode(Context context) { renderQueues = context.get(RenderQueuesHelper.class); wireframeStateChange = new SetWireframe(true); renderingDebugConfig = context.get(Config.class).getRendering().getDebug(); new WireframeTrigger(renderingDebugConfig, this); worldRenderer = context.get(WorldRenderer.class); playerCamera = worldRenderer.getActiveCamera(); addDesiredStateChange(new LookThrough(playerCamera)); addDesiredStateChange(new BindFBO(READONLY_GBUFFER, context.get(DisplayResolutionDependentFBOs.class))); addDesiredStateChange(new EnableMaterial(CHUNK_MATERIAL)); chunkMaterial = getMaterial(CHUNK_MATERIAL); }
Source:
public long currentTimeMicros() { FetchedTime spec = lastFetchedTime.get(); long curNano = System.nanoTime(); if (curNano > spec.nanoTimeAtCheck + ONE_SECOND_NS) { spec = fetchTimeMicros(); lastFetchedTime.set(spec); } return spec.timeInMicros + ((curNano - spec.nanoTimeAtCheck) / 1000); }

Target:
public long currentTimeMicros() { FetchedTime spec = lastFetchedTime.get(); long curNano = System.nanoTime(); if (curNano > spec.nanoTimeAtCheck + ONE_SECOND_NS) { lastFetchedTime.compareAndSet(spec, spec = fetchTimeMicros()); } return spec.timeInMicros + ((curNano - spec.nanoTimeAtCheck) / 1000); }