auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public ReadResult readInputData(InputChannelInfo info, Buffer buffer) throws IOException { log.debug("readInputData, resultSubpartitionInfo: , bufferBuilder {}", info, buffer); return getReader(info, inputChannelHandleReaders).readInto(buffer); }

Target:
public ReadResult readInputData(InputChannelInfo info, Buffer buffer) throws IOException { log.debug("readInputData, resultSubpartitionInfo: , buffer {}", info, buffer); return getReader(info, inputChannelHandleReaders).readInto(buffer); }
Source:
public void writeProcessorMsg(ProcessorMsg processorMsg) throws IOException { ObjectMapper objectMapper = new ObjectMapper(); String jsonString = objectMapper.writeValueAsString(processorMsg); writeString(jsonString); }

Target:
public void writeProcessorMsg(ProcessorMsg processorMsg) throws IOException { String jsonString = objectMapper.writeValueAsString(processorMsg); writeString(jsonString); }
Source:
public static ArrayList<SimpleTeam> getTeamList(String json) { ArrayList<SimpleTeam> teams = new ArrayList<>(); JsonArray data = JSONManager.getasJsonArray(json); Iterator iterator = data.iterator(); while (iterator.hasNext()) { teams.add(JSONManager.getGson().fromJson((JsonObject) (iterator.next()), SimpleTeam.class)); } return teams; }

Target:
public static ArrayList<SimpleTeam> getTeamList(String json) { ArrayList<SimpleTeam> teams = new ArrayList<>(); JsonArray data = JSONManager.getasJsonArray(json); Iterator<JsonElement> iterator = data.iterator(); while (iterator.hasNext()) { teams.add(JSONManager.getGson().fromJson(iterator.next(), SimpleTeam.class)); } return teams; }
Source:
void generateConstant(ExpressionClassBuilder acb, MethodBuilder mb) { if (SanityManager.DEBUG) { SanityManager.THROWASSERT("generateConstant() not expected to be called for UntypedNullConstantNode because we have implemented our own generateExpression()."); } }

Target:
void generateConstant(ExpressionClassBuilder acb, MethodBuilder mb) { if (SanityManager.DEBUG) { SanityManager.THROWASSERT("generateConstant() not expected to be called for EmptyDefaultConstantNode."); } }
Source:
private void setBuildsAndWorkspacesDir() throws IOException, InvalidBuildsDir { boolean mustSave = false; String newBuildsDir = SystemProperties.getString(BUILDS_DIR_PROP); if (newBuildsDir != null && !buildsDir.equals(newBuildsDir)) { checkRawBuildsDir(newBuildsDir); LOGGER.log(Level.WARNING, "Changing builds directories from {0} to {1}. Beware that no automated data migration will occur.", new String[]{buildsDir, newBuildsDir}); buildsDir = newBuildsDir; mustSave = true; } else if (!isDefaultBuildDir()) { LOGGER.log(Level.INFO, "Using non default builds directories: {0}.", buildsDir); } String newWorkspacesDir = SystemProperties.getString(WORKSPACES_DIR_PROP); if (newWorkspacesDir != null) { Level level; if(!workspaceDir.equals(newWorkspacesDir)) { level = Level.INFO; } else { level = Level.WARNING; } LOGGER.log(level, "Changing workspaces directories from {0} to {1}. Beware that no automated data migration will occur.", new String[]{workspaceDir, newWorkspacesDir}); workspaceDir = newWorkspacesDir; mustSave = true; } else if (!isDefaultWorkspaceDir()) { LOGGER.log(Level.INFO, "Using non default workspaces directories: {0}.", workspaceDir); } if (mustSave) { save(); } }

Target:
private void setBuildsAndWorkspacesDir() throws IOException, InvalidBuildsDir { boolean mustSave = false; String newBuildsDir = SystemProperties.getString(BUILDS_DIR_PROP); boolean freshStartup = STARTUP_MARKER_FILE.isOff(); if (newBuildsDir != null && !buildsDir.equals(newBuildsDir)) { checkRawBuildsDir(newBuildsDir); Level level = freshStartup ? Level.INFO : Level.WARNING; LOGGER.log(level, "Changing builds directories from {0} to {1}. Beware that no automated data migration will occur.", new String[]{buildsDir, newBuildsDir}); buildsDir = newBuildsDir; mustSave = true; } else if (!isDefaultBuildDir()) { LOGGER.log(Level.INFO, "Using non default builds directories: {0}.", buildsDir); } String newWorkspacesDir = SystemProperties.getString(WORKSPACES_DIR_PROP); if (newWorkspacesDir != null && !workspaceDir.equals(newWorkspacesDir)) { Level level = freshStartup ? Level.INFO : Level.WARNING; LOGGER.log(level, "Changing workspaces directories from {0} to {1}. Beware that no automated data migration will occur.", new String[]{workspaceDir, newWorkspacesDir}); workspaceDir = newWorkspacesDir; mustSave = true; } else if (!isDefaultWorkspaceDir()) { LOGGER.log(Level.INFO, "Using non default workspaces directories: {0}.", workspaceDir); } if (mustSave) { save(); } }
Source:
void timezoneJsPositive() { ClientProperties props = new ClientProperties(); props.setUtcOffset("11"); props.setUtcDSTOffset("10"); props.setJsTimeZone("Asia/Novosibirsk"); assertEquals(TimeZone.getTimeZone("Asia/Novosibirsk"), props.getTimeZone()); }

Target:
void timezoneJsPositive() { ClientProperties props = new ClientProperties(); props.setJsTimeZone("Asia/Novosibirsk"); assertEquals(TimeZone.getTimeZone("Asia/Novosibirsk"), props.getTimeZone()); }
Source:
public void addProviderProperties(Map properties, PersistenceUnitMetadata pu) { if (!properties.containsKey(ECLIPSELINK_TARGET_SERVER)) { properties.put(ECLIPSELINK_TARGET_SERVER, JBossAS7ServerPlatform.class.getName()); properties.put(ECLIPSELINK_ARCHIVE_FACTORY, JBossArchiveFactoryImpl.class.getName()); properties.put(ECLIPSELINK_LOGGING_LOGGER, JBossLogger.class.getName()); } logger.trace("Property " + ECLIPSELINK_TARGET_SERVER + " set to " + properties.get(ECLIPSELINK_TARGET_SERVER)); logger.trace("Property " + ECLIPSELINK_ARCHIVE_FACTORY + " set to " + properties.get(ECLIPSELINK_ARCHIVE_FACTORY)); logger.trace("Property " + ECLIPSELINK_LOGGING_LOGGER + " set to " + properties.get(ECLIPSELINK_LOGGING_LOGGER)); }

Target:
public void addProviderProperties(Map properties, PersistenceUnitMetadata pu) { if (!properties.containsKey(ECLIPSELINK_TARGET_SERVER)) { properties.put(ECLIPSELINK_TARGET_SERVER, WildFlyServerPlatform.class.getName()); properties.put(ECLIPSELINK_ARCHIVE_FACTORY, JBossArchiveFactoryImpl.class.getName()); properties.put(ECLIPSELINK_LOGGING_LOGGER, JBossLogger.class.getName()); } }
Source:
protected byte[] getFile(String dateDir, String attemptDir, String fileName) throws StorageFileNotFoundException { Path path = getPrefixDir(dateDir, attemptDir).resolve(fileName); try (InputStream in = Files.newInputStream(path)) { if (path.toString().endsWith(LogFiles.LOG_PLAIN_TEXT_FILE_SUFFIX)) { ByteArrayOutputStream byteOutput = new ByteArrayOutputStream(); GZIPOutputStream gzipOutput = new GZIPOutputStream(byteOutput); byte[] buffer = new byte[1024]; while (true) { int len = in.read(buffer); if (len < 0) { break; } gzipOutput.write(buffer, 0, len); } byteOutput.close(); gzipOutput.close(); return byteOutput.toByteArray(); } else { return ByteStreams.toByteArray(in); } } catch (FileNotFoundException ex) { throw new StorageFileNotFoundException(ex); } catch (IOException ex) { throw Throwables.propagate(ex); } }

Target:
protected byte[] getFile(String dateDir, String attemptDir, String fileName) throws StorageFileNotFoundException { Path path = getPrefixDir(dateDir, attemptDir).resolve(fileName); try (InputStream in = Files.newInputStream(path)) { if (path.toString().endsWith(LogFiles.LOG_PLAIN_TEXT_FILE_SUFFIX)) { try (ByteArrayOutputStream byteOutput = new ByteArrayOutputStream(); GZIPOutputStream gzipOutput = new GZIPOutputStream(byteOutput)) { ByteStreams.copy(in, gzipOutput); gzipOutput.finish(); return byteOutput.toByteArray(); } } else { return ByteStreams.toByteArray(in); } } catch (FileNotFoundException ex) { throw new StorageFileNotFoundException(ex); } catch (IOException ex) { throw Throwables.propagate(ex); } }
Source:
public void generatedCgoPackage() throws IOException { ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "cgo", tmp); workspace.setUp(); ProcessResult result = workspace.runBuckCommand("run", " result.assertSuccess(); }

Target:
public void generatedCgoPackage() throws IOException { GoAssumptions.assumeGoVersionAtLeast("1.10.0"); ProjectWorkspace workspace = TestDataHelper.createProjectWorkspaceForScenario(this, "cgo", tmp); workspace.setUp(); ProcessResult result = workspace.runBuckCommand("run", " result.assertSuccess(); }
Source:
public synchronized <I> boolean hasStringiferFor(Class<I> valueClass) { final boolean contains = entries.containsKey(valueClass) && (entries.get(valueClass) != null); return contains; }

Target:
public synchronized <I> boolean hasStringiferFor(Class<I> valueClass) { final boolean contains = entries.containsKey(valueClass); return contains; }
Source:
public Object execute(ExecutionEvent event) throws ExecutionException { IStructuredSelection selection = (IStructuredSelection) HandlerUtil .getCurrentSelection(event); final Repository repository = SelectionUtils.getRepository(selection); final GitFlowRepository gfRepo = new GitFlowRepository(repository); InputDialog inputDialog = new InputDialog( HandlerUtil.getActiveShell(event), UIText.FeatureStartHandler_provideFeatureName, UIText.FeatureStartHandler_pleaseProvideANameForTheNewFeature, "", new FeatureNameValidator(gfRepo)); if (inputDialog.open() != Window.OK) { return null; } final String featureName = inputDialog.getValue(); Job job = new Job(UIText.FeatureStartHandler_startingNewFeature) { @Override protected IStatus run(IProgressMonitor monitor) { try { new FeatureStartOperation(gfRepo, featureName) .execute(monitor); } catch (CoreException e) { return error(e.getMessage(), e); } return Status.OK_STATUS; } }; job.setUser(true); job.schedule(); return null; }

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { IStructuredSelection selection = (IStructuredSelection) HandlerUtil .getCurrentSelection(event); final Repository repository = SelectionUtils.getRepository(selection); final GitFlowRepository gfRepo = new GitFlowRepository(repository); InputDialog inputDialog = new InputDialog( HandlerUtil.getActiveShell(event), UIText.FeatureStartHandler_provideFeatureName, UIText.FeatureStartHandler_pleaseProvideANameForTheNewFeature, "", new FeatureNameValidator(gfRepo)); if (inputDialog.open() != Window.OK) { return null; } final String featureName = inputDialog.getValue(); WorkspaceJob job = new WorkspaceJob(UIText.FeatureStartHandler_startingNewFeature) { @Override public IStatus runInWorkspace(IProgressMonitor monitor) { try { new FeatureStartOperation(gfRepo, featureName) .execute(monitor); } catch (CoreException e) { return error(e.getMessage(), e); } return Status.OK_STATUS; } }; job.setUser(true); job.schedule(); return null; }
Source:
public static OrderStatus adaptOrderStatus(GDAXOrder order) { if(order.getStatus().equals("pending")) { return OrderStatus.PENDING_NEW; } if(order.getStatus().equals("done") || order.getStatus().equals("settled")) { if(order.getDoneReason().equals("filled")) return OrderStatus.FILLED; return null; } if(order.getFilledSize().compareTo(BigDecimal.ZERO) == 0) return OrderStatus.NEW; if(order.getFilledSize().compareTo(BigDecimal.ZERO) > 0 && order.getSize().compareTo(order.getFilledSize()) < 0) return OrderStatus.PARTIALLY_FILLED; return null; }

Target:
public static OrderStatus adaptOrderStatus(GDAXOrder order) { if(order.getStatus().equals("pending")) { return OrderStatus.PENDING_NEW; } if(order.getStatus().equals("done") || order.getStatus().equals("settled")) { if(order.getDoneReason().equals("filled")) { return OrderStatus.FILLED; } return OrderStatus.UNKNOWN; } if(order.getFilledSize().signum() == 0) return OrderStatus.NEW; if(order.getFilledSize().compareTo(BigDecimal.ZERO) > 0 && order.getSize().compareTo(order.getFilledSize()) < 0) return OrderStatus.PARTIALLY_FILLED; return OrderStatus.UNKNOWN; }
Source:
private void populateCPUList(List<ServerCpu> cpus, boolean canChangeArchitecture) { getArchitecture().getSelectedItemChangedEvent().removeListener(this); ServerCpu oldSelectedCpu = getCPU().getSelectedItem(); ArchitectureType oldSelectedArch = getArchitecture().getSelectedItem(); getCPU().setItems(cpus); initSupportedArchitectures(); try { getCPU().setSelectedItem(oldSelectedCpu != null ? Linq.firstOrNull(cpus, new Linq.ServerCpuPredicate(oldSelectedCpu.getCpuName())) : null); } catch (Exception e) { logger.log(Level.WARNING, "Failed setting the ServerCpu. Exception message: " + e.getMessage()); } if (getCPU().getSelectedItem() == null || !isCPUinitialized) { initCPU(); } if (getIsEdit()) { if (!canChangeArchitecture) { getArchitecture().setItems(new ArrayList<>(Collections.singletonList(getEntity().getArchitecture()))); } if (oldSelectedArch != null) { getArchitecture().setSelectedItem(oldSelectedArch); } else { if (getEntity() != null) { getArchitecture().setSelectedItem(getEntity().getArchitecture()); } else { getArchitecture().setSelectedItem(ArchitectureType.undefined); } } } else { getArchitecture().setSelectedItem(ArchitectureType.undefined); } initCpuArchTypeFiltering(); }

Target:
private void populateCPUList(List<ServerCpu> cpus, boolean canChangeArchitecture) { getArchitecture().getSelectedItemChangedEvent().removeListener(this); ServerCpu oldSelectedCpu = getCPU().getSelectedItem(); ArchitectureType oldSelectedArch = getArchitecture().getSelectedItem(); getCPU().setItems(cpus); initSupportedArchitectures(); try { getCPU().setSelectedItem(oldSelectedCpu != null ? Linq.firstOrNull(cpus, new Linq.ServerCpuPredicate(oldSelectedCpu.getCpuName())) : null); } catch (JavaScriptException e) { logger.log(Level.WARNING, "Failed setting the ServerCpu. Exception message: " + e.getMessage()); } if (getCPU().getSelectedItem() == null || !isCPUinitialized) { initCPU(); } if (getIsEdit()) { if (!canChangeArchitecture) { getArchitecture().setItems(new ArrayList<>(Collections.singletonList(getEntity().getArchitecture()))); } if (oldSelectedArch != null) { getArchitecture().setSelectedItem(oldSelectedArch); } else { if (getEntity() != null) { getArchitecture().setSelectedItem(getEntity().getArchitecture()); } else { getArchitecture().setSelectedItem(ArchitectureType.undefined); } } } else { getArchitecture().setSelectedItem(ArchitectureType.undefined); } initCpuArchTypeFiltering(); }
Source:
private static CEditor getCEditor(IEditorPart editorPart) { if (editorPart instanceof CEditor) { return (CEditor) editorPart; } else { return null; } }

Target:
private static CEditor getCEditor(IEditorPart editorPart) { if (editorPart instanceof CEditor) { return (CEditor) editorPart; } return null; }
Source:
protected void executeVdsBrokerCommand() { result = getBroker().sysprep( getParameters().getJobId().toString(), getParameters().getVolumes().stream().map(volume -> { Map<String, Object> volumeAddress = new HashMap<>(); volumeAddress.put("sd_id", volume.getStorageDomainId().toString()); volumeAddress.put("img_id", volume.getImageId().toString()); volumeAddress.put("vol_id", volume.getVolumeId().toString()); return volumeAddress; }).collect(Collectors.toList())); proceedProxyReturnValue(); }

Target:
protected void executeVdsBrokerCommand() { result = getBroker().sysprep( getParameters().getJobId().toString(), getParameters().getVolumes().stream().map(volume -> { Map<String, String> volumeAddress = new HashMap<>(); volumeAddress.put("sd_id", volume.getStorageDomainId().toString()); volumeAddress.put("img_id", volume.getImageId().toString()); volumeAddress.put("vol_id", volume.getVolumeId().toString()); return volumeAddress; }).collect(Collectors.toList())); proceedProxyReturnValue(); }
Source:
public void enqueue(List<WriteInfo> writes) { sweepableCellsWriter.enqueue(writes); sweepableTimestampsWriter.enqueue(writes); }

Target:
public void enqueue(List<WriteInfo> writes) { sweepableTimestampsWriter.enqueue(writes); sweepableCellsWriter.enqueue(writes); }
Source:
public void initialize(ResourceManager rm) { URL lcPath = IOUtilities.loadFromClasspath( TemporalChunkerAnnotator.class, rm.getString(TemporalChunkerConfigurator.MODEL_PATH) ); URL lexPath = IOUtilities.loadFromClasspath( TemporalChunkerAnnotator.class, rm.getString(TemporalChunkerConfigurator.MODEL_LEX_PATH) ); tagger = new Chunker( "/Users/zhilifeng/Desktop/DanRothResearch/illinois-cogcomp-nlp/temporal-normalizer/src/" + "main/java/edu/illinois/cs/cogcomp/temporal/normalizer/main/" + "prev_TB_full_1label_corr_bestit/prev_TB_full_1label_corr_bestit.lc", "/Users/zhilifeng/Desktop/DanRothResearch/illinois-cogcomp-nlp/temporal-normalizer/src/" + "main/java/edu/illinois/cs/cogcomp/temporal/normalizer/main/" + "prev_TB_full_1label_corr_bestit/prev_TB_full_1label_corr_bestit.lex" ); this.useHeidelTime = rm.getString(TemporalChunkerConfigurator.USE_HEIDELTIME) != "False"; this.dct = new Date(); if (this.useHeidelTime) { this.heidelTime = new HeidelTimeStandalone( Language.ENGLISH, DocumentType.valueOf(rm.getString(TemporalChunkerConfigurator.DOCUMENT_TYPE)), OutputType.valueOf(rm.getString(TemporalChunkerConfigurator.OUTPUT_TYPE)), rm.getString(TemporalChunkerConfigurator.HEIDELTIME_CONFIG), POSTagger.valueOf(rm.getString(TemporalChunkerConfigurator.POSTAGGER_TYPE)), true ); } else { timexNormalizer = new TimexNormalizer(); timexNormalizer.setTime(this.dct); } this.timex = new ArrayList<>(); this.factory = DocumentBuilderFactory.newInstance(); try { this.builder = this.factory.newDocumentBuilder(); } catch (Exception e) { e.printStackTrace(); } }

Target:
public void initialize(ResourceManager rm) { URL lcPath = IOUtilities.loadFromClasspath( TemporalChunkerAnnotator.class, rm.getString(TemporalChunkerConfigurator.MODEL_PATH) ); URL lexPath = IOUtilities.loadFromClasspath( TemporalChunkerAnnotator.class, rm.getString(TemporalChunkerConfigurator.MODEL_LEX_PATH) ); tagger = new Chunker( rm.getString(TemporalChunkerConfigurator.MODEL_PATH), rm.getString(TemporalChunkerConfigurator.MODEL_LEX_PATH)); tagger.readModel(lcPath); tagger.readLexicon(lexPath); this.useHeidelTime = rm.getString(TemporalChunkerConfigurator.USE_HEIDELTIME) != "False"; this.dct = new Date(); if (this.useHeidelTime) { this.heidelTime = new HeidelTimeStandalone( Language.ENGLISH, DocumentType.valueOf(rm.getString(TemporalChunkerConfigurator.DOCUMENT_TYPE)), OutputType.valueOf(rm.getString(TemporalChunkerConfigurator.OUTPUT_TYPE)), rm.getString(TemporalChunkerConfigurator.HEIDELTIME_CONFIG), POSTagger.valueOf(rm.getString(TemporalChunkerConfigurator.POSTAGGER_TYPE)), true ); } else { timexNormalizer = new TimexNormalizer(); timexNormalizer.setTime(this.dct); } this.timex = new ArrayList<>(); this.factory = DocumentBuilderFactory.newInstance(); try { this.builder = this.factory.newDocumentBuilder(); } catch (Exception e) { e.printStackTrace(); } }
Source:
public void run() { try { boolean isMaxAliveReached; do { BinRpcMessage message = new BinRpcMessage(socket.getInputStream(), true, config.getEncoding()); logger.trace("Event BinRpcMessage: {}", message); byte[] returnValue = rpcResponseHandler.handleMethodCall(message.getMethodName(), message.getResponseData()); if (returnValue != null) { socket.getOutputStream().write(returnValue); } isMaxAliveReached = System.currentTimeMillis() - created > (config.getSocketMaxAlive() * 1000); } while (!isMaxAliveReached); } catch (EOFException eof) { closeSocket(); } catch (Exception e) { logger.error("{}", e.getMessage(), e); closeSocket(); } finally { closeSocket(); } }

Target:
public void run() { try { boolean isMaxAliveReached; do { BinRpcMessage message = new BinRpcMessage(socket.getInputStream(), true, config.getEncoding()); logger.trace("Event BinRpcMessage: {}", message); byte[] returnValue = rpcResponseHandler.handleMethodCall(message.getMethodName(), message.getResponseData()); if (returnValue != null) { socket.getOutputStream().write(returnValue); } isMaxAliveReached = System.currentTimeMillis() - created > (config.getSocketMaxAlive() * 1000); } while (!isMaxAliveReached); } catch (EOFException eof) { } catch (Exception e) { logger.warn("{}", e.getMessage(), e); } finally { try { socket.close(); } catch (IOException ioe) { } } }
Source:
public FindAllDeviceModelsResponse findAllDeviceModels( @OrganisationIdentification final String organisationIdentification, @RequestPayload final FindAllDeviceModelsRequest request) throws OsgpException { LOGGER.info("Find all DeviceModels for organisation: {}.", organisationIdentification); final FindAllDeviceModelsResponse response = new FindAllDeviceModelsResponse(); try { final List<DeviceModel> deviceModels = this.firmwareManagementService .findAllDeviceModels(organisationIdentification); response.getDeviceModels().addAll(this.firmwareManagementMapper.mapAsList(deviceModels, com.alliander.osgp.adapter.ws.schema.core.firmwaremanagement.DeviceModel.class)); } catch (final MethodConstraintViolationException e) { LOGGER.error("Exception: {}, StackTrace: {}", e.getMessage(), e.getStackTrace(), e); throw new FunctionalException(FunctionalExceptionType.VALIDATION_ERROR, ComponentType.WS_CORE, new ValidationException(e.getConstraintViolations())); } catch (final Exception e) { this.handleException(e); } return response; }

Target:
public FindAllDeviceModelsResponse findAllDeviceModels( @OrganisationIdentification final String organisationIdentification, @RequestPayload final FindAllDeviceModelsRequest request) throws OsgpException { LOGGER.info("Find all DeviceModels for organisation: {}.", organisationIdentification); final FindAllDeviceModelsResponse response = new FindAllDeviceModelsResponse(); try { final List<DeviceModel> deviceModels = this.firmwareManagementService .findAllDeviceModels(organisationIdentification); response.getDeviceModels().addAll(this.firmwareManagementMapper.mapAsList(deviceModels, com.alliander.osgp.adapter.ws.schema.core.firmwaremanagement.DeviceModel.class)); } catch (final MethodConstraintViolationException e) { LOGGER.error("Exception find all devicemodels {}: ", e); throw new FunctionalException(FunctionalExceptionType.VALIDATION_ERROR, ComponentType.WS_CORE, new ValidationException(e.getConstraintViolations())); } catch (final Exception e) { this.handleException(e); } return response; }
Source:
protected Object readRecord(Object old, Schema expected, ResolvingDecoder in) throws IOException { final Object record = data.newRecord(old, expected); final Object state = data.getRecordState(record, expected); final List<Field> expectedFields = expected.getFields(); for (Field field : in.readFieldOrder()) { int pos = field.pos(); String name = field.name(); Object oldDatum = null; if (old != null) { oldDatum = data.getField(record, name, pos, state); } readField(record, field, oldDatum, in, state); } return record; }

Target:
protected Object readRecord(Object old, Schema expected, ResolvingDecoder in) throws IOException { final Object record = data.newRecord(old, expected); final Object state = data.getRecordState(record, expected); for (Field field : in.readFieldOrder()) { int pos = field.pos(); String name = field.name(); Object oldDatum = null; if (old != null) { oldDatum = data.getField(record, name, pos, state); } readField(record, field, oldDatum, in, state); } return record; }
Source:
public HttpServerImpl(VertxInternal vertx, HttpServerOptions options) { this.options = HttpServerOptions.copiedOptions(options); this.vertx = vertx; this.creatingContext = vertx.getContext(); if (creatingContext != null) { if (creatingContext.isMultithreaded()) { throw new IllegalStateException("Cannot use HttpServer in a multi-threaded worker verticle"); } creatingContext.addCloseHook(this); } this.sslHelper = new SSLHelper(options, KeyStoreHelper.create(vertx, options.getKeyStoreOptions()), KeyStoreHelper.create(vertx, options.getTrustStoreOptions())); this.metrics = vertx.metrics().register(this, options); }

Target:
public HttpServerImpl(VertxInternal vertx, HttpServerOptions options) { this.options = HttpServerOptions.copiedOptions(options); this.vertx = vertx; this.creatingContext = vertx.getContext(); if (creatingContext != null) { if (creatingContext.isMultithreaded()) { throw new IllegalStateException("Cannot use HttpServer in a multi-threaded worker verticle"); } creatingContext.addCloseHook(this); } this.sslHelper = new SSLHelper(options, KeyStoreHelper.create(vertx, options.getKeyStoreOptions()), KeyStoreHelper.create(vertx, options.getTrustStoreOptions())); this.metrics = vertx.metricsSPI().register(this, options); }
Source:
public ToolDescription createToolDescription() { ToolDescriptionImpl toolDescription = new ToolDescriptionImpl(); return toolDescription; }

Target:
public ToolDescription createToolDescription() { ToolDescriptionImpl toolDescription = new ToolDescriptionImpl(); ElementVariable elementVar = createElementVariable(); elementVar.setName("element"); toolDescription.setElement(elementVar); ElementViewVariable elementViewVar = createElementViewVariable(); elementViewVar.setName("elementView"); toolDescription.setElementView(elementViewVar); toolDescription.setInitialOperation(this.createInitialOperation()); return toolDescription; }
Source:
void set(DiffPreferences prefs) { this.prefs = prefs; setIgnoreWhitespace(prefs.ignoreWhitespace()); tabWidth.setIntValue(prefs.tabSize()); lineLength.setIntValue(prefs.lineLength()); syntaxHighlighting.setValue(prefs.syntaxHighlighting()); whitespaceErrors.setValue(prefs.showWhitespaceErrors()); showTabs.setValue(prefs.showTabs()); lineNumbers.setValue(prefs.showLineNumbers()); leftSide.setValue(view.diffTable.isVisibleA()); leftSide.setEnabled(!prefs.hideEmptyPane()); emptyPane.setValue(!prefs.hideEmptyPane()); topMenu.setValue(!prefs.hideTopMenu()); manualReview.setValue(prefs.manualReview()); expandAllComments.setValue(prefs.expandAllComments()); renderEntireFile.setValue(prefs.renderEntireFile()); renderEntireFile.setEnabled(view.canEnableRenderEntireFile(prefs)); setTheme(prefs.theme()); mode.setEnabled(prefs.syntaxHighlighting()); if (prefs.syntaxHighlighting()) { setMode(view.getCmFromSide(DisplaySide.B).getStringOption("mode")); } switch (view.getIntraLineStatus()) { case OFF: case OK: intralineDifference.setValue(prefs.intralineDifference()); break; case TIMEOUT: case FAILURE: intralineDifference.setValue(false); intralineDifference.setEnabled(false); break; } if (prefs.context() == WHOLE_FILE_CONTEXT) { contextLastValue = DEFAULT_CONTEXT; context.setText(""); contextEntireFile.setValue(true); } else { context.setIntValue(prefs.context()); contextEntireFile.setValue(false); } }

Target:
void set(DiffPreferences prefs) { this.prefs = prefs; setIgnoreWhitespace(prefs.ignoreWhitespace()); tabWidth.setIntValue(prefs.tabSize()); lineLength.setIntValue(prefs.lineLength()); syntaxHighlighting.setValue(prefs.syntaxHighlighting()); whitespaceErrors.setValue(prefs.showWhitespaceErrors()); showTabs.setValue(prefs.showTabs()); lineNumbers.setValue(prefs.showLineNumbers()); leftSide.setValue(view.diffTable.isVisibleA()); emptyPane.setValue(!prefs.hideEmptyPane()); leftSide.setEnabled(!(prefs.hideEmptyPane() && view.diffTable.getChangeType() == ChangeType.ADDED)); topMenu.setValue(!prefs.hideTopMenu()); manualReview.setValue(prefs.manualReview()); expandAllComments.setValue(prefs.expandAllComments()); renderEntireFile.setValue(prefs.renderEntireFile()); renderEntireFile.setEnabled(view.canEnableRenderEntireFile(prefs)); setTheme(prefs.theme()); mode.setEnabled(prefs.syntaxHighlighting()); if (prefs.syntaxHighlighting()) { setMode(view.getCmFromSide(DisplaySide.B).getStringOption("mode")); } switch (view.getIntraLineStatus()) { case OFF: case OK: intralineDifference.setValue(prefs.intralineDifference()); break; case TIMEOUT: case FAILURE: intralineDifference.setValue(false); intralineDifference.setEnabled(false); break; } if (prefs.context() == WHOLE_FILE_CONTEXT) { contextLastValue = DEFAULT_CONTEXT; context.setText(""); contextEntireFile.setValue(true); } else { context.setIntValue(prefs.context()); contextEntireFile.setValue(false); } }
Source:
public void setHazelcastRegisteredEventListenerId(String hazelcastRegisteredEventListenerId) { this.hazelcastRegisteredEventListenerId = hazelcastRegisteredEventListenerId; }

Target:
protected void setHazelcastRegisteredEventListenerId(String hazelcastRegisteredEventListenerId) { this.hazelcastRegisteredEventListenerId = hazelcastRegisteredEventListenerId; }
Source:
public List<Integer> getProjects() { assert projects == null || !projects.isEmpty(); if (projects == null) { int fieldCount = target.getFieldCount(); List<Integer> res = new ArrayList<>(fieldCount); for (int i = 0; i < fieldCount; i++) { res.add(i); } return res; } return projects; }

Target:
public List<Integer> getProjects() { if (projects == null) { int fieldCount = target.getFieldCount(); List<Integer> res = new ArrayList<>(fieldCount); for (int i = 0; i < fieldCount; i++) { res.add(i); } return res; } return projects; }
Source:
private String readAllLines(BufferedReader bufferedReader) { String tempString; String returnString = null; try { while ((tempString = bufferedReader.readLine()) != null) { returnString += tempString + '\n'; } } catch (IOException e) { log.error("IOException while trying to read from buffer", e); } return (returnString == null) ? null : returnString.toString(); }

Target:
private String readAllLines(BufferedReader bufferedReader) { String tempString; StringBuilder returnString = new StringBuilder(); try { while ((tempString = bufferedReader.readLine()) != null) { returnString.append(tempString).append('\n'); } } catch (IOException e) { log.error("IOException while trying to read from buffer", e); } return returnString.toString(); }
Source:
public ConfigurationClientBuilder httpLogOptions(HttpLogOptions logOptions) { httpLogOptions = Objects.requireNonNull(logOptions, "Http log options cannot be null."); return this; }

Target:
public ConfigurationClientBuilder httpLogOptions(HttpLogOptions logOptions) { httpLogOptions = logOptions; return this; }
Source:
private Optional<CurrentWsResponse.Homepage> applicationAndPortfolioHomepage(DbSession dbSession, UserDto user) { Optional<ComponentDto> componentOptional = ofNullable(dbClient.componentDao().selectByUuid(dbSession, of(user.getHomepageParameter()).orElse(EMPTY)).orNull()); if (!componentOptional.isPresent() || !pluginRepository.hasPlugin(GOVERNANCE_PLUGIN_KEY) || !userSession.hasComponentPermission(USER, componentOptional.get())) { cleanUserHomepageInDb(dbSession, user); return empty(); } return of(CurrentWsResponse.Homepage.newBuilder() .setType(CurrentWsResponse.HomepageType.valueOf(user.getHomepageType())) .setComponent(componentOptional.get().getKey()) .build()); }

Target:
private Optional<CurrentWsResponse.Homepage> applicationAndPortfolioHomepage(DbSession dbSession, UserDto user) { Optional<ComponentDto> componentOptional = ofNullable(dbClient.componentDao().selectByUuid(dbSession, of(user.getHomepageParameter()).orElse(EMPTY)).orNull()); if (shouldCleanApplicationOrPortfolioHomepage(componentOptional)) { cleanUserHomepageInDb(dbSession, user); return empty(); } return of(CurrentWsResponse.Homepage.newBuilder() .setType(CurrentWsResponse.HomepageType.valueOf(user.getHomepageType())) .setComponent(componentOptional.get().getKey()) .build()); }
Source:
void boundaryError(Disposable subscriber, Throwable ex) { SubscriptionHelper.cancel(upstream); subscribers.delete(subscriber); if (errors.addThrowable(ex)) { subscribers.dispose(); synchronized (this) { buffers = null; } done = true; drain(); } else { RxJavaPlugins.onError(ex); } }

Target:
void boundaryError(Disposable subscriber, Throwable ex) { SubscriptionHelper.cancel(upstream); subscribers.delete(subscriber); onError(ex); }
Source:
private void setSingleWorkflowTargetState(String workflow, final TargetState state) { LOG.info("Set " + workflow + " to target state " + state); WorkflowConfig workflowConfig = TaskUtil.getWorkflowConfig(_accessor, workflow); if (workflowConfig == null) { LOG.warn("WorkflowConfig for not found!", workflow); return; } WorkflowContext workflowContext = TaskUtil.getWorkflowContext(_propertyStore, workflow); if (state != TargetState.DELETE && workflowContext != null && workflowContext.getFinishTime() != WorkflowContext.UNFINISHED) { LOG.info("Workflow is already completed, skip to update its target state {}", workflow + state); return; } DataUpdater<ZNRecord> updater = currentData -> { if (currentData != null) { currentData.setSimpleField(WorkflowConfig.WorkflowConfigProperty.TargetState.name(), state.name()); } else { LOG.warn( "TargetState DataUpdater: Fails to update target state for {}. CurrentData is null.", workflow); } return currentData; }; PropertyKey workflowConfigKey = TaskUtil.getWorkflowConfigKey(_accessor, workflow); _accessor.getBaseDataAccessor().update(workflowConfigKey.getPath(), updater, AccessOption.PERSISTENT); }

Target:
private void setSingleWorkflowTargetState(String workflow, final TargetState state) { LOG.info("Set " + workflow + " to target state " + state); WorkflowConfig workflowConfig = TaskUtil.getWorkflowConfig(_accessor, workflow); if (workflowConfig == null) { LOG.warn("WorkflowConfig for not found!", workflow); return; } WorkflowContext workflowContext = TaskUtil.getWorkflowContext(_propertyStore, workflow); if (state != TargetState.DELETE && workflowContext != null && workflowContext.getFinishTime() != WorkflowContext.UNFINISHED) { LOG.info("Workflow is already completed, skip to update its target state {}", workflow, state); return; } DataUpdater<ZNRecord> updater = currentData -> { if (currentData != null) { currentData.setSimpleField(WorkflowConfig.WorkflowConfigProperty.TargetState.name(), state.name()); } else { LOG.warn( "TargetState DataUpdater: Fails to update target state for {}. CurrentData is null.", workflow); } return currentData; }; PropertyKey workflowConfigKey = TaskUtil.getWorkflowConfigKey(_accessor, workflow); _accessor.getBaseDataAccessor().update(workflowConfigKey.getPath(), updater, AccessOption.PERSISTENT); }
Source:
private boolean validateLine(byte[] line, int lineStart, int lineEnd) { for (; lineStart < lineEnd; lineStart++) { if ((line[lineStart] & 128) > 0) { int utf8Index = lineStart++; int utf8Bit = 64; if ((line[utf8Index] & utf8Bit) == 0) { return false; } for (; (lineStart - utf8Index) < 4 && (line[utf8Index] & utf8Bit) > 0 && (line[lineStart] & 128) > 0 && (line[lineStart] & 64) == 0 ; lineStart++, utf8Bit >>= 1) {}; utf8Bit <<= 1; lineStart--; if ((lineStart - utf8Index) == 0) { return false; } if ((line[utf8Index] & utf8Bit) > 0 && (line[lineStart] & 128) == 0) { return false; } } } return true; }

Target:
private boolean validateLine(byte[] line, int lineStart, int lineEnd) { for (; lineStart < lineEnd; lineStart++) { if ((line[lineStart] & 128) > 0) { int utf8Index = lineStart++; int utf8Bit = 64; if ((line[utf8Index] & utf8Bit) == 0) { return false; } for (; (lineStart - utf8Index) < 4 && (line[utf8Index] & utf8Bit) > 0 && (line[lineStart] & 128) > 0 && (line[lineStart] & 64) == 0; lineStart++, utf8Bit >>= 1) { } utf8Bit <<= 1; lineStart--; if ((lineStart - utf8Index) == 0) { return false; } if ((line[utf8Index] & utf8Bit) > 0 && (line[lineStart] & 128) == 0) { return false; } } } return true; }
Source:
public String render(final GetTapesResult obj) { final TapeList result = obj.getTapes(); if (result == null || Guard.isNullOrEmpty(result.getTapes())) { return "You do not have any tapes"; } this.tapeList = result.getTapes(); initTable(ImmutableList.of("Bar Code", "ID", "State", "Last Modified", "Available Raw Capacity", "BucketID", "Assigned to Storage Domain", "Ejection Date", "Ejection Location", "Ejection Label")); return ASCIITable.getInstance().getTable(getHeaders(), formatTableContents()); }

Target:
public String render(final GetTapesResult obj) { final TapeList result = obj.getTapes(); if (result == null || Guard.isNullOrEmpty(result.getTapes())) { return "You do not have any tapes"; } this.tapeList = result.getTapes(); initTable(ImmutableList.of("Bar Code", "ID", "State", "Last Modified", "Available Raw Capacity", "BucketID", "Assigned to Storage Domain", "Ejection Date", "Ejection Location", "Ejection Label", "Ejection Pending")); return ASCIITable.getInstance().getTable(getHeaders(), formatTableContents()); }
Source:
public void onStartup(final ServletContext servletContext) throws ServletException { TimeZone.setDefault(TimeZone.getTimeZone("UTC")); Context initialContext; try { initialContext = new InitialContext(); final String logLocation = (String) initialContext .lookup("java:comp/env/osgp/AdapterDomainAdmin/log-config"); if ((new File(logLocation).exists())) { LogbackConfigurer.initLogging(logLocation); } else { LogbackConfigurer.initLogging("classpath:logback.xml"); } } catch (final NameNotFoundException | FileNotFoundException | JoranException e) { LOGGER.info("Caught an exception [" + e.getMessage() + "]"); LOGGER.info("Using classpath logback.xml."); } catch (final NamingException e) { throw new ServletException("naming exception", e); } final AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext(); rootContext.register(ApplicationContext.class); servletContext.addListener(new ContextLoaderListener(rootContext)); }

Target:
public void onStartup(final ServletContext servletContext) throws ServletException { startUp(servletContext); }
Source:
public void tesIsModifiedBySameLastModifiedAndDifferentSize() throws Exception { File f1 = createFile("foo", "lorem".getBytes()); File f2 = createFile("bar", "lorem ipsum".getBytes()); long now = System.currentTimeMillis(); f1.setLastModified(now); f2.setLastModified(now); FileSnapshot save = FileSnapshot.save(f1); Thread.sleep(3000L); assertEquals(save.lastModified(), f2.lastModified()); assertTrue(save.isModified(f2)); }

Target:
public void tesIsModifiedBySameLastModifiedAndDifferentSize() throws Exception { File f1 = createFile("foo", "lorem".getBytes()); File f2 = createFile("bar", "lorem ipsum".getBytes()); long now = System.currentTimeMillis(); f1.setLastModified(f2.lastModified()); FileSnapshot save = FileSnapshot.save(f1); Thread.sleep(3000L); assertEquals(save.lastModified(), f2.lastModified()); assertTrue(save.isModified(f2)); }
Source:
private void process(Message message, org.springframework.messaging.Message<Object> messagingMessage) { setAttributesIfNecessary(message, messagingMessage); org.springframework.messaging.Message<?> reply = sendAndReceiveMessage(messagingMessage); if (reply != null) { Address replyTo; String replyToProperty = message.getMessageProperties().getReplyTo(); if (replyToProperty != null) { replyTo = new Address(replyToProperty); } else { replyTo = AmqpInboundGateway.this.defaultReplyTo; } org.springframework.amqp.core.Message amqpMessage = MappingUtils.mapReplyMessage(reply, AmqpInboundGateway.this.amqpMessageConverter, AmqpInboundGateway.this.headerMapper, message.getMessageProperties().getReceivedDeliveryMode(), AmqpInboundGateway.this.replyHeadersMappedLast); if (replyTo != null) { AmqpInboundGateway.this.amqpTemplate.send(replyTo.getExchangeName(), replyTo.getRoutingKey(), amqpMessage); } else { if (!AmqpInboundGateway.this.amqpTemplateExplicitlySet) { throw new IllegalStateException("There is no 'replyTo' message property " + "and the `defaultReplyTo` hasn't been configured."); } else { AmqpInboundGateway.this.amqpTemplate.send(amqpMessage); } } } }

Target:
private void process(Message message, org.springframework.messaging.Message<Object> messagingMessage) { setAttributesIfNecessary(message, messagingMessage); org.springframework.messaging.Message<?> reply = sendAndReceiveMessage(messagingMessage); if (reply != null) { Address replyTo; String replyToProperty = message.getMessageProperties().getReplyTo(); if (replyToProperty != null) { replyTo = new Address(replyToProperty); } else { replyTo = AmqpInboundGateway.this.defaultReplyTo; } org.springframework.amqp.core.Message amqpMessage = MappingUtils.mapReplyMessage(reply, AmqpInboundGateway.this.templateMessageConverter, AmqpInboundGateway.this.headerMapper, message.getMessageProperties().getReceivedDeliveryMode(), AmqpInboundGateway.this.replyHeadersMappedLast); if (replyTo != null) { AmqpInboundGateway.this.amqpTemplate.send(replyTo.getExchangeName(), replyTo.getRoutingKey(), amqpMessage); } else { if (!AmqpInboundGateway.this.amqpTemplateExplicitlySet) { throw new IllegalStateException("There is no 'replyTo' message property " + "and the `defaultReplyTo` hasn't been configured."); } else { AmqpInboundGateway.this.amqpTemplate.send(amqpMessage); } } } }
Source:
protected TupleBatch countFilter(final TupleBatch tb) { final int numTuples = tb.numTuples(); if (numTuples <= 0) { return tb; } doCount.inputTB = tb; final List<? extends Column<?>> columns = tb.getDataColumns(); final BitSet toRemove = new BitSet(numTuples); for (int i = 0; i < numTuples; ++i) { final int nextIndex = uniqueTuples.numTuples(); final int cntHashCode = HashUtils.hashSubRow(tb, keyColIndices, i); IntArrayList tupleIndexList = uniqueTupleIndices.get(cntHashCode); if (tupleIndexList == null) { tupleIndexList = new IntArrayList(); uniqueTupleIndices.put(cntHashCode, tupleIndexList); } doCount.found = false; doCount.meet = false; doCount.sourceRow = i; tupleIndexList.forEach(doCount); if (!doCount.found) { for (int j : keyColIndices) { uniqueTuples.put(j, columns.get(j), i); } tupleCounts.put(0, new IntArrayColumn(new int[] { 1 }, 1), 0); tupleIndexList.add(nextIndex); if (threshold <= 1) { doCount.meet = true; } } if (!doCount.meet) { toRemove.set(i); } } return tb.filterOut(toRemove).selectColumns(keyColIndices); }

Target:
protected TupleBatch countFilter(final TupleBatch tb) { final int numTuples = tb.numTuples(); if (numTuples <= 0) { return tb; } doCount.inputTB = tb; final List<? extends Column<?>> columns = tb.getDataColumns(); final BitSet toRemove = new BitSet(numTuples); for (int i = 0; i < numTuples; ++i) { final int nextIndex = uniqueTuples.numTuples(); final int cntHashCode = HashUtils.hashSubRow(tb, keyColIndices, i); IntArrayList tupleIndexList = uniqueTupleIndices.get(cntHashCode); if (tupleIndexList == null) { tupleIndexList = new IntArrayList(); uniqueTupleIndices.put(cntHashCode, tupleIndexList); } doCount.found = false; doCount.meet = false; doCount.sourceRow = i; tupleIndexList.forEach(doCount); if (!doCount.found) { for (int j : keyColIndices) { uniqueTuples.put(j, columns.get(j), i); } tupleCounts.putInt(0, 1); tupleIndexList.add(nextIndex); if (threshold <= 1) { doCount.meet = true; } } if (!doCount.meet) { toRemove.set(i); } } return tb.filterOut(toRemove).selectColumns(keyColIndices); }
Source:
public void onSpawn() { rabbit = npc.getEntity() instanceof Rabbit ? (Rabbit) npc.getEntity() : null; }

Target:
public void onSpawn() { rabbit = npc.getEntity() instanceof Rabbit ? (Rabbit) npc.getEntity() : null; setType(type); }
Source:
protected void appendName(ActivityPartition activitypartition, Collection<String> displayValue, StringBuilder sb) { Element represents = activitypartition.getRepresents(); String activitypartitionName = UMLLabelInternationalization.getInstance().getLabel(activitypartition); if (represents != null) { try { activitypartitionName = ((NamedElement) represents).getName() ; } catch (ClassCastException e) { } } appendString(sb, activitypartitionName, UNAMED); return; }

Target:
protected void appendName(ActivityPartition activitypartition, Collection<String> displayValue, StringBuilder sb) { Element represents = activitypartition.getRepresents(); String activitypartitionName = UMLLabelInternationalization.getInstance().getLabel(activitypartition); if (represents != null) { if (represents instanceof NamedElement) { activitypartitionName = ((NamedElement) represents).getName() ; } } appendString(sb, activitypartitionName, UNAMED); return; }
Source:
public <Q, I, U> SubscriptionQueryResult<I, U> subscriptionQuery(String queryName, Q query, ResponseType<I> initialResponseType, ResponseType<U> updateResponseType, SubscriptionQueryBackpressure backpressure, int updateBufferSize) { return subscriptionQuery(queryName, query, initialResponseType, updateResponseType, backpressure, updateBufferSize); }

Target:
public <Q, I, U> SubscriptionQueryResult<I, U> subscriptionQuery(String queryName, Q query, ResponseType<I> initialResponseType, ResponseType<U> updateResponseType, SubscriptionQueryBackpressure backpressure, int updateBufferSize) { SubscriptionQueryMessage<?, I, U> interceptedQuery = getSubscriptionQueryMessage( queryName, query, initialResponseType, updateResponseType); SubscriptionQueryResult<QueryResponseMessage<I>, SubscriptionQueryUpdateMessage<U>> result = queryBus.subscriptionQuery(interceptedQuery, backpressure, updateBufferSize); return getSubscriptionQueryResult(result); }
Source:
private void flushData(final EventTypePartition pk, final List<ConsumedEvent> data, final Optional<String> metadata) { try { final NakadiCursor sentOffset = offsets.get(pk).getSentOffset(); final SubscriptionCursor cursor = getContext().getCursorConverter().convert( sentOffset, getContext().getCursorTokenService().generateToken()); final int batchSize = getContext().getWriter().writeSubscriptionBatch( getOut().getOutputStream(), cursor, data, metadata); getOut().getOutputStream().flush(); bytesSentMeter.mark(batchSize); batchesSent++; } catch (final IOException e) { getLog().error("Failed to write data to output.", e); shutdownGracefully("Failed to write data to output"); } }

Target:
private void flushData(final EventTypePartition pk, final List<ConsumedEvent> data, final Optional<String> metadata) { try { final NakadiCursor sentOffset = offsets.get(pk).getSentOffset(); final SubscriptionCursor cursor = getContext().getCursorConverter().convert( sentOffset, getContext().getCursorTokenService().generateToken()); final int batchSize = getContext().getWriter().writeSubscriptionBatch( getOut().getOutputStream(), cursor, data, metadata); bytesSentMeter.mark(batchSize); batchesSent++; } catch (final IOException e) { getLog().error("Failed to write data to output.", e); shutdownGracefully("Failed to write data to output"); } }
Source:
private static void addToRequired(final JSONObject schema, final String[] toBeRequired) { final Set<String> required = new HashSet<>(Arrays.asList(toBeRequired)); for(int i = 0; i < schema.getJSONArray("required").length(); i++) { required.add(schema.getJSONArray("required").getString(i)); } schema.put("required", required); }

Target:
private static void addToRequired(final JSONObject schema, final String[] toBeRequired) { final Set<String> required = new HashSet<>(Arrays.asList(toBeRequired)); JSONArray currentRequired = schema.getJSONArray("required"); for(int i = 0; i < currentRequired.length(); i++) { required.add(currentRequired.getString(i)); } schema.put("required", required); }