auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public synchronized void seek(long pos) throws IOException { if (!initialized) { blockPosition = pos; return; } checkOpen(); if (pos < 0 || pos >= length) { if (pos == 0) { return; } throw new EOFException( "EOF encountered at pos: " + pos + " for block: " + blockID); } Preconditions.assertTrue(chunkIndex >= 0); if (chunkIndex >= chunkStreams.size()) { chunkIndex = Arrays.binarySearch(chunkOffsets, pos); } else if (pos < chunkOffsets[chunkIndex]) { chunkIndex = Arrays.binarySearch(chunkOffsets, 0, chunkIndex, pos); } else if (pos >= chunkOffsets[chunkIndex] + chunkStreams .get(chunkIndex).getLength()) { chunkIndex = Arrays.binarySearch(chunkOffsets, chunkIndex + 1, chunkStreams.size(), pos); } if (chunkIndex < 0) { chunkIndex = -chunkIndex - 2; } chunkStreams.get(chunkIndexOfPrevPosition).resetPosition(); chunkStreams.get(chunkIndex).seek(pos - chunkOffsets[chunkIndex]); chunkIndexOfPrevPosition = chunkIndex; }

Target:
public synchronized void seek(long pos) throws IOException { if (!initialized) { blockPosition = pos; return; } checkOpen(); if (pos < 0 || pos >= length) { if (pos == 0) { return; } throw new EOFException( "EOF encountered at pos: " + pos + " for block: " + blockID); } if (chunkIndex >= chunkStreams.size()) { chunkIndex = Arrays.binarySearch(chunkOffsets, pos); } else if (pos < chunkOffsets[chunkIndex]) { chunkIndex = Arrays.binarySearch(chunkOffsets, 0, chunkIndex, pos); } else if (pos >= chunkOffsets[chunkIndex] + chunkStreams .get(chunkIndex).getLength()) { chunkIndex = Arrays.binarySearch(chunkOffsets, chunkIndex + 1, chunkStreams.size(), pos); } if (chunkIndex < 0) { chunkIndex = -chunkIndex - 2; } chunkStreams.get(chunkIndexOfPrevPosition).resetPosition(); chunkStreams.get(chunkIndex).seek(pos - chunkOffsets[chunkIndex]); chunkIndexOfPrevPosition = chunkIndex; }
Source:
void otherSuccess(T value) { if (compareAndSet(0, 1)) { actual.onNext(value); otherState = 2; } else { singleItem = value; otherState = 1; if (getAndIncrement() != 0) { return; } } drainLoop(); }

Target:
void otherSuccess(T value) { if (compareAndSet(0, 1)) { actual.onNext(value); otherState = OTHER_STATE_CONSUMED_OR_EMPTY; } else { singleItem = value; otherState = OTHER_STATE_HAS_VALUE; if (getAndIncrement() != 0) { return; } } drainLoop(); }
Source:
private FeedbackSessionAttributes getNewFeedbackSession() { return FeedbackSessionAttributes.builder("fsTest1", "testCourse", "valid@email.tmt") .withCreatedTime(Instant.now()) .withStartTime(Instant.now()) .withSessionVisibleFromTime(Instant.now()) .withResultsVisibleFromTime(Instant.now()) .withEndTime(Instant.now()) .withGracePeriodMinutes(5) .withSentOpenEmail(true) .withSentPublishedEmail(true) .withInstructions("Give feedback.") .build(); }

Target:
private FeedbackSessionAttributes getNewFeedbackSession() { return FeedbackSessionAttributes.builder("fsTest1", "testCourse", "valid@email.tmt") .withCreatedTime(TimeHelperExtension.getInstantHoursOffsetFromNow(-2)) .withSessionVisibleFromTime(TimeHelperExtension.getInstantMinutesOffsetFromNow(-62)) .withStartTime(TimeHelperExtension.getInstantHoursOffsetFromNow(-1)) .withEndTime(TimeHelperExtension.getInstantHoursOffsetFromNow(0)) .withResultsVisibleFromTime(TimeHelperExtension.getInstantMinutesOffsetFromNow(1)) .withGracePeriodMinutes(5) .withSentOpenEmail(true) .withSentPublishedEmail(true) .withInstructions("Give feedback.") .build(); }
Source:
public void setUp() throws Exception { final Props props = new Props(); final Injector injector = Guice.createInjector(new AbstractModule() { @Override protected void configure() { bind(CommonMetrics.class).in(Scopes.SINGLETON); } }); SERVICE_PROVIDER.unsetInjector(); SERVICE_PROVIDER.setInjector(injector); final File jobTypeDir = this.temp.newFolder(TEST_PLUGIN_DIR); this.testPluginDirPath = jobTypeDir.getCanonicalPath(); final URL resourceUrl = Resources.getResource("plugins/jobtypes"); assertNotNull(resourceUrl); FileUtils.copyDirectory(new File(resourceUrl.toURI()), jobTypeDir); this.manager = new JobTypeManager(this.testPluginDirPath, null, this.getClass().getClassLoader()); }

Target:
public void setUp() throws Exception { initServiceProvider(); final File jobTypeDir = this.temp.newFolder(TEST_PLUGIN_DIR); this.testPluginDirPath = jobTypeDir.getCanonicalPath(); final URL resourceUrl = Resources.getResource("plugins/jobtypes"); assertNotNull(resourceUrl); FileUtils.copyDirectory(new File(resourceUrl.toURI()), jobTypeDir); this.manager = new JobTypeManager(this.testPluginDirPath, null, this.getClass().getClassLoader()); }
Source:
public static CommonFilesAction getDefault(){ if(instance == null){ instance = new CommonFilesAction(); } return instance; }

Target:
public static synchronized CommonFilesAction getDefault() { if (instance == null) { instance = new CommonFilesAction(); } return instance; }
Source:
public void serviceStart() throws Exception { startJvmPauseMonitor(); tajoMasterInfo = new TajoMasterInfo(); if (systemConf.getBoolVar(TajoConf.ConfVars.TAJO_MASTER_HA_ENABLE)) { long retryWaitTime = systemConf.getLongVar(TajoConf.ConfVars.TAJO_MASTER_HA_CLIENT_RETRY_WAIT_TIME); int retryMaxNum = systemConf.getIntVar(ConfVars.TAJO_MASTER_HA_CLIENT_RETRY_MAX_NUM); int retryNum = 1; boolean done = false; while (!done && retryNum < retryMaxNum) { try { tajoMasterInfo.setTajoMasterAddress(serviceTracker.getUmbilicalAddress()); tajoMasterInfo.setWorkerResourceTrackerAddr(serviceTracker.getResourceTrackerAddress()); done = true; LOG.info("Find a new TajoMaster (" + tajoMasterInfo.getTajoMasterAddress() + ")"); } catch (ServiceTrackerException e) { LOG.warn("Retry TajoMaster address (" + retryNum + ")"); Thread.sleep(retryWaitTime); } retryNum++; if (retryNum == retryMaxNum) { LOG.error("ERROR: the maximum retry (" + retryNum + ") to read TajoMaster address"); break; } } } else { tajoMasterInfo.setTajoMasterAddress(NetUtils.createSocketAddr(systemConf.getVar(ConfVars .TAJO_MASTER_UMBILICAL_RPC_ADDRESS))); tajoMasterInfo.setWorkerResourceTrackerAddr(NetUtils.createSocketAddr(systemConf.getVar(ConfVars .RESOURCE_TRACKER_RPC_ADDRESS))); } connectToCatalog(); if (!systemConf.get(CommonTestingUtil.TAJO_TEST_KEY, "FALSE").equalsIgnoreCase("TRUE")) { initCleanupService(); } initWorkerMetrics(); super.serviceStart(); LOG.info("Tajo Worker is started"); }

Target:
public void serviceStart() throws Exception { startJvmPauseMonitor(); tajoMasterInfo = new TajoMasterInfo(); if (systemConf.getBoolVar(TajoConf.ConfVars.TAJO_MASTER_HA_ENABLE)) { tajoMasterInfo.setTajoMasterAddress(serviceTracker.getUmbilicalAddress()); tajoMasterInfo.setWorkerResourceTrackerAddr(serviceTracker.getResourceTrackerAddress()); } else { tajoMasterInfo.setTajoMasterAddress(NetUtils.createSocketAddr(systemConf.getVar(ConfVars .TAJO_MASTER_UMBILICAL_RPC_ADDRESS))); tajoMasterInfo.setWorkerResourceTrackerAddr(NetUtils.createSocketAddr(systemConf.getVar(ConfVars .RESOURCE_TRACKER_RPC_ADDRESS))); } connectToCatalog(); if (!systemConf.get(CommonTestingUtil.TAJO_TEST_KEY, "FALSE").equalsIgnoreCase("TRUE")) { initCleanupService(); } initWorkerMetrics(); super.serviceStart(); LOG.info("Tajo Worker is started"); }
Source:
private void displaySnapshotMetadata(SnapshotMetadata metadata) { TextView metaDataView = (TextView) findViewById(R.id.text_metadata); metaDataView.setText(""); if (metadata == null) { return; } String metadataStr = "Source: Saved Games" + '\n' + "Description: " + metadata.getDescription() + '\n' + "Name: " + metadata.getUniqueName() + '\n' + "Last Modified: " + String.valueOf(metadata.getLastModifiedTimestamp()) + '\n' + "Played Time: " + String.valueOf(metadata.getPlayedTime()) + '\n' + "Cover Image URL: " + metadata.getCoverImageUrl(); metaDataView.setText(metadataStr); }

Target:
private void displaySnapshotMetadata(SnapshotMetadata metadata) { TextView metaDataView = (TextView) findViewById(R.id.text_metadata); if (metadata == null) { metaDataView.setText(""); return; } String metadataStr = "Source: Saved Games" + '\n' + "Description: " + metadata.getDescription() + '\n' + "Name: " + metadata.getUniqueName() + '\n' + "Last Modified: " + String.valueOf(metadata.getLastModifiedTimestamp()) + '\n' + "Played Time: " + String.valueOf(metadata.getPlayedTime()) + '\n' + "Cover Image URL: " + metadata.getCoverImageUrl(); metaDataView.setText(metadataStr); }
Source:
public void capitalizeEnglish() { Locale.setDefault(Locale.ENGLISH); String international = Strings.capitalize("international"); assertEquals("International", international); }

Target:
public void capitalizeEnglish() { Locale.setDefault( Locale.ENGLISH ); String international = Strings.capitalize( "international" ); assertThat( international ).isEqualTo( "International" ); }
Source:
private int syncFromChangesNonMerging(Collection<Change> changes, boolean verifyResult) { Set<String> entityIds = newHashSetWithExpectedSize(changes.size()); List<Statement> insertStatements = new ArrayList<>(); ClassifiedStatements classifiedStatements = new ClassifiedStatements(uris); Set<String> valueSet = new HashSet<>(); Set<String> refSet = new HashSet<>(); UpdateQueryFactory updateQueryFactory = new UpdateQueryFactory(uris); int modified = 0; for (final Change change : changes) { if (change.getStatements() == null) { continue; } entityIds.add(change.entityId()); insertStatements.addAll(change.getStatements()); classifiedStatements.classify(change.getStatements(), change.entityId()); valueSet.addAll(change.getValueCleanupList()); refSet.addAll(change.getRefCleanupList()); if (insertStatements.size() > maxStatementsPerBatch || classifiedStatements.getDataSize() > maxPostDataSize) { log.info("Too much data with bytes - sending batch out, last ID {}", classifiedStatements.getDataSize(), change.entityId()); modified += sendUpdateBatch(updateQueryFactory, entityIds, insertStatements, classifiedStatements, refSet, valueSet, verifyResult); entityIds.clear(); insertStatements.clear(); classifiedStatements.clear(); valueSet.clear(); refSet.clear(); } } if (!entityIds.isEmpty()) { modified += sendUpdateBatch(updateQueryFactory, entityIds, insertStatements, classifiedStatements, refSet, valueSet, verifyResult); } return modified; }

Target:
private int syncFromChangesNonMerging(Collection<Change> changes, boolean verifyResult) { Set<String> entityIds = newHashSetWithExpectedSize(changes.size()); List<Statement> insertStatements = new ArrayList<>(); ClassifiedStatements classifiedStatements = new ClassifiedStatements(uris); Set<String> valueSet = new HashSet<>(); Set<String> refSet = new HashSet<>(); int modified = 0; for (final Change change : changes) { if (change.getStatements() == null) { continue; } entityIds.add(change.entityId()); insertStatements.addAll(change.getStatements()); classifiedStatements.classify(change.getStatements(), change.entityId()); valueSet.addAll(change.getValueCleanupList()); refSet.addAll(change.getRefCleanupList()); if (insertStatements.size() > maxStatementsPerBatch || classifiedStatements.getDataSize() > maxPostDataSize) { log.info("Too much data with bytes - sending batch out, last ID {}", classifiedStatements.getDataSize(), change.entityId()); modified += sendUpdateBatch(entityIds, insertStatements, classifiedStatements, refSet, valueSet, verifyResult); entityIds.clear(); insertStatements.clear(); classifiedStatements.clear(); valueSet.clear(); refSet.clear(); } } if (!entityIds.isEmpty()) { modified += sendUpdateBatch(entityIds, insertStatements, classifiedStatements, refSet, valueSet, verifyResult); } return modified; }
Source:
void exec() throws ReplicationException; } private void interruptOrAbortWhenFail(ReplicationQueueOperation op) { try { op.exec(); } catch (ReplicationException e) { if (e.getCause() != null && e.getCause() instanceof KeeperException.SystemErrorException && e.getCause().getCause() != null && e.getCause() .getCause() instanceof InterruptedException) { LOG.info("Thread is interrupted, the replication source may be terminated"); return; } server.abort("Failed to operate on replication queue", e); } }

Target:
void exec() throws ReplicationException; } private void interruptOrAbortWhenFail(ReplicationQueueOperation op) { try { op.exec(); } catch (ReplicationException e) { if (e.getCause() != null && e.getCause() instanceof KeeperException.SystemErrorException && e.getCause().getCause() != null && e.getCause() .getCause() instanceof InterruptedException) { throw new ReplicationRuntimeException( "Thread is interrupted, the replication source may be terminated", e.getCause().getCause()); } server.abort("Failed to operate on replication queue", e); } }
Source:
public void commitCommandToLayer(LayerCommand layerCommand, Command bitmapCommand) { synchronized (mLayerCommandList) { clearUndoCommandList(); enableUndo(true); ArrayList<LayerBitmapCommand> result = getLayerBitmapCommands(layerCommand.getLayer().getLayerID()); result.get(0).commitCommandToLayer(bitmapCommand); layerCommand.setLayersBitmapCommands(result); mLayerCommandList.addLast(createLayerCommand(CommandType.COMMIT_LAYER_BITMAP_COMMAND, layerCommand)); } drawingSurfaceRedraw(); }

Target:
public void commitCommandToLayer(LayerCommand layerCommand, Command bitmapCommand) { synchronized (mLayerOperationsCommandList) { clearUndoCommandList(); enableUndo(true); ArrayList<LayerBitmapCommand> result = getLayerBitmapCommands(layerCommand.getLayer().getLayerID()); result.get(0).commitCommandToLayer(bitmapCommand); layerCommand.setLayersBitmapCommands(result); mLayerOperationsCommandList.addLast(createLayerCommand(CommandType.COMMIT_LAYER_BITMAP_COMMAND, layerCommand)); } drawingSurfaceRedraw(); }
Source:
private boolean isKarafOk() { Class serviceClass = KarafHealthService.class; try { final KarafHealthService service = SERVICE_LOOKUP.lookup(serviceClass, null); return service != null; } catch (Exception e) { LOG.warn("Could not lookup {}, will fail.", serviceClass.getName(), e); return false; } }

Target:
private boolean isKarafOk() { Class serviceClass = KarafHealthService.class; try { LOG.info("Waiting for loading of {}, will block startup until service is available.", serviceClass.getName()); final KarafHealthService service = SERVICE_LOOKUP.lookup(serviceClass, null); return service != null; } catch (Exception e) { LOG.error("Could not lookup {}, will fail.", serviceClass.getName(), e); return false; } }
Source:
public Element render( final Node node, final String domID, final Tree.Joint joint, final int depth) { final Element rootContainer = super.render(node, domID, joint, depth); final Element nodeContainer = rootContainer.getFirstChildElement(); final Element checkBoxElement = new CheckBox().getElement(); final InputElement checkBoxInputElement = (InputElement) checkBoxElement.getElementsByTagName("input").getItem(0); final Path nodePath = node instanceof ChangedFileNode ? Path.valueOf(node.getName()) : ((ChangedFolderNode) node).getPath(); if (indeterminate.contains(nodePath)) { checkBoxInputElement.setId(checkBoxInputElement.getId() + "-indeterminate"); setIndeterminate(checkBoxInputElement); } else if (!unselected.contains(nodePath)) { checkBoxInputElement.setChecked(true); checkBoxInputElement.setId(checkBoxInputElement.getId() + "-checked"); } else { checkBoxInputElement.setId(checkBoxInputElement.getId() + "-unchecked"); } Event.sinkEvents(checkBoxElement, Event.ONCLICK); Event.setEventListener( checkBoxElement, event -> { if (Event.ONCLICK == event.getTypeInt() && event.getTarget().getTagName().equalsIgnoreCase("label")) { handleCheckBoxSelection(nodePath, checkBoxInputElement.isChecked()); delegate.refreshNodes(); } }); nodeContainer.insertAfter(checkBoxElement, nodeContainer.getFirstChild()); return rootContainer; }

Target:
public Element render( final Node node, final String domID, final Tree.Joint joint, final int depth) { final Element rootContainer = super.render(node, domID, joint, depth); final Element nodeContainer = rootContainer.getFirstChildElement(); final Element checkBoxElement = new CheckBox().getElement(); final InputElement checkBoxInputElement = (InputElement) checkBoxElement.getElementsByTagName("input").getItem(0); final Path nodePath = node instanceof ChangedFileNode ? Path.valueOf(node.getName()) : ((ChangedFolderNode) node).getPath(); setCheckBoxState(nodePath, checkBoxInputElement); setCheckBoxClickHandler(nodePath, checkBoxElement, checkBoxInputElement.isChecked()); nodeContainer.insertAfter(checkBoxElement, nodeContainer.getFirstChild()); return rootContainer; }
Source:
public boolean isEmpty() { synchronized (listeners) { return listeners.size() == 0; } }

Target:
public boolean isEmpty() { return listeners.isEmpty(); }
Source:
public Comparator<Integer> getComparator() { return Integer::compare; }

Target:
public Comparator<Integer> getComparator() { return Comparator.naturalOrder(); }
Source:
public void checkIPAdress() { Set<ConstraintViolation<IPAdress>> validate = validator.validate(new IPAdress(address)); assertEquals(validate.isEmpty(), expectedResult); }

Target:
public void checkIPAdress() { Set<ConstraintViolation<IPAdress>> validate = validator.validate(new IPAdress(address)); assertEquals(expectedResult, validate.isEmpty()); }
Source:
private boolean shouldCommit() { if (isChanged()) { if (trace) log.tracef("Updating entry (key=%s removed=%s changed=%s created=%s value=%s metadata=%s)", toStr(getKey()), isRemoved(), isChanged(), isCreated(), isCommitted(), toStr(value), getMetadata()); return true; } return false; }

Target:
private boolean shouldCommit() { if (isChanged()) { if (trace) log.tracef("Updating entry (key=%s removed=%s changed=%s created=%s committed=%s value=%s metadata=%s internalMetadata=%s)", toStr(getKey()), isRemoved(), isChanged(), isCreated(), isCommitted(), toStr(value), getMetadata(), internalMetadata); return true; } return false; }
Source:
RulesProfileDto getOrCreateCustom(DbSession dbSession, OrganizationDto organization, QProfileName name) { requireNonNull(organization); RulesProfileDto profile = db.qualityProfileDao().selectByNameAndLanguage(organization, name.getName(), name.getLanguage(), dbSession); if (profile == null) { profile = doCreate(dbSession, organization, name, false, false); } else { checkArgument(!profile.isBuiltIn(), "Operation forbidden for built-in Quality Profile '%s'", profile.getKey()); } return profile; }

Target:
RulesProfileDto getOrCreateCustom(DbSession dbSession, OrganizationDto organization, QProfileName name) { requireNonNull(organization); RulesProfileDto profile = db.qualityProfileDao().selectByNameAndLanguage(organization, name.getName(), name.getLanguage(), dbSession); if (profile == null) { profile = doCreate(dbSession, organization, name, false, false); } else { checkArgument(!profile.isBuiltIn(), "Operation forbidden for built-in Quality Profile '%s' with language '%s'", profile.getName(), profile.getLanguage()); } return profile; }
Source:
private void copyJarInJarLoader(File targetFile) throws IOException { try (InputStream is= JavaPlugin.getDefault().getBundle().getEntry(FatJarRsrcUrlBuilder.JAR_RSRC_LOADER_ZIP).openStream()) { OutputStream os= new FileOutputStream(targetFile); byte[] buf= new byte[1024]; while (true) { int cnt= is.read(buf); if (cnt <= 0) break; os.write(buf, 0, cnt); } os.close(); } }

Target:
private void copyJarInJarLoader(File targetFile) throws IOException { try (InputStream is= JavaPlugin.getDefault().getBundle().getEntry(FatJarRsrcUrlBuilder.JAR_RSRC_LOADER_ZIP).openStream(); OutputStream os= new FileOutputStream(targetFile);) { byte[] buf= new byte[1024]; while (true) { int cnt= is.read(buf); if (cnt <= 0) break; os.write(buf, 0, cnt); } } }
Source:
private void showMessage(String messageData, boolean remote) { ChatMessage message = ChatMessage.fromData(messageData); message.setRemote(remote); mMessageHistory.add(message); }

Target:
private void showMessage(String messageData, boolean remote) { ChatMessage message = ChatMessage.fromData(messageData, remote); mMessageHistory.add(message); }
Source:
public List<FileAsset> findFileAssetsByFolder( final Folder parentFolder, final User user, final boolean respectFrontendRoles) throws DotDataException, DotSecurityException { List<Contentlet> contentlets = null; try{ contentlets = contAPI.search( "+structureType:" + Structure.STRUCTURE_TYPE_FILEASSET + " +conFolder:" + parentFolder.getInode(), -1, 0, null, user, respectFrontendRoles); } catch (DotRuntimeException e) { if (e.getCause() instanceof ConnectException) { contentlets = this.fileAssetFactory.findFileAssetsByFolderInDB(parentFolder, user, respectFrontendRoles); } else { throw e; } } catch (DotSecurityException | DotDataException e) { throw e; } catch (Exception e) { Logger.error(this.getClass(), e.getMessage(), e); throw new DotRuntimeException(e.getMessage(), e); } return fromContentlets(perAPI.filterCollection(contentlets, PermissionAPI.PERMISSION_READ, respectFrontendRoles, user)); }

Target:
public List<FileAsset> findFileAssetsByFolder( final Folder parentFolder, final User user, final boolean respectFrontendRoles) throws DotDataException, DotSecurityException { List<Contentlet> contentlets = null; try{ contentlets = contAPI.search( "+structureType:" + Structure.STRUCTURE_TYPE_FILEASSET + " +conFolder:" + parentFolder.getInode(), -1, 0, null, user, respectFrontendRoles); } catch (DotRuntimeException e) { if ( ExceptionUtil.causedBy(e, ConnectException.class)) { Logger.warnEveryAndDebug(FileAssetAPIImpl.class, e.getMessage(), e, 5000); contentlets = getFileAssetsByFolderInDB(parentFolder, user, respectFrontendRoles); } else { throw e; } } catch (DotSecurityException | DotDataException e) { throw e; } catch (Exception e) { Logger.error(this.getClass(), e.getMessage(), e); throw new DotRuntimeException(e.getMessage(), e); } return fromContentlets(perAPI.filterCollection(contentlets, PermissionAPI.PERMISSION_READ, respectFrontendRoles, user)); }
Source:
public boolean validate(Collection<FormField> fields) { boolean isAllValid = true; for (FormField field : fields) { isAllValid = validate(field) && isAllValid; } return isAllValid; }

Target:
public boolean validate(Collection<FormField> fields) { boolean isValid = true; for (FormField field : fields) { isValid = validate(field) && isValid; } return isValid; }
Source:
public void addInvalidMimetype() throws Exception { String mockBody = "{\"message\":{\"data\":\"dGVzdA==\"," + "\"attributes\":{},\"messageId\":\"91010751788941\"" + ",\"publishTime\":\"2017-09-25T23:16:42.302Z\"}}"; mockMvc .perform(post("/").contentType(MediaType.TEXT_HTML).content(mockBody)) .andExpect(status().isUnsupportedMediaType()); }

Target:
public void addInvalidMimetype() throws Exception { mockMvc .perform(post("/").contentType(MediaType.TEXT_HTML).content(mockBody)) .andExpect(status().isUnsupportedMediaType()); }
Source:
private SyncProcess newSyncProcess(BiPredicate<Meta, Map<String, Object>> predicate) { checkNotNull(predicate, "predicate parameter must not be null"); return new SyncProcess(client, deviceUUID, sessionManager, predicate); }

Target:
private SyncProcess newSyncProcess(BiPredicate<Meta, Map<String, Object>> predicate) { checkNotNull(predicate, "predicate parameter must not be null"); return new SyncProcess(client, deviceUUID, sessionManager, predicate, timeToRunInMillis); }
Source:
public ExportConfiguration setPemFile(Path path) { if (Files.isRegularFile(path) && Files.isReadable(path)) { this.pemFile = Optional.ofNullable(path); } return this; }

Target:
public ExportConfiguration setPemFile(Path path) { this.pemFile = Optional.ofNullable(path) .filter(PrivateKeyUtils::isValidPrivateKey); return this; }
Source:
public String[] extractPartitions(Message message) { JSONObject jsonObject = (JSONObject) JSONValue.parse(message.getPayload()); String result[] = { defaultDate }; if (jsonObject != null) { Object fieldValue = getJsonFieldValue(jsonObject); if (fieldValue != null) { try { Date dateFormat = DatatypeConverter.parseDateTime(fieldValue.toString()).getTime(); SimpleDateFormat outputFormatter = new SimpleDateFormat(defaultFormatter); result[0] = "dt=" + outputFormatter.format(dateFormat); } catch (Exception e) { LOG.warn("Impossible to convert date = as ISO-8601. Using date default = {}", fieldValue.toString(), result[0]); } } } return result; }

Target:
public String[] extractPartitions(Message message) throws Exception { JSONObject jsonObject = (JSONObject) JSONValue.parse(message.getPayload()); String result[] = { defaultDate }; if (jsonObject != null) { Object fieldValue = getJsonFieldValue(jsonObject); if (fieldValue == null) { LOG.warn("Missing field value. Using default partition = {}", defaultDate); } else { try { Date dateFormat = DatatypeConverter.parseDateTime(fieldValue.toString()).getTime(); result[0] = "dt=" + outputFormatter.format(dateFormat); } catch (Exception e) { LOG.warn("Impossible to convert date = as ISO-8601. Using date default = {}", fieldValue.toString(), result[0]); } } } return result; }
Source:
public void refresh() { try { if (this.consumer == null) { SustainedConnectionWorker.this.totalConsumerConnections.incrementAndGet(); this.consumer = new KafkaConsumer<>(this.props, new ByteArrayDeserializer(), new ByteArrayDeserializer()); List<TopicPartition> partitions = this.consumer.partitionsFor(this.topicName).stream() .map(partitionInfo -> new TopicPartition(partitionInfo.topic(), partitionInfo.partition())) .collect(Collectors.toList()); this.activePartition = partitions.get(this.rand.nextInt(partitions.size())); this.consumer.assign(Collections.singletonList(this.activePartition)); } this.consumer.seekToEnd(Collections.emptyList()); this.consumer.poll(Duration.ofMillis(50)); } catch (Throwable e) { this.closeQuietly(); SustainedConnectionWorker.this.totalConsumerConnections.decrementAndGet(); SustainedConnectionWorker.this.totalConsumerFailedConnections.incrementAndGet(); SustainedConnectionWorker.log.error("Error while refreshing sustained KafkaConsumer connection", e.getMessage()); } this.nextUpdate = System.currentTimeMillis() + this.refreshRate; this.inUse = false; }

Target:
public void refresh() { try { if (this.consumer == null) { SustainedConnectionWorker.this.totalConsumerConnections.incrementAndGet(); this.consumer = new KafkaConsumer<>(this.props, new ByteArrayDeserializer(), new ByteArrayDeserializer()); List<TopicPartition> partitions = this.consumer.partitionsFor(this.topicName).stream() .map(partitionInfo -> new TopicPartition(partitionInfo.topic(), partitionInfo.partition())) .collect(Collectors.toList()); this.activePartition = partitions.get(this.rand.nextInt(partitions.size())); this.consumer.assign(Collections.singletonList(this.activePartition)); } this.consumer.seekToEnd(Collections.emptyList()); this.consumer.poll(Duration.ofMillis(50)); } catch (Throwable e) { this.closeQuietly(); SustainedConnectionWorker.this.totalConsumerConnections.decrementAndGet(); SustainedConnectionWorker.this.totalConsumerFailedConnections.incrementAndGet(); SustainedConnectionWorker.log.error("Error while refreshing sustained KafkaConsumer connection", e); } this.completeRefresh(); }
Source:
public void dialogOnAddButtonPressed(String time, String date, String reading, String type, String notes, long oldId) { if (validateDate(date) && validateTime(time) && validateGlucose(reading) && validateType(type)) { Date finalDateTime = getReadingTime(); Number number = parseReading(reading); if (number == null) { activity.showErrorMessage(); return; } boolean isReadingAdded; if ("mg/dL".equals(getUnitMeasuerement())) { int finalReading = number.intValue(); GlucoseReading gReading = new GlucoseReading(finalReading, type, finalDateTime, notes); isReadingAdded = dB.editGlucoseReading(oldId, gReading); } else { converter = new GlucosioConverter(); int convertedReading = converter.glucoseToMgDl(number.doubleValue()); GlucoseReading gReading = new GlucoseReading(convertedReading, type, finalDateTime, notes); isReadingAdded = dB.editGlucoseReading(oldId, gReading); } if (!isReadingAdded) { activity.showDuplicateErrorMessage(); } else { activity.finishActivity(); } } else { activity.showErrorMessage(); } }

Target:
public void dialogOnAddButtonPressed(String time, String date, String reading, String type, String notes, long oldId) { if (validateDate(date) && validateTime(time) && validateGlucose(reading) && validateType(type)) { Date finalDateTime = getReadingTime(); Number number = ReadingTools.parseReading(reading); if (number == null) { activity.showErrorMessage(); } else { boolean isReadingAdded = createReading(type, notes, oldId, finalDateTime, number); if (!isReadingAdded) { activity.showDuplicateErrorMessage(); } else { activity.finishActivity(); } } } else { activity.showErrorMessage(); } }
Source:
protected void displayLnpResults() throws IOException { LNPResultsStatistics reportAnalysis = getResultsStatistics(); reportAnalysis.setTestName(getClass().getSimpleName()); reportAnalysis.generateResultsStatistics(); reportAnalysis.displayLnpResultsStatistics(getErrorRateLimit(), getMeanRespTimeLimit()); }

Target:
protected void displayLnpResults() throws IOException { LNPResultsStatistics resultsStats = getResultsStatistics(); resultsStats.displayLnpResultsStatistics(); resultsStats.verifyLnpTestSuccess(getErrorRateLimit(), getMeanRespTimeLimit()); }
Source:
public void boardCreation_firstTimeUser_sampleBoardCreated(){ login("dummy", "dummy", "test", "test"); teardown(); assertEquals(testPref.getAllBoardNames().size(), 1); assertEquals(testPref.getAllBoardNames().get(0), SAMPLE_BOARD); verifyBoard(panelControl, BoardAutoCreator.getSamplePanelDetails()); }

Target:
public void boardCreation_firstTimeUser_sampleBoardCreated(){ login("dummy", "dummy", "test", "test"); TestUtils.awaitCondition(() -> BoardAutoCreator.getSamplePanelDetails().size() == countPanelsShown()); List<String> boardNames = panelControl.getAllBoardNames(); assertEquals(boardNames, Arrays.asList(new String[] {SAMPLE_BOARD})); verifyBoard(panelControl, BoardAutoCreator.getSamplePanelDetails()); }
Source:
public void run() { Object value = this.recordStore.get(this.dataKey, false, getCallerAddress()); this.result = (value instanceof com.hazelcast.map.Immutable) ? value : this.mapServiceContext.toData(value); }

Target:
public void run() { Object currentValue = recordStore.get(dataKey, false, getCallerAddress()); result = (currentValue instanceof Immutable) ? currentValue : mapServiceContext.toData(currentValue); }
Source:
public void testApply() { Vector[] data = new Vector[] { new DenseVector(new Serializable[] {"1", "Moscow", "A"}), new DenseVector(new Serializable[] {"2", "Moscow", "B"}), new DenseVector(new Serializable[] {"3", "Moscow", "B"}), }; Vectorizer<Integer, Vector, Integer, Double> vectorizer = new DummyVectorizer<>(0, 1, 2); TargetEncoderPreprocessor<Integer, Vector> preprocessor = new TargetEncoderPreprocessor<Integer, Vector>( new TargetEncodingMeta[]{ new TargetEncodingMeta( 0.5, new HashMap() { { put("1", 1.0); put("2", 0.0); } } ), new TargetEncodingMeta( 0.1, new HashMap() ), new TargetEncodingMeta( 0.1, new HashMap() { { put("A", 1.0); put("B", 2.0); } } ), }, vectorizer, new HashSet() { { add(0); add(1); add(2); } }); double[][] postProcessedData = new double[][] { {1.0, 0.1, 1.0}, {0.0, 0.1, 2.0}, {0.5, 0.1, 2.0}, }; for (int i = 0; i < data.length; i++) assertArrayEquals(postProcessedData[i], preprocessor.apply(i, data[i]).features().asArray(), 1e-8); }

Target:
public void testApply() { Vector[] data = new Vector[] { new DenseVector(new Serializable[] {"1", "Moscow", "A"}), new DenseVector(new Serializable[] {"2", "Moscow", "B"}), new DenseVector(new Serializable[] {"3", "Moscow", "B"}), }; Vectorizer<Integer, Vector, Integer, Double> vectorizer = new DummyVectorizer<>(0, 1, 2); TargetEncoderPreprocessor<Integer, Vector> preprocessor = new TargetEncoderPreprocessor<>( new TargetEncodingMeta[]{ new TargetEncodingMeta() .withGlobalMean(0.5) .withCategoryMean(new HashMap<String, Double>() { { put("1", 1.0); put("2", 0.0); } }), new TargetEncodingMeta() .withGlobalMean(0.1) .withCategoryMean(new HashMap<String, Double>() {}), new TargetEncodingMeta() .withGlobalMean(0.1) .withCategoryMean(new HashMap<String, Double>() { { put("A", 1.0); put("B", 2.0); } }) }, vectorizer, new HashSet<Integer>() { { add(0); add(1); add(2); } }); double[][] postProcessedData = new double[][] { { 1.0, 0.1, 1.0 }, { 0.0, 0.1, 2.0 }, { 0.5, 0.1, 2.0 }, }; for (int i = 0; i < data.length; i++) assertArrayEquals(postProcessedData[i], preprocessor.apply(i, data[i]).features().asArray(), 1e-8); }
Source:
ClientExport(final GoodDataEndpoint endpoint, final String projectUri, final String dashboardUri, final String tabId) { this(notNull(endpoint, "endpoint").toUri() + DASHBOARD_EXPORT_TEMPLATE .expand( notNull(projectUri, "projectUri"), notNull(dashboardUri, "dashboardUri"), notNull(tabId, "tabId") ).toString(), "foo"); }

Target:
ClientExport(final GoodDataEndpoint endpoint, final String projectUri, final String dashboardUri, final String tabId) { this(notNull(endpoint, "endpoint").toUri() + DASHBOARD_EXPORT_TEMPLATE .expand( notNull(projectUri, "projectUri"), notNull(dashboardUri, "dashboardUri"), notNull(tabId, "tabId") ).toString(), "export.pdf"); }
Source:
protected final void internalRenderJavaScriptReference(Response response, String url, String id, boolean defer, String charset, String condition, boolean async) { Args.notEmpty(url, "url"); boolean hasCondition = Strings.isEmpty(condition) == false; if (hasCondition) { response.write("<!--[if "); response.write(condition); response.write("]>"); } boolean isAjax = RequestCycle.get().find(IPartialPageRequestHandler.class).isPresent(); CharSequence escapedUrl = isAjax ? Strings.escapeMarkup(url): url; AttributeMap attributes = AttributeMap.of( HeaderItemAttribute.TYPE, "text/javascript", HeaderItemAttribute.SCRIPT_SRC, String.valueOf(escapedUrl) ); if (id != null) { attributes.add(HeaderItemAttribute.ID, id); } if (defer) { attributes.add(HeaderItemAttribute.SCRIPT_DEFER, "defer"); } if (charset != null) { attributes.add("charset", charset); } if (async) { attributes.add(HeaderItemAttribute.SCRIPT_ASYNC, "async"); } attributes.compute(HeaderItemAttribute.CSP_NONCE, this::getNonce); JavaScriptUtils.writeScript(response, attributes); if (hasCondition) { response.write("<![endif]-->\n"); } }

Target:
protected final void internalRenderJavaScriptReference(Response response, String url, String id, boolean defer, String charset, String condition, boolean async) { Args.notEmpty(url, "url"); boolean hasCondition = Strings.isEmpty(condition) == false; if (hasCondition) { response.write("<!--[if "); response.write(condition); response.write("]>"); } AttributeMap attributes = new AttributeMap(); attributes.put(JavaScriptUtils.ATTR_TYPE, "text/javascript"); attributes.putIfNotNull(JavaScriptUtils.ATTR_ID, id); if (defer) { attributes.put(JavaScriptUtils.ATTR_SCRIPT_DEFER, "defer"); } attributes.putIfNotNull("charset", charset); if (async) { attributes.put(JavaScriptUtils.ATTR_SCRIPT_ASYNC, "async"); } attributes.put(JavaScriptUtils.ATTR_SCRIPT_SRC, UrlEncoder.FULL_URL_INSTANCE.encode(url, "UTF-8")); attributes.putIfNotNull(JavaScriptUtils.ATTR_CSP_NONCE, getNonce()); JavaScriptUtils.writeScript(response, attributes); if (hasCondition) { response.write("<![endif]-->\n"); } }
Source:
private void startAuthMethodChoice() { FlowParameters flowParams = getFlowParams(); List<AuthUI.IdpConfig> idpConfigs = flowParams.providerInfo; if (idpConfigs.size() == 1) { String firstProvider = idpConfigs.get(0).getProviderId(); switch (firstProvider) { case EmailAuthProvider.PROVIDER_ID: startActivityForResult( RegisterEmailActivity.createIntent(getContext(), flowParams), RC_EMAIL_FLOW); break; case PhoneAuthProvider.PROVIDER_ID: String phone = idpConfigs .get(0) .getParams() .getString(AuthUI.PHONE_VERIFICATION_DEFAULT_PHONE_EXTRA); startActivityForResult( PhoneVerificationActivity.createIntent(getContext(), flowParams, phone), RC_PHONE_FLOW); break; default: redirectToIdpSignIn(null, providerIdToAccountType(firstProvider)); break; } } else { startActivityForResult( AuthMethodPickerActivity.createIntent( getContext(), flowParams), RC_AUTH_METHOD_PICKER); } getDialogHolder().dismissDialog(); }

Target:
private void startAuthMethodChoice() { FlowParameters flowParams = getFlowParams(); List<AuthUI.IdpConfig> idpConfigs = flowParams.providerInfo; if (idpConfigs.size() == 1) { AuthUI.IdpConfig firstIdpConfig = idpConfigs.get(0); String firstProvider = firstIdpConfig.getProviderId(); switch (firstProvider) { case EmailAuthProvider.PROVIDER_ID: startActivityForResult( RegisterEmailActivity.createIntent(getContext(), flowParams), RC_EMAIL_FLOW); break; case PhoneAuthProvider.PROVIDER_ID: String phone = firstIdpConfig.getParams().getString(AuthUI.EXTRA_DEFAULT_PHONE); startActivityForResult( PhoneVerificationActivity.createIntent(getContext(), flowParams, phone), RC_PHONE_FLOW); break; default: redirectToIdpSignIn(null, providerIdToAccountType(firstProvider)); break; } } else { startActivityForResult( AuthMethodPickerActivity.createIntent( getContext(), flowParams), RC_AUTH_METHOD_PICKER); } getDialogHolder().dismissDialog(); }
Source:
public FastaReferenceWriter startSequence(final String sequenceName, final String description, final int basesPerLine) throws IOException { assertIsNotClosed(); checkSequenceName(sequenceName); final String nonNullDescription = checkDescription(description); checkBasesPerLine(basesPerLine); closeSequence(); if (sequenceNamesAndSizes.containsKey(sequenceName)) { throw new IllegalStateException("the input sequence name '" + sequenceName + "' has already been added"); } currentSequenceName = sequenceName; currentBasesPerLine = basesPerLine; final StringBuilder builder = new StringBuilder(sequenceName.length() + nonNullDescription.length() + 10); builder.append(HEADER_START_CHAR).append(sequenceName); if (!nonNullDescription.isEmpty()) { builder.append(HEADER_NAME_AND_DESCRIPTION_SEPARATOR).append(nonNullDescription); } fastaStream.write(builder.toString().getBytes(CHARSET)); fastaStream.write(LINE_SEPARATOR); currentSequenceOffset = fastaStream.getBytesWritten(); return this; }

Target:
public FastaReferenceWriter startSequence(final String sequenceName, final String description, final int basesPerLine) throws IOException { assertIsNotClosed(); checkSequenceName(sequenceName); final String nonNullDescription = checkDescription(description); FastaReferenceWriterBuilder.checkBasesPerLine(basesPerLine); closeSequence(); if (sequenceNames.contains(sequenceName)) { throw new IllegalStateException("the input sequence name '" + sequenceName + "' has already been added"); } currentSequenceName = sequenceName; currentBasesPerLine = basesPerLine; final StringBuilder builder = new StringBuilder(sequenceName.length() + nonNullDescription.length() + 2); builder.append(HEADER_START_CHAR).append(sequenceName); if (!nonNullDescription.isEmpty()) { builder.append(HEADER_NAME_AND_DESCRIPTION_SEPARATOR).append(nonNullDescription); } fastaStream.write(builder.toString().getBytes(CHARSET)); fastaStream.write(LINE_SEPARATOR); currentSequenceOffset = fastaStream.getBytesWritten(); return this; }
Source:
private EList<Diff> getInverseReferences(Match match) { final Collection<EStructuralFeature.Setting> leftInverseReference = safGetNonNavigableInverseReferences( match.getLeft(), diffCrossReferencer); final Collection<EStructuralFeature.Setting> rightInverseReference = safGetNonNavigableInverseReferences( match.getRight(), diffCrossReferencer); final Collection<EStructuralFeature.Setting> originInverseReference = safGetNonNavigableInverseReferences( match.getOrigin(), diffCrossReferencer); List<ResourceAttachmentChange> resourceAttachmentChanges = newArrayList(filter( match.getDifferences(), ResourceAttachmentChange.class)); EList<Diff> result = new BasicEList<Diff>(leftInverseReference.size() + rightInverseReference.size() + originInverseReference.size() + resourceAttachmentChanges.size()); addSettingEObjectsTo(result, leftInverseReference); addSettingEObjectsTo(result, rightInverseReference); addSettingEObjectsTo(result, originInverseReference); addAll(result, resourceAttachmentChanges.iterator()); return result; }

Target:
private EList<Diff> getInverseReferences(Match match) { final Collection<EStructuralFeature.Setting> leftInverseReference = safGetNonNavigableInverseReferences( match.getLeft(), diffCrossReferencer); final Collection<EStructuralFeature.Setting> rightInverseReference = safGetNonNavigableInverseReferences( match.getRight(), diffCrossReferencer); final Collection<EStructuralFeature.Setting> originInverseReference = safGetNonNavigableInverseReferences( match.getOrigin(), diffCrossReferencer); List<ResourceAttachmentChange> resourceAttachmentChanges = newArrayList(filter( match.getDifferences(), ResourceAttachmentChange.class)); final int maxExpectedSize = leftInverseReference.size() + rightInverseReference.size() + originInverseReference.size() + resourceAttachmentChanges.size(); EList<Diff> result = new UniqueEList.FastCompare<Diff>(maxExpectedSize); addSettingEObjectsTo(result, leftInverseReference); addSettingEObjectsTo(result, rightInverseReference); addSettingEObjectsTo(result, originInverseReference); addAll(result, resourceAttachmentChanges.iterator()); return result; }
Source:
public void send(ReqT request) throws IOException { if (mClosed || mCanceled || mClosedFromRemote) { LOG.debug("Failed to send request {}: stream is already closed or canceled. ({})", LogUtils.truncateMessageLines(request), mDescription); return; } try (LockResource lr = new LockResource(mLock)) { checkError(); } mRequestObserver.onNext(request); }

Target:
public void send(ReqT request) throws IOException { if (mClosed || mCanceled || mClosedFromRemote) { if (LOG.isDebugEnabled()) { LOG.debug("Failed to send request {}: stream is already closed or cancelled. ({})", LogUtils.truncateMessageLineLength(request), mDescription); } return; } try (LockResource lr = new LockResource(mLock)) { checkError(); } mRequestObserver.onNext(request); }
Source:
public void testQueueCleanWhenConnectionSynExeConnectAndDisconnect() throws Exception { Random random = new Random(); Set<MQTTClientProvider> clientProviders = new HashSet<>(11); int repeatCount = 0; String address = "clean/test"; String clientId = "sameClientId"; String queueName = "::sameClientId.clean.test"; while (repeatCount < 100) { repeatCount++; int subConnectionCount = random.nextInt(50) + 1; int sC = 0; try { while (sC < subConnectionCount) { sC++; MQTTClientProvider clientProvider = getMQTTClientProvider(); clientProvider.setClientId(clientId); initializeConnection(clientProvider); clientProviders.add(clientProvider); clientProvider.subscribe(address, AT_LEAST_ONCE); } } finally { for (MQTTClientProvider clientProvider : clientProviders) { clientProvider.disconnect(); } clientProviders.clear(); assertTrue(waitForBindings(server, queueName, false, 0, 0, 10000)); } } }

Target:
public void testQueueCleanWhenConnectionSynExeConnectAndDisconnect() throws Exception { Random random = new Random(); Set<MQTTClientProvider> clientProviders = new HashSet<>(11); int repeatCount = 0; String address = "clean/test"; String clientId = "sameClientId"; String queueName = "::sameClientId.clean.test"; while (repeatCount < 100) { repeatCount++; int subConnectionCount = random.nextInt(50) + 1; int sC = 0; try { while (sC < subConnectionCount) { sC++; MQTTClientProvider clientProvider = getMQTTClientProvider(); clientProvider.setClientId(clientId); initializeConnection(clientProvider); clientProviders.add(clientProvider); clientProvider.subscribe(address, AT_LEAST_ONCE); } } catch (Throwable e) { LOG.error(e.getMessage(), e); } finally { for (MQTTClientProvider clientProvider : clientProviders) { clientProvider.disconnect(); } clientProviders.clear(); assertTrue(Wait.waitFor(() -> server.locateQueue(SimpleString.toSimpleString(queueName)) == null, 5000, 10)); } } }
Source:
private void handleAudioFocusGain() { if (isAudioPlaying()) { setUpAudioVolume(); } this.audioFocus = AudioFocus.GAIN; }

Target:
private void handleAudioFocusGain() { if (isAudioPlaying()) { setUpAudioVolume(); } else { if (audioFocus == AudioFocus.LOSS) { playAudio(); } } this.audioFocus = AudioFocus.GAIN; }
Source:
private MetadataPointer parsePointer(XmlPullParser parser) throws XmlPullParserException, IOException { int pointerDepth = parser.getDepth(); String namespace = null; HashMap<String, Object> fields = null; while (true) { XmlPullParser.Event eventType2 = parser.next(); if (eventType2 == XmlPullParser.Event.START_ELEMENT) { if (parser.getName().equals("x")) { namespace = parser.getNamespace(); } else { if (fields == null) { fields = new HashMap<>(); } String name = parser.getName(); Object value = parser.nextText(); fields.put(name, value); } } else if (eventType2 == XmlPullParser.Event.END_ELEMENT) { if (parser.getDepth() == pointerDepth) { break; } } } return new MetadataPointer(namespace, fields); }

Target:
private static MetadataPointer parsePointer(XmlPullParser parser) throws XmlPullParserException, IOException { int pointerDepth = parser.getDepth(); String namespace = null; HashMap<String, Object> fields = null; outperloop: while (true) { XmlPullParser.TagEvent tag = parser.nextTag(); switch (tag) { case START_ELEMENT: if (parser.getName().equals("x")) { namespace = parser.getNamespace(); } else { if (fields == null) { fields = new HashMap<>(); } String name = parser.getName(); Object value = parser.nextText(); fields.put(name, value); } break; case END_ELEMENT: if (parser.getDepth() == pointerDepth) { break outperloop; } } } return new MetadataPointer(namespace, fields); }
Source:
private String getThreeWayOverlay(final Diff diff) { final Conflict conflict = diff.getConflict(); final DifferenceKind diffKind = diff.getKind(); final DifferenceSource source = diff.getSource(); ConflictKind conflictKind = null; if (hasDirectOrIndirectConflict(REAL).apply(diff)) { conflictKind = REAL; } else if (canBeConsideredAsPseudoConflicting().apply(diff)) { conflictKind = PSEUDO; } String path = ""; if (conflict != null || conflictKind != null) { if ((conflict != null && conflict.getKind() == PSEUDO) || conflictKind == PSEUDO) { path += "p"; } path += "conf"; if (source == DifferenceSource.RIGHT) { path += "r_"; } } else { switch (source) { case LEFT: path += "r_out"; break; case RIGHT: path += "r_in"; break; default: break; } } switch (diffKind) { case ADD: path += ADD_OV; break; case DELETE: path += DEL_OV; break; case CHANGE: case MOVE: path += CHG_OV; break; default: break; } return path; }

Target:
private String getThreeWayOverlay(final Diff diff) { final DifferenceKind diffKind = diff.getKind(); final DifferenceSource source = diff.getSource(); String path = ""; if (hasDirectOrIndirectConflict(REAL).apply(diff)) { path += "conf"; if (source == DifferenceSource.RIGHT) { path += "r_"; } } else if (canBeConsideredAsPseudoConflicting().apply(diff)) { path += "pconf"; if (source == DifferenceSource.RIGHT) { path += "r_"; } } else { switch (source) { case LEFT: path += "r_out"; break; case RIGHT: path += "r_in"; break; default: break; } } switch (diffKind) { case ADD: path += ADD_OV; break; case DELETE: path += DEL_OV; break; case CHANGE: case MOVE: path += CHG_OV; break; default: break; } return path; }
Source:
private void forwardEvent(Event event) throws InvocationTargetException { if (EDBEvent.class.isAssignableFrom(event.getClass())) { LOGGER.info("Forwarding event to edb service"); try { edbService.processEvent(event); } catch (EDBException e) { throw new InvocationTargetException(e); } } else { LOGGER.info("Forwarding event to workflow service"); try { workflowService.processEvent(event); } catch (WorkflowException e) { throw new InvocationTargetException(e); } } }

Target:
private void forwardEvent(Event event) throws InvocationTargetException { if (EDBEvent.class.isAssignableFrom(event.getClass())) { LOGGER.info("Forwarding event to edb service"); try { if (event instanceof EDBInsertEvent) { edbService.processEDBInsertEvent((EDBInsertEvent) event); } else if (event instanceof EDBDeleteEvent) { edbService.processEDBDeleteEvent((EDBDeleteEvent) event); } else if (event instanceof EDBUpdateEvent) { edbService.processEDBUpdateEvent((EDBUpdateEvent) event); } else if (event instanceof EDBBatchEvent) { edbService.processEDBBatchEvent((EDBBatchEvent) event); } } catch (EDBException e) { throw new InvocationTargetException(e); } } else { LOGGER.info("Forwarding event to workflow service"); try { workflowService.processEvent(event); } catch (WorkflowException e) { throw new InvocationTargetException(e); } } }