auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void processValid(T tuple, Slice value) { if (!orderedOutput || waitingEvents.isEmpty()) { if (value == null) { managedState.put(getTime(tuple), getKey(tuple), getKey(tuple)); processUnique(tuple); } else { processDuplicate(tuple); } } else { processWaitingEvent(tuple, Futures.immediateFuture(value)); } }

Target:
protected void processValid(T tuple, Slice value) { if (!preserveTupleOrder || waitingEvents.isEmpty()) { if (value == null) { managedState.put(getTime(tuple), getKey(tuple), new Slice(new byte[0])); processUnique(tuple); } else { processDuplicate(tuple); } } else { processWaitingEvent(tuple, Futures.immediateFuture(value)); } }
Source:
public File userHome() { if (userHome == null) { userHome = userHomeImpl(); } return userHome; }

Target:
public File userHome() { return userHome; }
Source:
public static InMemoryEvent toEvent(Event event) { return event == null ? null : Mappers.getMapper(InMemoryEventMapper.class).map(event); }

Target:
public static InMemoryEvent toEvent(Event event) { return event == null ? null : inMemoryEventMapper.map(event); }
Source:
OverlordResourceTestClient( ObjectMapper jsonMapper, @TestClient HttpClient httpClient, IntegrationTestingConfig config ) { this.jsonMapper = jsonMapper; this.httpClient = httpClient; this.indexer = config.getIndexerUrl(); this.responseHandler = StatusResponseHandler.getInstance(); }

Target:
OverlordResourceTestClient( ObjectMapper jsonMapper, @TestClient HttpClient httpClient, IntegrationTestingConfig config ) { this.jsonMapper = jsonMapper; this.httpClient = httpClient; this.indexer = config.getIndexerUrl(); }
Source:
public void closeTable() throws IOException { try { if (table != null) { table.close(); } if (connection != null) { connection.close(); } } catch (IOException e) { if (connection != null) { connection.close(); } throw e; } finally { table = null; connection = null; } }

Target:
public void closeTable() { if (table != null) { try { table.close(); } catch (IOException e) { LOG.warn("Exception occurs while closing HBase Table.", e); } table = null; } if (connection != null) { try { connection.close(); } catch (IOException e) { LOG.warn("Exception occurs while closing HBase Connection.", e); } connection = null; } }
Source:
public BoxArray() { super(); mProperties.put(FIELD_ENTRIES, collection); }

Target:
public BoxArray() { super(); }
Source:
public static MethodReference getBuilderFinisherMethod(Method method, BuilderType builderType, MappingBuilderContext ctx) { Collection<ExecutableElement> buildMethods = builderType.getBuildMethods(); if ( buildMethods.isEmpty() ) { return null; } else if ( buildMethods.size() == 1 ) { return MethodReference.forMethodCall( first( buildMethods ).getSimpleName().toString() ); } else { BuilderMappingPrism builderMapping = builderMappingPrism( method, ctx ); String buildMethodPattern = "build"; if ( builderMapping != null ) { buildMethodPattern = builderMapping.builderFinisher(); } for ( ExecutableElement buildMethod : buildMethods ) { String methodName = buildMethod.getSimpleName().toString(); if ( methodName.matches( buildMethodPattern ) ) { return MethodReference.forMethodCall( methodName ); } } if ( builderMapping == null ) { ctx.getMessager().printMessage( method.getExecutable(), Message.BUILDER_MORE_THAN_ONE_BUILD_METHOD_DEFAULT_PATTERN, builderType.getBuilder(), builderType.getBuildingType(), Strings.join( buildMethods, ", " ) ); } else { ctx.getMessager().printMessage( method.getExecutable(), builderMapping.mirror, Message.BUILDER_MORE_THAN_ONE_BUILD_METHOD_DEFINED_PATTERN, builderType.getBuilder(), builderType.getBuildingType(), Strings.join( buildMethods, ", " ), buildMethodPattern ); } } return null; }

Target:
public static MethodReference getBuilderFinisherMethod(Method method, BuilderType builderType, MappingBuilderContext ctx) { Collection<ExecutableElement> buildMethods = builderType.getBuildMethods(); if ( buildMethods.isEmpty() ) { return null; } BuilderPrism builderMapping = builderMappingPrism( method, ctx ); if ( builderMapping == null && buildMethods.size() == 1 ) { return MethodReference.forMethodCall( first( buildMethods ).getSimpleName().toString() ); } else { String buildMethodPattern = DEFAULT_BUILD_METHOD_NAME; if ( builderMapping != null ) { buildMethodPattern = builderMapping.buildMethod(); } for ( ExecutableElement buildMethod : buildMethods ) { String methodName = buildMethod.getSimpleName().toString(); if ( methodName.matches( buildMethodPattern ) ) { return MethodReference.forMethodCall( methodName ); } } if ( builderMapping == null ) { ctx.getMessager().printMessage( method.getExecutable(), Message.BUILDER_NO_BUILD_METHOD_FOUND_DEFAULT, buildMethodPattern, builderType.getBuilder(), builderType.getBuildingType(), Strings.join( buildMethods, ", " ) ); } else { ctx.getMessager().printMessage( method.getExecutable(), builderMapping.mirror, Message.BUILDER_NO_BUILD_METHOD_FOUND, buildMethodPattern, builderType.getBuilder(), builderType.getBuildingType(), Strings.join( buildMethods, ", " ) ); } } return null; }
Source:
public IReconcilingStrategy getReconcilingStrategy(String contentType) { return new CompositeReconcilerStrategy(fReconcilers, contentType); }

Target:
public IReconcilingStrategy getReconcilingStrategy(String contentType) { if(fReconcilers.size() == 1) { return fReconcilers.get(0).getReconcilingStrategy(contentType); } List<IReconcilingStrategy> strategies = new ArrayList<>(); for (IReconciler iReconciler : fReconcilers) { IReconcilingStrategy strategy = iReconciler.getReconcilingStrategy(contentType); if(strategy != null) { strategies.add(strategy); } } return new CompositeReconcilerStrategy(strategies); }
Source:
public List<StreamsDatum> process(StreamsDatum entry) { List<StreamsDatum> result = Lists.newArrayList(); String json = null; LOGGER.debug("{} processing {}", STREAMS_ID); if( entry.getDocument() instanceof ObjectNode ) { ObjectNode node = (ObjectNode) entry.getDocument(); try { json = mapper.writeValueAsString(node); } catch (JsonProcessingException e) { e.printStackTrace(); } } else if( entry.getDocument() instanceof String ) { json = (String) entry.getDocument(); } if( StringUtils.isNotEmpty(json)) { try { Object readResult = jsonPath.read(json); if (readResult instanceof String) { String match = (String) readResult; StreamsDatum matchDatum = new StreamsDatum(match); result.add(matchDatum); } else if (readResult instanceof JSONObject) { JSONObject match = (JSONObject) readResult; ObjectNode objectNode = mapper.readValue(mapper.writeValueAsString(match), ObjectNode.class); StreamsDatum matchDatum = new StreamsDatum(objectNode); result.add(matchDatum); } else if (readResult instanceof JSONArray) { JSONArray array = (JSONArray) readResult; Iterator iterator = array.iterator(); while (iterator.hasNext()) { Object item = iterator.next(); if( item instanceof String ) { String match = (String) item; StreamsDatum matchDatum = new StreamsDatum(match); result.add(matchDatum); } else if ( item instanceof JSONObject ) { StreamsDatum matchDatum = new StreamsDatum(item); result.add(matchDatum); } } } else { } } catch( Exception e ) { e.printStackTrace(); LOGGER.warn(e.getMessage()); } } return result; }

Target:
public List<StreamsDatum> process(StreamsDatum entry) { List<StreamsDatum> result = Lists.newArrayList(); String json = null; LOGGER.debug("{} processing {}", STREAMS_ID); if( entry.getDocument() instanceof ObjectNode ) { ObjectNode node = (ObjectNode) entry.getDocument(); try { json = mapper.writeValueAsString(node); } catch (JsonProcessingException e) { LOGGER.warn(e.getMessage()); } } else if( entry.getDocument() instanceof String ) { json = (String) entry.getDocument(); } if( StringUtils.isNotEmpty(json)) { try { Object readResult = jsonPath.read(json); if (readResult instanceof String) { String match = (String) readResult; StreamsDatum matchDatum = new StreamsDatum(match); result.add(matchDatum); } else if (readResult instanceof JSONObject) { JSONObject match = (JSONObject) readResult; ObjectNode objectNode = mapper.readValue(mapper.writeValueAsString(match), ObjectNode.class); StreamsDatum matchDatum = new StreamsDatum(objectNode); result.add(matchDatum); } else if (readResult instanceof JSONArray) { JSONArray array = (JSONArray) readResult; Iterator iterator = array.iterator(); while (iterator.hasNext()) { Object item = iterator.next(); if( item instanceof String ) { String match = (String) item; StreamsDatum matchDatum = new StreamsDatum(match); result.add(matchDatum); } else if ( item instanceof JSONObject ) { JSONObject match = (JSONObject) item; ObjectNode objectNode = mapper.readValue(mapper.writeValueAsString(match), ObjectNode.class); StreamsDatum matchDatum = new StreamsDatum(objectNode); result.add(matchDatum); } } } else { } } catch( Exception e ) { LOGGER.warn(e.getMessage()); } } return result; }
Source:
protected void AddDiskImageToDb(DiskImage image) { try { DbFacade.getInstance().getDiskImageDAO().save(image); DbFacade.getInstance().getImageVmMapDAO().save( new image_vm_map(image.getactive(), image.getId(), image.getvm_guid())); DiskImageDynamic diskDynamic = new DiskImageDynamic(); diskDynamic.setId(image.getId()); diskDynamic.setactual_size(image.getactual_size()); DbFacade.getInstance().getDiskImageDynamicDAO().save(diskDynamic); if (!DbFacade.getInstance().getDiskDao().exists(image.getimage_group_id())) { DbFacade.getInstance().getDiskDao().save(new Disk(image)); } } catch (RuntimeException ex) { log.error("AddDiskImageToDB::Failed adding new created snapshot into the db", ex); throw new VdcBLLException(VdcBllErrors.DB, ex); } }

Target:
protected void AddDiskImageToDb(DiskImage image) { try { DbFacade.getInstance().getDiskImageDAO().save(image); DbFacade.getInstance().getImageVmMapDAO().save( new image_vm_map(image.getactive(), image.getId(), image.getvm_guid())); DiskImageDynamic diskDynamic = new DiskImageDynamic(); diskDynamic.setId(image.getId()); diskDynamic.setactual_size(image.getactual_size()); DbFacade.getInstance().getDiskImageDynamicDAO().save(diskDynamic); saveDiskIfNotExists(image); } catch (RuntimeException ex) { log.error("AddDiskImageToDB::Failed adding new created snapshot into the db", ex); throw new VdcBLLException(VdcBllErrors.DB, ex); } }
Source:
protected static boolean CanAttachNonPrestartedVmToUser(Guid vm_guid) { java.util.ArrayList<String> messages = new java.util.ArrayList<String>(); return IsVmFree(vm_guid, messages); }

Target:
protected static boolean CanAttachNonPrestartedVmToUser(Guid vm_guid) { return IsVmFree(vm_guid, new java.util.ArrayList<String>()); }
Source:
public static void diff(Collection<ArtifactDelta> artifactDeltas, String pathPrefix, Object... options) { CompareDataCollector collector = new NoOpCompareDataCollector(); IOperation operation = new DiffUsingRenderer(collector, artifactDeltas, pathPrefix, options); IProgressMonitor monitor = null; for (int i = 0; i < options.length; i += 2) { if (((String) options[i]).equals("Progress Monitor")) { monitor = (IProgressMonitor) options[i + 1]; break; } } if (monitor == null) { Operations.executeWork(operation); } else { Operations.executeWork(operation, monitor); } }

Target:
public static void diff(Collection<ArtifactDelta> artifactDeltas, String pathPrefix, Object... options) { CompareDataCollector collector = new NoOpCompareDataCollector(); IOperation operation = new DiffUsingRenderer(collector, artifactDeltas, pathPrefix, options); IProgressMonitor monitor = null; for (int i = 0; i < options.length; i += 2) { if (((String) options[i]).equals("Progress Monitor")) { monitor = (IProgressMonitor) options[i + 1]; break; } } Operations.executeWork(operation, monitor); }
Source:
public void onChatMessage(ChatMessageEvent event) { Platform.runLater(() -> { ChatMessage message = event.getMessage(); if (message.getSource() != null && message.getSource().endsWith("'sParty")) return; if (!message.isPrivate()) { getOrCreateChannelTab(message.getSource()).onChatMessage(message); } else { addAndGetPrivateMessageTab(message.getSource()).onChatMessage(message); } }); }

Target:
public void onChatMessage(ChatMessageEvent event) { Platform.runLater(() -> { ChatMessage message = event.getMessage(); if (isMatchmakerPartyMessage(message)) return; if (!message.isPrivate()) { getOrCreateChannelTab(message.getSource()).onChatMessage(message); } else { addAndGetPrivateMessageTab(message.getSource()).onChatMessage(message); } }); }
Source:
protected Map<String, String> getTemplateParameterList(ContractsGrantsInvoiceDocument document) { Map<String, String> templateParameters = super.getTemplateParameterList(document); ContractsGrantsInvoiceDetail totalCostInvoiceDetail = document.getTotalCostInvoiceDetail(); if (ObjectUtils.isNotNull(totalCostInvoiceDetail)) { Map<String, Object> parameterMap = new HashMap<String, Object>(); parameterMap.put(CuArPropertyConstants.ContractsAndGrantsBillingAwardFields.TOTAL_PROGRAM_OUTLAYS_TO_DATE, totalCostInvoiceDetail.getTotalAmountBilledToDate().add(document.getInvoiceGeneralDetail().getCostShareAmount())); Map<String, String> localParameterMap = new PdfFormattingMap(parameterMap); templateParameters.putAll(new PdfFormattingMap(localParameterMap)); } return templateParameters; }

Target:
protected Map<String, String> getTemplateParameterList(ContractsGrantsInvoiceDocument document) { Map<String, String> templateParameters = super.getTemplateParameterList(document); Map<String, Object> localParameterMap = new HashMap<String, Object>(); if (document.getInvoiceGeneralDetail().isFinalBillIndicator()) { localParameterMap.put(CuArPropertyConstants.ContractsAndGrantsBillingAwardFields.FINAL_BILL, CUKFSConstants.CAPITAL_X); localParameterMap.put(CuArPropertyConstants.ContractsAndGrantsBillingAwardFields.PARTIAL_BILL, StringUtils.EMPTY); } else { localParameterMap.put(CuArPropertyConstants.ContractsAndGrantsBillingAwardFields.FINAL_BILL, StringUtils.EMPTY); localParameterMap.put(CuArPropertyConstants.ContractsAndGrantsBillingAwardFields.PARTIAL_BILL, CUKFSConstants.CAPITAL_X); } ContractsGrantsInvoiceDetail totalCostInvoiceDetail = document.getTotalCostInvoiceDetail(); if (ObjectUtils.isNotNull(totalCostInvoiceDetail)) { localParameterMap.put(CuArPropertyConstants.ContractsAndGrantsBillingAwardFields.TOTAL_PROGRAM_OUTLAYS_TO_DATE, totalCostInvoiceDetail.getTotalAmountBilledToDate().add(document.getInvoiceGeneralDetail().getCostShareAmount())); } if (!localParameterMap.isEmpty()) { LOG.debug("getTemplateParameterList, there were local parameters, adding them to the returning map."); templateParameters.putAll(new PdfFormattingMap(localParameterMap)); } return templateParameters; }
Source:
public void stop() { if (mJvmMonitorThread == null) { return; } mJvmMonitorThread.interrupt(); try { mJvmMonitorThread.join(60 * 1000); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } mJvmMonitorThread = null; }

Target:
public void stop() { if (mJvmMonitorThread == null) { return; } mJvmMonitorThread.interrupt(); try { mJvmMonitorThread.join(5 * Constants.SECOND_MS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } mJvmMonitorThread = null; }
Source:
protected Class<?>[] getValidationGroups(Object action, String methodName) throws NoSuchMethodException { ValidateGroup validateGroup = MethodUtils.getAnnotation(getActionMethod(action.getClass(), methodName), ValidateGroup.class, true, true); return validateGroup == null ? new Class[]{} : validateGroup.value(); }

Target:
protected Class<?>[] getValidationGroups(Object action, String methodName) throws NoSuchMethodException { ValidationGroup validationGroup = MethodUtils.getAnnotation(getActionMethod(action.getClass(), methodName), ValidationGroup.class, true, true); return validationGroup == null ? new Class[]{Default.class} : validationGroup.value(); }
Source:
private void testContainerPlacementRequestMessage(ContainerPlacementRequestMessage requestMessage) throws IOException { ObjectMapper objectMapper = ContainerPlacementMessageObjectMapper.getObjectMapper(); ContainerPlacementMessage message = objectMapper.readValue(objectMapper.writeValueAsString(requestMessage), ContainerPlacementMessage.class); assertTrue(message instanceof ContainerPlacementRequestMessage); ContainerPlacementRequestMessage deserializedRequest = (ContainerPlacementRequestMessage) message; assertEquals(requestMessage, deserializedRequest); assertEquals(deserializedRequest.getStatusCode(), ContainerPlacementMessage.StatusCode.CREATED); }

Target:
private void testContainerPlacementRequestMessage(ContainerPlacementRequestMessage requestMessage) throws IOException { ObjectMapper objectMapper = ContainerPlacementMessageObjectMapper.getObjectMapper(); ContainerPlacementMessage message = objectMapper.readValue(objectMapper.writeValueAsString(requestMessage), ContainerPlacementMessage.class); assertTrue(message instanceof ContainerPlacementRequestMessage); ContainerPlacementRequestMessage deserializedRequest = (ContainerPlacementRequestMessage) message; assertEquals(requestMessage, deserializedRequest); }
Source:
public Map<String, RestEntry> buildEntryMap(Map<String, Object> config){ Map entries = new LinkedHashMap(); for(Map.Entry<String, Object> entry: config.entrySet()){ RestEntry re = build(entry); if(re.getUrl().equals(RestEntry.MISSING) ){ logger.log(SystemProperties.DIAG, "{} was bypassed due by version check.", re.getName()); } else{ entries.put(re.getName(), re); } } return entries; }

Target:
public Map<String, RestEntry> buildEntryMap(Map<String, Object> config){ Map entries = new LinkedHashMap<>(); for(Map.Entry<String, Object> entry: config.entrySet()){ RestEntry re = build(entry); if(re.getUrl().equals(RestEntry.MISSING) ){ logger.log(SystemProperties.DIAG, "{} was bypassed due by version check.", re.getName()); } else{ entries.put(re.getName(), re); } } return entries; }
Source:
private Object applyUpdateUnsafe(SMREntry entry, long timestamp) { log.trace("Apply[{}] of {}@{} ({})", this, entry.getSMRMethod(), Address.isAddress(entry.getGlobalAddress()) ? entry.getGlobalAddress() : "OPT", entry.getSMRArguments()); if (SMREntry.isNOP(entry)) { return null; } ICorfuSMRUpcallTarget<T> target = upcallTargetMap.get(entry.getSMRMethod()); if (target == null) { throw new RuntimeException("Unknown upcall " + entry.getSMRMethod()); } ICorfuExecutionContext.Context context = getContext(timestamp); if (!entry.isUndoable() || !Address.isAddress(entry.getGlobalAddress())) { IUndoRecordFunction<T> undoRecordTarget = undoRecordFunctionMap.get(entry.getSMRMethod()); if (undoRecordTarget != null) { entry.setUndoRecord(undoRecordTarget .getUndoRecord(object.getContext(context), entry.getSMRArguments())); log.trace("Apply[{}] Undo->{}", this, entry.getUndoRecord()); } else if (resetSet.contains(entry.getSMRMethod())) { entry.setUndoRecord(object); object.close(); object = newObjectFn.get(); log.trace("Apply[{}] Undo->RESET", this); } } return target.upcall(object.getContext(context), entry.getSMRArguments()); }

Target:
private Object applyUpdateUnsafe(SMREntry entry, long timestamp) { log.trace("Apply[{}] of {}@{} ({})", this, entry.getSMRMethod(), Address.isAddress(entry.getGlobalAddress()) ? entry.getGlobalAddress() : "OPT", entry.getSMRArguments()); ICorfuSMRUpcallTarget<T> target = upcallTargetMap.get(entry.getSMRMethod()); if (target == null) { throw new RuntimeException("Unknown upcall " + entry.getSMRMethod()); } ICorfuExecutionContext.Context context = getContext(timestamp); if (!entry.isUndoable() || !Address.isAddress(entry.getGlobalAddress())) { IUndoRecordFunction<T> undoRecordTarget = undoRecordFunctionMap.get(entry.getSMRMethod()); if (undoRecordTarget != null) { entry.setUndoRecord(undoRecordTarget .getUndoRecord(object.getContext(context), entry.getSMRArguments())); log.trace("Apply[{}] Undo->{}", this, entry.getUndoRecord()); } else if (resetSet.contains(entry.getSMRMethod())) { entry.setUndoRecord(object); object.close(); object = newObjectFn.get(); log.trace("Apply[{}] Undo->RESET", this); } } return target.upcall(object.getContext(context), entry.getSMRArguments()); }
Source:
private static String resolveMessage(String message, Optional<ComponentLocation> originatingLocation, Optional<Exception> closerResponsible) { String openedByDescription = format("The cursor provider was open by %s", originatingLocation.map(cl -> cl.getLocation()) .orElse("unknown")); String responsibleDescription = closerResponsible.map(r -> { StringWriter stringWriter = new StringWriter(); r.printStackTrace(new PrintWriter(stringWriter)); return format("The cursor provider was closed by: \n %s", stringWriter.toString()); }).orElse(format("Run with -M-D%s=true for more details", TRACK_CURSOR_PROVIDER_CLOSE)); return format("%s: %s. %s.", message, openedByDescription, responsibleDescription); }

Target:
private static String resolveMessage(String message, Optional<ComponentLocation> originatingLocation, Optional<Exception> closerResponsible) { String openedByDescription = format("The cursor provider was open by %s", originatingLocation.map(cl -> cl.getLocation()) .orElse("unknown")); String responsibleDescription = closerResponsible.map(r -> { StringWriter stringWriter = new StringWriter(); r.printStackTrace(new PrintWriter(stringWriter)); return format("The cursor provider was closed by: \n %s", stringWriter.toString()); }).orElse(format("Set SystemProperty '%s' in true for more details", TRACK_CURSOR_PROVIDER_CLOSE_PROPERTY)); return format("%s: %s. %s.", message, openedByDescription, responsibleDescription); }
Source:
public StorageTraversal getStorageTraversal() { Collection<IResource> resources = Arrays.asList(papyrusFile.getAssociatedResources()); Set<IStorage> storages = getStorages(resources); return new StorageTraversal(storages); }

Target:
public StorageTraversal getStorageTraversal() { IResource[] resources = papyrusFile.getAssociatedResources(); Set<IStorage> storages = getStorages(resources); return new StorageTraversal(storages); }
Source:
public Explosion newExplosion(@Nullable net.minecraft.entity.Entity entityIn, double x, double y, double z, float strength, boolean isFlaming, boolean isSmoking) { Explosion explosion = new Explosion((WorldServer) (Object) this, entityIn, x, y, z, strength, isFlaming, isSmoking); triggerExplosion((org.spongepowered.api.world.explosion.Explosion) explosion, Cause.of(NamedCause.source(entityIn == null ? this : entityIn))); return explosion; }

Target:
public Explosion newExplosion(@Nullable net.minecraft.entity.Entity entityIn, double x, double y, double z, float strength, boolean isFlaming, boolean isSmoking) { Explosion explosion = new Explosion((WorldServer) (Object) this, entityIn, x, y, z, strength, isFlaming, isSmoking); explosion = triggerInternalExplosion((org.spongepowered.api.world.explosion.Explosion) explosion, e -> GeneralPhase.State.EXPLOSION .createPhaseContext() .explosion(e) .potentialExplosionSource((WorldServer) (Object) this, entityIn)); return explosion; }
Source:
public static Map<String, Symbol> typeShedSymbols() { if (TypeShedVisitor.typeShedSymbols == null) { Map<String, Symbol> typeShedSymbols = Collections.emptyMap(); InputStream resource = TypeShedVisitor.class.getResourceAsStream("builtins.pyi"); try (BufferedReader reader = new BufferedReader(new InputStreamReader(resource, StandardCharsets.UTF_8))) { String builtins = reader.lines().collect(Collectors.joining("\n")); AstNode astNode = PythonParser.create().parse(builtins); FileInput fileInput = new PythonTreeMaker().fileInput(astNode); TypeShedVisitor typeShedVisitor = new TypeShedVisitor(); fileInput.accept(typeShedVisitor); typeShedSymbols = typeShedVisitor.symbolsByName; } catch (IOException | UncheckedIOException e) { LOG.debug("Unable to read builtin types."); } TypeShedVisitor.typeShedSymbols = Collections.unmodifiableMap(typeShedSymbols); } return typeShedSymbols; }

Target:
public static Map<String, Symbol> typeShedSymbols() { if (TypeShedVisitor.typeShedSymbols == null) { Map<String, Symbol> typeShedSymbols = Collections.emptyMap(); InputStream resource = TypeShedVisitor.class.getResourceAsStream("builtins.pyi"); try (BufferedReader reader = new BufferedReader(new InputStreamReader(resource, StandardCharsets.UTF_8))) { String builtins = reader.lines().collect(Collectors.joining("\n")); AstNode astNode = PythonParser.create().parse(builtins); FileInput fileInput = new PythonTreeMaker().fileInput(astNode); TypeShedVisitor typeShedVisitor = new TypeShedVisitor(); fileInput.accept(typeShedVisitor); typeShedSymbols = typeShedVisitor.symbolsByName; } catch (IOException | UncheckedIOException e) { LOG.info("Unable to read builtin types.", e); } TypeShedVisitor.typeShedSymbols = Collections.unmodifiableMap(typeShedSymbols); } return typeShedSymbols; }
Source:
public void testModuleExecution() { Document doc = getXmlDocumentFromFile(TmfXmlTestFiles.VALID_FILE.getFile()); assertNotNull(doc); NodeList stateproviderNodes = doc.getElementsByTagName(TmfXmlStrings.STATE_PROVIDER); Element node = (Element) stateproviderNodes.item(0); fModule = new XmlStateSystemModule(); String moduleId = node.getAttribute(TmfXmlStrings.ANALYSIS_ID); fModule.setId(moduleId); fModule.setXmlFile(new Path(TmfXmlTestFiles.VALID_FILE.getFile().getAbsolutePath())); NodeList head = node.getElementsByTagName(TmfXmlStrings.HEAD); XmlHeadInfo headInfo = null; if (head.getLength() == 1) { headInfo = new XmlHeadInfo(head.item(0)); } fModule.setHeadInfo(headInfo); try { assumeTrue(CtfTmfTestTrace.KERNEL.exists()); ITmfTrace trace = CtfTmfTestTrace.KERNEL.getTrace(); fModule.setTrace(trace); fModule.schedule(); assertTrue(fModule.waitForCompletion(new NullProgressMonitor())); } catch (TmfAnalysisException e) { fail("Cannot set trace " + e.getMessage()); } finally { CtfTmfTestTrace.KERNEL.dispose(); } }

Target:
public void testModuleExecution() { assumeTrue(CtfTmfTestTrace.KERNEL.exists()); Document doc = getXmlDocumentFromFile(TmfXmlTestFiles.VALID_FILE.getFile()); assertNotNull(doc); NodeList stateproviderNodes = doc.getElementsByTagName(TmfXmlStrings.STATE_PROVIDER); Element node = (Element) stateproviderNodes.item(0); fModule = new XmlStateSystemModule(); String moduleId = node.getAttribute(TmfXmlStrings.ANALYSIS_ID); fModule.setId(moduleId); fModule.setXmlFile(new Path(TmfXmlTestFiles.VALID_FILE.getFile().getAbsolutePath())); NodeList head = node.getElementsByTagName(TmfXmlStrings.HEAD); XmlHeadInfo headInfo = null; if (head.getLength() == 1) { headInfo = new XmlHeadInfo(head.item(0)); } fModule.setHeadInfo(headInfo); try { ITmfTrace trace = CtfTmfTestTrace.KERNEL.getTrace(); fModule.setTrace(trace); fModule.schedule(); assertTrue(fModule.waitForCompletion(new NullProgressMonitor())); } catch (TmfAnalysisException e) { fail("Cannot set trace " + e.getMessage()); } finally { CtfTmfTestTrace.KERNEL.dispose(); } }
Source:
public void createContainerWithShmPidsLimit() throws DockerException { final RemoteApiVersion apiVersion = getVersion(dockerClient); if (!apiVersion.isGreaterOrEqual(RemoteApiVersion.VERSION_1_23)) { throw new SkipException("API version should be >= 1.23"); } HostConfig hostConfig = new HostConfig().withPidsLimit(2L); CreateContainerResponse container = dockerClient.createContainerCmd(BUSYBOX_IMAGE) .withHostConfig(hostConfig).withCmd("true").exec(); LOG.info("Created container {}", container.toString()); assertThat(container.getId(), not(isEmptyString())); InspectContainerResponse inspectContainerResponse = dockerClient.inspectContainerCmd(container.getId()).exec(); assertEquals(inspectContainerResponse.getHostConfig().getPidsLimit(), hostConfig.getPidsLimit()); }

Target:
public void createContainerWithShmPidsLimit() throws DockerException { final RemoteApiVersion apiVersion = getVersion(dockerClient); if (!apiVersion.isGreaterOrEqual(RemoteApiVersion.VERSION_1_23)) { throw new SkipException("API version should be >= 1.23"); } HostConfig hostConfig = new HostConfig().withPidsLimit(2L); CreateContainerResponse container = dockerClient.createContainerCmd(BUSYBOX_IMAGE) .withHostConfig(hostConfig).withCmd("true").exec(); LOG.info("Created container {}", container.toString()); assertThat(container.getId(), not(isEmptyString())); InspectContainerResponse inspectContainerResponse = dockerClient.inspectContainerCmd(container.getId()).exec(); assertThat(inspectContainerResponse.getHostConfig().getPidsLimit(), is(hostConfig.getPidsLimit())); }
Source:
public Collection<MultiMapRecord> remove(Data dataKey, boolean copyOf) { MultiMapValue multiMapValue = multiMapValues.remove(dataKey); if (multiMapValue != null) { decrSize(multiMapValue.size()); return multiMapValue.getCollection(copyOf); } else { return null; } }

Target:
public Collection<MultiMapRecord> remove(Data dataKey, boolean copyOf) { MultiMapValue multiMapValue = multiMapValues.remove(dataKey); if (multiMapValue != null) { decrSize(multiMapValue.size()); return multiMapValue.getCollection(copyOf); } return null; }
Source:
public int getLeftX() { try { int x = (int) Math.round(Double.parseDouble(getPropertyValue(PROPERTY_NAME_X))); if (originAtCenter) { return x - radius; } else { return x; } } catch (NumberFormatException e) { return 0; } }

Target:
public int getLeftX() { return x - getXOffset(); }
Source:
public void visitToken(DetailAST ast) { if (canBeOverridden(ast) && !hasEmptyImplementation(ast) && !hasJavadocComment(ast) && !hasIgnoredAnnotation(ast, ignoredAnnotations)) { final DetailAST containerDef = getNearestClassOrEnumDefinition(ast); if (canBeSubclassed(containerDef) && hasDefaultOrExplicitNonPrivateCtor(containerDef)) { final String methodName = ast.findFirstToken(TokenTypes.IDENT).getText(); log(ast.getLineNo(), ast.getColumnNo(), MSG_KEY, methodName); } } }

Target:
public void visitToken(DetailAST ast) { if (!hasJavadocComment(ast) && (isNativeMethod(ast) || !hasEmptyImplementation(ast)) && canBeOverridden(ast) && !hasIgnoredAnnotation(ast, ignoredAnnotations)) { final DetailAST classDef = getNearestClassOrEnumDefinition(ast); if (canBeSubclassed(classDef)) { final String className = classDef.findFirstToken(TokenTypes.IDENT).getText(); final String methodName = ast.findFirstToken(TokenTypes.IDENT).getText(); log(ast.getLineNo(), ast.getColumnNo(), MSG_KEY, className, methodName); } } }
Source:
protected boolean canDoAction() { if (!super.canDoAction()) { return false; } if (Guid.isNullOrEmpty(getParameters().getHookId())) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_ID_IS_REQUIRED); return false; } if (getGlusterHook() == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_DOES_NOT_EXIST); return false; } if (getMissingServerHooks().isEmpty()) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_NO_CONFLICT_SERVERS); return false; } return true; }

Target:
protected boolean canDoAction() { if (!super.canDoAction()) { return false; } if (getMissingServerHooks().isEmpty()) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_NO_CONFLICT_SERVERS); return false; } return true; }
Source:
default void interactBlock(Vector3i position, Direction side) { interactBlock(checkNotNull(position, "position").getX(), position.getY(), position.getZ(), checkNotNull(side, "side")); }

Target:
default boolean interactBlock(Vector3i position, Direction side) { return interactBlock(checkNotNull(position, "position").getX(), position.getY(), position.getZ(), checkNotNull(side, "side")); }
Source:
public LiveData<Boolean> downloadNotifications() { if (notificationDownloadResponse == null) { notificationDownloadResponse = new MutableLiveData<>(); } try { int id = JWTUtils.getIdentity(AuthUtil.getAuthorization()); compositeDisposable.add(APIClient.getOpenEventAPI().getNotifications(id) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe( notifications -> { Timber.i("Downloaded notifications"); realmRepo.saveNotifications(notifications); notificationDownloadResponse.setValue(true); }, throwable -> { Timber.e("Notification download failed"); notificationDownloadResponse.setValue(false); })); } catch (JSONException e) { Timber.e(e); } return notificationDownloadResponse; }

Target:
public LiveData<Boolean> downloadNotifications() { if (notificationDownloadResponse == null) { notificationDownloadResponse = new MutableLiveData<>(); } Observable<List<Notification>> notificationsObservable = notificationsRepository.downloadNotifications(); if (notificationsObservable != null) { compositeDisposable.add(notificationsObservable.subscribe(notifications -> { Timber.i("Downloaded notifications"); notificationDownloadResponse.setValue(true); }, throwable -> { Timber.e("Notification download failed"); notificationDownloadResponse.setValue(false); })); } return notificationDownloadResponse; }
Source:
Method toMethod() throws ClassNotFoundException, NoSuchMethodException, IllegalClassFormatException { if (method != null) { return method; } String classname = this.classname; int superclassIndex = 0; JavaClass jc = null; do { try { jc = ReplacementFileReader.getJavaClassFromClassname(classname); } catch (Throwable e) { throw new IllegalClassFormatException("Unable to read: " + classname); } if (jc == null) { throw new ClassNotFoundException("Class not found: " + classname); } for (Method m : jc.getMethods()) { if (m.getName().equals(this.name) && Arrays.equals(m.getArgumentTypes(), this.paramTypes)) { this.method = m; return m; } } superclassIndex = jc.getSuperclassNameIndex(); classname = jc.getSuperclassName(); } while (superclassIndex != 0); throw new NoSuchMethodException("Method not found: " + this.name); }

Target:
Method toMethod() throws ClassNotFoundException, NoSuchMethodException, IllegalClassFormatException { if (method != null) { return method; } String currentClassname = classname; while (true) { JavaClass currentClass; try { currentClass = ReplacementFileReader.getJavaClassFromClassname(currentClassname); } catch (Throwable e) { throw new IllegalClassFormatException("Unable to read: " + currentClassname); } if (currentClass == null) { throw new ClassNotFoundException("Class " + currentClassname + " not found"); } for (Method m : currentClass.getMethods()) { if (m.getName().equals(this.name) && Arrays.equals(m.getArgumentTypes(), this.paramTypes)) { this.method = m; return m; } } if (currentClass.getSuperclassNameIndex() == 0) { throw new NoSuchMethodException("Method " + this.name + " not found"); } currentClassname = currentClass.getSuperclassName(); } }
Source:
protected void fix(TaskListener listener) throws Exception { LOGGER.info("Initiating a re-keying of secrets. See "+getLogFile()); SecretRewriter rewriter = new SecretRewriter(); try { PrintStream log = listener.getLogger(); log.println("Started re-keying " + new Date()); int count = rewriter.rewriteRecursive(Jenkins.get().getRootDir(), listener); log.printf("Completed re-keying %d files on %s\n",count,new Date()); new RekeySecretAdminMonitor().done.on(); LOGGER.finest("Secret re-keying completed"); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Fatal failure in re-keying secrets",e); Functions.printStackTrace(e, listener.error("Fatal failure in rewriting secrets")); } }

Target:
protected void fix(TaskListener listener) throws Exception { LOGGER.info("Initiating a re-keying of secrets. See "+getLogFile()); SecretRewriter rewriter = new SecretRewriter(); try { PrintStream log = listener.getLogger(); log.println("Started re-keying " + new Date()); int count = rewriter.rewriteRecursive(Jenkins.get().getRootDir(), listener); log.printf("Completed re-keying %d files on %s\n",count,new Date()); new RekeySecretAdminMonitor().done.on(); LOGGER.info("Secret re-keying completed"); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Fatal failure in re-keying secrets",e); Functions.printStackTrace(e, listener.error("Fatal failure in rewriting secrets")); } }
Source:
public Class<? extends ArrayAggregationState> getGroupedStateClass() { if (mode == NEW) { return GroupArrayAggregationState.class; } if (mode == LEGACY) { return LegacyArrayAggregationGroupState.class; } throw new PrestoException(FUNCTION_IMPLEMENTATION_ERROR, format("Unexpected group enum type %s", mode)); }

Target:
public Class<? extends ArrayAggregationState> getGroupedStateClass() { switch (mode) { case NEW: return GroupArrayAggregationState.class; case LEGACY: return LegacyArrayAggregationGroupState.class; default: throw new PrestoException(FUNCTION_IMPLEMENTATION_ERROR, format("Unexpected group enum type %s", mode)); } }
Source:
public String[] getClientAliases(String keyType, Principal[] issuers) { int count = getAliasCount(); if (count == 0) { return null; } String[] aliases = new String[count]; System.arraycopy(this.names, 0, aliases, 0, aliases.length); return aliases; }

Target:
public String[] getClientAliases(String keyType, Principal[] issuers) { int count = this.names.length; if (count == 0) { return null; } return Arrays.copyOf(this.names, count); }
Source:
public CommandResult execute() { try { furnace = FurnaceFactory.getInstance(); furnace.setServerMode(true); loadAddons(); try { Future<Furnace> future = furnace.startAsync(); future.get(); } catch (Exception e) { System.out.println("Failed to start "+Util.WINDUP_BRAND_NAME_ACRONYM+"!"); if (e.getMessage() != null) System.out.println("Failure reason: " + e.getMessage()); e.printStackTrace(); } this.analyze(); this.furnace.stop(); } catch (Throwable t) { System.err.println(Util.WINDUP_BRAND_NAME_ACRONYM + " execution failed due to: " + t.getMessage()); t.printStackTrace(); } return null; }

Target:
public CommandResult execute() { try { furnace = FurnaceFactory.getInstance(); furnace.setServerMode(true); loadAddons(); try { Future<Furnace> future = furnace.startAsync(); future.get(); } catch (Exception e) { System.out.println("Failed to start "+Util.WINDUP_BRAND_NAME_ACRONYM+"!"); e.printStackTrace(); } this.analyze(); this.furnace.stop(); } catch (Throwable t) { System.err.println(Util.WINDUP_BRAND_NAME_ACRONYM + " execution failed due to: " + t.getMessage()); t.printStackTrace(); } return null; }
Source:
public void stop(boolean stopGracefully) { synchronized (stateChangeLock) { Preconditions.checkState(started, "not started"); log.info("Beginning shutdown of KafkaSupervisor[%s]", dataSource); try { scheduledExec.shutdownNow(); Optional<TaskRunner> taskRunner = taskMaster.getTaskRunner(); if (taskRunner.isPresent()) { taskRunner.get().unregisterListener(supervisorId); } synchronized (stopLock) { if (stopGracefully) { log.info("Posting GracefulShutdownNotice, signalling managed tasks to complete and publish"); notices.add(new GracefulShutdownNotice()); } else { log.info("Posting ShutdownNotice"); notices.add(new ShutdownNotice()); } long endTime = System.currentTimeMillis() + SHUTDOWN_TIMEOUT_MILLIS; while (!stopped) { long sleepTime = endTime - System.currentTimeMillis(); if (sleepTime <= 0) { log.info("Timed out while waiting for shutdown"); stopped = true; break; } stopLock.wait(sleepTime); } } log.info("Shutdown notice handled"); taskClient.close(); workerExec.shutdown(); exec.shutdownNow(); started = false; log.info("KafkaSupervisor[%s] has stopped", dataSource); } catch (Exception e) { log.makeAlert(e, "Exception stopping KafkaSupervisor[%s]", dataSource) .emit(); } } }

Target:
public void stop(boolean stopGracefully) { synchronized (stateChangeLock) { Preconditions.checkState(started, "not started"); log.info("Beginning shutdown of KafkaSupervisor[%s]", dataSource); try { scheduledExec.shutdownNow(); Optional<TaskRunner> taskRunner = taskMaster.getTaskRunner(); if (taskRunner.isPresent()) { taskRunner.get().unregisterListener(supervisorId); } synchronized (stopLock) { if (stopGracefully) { log.info("Posting GracefulShutdownNotice, signalling managed tasks to complete and publish"); notices.add(new GracefulShutdownNotice()); } else { log.info("Posting ShutdownNotice"); notices.add(new ShutdownNotice()); } long endTime = System.currentTimeMillis() + SHUTDOWN_TIMEOUT_MILLIS; while (!stopped) { long sleepTime = endTime - System.currentTimeMillis(); if (sleepTime <= 0) { log.info("Timed out while waiting for shutdown"); stopped = true; break; } stopLock.wait(sleepTime); } } log.info("Shutdown notice handled"); taskClient.close(); workerExec.shutdownNow(); exec.shutdownNow(); started = false; log.info("KafkaSupervisor[%s] has stopped", dataSource); } catch (Exception e) { log.makeAlert(e, "Exception stopping KafkaSupervisor[%s]", dataSource) .emit(); } } }
Source:
private void removeAvailablePointsJson(Path projectPath) { File availablePointsJson = new File(projectPath.toAbsolutePath().toString() + "/.available_points.json"); availablePointsJson.delete(); }

Target:
private void removeAvailablePointsJson(Path projectPath) throws IOException { Files.deleteIfExists(projectPath.resolve(".available_points.json")); }
Source:
public XRYKeyValuePair(String key, String value, String namespace) { this.key = key.trim(); this.value = value.trim(); this.namespace = namespace.trim(); }

Target:
XRYKeyValuePair(String key, String value, String namespace) { this.key = key.trim(); this.value = value.trim(); this.namespace = namespace.trim(); }
Source:
private int estimateAverageLogicalSizePerRow(Page page) { checkArgument(page.getPositionCount() > 0); Page chunk = page.getRegion(0, Math.min(page.getPositionCount(), 100)); return (int) (chunk.getLogicalSizeInBytes() / chunk.getPositionCount()); }

Target:
private int estimateAverageLogicalSizePerRow(Page page) { checkArgument(page.getPositionCount() > 0, "page is empty"); Page chunk = page.getRegion(0, min(page.getPositionCount(), 100)); return toIntExact(chunk.getLogicalSizeInBytes() / chunk.getPositionCount()); }
Source:
public void execute(Runnable command) { if (DsfDebugOptions.DEBUG && DsfDebugOptions.DEBUG_EXECUTOR && command instanceof DsfExecutable) { assert !((DsfExecutable)command).getSubmitted() : "Executable was previously executed."; ((DsfExecutable)command).setSubmitted(); } command.run(); }

Target:
public void execute(Runnable command) { if (DsfDebugOptions.DEBUG_EXECUTOR && command instanceof DsfExecutable) { assert !((DsfExecutable)command).getSubmitted() : "Executable was previously executed."; ((DsfExecutable)command).setSubmitted(); } command.run(); }
Source:
private CallExpression rewriteCast(CallExpression call) { if (call.getArguments().get(0) instanceof CallExpression) { CallExpression innerCall = (CallExpression) call.getArguments().get(0); if (innerCall.getSignature().getName().equals("json_parse")) { checkArgument(innerCall.getType().equals(JSON)); checkArgument(innerCall.getArguments().size() == 1); TypeSignature returnType = call.getSignature().getReturnType(); if (returnType.getBase().equals(ARRAY)) { return call( functionManager.lookupCast( JSON_TO_ARRAY_CAST, parseTypeSignature(VARCHAR), returnType).getSignature(), call.getType(), innerCall.getArguments()); } if (returnType.getBase().equals(MAP)) { return call( functionManager.lookupCast( JSON_TO_MAP_CAST, parseTypeSignature(VARCHAR), returnType).getSignature(), call.getType(), innerCall.getArguments()); } if (returnType.getBase().equals(ROW)) { return call( functionManager.lookupCast( JSON_TO_ROW_CAST, parseTypeSignature(VARCHAR), returnType).getSignature(), call.getType(), innerCall.getArguments()); } } } return call( functionManager.lookupCast( CastType.CAST, call.getArguments().get(0).getType().getTypeSignature(), call.getType().getTypeSignature()).getSignature(), call.getType(), call.getArguments()); }

Target:
private CallExpression rewriteCast(CallExpression call) { if (call.getArguments().get(0) instanceof CallExpression) { CallExpression innerCall = (CallExpression) call.getArguments().get(0); if (innerCall.getFunctionHandle().getSignature().getName().equals("json_parse")) { checkArgument(innerCall.getType().equals(JSON)); checkArgument(innerCall.getArguments().size() == 1); TypeSignature returnType = call.getFunctionHandle().getSignature().getReturnType(); if (returnType.getBase().equals(ARRAY)) { return call( functionManager.lookupCast( JSON_TO_ARRAY_CAST, parseTypeSignature(VARCHAR), returnType), call.getType(), innerCall.getArguments()); } if (returnType.getBase().equals(MAP)) { return call( functionManager.lookupCast( JSON_TO_MAP_CAST, parseTypeSignature(VARCHAR), returnType), call.getType(), innerCall.getArguments()); } if (returnType.getBase().equals(ROW)) { return call( functionManager.lookupCast( JSON_TO_ROW_CAST, parseTypeSignature(VARCHAR), returnType), call.getType(), innerCall.getArguments()); } } } return call( functionManager.lookupCast( CAST, call.getArguments().get(0).getType().getTypeSignature(), call.getType().getTypeSignature()), call.getType(), call.getArguments()); }
Source:
public Flux<ByteBuffer> query(String expression) { throw logger.logExceptionAsError(new UnsupportedOperationException( "Cannot query a client side encrypted client")); }

Target:
public Flux<ByteBuffer> query(String expression) { throw logger.logExceptionAsError(new UnsupportedOperationException( "Cannot query data encrypted on client side")); }
Source:
public SingleNodeIntegrationTestSupport(SingleNodeApplication application) { this(application, "classpath:/module"); }

Target:
public SingleNodeIntegrationTestSupport(SingleNodeApplication application) { Assert.notNull(application, "SingleNodeApplication must not be null"); this.application = application; streamDefinitionRepository = application.pluginContext().getBean(StreamDefinitionRepository.class); jobDefinitionRepository = application.pluginContext().getBean(JobDefinitionRepository.class); streamRepository = application.pluginContext().getBean(StreamRepository.class); jobRepository = application.pluginContext().getBean(JobRepository.class); streamResourceStateVerifier = new ResourceStateVerifier(streamRepository, streamDefinitionRepository); jobResourceStateVerifier = new ResourceStateVerifier(jobRepository, jobDefinitionRepository); streamDeployer = application.adminContext().getBean(StreamDeployer.class); messageBus = application.pluginContext().getBean(MessageBusSupport.class); zooKeeperConnection = application.adminContext().getBean(ZooKeeperConnection.class); moduleDeployer = application.containerContext().getBean(ModuleDeployer.class); }
Source:
private static final Execution getExecution() { return Utils.getComponent(Execution.class); }

Target:
private final Execution getExecution() { return Utils.getComponent(Execution.class); }
Source:
public static BlockBuilder quantileBoundsToArray(double lowerQuantile, double upperQuantile) { QuantileDigestFunctions.validateQuantileRange(lowerQuantile, upperQuantile); BlockBuilder blockBuilder = DOUBLE.createBlockBuilder(null, 2); DOUBLE.writeDouble(blockBuilder, lowerQuantile); DOUBLE.writeDouble(blockBuilder, upperQuantile); return blockBuilder; }

Target:
public static BlockBuilder quantileBoundsToArray(double lowerQuantile, double upperQuantile) { validateQuantileRange(lowerQuantile, upperQuantile); BlockBuilder blockBuilder = DOUBLE.createBlockBuilder(null, 2); DOUBLE.writeDouble(blockBuilder, lowerQuantile); DOUBLE.writeDouble(blockBuilder, upperQuantile); return blockBuilder; }
Source:
public boolean isFull() { return chunks.size() == chunks.get(0).getObject().getAtomicUpdateGroupSize(); }

Target:
public boolean isFull() { return !isEmpty() && chunks.size() == chunks.get(0).getObject().getAtomicUpdateGroupSize(); }
Source:
private void setValidMongoOnlyNoCollections(){ jsonConfig = "{\"mongo\":{\"uri\":\"mongodb://user:pass@test.com/cgm_data\"}}"; setBarcode(); }

Target:
private void setValidMongoOnlyNoCollections() { jsonConfig = "{'mongo':{'uri':'mongodb://user:pass@test.com/cgm_data'}}"; setBarcode(); }