auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof GlusterBrickEntity)) { return false; } GlusterBrickEntity other = (GlusterBrickEntity) obj; return Objects.equals(id, other.id) && Objects.equals(volumeId, other.volumeId) && Objects.equals(serverId, other.serverId) && Objects.equals(brickDirectory, other.brickDirectory) && Objects.equals(brickOrder, other.brickOrder) && Objects.equals(asyncTask, other.asyncTask) && Objects.equals(unSyncedEntries, other.unSyncedEntries) && Objects.equals(unSyncedEntriesTrend, other.unSyncedEntriesTrend) && Objects.equals(selfHealEta, other.selfHealEta) && status == other.status && (Objects.equals(isArbiter, other.isArbiter)); }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof GlusterBrickEntity)) { return false; } GlusterBrickEntity other = (GlusterBrickEntity) obj; return Objects.equals(id, other.id) && Objects.equals(volumeId, other.volumeId) && Objects.equals(serverId, other.serverId) && Objects.equals(brickDirectory, other.brickDirectory) && Objects.equals(brickOrder, other.brickOrder) && Objects.equals(asyncTask, other.asyncTask) && Objects.equals(unSyncedEntries, other.unSyncedEntries) && Objects.equals(unSyncedEntriesTrend, other.unSyncedEntriesTrend) && Objects.equals(selfHealEta, other.selfHealEta) && status == other.status && Objects.equals(isArbiter, other.isArbiter); }
Source:
public Repository(final File d, final File workTree, final File objectDir, final File[] alternateObjectDir, final File indexFile, FS fs) throws IOException { if (workTree != null) { workDir = workTree; if (d == null) gitDir = new File(workTree, Constants.DOT_GIT); else gitDir = d; } else { if (d != null) gitDir = d; else throw new IllegalArgumentException("Either GIT_DIR or GIT_WORK_TREE must be passed to Repository constructor"); } this.fs = fs; userConfig = SystemReader.getInstance().openUserConfig(fs); config = new RepositoryConfig(userConfig, fs.resolve(gitDir, "config")); loadUserConfig(); loadConfig(); if (workDir == null) { String workTreeConfig = getConfig().getString("core", null, "worktree"); if (workTreeConfig != null) { workDir = fs.resolve(d, workTreeConfig); } else { workDir = gitDir.getParentFile(); } } refs = new RefDirectory(this); if (objectDir != null) objectDatabase = new ObjectDirectory(fs.resolve(objectDir, ""), alternateObjectDir); else objectDatabase = new ObjectDirectory(fs.resolve(gitDir, "objects"), alternateObjectDir); if (indexFile != null) this.indexFile = indexFile; else this.indexFile = new File(gitDir, "index"); if (objectDatabase.exists()) { final String repositoryFormatVersion = getConfig().getString( "core", null, "repositoryFormatVersion"); if (!"0".equals(repositoryFormatVersion)) { throw new IOException("Unknown repository format \"" + repositoryFormatVersion + "\"; expected \"0\"."); } } }

Target:
public Repository(final File d, final File workTree, final File objectDir, final File[] alternateObjectDir, final File indexFile, FS fs) throws IOException { if (workTree != null) { workDir = workTree; if (d == null) gitDir = new File(workTree, Constants.DOT_GIT); else gitDir = d; } else { if (d != null) gitDir = d; else throw new IllegalArgumentException("Either GIT_DIR or GIT_WORK_TREE must be passed to Repository constructor"); } this.fs = fs; userConfig = SystemReader.getInstance().openUserConfig(fs); config = new RepositoryConfig(userConfig, fs.resolve(gitDir, "config")); loadUserConfig(); loadConfig(); if (workDir == null) { String workTreeConfig = getConfig().getString("core", null, "worktree"); if (workTreeConfig != null) { workDir = fs.resolve(d, workTreeConfig); } else { workDir = gitDir.getParentFile(); } } refs = new RefDirectory(this); if (objectDir != null) objectDatabase = new ObjectDirectory(fs.resolve(objectDir, ""), alternateObjectDir, fs); else objectDatabase = new ObjectDirectory(fs.resolve(gitDir, "objects"), alternateObjectDir, fs); if (indexFile != null) this.indexFile = indexFile; else this.indexFile = new File(gitDir, "index"); if (objectDatabase.exists()) { final String repositoryFormatVersion = getConfig().getString( "core", null, "repositoryFormatVersion"); if (!"0".equals(repositoryFormatVersion)) { throw new IOException("Unknown repository format \"" + repositoryFormatVersion + "\"; expected \"0\"."); } } }
Source:
private void dumpDirectly(final String path, final String jobName, final List<String> result) { for (String each : regCenter.getChildrenKeys(path)) { String zkPath = path + "/" + each; String zkValue = Optional.ofNullable(regCenter.get(zkPath)).orElse(""); String cachePath = zkPath; String cacheValue = zkValue; CuratorCache cache = (CuratorCache) regCenter.getRawCache("/" + jobName); if (null != cache) { Optional<ChildData> cacheData = cache.get(zkPath); cachePath = cacheData.map(ChildData::getPath).orElse(zkPath); cacheValue = cacheData.map(ChildData::getData).map(String::new).orElse(zkValue); } if (zkValue.equals(cacheValue) && zkPath.equals(cachePath)) { result.add(String.join(" | ", zkPath, zkValue)); } else { result.add(String.join(" | ", zkPath, zkValue, cachePath, cacheValue)); } dumpDirectly(zkPath, jobName, result); } }

Target:
private void dumpDirectly(final String path, final String jobName, final List<String> result) { for (String each : regCenter.getChildrenKeys(path)) { String zkPath = path + "/" + each; String zkValue = Optional.ofNullable(regCenter.get(zkPath)).orElse(""); String cachePath = zkPath; String cacheValue = zkValue; CuratorCache cache = (CuratorCache) regCenter.getRawCache("/" + jobName); if (null != cache) { Optional<ChildData> cacheData = cache.get(zkPath); cachePath = cacheData.map(ChildData::getPath).orElse(""); cacheValue = cacheData.map(ChildData::getData).map(String::new).orElse(""); } if (zkValue.equals(cacheValue) && zkPath.equals(cachePath)) { result.add(String.join(" | ", zkPath, zkValue)); } else { result.add(String.join(" | ", zkPath, zkValue, cachePath, cacheValue)); } dumpDirectly(zkPath, jobName, result); } }
Source:
private static DetailAST getNodeFromFile(int type) throws Exception { return getNode(parseFile(getPath("checkutils/InputCheckUtilsTest.java")), type); }

Target:
private static DetailAST getNodeFromFile(int type) throws Exception { return getNode(parseFile(getPath("InputCheckUtilsTest.java")), type); }
Source:
public void setCommandExecuted() { Transaction transaction = TransactionSupport.suspend(); try { CommandEntity cmdEntity = CommandCoordinatorUtil.getCommandEntity(getCommandId()); if (cmdEntity != null) { CommandEntity executedCmdEntity = buildCommandEntity(cmdEntity.getRootCommandId(), cmdEntity.isCallbackEnabled()); executedCmdEntity.setWaitingForEvent(callbackTriggeredByEvent()); CommandCoordinatorUtil.persistCommand(executedCmdEntity, getContext()); CommandCoordinatorUtil.updateCommandExecuted(getCommandId()); } } finally { if (transaction != null) { TransactionSupport.resume(transaction); } } }

Target:
public void setCommandExecuted() { Transaction transaction = TransactionSupport.suspend(); try { CommandEntity cmdEntity = CommandCoordinatorUtil.getCommandEntity(getCommandId()); if (cmdEntity != null) { CommandEntity executedCmdEntity = buildCommandEntity(cmdEntity.getRootCommandId(), cmdEntity.isCallbackEnabled()); executedCmdEntity .setWaitingForEvent(cmdEntity.isCallbackEnabled() ? callbackTriggeredByEvent() : false); CommandCoordinatorUtil.persistCommand(executedCmdEntity, getContext()); CommandCoordinatorUtil.updateCommandExecuted(getCommandId()); } } finally { if (transaction != null) { TransactionSupport.resume(transaction); } } }
Source:
public void controller(FragmentConfiguration config, @FragmentParam("patient") PatientDomainWrapper pdw, @SpringBean("adtService") AdtService adtService, UiSessionContext sessionContext, UiUtils uiUtils, FragmentModel model) { model.addAttribute("activeVisitStartDatetime", null); Patient patient = pdw.getPatient(); VisitDomainWrapper activeVisit = (VisitDomainWrapper) config.getAttribute("activeVisit"); if (activeVisit == null) { try { Location visitLocation = adtService.getLocationThatSupportsVisits(sessionContext.getSessionLocation()); activeVisit = adtService.getActiveVisit(patient, visitLocation); } catch (IllegalArgumentException ex) { } } if (activeVisit != null) { model.addAttribute("activeVisit", activeVisit); model.addAttribute("activeVisitStartDatetime", DateFormatUtils.format(activeVisit.getStartDatetime(), "dd MMM yyyy hh:mm a", Context.getLocale())); } }

Target:
public void controller(FragmentConfiguration config, @FragmentParam("patient") PatientDomainWrapper pdw, @SpringBean("adtService") AdtService adtService, UiSessionContext sessionContext, UiUtils uiUtils, FragmentModel model) { model.addAttribute("activeVisitStartDatetime", null); Patient patient = pdw.getPatient(); VisitDomainWrapper activeVisit = (VisitDomainWrapper) config.getAttribute("activeVisit"); if (activeVisit == null) { try { Location visitLocation = adtService.getLocationThatSupportsVisits(sessionContext.getSessionLocation()); activeVisit = adtService.getActiveVisit(patient, visitLocation); } catch (IllegalArgumentException ex) { } } if (activeVisit != null) { model.addAttribute("activeVisit", activeVisit); model.addAttribute("activeVisitStartDatetime", uiUtils.format(activeVisit.getStartDatetime())); } }
Source:
public static LongObjectOpenHashMap<BigFraction> readLongBigFractionOpenHashMap(ObjectInputStream stream) throws ClassNotFoundException, IOException { boolean[] allocated = (boolean[]) stream.readObject(); long[] keys = (long[]) stream.readObject(); BigFraction[] values = (BigFraction[]) stream.readObject(); LongObjectOpenHashMap<BigFraction> result = new LongObjectOpenHashMap<BigFraction>(); for (int i=0; i<allocated.length; i++) { if (allocated[i]) { result.put(keys[i], values[i]); } } return result; }

Target:
public static LongObjectOpenHashMap<BigFraction> readLongBigFractionOpenHashMap(ObjectInputStream stream) throws ClassNotFoundException, IOException { boolean[] allocated = (boolean[]) stream.readObject(); long[] keys = (long[]) stream.readObject(); Object[] values = (Object[]) stream.readObject(); LongObjectOpenHashMap<BigFraction> result = new LongObjectOpenHashMap<BigFraction>(); for (int i=0; i<allocated.length; i++) { if (allocated[i]) { result.put(keys[i], (BigFraction)values[i]); } } return result; }
Source:
public void testWriteRecord() throws IOException, CopycatException { Properties props = createProps(); HdfsSinkConnectorConfig connectorConfig = new HdfsSinkConnectorConfig(props); HdfsWriter hdfsWriter = new HdfsWriter(connectorConfig); String topicsDir = connectorConfig.getString(HdfsSinkConnectorConfig.TOPIC_DIR_CONFIG); String topic = "topic"; int partition = 0; String key = "key"; GenericRecord record = createRecord(); TopicPartition topicPart = new TopicPartition(topic, partition); for (long offset = 0; offset < 7; offset++) { SinkRecord sinkRecord = new SinkRecord(topic, partition, key, record, offset); hdfsWriter.writeRecord(topicPart, sinkRecord); } hdfsWriter.close(); long[] validOffsets = {-1, 2, 5, 6}; for (int i = 1; i < validOffsets.length; i++) { Path path = new Path(FileUtils.fileName(url, topicsDir, topicPart, validOffsets[i])); Collection<Object> records = readAvroFile(path); long size = validOffsets[i] - validOffsets[i - 1]; assertEquals(records.size(), size); for (Object avroRecord: records) { assertEquals(avroRecord, AvroData.convertToAvro(record)); } } long[] inValidOffsets = {0, 1, 3, 4}; for (long offset: inValidOffsets) { Path path = new Path(FileUtils.fileName(url, topicsDir, topicPart, offset)); assertFalse(fs.exists(path)); } }

Target:
public void testWriteRecord() throws IOException, CopycatException { Properties props = createProps(); HdfsSinkConnectorConfig connectorConfig = new HdfsSinkConnectorConfig(props); HdfsWriter hdfsWriter = new HdfsWriter(connectorConfig); String topicsDir = connectorConfig.getString(HdfsSinkConnectorConfig.TOPIC_DIR_CONFIG); String topic = "topic"; int partition = 0; String key = "key"; GenericRecord record = createRecord(); TopicPartition topicPart = new TopicPartition(topic, partition); for (long offset = 0; offset < 7; offset++) { SinkRecord sinkRecord = new SinkRecord(topic, partition, key, record, offset); hdfsWriter.writeRecord(topicPart, sinkRecord); } hdfsWriter.close(); long[] validOffsets = {-1, 2, 5, 6}; for (int i = 1; i < validOffsets.length; i++) { Path path = new Path(FileUtils.committedFileName(url, topicsDir, topicPart, validOffsets[i])); Collection<Object> records = readAvroFile(path); long size = validOffsets[i] - validOffsets[i - 1]; assertEquals(records.size(), size); for (Object avroRecord: records) { assertEquals(avroRecord, AvroData.convertToAvro(record)); } } long[] inValidOffsets = {0, 1, 3, 4}; for (long offset: inValidOffsets) { Path path = new Path(FileUtils.committedFileName(url, topicsDir, topicPart, offset)); assertFalse(fs.exists(path)); } }
Source:
protected CompactJavaSerializer(ClassLoader loader, Map<Integer, ObjectStreamClass> mappings) { this(loader); System.out.println(mappings); for (Entry<Integer, ObjectStreamClass> e : mappings.entrySet()) { Integer encoding = e.getKey(); ObjectStreamClass disconnectedOsc = disconnect(e.getValue()); readLookup.put(encoding, disconnectedOsc); if (writeLookup.putIfAbsent(new SerializableDataKey(disconnectedOsc, true), encoding) != null) { throw new AssertionError("Corrupted data " + mappings.toString()); } } }

Target:
protected CompactJavaSerializer(ClassLoader loader, Map<Integer, ObjectStreamClass> mappings) { this(loader); for (Entry<Integer, ObjectStreamClass> e : mappings.entrySet()) { Integer encoding = e.getKey(); ObjectStreamClass disconnectedOsc = disconnect(e.getValue()); readLookup.put(encoding, disconnectedOsc); if (writeLookup.putIfAbsent(new SerializableDataKey(disconnectedOsc, true), encoding) != null) { throw new AssertionError("Corrupted data " + mappings.toString()); } } }
Source:
public IDefinition getDefinition(String fieldName) { if( fieldName.equals(AbstractEventHeaderDecl.ID)){ return new IntegerDefinition(IntegerDeclaration.INT_32B_DECL, null, AbstractEventHeaderDecl.ID, getId()); } else if(fieldName.equals(AbstractEventHeaderDecl.TIMESTAMP)){ return new IntegerDefinition(IntegerDeclaration.INT_64B_DECL, null, AbstractEventHeaderDecl.TIMESTAMP, getTimestamp()); } return null; }

Target:
public Definition getDefinition(String fieldName) { if (fieldName.equals(AbstractEventHeaderDecl.ID)) { return new IntegerDefinition(IntegerDeclaration.INT_32B_DECL, null, AbstractEventHeaderDecl.ID, getId()); } else if (fieldName.equals(AbstractEventHeaderDecl.TIMESTAMP)) { return new IntegerDefinition(IntegerDeclaration.INT_64B_DECL, null, AbstractEventHeaderDecl.TIMESTAMP, getTimestamp()); } return null; }
Source:
public MenuItem newExportsItem(final Command exportPNGCommand, final Command exportJPGCommand, final Command exportPDFCommand, final Command exportBPMNCommand) { final DropDownMenu menu = new DropDownMenu() {{ setPull(Pull.RIGHT); }}; menu.add(new AnchorListItem("Export to PNG") {{ setIcon(IconType.FILE_IMAGE_O); setIconPosition(IconPosition.LEFT); setTitle("Export to PNG"); addClickHandler(event -> exportPNGCommand.execute()); }}); menu.add(new AnchorListItem("Export to JPG") {{ setIcon(IconType.FILE_IMAGE_O); setIconPosition(IconPosition.LEFT); setTitle("Export to JPG"); addClickHandler(event -> exportJPGCommand.execute()); }}); menu.add(new AnchorListItem("Export to PDF") {{ setIcon(IconType.FILE_PDF_O); setIconPosition(IconPosition.LEFT); setTitle("Export to PDF"); addClickHandler(event -> exportPDFCommand.execute()); }}); menu.add(new AnchorListItem("Export to BPMN") {{ setIcon(IconType.FILE_TEXT_O); setIconPosition(IconPosition.LEFT); setTitle("Export to BPMN"); addClickHandler(event -> exportBPMNCommand.execute()); }}); final IsWidget group = new ButtonGroup() {{ add(new Button() {{ setToggleCaret(true); setDataToggle(Toggle.DROPDOWN); setIcon(IconType.IMAGE); setSize(ButtonSize.SMALL); setTitle("Export diagram"); }}); add(menu); }}; return buildItem(group); }

Target:
public MenuItem newExportsItem(final Command exportPNGCommand, final Command exportJPGCommand, final Command exportPDFCommand, final Command exportBPMNCommand) { final DropDownMenu menu = new DropDownMenu() {{ setPull(Pull.RIGHT); }}; menu.add(new AnchorListItem("Download as PNG") {{ setIcon(IconType.FILE_IMAGE_O); setIconPosition(IconPosition.LEFT); setTitle("Download as PNG"); addClickHandler(event -> exportPNGCommand.execute()); }}); menu.add(new AnchorListItem("Download as JPG") {{ setIcon(IconType.FILE_IMAGE_O); setIconPosition(IconPosition.LEFT); setTitle("Download as JPG"); addClickHandler(event -> exportJPGCommand.execute()); }}); menu.add(new AnchorListItem("Download as PDF") {{ setIcon(IconType.FILE_PDF_O); setIconPosition(IconPosition.LEFT); setTitle("Download as PDF"); addClickHandler(event -> exportPDFCommand.execute()); }}); menu.add(new AnchorListItem("Download as BPMN") {{ setIcon(IconType.FILE_TEXT_O); setIconPosition(IconPosition.LEFT); setTitle("Download as BPMN"); addClickHandler(event -> exportBPMNCommand.execute()); }}); final IsWidget group = new ButtonGroup() {{ add(new Button() {{ setToggleCaret(true); setDataToggle(Toggle.DROPDOWN); setIcon(IconType.IMAGE); setSize(ButtonSize.SMALL); setTitle("Download diagram"); }}); add(menu); }}; return buildItem(group); }
Source:
public static Set<DistributionModuleGroup> getModuleGroups(String distribution, String version) { HDFSLinkedNodeCondition hdfsLinkedNodeCondition = new HDFSLinkedNodeCondition(distribution, version); DistributionModuleGroup dmgWebHDFS = new DistributionModuleGroup(CDH5100Constant.WEBHDFS_MODULE_GROUP.getModuleName(), true, hdfsLinkedNodeCondition.getWebHDFSCondition()); DistributionModuleGroup dmgADLS = new DistributionModuleGroup(CDH5100Constant.SPARK_AZURE_MRREQUIRED_MODULE_GROUP.getModuleName(), true, hdfsLinkedNodeCondition.getAdlsCondition()); Set<DistributionModuleGroup> hs = new HashSet<>(); hs.add(dmgWebHDFS); hs.add(dmgADLS); return hs; }

Target:
public static Set<DistributionModuleGroup> getModuleGroups(String distribution, String version) { HDFSLinkedNodeCondition hdfsLinkedNodeCondition = new HDFSLinkedNodeCondition(distribution, version); DistributionModuleGroup dmgWebHDFS = new DistributionModuleGroup(CDH5100Constant.WEBHDFS_MODULE_GROUP.getModuleName(), true, hdfsLinkedNodeCondition.getWebHDFSCondition()); Set<DistributionModuleGroup> hs = new HashSet<>(); hs.add(dmgWebHDFS); return hs; }
Source:
private ContentTypeConvertingInterceptor(String contentType, boolean input) { this.contentType = contentType; this.mimeType = MessageConverterUtils.getMimeType(contentType); this.input = input; if (MessageConverterUtils.X_JAVA_OBJECT.includes(this.mimeType)) { this.klazz = MessageConverterUtils .getJavaTypeForJavaObjectContentType(this.mimeType); } else if (this.mimeType.equals(MessageConverterUtils.X_SPRING_TUPLE)) { this.klazz = Tuple.class; } else if (this.mimeType.getType().equals("text") || this.mimeType.getSubtype().equals( "json") || this.mimeType.getSubtype().equals("xml")) { this.klazz = String.class; } else { this.klazz = byte[].class; } if (input) { this.messageConverter = new MessageWrappingMessageConverter( MessageConverterConfigurer.this.compositeMessageConverterFactory .getMessageConverterForType(this.mimeType), this.mimeType); } else { this.messageConverter = new MessageWrappingMessageConverter( MessageConverterConfigurer.this.compositeMessageConverterFactory .getMessageConverterForType(this.mimeType), this.mimeType); } }

Target:
private ContentTypeConvertingInterceptor(String contentType, boolean input) { this.contentType = contentType; this.mimeType = MessageConverterUtils.getMimeType(contentType); this.input = input; if (MessageConverterUtils.X_JAVA_OBJECT.includes(this.mimeType)) { this.klazz = MessageConverterUtils .getJavaTypeForJavaObjectContentType(this.mimeType); } else if (this.mimeType.equals(MessageConverterUtils.X_SPRING_TUPLE)) { this.klazz = Tuple.class; } else if (this.mimeType.getType().equals("text") || this.mimeType.getSubtype().equals( "json") || this.mimeType.getSubtype().equals("xml")) { this.klazz = String.class; } else { this.klazz = byte[].class; } this.messageConverter = new MessageWrappingMessageConverter( MessageConverterConfigurer.this.compositeMessageConverterFactory .getMessageConverterForType(this.mimeType), this.mimeType); }
Source:
public void testSendPingAgent() throws IOException, InterruptedException { TestApplication app = new TestApplication(); ManagedApplication ma = new ManagedApplication( app, this.folder.newFolder() ); this.manager.getAppNameToManagedApplication().put( app.getName(), ma ); for (Instance i : app.getRootInstances()) { this.manager.pingAgent( app.getName(), i.getName(), "TEST " + i.getName(), 0L ); } List<Message> sentMessages = this.msgClient.sentMessages; Assert.assertTrue( sentMessages.size() == app.getRootInstances().size() ); int index = 0; for (Instance i : app.getRootInstances()) { Message message = sentMessages.get( index++ ); Assert.assertTrue( message instanceof MsgEcho ); MsgEcho echo = (MsgEcho) message; Assert.assertTrue( echo.getContent().equals( "PING:TEST " + i.getName()) ); } }

Target:
public void testSendPingAgent() throws IOException, InterruptedException { TestApplication app = new TestApplication(); ManagedApplication ma = new ManagedApplication( app, this.folder.newFolder() ); this.manager.getAppNameToManagedApplication().put( app.getName(), ma ); for (Instance i : app.getRootInstances()) { this.manager.pingAgent( app.getName(), i.getName(), "TEST " + i.getName(), 0L ); } List<Message> sentMessages = this.msgClient.sentMessages; Assert.assertTrue( sentMessages.size() == app.getRootInstances().size() ); int index = 0; for (Instance i : app.getRootInstances()) { Message message = sentMessages.get( index++ ); Assert.assertTrue( message instanceof MsgEcho ); MsgEcho echo = (MsgEcho) message; Assert.assertEquals( "PING:TEST " + i.getName(), echo.getContent() ); } }
Source:
private ServiceMessage toResponse(Object response, Map<String, String> headers) { if (response instanceof ServiceMessage) { return (ServiceMessage) response; } return ServiceMessage.builder() .qualifier(methodInfo.qualifier()) .headers(headers) .data(response) .build(); }

Target:
private ServiceMessage toResponse(Object response, Map<String, String> headers) { if (response instanceof ServiceMessage) { ServiceMessage response1 = (ServiceMessage) response; return ServiceMessage.from(response1).qualifier(methodInfo.qualifier()).build(); } return ServiceMessage.builder() .qualifier(methodInfo.qualifier()) .headers(headers) .data(response) .build(); }
Source:
protected void doStop() throws Exception { if (aggregateController != null) { aggregateController.onStop(this); } if (recoverService != null) { camelContext.getExecutorServiceManager().shutdown(recoverService); } if (timeoutCheckerExecutorService != null) { camelContext.getExecutorServiceManager().shutdown(timeoutCheckerExecutorService); timeoutCheckerExecutorService = null; } ServiceHelper.stopServices(timeoutMap, processor, deadLetterProducerTemplate); if (closedCorrelationKeys != null) { ServiceHelper.stopService(closedCorrelationKeys); closedCorrelationKeys.clear(); } batchConsumerCorrelationKeys.clear(); redeliveryState.clear(); }

Target:
protected void doStop() throws Exception { if (aggregateController != null) { aggregateController.onStop(this); } if (recoverService != null) { camelContext.getExecutorServiceManager().shutdown(recoverService); } if (shutdownTimeoutCheckerExecutorService && timeoutCheckerExecutorService != null) { camelContext.getExecutorServiceManager().shutdown(timeoutCheckerExecutorService); timeoutCheckerExecutorService = null; shutdownTimeoutCheckerExecutorService = false; } ServiceHelper.stopServices(timeoutMap, processor, deadLetterProducerTemplate); if (closedCorrelationKeys != null) { ServiceHelper.stopService(closedCorrelationKeys); closedCorrelationKeys.clear(); } batchConsumerCorrelationKeys.clear(); redeliveryState.clear(); }
Source:
protected boolean validateImages() { return ImagesHandler.PerformImagesChecks(getVm(), getReturnValue().getCanDoActionMessages(), getVm().getstorage_pool_id(), Guid.Empty, true, true, false, false, true, true, true, true, null); }

Target:
protected boolean validateImages() { return ImagesHandler.PerformImagesChecks(getVm(), getReturnValue().getCanDoActionMessages(), getVm().getstorage_pool_id(), Guid.Empty, true, true, hasImages(), hasImages(), true, true, true, true, null); }
Source:
private ITimeGraphState createTimeGraphState(ITmfStateInterval interval, ITmfStateSystem ss) throws StateSystemDisposedException { long startTime = interval.getStartTime(); long endTime = interval.getEndTime(); long duration = endTime - startTime + 1; Object status = interval.getValue(); if (status instanceof Integer) { int s = (int) status; if (s == StateValues.CPU_STATUS_RUN_USERMODE || s == StateValues.CPU_STATUS_RUN_SYSCALL) { return fTimeEventNames.getUnchecked(interval); } if (s != 0) { int quark = ss.optQuarkAbsolute(Attributes.THREADS, Integer.toString(s), Attributes.EXEC_NAME); if (quark != ITmfStateSystem.INVALID_ATTRIBUTE) { ITmfStateInterval nameInterval = ss.querySingleState(endTime, quark); Object processName = nameInterval.getValue(); if (processName instanceof String) { return new TimeGraphState(startTime, duration, s, (String) processName); } } return new TimeGraphState(startTime, duration, s); } return new TimeGraphState(startTime, duration, s); } return new TimeGraphState(startTime, duration, Integer.MIN_VALUE); }

Target:
private ITimeGraphState createTimeGraphState(ITmfStateInterval interval, ITmfStateSystem ss) throws StateSystemDisposedException { long startTime = interval.getStartTime(); long endTime = interval.getEndTime(); long duration = endTime - startTime + 1; Object statusObj = interval.getValue(); if (statusObj instanceof Integer) { int status = (int) statusObj; if (status == StateValues.CPU_STATUS_RUN_USERMODE || status == StateValues.CPU_STATUS_RUN_SYSCALL) { return fTimeEventNames.getUnchecked(interval); } if (status != 0) { Object processName = null; if (execNameIntervals.containsEntry(status, new OverlapComparableInterval(interval))) { processName = execNameIntervals.get(status).first().getInterval().getValue(); } else { int quark = ss.optQuarkAbsolute(Attributes.THREADS, Integer.toString(status), Attributes.EXEC_NAME); if (quark != ITmfStateSystem.INVALID_ATTRIBUTE) { ITmfStateInterval namedInterval = ss.querySingleState(endTime, quark); execNameIntervals.put(status, new OverlapComparableInterval(namedInterval)); processName = namedInterval.getValue(); } } if (processName instanceof String) { return new TimeGraphState(startTime, duration, status, (String) processName + '/' + status); } } return new TimeGraphState(startTime, duration, status); } return new TimeGraphState(startTime, duration, Integer.MIN_VALUE); }
Source:
private void initAssets() { DefaultBlockFamilyFactoryRegistry familyFactoryRegistry = new DefaultBlockFamilyFactoryRegistry(); rootContext.put(BlockFamilyFactoryRegistry.class, familyFactoryRegistry); assetTypeManager.registerCoreAssetType(Prefab.class, (AssetFactory<Prefab, PrefabData>) PojoPrefab::new, false, "prefabs"); assetTypeManager.registerCoreAssetType(BlockShape.class, (AssetFactory<BlockShape, BlockShapeData>) BlockShapeImpl::new, "shapes"); assetTypeManager.registerCoreAssetType(BlockSounds.class, (AssetFactory<BlockSounds, BlockSoundsData>) BlockSounds::new, "blockSounds"); assetTypeManager.registerCoreAssetType(BlockTile.class, (AssetFactory<BlockTile, TileData>) BlockTile::new, "blockTiles"); assetTypeManager.registerCoreAssetType(BlockFamilyDefinition.class, (AssetFactory<BlockFamilyDefinition, BlockFamilyDefinitionData>) BlockFamilyDefinition::new, "blocks"); assetTypeManager.registerCoreFormat(BlockFamilyDefinition.class, new BlockFamilyDefinitionFormat(assetTypeManager.getAssetManager(), familyFactoryRegistry)); assetTypeManager.registerCoreAssetType(UISkin.class, (AssetFactory<UISkin, UISkinData>) UISkin::new, "skins"); assetTypeManager.registerCoreAssetType(BehaviorTree.class, (AssetFactory<BehaviorTree, BehaviorTreeData>) BehaviorTree::new, false, "behaviors"); assetTypeManager.registerCoreAssetType(UIElement.class, (AssetFactory<UIElement, UIData>) UIElement::new, "ui"); assetTypeManager.registerCoreAssetType(Translation.class, (AssetFactory<Translation, TranslationData>) Translation::new, "i18n"); for (EngineSubsystem subsystem : allSubsystems) { subsystem.registerCoreAssetTypes(assetTypeManager); } }

Target:
private void initAssets() { DefaultBlockFamilyFactoryRegistry familyFactoryRegistry = new DefaultBlockFamilyFactoryRegistry(); rootContext.put(BlockFamilyFactoryRegistry.class, familyFactoryRegistry); assetTypeManager.registerCoreAssetType(Prefab.class, (AssetFactory<Prefab, PrefabData>) PojoPrefab::new, false, "prefabs"); assetTypeManager.registerCoreAssetType(BlockShape.class, (AssetFactory<BlockShape, BlockShapeData>) BlockShapeImpl::new, "shapes"); assetTypeManager.registerCoreAssetType(BlockSounds.class, (AssetFactory<BlockSounds, BlockSoundsData>) BlockSounds::new, "blockSounds"); assetTypeManager.registerCoreAssetType(BlockTile.class, (AssetFactory<BlockTile, TileData>) BlockTile::new, "blockTiles"); assetTypeManager.registerCoreAssetType(BlockFamilyDefinition.class, (AssetFactory<BlockFamilyDefinition, BlockFamilyDefinitionData>) BlockFamilyDefinition::new, "blocks"); assetTypeManager.registerCoreFormat(BlockFamilyDefinition.class, new BlockFamilyDefinitionFormat(assetTypeManager.getAssetManager(), familyFactoryRegistry)); assetTypeManager.registerCoreAssetType(UISkin.class, (AssetFactory<UISkin, UISkinData>) UISkin::new, "skins"); assetTypeManager.registerCoreAssetType(BehaviorTree.class, (AssetFactory<BehaviorTree, BehaviorTreeData>) BehaviorTree::new, false, "behaviors"); assetTypeManager.registerCoreAssetType(UIElement.class, (AssetFactory<UIElement, UIData>) UIElement::new, "ui"); for (EngineSubsystem subsystem : allSubsystems) { subsystem.registerCoreAssetTypes(assetTypeManager); } }
Source:
private Path pathFor(String name) { assert name.codePointCount(0, name.length()) > 0; if (encoded) { String normalized = Normalizer.normalize(name.toLowerCase(Locale.ROOT), Normalizer.Form.NFKC) .replaceAll("[^a-z0-9]", "_"); String base32 = ByteIterator.ofBytes(new ByteStringBuilder().append(name).toArray()) .base32Encode(Alphabet.Base32Alphabet.STANDARD, false).drainToString(); name = normalized + "-" + base32; } final int levels = this.levels; Path path = root; int idx = 0; for (int level = 0; level < levels; level ++) { int newIdx = name.offsetByCodePoints(idx, 1); path = path.resolve(name.substring(idx, newIdx)); idx = newIdx; if (idx == name.length()) { break; } } return path.resolve(name + ".xml"); }

Target:
private Path pathFor(String name) { assert name.codePointCount(0, name.length()) > 0; String normalizedName = name; if (encoded) { normalizedName = Normalizer.normalize(name, Normalizer.Form.NFKC) .toLowerCase(Locale.ROOT) .replaceAll("[^a-z0-9]", "_"); } Path path = root; int idx = 0; for (int level = 0; level < levels; level ++) { int newIdx = normalizedName.offsetByCodePoints(idx, 1); path = path.resolve(normalizedName.substring(idx, newIdx)); idx = newIdx; if (idx == normalizedName.length()) { break; } } if (encoded) { String base32 = ByteIterator.ofBytes(new ByteStringBuilder().append(name).toArray()) .base32Encode(Alphabet.Base32Alphabet.STANDARD, false).drainToString(); name = normalizedName + "-" + base32; } return path.resolve(name + ".xml"); }
Source:
protected boolean needsRemoteGet(InvocationContext ctx, AbstractDataCommand command) { if (!command.hasFlag(Flag.DELTA_WRITE) && (command.hasFlag(Flag.CACHE_MODE_LOCAL) || command.hasFlag(Flag.SKIP_REMOTE_LOOKUP) || command.hasFlag(Flag.IGNORE_RETURN_VALUES))) { return false; } boolean shouldFetchFromRemote = false; CacheEntry entry = ctx.lookupEntry(command.getKey()); if (entry == null || entry.isNull() || entry.isLockPlaceholder() || command.hasFlag(Flag.DELTA_WRITE)) { Object key = command.getKey(); ConsistentHash ch = stateTransferManager.getCacheTopology().getReadConsistentHash(); shouldFetchFromRemote = (ctx.isOriginLocal() && !ch.isKeyLocalToNode(rpcManager.getAddress(), key) || command.hasFlag(Flag.DELTA_WRITE)) && !dataContainer.containsKey(key); if (!shouldFetchFromRemote && getLog().isTraceEnabled()) { getLog().tracef("Not doing a remote get for key %s since entry is mapped to current node (%s) or is in L1. Owners are %s", key, rpcManager.getAddress(), ch.locateOwners(key)); } } return shouldFetchFromRemote; }

Target:
protected boolean needsRemoteGet(InvocationContext ctx, AbstractDataCommand command) { if(command.hasFlag(Flag.CACHE_MODE_LOCAL) || (command.hasFlag(Flag.SKIP_REMOTE_LOOKUP) && !command.hasFlag(Flag.DELTA_WRITE) || command.hasFlag(Flag.IGNORE_RETURN_VALUES))) { return false; } boolean shouldFetchFromRemote = false; CacheEntry entry = ctx.lookupEntry(command.getKey()); if (entry == null || entry.isNull() || entry.isLockPlaceholder()){ Object key = command.getKey(); ConsistentHash ch = stateTransferManager.getCacheTopology().getReadConsistentHash(); shouldFetchFromRemote = (ctx.isOriginLocal() || command.hasFlag(Flag.DELTA_WRITE)) && !ch.isKeyLocalToNode(rpcManager.getAddress(), key) && !dataContainer.containsKey(key); if (!shouldFetchFromRemote && getLog().isTraceEnabled()) { getLog().tracef("Not doing a remote get for key %s since entry is mapped to current node (%s) or is in L1. Owners are %s", key, rpcManager.getAddress(), ch.locateOwners(key)); } } return shouldFetchFromRemote; }
Source:
public <T> T get() { if (FMLEnvironment.dist == Dist.CLIENT) { return (T)this.clientSide.apply(client); } else if (FMLEnvironment.dist == Dist.DEDICATED_SERVER) { return (T)this.serverSide.apply(server); } else if (FMLEnvironment.dist == null) { return (T)this.testSide.get(); } else { throw new IllegalArgumentException("THREE SIDES? WUT?"); } }

Target:
public <T> T get() { if (FMLEnvironment.dist == Dist.CLIENT) { return (T)this.clientSide.apply(client); } else if (FMLEnvironment.dist == Dist.DEDICATED_SERVER) { return (T)this.serverSide.apply(server); } else { return (T)this.testSide.get(); } }
Source:
private List<Component> distinctComponents(String flowName, Set<Component> components) { logger.info(String.format("Filtering distinct components for flow[%s]. Before:[%s].", flowName, components.size())); List<Component> filtered = components.stream().filter( distinctByKey(component -> component.getName())).collect(Collectors.toList()); logger.info(String.format("After: [%s]", filtered.size())); return filtered; }

Target:
private List<Component> distinctComponents(String flowName, Set<Component> components) { logger.info("Filtering distinct components for flow[{}]. Before:[{}].", flowName, components.size()); List<Component> filtered = components.stream().filter( distinctByKey(component -> component.getName())).collect(Collectors.toList()); logger.info("After: [{}]", filtered.size()); return filtered; }
Source:
public Map<ChannelOption<?>, Object> getOptions() { return getOptions(super.getOptions(), EpollChannelOption.DOMAIN_SOCKET_READ_MODE, ChannelOption.ALLOW_HALF_CLOSURE); }

Target:
public Map<ChannelOption<?>, Object> getOptions() { return getOptions(super.getOptions(), DOMAIN_SOCKET_READ_MODE, ALLOW_HALF_CLOSURE); }
Source:
private String cleanUpPath(String path) { return path.replaceAll(" }

Target:
String cleanUpPath(String path) { return PATH_DIRTY_SLASHES.matcher(path).replaceAll("/").trim(); }
Source:
public MovedHandler(final EMOperation completeOp) { this.completeOp = completeOp; }

Target:
MovedHandler(final EMOperation completeOp) { this.completeOp = completeOp; }
Source:
public BigDecimal lastQuotaBalance(final Long accountId, final Long domainId, Date startDate) { List<QuotaBalanceVO> quotaBalance = lastQuotaBalanceVO(accountId, domainId, startDate); if (quotaBalance.size() == 0) { new InvalidParameterValueException("There are no balance entries on or before the requested date."); } BigDecimal finalBalance = new BigDecimal(0); for (QuotaBalanceVO entry : quotaBalance) { s_logger.debug("lastQuotaBalance Date=" + entry.getUpdatedOn().toGMTString() + " balance=" + entry.getCreditBalance() + " credit=" + entry.getCreditsId()); finalBalance = finalBalance.add(entry.getCreditBalance()); } return finalBalance; }

Target:
public BigDecimal lastQuotaBalance(final Long accountId, final Long domainId, Date startDate) { List<QuotaBalanceVO> quotaBalance = lastQuotaBalanceVO(accountId, domainId, startDate); BigDecimal finalBalance = new BigDecimal(0); if (quotaBalance.isEmpty()) { s_logger.info("There are no balance entries on or before the requested date."); return finalBalance; } for (QuotaBalanceVO entry : quotaBalance) { if (s_logger.isDebugEnabled()) { s_logger.debug("lastQuotaBalance Entry=" + entry); } finalBalance = finalBalance.add(entry.getCreditBalance()); } return finalBalance; }
Source:
public void recognizeCustomFormLabeledDataWithJpgContentType(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); customFormJpgDataRunner(data -> beginTrainingLabeledRunner((trainingFilesUrl, useTrainingLabels) -> { SyncPoller<OperationResult, CustomFormModel> trainingPoller = getFormTrainingAsyncClient(httpClient, serviceVersion).beginTraining(trainingFilesUrl, useTrainingLabels).getSyncPoller(); trainingPoller.waitForCompletion(); SyncPoller<OperationResult, List<RecognizedForm>> syncPoller = client.beginRecognizeCustomForms(toFluxByteBuffer(data), trainingPoller.getFinalResult().getModelId(), FORM_1_JPG_FILE_LENGTH, FormContentType.IMAGE_JPEG, false, null).getSyncPoller(); syncPoller.waitForCompletion(); validateRecognizedResult(syncPoller.getFinalResult(), false, true); })); }

Target:
public void recognizeCustomFormLabeledDataWithJpgContentType(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); customFormJpgDataRunner((data, dataLength) -> beginTrainingLabeledRunner((trainingFilesUrl, useTrainingLabels) -> { SyncPoller<OperationResult, CustomFormModel> trainingPoller = getFormTrainingAsyncClient(httpClient, serviceVersion).beginTraining(trainingFilesUrl, useTrainingLabels, null, durationTestMode).getSyncPoller(); trainingPoller.waitForCompletion(); SyncPoller<OperationResult, List<RecognizedForm>> syncPoller = client.beginRecognizeCustomForms( new RecognizeCustomFormsOptions(toFluxByteBuffer(data), dataLength, trainingPoller.getFinalResult().getModelId()).setFormContentType(FormContentType.IMAGE_JPEG) .setPollInterval(durationTestMode)).getSyncPoller(); syncPoller.waitForCompletion(); validateRecognizedResult(syncPoller.getFinalResult(), false, true); })); }
Source:
public static void setUpBeforeClass() throws Exception { project = ResourcesPlugin.getWorkspace().getRoot().getProject("test"); project.create(new NullProgressMonitor()); project.open(new NullProgressMonitor()); file = project.getFile("foo.txt"); file.create(new ByteArrayInputStream("bar".getBytes()), true, new NullProgressMonitor()); }

Target:
public static void setUpBeforeClass() throws Exception { GenericEditorTestUtils.setUpBeforeClass(); }
Source:
public void completeImportScope_Imports(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { PrefixMatcher newMatcher = new PrefixMatcher() { @Override public boolean isCandidateMatchingPrefix(String name, String prefix) { String strippedName = name; if (name.startsWith("^") && !prefix.startsWith("^")) { strippedName = name.substring(1); } return context.getMatcher().isCandidateMatchingPrefix(strippedName, prefix); } }; ContentAssistContext myContext = context.copy().setMatcher(newMatcher).toContext(); StringProposalDelegate stringProposalDelegate = new StringProposalDelegate(acceptor, myContext); Set<PackageImport> allImports = mapper.getAllImports(model.eResource()); for (PackageImport pkgImport : allImports) { ICompletionProposal doCreateProposal = createCompletionProposal("\"" + pkgImport.getName() + "\"", computePackageStyledString(pkgImport), getIncludeImage(pkgImport), myContext); stringProposalDelegate.accept(doCreateProposal); } }

Target:
public void completeImportScope_Imports(EObject model, Assignment assignment, ContentAssistContext context, ICompletionProposalAcceptor acceptor) { StringProposalDelegate stringProposalDelegate = new StringProposalDelegate(acceptor, context); Set<PackageImport> allImports = mapper.getAllImports(model.eResource()); for (PackageImport pkgImport : allImports) { ICompletionProposal doCreateProposal = createCompletionProposal( "\"" + pkgImport.getName() + "\"", computePackageStyledString(pkgImport), getIncludeImage(pkgImport), pkgImport.getUri().isFile() ? 1 : -1, context.getPrefix(), context); stringProposalDelegate.accept(doCreateProposal); } }
Source:
public FilestoreModel.Status uploadBlob(String oid, long size, UserModel user, RepositoryModel repo, InputStream streamIn) { Status state = addObject(oid, size, user, repo); if (state != Status.Upload_Pending) { return state; } FilestoreModel model = fileCache.get(oid); if (!model.actionUpload(user)) { return Status.Upload_In_Progress; } else { long actualSize = 0; File file = getStoragePath(oid); try { file.getParentFile().mkdirs(); file.createNewFile(); FileOutputStream streamOut = new FileOutputStream(file); actualSize = IOUtils.copyLarge(streamIn, streamOut); streamOut.flush(); streamOut.close(); if (model.getSize() != actualSize) { model.setStatus(Status.Error_Size_Mismatch, user); logger.warn(MessageFormat.format("Failed to upload blob {0} due to size mismatch, expected {1} got {2}", oid, model.getSize(), actualSize)); } else { FileInputStream fileForHash = new FileInputStream(file); String actualOid = DigestUtils.sha256Hex(fileForHash); fileForHash.close(); if (oid.equalsIgnoreCase(actualOid)) { model.setStatus(Status.Available, user); } else { model.setStatus(Status.Error_Hash_Mismatch, user); logger.warn(MessageFormat.format("Failed to upload blob {0} due to hash mismatch, got {1}", oid, actualOid)); } } } catch (Exception e) { model.setStatus(Status.Error_Unknown, user); logger.warn(MessageFormat.format("Failed to upload blob {0}", oid), e); } finally { saveFilestoreModel(model); } if (model.isInErrorState()) { file.delete(); model.removeRepository(repo.name); } } return model.getStatus(); }

Target:
public FilestoreModel.Status uploadBlob(String oid, long size, UserModel user, RepositoryModel repo, InputStream streamIn) { Status state = addObject(oid, size, user, repo); if (state != Status.Upload_Pending) { return state; } FilestoreModel model = fileCache.get(oid); if (!model.actionUpload(user)) { return Status.Upload_In_Progress; } else { long actualSize = 0; File file = getStoragePath(oid); try { file.getParentFile().mkdirs(); file.createNewFile(); try (FileOutputStream streamOut = new FileOutputStream(file)) { actualSize = IOUtils.copyLarge(streamIn, streamOut); streamOut.flush(); streamOut.close(); if (model.getSize() != actualSize) { model.setStatus(Status.Error_Size_Mismatch, user); logger.warn(MessageFormat.format("Failed to upload blob {0} due to size mismatch, expected {1} got {2}", oid, model.getSize(), actualSize)); } else { String actualOid = ""; try (FileInputStream fileForHash = new FileInputStream(file)) { actualOid = DigestUtils.sha256Hex(fileForHash); fileForHash.close(); } if (oid.equalsIgnoreCase(actualOid)) { model.setStatus(Status.Available, user); } else { model.setStatus(Status.Error_Hash_Mismatch, user); logger.warn(MessageFormat.format("Failed to upload blob {0} due to hash mismatch, got {1}", oid, actualOid)); } } } } catch (Exception e) { model.setStatus(Status.Error_Unknown, user); logger.warn(MessageFormat.format("Failed to upload blob {0}", oid), e); } finally { saveFilestoreModel(model); } if (model.isInErrorState()) { file.delete(); model.removeRepository(repo.name); } } return model.getStatus(); }
Source:
private void handleNoExecutorSelectedCase(ExecutionReference reference, ExecutableFlow exflow) throws ExecutorManagerException { reference.setNumErrors(reference.getNumErrors() + 1); if (reference.getNumErrors() >= MAX_DISPATCHING_ERRORS_PERMITTED) { finalizeFlows(exflow); } else { queuedFlows.enqueue(exflow, reference); } }

Target:
private void handleNoExecutorSelectedCase(ExecutionReference reference, ExecutableFlow exflow) throws ExecutorManagerException { logger .info(String .format( "Reached handleNoExecutorSelectedCase stage for exec %d with error count %d", exflow.getExecutionId(), reference.getNumErrors())); reference.setNumErrors(reference.getNumErrors() + 1); if (reference.getNumErrors() >= MAX_DISPATCHING_ERRORS_PERMITTED) { finalizeFlows(exflow); } else { queuedFlows.enqueue(exflow, reference); } }
Source:
private TimestampData convertToTimestampWithLocalZone(JsonNode jsonNode){ TemporalAccessor parsedTimestampWithLocalZone; switch (timestampFormat){ case SQL: parsedTimestampWithLocalZone = SQL_TIMESTAMP_WITH_LOCAL_TIMEZONE_FORMAT.parse(jsonNode.asText()); break; case ISO_8601: parsedTimestampWithLocalZone = ISO8601_TIMESTAMP_WITH_LOCAL_TIMEZONE_FORMAT.parse(jsonNode.asText()); break; default: throw new TableException(String.format("Unsupported timestamp format '%s'. Validator should have checked that.", timestampFormat)); } LocalTime localTime = parsedTimestampWithLocalZone.query(TemporalQueries.localTime()); LocalDate localDate = parsedTimestampWithLocalZone.query(TemporalQueries.localDate()); return TimestampData.fromInstant(LocalDateTime.of(localDate, localTime).atOffset(ZoneOffset.UTC).toInstant()); }

Target:
private TimestampData convertToTimestampWithLocalZone(JsonNode jsonNode){ TemporalAccessor parsedTimestampWithLocalZone; switch (timestampFormat){ case SQL: parsedTimestampWithLocalZone = SQL_TIMESTAMP_WITH_LOCAL_TIMEZONE_FORMAT.parse(jsonNode.asText()); break; case ISO_8601: parsedTimestampWithLocalZone = ISO8601_TIMESTAMP_WITH_LOCAL_TIMEZONE_FORMAT.parse(jsonNode.asText()); break; default: throw new TableException(String.format("Unsupported timestamp format '%s'. Validator should have checked that.", timestampFormat)); } LocalTime localTime = parsedTimestampWithLocalZone.query(TemporalQueries.localTime()); LocalDate localDate = parsedTimestampWithLocalZone.query(TemporalQueries.localDate()); return TimestampData.fromInstant(LocalDateTime.of(localDate, localTime).toInstant(ZoneOffset.UTC)); }
Source:
public JsonRpcRequest(@Assisted("id") String id, @Assisted("method") String method, @Assisted("params") JsonRpcParams params, JsonParser jsonParser) { this.jsonParser = jsonParser; checkNotNull(method, "Method name must not be null"); checkArgument(!method.isEmpty(), "Method name must not be empty"); this.id = id; this.method = method; this.params = params; }

Target:
public JsonRpcRequest(@Assisted("id") String id, @Assisted("method") String method, @Assisted("params") JsonRpcParams params, JsonParser jsonParser) { checkNotNull(method, "Method name must not be null"); checkArgument(!method.isEmpty(), "Method name must not be empty"); this.id = id; this.method = method; this.params = params; }