auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static void visitParameterList( @NotNull ProblemsHolder holder, @Nullable GoParameters parameters, String ownerType, String what) { if (parameters == null || parameters.getParameterDeclarationList().isEmpty()) return; ProgressManager.checkCanceled(); boolean hasNamed = false; boolean hasUnnamed = false; for (GoParameterDeclaration parameterDeclaration : parameters.getParameterDeclarationList()) { if (parameterDeclaration.getParamDefinitionList().isEmpty()) { hasUnnamed = true; } else { hasNamed = true; } } if (hasNamed && hasUnnamed) { holder.registerProblem( parameters, ownerType + " has both named and unnamed " + what + " <code>#ref</code> #loc", ProblemHighlightType.GENERIC_ERROR_OR_WARNING); } }

Target:
private static void visitParameterList( @NotNull ProblemsHolder holder, @Nullable GoParameters parameters, String ownerType, String what) { if (parameters == null || parameters.getParameterDeclarationList().isEmpty()) return; ProgressManager.checkCanceled(); boolean hasNamed = false; boolean hasUnnamed = false; for (GoParameterDeclaration parameterDeclaration : parameters.getParameterDeclarationList()) { if (parameterDeclaration.getParamDefinitionList().isEmpty()) { hasUnnamed = true; } else { hasNamed = true; } if (hasNamed && hasUnnamed) { holder.registerProblem( parameters, ownerType + " has both named and unnamed " + what + " <code>#ref</code> #loc", ProblemHighlightType.GENERIC_ERROR_OR_WARNING); return; } } }
Source:
private Map<String,String> getMapFromRawClientInfo( String clientInfo) { Map<String,String> clientInfoMap = new LinkedHashMap<>(); List<String> myList = new ArrayList<String>(Arrays.asList(clientInfo.split(" "))); for (String entry : myList) { String[] kvArray = entry.split("="); clientInfoMap.put(kvArray[0], (kvArray.length ==2)?kvArray[1]:"" ); } return clientInfoMap; }

Target:
private Map<String,String> getMapFromRawClientInfo( String clientInfo) { String[] entries = clientInfo.split(" "); Map<String,String> clientInfoMap = new LinkedHashMap<>(entries.length); for (String entry : entries) { String[] kvArray = entry.split("="); clientInfoMap.put(kvArray[0], (kvArray.length ==2)?kvArray[1]:"" ); } return clientInfoMap; }
Source:
public ModelNode execute(Operation operation) throws IOException { return execute(operation.getOperation()); }

Target:
public ModelNode execute(Operation operation) throws IOException { if (!operation.getInputStreams().isEmpty()) { throw new IllegalStateException("Operation has one or more attachments which is not allowed."); } return execute(operation.getOperation()); }
Source:
public String toString() { String roles = ""; if (!this.isEmpty()) { for (String role: this.keySet()) { roles += role.toLowerCase() + this.get(role) + ","; } } return getClass().getSimpleName() + "[" + roles + "]"; }

Target:
public String toString() { String roles = ""; if (!this.isEmpty()) { for (String role: this.keySet()) { roles += role + this.get(role) + ","; } } return getClass().getSimpleName() + "[" + roles + "]"; }
Source:
public synchronized boolean isUITestRunning() { if (isUITestRunning == null) { boolean istest; try { Class.forName("org.openobservatory.ooniprobe.AutomateScreenshotsTest"); istest = true; } catch (ClassNotFoundException e) { istest = false; } isUITestRunning = new AtomicBoolean (istest); } return isUITestRunning.get(); }

Target:
public boolean isUITestRunning() { try { Class.forName("org.openobservatory.ooniprobe.AutomateScreenshotsTest"); return true; } catch (ClassNotFoundException e) { return false; } }
Source:
private void removeTemplateBackup() { AsyncDataProvider.getInstance().getDataCentersByStorageDomain(new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { TemplateBackupModel templateBackupModel = (TemplateBackupModel) model; ArrayList<StoragePool> pools = (ArrayList<StoragePool>) returnValue; if (pools != null && pools.size() > 0) { StoragePool pool = pools.get(0); ArrayList<VdcActionParametersBase> prms = new ArrayList<VdcActionParametersBase>(); for (Object a : templateBackupModel.getSelectedItems()) { VmTemplate template = (VmTemplate) a; prms.add(new VmTemplateImportExportParameters(template.getId(), getEntity().getId(), pool.getId())); } Frontend.getInstance().runMultipleAction(VdcActionType.RemoveVmTemplateFromImportExport, prms); cancel(); } } }), getEntity().getId()); }

Target:
private void removeTemplateBackup() { ArrayList<VdcActionParametersBase> prms = new ArrayList<VdcActionParametersBase>(); for (Object a : getSelectedItems()) { VmTemplate template = (VmTemplate) a; prms.add(new VmTemplateImportExportParameters(template.getId(), getEntity().getId(), pool.getId())); } Frontend.getInstance().runMultipleAction(VdcActionType.RemoveVmTemplateFromImportExport, prms); cancel(); }
Source:
public ToStringHelper string() { return super.string() .add("app", app) .add("script", script) .add("location", locations) .add("port", port) .add("noConsole", noConsole) .add("noShutdwonOnExit", noShutdownOnExit) .add("stopOnKeyPress", stopOnKeyPress); }

Target:
public ToStringHelper string() { return super.string() .add("app", app) .add("script", script) .add("location", locations) .add("port", port) .add("noConsole", noConsole) .add("noShutdownOnExit", noShutdownOnExit) .add("stopOnKeyPress", stopOnKeyPress); }
Source:
default <R> Try<R> collect(PartialFunction<? super T, ? extends R> partialFunction){ Objects.requireNonNull(partialFunction, "partialFunction is null"); final Try<T> valueInDomain = filter(partialFunction::isDefinedAt); if (valueInDomain.isFailure()) { return (Failure<R>) valueInDomain; } else { try { return new Success<>(partialFunction.apply(valueInDomain.get())); } catch (Throwable t) { return new Failure<>(t); } } }

Target:
default <R> Try<R> collect(PartialFunction<? super T, ? extends R> partialFunction){ Objects.requireNonNull(partialFunction, "partialFunction is null"); return filter(partialFunction::isDefinedAt).map(partialFunction::apply); }
Source:
public boolean reschedule(String cronExpression) { try { Trigger trigger = newTrigger() .withSchedule( cronSchedule(cronExpression) ) .build(); scheduler.rescheduleJob(triggerKey, trigger); this.triggerKey = trigger.getKey(); this.cancelled = false; this.cronExpression = cronExpression; this.terminated = false; return true; } catch (SchedulerException e) { logger.warn("An error occured while rescheduling the job '{}': {}", new String[] { jobKey.toString(), e.getMessage() }); return false; } }

Target:
public boolean reschedule(String cronExpression) { try { Trigger oldTrigger = scheduler.getTrigger(triggerKey); TriggerBuilder tb = oldTrigger.getTriggerBuilder(); trigger = tb .withDescription("cron " + cronExpression) .withSchedule( cronSchedule(cronExpression) ) .build(); return update(trigger); } catch (Exception e) { logger.warn("An error occured while creating a new timer for rescheduling the job '{}': {}", new String[] { jobKey.toString(), e.getMessage() }); return false; } }
Source:
public final void close() throws SQLException { if (delegate != ClosedConnection.CLOSED_CONNECTION) { leakTask.cancel(); closeOpenStatements(); try { if (isCommitStateDirty) { lastAccess = clockSource.currentTime(); if (!poolEntry.isAutoCommit) { delegate.rollback(); LOGGER.debug("{} - Executed rollback on connection due to dirty commit state on close().", poolEntry.parentPool, delegate); } } if (isConnectionStateDirty) { poolEntry.resetConnectionState(); lastAccess = clockSource.currentTime(); } delegate.clearWarnings(); } catch (SQLException e) { if (!poolEntry.aborted) { throw checkException(e); } } finally { delegate = ClosedConnection.CLOSED_CONNECTION; poolEntry.releaseConnection(lastAccess); } } }

Target:
public final void close() throws SQLException { if (delegate != ClosedConnection.CLOSED_CONNECTION) { leakTask.cancel(); try { closeOpenStatements(); if (isCommitStateDirty) { lastAccess = clockSource.currentTime(); if (!poolEntry.isAutoCommit) { delegate.rollback(); LOGGER.debug("{} - Executed rollback on connection due to dirty commit state on close().", poolEntry.parentPool, delegate); } } if (isConnectionStateDirty) { poolEntry.resetConnectionState(); lastAccess = clockSource.currentTime(); } delegate.clearWarnings(); } catch (SQLException e) { if (!poolEntry.aborted) { throw checkException(e); } } finally { delegate = ClosedConnection.CLOSED_CONNECTION; poolEntry.releaseConnection(lastAccess); } } }
Source:
public boolean isCompatibleWith(LuceneIndexSchemaFieldNode<?> other) { return converter.isDslCompatibleWith( other.converter ) && Objects.equals( codec, other.codec ) && predicateBuilderFactory.isDslCompatibleWith( other.predicateBuilderFactory ) && Objects.equals( sortContributor, other.sortContributor ) && Objects.equals( projectionBuilderFactory, other.projectionBuilderFactory ); }

Target:
public boolean isCompatibleWith(LuceneIndexSchemaFieldNode<?> other) { return converter.isDslCompatibleWith( other.converter ) && Objects.equals( codec, other.codec ) && predicateBuilderFactory.isDslCompatibleWith( other.predicateBuilderFactory ) && Objects.equals( sortContributor, other.sortContributor ) && projectionBuilderFactory.isDslCompatibleWith( other.projectionBuilderFactory ); }
Source:
public void createDatabase(final String name) { Preconditions.checkArgument(!name.contains("-"), "Databasename cant contain -"); String createDatabaseQueryString = String.format("CREATE DATABASE IF NOT EXISTS \"%s\"", name); DefaultArtifactVersion versionCurrent = new DefaultArtifactVersion(this.version()); DefaultArtifactVersion version1 = new DefaultArtifactVersion("1.0.0"); if (versionCurrent.compareTo(version1) >= 0 ) { createDatabaseQueryString = String.format("CREATE DATABASE \"%s\"", name); } this.influxDBService.query(this.username, this.password, createDatabaseQueryString); }

Target:
public void createDatabase(final String name) { Preconditions.checkArgument(!name.contains("-"), "Databasename cant contain -"); String createDatabaseQueryString = String.format("CREATE DATABASE \"%s\"", name); if ( this.version().startsWith("0.") ) { createDatabaseQueryString = String.format("CREATE DATABASE IF NOT EXISTS \"%s\"", name); } this.influxDBService.query(this.username, this.password, createDatabaseQueryString); }
Source:
public long waitFor1(long sequence, Sequence cursorSequence, Sequence dependentSequence, com.lmax.disruptor.SequenceBarrier barrier) throws AlertException, InterruptedException, SuspendExecution { long availableSequence; if ((availableSequence = cursorSequence.get()) < sequence) { Object token = processorNotifyCondition.register(); try { for (int i = 0; (availableSequence = cursorSequence.get()) < sequence; i++) { barrier.checkAlert(); processorNotifyCondition.await(i, 1, TimeUnit.NANOSECONDS); } } finally { processorNotifyCondition.unregister(token); } } while ((availableSequence = dependentSequence.get()) < sequence) { barrier.checkAlert(); } return availableSequence; }

Target:
public long waitFor1(long sequence, Sequence cursorSequence, Sequence dependentSequence, com.lmax.disruptor.SequenceBarrier barrier) throws AlertException, InterruptedException, SuspendExecution { long availableSequence; if ((availableSequence = cursorSequence.get()) < sequence) { Object token = processorNotifyCondition.register(); try { for (int i = 0; (availableSequence = cursorSequence.get()) < sequence; i++) { barrier.checkAlert(); processorNotifyCondition.await(i); } } finally { processorNotifyCondition.unregister(token); } } while ((availableSequence = dependentSequence.get()) < sequence) { barrier.checkAlert(); } return availableSequence; }
Source:
public Void visitAnnotation(final AnnotationTree node, final Void p) { AnnotationMirror anno = TreeUtils.annotationFromAnnotationTree(node); if (atypeFactory.isPredicate(anno)) { String errorMessage = atypeFactory.isValidPredicate(anno); if (errorMessage != null) { checker.report( node, new DiagMessage(Diagnostic.Kind.ERROR, "predicate.invalid", errorMessage)); return null; } } return super.visitAnnotation(node, p); }

Target:
public Void visitAnnotation(final AnnotationTree node, final Void p) { AnnotationMirror anno = TreeUtils.annotationFromAnnotationTree(node); if (atypeFactory.isPredicate(anno)) { String errorMessage = atypeFactory.isValidPredicate(anno); if (errorMessage != null) { checker.reportError(node, "predicate.invalid", errorMessage); } } return super.visitAnnotation(node, p); }
Source:
public ManageDomainsResult(ManageDomainsResultEnum enumResult, String... params) { this("Default error.", enumResult, params); }

Target:
public ManageDomainsResult(ManageDomainsResultEnum enumResult, String... params) { this("", enumResult, params); }
Source:
public SignInPage clickForgotPasswordLink() { forgottenPasswordLink.click(); return this; }

Target:
public SignInPage clickForgotPasswordLink() { wait.forElementClickable(forgottenPasswordLink); forgottenPasswordLink.click(); return this; }
Source:
private void assertOneMessage(String fileName, String expectedMessage) throws Exception { File sourceFile = new File(baseDir, fileName); LocalizedMessages messages = processFile(sourceFile, check); assertThat(messages, is(not(nullValue()))); assertThat(messages.getMessages().isEmpty(), is(false)); assertThat(messages.getMessages().size(), is(1)); assertThat(messages.getMessages().first().getMessage(), is(expectedMessage)); }

Target:
private void assertOneMessage(String fileName, String expectedMessage) throws Exception { File sourceFile = new File(baseDir, fileName); LocalizedMessages messages = processFile(sourceFile, check); assertThat(messages.getMessages().isEmpty(), is(false)); assertThat(messages.getMessages().size(), is(1)); assertThat(messages.getMessages().first().getMessage(), is(expectedMessage)); }
Source:
public void configure(Binder binder) { if (!slackConfiguration.isPresent()) { LOG.info("Slack is not configured, not binding slack related resources or slack build notification visitors"); return; } binder.bind(SlackSession.class).toInstance(makeNewSlackSession()); binder.bind(SlackMessageBuildingUtils.class); repositoryBuildVisitorMultibinder.addBinding().to(SlackDmNotificationVisitor.class); repositoryBuildVisitorMultibinder.addBinding().to(SlackRoomNotificationVisitor.class); binder.bind(UserFeedbackResource.class); binder.bind(SlackClientWrapper.class); binder.bind(SlackResource.class); if (slackConfiguration.get().getFeedbackRoom().isPresent()) { binder.bindConstant().annotatedWith(Names.named(SLACK_FEEDBACK_ROOM)).to(slackConfiguration.get().getFeedbackRoom().get()); binder.bind(UserFeedbackResource.class); } else { LOG.info("Not configuring feedback endpoint -- no room configured"); } }

Target:
public void configure(Binder binder) { if (!slackConfiguration.isPresent()) { LOG.info("Slack is not configured, not binding slack related resources or slack build notification visitors"); return; } Multibinder<RepositoryBuildVisitor> repositoryBuildVisitorMultibinder = Multibinder.newSetBinder(binder, RepositoryBuildVisitor.class); repositoryBuildVisitorMultibinder.addBinding().to(SlackDmNotificationVisitor.class); repositoryBuildVisitorMultibinder.addBinding().to(SlackRoomNotificationVisitor.class); binder.bind(SlackSession.class).toInstance(SlackSessionFactory.createWebSocketSlackSession(slackConfiguration.get().getSlackApiToken())); binder.bind(SlackResource.class); binder.bind(UserFeedbackResource.class); }
Source:
public void readFields(DataInput input) throws IOException { byte[] tableNameBytes = Bytes.readByteArray(input); PName tableName = new PNameImpl(tableNameBytes); PTableType tableType = PTableType.values()[WritableUtils.readVInt(input)]; long sequenceNumber = WritableUtils.readVLong(input); long timeStamp = input.readLong(); byte[] pkNameBytes = Bytes.readByteArray(input); String pkName = pkNameBytes.length == 0 ? null : Bytes.toString(pkNameBytes); Integer bucketNum = WritableUtils.readVInt(input); int nColumns = WritableUtils.readVInt(input); List<PColumn> columns = Lists.newArrayListWithExpectedSize(nColumns); for (int i = 0; i < nColumns; i++) { PColumn column = new PColumnImpl(); column.readFields(input); columns.add(column); } Map<String, byte[][]> guidePosts = new HashMap<String, byte[][]>(); int size = WritableUtils.readVInt(input); for (int i=0; i<size; i++) { String key = WritableUtils.readString(input); int valueSize = WritableUtils.readVInt(input); byte[][] value = new byte[valueSize][]; for (int j=0; j<valueSize; j++) { value[j] = Bytes.readByteArray(input); } guidePosts.put(key, value); } PTableStats stats = new PTableStatsImpl(guidePosts); init(tableName, tableType, timeStamp, sequenceNumber, pkName, bucketNum == QueryConstants.NO_SALTING ? null : bucketNum, columns, stats); }

Target:
public void readFields(DataInput input) throws IOException { byte[] tableNameBytes = Bytes.readByteArray(input); PName tableName = new PNameImpl(tableNameBytes); PTableType tableType = PTableType.values()[WritableUtils.readVInt(input)]; long sequenceNumber = WritableUtils.readVLong(input); long timeStamp = input.readLong(); byte[] pkNameBytes = Bytes.readByteArray(input); String pkName = pkNameBytes.length == 0 ? null : Bytes.toString(pkNameBytes); Integer bucketNum = WritableUtils.readVInt(input); int nColumns = WritableUtils.readVInt(input); List<PColumn> columns = Lists.newArrayListWithExpectedSize(nColumns); for (int i = 0; i < nColumns; i++) { PColumn column = new PColumnImpl(); column.readFields(input); columns.add(column); } Map<String, byte[][]> guidePosts = new HashMap<String, byte[][]>(); int size = WritableUtils.readVInt(input); for (int i=0; i<size; i++) { String key = WritableUtils.readString(input); int valueSize = WritableUtils.readVInt(input); byte[][] value = new byte[valueSize][]; for (int j=0; j<valueSize; j++) { value[j] = Bytes.readByteArray(input); } guidePosts.put(key, value); } PTableStats stats = new PTableStatsImpl(guidePosts); init(tableName, tableType, timeStamp, sequenceNumber, pkName, bucketNum == NO_SALTING ? null : bucketNum, columns, stats); }
Source:
public static Charset getCharset(final MediaType mediaType) { if (mediaType != null) { String charset = mediaType.getParameters().get("charset"); if (charset != null) return Charset.forName(charset); } return Charset.forName("utf-8"); }

Target:
public static Charset getCharset(final MediaType mediaType) { if (DISABLE_CHARSET) { return Charset.forName("utf-8"); } if (mediaType != null) { String charset = mediaType.getParameters().get("charset"); if (charset != null) return Charset.forName(charset); } return Charset.defaultCharset(); }
Source:
public Authentication supply(@Nonnull HttpServletRequest request) { if (suppliers == null || suppliers.isEmpty()) { logger.debug("There was no any provided.", AuthenticationSupplier.class); return null; } AuthenticationException lastException = null; for (final AuthenticationSupplier supplier : suppliers) { final String supplierName = supplier.getClass() .getName(); if (!supplier.supports(request)) { logger.debug("Supplier does not support this request [method: {}] [URI: {}] [ContentType {}]", supplierName, request.getMethod(), request.getRequestURI(), request.getContentType()); continue; } logger.debug("Authentication supplier attempt using {}", supplierName); Authentication authentication; try { authentication = supplier.supply(request); } catch (AuthenticationException e) { lastException = e; continue; } if (authentication != null) { logger.debug("Authentication supplied by {}", supplierName); return authentication; } } if (lastException != null) { throw lastException; } return null; }

Target:
public Authentication supply(@Nonnull HttpServletRequest request) { if (suppliers == null || suppliers.isEmpty()) { logger.debug("There was no provided.", AuthenticationSupplier.class); return null; } AuthenticationException lastException = null; for (final AuthenticationSupplier supplier : suppliers) { final String supplierName = supplier.getClass() .getName(); if (!supplier.supports(request)) { logger.debug("Supplier does not support this request [method: {}] [URI: {}] [ContentType {}]", supplierName, request.getMethod(), request.getRequestURI(), request.getContentType()); continue; } logger.debug("Authentication supplier attempt using {}", supplierName); Authentication authentication; try { authentication = supplier.supply(request); } catch (AuthenticationException e) { lastException = e; continue; } if (authentication != null) { logger.debug("Authentication supplied by {}", supplierName); return authentication; } } if (lastException != null) { throw lastException; } return null; }
Source:
public void addTaskLatency(String daemonId, long value) { daemonTaskLatency.compute(daemonId, (k, v) -> { v = (v == null ? new DaemonLatencyMetric(daemonId, latencyMetricWindowSize) : v); v.addValue(value); return v; }); }

Target:
public void addTaskLatency(String daemonId, long value) { if (latencyMetricWindowSize > 0) { daemonTaskLatency.computeIfAbsent(daemonId, k -> new DaemonLatencyMetric(daemonId, latencyMetricWindowSize)).addValue(value); } }
Source:
protected void waitUntil(BooleanSupplier supplier, long timeout) { long start = System.currentTimeMillis(); while (true) { if (supplier.getAsBoolean()) { break; } try { Thread.sleep(10); } catch (InterruptedException ignore) { } long now = System.currentTimeMillis(); if (now - start > timeout) { throw new IllegalStateException("Timed out"); } } }

Target:
protected void waitUntil(BooleanSupplier supplier, long timeout) { long start = System.currentTimeMillis(); while (true) { if (supplier.getAsBoolean()) { break; } try { Thread.sleep(10); } catch (InterruptedException ignore) { Thread.currentThread().interrupt(); } long now = System.currentTimeMillis(); if (now - start > timeout) { throw new IllegalStateException("Timed out"); } } }
Source:
protected StorageDomain electNewMaster(boolean duringReconstruct, boolean selectInactiveWhenNoActiveUnknownDomains, boolean canChooseCurrentMasterAsNewMaster) { if (getStoragePool() == null) { log.warn("Cannot elect new master: storage pool not found"); return null; } List<StorageDomain> storageDomains = storageDomainDao.getAllForStoragePool(getStoragePool().getId()); if (storageDomains.isEmpty()) { log.warn("Cannot elect new master, no storage domains found for pool {}", getStoragePool().getName()); return null; } Collections.sort(storageDomains, Comparator.comparing(StorageDomain::getLastTimeUsedAsMaster) .thenComparing(Comparator.comparing(StorageDomain::isLocal))); StorageDomain newMaster = null; StorageDomain storageDomain = getStorageDomain(); for (StorageDomain dbStorageDomain : storageDomains) { if (dbStorageDomain.isHostedEngineStorage()) { continue; } if ((storageDomain == null || (duringReconstruct || !dbStorageDomain.getId() .equals(storageDomain.getId()))) && ((dbStorageDomain.getStorageDomainType() == StorageDomainType.Data) && (dbStorageDomain.isBackup() == false) || (canChooseCurrentMasterAsNewMaster && dbStorageDomain.getStorageDomainType() == StorageDomainType.Master))) { if (dbStorageDomain.getStatus() == StorageDomainStatus.Active || dbStorageDomain.getStatus() == StorageDomainStatus.Unknown) { newMaster = dbStorageDomain; break; } else if (selectInactiveWhenNoActiveUnknownDomains && newMaster == null && dbStorageDomain.getStatus() == StorageDomainStatus.Inactive) { newMaster = dbStorageDomain; } } } return newMaster; }

Target:
protected StorageDomain electNewMaster(boolean duringReconstruct, boolean selectInactiveWhenNoActiveUnknownDomains, boolean canChooseCurrentMasterAsNewMaster) { if (getStoragePool() == null) { log.warn("Cannot elect new master: storage pool not found"); return null; } List<StorageDomain> storageDomains = storageDomainDao.getAllForStoragePool(getStoragePool().getId()); if (storageDomains.isEmpty()) { log.warn("Cannot elect new master, no storage domains found for pool {}", getStoragePool().getName()); return null; } Collections.sort(storageDomains, Comparator.comparing(StorageDomain::getLastTimeUsedAsMaster) .thenComparing(Comparator.comparing(StorageDomain::isLocal))); StorageDomain newMaster = null; StorageDomain storageDomain = getStorageDomain(); for (StorageDomain dbStorageDomain : storageDomains) { if (dbStorageDomain.isHostedEngineStorage()) { continue; } if ((storageDomain == null || (duringReconstruct || !dbStorageDomain.getId() .equals(storageDomain.getId()))) && ((dbStorageDomain.getStorageDomainType() == StorageDomainType.Data) && (!dbStorageDomain.isBackup()) || (canChooseCurrentMasterAsNewMaster && dbStorageDomain.getStorageDomainType() == StorageDomainType.Master))) { if (dbStorageDomain.getStatus() == StorageDomainStatus.Active || dbStorageDomain.getStatus() == StorageDomainStatus.Unknown) { newMaster = dbStorageDomain; break; } else if (selectInactiveWhenNoActiveUnknownDomains && newMaster == null && dbStorageDomain.getStatus() == StorageDomainStatus.Inactive) { newMaster = dbStorageDomain; } } } return newMaster; }
Source:
private synchronized void loadFromDisk() { try { synchronized (goConfigWriteLock.mutex()) { GoConfigHolder configHolder = dataSource.load(); if (configHolder != null) { saveValidConfigToCacheAndNotifyConfigChangeListeners(configHolder); } } } catch (Exception e) { LOGGER.warn("Error loading cruise-config.xml from disk, keeping previous one", e); saveConfigError(e); } }

Target:
private void loadFromDisk() { try { synchronized (GoConfigWriteLock.class) { GoConfigHolder configHolder = dataSource.load(); if (configHolder != null) { saveValidConfigToCacheAndNotifyConfigChangeListeners(configHolder); } } } catch (Exception e) { LOGGER.warn("Error loading cruise-config.xml from disk, keeping previous one", e); saveConfigError(e); } }
Source:
protected void run() throws Exception { File configFile = getConfigFile(); ProgressMonitor monitor = new TextProgressMonitor(out); SubscriptionManager manager = new SubscriptionManager(monitor, out); try { while (true) { long changeTime = configFile.lastModified(); manager.sync(getConfig().getPublishers()); while (changeTime == configFile.lastModified()) Thread.sleep(5000); } } finally { manager.close(); } }

Target:
protected void run() throws Exception { File configFile = getConfigFile(); ProgressMonitor monitor = new TextProgressMonitor(out); SubscriptionManager manager = new SubscriptionManager(monitor, out); try { while (true) { FileSnapshot configFileSnapshot = FileSnapshot.save(configFile); manager.sync(getConfig().getPublishers()); while (!configFileSnapshot.isModified(configFile)) Thread.sleep(1000 * pollTime); } } finally { manager.close(); } }
Source:
private void removeAndUpdateAddressMap(final Address address) throws Exception { Bindings bindings = super.getBindingsForRoutingAddress(address.getAddress()); if (bindings == null || bindings.getBindings().isEmpty()) { synchronized (this) { List<Address> addresses = address.getLinkedAddresses(); for (Address address1 : addresses) { address1.removeLinkedAddress(address); Bindings linkedBindings = super.getBindingsForRoutingAddress(address1.getAddress()); if (linkedBindings == null || linkedBindings.getBindings().size() == 0) { removeAddress(address1); } } removeAddress(address); } } }

Target:
private void removeAndUpdateAddressMap(final Address address) throws Exception { Bindings bindings = super.getBindingsForRoutingAddress(address.getAddress()); if (bindings == null || bindings.getBindings().isEmpty()) { synchronized (this) { for (Address address1 : address.getLinkedAddresses()) { address1.removeLinkedAddress(address); Bindings linkedBindings = super.getBindingsForRoutingAddress(address1.getAddress()); if (linkedBindings == null || linkedBindings.getBindings().size() == 0) { removeAddress(address1); } } removeAddress(address); } } }
Source:
protected boolean canDoAction() { if (!super.canDoAction()) { return false; } if (getGlusterVolume().getVolumeType().isDispersedType()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_REMOVE_BRICK_FROM_DISPERSE_VOLUME_NOT_SUPPORTED); } if (getGlusterVolume().getVolumeType().isDistributedDispersedType()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_REMOVE_BRICK_FROM_DISTRIBUTED_DISPERSE_VOLUME_NOT_SUPPORTED); } GlusterBrickValidator brickValidator = new GlusterBrickValidator(); return validate(brickValidator.canRemoveBrick(getParameters().getBricks(), getGlusterVolume(), getParameters().getReplicaCount(), true)); }

Target:
protected boolean canDoAction() { if (!super.canDoAction()) { return false; } if (getGlusterVolume().getVolumeType().isDispersedType()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_REMOVE_BRICK_FROM_DISPERSE_VOLUME_NOT_SUPPORTED); } GlusterBrickValidator brickValidator = new GlusterBrickValidator(); return validate(brickValidator.canRemoveBrick(getParameters().getBricks(), getGlusterVolume(), getParameters().getReplicaCount(), true)); }
Source:
public static void scanFile() { String dir = "src/test/resources/org/sonar/plugins/python/squid-sensor"; File file = new File(dir, "/symbolVisitor.py"); DefaultInputFile inputFile = TestInputFileBuilder.create("moduleKey", file.getName()) .initMetadata(TestUtils.fileContent(file, StandardCharsets.UTF_8)) .build(); context = SensorContextTester.create(file); context.fileSystem().add(inputFile); componentKey = inputFile.key(); SymbolVisitor symbolVisitor = new SymbolVisitor(context.newSymbolTable().onFile(inputFile)); PythonVisitorContext context = TestPythonVisitorRunner.createContext(file); FileInput fileInput = context.rootTree(); fileInput.accept(symbolVisitor); }

Target:
public static void scanFile() { File file = new File("src/test/resources/org/sonar/plugins/python/squid-sensor", "/symbolVisitor.py"); DefaultInputFile inputFile = TestInputFileBuilder.create("moduleKey", file.getName()) .initMetadata(TestUtils.fileContent(file, StandardCharsets.UTF_8)) .build(); context = SensorContextTester.create(file); context.fileSystem().add(inputFile); componentKey = inputFile.key(); SymbolVisitor symbolVisitor = new SymbolVisitor(context.newSymbolTable().onFile(inputFile)); PythonVisitorContext context = TestPythonVisitorRunner.createContext(file); FileInput fileInput = context.rootTree(); fileInput.accept(symbolVisitor); }
Source:
private Set<ObjectId> listNonHEADIndexObjects() throws CorruptObjectException, IOException { RevWalk revWalk = null; try { if (repo.getIndexFile() == null) return Collections.emptySet(); } catch (NoWorkTreeException e) { return Collections.emptySet(); } TreeWalk treeWalk = new TreeWalk(repo); try { treeWalk.addTree(new DirCacheIterator(repo.readDirCache())); ObjectId headID = repo.resolve(Constants.HEAD); if (headID != null) { revWalk = new RevWalk(repo); treeWalk.addTree(revWalk.parseTree(headID)); revWalk.dispose(); } treeWalk.setFilter(TreeFilter.ANY_DIFF); treeWalk.setRecursive(true); Set<ObjectId> ret = new HashSet<ObjectId>(); while (treeWalk.next()) { ObjectId objectId = treeWalk.getObjectId(0); if (!ObjectId.zeroId().equals(objectId)) ret.add(objectId); } return ret; } finally { if (revWalk != null) revWalk.dispose(); treeWalk.release(); } }

Target:
private Set<ObjectId> listNonHEADIndexObjects() throws CorruptObjectException, IOException { RevWalk revWalk = null; try { if (repo.getIndexFile() == null) return Collections.emptySet(); } catch (NoWorkTreeException e) { return Collections.emptySet(); } TreeWalk treeWalk = new TreeWalk(repo); try { treeWalk.addTree(new DirCacheIterator(repo.readDirCache())); ObjectId headID = repo.resolve(Constants.HEAD); if (headID != null) { revWalk = new RevWalk(repo); treeWalk.addTree(revWalk.parseTree(headID)); revWalk.dispose(); revWalk = null; } treeWalk.setFilter(TreeFilter.ANY_DIFF); treeWalk.setRecursive(true); Set<ObjectId> ret = new HashSet<ObjectId>(); while (treeWalk.next()) { ObjectId objectId = treeWalk.getObjectId(0); switch (treeWalk.getRawMode(0) & FileMode.TYPE_MASK) { case FileMode.TYPE_MISSING: case FileMode.TYPE_GITLINK: continue; case FileMode.TYPE_TREE: case FileMode.TYPE_FILE: case FileMode.TYPE_SYMLINK: ret.add(objectId); continue; default: throw new IOException(MessageFormat.format( JGitText.get().corruptObjectInvalidMode3, String .format("%o", Integer.valueOf(treeWalk .getRawMode(0)), (objectId == null) ? "null" : objectId.name(), treeWalk .getPathString(), repo .getIndexFile()))); } } return ret; } finally { if (revWalk != null) revWalk.dispose(); treeWalk.release(); } }
Source:
public List<Metric> filter(Map<Metric, String> extendedSortedMap, String limit) { SystemAssert.requireArgument(extendedSortedMap != null && !extendedSortedMap.isEmpty(), "New map is not constructed successfully!"); SystemAssert.requireArgument(limit != null && !limit.equals(""), "Limit must be provided!"); List<Metric> result = new ArrayList<Metric>(); for (Map.Entry<Metric, String> entry : extendedSortedMap.entrySet()) { Number bound; try { bound = Long.parseLong(limit); } catch (NumberFormatException nfe) { try { bound = Double.parseDouble(limit); } catch (NumberFormatException nfe2) { throw new IllegalArgumentException("The limit " + limit + " is not a valid number."); } } Number val; try { val = Long.parseLong(entry.getValue()); } catch (NumberFormatException nfe) { try { val = Double.parseDouble(entry.getValue()); } catch (NumberFormatException nfe2) { throw new IllegalArgumentException("The data value " + entry.getValue() + " is not a valid number."); } } if (NumberOperations.isGreaterThan(val, bound)) { result.add(entry.getKey()); } } return result; }

Target:
public List<Metric> filter(Map<Metric, String> extendedSortedMap, String limit) { SystemAssert.requireArgument(extendedSortedMap != null && !extendedSortedMap.isEmpty(), "New map is not constructed successfully!"); SystemAssert.requireArgument(limit != null && !limit.equals(""), "Limit must be provided!"); List<Metric> result = new ArrayList<Metric>(); Number bound = NumberOperations.parseConstant(limit); for (Map.Entry<Metric, String> entry : extendedSortedMap.entrySet()) { Number val = NumberOperations.parseConstant(entry.getValue()); if (NumberOperations.isGreaterThan(val, bound)) { result.add(entry.getKey()); } } return result; }
Source:
public void detachNodeFailInActiveAtPrepare() throws Exception { final int activeId = findActive(1).getAsInt(); final int passiveId = findPassives(1)[0]; String propertySettingString = "stripe.1.node." + activeId + ".tc-properties.detachStatus=prepareDeletion-failure"; assertThat(configToolInvocation("set", "-s", "localhost:" + getNodePort(1, 1), "-c", propertySettingString), is(successful())); out.clearLog(1, passiveId); assertThat( configToolInvocation("detach", "-f", "-d", "localhost:" + getNodePort(1, activeId), "-s", "localhost:" + getNodePort(1, passiveId)), containsOutput("Two-Phase commit failed")); waitUntil(out.getLog(1, passiveId), containsLog("Restarting the server")); waitUntil(out.getLog(1, passiveId), containsLog("Moved to State[ PASSIVE-STANDBY ]")); }

Target:
public void detachNodeFailInActiveAtPrepare() throws Exception { final int activeId = findActive(1).getAsInt(); final int passiveId = findPassives(1)[0]; String propertySettingString = "stripe.1.node." + activeId + ".tc-properties.detachStatus=prepareDeletion-failure"; assertThat(configToolInvocation("set", "-s", "localhost:" + getNodePort(1, 1), "-c", propertySettingString), is(successful())); assertThat( configToolInvocation("detach", "-f", "-d", "localhost:" + getNodePort(1, activeId), "-s", "localhost:" + getNodePort(1, passiveId)), containsOutput("Two-Phase commit failed")); assertThat(getUpcomingCluster("localhost", getNodePort(1, activeId)).getNodeCount(), is(equalTo(2))); assertThat(getRuntimeCluster("localhost", getNodePort(1, activeId)).getNodeCount(), is(equalTo(2))); assertThat(getUpcomingCluster("localhost", getNodePort(1, passiveId)).getNodeCount(), is(equalTo(2))); assertThat(getRuntimeCluster("localhost", getNodePort(1, passiveId)).getNodeCount(), is(equalTo(2))); withTopologyService(1, activeId, topologyService -> assertTrue(topologyService.isActivated())); withTopologyService(1, passiveId, topologyService -> assertTrue(topologyService.isActivated())); }
Source:
public void testMsgNotifHeartbeat_requestModel() throws Exception { TestApplication app = new TestApplication(); app.setDirectory( this.folder.newFolder()); ManagedApplication ma = new ManagedApplication( app ); this.managerWrapper.getNameToManagedApplication().put( app.getName(), ma ); String targetId = this.manager.targetsMngr().createTarget( "id: tid1\nhandler: h" ); this.manager.targetsMngr().associateTargetWith( targetId, app, null ); File dir = new File( this.manager.configurationMngr().getWorkingDirectory(), ConfigurationUtils.TARGETS + "/" + targetId ); Utils.createDirectory( dir ); Utils.writeStringInto( "#!/bin/bash\necho Bonjour le monde cruel > toto.txt", new File( dir, Constants.TARGET_SCRIPT_FILE_NAME )); Assert.assertNotNull( this.manager.targetsMngr().findScriptResources(targetId) ); this.msgClient.allSentMessages.clear(); Assert.assertEquals( 0, this.msgClient.allSentMessages.size()); MsgNotifHeartbeat msg = new MsgNotifHeartbeat( app.getName(), app.getMySqlVm(), "192.168.1.45" ); msg.setModelRequired( true ); this.managerWrapper.getMessagingClient().getMessageProcessor().storeMessage( msg ); Thread.sleep( 100 ); Assert.assertEquals( 1, this.msgClient.allSentMessages.size()); Message sentMessage = this.msgClient.allSentMessages.get( 0 ); Assert.assertEquals( MsgCmdSetScopedInstance.class, sentMessage.getClass()); Assert.assertNotNull(((MsgCmdSetScopedInstance) sentMessage).getScopedInstance()); }

Target:
public void testMsgNotifHeartbeat_requestModel() throws Exception { TestApplication app = new TestApplication(); app.setDirectory( this.folder.newFolder()); ManagedApplication ma = new ManagedApplication( app ); this.managerWrapper.getNameToManagedApplication().put( app.getName(), ma ); this.msgClient.allSentMessages.clear(); Assert.assertEquals( 0, this.msgClient.allSentMessages.size()); MsgNotifHeartbeat msg = new MsgNotifHeartbeat( app.getName(), app.getMySqlVm(), "192.168.1.45" ); msg.setModelRequired( true ); this.managerWrapper.getMessagingClient().getMessageProcessor().storeMessage( msg ); Thread.sleep( 100 ); Assert.assertEquals( 1, this.msgClient.allSentMessages.size()); Message sentMessage = this.msgClient.allSentMessages.get( 0 ); Assert.assertEquals( MsgCmdSetScopedInstance.class, sentMessage.getClass()); Assert.assertNotNull(((MsgCmdSetScopedInstance) sentMessage).getScopedInstance()); }
Source:
public void dropPartition(String databaseName, String tableName, List<String> parts, boolean deleteData) { Table tbl = getTableOrElseThrow(databaseName, tableName); Partition partition = getPartition(databaseName, tableName, parts) .orElseThrow(() -> new PartitionNotFoundException(new SchemaTableName(databaseName, tableName), parts)); try { glueClient.deletePartition(new DeletePartitionRequest() .withDatabaseName(databaseName) .withTableName(tableName) .withPartitionValues(parts)); } catch (AmazonServiceException e) { throw new PrestoException(HIVE_METASTORE_ERROR, e); } String partLocation = partition.getStorage().getLocation(); if (deleteData && !isExternalTable(tbl) && !isNullOrEmpty(partLocation)) { deleteDir(hdfsContext, hdfsEnvironment, new Path(partLocation), true); } }

Target:
public void dropPartition(String databaseName, String tableName, List<String> parts, boolean deleteData) { Table table = getTableOrElseThrow(databaseName, tableName); Partition partition = getPartition(databaseName, tableName, parts) .orElseThrow(() -> new PartitionNotFoundException(new SchemaTableName(databaseName, tableName), parts)); try { glueClient.deletePartition(new DeletePartitionRequest() .withDatabaseName(databaseName) .withTableName(tableName) .withPartitionValues(parts)); } catch (AmazonServiceException e) { throw new PrestoException(HIVE_METASTORE_ERROR, e); } String partLocation = partition.getStorage().getLocation(); if (deleteData && isManagedTable(table) && !isNullOrEmpty(partLocation)) { deleteDir(hdfsContext, hdfsEnvironment, new Path(partLocation), true); } }
Source:
public void manages_a_forms_configuration() { ExportForms forms = new ExportForms(buildFormStatusList(2), new HashMap<>(), new HashMap<>()); FormStatus firstForm = forms.get(0); FormStatus secondForm = forms.get(1); assertThat(forms.hasConfiguration(firstForm), is(false)); forms.setConfiguration(firstForm, VALID_CONFIGURATION); assertThat(forms.hasConfiguration(firstForm), is(true)); assertThat(forms.getConfiguration(firstForm), isPresentAndIs(VALID_CONFIGURATION)); assertThat(forms.getConfiguration(firstForm.getFormDefinition()), isPresentAndIs(VALID_CONFIGURATION)); forms.setConfiguration(secondForm, INVALID_CONFIGURATION); assertThat(forms.getValidConfigurations().values(), Matchers.hasSize(1)); assertThat(forms.getValidConfigurations().values(), Matchers.contains(VALID_CONFIGURATION)); forms.removeConfiguration(firstForm); assertThat(forms.hasConfiguration(firstForm), is(false)); }

Target:
public void manages_a_forms_configuration() { ExportForms forms = new ExportForms(buildFormStatusList(2), ExportConfiguration.empty(), new HashMap<>(), new HashMap<>()); FormStatus firstForm = forms.get(0); FormStatus secondForm = forms.get(1); assertThat(forms.hasConfiguration(firstForm), is(false)); forms.putConfiguration(firstForm, VALID_CONFIGURATION); assertThat(forms.hasConfiguration(firstForm), is(true)); assertThat(forms.getConfiguration(firstForm.getFormDefinition().getFormId()), is(VALID_CONFIGURATION)); assertThat(forms.getConfiguration(firstForm.getFormDefinition().getFormId()), is(VALID_CONFIGURATION)); forms.putConfiguration(secondForm, INVALID_CONFIGURATION); assertThat(forms.getCustomConfigurations().values(), hasSize(2)); assertThat(forms.getCustomConfigurations().values(), contains(VALID_CONFIGURATION, INVALID_CONFIGURATION)); forms.removeConfiguration(firstForm); assertThat(forms.hasConfiguration(firstForm), is(false)); }
Source:
protected boolean rewindToMarkAndSet(String value) { int markIndex = getLatestMarkPosition(steps); if (markIndex >= 0) { String markDatumId = steps.get(markIndex).getId(); steps = new Vector<>(steps.subList(0, markIndex)); steps.addElement(new StackFrameStep(SessionFrame.STATE_DATUM_VAL, markDatumId, value)); return true; } else { return false; } }

Target:
protected boolean rewindToMarkAndSet(String value) { int markIndex = getLatestMarkPosition(steps); if (markIndex >= 0) { String markDatumId = steps.get(markIndex).getId(); steps = new Vector<>(steps.subList(0, markIndex)); if (value != null) { steps.addElement(new StackFrameStep(SessionFrame.STATE_UNKNOWN, markDatumId, value)); } return true; } else { return false; } }
Source:
public synchronized void initialize(URI uri, Configuration configuration) { setConf(configuration); statistics = getStatistics(uri.getScheme(), getClass()); Map<String, Object> uriConfProperties = getConfigurationFromUri(uri); AlluxioProperties alluxioProperties = ConfigurationUtils.defaults(); InstancedConfiguration newConf = HadoopConfigurationUtils.mergeHadoopConfiguration(configuration, alluxioProperties); newConf.merge(uriConfProperties, Source.RUNTIME); mAlluxioConf = newConf; Properties metricsProps = new Properties(); for (Map.Entry<String, String> e : configuration) { metricsProps.setProperty(e.getKey(), e.getValue()); } MetricsSystem.startSinksFromConfig(new MetricsConfig(metricsProps)); mFileSystem = new LocalCacheFileSystem( new AlluxioCachingClientFileSystem(fileSystem, mAlluxioConf), mAlluxioConf); }

Target:
public synchronized void initialize(URI uri, Configuration configuration) throws IOException { setConf(configuration); statistics = getStatistics(uri.getScheme(), getClass()); Map<String, Object> configurationFromUri = getConfigurationFromUri(uri); AlluxioProperties alluxioProperties = ConfigurationUtils.defaults(); InstancedConfiguration newConfiguration = HadoopConfigurationUtils.mergeHadoopConfiguration(configuration, alluxioProperties); newConfiguration.merge(configurationFromUri, Source.RUNTIME); mAlluxioConf = newConfiguration; Properties metricsProperties = new Properties(); for (Map.Entry<String, String> entry : configuration) { metricsProperties.setProperty(entry.getKey(), entry.getValue()); } MetricsSystem.startSinksFromConfig(new MetricsConfig(metricsProperties)); mFileSystem = new LocalCacheFileSystem(new AlluxioCachingClientFileSystem(fileSystem, mAlluxioConf), mAlluxioConf); super.initialize(uri, configuration); }
Source:
public void removeScript(String name) { if (!getScriptCache().containsKey(name)) { throw log.noNamedScript(name); } else { getScriptCache().remove(name); } }

Target:
public void removeScript(String name) { if (getScriptCache().remove(name) == null) { throw log.noNamedScript(name); } }
Source:
protected void addInTarget(ResourceAttachmentChange diff, boolean rightToLeft) { final Match match = diff.getMatch(); final Comparison comparison = match.getComparison(); final Resource expectedContainer = findOrCreateTargetResource(match, rightToLeft); if (expectedContainer == null) { diff.setState(DifferenceState.UNRESOLVED); return; } final EObject sourceValue; if (rightToLeft) { sourceValue = match.getRight(); } else { sourceValue = match.getLeft(); } final EObject expectedValue; if (rightToLeft) { if (match.getLeft() != null) { expectedValue = match.getLeft(); } else { mergeRelatedContainmentRefChanges(diff, sourceValue, rightToLeft); EObject leftValue = match.getLeft(); if (leftValue == null) { expectedValue = createCopy(sourceValue); match.setLeft(expectedValue); } else { expectedValue = leftValue; } } } else if (match.getRight() != null) { expectedValue = match.getRight(); } else { mergeRelatedContainmentRefChanges(diff, sourceValue, rightToLeft); EObject rightValue = match.getRight(); if (rightValue == null) { expectedValue = createCopy(sourceValue); match.setRight(expectedValue); } else { expectedValue = rightValue; } } final Resource initialResource = sourceValue.eResource(); final List<EObject> sourceList = initialResource.getContents(); final List<EObject> targetList = expectedContainer.getContents(); final int insertionIndex = findInsertionIndex(comparison, sourceList, targetList, expectedValue); addAt(targetList, expectedValue, insertionIndex); if (initialResource instanceof XMIResource && expectedContainer instanceof XMIResource) { ((XMIResource)expectedContainer).setID(expectedValue, ((XMIResource)initialResource) .getID(sourceValue)); } }

Target:
protected void addInTarget(ResourceAttachmentChange diff, boolean rightToLeft) { final Match match = diff.getMatch(); final Comparison comparison = match.getComparison(); final Resource expectedContainer = findOrCreateTargetResource(match, rightToLeft); if (expectedContainer == null) { diff.setState(DifferenceState.UNRESOLVED); return; } final EObject sourceValue; if (rightToLeft) { sourceValue = match.getRight(); } else { sourceValue = match.getLeft(); } final EObject expectedValue; if (rightToLeft) { if (match.getLeft() != null) { expectedValue = match.getLeft(); } else { expectedValue = createCopy(sourceValue); match.setLeft(expectedValue); } } else if (match.getRight() != null) { expectedValue = match.getRight(); } else { expectedValue = createCopy(sourceValue); match.setRight(expectedValue); } final Resource initialResource = sourceValue.eResource(); final List<EObject> sourceList = initialResource.getContents(); final List<EObject> targetList = expectedContainer.getContents(); final int insertionIndex = findInsertionIndex(comparison, sourceList, targetList, expectedValue); addAt(targetList, expectedValue, insertionIndex); if (initialResource instanceof XMIResource && expectedContainer instanceof XMIResource) { ((XMIResource)expectedContainer).setID(expectedValue, ((XMIResource)initialResource) .getID(sourceValue)); } }
Source:
public void should_return_http400_error_code_when_no_queryString() throws Exception { Response response = request("/system/i18ntranslationv2").get(); assertThat(response).hasStatus(Status.CLIENT_ERROR_BAD_REQUEST); }

Target:
public void should_return_http400_error_code_when_no_queryString() throws Exception { Response response = request("/system/i18ntranslation").get(); assertThat(response).hasStatus(Status.CLIENT_ERROR_BAD_REQUEST); }