auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void setTransform(Transform transform) { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); if (transform != null && transform.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); if (data.cairo == 0 && transform == null) return; initCairo(); long cairo = data.cairo; double[] identity = identity(); identity[4] <START> += ctm_dx; <END> identity[5] += ctm_dy; if (transform != null) { Cairo.cairo_matrix_multiply(identity, transform.handle, identity); } Cairo.cairo_set_matrix(cairo, identity); data.state &= ~DRAW_OFFSET; }</code><technical_language>if this is right for applying translation, need call some dedicated translate method, save entire original ctm matrix instead of identity here. I happy GMF / GEF finally worked this approach. This need tested rotated scaled transforms (not if this "+=" works them). I if SWT examples get some "transformed shapes" tab scaled, rotated moved shapes/strokes texts, emulating GEF is doing. checked if this already</technical_language>

Target:
public void setTransform(Transform transform) { if (handle == 0) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED); if (transform != null && transform.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT); if (data.cairo == 0 && transform == null) return; initCairo(); long cairo = data.cairo; if (GTK.GTK_VERSION >= OS.VERSION (3, 14, 0)) { if (hasTransform) { Cairo.cairo_restore(cairo); hasTransform = false; } if (transform != null) { double[] identity = identity(); Cairo.cairo_matrix_multiply(identity, transform.handle, identity); Cairo.cairo_save(cairo); hasTransform = true; Cairo.cairo_transform(cairo, identity); } } else { double[] identity = identity(); if (transform != null) { Cairo.cairo_matrix_multiply(identity, transform.handle, identity); } Cairo.cairo_set_matrix(cairo, identity); } data.state &= ~DRAW_OFFSET; }
Source:
<code>private void handleExceptionalPaths(Symbol symbol) { TryStatement pop = enclosingTry.pop(); TryStatement tryStatement; if(!enclosedByCatch.peek()) { tryStatement = pop; } else { tryStatement = enclosingTry.peek(); } enclosingTry.push(pop); if(pop != outerTry) { currentBlock = createBlock(currentBlock); currentBlock.exceptions.add(exitBlocks.peek()); } if (symbol.isMethodSymbol()) { List<Type> thrownTypes = ((Symbol.MethodSymbol) symbol).thrownTypes(); <START> if (!thrownTypes.isEmpty()) { <END> thrownTypes.forEach(thrownType -> { for (Type caughtType : tryStatement.catches.keySet()) { if (thrownType.isSubtypeOf(caughtType) || caughtType.isSubtypeOf(thrownType)) { currentBlock.exceptions.add(tryStatement.catches.get(caughtType)); break; } } }); } } currentBlock.exceptions.addAll(tryStatement.runtimeCatches); }</code><technical_language>need check if thrownTypes list is empty, forEach do if case</technical_language>

Target:
private void handleExceptionalPaths(Symbol symbol) { TryStatement pop = enclosingTry.pop(); TryStatement tryStatement; if (enclosedByCatch.peek()) { tryStatement = enclosingTry.peek(); } else { tryStatement = pop; } enclosingTry.push(pop); if(pop != outerTry) { currentBlock = createBlock(currentBlock); currentBlock.exceptions.add(exitBlocks.peek()); } if (symbol.isMethodSymbol()) { List<Type> thrownTypes = ((Symbol.MethodSymbol) symbol).thrownTypes(); thrownTypes.forEach(thrownType -> { for (Type caughtType : tryStatement.catches.keySet()) { if (thrownType.isSubtypeOf(caughtType) || caughtType.isSubtypeOf(thrownType)) { currentBlock.exceptions.add(tryStatement.catches.get(caughtType)); break; } } }); } currentBlock.exceptions.addAll(tryStatement.runtimeCatches); }
Source:
<code>public ByteBuffer subscriptionUserData(final Set<String> topics) { final Set<TaskId> activeTasks; final Set<TaskId> standbyTasks = taskManager.cachedTasksIds(); if (rebalanceProtocol == RebalanceProtocol.EAGER) { activeTasks = taskManager.previousRunningTaskIds(); standbyTasks.removeAll(activeTasks); <START> <END> } else if (rebalanceProtocol == RebalanceProtocol.COOPERATIVE) { activeTasks = Collections.emptySet(); standbyTasks.removeAll(taskManager.activeTaskIds()); } else { throw new IllegalStateException("Streams partition assignor has no known rebalance protocol"); } final SubscriptionInfo data = new SubscriptionInfo( usedSubscriptionMetadataVersion, taskManager.processId(), activeTasks, standbyTasks, userEndPoint); taskManager.updateSubscriptionsFromMetadata(topics); taskManager.setRebalanceInProgress(true); return data.encode(); }</code><technical_language>nit: case switch better</technical_language>

Target:
public ByteBuffer subscriptionUserData(final Set<String> topics) { final Set<TaskId> standbyTasks = taskManager.cachedTasksIds(); final Set<TaskId> activeTasks = prepareForSubscription(taskManager, topics, standbyTasks, rebalanceProtocol); return new SubscriptionInfo( usedSubscriptionMetadataVersion, taskManager.processId(), activeTasks, standbyTasks, userEndPoint) .encode(); }
Source:
<code>public PutMessageFormatInputStream(StoreKey key, ByteBuffer blobEncryptionKey, BlobProperties blobProperties, ByteBuffer userMetadata, InputStream blobStream, long streamSize) throws MessageFormatException { <START> this(key, blobEncryptionKey, blobProperties, userMetadata, blobStream, streamSize, BlobType.DataBlob); <END> }</code><technical_language>change this to: this(key, blobEncryptionKey, blobProperties, userMetadata, blobStream, streamSize, BlobType.DataBlob, (short) 0); avoiding extra method call</technical_language>

Target:
public PutMessageFormatInputStream(StoreKey key, ByteBuffer blobEncryptionKey, BlobProperties blobProperties, ByteBuffer userMetadata, InputStream blobStream, long streamSize) throws MessageFormatException { this(key, blobEncryptionKey, blobProperties, userMetadata, blobStream, streamSize, BlobType.DataBlob, (short) 0); }
Source:
<code>private static boolean equalIncludingGenerics(ClassNode orig, ClassNode copy) { if (orig==copy) return true; if (orig.isGenericsPlaceHolder()!=copy.isGenericsPlaceHolder()) return false; if (!orig.equals(copy)) return false; GenericsType[] gt1 = orig.getGenericsTypes(); GenericsType[] gt2 = copy.getGenericsTypes(); if (gt1==gt2) return true; <START> if (gt1 == null || gt2 == null) return false; <END> if (gt1.length!=gt2.length) return false; for (int i=0; i<gt1.length; i++) { if (!equalIncludingGenerics(gt1[i],gt2[i])) return false; } return true; }</code><technical_language>I personally dont this reordering of checks here. For intend more clear (of orig/copy bug)</technical_language>

Target:
private static boolean equalIncludingGenerics(ClassNode orig, ClassNode copy) { if (orig==copy) return true; if (orig.isGenericsPlaceHolder()!=copy.isGenericsPlaceHolder()) return false; if (!orig.equals(copy)) return false; GenericsType[] gt1 = orig.getGenericsTypes(); GenericsType[] gt2 = copy.getGenericsTypes(); if ((gt1==null) ^ (gt2==null)) return false; if (gt1==gt2) return true; if (gt1.length!=gt2.length) return false; for (int i=0; i<gt1.length; i++) { if (!equalIncludingGenerics(gt1[i],gt2[i])) return false; } return true; }
Source:
<code>Duration getPollDuration() { <START> return Duration.ofSeconds(1); <END> }</code><technical_language>create a constant name DEFAULT_POLL_DURATION</technical_language>

Target:
Duration getPollDuration() { return DEFAULT_POLL_DURATION; }
Source:
<code>protected Parser getSyntaxParser(Syntax syntax) throws MacroExecutionException { try { return this.componentManager.getInstance(Parser.class, syntax.toIdString()); } catch (ComponentLookupException e) { <START> throw new MacroExecutionException(String.format("Cannot find Parser for syntax [%s]", syntax.toIdString()), e); <END> } }</code><technical_language>Line long</technical_language>

Target:
protected Parser getSyntaxParser(Syntax syntax) throws MacroExecutionException { try { return this.componentManager.getInstance(Parser.class, syntax.toIdString()); } catch (ComponentLookupException e) { throw new MacroExecutionException(String.format("Cannot find Parser for syntax [%s]" + , syntax.toIdString()), e); } }
Source:
<code>public void onCreate() { super.onCreate(); SwrveConfig config = new SwrveConfig(); try { config.useEuStack(); config.setStack(SwrveConfigBase.SwrveStack.US); config.setAppIdPrefix(2132); config.setUseHttpsForEventsUrl(true); config.setEventsUrl(new URL("<LINK_1>")); config.setContentUrl(new URL("<LINK_0>")); config.setUseHttpsForEventsUrl(false); <START> config.setStack(SwrveConfigBase.SwrveStack.US); END> } catch (MalformedURLException e) { e.printStackTrace(); } try { SwrveSDK.createInstance(this, 2132, "AYgy6V2uk6f3d46ShfJ", config); } catch (IllegalArgumentException exp) { Log.e(LOG_TAG, "Could not initialize the Swrve SDK", exp); } }</code><technical_language>Mistaken commit</technical_language>

Target:
public void onCreate() { super.onCreate(); try { SwrveSDK.createInstance(this, YOUR_APP_ID, YOUR_API_KEY); } catch (IllegalArgumentException exp) { Log.e(LOG_TAG, "Could not initialize the Swrve SDK", exp); } }
Source:
<code>public boolean offer( E e, long timeout, TimeUnit unit ) throws InterruptedException { checkNotNull(e); long nanos = unit.toNanos(timeout); boolean added = false; putLock.lockInterruptibly(); try { <START> while (currentSize.get() >= capacity) { <END> if (nanos <= 0) { return false; } nanos = notFull.awaitNanos(nanos); } delegate.add(e); elementAdded(e); added = true; } finally { putLock.unlock(); } if (added) { signalNotEmpty(); } return added; }</code><technical_language>this account size of element offered, allowing grow capacity</technical_language>

Target:
public boolean offer( E e, long timeout, TimeUnit unit ) throws InterruptedException { checkNotNull(e); checkSize(e); long nanos = unit.toNanos(timeout); boolean added = false; putLock.lockInterruptibly(); try { while (currentSize.get() + getBytesSize(e) > capacity) { if (nanos <= 0) { return false; } nanos = notFull.awaitNanos(nanos); } delegate.add(e); elementAdded(e); added = true; } finally { putLock.unlock(); } if (added) { signalNotEmpty(); } return added; }
Source:
<code>private static void getColumnNames(DatabaseMetaData meta, Set<String> names) throws SQLException { try { ResultSet columns = meta.getColumns(meta.getConnection().getCatalog(), null, "%", "%"); try { while (columns.next()) { String name = columns.getString("TABLE_NAME"); if (!isBlank(name)) { names.add(name); names.add(columns.getString("COLUMN_NAME")); } } } finally { columns.close(); } logger.debug(Joiner.on(',').join(names)); <START> } catch (Throwable t) { <END> logger.error("Failed to retrieve the column name", t); } }</code><technical_language>Is a reason user Throwable instead of Exception below</technical_language>

Target:
private static void getColumnNames(DatabaseMetaData meta, Set<String> names) throws SQLException { try { ResultSet columns = meta.getColumns(meta.getConnection().getCatalog(), null, "%", "%"); try { while (columns.next()) { String name = columns.getString("TABLE_NAME"); if (!isBlank(name)) { names.add(name); names.add(columns.getString("COLUMN_NAME")); } } } finally { columns.close(); } logger.debug(Joiner.on(',').join(names)); } catch (Exception e) { logger.error("Failed to retrieve the column name", e); } }
Source:
<code>void close() { try { LOG.info("Starting to close KafkaProducer."); producer.close(); LOG.info("Successfully closed KafkaProducer."); <START> } catch (Exception e) { <END> LOG.error("An error occurred while closing KafkaProducer!", e); } }</code><technical_language>RuntimeException sufficient</technical_language>

Target:
private void close() { try { LOG.debug("Starting to close KafkaProducer."); producer.close(); LOG.debug("Successfully closed KafkaProducer."); } catch (RuntimeException e) { LOG.error("An error occurred while closing KafkaProducer.", e); } }
Source:
<code>protected void onActiveFilterAdded(ActiveFilterItem activeFilterItem) { if (activeFilterItem.getKey().equals(constants.State()) && activeFilterItem.getValue() instanceof List) { final List<String> values = (List<String>) activeFilterItem.getValue(); values.forEach(v -> view.checkSelectFilter(constants.State(), String.valueOf(v))); } if (activeFilterItem.getKey().equals(COLUMN_ERROR_COUNT) && activeFilterItem.getValue() instanceof List) { final List<String> values = (List<String>) activeFilterItem.getValue(); <START> values.forEach(v -> view.checkSelectFilter(constants.Errors(), (String.valueOf(v).equals("0") || String.valueOf(v) == "0") ? "true" : "false")); <END> } }</code><technical_language>equals for string is enough, need compare identity aferwards</technical_language>

Target:
protected void onActiveFilterAdded(ActiveFilterItem activeFilterItem) { if (activeFilterItem.getKey().equals(constants.State()) && activeFilterItem.getValue() instanceof List) { final List<String> values = (List<String>) activeFilterItem.getValue(); values.forEach(v -> view.checkSelectFilter(constants.State(), v)); } if (activeFilterItem.getKey().equals(COLUMN_ERROR_COUNT) && activeFilterItem.getValue() instanceof List) { final List<String> values = (List<String>) activeFilterItem.getValue(); values.forEach(v -> view.checkSelectFilter(constants.Errors(), v)); } }
Source:
<code>public Optional<IOException> handle(Response response) { <START> if (response.isSuccessful() || response.code() == 101) { <END> return Optional.empty(); } try { String body = response.body() != null && response.body().byteStream() != null ? toString(response.body().byteStream()) : "<empty>"; return Optional.of(new IOException(String.format("Error %s. " + "(Failed to parse response body as SerializableError.) Body:%n%s", response.code(), body))); } catch (IOException e) { return Optional.of(new IOException("Failed to read response body", e)); } }</code><technical_language>give this magic number a name present in usual javax.ws.rs.core.Response.Status</technical_language>

Target:
public Optional<IOException> handle(Response response) { if (response.isSuccessful() || response.code() == MoreHttpCodes.SWITCHING_PROTOCOLS) { return Optional.empty(); } try { String body = response.body() != null && response.body().byteStream() != null ? toString(response.body().byteStream()) : "<empty>"; return Optional.of(new IOException(String.format("Error %s. " + "(Failed to parse response body as SerializableError.) Body:%n%s", response.code(), body))); } catch (IOException e) { return Optional.of(new IOException("Failed to read response body", e)); } }
Source:
<code><START> public Blueprint() { <END> this(null, null, null); }</code><technical_language>Jackson is fine private constructors. IMHO this Update private protected users instantiate this essentially invalid objects</technical_language>

Target:
private Blueprint() { this(null, null, null); }
Source:
<code>public void addMtuEditor() { FlowPanel panel = mtuSelectorEditor.asRadioGroup().getPanel(MtuSelector.customMtu); <START> if (panel != null) { <END> panel.add(mtuEditor); } }</code><technical_language>this null</technical_language>

Target:
public void addMtuEditor() { FlowPanel panel = mtuSelectorEditor.asRadioGroup().getPanel(MtuSelector.customMtu); panel.add(mtuEditor); }
Source:
<code>public static Set<RuntimePath> parseRuntimeFile(InputStream is, boolean includeMissing) { final Set<RuntimePath> runtimePaths = new HashSet<RuntimePath>(); try { Properties servers = new Properties(); servers.load(is); Enumeration<Object> elements = servers.elements(); while (elements.hasMoreElements()) { String str = (String) elements.nextElement(); StringTokenizer lineTokenizer = new StringTokenizer(str,LINE_DELIMITER); while (lineTokenizer.hasMoreTokens()) { String lineToken = lineTokenizer.nextToken(); StringTokenizer tokenizer = new StringTokenizer( lineToken, IN_LINE_DELIMITER); if (tokenizer.countTokens() == 2) { String location = tokenizer.nextToken(); boolean scan = Boolean.parseBoolean(tokenizer.nextToken()); File locationFile = new File(location); if (locationFile.isDirectory() || (includeMissing && !locationFile.exists())) { RuntimePath tempLocation = new RuntimePath(location); tempLocation.setScanOnEveryStartup(scan); runtimePaths.add(tempLocation); } else { <START> RuntimeCoreActivator.pluginLog().logWarning("Runtime location \"" + location + "\" does not exist or not a directory"); <END> } } } } } catch (IOException e) { RuntimeCoreActivator.pluginLog().logError(e); } return runtimePaths; }</code><technical_language>"or is not"</technical_language>

Target:
public static Set<RuntimePath> parseRuntimeFile(InputStream is, boolean includeMissing) { final Set<RuntimePath> runtimePaths = new HashSet<RuntimePath>(); try { Properties servers = new Properties(); servers.load(is); Enumeration<Object> elements = servers.elements(); while (elements.hasMoreElements()) { String str = (String) elements.nextElement(); StringTokenizer lineTokenizer = new StringTokenizer(str,LINE_DELIMITER); while (lineTokenizer.hasMoreTokens()) { String lineToken = lineTokenizer.nextToken(); StringTokenizer tokenizer = new StringTokenizer( lineToken, IN_LINE_DELIMITER); if (tokenizer.countTokens() == 2) { String location = tokenizer.nextToken(); boolean scan = Boolean.parseBoolean(tokenizer.nextToken()); File locationFile = new File(location); if (locationFile.isDirectory() || (includeMissing && !locationFile.exists())) { RuntimePath tempLocation = new RuntimePath(location); tempLocation.setScanOnEveryStartup(scan); runtimePaths.add(tempLocation); } else { RuntimeCoreActivator.pluginLog().logWarning("Runtime location \"" + location + "\" does not exist or is not a directory"); } } } } } catch (IOException e) { RuntimeCoreActivator.pluginLog().logError(e); } return runtimePaths; }
Source:
<code>private void updateRepoRemoveList(Menu remove) { remove.getItems().clear(); Set<String> currentlyUsedRepos = ui.getCurrentlyUsedRepos(); Set<String> removableRepos = ui.logic.getStoredRepos(); removableRepos.removeAll(currentlyUsedRepos); for (String repoId : removableRepos) { MenuItem removeItem = new MenuItem(repoId); removeItem.setOnAction(e1 -> onRepoRemove(repoId)); remove.getItems().add(removeItem); } for (String usedRepoId : currentlyUsedRepos) { <START> MenuItem disabledRemoveItem = new MenuItem(usedRepoId + " (in use; non-removable)"); <END> disabledRemoveItem.setDisable(true); remove.getItems().add(disabledRemoveItem); } }</code><technical_language>I semicolon nice =P shorter (In Use)</technical_language>

Target:
private void updateRepoRemoveList(Menu remove) { remove.getItems().clear(); Set<String> currentlyUsedRepos = ui.getCurrentlyUsedRepos(); Set<String> removableRepos = ui.logic.getStoredRepos(); removableRepos.removeAll(currentlyUsedRepos); for (String repoId : removableRepos) { MenuItem removeItem = new MenuItem(repoId); removeItem.setOnAction(e1 -> onRepoRemove(repoId)); remove.getItems().add(removeItem); } remove.getItems().add(new SeparatorMenuItem()); MenuItem nonRemovableMsg = new MenuItem("[Non-Removable - In Use]"); nonRemovableMsg.setDisable(true); remove.getItems().add(nonRemovableMsg); for (String usedRepoId : currentlyUsedRepos) { MenuItem disabledRemoveItem = new MenuItem(usedRepoId); disabledRemoveItem.setDisable(true); remove.getItems().add(disabledRemoveItem); } }
Source:
<code>public void afterTestSuite(ProjectRunner testScenarioRunner, ProjectRunContext runContext, TestSuiteRunner testRunner) { if (testScenarioRunner != projectRunner) { return; } finishCount.incrementAndGet(); Platform.runLater(new Runnable() { @Override public void run() { progressBar.setValue(finishCount.get()); <START> System.out.println("setting coutn to " + String.valueOf(finishCount.get())); <END> } }); if (project.getRunType() == TestSuiteRunType.SEQUENTIAL) { testRunner.getTestSuite().removeTestSuiteRunListener(runLogListener); } }</code><technical_language>need remove System.out.println</technical_language>

Target:
public void afterTestSuite(ProjectRunner testScenarioRunner, ProjectRunContext runContext, TestSuiteRunner testRunner) { if (testScenarioRunner != projectRunner) { return; } finishCount.incrementAndGet(); Platform.runLater(new Runnable() { @Override public void run() { progressBar.setValue(finishCount.get()); } }); if (project.getRunType() == TestSuiteRunType.SEQUENTIAL) { testRunner.getTestSuite().removeTestSuiteRunListener(runLogListener); } }
Source:
<code>public void run() { if (log.isDebugEnabled()) { log.debug("Starting a new BAPI worker thread to process the incoming request"); } <START> ByteArrayInputStream bais = new ByteArrayInputStream(this.xmlContent.getBytes()); <END> MessageContext msgContext = null; try { msgContext = endpoint.createMessageContext(); msgContext.setIncomingTransportName(SAPConstants.SAP_BAPI_PROTOCOL_NAME); if (log.isDebugEnabled()) { log.debug("Creating SOAP envelope from the BAPI function call"); } SOAPEnvelope envelope = TransportUtils.createSOAPMessage(msgContext, bais, SAPConstants.SAP_CONTENT_TYPE); msgContext.setEnvelope(envelope); AxisEngine.receive(msgContext); } catch (Exception e) { log.error("Error while processing the BAPI call through the Axis engine", e); } finally { try { bais.close(); } catch (IOException e) { log.error("Error while closing the stream", e); } } }</code><technical_language>ByteArrayInputStream implements Autocloseable try resources for resource cleanup closing stream in finally clause</technical_language>

Target:
public void run() { if (log.isDebugEnabled()) { log.debug("Starting a new BAPI worker thread to process the incoming request"); } try (ByteArrayInputStream bais = new ByteArrayInputStream(this.xmlContent.getBytes())){ MessageContext msgContext = endpoint.createMessageContext(); msgContext.setIncomingTransportName(SAPConstants.SAP_BAPI_PROTOCOL_NAME); if (log.isDebugEnabled()) { log.debug("Creating SOAP envelope from the BAPI function call"); } SOAPEnvelope envelope = TransportUtils.createSOAPMessage(msgContext, bais, SAPConstants.SAP_CONTENT_TYPE); msgContext.setEnvelope(envelope); AxisEngine.receive(msgContext); } catch (Exception e) { log.error("Error while processing the BAPI call through the Axis engine", e); } }
Source:
<code>public void objectWithPropDep() { ObjectSchema actual = (ObjectSchema) SchemaLoader.load(get("objectWithPropDep")); assertEquals(1, actual.getPropertyDependencies().get("isIndividual").size()); <START> actual = (ObjectSchema) loadAsV201909(get("objectWithPropDep_V201909")); <END> assertEquals(1, actual.getPropertyDependencies().get("isIndividual").size()); }</code><technical_language>This movd a separate tests, test contains given-when-then triad (same for other test changes below)</technical_language>

Target:
public void objectWithPropDep() { ObjectSchema actual = (ObjectSchema) SchemaLoader.load(get("objectWithPropDep")); assertEquals(1, actual.getPropertyDependencies().get("isIndividual").size()); }
Source:
<code><START> public Locale getLoggingLocale() { <END> return LOGGING_LOCALE.get(); }</code><technical_language>do making this method final? called of log methods (which want fast possible), adding 'final' more (all considered) inlined</technical_language>

Target:
public static Locale getLoggingLocale() { return LOGGING_LOCALE.get(); }
Source:
<code><START> void generatePipelinedRegions() { <END> final Set<Set<SchedulingExecutionVertex>> rawRegions = PipelinedRegionComputeUtil.computePipelinedRegions(this); for (Set<SchedulingExecutionVertex> rawRegion : rawRegions) { final Set<TestingSchedulingExecutionVertex> vertices = rawRegion.stream() .map(vertex -> schedulingExecutionVertices.get(vertex.getId())) .collect(Collectors.toSet()); final TestingSchedulingPipelinedRegion region = new TestingSchedulingPipelinedRegion(vertices); for (TestingSchedulingExecutionVertex vertex : vertices) { vertexRegions.put(vertex.getId(), region); } } }</code><technical_language>Consider invoking this method lazily in getAllPipelinedRegions() getPipelinedRegionOfVertex() instead of relying client (test) invoke it</technical_language>

Target:
private void generatePipelinedRegions() { vertexRegions = new HashMap<>(); final Set<Set<SchedulingExecutionVertex>> rawRegions = PipelinedRegionComputeUtil.computePipelinedRegions(this); for (Set<SchedulingExecutionVertex> rawRegion : rawRegions) { final Set<TestingSchedulingExecutionVertex> vertices = rawRegion.stream() .map(vertex -> schedulingExecutionVertices.get(vertex.getId())) .collect(Collectors.toSet()); final TestingSchedulingPipelinedRegion region = new TestingSchedulingPipelinedRegion(vertices); for (TestingSchedulingExecutionVertex vertex : vertices) { vertexRegions.put(vertex.getId(), region); } } }
Source:
<code>public static ExtensionsManager getInstance() { if (instance == null) { synchronized (EngineExtensionsManager.class) { if (instance == null) { instance = new ExtensionsManager( <START> EngineLocalConfig.getInstance().getProperties()); <END> instance.getGlobalContext().put(Base.GlobalContextKeys.APPLICATION_NAME, Base.ApplicationNames.OVIRT_ENGINE); List<String> extensionNames = new ArrayList<>(); for (File directory : EngineLocalConfig.getInstance().getExtensionsDirectories()) { if (!directory.exists()) { log.warn(String.format("The directory '%1$s' cotaning configuration files does not exist.", directory.getAbsolutePath())); } else { File[] files = directory.listFiles(); if (files != null) { sort(files); for (File file : files) { if (file.getName().endsWith(".properties")) { extensionNames.add(instance.load(file)); } } } } } for (String extensionName : extensionNames) { if (EngineLocalConfig.getInstance().getBoolean(ENGINE_EXTENSION_ENABLED + extensionName, true)) { instance.activate(extensionName); } } } } } return instance; }</code><technical_language>drop getProperties()</technical_language>

Target:
public static ExtensionsManager getInstance() { if (instance == null) { synchronized (EngineExtensionsManager.class) { if (instance == null) { instance = new ExtensionsManager(); instance.getGlobalContext().put(Base.GlobalContextKeys.APPLICATION_NAME, Base.ApplicationNames.OVIRT_ENGINE); for (File directory : EngineLocalConfig.getInstance().getExtensionsDirectories()) { if (!directory.exists()) { log.warn(String.format("The directory '%1$s' cotaning configuration files does not exist.", directory.getAbsolutePath())); } else { File[] files = directory.listFiles(); if (files != null) { sort(files); for (File file : files) { if (file.getName().endsWith(".properties")) { instance.load(file); } } } } } for (ExtensionProxy extension : instance.getExtensions()) { if (EngineLocalConfig.getInstance().getBoolean(ENGINE_EXTENSION_ENABLED + extension.getContext().<String> get(Base.ContextKeys.INSTANCE_NAME), true)) { instance.activate(extension.getContext().<String> get(Base.ContextKeys.INSTANCE_NAME)); } } } } } return instance; }
Source:
<code>protected void executeVmCommand() { if (getVm().isAutoStartup() && shouldAddLease(getVm().getStaticData())) { if (FeatureSupported.isVmLeasesSupported(getEffectiveCompatibilityVersion())) { if (validateLeaseStorageDomain(getVm().getLeaseStorageDomainId())) { if (!addVmLease(getVm().getLeaseStorageDomainId(), getVm().getId())) { getVm().setLeaseStorageDomainId(null); } } else { getVm().setLeaseStorageDomainId(null); auditLogDirector.log(this, AuditLogType.CANNOT_IMPORT_VM_WITH_LEASE_STORAGE_DOMAIN); } } else { getVm().setLeaseStorageDomainId(null); auditLogDirector.log(this, AuditLogType.CANNOT_IMPORT_VM_WITH_LEASE_COMPAT_VERSION); } } else { getVm().setLeaseStorageDomainId(null); } super.executeVmCommand(); <START> if(getReturnValue().getVdsmTaskIdList().isEmpty()){ <END> auditLogDirector.log(this, AuditLogType.IMPORTEXPORT_STARTING_IMPORT_VM); } }</code><technical_language>formatter</technical_language>

Target:
protected void executeVmCommand() { if (getVm().isAutoStartup() && shouldAddLease(getVm().getStaticData())) { if (FeatureSupported.isVmLeasesSupported(getEffectiveCompatibilityVersion())) { if (validateLeaseStorageDomain(getVm().getLeaseStorageDomainId())) { if (!addVmLease(getVm().getLeaseStorageDomainId(), getVm().getId())) { getVm().setLeaseStorageDomainId(null); } } else { getVm().setLeaseStorageDomainId(null); auditLogDirector.log(this, AuditLogType.CANNOT_IMPORT_VM_WITH_LEASE_STORAGE_DOMAIN); } } else { getVm().setLeaseStorageDomainId(null); auditLogDirector.log(this, AuditLogType.CANNOT_IMPORT_VM_WITH_LEASE_COMPAT_VERSION); } } else { getVm().setLeaseStorageDomainId(null); } super.executeVmCommand(); }
Source:
<code>public boolean tryLock() { Lock localLock = RedisLockRegistry.this.localRegistry.obtain(lockKey); try { if (!localLock.tryLock()) { return false; } boolean obtainedLock = this.obtainLock(); if (!obtainedLock) { localLock.unlock(); if (this.reLock <= 0) { removeThreadLocal(); <START> } <END> } return obtainedLock; } catch (Exception e) { localLock.unlock(); throw new RuntimeException(e); } }</code><technical_language>this in catch block localLock.unlock();</technical_language>

Target:
public boolean tryLock() { Lock localLock = RedisLockRegistry.this.localRegistry.obtain(lockKey); try { if (!localLock.tryLock()) { return false; } boolean obtainedLock = this.obtainLock(); if (!obtainedLock) { localLock.unlock(); } return obtainedLock; } catch (Exception e) { localLock.unlock(); throw new RuntimeException(e); } }
Source:
<code>public void preBegin() { <START> for (EntityRef entityRef : entityManager.getEntitiesWith(ModuleConfigComponent.class)) { <END> ModuleConfigComponent moduleConfig = entityRef.getComponent(ModuleConfigComponent.class); String moduleName = moduleConfig.moduleName; Map<String, String> properties; if (propertiesPerModule.containsKey(moduleName)) { logger.error("Encountered more than one Module Config for module - "+moduleName+", this is not recommended, " + "as the property values visible are not going to be well defined."); properties = propertiesPerModule.get(moduleName); } else { properties = new HashMap<>(); propertiesPerModule.put(moduleName, properties); } properties.putAll(moduleConfig.properties); } }</code><technical_language>this doesnt get changes entity gets, suited find prefabs ModuleConfigComponent? I it, do create entities preBegin? I AutoCreateComponent, didnt work. I missing something. prefabs instead of entities work for test. a good forward</technical_language>

Target:
public void preBegin() { for (Prefab prefab : prefabManager.listPrefabs(ModuleConfigComponent.class)) { ModuleConfigComponent moduleConfig = prefab.getComponent(ModuleConfigComponent.class); String moduleName = moduleConfig.moduleName; Map<String, String> properties; if (propertiesPerModule.containsKey(moduleName)) { logger.error("Encountered more than one Module Config for module - "+moduleName+", this is not recommended, " + "as the property values visible are not going to be well defined."); properties = propertiesPerModule.get(moduleName); } else { properties = new HashMap<>(); propertiesPerModule.put(moduleName, properties); } properties.putAll(moduleConfig.properties); } }
Source:
<code>public void testCreateSmbFileObjectWithBackSlash1() throws IOException { System.setProperty("file.separator", "\\"); SmbShare smbShare = new SmbShare("smb://myshare/shared/"); SmbSession smbSession = new SmbSession(smbShare); SmbFile smbFile = smbSession.createSmbFileObject("smb://myshare\\blubba\\"); <START> assertEquals("smb://myshare/shared/smb://myshare/blubba/", smbFile.getCanonicalPath()); <END> }</code><technical_language>I this is wrong. creepy path... /blubba sub-path of smb://myshare/shared/ root. it</technical_language>

Target:
public void testCreateSmbFileObjectWithBackSlash1() throws IOException { System.setProperty("file.separator", "\\"); SmbConfig config = new SmbConfig(); config.setHost("myshare"); config.setPort(445); config.setShareAndDir("shared/"); SmbShare smbShare = new SmbShare(config); SmbSession smbSession = new SmbSession(smbShare); SmbFile smbFile = smbSession.createSmbFileObject("smb://myshare\\blubba\\"); assertEquals("smb://myshare/blubba/", smbFile.getPath()); smbSession.close(); }
Source:
<code>private void processCheckpoint(StreamAddressSpace streamAddressSpace, Function<ILogData, Boolean> filter, NavigableSet<Long> queue) { SortedSet<Long> checkpointAddresses = new TreeSet<>(Collections.reverseOrder()); streamAddressSpace.getAddressMap().forEach(checkpointAddresses::add); Iterable<List<Long>> batches = Iterables.partition(checkpointAddresses, runtime.getParameters().getCheckpointReadBatchSize()); boolean checkpointResolved = false; for (List<Long> batch : batches) { if (checkpointResolved) { break; } try { List<ILogData> entries = readAll(batch); for (ILogData data : entries) { filter.apply(data); } } catch (TrimmedException te) { checkpointResolved = processCheckpointBatchByEntry(batch, filter, queue); } } <START> List<Long> checkpointEntries = selectCheckpoint(getCurrentContext()); <END> queue.addAll(checkpointEntries); }</code><technical_language>is this supposed do ? Is supposed provide a list of highest checkpoint</technical_language>

Target:
private void processCheckpoint(StreamAddressSpace streamAddressSpace, Function<ILogData, Boolean> filter, NavigableSet<Long> queue) { SortedSet<Long> checkpointAddresses = new TreeSet<>(Collections.reverseOrder()); streamAddressSpace.getAddressMap().forEach(checkpointAddresses::add); Iterable<List<Long>> batches = Iterables.partition(checkpointAddresses, runtime.getParameters().getCheckpointReadBatchSize()); boolean checkpointResolved = false; for (List<Long> batch : batches) { if (checkpointResolved) { break; } try { List<ILogData> entries = readAll(batch); for (ILogData data : entries) { filter.apply(data); } } catch (TrimmedException te) { checkpointResolved = processCheckpointBatchByEntry(batch, filter, queue); } } List<Long> checkpointEntries = resolveCheckpoint(getCurrentContext()); queue.addAll(checkpointEntries); }
Source:
<code>static Iterator<Double> rangeClosedBy(double from, double toInclusive, double step) { if (Double.isNaN(from)) { throw new IllegalArgumentException("from is NaN"); } else if (Double.isNaN(toInclusive)) { throw new IllegalArgumentException("toInclusive is NaN"); } else if (Double.isNaN(step)) { throw new IllegalArgumentException("step is NaN"); } else if (step == 0) { throw new IllegalArgumentException("step cannot be 0"); } else if (from == toInclusive) { return of(from); } else if (Math.signum(step) == Math.signum(from - toInclusive)) { return empty(); } else { if (step > 0) { return new AbstractIterator<Double>() { final double end = Math.nextUp(toInclusive); double i = from; @Override public boolean hasNext() { return i < end; } @Override public Double getNext() { final double next = i; <START> i = Math.max(i + step, Math.nextUp(i)); <END> return next; } }; } else { return new AbstractIterator<Double>() { final double end = Math.nextDown(toInclusive); double i = from; @Override public boolean hasNext() { return i > end; } @Override public Double getNext() { final double previous = i; i = Math.min(i + step, Math.nextDown(i)); return previous; } }; } } }</code><technical_language>break this semantics? E.g. for range(.0d, Double.MAX_VALUE, Double.MIN_VALUE). steps greater greater... expect constant steps. Scala behave here</technical_language>

Target:
static Iterator<Double> rangeClosedBy(double from, double toInclusive, double step) { if (Double.isNaN(from)) { throw new IllegalArgumentException("from is NaN"); } else if (Double.isNaN(toInclusive)) { throw new IllegalArgumentException("toInclusive is NaN"); } else if (Double.isNaN(step)) { throw new IllegalArgumentException("step is NaN"); } else if (step == 0) { throw new IllegalArgumentException("step cannot be 0"); } else if (from == toInclusive) { return of(from); } else if (step * (from - toInclusive) > 0) { return empty(); } else { return new AbstractIterator<Double>() { double prev = Double.NaN; double curr = from; boolean hasNext = true; @Override public boolean hasNext() { return hasNext; } @Override public Double getNext() { final double next = curr; if ((step > 0 && curr + step > toInclusive) || (step < 0 && curr + step < toInclusive)) { hasNext = false; } else { prev = curr; curr += step; if (curr == prev) { hasNext = false; } } return next; } }; } }
Source:
<code>public Network inspectNetwork(InspectNetworkParams params) throws IOException { String netId = params.getNetworkId(); ServiceList services = openShiftClient.services() .inNamespace(this.cheOpenShiftProjectName) .list(); Map<String, ContainerInNetwork> containers = new HashMap<>(); <START> for (Service svc : services.getItems()) { <END> String selector = svc.getSpec().getSelector().get(OPENSHIFT_DEPLOYMENT_LABEL); if (selector == null || !selector.startsWith(CHE_OPENSHIFT_RESOURCES_PREFIX)) { continue; } PodList pods = openShiftClient.pods() .inNamespace(cheOpenShiftProjectName) .withLabel(OPENSHIFT_DEPLOYMENT_LABEL, selector) .list(); for (Pod pod : pods.getItems()) { String podName = pod.getMetadata() .getName(); ContainerInNetwork container = new ContainerInNetwork().withName(podName) .withIPv4Address(svc.getSpec() .getClusterIP()); String podId = getLabelFromContainerID(pod.getMetadata() .getLabels() .get(CHE_CONTAINER_IDENTIFIER_LABEL_KEY)); if (podId == null) { continue; } containers.put(podId, container); } } List<IpamConfig> ipamConfig = new ArrayList<>(); Ipam ipam = new Ipam().withDriver("bridge") .withOptions(Collections.emptyMap()) .withConfig(ipamConfig); return new Network().withName("OpenShift") .withId(netId) .withContainers(containers) .withLabels(Collections.emptyMap()) .withOptions(Collections.emptyMap()) .withDriver("default") .withIPAM(ipam) .withScope("local") .withInternal(false) .withEnableIPv6(false); }</code><technical_language>is streams</technical_language>

Target:
public Network inspectNetwork(InspectNetworkParams params) throws IOException { String netId = params.getNetworkId(); ServiceList services = openShiftClient.services() .inNamespace(this.openShiftCheProjectName) .list(); Map<String, ContainerInNetwork> containers = new HashMap<>(); for (Service svc : services.getItems()) { String selector = svc.getSpec().getSelector().get(OPENSHIFT_DEPLOYMENT_LABEL); if (selector == null || !selector.startsWith(CHE_OPENSHIFT_RESOURCES_PREFIX)) { continue; } PodList pods = openShiftClient.pods() .inNamespace(openShiftCheProjectName) .withLabel(OPENSHIFT_DEPLOYMENT_LABEL, selector) .list(); for (Pod pod : pods.getItems()) { String podName = pod.getMetadata() .getName(); ContainerInNetwork container = new ContainerInNetwork().withName(podName) .withIPv4Address(svc.getSpec() .getClusterIP()); String podId = getLabelFromContainerID(pod.getMetadata() .getLabels() .get(CHE_CONTAINER_IDENTIFIER_LABEL_KEY)); if (podId == null) { continue; } containers.put(podId, container); } } List<IpamConfig> ipamConfig = new ArrayList<>(); Ipam ipam = new Ipam().withDriver("bridge") .withOptions(Collections.emptyMap()) .withConfig(ipamConfig); return new Network().withName("OpenShift") .withId(netId) .withContainers(containers) .withLabels(Collections.emptyMap()) .withOptions(Collections.emptyMap()) .withDriver("default") .withIPAM(ipam) .withScope("local") .withInternal(false) .withEnableIPv6(false); }
Source:
<code>void testNoRetry() throws Exception { SyncTaskImpl task = new SyncTaskImpl(SUCCESS); RetryStats retryStats = new RetryStats(); <START> Integer result = retry.run("test", retryStats, task); <END> assertSyncSuccess(result, task, 1); }</code><technical_language>this need boxed (can null)</technical_language>

Target:
void testNoRetry() throws Exception { SyncTaskImpl task = new SyncTaskImpl(SUCCESS); RetryStats retryStats = new RetryStats(); Integer result = retry.run("test", retryStats, task); assertSyncSuccess(result, task, 1); assertFinalSuccess(retryStats, 1); }
Source:
<code>public void addAggregators(@NotNull String metric, @NotNull SingleMetricAggregator[] aggregators, @NotNull String[] logicalMetricNames) { Preconditions.checkNotNull(metric, "metric"); Preconditions.checkNotNull(aggregators, "aggregators"); Preconditions.checkNotNull(logicalMetricNames, "logicalMetricNames"); Preconditions.checkArgument(aggregators.length == logicalMetricNames.length, "different length aggregators and" + <START> " logical names"); <END> addAggregatorsHelper(metric, aggregators, logicalMetricNames); }</code><technical_language>Avoid split string literal. previous line split comma</technical_language>

Target:
public void addAggregators(@NotNull String metric, @NotNull SingleMetricAggregator[] aggregators, @NotNull String[] logicalMetricNames) { Preconditions.checkNotNull(metric, "metric"); Preconditions.checkNotNull(aggregators, "aggregators"); Preconditions.checkNotNull(logicalMetricNames, "logicalMetricNames"); Preconditions.checkArgument(aggregators.length == logicalMetricNames.length, "different length aggregators and logical names"); addAggregatorsHelper(metric, aggregators, logicalMetricNames); }
Source:
<code>public void testRelativeSymlink() throws IOException, URISyntaxException { <START> assumeThat(System.getProperty("os.name"), not(containsString("Windows"))); <END> final Path tempDir = Files.createTempDirectory("ds3_file_object_rel_test_"); final Path tempPath = Files.createTempFile(tempDir, "temp_", ".txt"); try { try (final SeekableByteChannel channel = Files.newByteChannel(tempPath, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.WRITE)) { channel.write(ByteBuffer.wrap(testData)); } final Path symLinkPath = tempDir.resolve("sym_" + tempPath.getFileName().toString()); final Path relPath = Paths.get("..", getParentDir(tempPath), tempPath.getFileName().toString()); LOG.info("Creating symlink from " + symLinkPath.toString() + " to " + relPath.toString()); Files.createSymbolicLink(symLinkPath, relPath); getFileWithPutter(tempDir, symLinkPath); } finally { Files.deleteIfExists(tempPath); Files.deleteIfExists(tempDir); } }</code><technical_language>starting this windows check more often, create a util function for isWindows. I in cli</technical_language>

Target:
public void testRelativeSymlink() throws IOException, URISyntaxException { assumeFalse(Platform.isWindows()); final Path tempDir = Files.createTempDirectory("ds3_file_object_rel_test_"); final Path tempPath = Files.createTempFile(tempDir, "temp_", ".txt"); try { try (final SeekableByteChannel channel = Files.newByteChannel(tempPath, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.WRITE)) { channel.write(ByteBuffer.wrap(testData)); } final Path symLinkPath = tempDir.resolve("sym_" + tempPath.getFileName().toString()); final Path relPath = Paths.get("..", getParentDir(tempPath), tempPath.getFileName().toString()); LOG.info("Creating symlink from " + symLinkPath.toString() + " to " + relPath.toString()); Files.createSymbolicLink(symLinkPath, relPath); getFileWithPutter(tempDir, symLinkPath); } finally { Files.deleteIfExists(tempPath); Files.deleteIfExists(tempDir); } }
Source:
<code>public FormDefinitionImportService getService(ConfigurationType type) { switch (type) { case ODK: return formDefinitionImportServiceODK; case ONA: return formDefinitionImportServiceOna; case KOBO: return formDefinitionImportServiceKobo; default: <START> return null; <END> } }</code><technical_language>Another case of a suspect null return. sense return null? If this means fail next lines, throw some sort of a configuration exception IllegalStateException</technical_language>

Target:
public FormDefinitionImportService getService(ConfigurationType type) throws ConfigurationTypeException { switch (type) { case ODK: return formDefinitionImportServiceODK; case ONA: return formDefinitionImportServiceOna; case KOBO: return formDefinitionImportServiceKobo; default: throw new ConfigurationTypeException(NO_SERVICE + type); } }
Source:
<code>public String getText(Object element) { if (element instanceof EObject) { EObject eObject = (EObject) element; String text = getLabel(eObject); EObject container = eObject.eContainer(); <START> while (container != null) { text = getLabel(container) + DELIMITER + text; container = container.eContainer(); } <END> return text; } return wrappedProvider != null ? wrappedProvider.getText(element) : super.getText(element); }</code><technical_language>a StringBuilder, more a Joiner. - Also, top-level element. "Group" wrapper element root of a VSM is interseting show occupy some screen space useful path info</technical_language>

Target:
public String getText(Object element) { if (element instanceof EObject && handles((EObject) element)) { LinkedList<String> segments = Lists.newLinkedList(); for (EObject current = (EObject) element; current != null; current = current.eContainer()) { segments.addFirst(getLabel(current)); } return Joiner.on(getDelimiter()).join(segments); } return wrappedProvider != null ? wrappedProvider.getText(element) : super.getText(element); }
Source:
<code><START> public ESat isEntailed() { if (isCompletelyInstantiated()) { return ESat.eval(values[y.getLB()] <= x.getUB() && x.getLB() <= values[y.getUB()]); } return ESat.UNDEFINED; } <END></code><technical_language>method isEntailed() is coherent filtering. assure x values[y.getValue()-1] values[y.getValue()+1]</technical_language>

Target:
public ESat isEntailed() { if (isCompletelyInstantiated()) { int idx = y.getValue(); if(idx < 0 || idx >= values.length) { return ESat.FALSE; } return ESat.eval( (idx == 0 || values[idx-1] < x.getLB()) && x.getLB() <= values[idx] && values[idx] <= x.getUB() && (idx == values.length-1 || x.getUB() < values[idx+1]) ); } return ESat.UNDEFINED; }
Source:
<code>public void testEGetNullEObject() { assertEquals(null, eObjectServices.eGet(null, "query")); <START> } <END></code><technical_language>Remove useless assert</technical_language>

Target:
public void testEGetNullEObject() { eObjectServices.eGet(null, "query"); }
Source:
<code>private void readFile(ByteBuffer buffer) { try (FileInputStream fis = new FileInputStream(file); FileChannel channel = fis.getChannel()) { channel.position(offset); <START> channel.read(buffer); <END> } catch (IOException e) { throw new RuntimeException(e); } }</code><technical_language>For this purpose <LINK_0>, long) more efficient. is ok open/close time FileChannel read a chunk of it</technical_language>

Target:
private void readFile(ByteBuffer buffer) { try { fileChannel.read(buffer, offset); } catch (IOException e) { throw new RuntimeException(e); } }
Source:
<code>public int hashCode() { <START> return Objects.hash(hash); <END> }</code><technical_language>hash.hashcode()</technical_language>

Target:
public int hashCode() { return hash.hashCode(); }
Source:
<code>public void testInputValidation() { ______TS("input validation"); editPage.submitUnsuccessfully(null, "", null, null) .verifyStatus(Const.StatusMessages.FIELDS_EMPTY); String invalidStudentName = "invalidstudentnamewithmorethan40characters"; String newTeamName = "New teamname"; editPage.submitUnsuccessfully(invalidStudentName, newTeamName, null, null) .verifyStatus(Const.StatusMessages.COURSE_STUDENTNAME_INVALID); String newStudentName = "New guy"; <START> String invalidTeamName = "invalidteamnamewithmorethan60characterslooooooooooooooooooong"; <END> editPage.submitUnsuccessfully(newStudentName, invalidTeamName, null, null) .verifyStatus(Const.StatusMessages.COURSE_TEAMNAME_INVALID); String invalidEmail = "invalidemail"; editPage.submitUnsuccessfully(newStudentName, newTeamName, invalidEmail, null) .verifyStatus(Const.StatusMessages.COURSE_EMAIL_INVALID); }</code><technical_language>StringHelper.generateStringOfLength(FieldValidator.COURSE_VAR_MAX_LENGTH + 1) here</technical_language>

Target:
public void testInputValidation() { ______TS("input validation"); editPage.submitUnsuccessfully(null, "", null, null) .verifyStatus(Const.StatusMessages.FIELDS_EMPTY); String invalidStudentName = StringHelper.generateStringOfLength(FieldValidator.COURSE_STUDENTNAME_MAX_LENGTH + 1); String newTeamName = "New teamname"; editPage.submitUnsuccessfully(invalidStudentName, newTeamName, null, null) .verifyStatus(Const.StatusMessages.COURSE_STUDENTNAME_INVALID); String newStudentName = "New guy"; String invalidTeamName = StringHelper.generateStringOfLength(FieldValidator.COURSE_TEAMNAME_MAX_LENGTH + 1); editPage.submitUnsuccessfully(newStudentName, invalidTeamName, null, null) .verifyStatus(Const.StatusMessages.COURSE_TEAMNAME_INVALID); String invalidEmail = "invalidemail"; editPage.submitUnsuccessfully(newStudentName, newTeamName, invalidEmail, null) .verifyStatus(Const.StatusMessages.COURSE_EMAIL_INVALID); }