auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public CombinedConfiguration loadDefaultConfiguration() throws ConfigurationException { final URL configUrl; <START> String name = System.getProperty(CONFIG_URL); <END> if (name != null) { try { configUrl = new URL(name); } catch (MalformedURLException e) { throw new ConfigurationException("Invalid value of '" + name + "' for '" + CONFIG_URL + "'. Must be a valid URL."); } } else { File configFile = new File(configDir, "ambra.xml"); try { configUrl = configFile.toURI().toURL(); } catch (MalformedURLException e) { throw new RuntimeException(e); } } return loadConfiguration(configUrl); }</code><technical_language>Please rename name more meaningful</technical_language>

Target:
public CombinedConfiguration loadDefaultConfiguration() throws ConfigurationException { final URL configUrl; String configUrlProperty = System.getProperty(CONFIG_URL_PROPERTY_NAME); if (configUrlProperty != null) { try { configUrl = new URL(configUrlProperty); } catch (MalformedURLException e) { throw new ConfigurationException("Invalid value of '" + configUrlProperty + "' for '" + CONFIG_URL_PROPERTY_NAME + "'. Must be a valid URL."); } } else { File configFile = new File(configDir, "ambra.xml"); try { configUrl = configFile.toURI().toURL(); } catch (MalformedURLException e) { throw new RuntimeException(e); } } return loadConfiguration(configUrl); }
Source:
<code>public Consumer createConsumer(Processor processor) throws Exception { <START> return new TelegramConsumer(this, processor); <END> }</code><technical_language>Remember call configureConsumer(answer); is needed, other components</technical_language>

Target:
public Consumer createConsumer(Processor processor) throws Exception { TelegramConsumer consumer = new TelegramConsumer(this, processor); configureConsumer(consumer); return consumer; }
Source:
<code>public void loadCommand(HttpServletRequest request, HttpSession session) { try { this.validate(); scheme = request.getScheme(); serverPort = request.getServerPort(); serverName = request.getServerName(); contextPath = request.getContextPath(); isSecure = request.isSecure(); String coreAsString = request.getParameter("idCoreFacility"); if (coreAsString != null && coreAsString.length() > 0) { try { idCoreFacility = Integer.valueOf(coreAsString); } catch(NumberFormatException ex) { idCoreFacility = null; } } else { idCoreFacility = null; } } catch (Exception e) { log.error(e.getClass().toString() + ": " , e); <START> e.printStackTrace(); <END> } }</code><technical_language>This is necessary generally a bad practice, especially in production code</technical_language>

Target:
public void loadCommand(HttpServletRequest request, HttpSession session) { try { this.validate(); scheme = request.getScheme(); serverPort = request.getServerPort(); serverName = request.getServerName(); contextPath = request.getContextPath(); isSecure = request.isSecure(); String coreAsString = request.getParameter("idCoreFacility"); if (coreAsString != null && coreAsString.length() > 0) { try { idCoreFacility = Integer.valueOf(coreAsString); } catch(NumberFormatException ex) { idCoreFacility = null; } } else { idCoreFacility = null; } } catch (Exception e) { LOG.error(e.getClass().toString() + ": " , e); } }
Source:
<code>private void processTuple(Object in) { if (!inputClass.isAssignableFrom(in.getClass())) { throw new RuntimeException( "Unexpected tuple received. Received class: " + in.getClass() + ". Expected class: " + inputClass.getClass()); } Object out; try { out = outputClass.newInstance(); } catch (InstantiationException | IllegalAccessException e) { throw new RuntimeException("Failed to create new object", e); } for (Map.Entry<PojoUtils.Setter, Expression> entry : transformationMap.entrySet()) { PojoUtils.Setter set = entry.getKey(); Expression expr = entry.getValue(); set.set(out, expr.execute(in)); <START> } <END> output.emit(out); }</code><technical_language>Is default Identity function? For example: If input POJO a, b fields output POJO a,b,c expression is defined for c = a+b. output.a=input.a output.b=input.b auto-set. This overridden a = a-b</technical_language>

Target:
protected void processTuple(Object in) { if (!inputClass.isAssignableFrom(in.getClass())) { throw new RuntimeException( "Unexpected tuple received. Received class: " + in.getClass() + ". Expected class: " + inputClass.getClass()); } Object out; try { out = outputClass.newInstance(); } catch (InstantiationException | IllegalAccessException e) { throw new RuntimeException("Failed to create new object", e); } for (Map.Entry<PojoUtils.Setter, Expression> entry : transformationMap.entrySet()) { PojoUtils.Setter set = entry.getKey(); Expression expr = entry.getValue(); set.set(out, expr.execute(in)); } output.emit(out); }
Source:
<code>public ActionResult execute() throws EntityNotFoundException { try { Part image = extractProfilePicture(); <START> byte[] imageData = new byte[(int) image.getSize()]; <END> try (InputStream is = image.getInputStream()) { is.read(imageData); } String pictureKey = GoogleCloudStorageHelper.writeImageDataToGcs(userInfo.id, imageData); logic.updateStudentProfilePicture(userInfo.id, pictureKey); PostStudentProfileResults dataFormat = new PostStudentProfileResults(Const.StatusMessages.STUDENT_PROFILE_PICTURE_SAVED, pictureKey); return new JsonResult(dataFormat); } catch (IllegalArgumentException | IOException e) { return new JsonResult(e.getMessage(), HttpStatus.SC_BAD_REQUEST); } }</code><technical_language>Potential NPE if image is null</technical_language>

Target:
public ActionResult execute() { try { Part image = req.getPart("studentprofilephoto"); if (image == null) { throw new InvalidHttpRequestBodyException(Const.StatusMessages.STUDENT_PROFILE_NO_PICTURE_GIVEN); } if (image.getSize() > Const.SystemParams.MAX_PROFILE_PIC_SIZE) { throw new InvalidHttpRequestBodyException(Const.StatusMessages.STUDENT_PROFILE_PIC_TOO_LARGE); } if (!image.getContentType().startsWith("image/")) { throw new InvalidHttpRequestBodyException(Const.StatusMessages.STUDENT_PROFILE_NOT_A_PICTURE); } byte[] imageData = new byte[(int) image.getSize()]; try (InputStream is = image.getInputStream()) { is.read(imageData); } String pictureKey = GoogleCloudStorageHelper.writeImageDataToGcs(userInfo.id, imageData); logic.updateOrCreateStudentProfile( StudentProfileAttributes.updateOptionsBuilder(userInfo.id) .withPictureKey(pictureKey) .build()); StudentProfilePictureResults dataFormat = new StudentProfilePictureResults(pictureKey); return new JsonResult(dataFormat); } catch (InvalidParametersException ipe) { throw new InvalidHttpRequestBodyException(ipe.getMessage(), ipe); } catch (ServletException | IOException e) { return new JsonResult(e.getMessage(), HttpStatus.SC_INTERNAL_SERVER_ERROR); } }
Source:
<code>private static void wait(WaitForEnum waitFor) throws BlockStoreException { final CountDownLatch latch = new CountDownLatch(1); setup(); switch (waitFor) { case EVER: break; case WALLET_TX: wallet.addEventListener(new AbstractWalletEventListener() { private void handleTx(Transaction tx) { System.out.println(tx.getHashAsString()); latch.countDown(); } @Override public void onCoinsReceived(Wallet wallet, Transaction tx, Coin prevBalance, Coin newBalance) { super.onCoinsReceived(wallet, tx, prevBalance, newBalance); handleTx(tx); } @Override public void onCoinsSent(Wallet wallet, Transaction tx, Coin prevBalance, Coin newBalance) { super.onCoinsSent(wallet, tx, prevBalance, newBalance); handleTx(tx); } }); break; case BLOCK: peers.addDataEventListener(new AbstractPeerDataEventListener() { @Override <START> public void onBlocksDownloaded(Peer peer, AbstractBlockHeader block, int blocksLeft) { <END> if (latch.getCount() == 0) return; System.out.println(block.getHashAsString()); latch.countDown(); } }); break; case BALANCE: if (condition.matchBitcoins(wallet.getBalance(Wallet.BalanceType.ESTIMATED))) { latch.countDown(); break; } wallet.addEventListener(new AbstractWalletEventListener() { @Override public synchronized void onChange() { super.onChange(); saveWallet(walletFile); Coin balance = wallet.getBalance(Wallet.BalanceType.ESTIMATED); if (condition.matchBitcoins(balance)) { System.out.println(balance.toFriendlyString()); latch.countDown(); } } }); break; } if (!peers.isRunning()) peers.startAsync(); try { latch.await(); } catch (InterruptedException e) { } }</code><technical_language>I notice places, drop @Nullable. Why</technical_language>

Target:
private static void wait(WaitForEnum waitFor) throws BlockStoreException { final CountDownLatch latch = new CountDownLatch(1); setup(); switch (waitFor) { case EVER: break; case WALLET_TX: wallet.addCoinsReceivedEventListener(new WalletCoinsReceivedEventListener() { @Override public void onCoinsReceived(Wallet wallet, Transaction tx, Coin prevBalance, Coin newBalance) { System.out.println(tx.getHashAsString()); latch.countDown(); } }); wallet.addCoinsSentEventListener(new WalletCoinsSentEventListener() { @Override public void onCoinsSent(Wallet wallet, Transaction tx, Coin prevBalance, Coin newBalance) { System.out.println(tx.getHashAsString()); latch.countDown(); } }); break; case BLOCK: peers.addBlocksDownloadedEventListener(new BlocksDownloadedEventListener() { @Override public void onBlocksDownloaded(Peer peer, AbstractBlock block, int blocksLeft) { if (latch.getCount() == 0) return; System.out.println(block.getHashAsString()); latch.countDown(); } }); break; case BALANCE: if (condition.matchBitcoins(wallet.getBalance(Wallet.BalanceType.ESTIMATED))) { latch.countDown(); break; } final WalletEventListener listener = new WalletEventListener(latch); wallet.addCoinsReceivedEventListener(listener); wallet.addCoinsSentEventListener(listener); wallet.addChangeEventListener(listener); wallet.addReorganizeEventListener(listener); break; } if (!peers.isRunning()) peers.startAsync(); try { latch.await(); } catch (InterruptedException e) { } }
Source:
<code><START> public int addVariableValue(String value){ <END> variableValues.add(value); return (variableValues.size() - 1); }</code><technical_language>this default</technical_language>

Target:
int addVariableValue(String value){ variableValues.add(value); return (variableValues.size() - 1); }
Source:
<code>public QuartzSchedulerService(ZeppelinConfiguration zeppelinConfiguration, Notebook notebook) throws SchedulerException { this.zeppelinConfiguration = zeppelinConfiguration; this.notebook = notebook; this.scheduler = new StdSchedulerFactory().getScheduler(); this.scheduler.start(); <START> Thread loadingNotesThread = new Thread(){ <END> @Override public void run() { LOGGER.info("Starting init cronjobs"); notebook.getNotesInfo().stream() .forEach(entry -> refreshCron(entry.getId())); LOGGER.info("Complete init cronjobs"); } }; loadingNotesThread.setName("Init CronJob Thread"); loadingNotesThread.setDaemon(true); loadingNotesThread.start(); }</code><technical_language>easier write lambda syntax () -> ...</technical_language>

Target:
public QuartzSchedulerService(ZeppelinConfiguration zeppelinConfiguration, Notebook notebook) throws SchedulerException { this.zeppelinConfiguration = zeppelinConfiguration; this.notebook = notebook; this.scheduler = new StdSchedulerFactory().getScheduler(); this.scheduler.start(); Thread loadingNotesThread = new Thread(() -> { LOGGER.info("Starting init cronjobs"); notebook.getNotesInfo().stream() .forEach(entry -> refreshCron(entry.getId())); LOGGER.info("Complete init cronjobs"); }); loadingNotesThread.setName("Init CronJob Thread"); loadingNotesThread.setDaemon(true); loadingNotesThread.start(); }
Source:
<code>public static Set<DistributionModuleGroup> getModuleGroups() { Set<DistributionModuleGroup> hs = new HashSet<>(); hs.add(new DistributionModuleGroup(EMR5150Constant.SQOOP_MODULE_GROUP.getModuleName())); hs.add(new DistributionModuleGroup(EMR5150Constant.MAPREDUCE_MODULE_GROUP.getModuleName())); hs.add(new DistributionModuleGroup(EMR5150Constant.HDFS_MODULE_GROUP.getModuleName())); ComponentCondition parquetOutputCondition = <START> new SimpleComponentCondition(new BasicExpression(SqoopConstant.FILE_FORMAT, EqualityOperator.NOT_EQ, <END> SqoopConstant.AVRO_OUTPUT_FORMAT)); hs.add(new DistributionModuleGroup(EMR5150Constant.SQOOP_PARQUET_MODULE_GROUP.getModuleName(), true, parquetOutputCondition)); ComponentCondition avroOutputCondition = new SimpleComponentCondition(new BasicExpression(SqoopConstant.FILE_FORMAT, EqualityOperator.EQ, SqoopConstant.AVRO_OUTPUT_FORMAT)); hs.add(new DistributionModuleGroup(EMR5150Constant.SQOOP_AVRO_MODULE_GROUP.getModuleName(), true, avroOutputCondition)); return hs; }</code><technical_language>changed condition equal PARQUET equal AVRO. Is equivalent. other txt formats</technical_language>

Target:
public static Set<DistributionModuleGroup> getModuleGroups() { Set<DistributionModuleGroup> hs = new HashSet<>(); hs.add(new DistributionModuleGroup(EMR5150Constant.SQOOP_MODULE_GROUP.getModuleName())); hs.add(new DistributionModuleGroup(EMR5150Constant.MAPREDUCE_MODULE_GROUP.getModuleName())); hs.add(new DistributionModuleGroup(EMR5150Constant.HDFS_MODULE_GROUP.getModuleName())); ComponentCondition parquetOutputCondition = new SimpleComponentCondition(new BasicExpression(SqoopConstant.FILE_FORMAT, EqualityOperator.EQ, SqoopConstant.PAQUET_OUTPUT_FORMAT)); hs.add(new DistributionModuleGroup(EMR5150Constant.SQOOP_PARQUET_MODULE_GROUP.getModuleName(), true, parquetOutputCondition)); ComponentCondition textOutputCondition = new SimpleComponentCondition(new BasicExpression(SqoopConstant.FILE_FORMAT, EqualityOperator.EQ, SqoopConstant.TEXT_OUTPUT_FORMAT)); hs.add(new DistributionModuleGroup(EMR5150Constant.SQOOP_TEXT_MODULE_GROUP.getModuleName(), true, textOutputCondition)); ComponentCondition sequenceOutputCondition = new SimpleComponentCondition(new BasicExpression(SqoopConstant.FILE_FORMAT, EqualityOperator.EQ, SqoopConstant.SEQUENCE_OUTPUT_FORMAT)); hs.add(new DistributionModuleGroup(EMR5150Constant.SQOOP_SEQUENCE_MODULE_GROUP.getModuleName(), true, sequenceOutputCondition)); ComponentCondition avroOutputCondition = new SimpleComponentCondition(new BasicExpression(SqoopConstant.FILE_FORMAT, EqualityOperator.EQ, SqoopConstant.AVRO_OUTPUT_FORMAT)); hs.add(new DistributionModuleGroup(EMR5150Constant.SQOOP_AVRO_MODULE_GROUP.getModuleName(), true, avroOutputCondition)); return hs; }
Source:
<code>public int prepare(Xid xid) throws XAException { <START> log.infof("prepare xid: [%s]", xid); <END> return prepareReturnValue; }</code><technical_language>tracef</technical_language>

Target:
public int prepare(Xid xid) throws XAException { log.tracef("prepare xid: [%s]", xid); return prepareReturnValue; }
Source:
<code>public static synchronized void doSetup() throws Exception { <START> Map<String, String> props = Maps.newHashMapWithExpectedSize(1); <END> props.put(QueryServices.GLOBAL_INDEX_ROW_AGE_THRESHOLD_TO_DELETE_MS_ATTRIB, Long.toString(0)); props.put(ScanInfoUtil.PHOENIX_MAX_LOOKBACK_AGE_CONF_KEY, Integer.toString(MAX_LOOKBACK)); setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator())); }</code><technical_language>consider expected size = 2</technical_language>

Target:
public static synchronized void doSetup() throws Exception { Map<String, String> props = Maps.newHashMapWithExpectedSize(2); props.put(QueryServices.GLOBAL_INDEX_ROW_AGE_THRESHOLD_TO_DELETE_MS_ATTRIB, Long.toString(0)); props.put(ScanInfoUtil.PHOENIX_MAX_LOOKBACK_AGE_CONF_KEY, Integer.toString(MAX_LOOKBACK)); setUpTestDriver(new ReadOnlyProps(props.entrySet().iterator())); }
Source:
<code>GitHub(String apiUrl, String login, String oauthAccessToken, String password, HttpConnector connector, RateLimitHandler rateLimitHandler) throws IOException { if (apiUrl.endsWith("/")) apiUrl = apiUrl.substring(0, apiUrl.length()-1); this.apiUrl = apiUrl; if (null != connector) this.connector = connector; if (oauthAccessToken!=null) { encodedAuthorization = "token "+oauthAccessToken; } else { if (password!=null) { String authorization = (login + ':' + password); <START> final Charset charset = Charset.defaultCharset(); <END> encodedAuthorization = "Basic "+new String(Base64.encodeBase64(authorization.getBytes(charset)), charset); } else { encodedAuthorization = null; } } this.rateLimitHandler = rateLimitHandler; if (login==null && encodedAuthorization!=null) login = getMyself().getLogin(); this.login = login; }</code><technical_language>@lanwen same</technical_language>

Target:
GitHub(String apiUrl, String login, String oauthAccessToken, String password, HttpConnector connector, RateLimitHandler rateLimitHandler) throws IOException { if (apiUrl.endsWith("/")) apiUrl = apiUrl.substring(0, apiUrl.length()-1); this.apiUrl = apiUrl; if (null != connector) this.connector = connector; if (oauthAccessToken!=null) { encodedAuthorization = "token "+oauthAccessToken; } else { if (password!=null) { String authorization = (login + ':' + password); final Charset charset; try { charset = Charset.forName("UTF-8"); } catch (Exception ex) { throw new IOException("UTF-8 encoding is not supported", ex); } encodedAuthorization = "Basic "+new String(Base64.encodeBase64(authorization.getBytes(charset)), charset); } else { encodedAuthorization = null; } } this.rateLimitHandler = rateLimitHandler; if (login==null && encodedAuthorization!=null) login = getMyself().getLogin(); this.login = login; }
Source:
<code>private void createAndRegisterListener(RemoteCache<K, V> remote) { if (config.mode().invalidated()) { listener = new SmartInvalidatedNearCacheListener<>(this, remote.getRemoteCacheManager().getMarshaller()); try { remote.addClientListener(listener); } catch (HotRodClientException e) { listener = new InvalidatedNearCacheListener<>(this); remote.addClientListener(listener); } } else { <START> listener = new EagerNearCacheListener(this, remote.getRemoteCacheManager().getMarshaller()); <END> remote.addClientListener(listener); } }</code><technical_language>NearCacheMode.EAGER removed, remove this</technical_language>

Target:
private void createAndRegisterListener(RemoteCache<K, V> remote) { listener = new KeyOnlyInvalidatedNearCacheListener<>(this, remote.getRemoteCacheManager().getMarshaller()); try { remote.addClientListener(listener); } catch (HotRodClientException e) { listener = new InvalidatedNearCacheListener<>(this); remote.addClientListener(listener); } }
Source:
<code>protected void handleMessage(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessage responseMessage, final OsgpException osgpException) throws FunctionalException { <START> this.installationService.handleCoupleMbusDeviceResponse(deviceMessageMetadata, <END> (MbusChannelElementsResponseDto) responseMessage.getDataObject()); }</code><technical_language>call method in MBusGatewayService</technical_language>

Target:
protected void handleMessage(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessage responseMessage, final OsgpException osgpException) throws FunctionalException { this.installationService.handleCoupleMbusDeviceResponse(deviceMessageMetadata, responseMessage.getResult(), responseMessage.getOsgpException(), (MbusChannelElementsResponseDto) responseMessage.getDataObject()); }
Source:
<code>public Set<ServiceDependency> getUnfulfilledDependencies(String[] types) { Set<ServiceDependency> ret = new LinkedHashSet<ServiceDependency>(); for (String type : types) { if (!type.contains(".")) { type = String.format("org.myrobotlab.service.%s", type); } ServiceData sd = ServiceData.getLocalInstance(); if (!sd.containsServiceType(type)) { log.error("{} not found", type); return ret; } <START> MetaData st = sd.getServiceType(type); <END> List<ServiceDependency> metaDependencies = st.getDependencies(); if (metaDependencies != null && metaDependencies.size() > 0) { for (ServiceDependency library : metaDependencies) { if (!installedLibraries.containsKey(library.toString())) { ret.add(library); } else { log.debug("previously installed - {}", library); } } } Map<String, ServiceReservation> peers = st.getPeers(); if (peers != null) { for (String key : peers.keySet()) { ServiceReservation sr = peers.get(key); ret.addAll(getUnfulfilledDependencies(CodecUtils.makeFullTypeName(sr.type))); } } } return ret; }</code><technical_language>method name for getServiceType renamed? return a ServiceType anymore</technical_language>

Target:
public Set<ServiceDependency> getUnfulfilledDependencies(String[] types) { Set<ServiceDependency> ret = new LinkedHashSet<ServiceDependency>(); for (String type : types) { if (!type.contains(".")) { type = String.format("org.myrobotlab.service.%s", type); } ServiceData sd = ServiceData.getLocalInstance(); if (!sd.containsServiceType(type)) { log.error("{} not found", type); return ret; } MetaData st = ServiceData.getMetaData(type); List<ServiceDependency> metaDependencies = st.getDependencies(); if (metaDependencies != null && metaDependencies.size() > 0) { for (ServiceDependency library : metaDependencies) { if (!installedLibraries.containsKey(library.toString())) { ret.add(library); } else { log.debug("previously installed - {}", library); } } } Map<String, ServiceReservation> peers = st.getPeers(); if (peers != null) { for (String key : peers.keySet()) { ServiceReservation sr = peers.get(key); ret.addAll(getUnfulfilledDependencies(CodecUtils.makeFullTypeName(sr.type))); } } } return ret; }
Source:
<code>static boolean runningOnComputeEngine( <START> HttpTransportFactory transportFactory, DefaultCredentialsProvider provider) { <END> if (Boolean.parseBoolean(provider.getEnv("NO_GCE_CHECK"))) { return false; } GenericUrl tokenUrl = new GenericUrl(getMetadataServerUrl(provider)); for (int i = 1; i <= MAX_COMPUTE_PING_TRIES; ++i) { try { HttpRequest request = transportFactory.create().createRequestFactory().buildGetRequest(tokenUrl); request.setConnectTimeout(COMPUTE_PING_CONNECTION_TIMEOUT_MS); HttpResponse response = request.execute(); try { HttpHeaders headers = response.getHeaders(); return OAuth2Utils.headersContainValue(headers, "Metadata-Flavor", "Google"); } finally { response.disconnect(); } } catch (SocketTimeoutException expected) { } catch (IOException e) { LOGGER.log( Level.WARNING, "Failed to detect whether we are running on Google Compute Engine.", e); } } return false; }</code><technical_language>Do want pass in a DefaultCredentialsProvider perform env lookup?, simpler suffice instead of tying classes together</technical_language>

Target:
static boolean runningOnComputeEngine( HttpTransportFactory transportFactory, DefaultCredentialsProvider provider) { if (Boolean.parseBoolean(provider.getEnv(DefaultCredentialsProvider.NO_GCE_CHECK_ENV_VAR))) { return false; } GenericUrl tokenUrl = new GenericUrl(getMetadataServerUrl(provider)); for (int i = 1; i <= MAX_COMPUTE_PING_TRIES; ++i) { try { HttpRequest request = transportFactory.create().createRequestFactory().buildGetRequest(tokenUrl); request.setConnectTimeout(COMPUTE_PING_CONNECTION_TIMEOUT_MS); HttpResponse response = request.execute(); try { HttpHeaders headers = response.getHeaders(); return OAuth2Utils.headersContainValue(headers, "Metadata-Flavor", "Google"); } finally { response.disconnect(); } } catch (SocketTimeoutException expected) { } catch (IOException e) { LOGGER.log( Level.WARNING, "Failed to detect whether we are running on Google Compute Engine.", e); } } return false; }
Source:
<code>public void testLockCreationWhenPartitionHappening() throws Throwable { ClusteredLockManager clusteredLockManager = EmbeddedClusteredLockManagerFactory.from(getCacheManagers().get(0)); await(clusteredLockManager.remove(LOCK_NAME)); splitCluster(new int[]{0, 1, 2}, new int[]{3, 4, 5}); for (int i = 0; i < 6; i++) { int finalI = i; <START> eventuallyEquals(3, () -> advancedCache(finalI).getRpcManager().getTransport().getMembers().size()); <END> } for (EmbeddedCacheManager cm : getCacheManagers()) { ClusteredLockManager clm = EmbeddedClusteredLockManagerFactory.from(cm); eventually(() -> availabilityExceptionRaised(clm)); } }</code><technical_language>This is basically TestingUtil.blockUntilViewReceived(long, Cache...) does</technical_language>

Target:
public void testLockCreationWhenPartitionHappening() throws Throwable { ClusteredLockManager clusteredLockManager = EmbeddedClusteredLockManagerFactory.from(getCacheManagers().get(0)); await(clusteredLockManager.remove(LOCK_NAME)); splitCluster(new int[]{0, 1, 2}, new int[]{3, 4, 5}); for (EmbeddedCacheManager cm : getCacheManagers()) { ClusteredLockManager clm = EmbeddedClusteredLockManagerFactory.from(cm); eventually(() -> availabilityExceptionRaised(clm)); } }
Source:
<code>public void createSection(Composite parent) { super.createSection(parent); this.dbc = new DataBindingContext(); this.formPresenterSupport = new FormPresenterSupport( new FormEditorPresenter(getManagedForm().getForm().getForm()), dbc); FormToolkit toolkit = new FormToolkit(parent.getDisplay()); this.model = new OpenShiftServerEditorModel(server, this, null); Section section = toolkit.createSection(parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED | ExpandableComposite.TITLE_BAR); section.setText("OpenShift Server Adapter"); GridDataFactory.fillDefaults() .align(SWT.FILL, SWT.FILL).grab(true, true) .applyTo(section); Composite container = createControls(toolkit, section, dbc); GridDataFactory.fillDefaults() .align(SWT.FILL, SWT.FILL).grab(true, true) .applyTo(container); toolkit.paintBordersFor(container); toolkit.adapt(container); GridDataFactory.fillDefaults() .align(SWT.FILL, SWT.FILL).grab(true, true) .applyTo(container); section.setClient(container); IObservableValue<Boolean> dirtyStatusObservable = DataBindingUtils.createDirtyStatusObservable(getServerEditor()); dbc.addValidationStatusProvider(new MultiValidator() { @Override protected IStatus validate() { <START> if (Boolean.TRUE.equals(dirtyStatusObservable.getValue())) { <END> return ValidationStatus.warning( "Saved changes to the server adapter will only get active once the adapter is restarted."); } return ValidationStatus.ok(); } }); loadResources(section, model, dbc); dbc.updateTargets(); }</code><technical_language>if (dirtyStatusObservable.getValue()) {</technical_language>

Target:
public void createSection(Composite parent) { super.createSection(parent); this.dbc = new DataBindingContext(); this.formPresenterSupport = new FormPresenterSupport( new FormEditorPresenter(getManagedForm().getForm().getForm()), dbc); FormToolkit toolkit = new FormToolkit(parent.getDisplay()); this.model = new OpenShiftServerEditorModel(server, this, null); Section section = toolkit.createSection(parent, ExpandableComposite.TWISTIE | ExpandableComposite.EXPANDED | ExpandableComposite.TITLE_BAR); section.setText("OpenShift Server Adapter"); GridDataFactory.fillDefaults() .align(SWT.FILL, SWT.FILL).grab(true, true) .applyTo(section); Composite container = createControls(toolkit, section, dbc); GridDataFactory.fillDefaults() .align(SWT.FILL, SWT.FILL).grab(true, true) .applyTo(container); toolkit.paintBordersFor(container); toolkit.adapt(container); GridDataFactory.fillDefaults() .align(SWT.FILL, SWT.FILL).grab(true, true) .applyTo(container); section.setClient(container); setupWarningToRestartAdapter(getServerEditor()); loadResources(section, model, dbc); dbc.updateTargets(); }
Source:
<code>public static URLClassLoader urlClassLoaderFromPaths(ClassLoader parent, Collection<Path> paths) { Assert.notNull(paths, "paths collection cannot be null"); final URL[] urls; try { final URI[] uris = paths.stream().map(Path::toUri).toArray(size -> new URI[size]); urls = new URL[uris.length]; for (int i = 0; i < uris.length; i++) { urls[i] = uris[i].toURL(); } } catch (IOException e) { <START> throw new RuntimeException(e); <END> } return new URLClassLoader(urls, parent); }</code><technical_language>I UndeclaredThrowableException in similar cases</technical_language>

Target:
public static URLClassLoader urlClassLoaderFromPaths(ClassLoader parent, Collection<Path> paths) { Assert.notNull(paths, "paths collection cannot be null"); final URL[] urls; try { final URI[] uris = paths.stream().map(Path::toUri).toArray(size -> new URI[size]); urls = new URL[uris.length]; for (int i = 0; i < uris.length; i++) { urls[i] = uris[i].toURL(); } } catch (IOException e) { throw new UndeclaredThrowableException(e); } return new URLClassLoader(urls, parent); }
Source:
<code>public WorkbookParser(WorkbookParserSettings settings, Context context, Workbook workbook, String offsetId ) throws DataParserException { this.settings = requireNonNull(settings); this.context = requireNonNull(context); this.workbook = requireNonNull(workbook); this.rowIterator = iterate(this.workbook); this.offset = requireNonNull(offsetId); if (!rowIterator.hasNext()) { throw new DataParserException(Errors.EXCEL_PARSER_04); } switch (settings.getHeader()) { case WITH_HEADER: <START> rowIterator.next(); <END> headers = new HashMap<>(); for (Sheet sheet : workbook) { List<Field> sheetHeaders = new ArrayList<>(); Row headerRow = sheet.getRow(0); for (Cell cell : headerRow) { sheetHeaders.add(Cells.parseCell(cell)); } headers.put(sheet.getSheetName(), sheetHeaders); } break; case IGNORE_HEADER: Row ignored = rowIterator.next(); headers = new HashMap<>(); break; case NO_HEADER: headers = new HashMap<>(); break; } Offsets.parse(offsetId).ifPresent(offset -> { String startSheetName = offset.getSheetName(); int startRowNum = offset.getRowNum(); while (rowIterator.hasNext()) { Row row = rowIterator.next(); int rowNum = row.getRowNum(); String sheetName = row.getSheet().getSheetName(); if (startSheetName.equals(sheetName) && rowNum == startRowNum) { if (rowIterator.hasPrevious()) { rowIterator.previous(); } break; } } }); }</code><technical_language>do headerRow = rowIterator.next() here, instead of advancing iterator (and ignoring result), fetching sheet.getRow(0) call below</technical_language>

Target:
public WorkbookParser(WorkbookParserSettings settings, Context context, Workbook workbook, String offsetId ) throws DataParserException { this.settings = requireNonNull(settings); this.context = requireNonNull(context); this.workbook = requireNonNull(workbook); this.rowIterator = iterate(this.workbook); this.offset = requireNonNull(offsetId); this.evaluator = workbook.getCreationHelper().createFormulaEvaluator(); if (!rowIterator.hasNext()) { throw new DataParserException(Errors.EXCEL_PARSER_04); } headers = new HashMap<>(); if (settings.getHeader() != NO_HEADER) { rowIterator.next(); } if (settings.getHeader() == WITH_HEADER) { for (Sheet sheet : workbook) { List<Field> sheetHeaders = new ArrayList<>(); Row headerRow = sheet.getRow(0); if (headerRow == null) { throw new DataParserException(Errors.EXCEL_PARSER_07, sheet.getSheetName()); } for (Cell cell : headerRow) { try { sheetHeaders.add(Cells.parseCell(cell, this.evaluator)); } catch (ExcelUnsupportedCellTypeException e) { throw new DataParserException(Errors.EXCEL_PARSER_05, cell.getCellTypeEnum()); } } headers.put(sheet.getSheetName(), sheetHeaders); } } Offsets.parse(offsetId).ifPresent(offset -> { String startSheetName = offset.getSheetName(); int startRowNum = offset.getRowNum(); while (rowIterator.hasNext()) { Row row = rowIterator.next(); int rowNum = row.getRowNum(); String sheetName = row.getSheet().getSheetName(); if (startSheetName.equals(sheetName) && rowNum == startRowNum) { if (rowIterator.hasPrevious()) { rowIterator.previous(); } break; } } }); }
Source:
<code>public void halt() throws InterruptedException { for (;;) { join(250 ); if (isAlive()) { done = true; interrupt(); if (process != null) { process.destroy(); } <START> } else <END> break; } }</code><technical_language>add braces in this other branch of if statement</technical_language>

Target:
public void halt() throws InterruptedException { for (;;) { join(250 ); if (isAlive()) { done = true; interrupt(); } else { break; } } }
Source:
<code>private VaultToken initialToken() { final Client vgm = factory.newClient("vgm", StandardFeatureGroup.PLATFORM_INTERNAL); try { final VgmTokenResponse response = vgm.target(vgmTokenUri) .request(MediaType.APPLICATION_JSON) .post(Entity.json(Collections.singletonMap("task_id", appInfo.getTaskId())), VgmTokenResponse.class); LOG.info("VGM response: status '{}' token '{}'", response.isOk() ? "success" : "FAILURE", response.getStatus(), response.getToken()); return VaultToken.of(response.getToken()); } catch (WebApplicationException e) { final Response r = e.getResponse(); LOG.error("VGM cubbyhole authentication failure: {}", r.getStatusInfo(), r.readEntity(String.class)); return VaultToken.of("invalid"); } catch (ProcessingException e) { LOG.error("VGM cubbyhole authentication failure", e); return VaultToken.of("invalid"); <START> } finally { <END> vgm.close(); } }</code><technical_language>a Closeable wrapper in this configuration class</technical_language>

Target:
private VaultToken initialToken() { final Client vgm = factory.newClient("vgm", StandardFeatureGroup.PLATFORM_INTERNAL); try { final VgmTokenResponse response = vgm.target(vgmTokenUri) .request(MediaType.APPLICATION_JSON) .post(Entity.json(Collections.singletonMap("task_id", appInfo.getTaskId())), VgmTokenResponse.class); LOG.info("VGM response: status '{}' token '{}'", response.isOk() ? "success" : "FAILURE", response.getStatus(), response.getToken()); return VaultToken.of(response.getToken()); } catch (WebApplicationException e) { final Response r = e.getResponse(); LOG.error("VGM cubbyhole authentication failure: {}", r.getStatusInfo(), r.readEntity(String.class)); return VaultToken.of("invalid"); } catch (Exception e) { LOG.error("VGM cubbyhole authentication failure", e); return VaultToken.of("invalid"); } finally { vgm.close(); } }
Source:
<code>protected long getTime(Object event) { if (getter == null) { Class<?> fqcn = event.getClass(); Getter<Object, Date> getterTime = PojoUtils.createGetter(fqcn, timeExpression, Date.class); <START> getter = getterTime; <END> } return ((Date)getter.get(event)).getTime(); }</code><technical_language>done start processing event</technical_language>

Target:
protected long getTime(Object event) { return ((Date)getter.get(event)).getTime(); }
Source:
<code>public String toString() { <START> return getName() + ": " + conditions.stream().map(Condition::toString).collect(joining(" or ")); <END> }</code><technical_language>introduce a new variable complex stream operation string format for a final message</technical_language>

Target:
public String toString() { String conditionsToString = conditions.stream().map(Condition::toString).collect(joining(" or ")); return String.format("%s: %s", getName(), conditionsToString); }
Source:
<code>private void applyRefactoring(RefactoringSession session) { eventBus.fireEvent(new FileTrackingEvent(null, null, SUSPEND)); refactorService.applyRefactoring(session).then(new Operation<RefactoringResult>() { @Override public void apply(RefactoringResult arg) throws OperationException { if (arg.getSeverity() == OK) { view.hide(); refactoringUpdater.updateAfterRefactoring(arg.getChanges()); final Resource[] resources = refactorInfo != null ? refactorInfo.getResources() : null; Project project = null; if (resources != null && resources.length == 1) { final Optional<Project> optProject = resources[0].getRelatedProject(); if (optProject.isPresent()) { project = optProject.get(); } } else { final Resource resource = appContext.getResource(); if (resource != null) { final Optional<Project> optProject = resource.getRelatedProject(); if (optProject.isPresent()) { project = optProject.get(); } } } if (project != null) { refactorService.reindexProject(project.getLocation().toString()); } setEditorFocus(); } else { view.showErrorMessage(arg); } for (ChangeInfo change : arg.getChanges()) { final String path = change.getPath(); final String oldPath = change.getOldPath(); eventBus.fireEvent(new FileTrackingEvent(path, oldPath, MOVE)); } <START> eventBus.fireEvent(new FileTrackingEvent(null, null, RESUME)); <END> } }); }</code><technical_language>Strange event, no? (newPath == null oldPath == null)</technical_language>

Target:
private void applyRefactoring(RefactoringSession session) { eventBus.fireEvent(newFileTrackingSuspendEvent()); refactorService.applyRefactoring(session).then(new Operation<RefactoringResult>() { @Override public void apply(RefactoringResult arg) throws OperationException { if (arg.getSeverity() == OK) { view.hide(); refactoringUpdater.updateAfterRefactoring(arg.getChanges()); final Resource[] resources = refactorInfo != null ? refactorInfo.getResources() : null; Project project = null; if (resources != null && resources.length == 1) { final Optional<Project> optProject = resources[0].getRelatedProject(); if (optProject.isPresent()) { project = optProject.get(); } } else { final Resource resource = appContext.getResource(); if (resource != null) { final Optional<Project> optProject = resource.getRelatedProject(); if (optProject.isPresent()) { project = optProject.get(); } } } if (project != null) { refactorService.reindexProject(project.getLocation().toString()); } setEditorFocus(); } else { view.showErrorMessage(arg); } for (ChangeInfo change : arg.getChanges()) { final String path = change.getPath(); final String oldPath = change.getOldPath(); eventBus.fireEvent(newFileTrackingMoveEvent(path, oldPath)); } eventBus.fireEvent(newFileTrackingResumeEvent()); } }); }
Source:
<code>private void checkRulesToRegisterAlumni(final Integer studentNumber, final String documentIdNumber) { Student student = Student.readStudentByNumber(studentNumber); if (student == null) { if (Person.findPersonByDocumentID(documentIdNumber).isEmpty()) { throw new DomainException("error.person.document.number", Unit.getInstitutionAcronym()); } else { throw new DomainException("error.person.no.student", Unit.getInstitutionAcronym()); } } if (!student.getPerson().getDocumentIdNumber().equals(documentIdNumber.trim())) { throw new DomainException("error.document.number.student.number.mismatch"); } if (!checkAlumni(student)) { if (!student.getRegistrationsSet().isEmpty()) { for (Registration registration : student.getRegistrationsSet()) { ProgramConclusion programConclusion = ProgramConclusion.conclusionsFor(registration).findAny().orElse(null); <START> if (registration.isConcluded() || programConclusion != null) { <END> return; } } throw new DomainException("error.no.concluded.registrations"); } else { throw new DomainException("error.no.registrations", Unit.getInstitutionAcronym(), Installation.getInstance() .getInstituitionalEmailAddress("alumni")); } } }</code><technical_language>Optional.isPresent instead of checking nulls</technical_language>

Target:
private void checkRulesToRegisterAlumni(final Integer studentNumber, final String documentIdNumber) { Student student = Student.readStudentByNumber(studentNumber); if (student == null) { if (Person.findPersonByDocumentID(documentIdNumber).isEmpty()) { throw new DomainException("error.person.document.number", Unit.getInstitutionAcronym()); } else { throw new DomainException("error.person.no.student", Unit.getInstitutionAcronym()); } } if (!student.getPerson().getDocumentIdNumber().equals(documentIdNumber.trim())) { throw new DomainException("error.document.number.student.number.mismatch"); } if (!checkAlumni(student)) { if (!student.getRegistrationsSet().isEmpty()) { for (Registration registration : student.getRegistrationsSet()) { if (registration.isConcluded() || ProgramConclusion.conclusionsFor(registration).findAny().isPresent()) { return; } } throw new DomainException("error.no.concluded.registrations"); } else { throw new DomainException("error.no.registrations", Unit.getInstitutionAcronym(), Installation.getInstance() .getInstituitionalEmailAddress("alumni")); } } }
Source:
<code>public DTableModel compileAll( DMNFEELHelper feel, DMNCompilerContext ctx ) { CompilerContext feelctx = feel.newCompilerContext(); feelctx.setDoCompile( true ); ctx.getVariables().forEach( (k, v) -> feelctx.addInputVariableType( k, ((BaseDMNTypeImpl ) v).getFeelType() ) ); <START> initInputs(feel, feelctx); <END> initRows(feel, feelctx); initOutputs(feel, feelctx); return this; }</code><technical_language>please rename InputClauses OutputClauses necessary align DMN definitions, please</technical_language>

Target:
public DTableModel compileAll( DMNFEELHelper feel, DMNCompilerContext ctx ) { CompilerContext feelctx = feel.newCompilerContext(); feelctx.setDoCompile( true ); ctx.getVariables().forEach( (k, v) -> feelctx.addInputVariableType( k, ((BaseDMNTypeImpl ) v).getFeelType() ) ); initInputClauses(feel, feelctx); initRows(feel, feelctx); initOutputClauses(feel, feelctx); return this; }
Source:
<code>public int findRangeId(long value) { for (int i = 0; i < _rangeStartArray.length - 1; i++) { if (value >= _rangeStartArray[i].longValue() && value < _rangeStartArray[i + 1].longValue()) { <START> return i; <END> } } return _rangeStartArray.length - 1; }</code><technical_language>add a TODO for a linear scan find range for a dictId. If number of ranges is high, want do binary search</technical_language>

Target:
public int findRangeId(long value) { for (int i = 0; i < _rangeStartArray.length; i++) { if (value < _rangeStartArray[i].longValue()) { return i - 1; } } if (value <= _lastRangeEnd.longValue()) { return _rangeStartArray.length - 1; } return -1; }
Source:
<code>public KeyValueColumnExpression(PColumn column) { super(column); this.cf = column.getFamilyName().getBytes(); this.cq = column.getName().getBytes(); <START> this.maxLength = column.getMaxLength(); <END> this.scale = column.getScale(); }</code><technical_language>I this logic in super class b/c apply for RowKeyColumnExpression</technical_language>

Target:
public KeyValueColumnExpression(PColumn column) { super(column); this.cf = column.getFamilyName().getBytes(); this.cq = column.getName().getBytes(); }
Source:
<code>private boolean execute(GdbLaunch launch, final IDebugCommandRequest request) { try { fExecutor.execute(new DsfRunnable() { @Override public void run() { final IGDBControl commandControl = fTracker.getService(IGDBControl.class); if (commandControl != null) { commandControl.terminate(new ImmediateRequestMonitor() { @Override protected void handleCompleted() { <START> if (!getStatus().isOK()) { <END> request.setStatus(getStatus()); request.done(); } else { WaitForTerminationJob job = new WaitForTerminationJob(fSession.getId(), request); job.schedule(); } }; }); } else { request.done(); } } }); } catch (RejectedExecutionException e) { request.done(); } return false; }</code><technical_language>RequestMonitor.isSuccess(). Is a reason IStatus directly</technical_language>

Target:
private boolean execute(GdbLaunch launch, final IDebugCommandRequest request) { try { fExecutor.execute(new DsfRunnable() { @Override public void run() { final IGDBControl commandControl = fTracker.getService(IGDBControl.class); if (commandControl != null) { commandControl.terminate(new ImmediateRequestMonitor() { @Override protected void handleCompleted() { if (!isSuccess()) { request.setStatus(getStatus()); request.done(); } else { WaitForTerminationJob job = new WaitForTerminationJob(fSession.getId(), request); job.schedule(); } }; }); } else { request.done(); } } }); } catch (RejectedExecutionException e) { request.done(); } return false; }
Source:
<code>public boolean equals(final Object o) { boolean isEqual = false; <START> final Customer customer = (Customer) o; <END> if (getId() == customer.getId()) { isEqual = true; } return isEqual; }</code><technical_language>Logic: promote incorrect conventions. a blind cast Customer in equals(). java public boolean equals(Object o) { if (o == this) { return true; } if (!(o instanceof Customer)) { return false; } // safe cast here. usual equality checks }</technical_language>

Target:
public boolean equals(final Object o) { boolean isEqual = false; if (this == o) { isEqual = true; } else if (o != null && (getClass() == o.getClass())) { final Customer customer = (Customer) o; if (getId() == customer.getId()) isEqual = true; } return isEqual; }
Source:
<code><START> public ContentDTO createContent(String ownerKey, ContentDTO content) { <END> Owner owner = this.getOwnerByKey(ownerKey); Content entity = this.createContentImpl(owner, content); ownerManager.refreshOwnerForContentAccess(owner); return this.translator.translate(entity, ContentDTO.class); }</code><technical_language>resources do trigger validation of incoming DTOs. inject DTOValidator validate DTOs. a DistributorVersionResource for example used</technical_language>

Target:
public ContentDTO createContent(String ownerKey, ContentDTO content) { this.validator.validateConstraints(content); this.validator.validateCollectionElementsNotNull(content::getModifiedProductIds); Owner owner = this.getOwnerByKey(ownerKey); Content entity = this.createContentImpl(owner, content); ownerManager.refreshOwnerForContentAccess(owner); return this.translator.translate(entity, ContentDTO.class); }
Source:
<code>public OrganizationDto getOrganization(DbSession dbSession, ComponentDto component) { String organizationUuid = component.getOrganizationUuid(); <START> return dbClient.organizationDao().selectByUuid(dbSession, organizationUuid) <END> .orElseThrow(() -> new NotFoundException(format("Organization with uuid '%s' not found", organizationUuid))); }</code><technical_language>suggestion: checkFoundWithOptional. Otherwise, deprecate existing method</technical_language>

Target:
public OrganizationDto getOrganization(DbSession dbSession, ComponentDto component) { String organizationUuid = component.getOrganizationUuid(); java.util.Optional<OrganizationDto> organizationDto = dbClient.organizationDao().selectByUuid(dbSession, organizationUuid); return checkFoundWithOptional(organizationDto, "Organization with uuid '%s' not found", organizationUuid); }
Source:
<code>public void testUnmarshallSubprocessLevelEventEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateSignalEventCatching emptySubprocessEvent = getCatchingIntermediateNodeById(diagram, EMPTY_SUBPROCESS_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_NO_OUTGOING_EDGE); assertGeneralSet(emptySubprocessEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); <START> assertSignalEventExecutionSet(emptySubprocessEvent.getExecutionSet(), EMPTY_VALUE, NON_CANCELLING, ""); <END> assertDataIOSet(emptySubprocessEvent.getDataIOSet(), EMPTY_VALUE); }</code><technical_language>suggestion assertSignalEventExecutionSet(emptySubprocessEvent.getExecutionSet(), EMPTY_VALUE, NON_CANCELLING, EMPTY_VALUE);</technical_language>

Target:
public void testUnmarshallSubprocessLevelEventEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateSignalEventCatching emptySubprocessEvent = getCatchingIntermediateNodeById(diagram, EMPTY_SUBPROCESS_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_NO_OUTGOING_EDGE); assertGeneralSet(emptySubprocessEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertSignalEventExecutionSet(emptySubprocessEvent.getExecutionSet(), EMPTY_VALUE, NON_CANCELLING, EMPTY_VALUE); assertDataIOSet(emptySubprocessEvent.getDataIOSet(), EMPTY_VALUE); }
Source:
<code>public void testGetInvalidityInfoForInstituteName_invalid_returnSpecificErrorString() { String invalidInstituteName = StringHelper.generateStringOfLength(INSTITUTE_NAME_MAX_LENGTH + 1); String actual = validator.getInvalidityInfoForInstituteName(invalidInstituteName); assertEquals("Invalid institute name (too long) should return error message that is specific to institute name", "\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\" is not " + "acceptable to TEAMMATES as a/an institute name because it is too long. The value " + "of a/an institute name should be no longer than 64 characters. It should not be " <START> + "empty.", <END> actual); }</code><technical_language>This (both instances of empty.) line before</technical_language>

Target:
public void testGetInvalidityInfoForInstituteName_invalid_returnSpecificErrorString() { String invalidInstituteName = StringHelper.generateStringOfLength(INSTITUTE_NAME_MAX_LENGTH + 1); String actual = validator.getInvalidityInfoForInstituteName(invalidInstituteName); assertEquals("Invalid institute name (too long) should return error message that is specific to institute name", "\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\" is not " + "acceptable to TEAMMATES as a/an institute name because it is too long. The value " + "of a/an institute name should be no longer than 64 characters. It should not be empty.", actual); }