auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void shouldBreakOnInvalidAuthenticationHandler() throws Exception { final CombinedTestClient client = new CombinedTestClient(getProtocol()); try { client.sendAndAssert("2+2", 4); } catch (NoHttpResponseException | SocketException e) { } finally { client.close(); } }

Target:
public void shouldBreakOnInvalidAuthenticationHandler() throws Exception { final CombinedTestClient client = new CombinedTestClient(getProtocol()); try { client.sendAndAssert("2+2", 4); Assert.fail("An exception should be thrown with an invalid authentication handler"); } catch (NoHttpResponseException | SocketException e) { } finally { client.close(); } }
Source:
private void updateMessageState(List<Message> readMsgs, HelixDataAccessor accessor, String instanceName) { Builder keyBuilder = accessor.keyBuilder(); List<String> readMsgPaths = new ArrayList<>(); List<DataUpdater<ZNRecord>> updaters = new ArrayList<>(); for (Message msg : readMsgs) { readMsgPaths.add(msg.getKey(keyBuilder, instanceName).getPath()); _knownMessageIds.add(msg.getId()); updaters.add(new DataUpdater<ZNRecord>() { @Override public ZNRecord update(ZNRecord currentData) { if (currentData == null) { return null; } return msg.getRecord(); } }); } accessor.updateChildren(readMsgPaths, updaters, AccessOption.PERSISTENT); }

Target:
private void updateMessageState(List<Message> readMsgs, HelixDataAccessor accessor, String instanceName) { Builder keyBuilder = accessor.keyBuilder(); List<String> readMsgPaths = new ArrayList<>(); List<DataUpdater<ZNRecord>> updaters = new ArrayList<>(); for (Message msg : readMsgs) { readMsgPaths.add(msg.getKey(keyBuilder, instanceName).getPath()); _knownMessageIds.add(msg.getId()); updaters.add(new DataUpdater<ZNRecord>() { @Override public ZNRecord update(ZNRecord currentData) { if (currentData == null) { LOG.warn("Message targets at has already been removed before it is set as READ on instance {}", msg.getId(), msg.getTgtName(), instanceName); return null; } return msg.getRecord(); } }); } accessor.updateChildren(readMsgPaths, updaters, AccessOption.PERSISTENT); }
Source:
public boolean processAutoDiscovery(byte[] buffer) { boolean reinit = false; String[] discovered; try { String configs = new String(buffer, "UTF-8"); String separator = App.AD_CONFIG_SEP; if (configs.indexOf(App.AD_LEGACY_CONFIG_SEP) != -1) { separator = App.AD_LEGACY_CONFIG_SEP; } discovered = configs.split(separator + System.getProperty("line.separator")); } catch(UnsupportedEncodingException e) { LOGGER.debug("Unable to parse byte buffer to UTF-8 String."); return false; } for (String config : discovered) { if (config == null || config.isEmpty()) { continue; } try{ String name = getAutoDiscoveryName(config); LOGGER.debug("Attempting to apply config. Name: " + name + "\nconfig: \n" + config); InputStream stream = new ByteArrayInputStream(config.getBytes("UTF-8")); YamlParser yaml = new YamlParser(stream); if (this.addConfig(name, yaml)){ reinit = true; LOGGER.debug("Configuration added succesfully reinit in order"); } else { LOGGER.debug("Unable to apply configuration."); } } catch(UnsupportedEncodingException e) { LOGGER.debug("Unable to parse byte buffer to UTF-8 String."); } } return reinit; }

Target:
public boolean processAutoDiscovery(byte[] buffer) { boolean reinit = false; String[] discovered; String configs = new String(buffer, UTF_8); String separator = App.AD_CONFIG_SEP; if (configs.indexOf(App.AD_LEGACY_CONFIG_SEP) != -1) { separator = App.AD_LEGACY_CONFIG_SEP; } discovered = configs.split(separator + System.getProperty("line.separator")); for (String config : discovered) { if (config == null || config.isEmpty()) { continue; } String name = getAutoDiscoveryName(config); LOGGER.debug("Attempting to apply config. Name: " + name + "\nconfig: \n" + config); InputStream stream = new ByteArrayInputStream(config.getBytes(UTF_8)); YamlParser yaml = new YamlParser(stream); if (this.addConfig(name, yaml)){ reinit = true; LOGGER.debug("Configuration added succesfully reinit in order"); } else { LOGGER.debug("Unable to apply configuration."); } } return reinit; }
Source:
protected boolean isDiskInBackupDomain() { if (!validate(createDiskValidator(getImage()).isDiskPluggedToAnyNonDownVm(false))) { return failValidation( EngineMessage.ACTION_TYPE_FAILED_RUNNING_VM_DISK_CANNOT_COPY_OR_MOVE_TO_BACKUP_DOMAIN); } return true; }

Target:
protected boolean isDiskInBackupDomain() { StorageDomain destDomain = storageDomainDao.get(getParameters().getStorageDomainId()); if (getStorageDomain().isBackup()) { if (destDomain.isBackup()) { if (!validate(createDiskValidator(getImage()).isDiskPluggedToAnyNonDownVm(false))) { return failValidation( EngineMessage.ACTION_TYPE_FAILED_RUNNING_VM_DISK_CANNOT_COPY_OR_MOVE_TO_BACKUP_DOMAIN); } } } return true; }
Source:
public void checkValue(String envVar, String operation, String value) throws Exception { switch (operation) { case "is": Assertions.assertThat(envVar).isEqualTo(value); break; case "matches": Assertions.assertThat(envVar).matches(value); break; case "is higher than": if (envVar.matches("^-?\\d+$") && value.matches("^-?\\d+$")) { Assertions.assertThat(Integer.parseInt(envVar)).isGreaterThan(Integer.parseInt(value)); } else { Fail.fail("A number should be provided in order to perform a valid comparison."); } break; case "is lower than": if (envVar.matches("^-?\\d+$") && value.matches("^-?\\d+$")) { Assertions.assertThat(Integer.parseInt(envVar)).isLessThan(Integer.parseInt(value)); } else { Fail.fail("A number should be provided in order to perform a valid comparison."); } break; case "contains": Assertions.assertThat(envVar).contains(value); break; case "is different from": Assertions.assertThat(envVar).isNotEqualTo(value); break; default: Fail.fail("Not a valid comparison."); } }

Target:
public void checkValue(String envVar, String operation, String value) throws Exception { switch (operation.toLowerCase()) { case "is": Assertions.assertThat(envVar).isEqualTo(value); break; case "matches": Assertions.assertThat(envVar).matches(value); break; case "is higher than": if (envVar.matches("^-?\\d+$") && value.matches("^-?\\d+$")) { Assertions.assertThat(Integer.parseInt(envVar)).isGreaterThan(Integer.parseInt(value)); } else { Fail.fail("A number should be provided in order to perform a valid comparison."); } break; case "is lower than": if (envVar.matches("^-?\\d+$") && value.matches("^-?\\d+$")) { Assertions.assertThat(Integer.parseInt(envVar)).isLessThan(Integer.parseInt(value)); } else { Fail.fail("A number should be provided in order to perform a valid comparison."); } break; case "contains": Assertions.assertThat(envVar).contains(value); break; case "is different from": Assertions.assertThat(envVar).isNotEqualTo(value); break; default: Fail.fail("Not a valid comparison. Valid ones are: is | matches | is higher than | is lower than | contains | is different from"); } }
Source:
public WriteResponseHandler(Replica replica, WriteType writeType, Runnable callback, long queryStartNanoTime) { this(new ReplicaList(Collections.singleton(replica)), new ReplicaList(), ConsistencyLevel.ONE, null, callback, writeType, queryStartNanoTime); }

Target:
public WriteResponseHandler(Replica replica, WriteType writeType, Runnable callback, long queryStartNanoTime) { this(ReplicaList.of(replica), Replicas.empty(), ConsistencyLevel.ONE, null, callback, writeType, queryStartNanoTime); }
Source:
public void testWithOfflineInstancesLimit() throws Exception { MaintenanceSignal maintenanceSignal = _dataAccessor.getProperty(_dataAccessor.keyBuilder().maintenance()); Assert.assertNull(maintenanceSignal); checkForRebalanceError(false); int i; for (i = 2; i < 2 + _maxOfflineInstancesAllowed; i++) { _participants.get(i).syncStop(); } boolean result = TestHelper.verify(() -> { MaintenanceSignal ms = _dataAccessor.getProperty(_dataAccessor.keyBuilder().maintenance()); return ms == null; }, TestHelper.WAIT_DURATION); Assert.assertTrue(result); _participants.get(i).syncStop(); result = TestHelper.verify(() -> { MaintenanceSignal ms =_dataAccessor.getProperty(_dataAccessor.keyBuilder().maintenance()); return ms != null && ms.getReason() != null; }, TestHelper.WAIT_DURATION); checkForRebalanceError(true); }

Target:
public void testWithOfflineInstancesLimit() throws Exception { MaintenanceSignal maintenanceSignal = _dataAccessor.getProperty(_dataAccessor.keyBuilder().maintenance()); Assert.assertNull(maintenanceSignal); checkForRebalanceError(false); int i; for (i = 2; i < 2 + _maxOfflineInstancesAllowed; i++) { _participants.get(i).syncStop(); } boolean result = TestHelper.verify(() -> { MaintenanceSignal ms = _dataAccessor.getProperty(_dataAccessor.keyBuilder().maintenance()); return ms == null; }, TestHelper.WAIT_DURATION); Assert.assertTrue(result); _participants.get(i).syncStop(); result = TestHelper.verify(() -> { MaintenanceSignal ms =_dataAccessor.getProperty(_dataAccessor.keyBuilder().maintenance()); return ms != null && ms.getReason() != null; }, TestHelper.WAIT_DURATION); Assert.assertTrue(result); checkForRebalanceError(true); }
Source:
public String getTitle() { return title.get(); }

Target:
public String getTitle() { return this.title.get(); }
Source:
public synchronized void setupTaskAndConn(final int taskNum) { final Configuration commonConf = Configurations.merge(commonConfigs.getConfiguration(), taskConfigs.getConfiguration()); try { for (int i = 0; i < taskNum; i++) { final String taskId = TASK_ID_PREFIX + taskIdIndex; final JavaConfigurationBuilder jcb = Tang.Factory.getTang().newConfigurationBuilder(); jcb.bindNamedParameter(TaskId.class, taskId); final String serializedConf = confSerializer.toString(Configurations.merge(commonConf, jcb.build())); final TaskRequest taskRequest = TaskRequest.newBuilder() .setTaskId(taskId) .setTaskCpuNum(numTaskCores) .setTaskMemSize(taskMemSize) .setNewRatio(newRatio) .setReservedCodeCacheSize(reservedCodeCacheSize) .setSerializedTaskConfiguration(serializedConf) .build(); taskIdIndex += 1; LOG.log(Level.INFO, "Requesting for a task to the driver... Task ID = {0}", taskId); proxyToDriver.requestNewTask(taskRequest); countDownLatch = new CountDownLatch(1); countDownLatch.await(); } } catch (final AvroRemoteException | InterruptedException e) { e.printStackTrace(); } }

Target:
public synchronized void setupTaskAndConn(final int taskNum) throws AvroRemoteException, InterruptedException { final Configuration commonConf = Configurations.merge(commonConfigs.getConfiguration(), taskConfigs.getConfiguration()); for (int i = 0; i < taskNum; i++) { final String taskId = TASK_ID_PREFIX + taskIdIndex; final JavaConfigurationBuilder jcb = Tang.Factory.getTang().newConfigurationBuilder(); jcb.bindNamedParameter(TaskId.class, taskId); final String serializedConf = confSerializer.toString(Configurations.merge(commonConf, jcb.build())); final TaskRequest taskRequest = TaskRequest.newBuilder() .setTaskId(taskId) .setTaskCpuNum(numTaskCores) .setTaskMemSize(taskMemSize) .setNewRatio(newRatio) .setReservedCodeCacheSize(reservedCodeCacheSize) .setSerializedTaskConfiguration(serializedConf) .build(); taskIdIndex += 1; LOG.log(Level.INFO, "Requesting for a task to the driver... Task ID = {0}", taskId); proxyToDriver.requestNewTask(taskRequest); countDownLatch = new CountDownLatch(1); countDownLatch.await(); } }
Source:
public void onEvent(final PusherEvent event) { System.out.println(String.format("Received event [%s] on channel [%s] with data [%s] and event [%s]", event.toString())); }

Target:
public void onEvent(final PusherEvent event) { System.out.println(String.format("Received event [%s] on channel [%s] with data [%s] and event [%s]", event.getEventName(), event.getChannelName(), event.getData(), event.toString())); }
Source:
private String getCurrentUser() { Account[] accountList = mAcctManager .getAccountsByType(AuthenticationConstants.Broker.BROKER_ACCOUNT_TYPE); return accountList[0].name; }

Target:
private String getCurrentUser() { Account[] accountList = mAcctManager .getAccountsByType(AuthenticationConstants.Broker.BROKER_ACCOUNT_TYPE); if (accountList != null && accountList.length > 0) { return accountList[0].name; } return null; }
Source:
public static void printAsTableauForm( TableSchema tableSchema, Iterator<Row> it, PrintWriter printWriter, int maxColumnWidth, String nullColumn, boolean deriveColumnWidthByType, boolean printRowKind) { final List<TableColumn> columns = tableSchema.getTableColumns(); String[] columnNames = columns.stream().map(TableColumn::getName).toArray(String[]::new); if (printRowKind) { columnNames = Stream.concat(Stream.of(ROW_KIND_COLUMN), Arrays.stream(columnNames)).toArray(String[]::new); } final int[] colWidths; if (deriveColumnWidthByType) { colWidths = columnWidthsByType( columns, maxColumnWidth, nullColumn, printRowKind ? ROW_KIND_COLUMN : null); } else { List<Row> rows = new ArrayList<>(); List<String[]> content = new ArrayList<>(); content.add(columnNames); while (it.hasNext()) { Row row = it.next(); rows.add(row); content.add(rowToString(row, nullColumn, printRowKind)); } colWidths = columnWidthsByContent(columnNames, content, maxColumnWidth); it = rows.iterator(); } final String borderline = PrintUtils.genBorderLine(colWidths); printWriter.println(borderline); PrintUtils.printSingleRow(colWidths, columnNames, printWriter); printWriter.println(borderline); printWriter.flush(); long numRows = 0; while (it.hasNext()) { String[] cols = rowToString(it.next(), nullColumn, printRowKind); printSingleRow(colWidths, cols, printWriter); numRows++; } if (numRows > 0) { printWriter.println(borderline); } final String rowTerm; if (numRows > 1) { rowTerm = "rows"; } else { rowTerm = "row"; } printWriter.println(numRows + " " + rowTerm + " in set"); printWriter.flush(); }

Target:
public static void printAsTableauForm( TableSchema tableSchema, Iterator<Row> it, PrintWriter printWriter, int maxColumnWidth, String nullColumn, boolean deriveColumnWidthByType, boolean printRowKind) { final List<TableColumn> columns = tableSchema.getTableColumns(); String[] columnNames = columns.stream().map(TableColumn::getName).toArray(String[]::new); if (printRowKind) { columnNames = Stream.concat(Stream.of(ROW_KIND_COLUMN), Arrays.stream(columnNames)).toArray(String[]::new); } final int[] colWidths; if (deriveColumnWidthByType) { colWidths = columnWidthsByType( columns, maxColumnWidth, nullColumn, printRowKind ? ROW_KIND_COLUMN : null); } else { final List<Row> rows = new ArrayList<>(); final List<String[]> content = new ArrayList<>(); content.add(columnNames); while (it.hasNext()) { Row row = it.next(); rows.add(row); content.add(rowToString(row, nullColumn, printRowKind)); } colWidths = columnWidthsByContent(columnNames, content, maxColumnWidth); it = rows.iterator(); } final String borderline = PrintUtils.genBorderLine(colWidths); printWriter.println(borderline); PrintUtils.printSingleRow(colWidths, columnNames, printWriter); printWriter.println(borderline); printWriter.flush(); long numRows = 0; while (it.hasNext()) { String[] cols = rowToString(it.next(), nullColumn, printRowKind); printSingleRow(colWidths, cols, printWriter); numRows++; } if (numRows > 0) { printWriter.println(borderline); } final String rowTerm; if (numRows > 1) { rowTerm = "rows"; } else { rowTerm = "row"; } printWriter.println(numRows + " " + rowTerm + " in set"); printWriter.flush(); }
Source:
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException { ListResponse<KubernetesSupportedVersionResponse> response = kubernetesVersionService.listKubernetesSupportedVersions(this); response.setResponseName(getCommandName()); setResponseObject(response); }

Target:
public void execute() throws ServerApiException, ConcurrentOperationException { ListResponse<KubernetesSupportedVersionResponse> response = kubernetesVersionService.listKubernetesSupportedVersions(this); response.setResponseName(getCommandName()); setResponseObject(response); }
Source:
Submit(@GerritPersonIdent PersonIdent serverIdent, Provider<ReviewDb> dbProvider, GitRepositoryManager repoManager, IdentifiedUser.GenericFactory userFactory, ChangeUpdate.Factory updateFactory, ApprovalsUtil approvalsUtil, MergeQueue mergeQueue, AccountsCollection accounts, ChangesCollection changes, ChangeIndexer indexer, LabelNormalizer labelNormalizer, @GerritServerConfig Config cfg) { this.serverIdent = serverIdent; this.dbProvider = dbProvider; this.repoManager = repoManager; this.userFactory = userFactory; this.updateFactory = updateFactory; this.approvalsUtil = approvalsUtil; this.mergeQueue = mergeQueue; this.accounts = accounts; this.changes = changes; this.indexer = indexer; this.labelNormalizer = labelNormalizer; this.label = Objects.firstNonNull(cfg.getString( "change", null, "submitLabel"), "Submit"); this.tooltipPattern = new ParameterizedString(Objects.firstNonNull(cfg.getString( "change", null, "submitTooltip"), DEFAULT_TOOLTIP)); }

Target:
Submit(@GerritPersonIdent PersonIdent serverIdent, Provider<ReviewDb> dbProvider, GitRepositoryManager repoManager, IdentifiedUser.GenericFactory userFactory, ChangeUpdate.Factory updateFactory, ApprovalsUtil approvalsUtil, MergeQueue mergeQueue, AccountsCollection accounts, ChangesCollection changes, ChangeIndexer indexer, LabelNormalizer labelNormalizer, @GerritServerConfig Config cfg) { this.serverIdent = serverIdent; this.dbProvider = dbProvider; this.repoManager = repoManager; this.userFactory = userFactory; this.updateFactory = updateFactory; this.approvalsUtil = approvalsUtil; this.mergeQueue = mergeQueue; this.accounts = accounts; this.changes = changes; this.indexer = indexer; this.labelNormalizer = labelNormalizer; this.label = Objects.firstNonNull( Strings.emptyToNull(cfg.getString("change", null, "submitLabel")), "Submit"); this.titlePattern = new ParameterizedString(Objects.firstNonNull( cfg.getString("change", null, "submitTooltip"), DEFAULT_TOOLTIP)); }
Source:
protected static File createSampleZip(boolean addMarker) throws IOException { String sourceDirPath = "data/sample_export"; File zip = new File(downloadDir, "distrib-apidoc.zip"); FileUtils.deleteQuietly(zip); Path p = Files.createFile(Paths.get(zip.getPath())); try (ZipOutputStream zs = new ZipOutputStream(Files.newOutputStream(p))) { if (addMarker) { ZipEntry zipEntry = new ZipEntry(".nuxeo-archive"); zs.putNextEntry(zipEntry); zs.closeEntry(); } Path epath = Paths.get(sourceDirPath, "entries.txt"); List<String> lines = IOUtils.readLines(AbstractExplorerTest.getReferenceStream(epath), StandardCharsets.UTF_8); for (Iterator<String> lineIter = lines.iterator(); lineIter.hasNext();) { String path = lineIter.next(); if (StringUtils.isEmpty(path)) { continue; } ZipEntry entry = new ZipEntry(path); if (path.endsWith("/")) { entry.setExtra(new DWord(Integer.valueOf(lineIter.next())).getBytes()); zs.putNextEntry(entry); } else { zs.putNextEntry(entry); Path ppath = Paths.get(sourceDirPath, path); IOUtils.copy(AbstractExplorerTest.getReferenceStream(ppath), zs); } zs.closeEntry(); } } return zip; }

Target:
protected static File createSampleZip(boolean addMarker) throws IOException { String sourceDirPath = "data/sample_export"; File zip = new File(downloadDir, "distrib-apidoc.zip"); FileUtils.deleteQuietly(zip); Path p = Files.createFile(Paths.get(zip.getPath())); try (ZipOutputStream zs = new ZipOutputStream(Files.newOutputStream(p))) { if (addMarker) { ZipEntry zipEntry = new ZipEntry(".nuxeo-archive"); zs.putNextEntry(zipEntry); zs.closeEntry(); } Path epath = Paths.get(sourceDirPath, "entries.txt"); List<String> lines; try (InputStream stream = AbstractExplorerTest.getReferenceStream(epath)) { lines =IOUtils.readLines(stream, StandardCharsets.UTF_8); } for (Iterator<String> lineIter = lines.iterator(); lineIter.hasNext();) { String path = lineIter.next(); if (StringUtils.isEmpty(path)) { continue; } ZipEntry entry = new ZipEntry(path); if (path.endsWith("/")) { entry.setExtra(new DWord(Integer.valueOf(lineIter.next())).getBytes()); zs.putNextEntry(entry); } else { zs.putNextEntry(entry); Path ppath = Paths.get(sourceDirPath, path); try (InputStream stream = getReferenceStream(ppath)) { IOUtils.copy(stream, zs); } } zs.closeEntry(); } } return zip; }
Source:
public Mono<ServiceBusTransactionContext> createTransaction() { if (isDisposed.get()) { return monoError(logger, new IllegalStateException( String.format(INVALID_OPERATION_DISPOSED_RECEIVER, "createTransaction"))); } return connectionProcessor .flatMap(connection -> connection.getTransactionManager()) .flatMap(transactionManager -> transactionManager.createTransaction()) .map(byteBuffer -> new ServiceBusTransactionContext(byteBuffer)); }

Target:
public Mono<ServiceBusTransactionContext> createTransaction() { if (isDisposed.get()) { return monoError(logger, new IllegalStateException( String.format(INVALID_OPERATION_DISPOSED_RECEIVER, "createTransaction"))); } return connectionProcessor .flatMap(connection -> connection.createSession(TRANSACTION_LINK_NAME)) .flatMap(transactionSession -> transactionSession.createTransaction()) .map(transaction -> new ServiceBusTransactionContext(transaction.getTransactionId())); }
Source:
protected ToolDescriptor() { super(); }

Target:
protected ToolDescriptor() { }
Source:
public <T> T[] toArray(final T[] a) { final T[] copy = a.length < table.size() ? (T[]) java.lang.reflect.Array .newInstance(a.getClass().getComponentType(), table.size()) : a; for (int i = 0; i < copy.length; i++) { if (i >= table.size()) copy[i] = null; else { if (checkString(i)) copy[i] = (T) table.getStringValue(col, i); else copy[i] = (T) Double.valueOf(table.getValueAsDouble(col, i)); } } return copy; }

Target:
public <T> T[] toArray(final T[] a) { final T[] copy = a.length < table.size() ? (T[]) java.lang.reflect.Array .newInstance(a.getClass().getComponentType(), table.size()) : a; for (int i = 0; i < table.size(); i++) { if (checkString(i)) copy[i] = (T) table.getStringValue(col, i); else copy[i] = (T) Double.valueOf(table.getValueAsDouble(col, i)); } if (copy.length > table.size()) copy[table.size()] = null; return copy; }
Source:
protected List<String> getLayerNames(String workspaceName) { SortedSet<String> resultSet = new TreeSet<String>(); if (workspaceName != null) { for (ResourceInfo r : getCatalog().getResources(ResourceInfo.class)) { if (r.getStore().getWorkspace().getName().equals(workspaceName)) { resultSet.add(r.getName()); } } } return new ArrayList(resultSet); }

Target:
protected List<String> getLayerNames(String workspaceName) { List<String> resultSet = new ArrayList<String>(); if (workspaceName != null) { FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(); try(CloseableIterator<ResourceInfo> it = getCatalog().getFacade().list(ResourceInfo.class, Predicates.equal("store.workspace.name", workspaceName), null, null, ff.sort("name", SortOrder.ASCENDING))) { while(it.hasNext()) { resultSet.add(it.next().getName()); } } } return resultSet; }
Source:
public void FBButton_004_ForcedLoginButton_Visible() { WikiBasePageObject base = new WikiBasePageObject(driver); SpecialNewFilesPageObject specialPage = base.openSpecialNewFiles(wikiURL); specialPage.verifyPageHeader(NEW_FILES_SPECIAL_PAGE_TITLE); specialPage.addPhoto(); specialPage.verifyModalLoginAppeared(); specialPage.verifyModalFBButtonVisible(); }

Target:
public void FBButton_004_ForcedLoginButton_Visible() { WikiBasePageObject base = new WikiBasePageObject(driver); SpecialNewFilesPageObject specialPage = base.openSpecialNewFiles(wikiURL); specialPage.verifyPageHeader(specialPage.getNewFilesSpecialPageTitle()); specialPage.addPhoto(); specialPage.verifyModalLoginAppeared(); specialPage.verifyModalFBButtonVisible(); }
Source:
public void onTrailers(HttpFields trailers) { if (LOG.isDebugEnabled()) LOG.debug("onTrailers {}", this, trailers); _request.getMetaData().setTrailers(trailers.asImmutable()); _combinedListener.onRequestTrailers(_request); }

Target:
public void onTrailers(HttpFields trailers) { if (LOG.isDebugEnabled()) LOG.debug("onTrailers {}", this, trailers); _request.setTrailerHttpFields(trailers); _combinedListener.onRequestTrailers(_request); }
Source:
private void pollQueue() { do { FastList vs; synchronized (this) { vs = queue; queue = new FastList(); } for (Object v : vs.array) { if (v == null) { break; } switch (on.kind(v)) { case OnNext: case OnCompleted: synchronized (scheduledUnsubscribe) { if (scheduledUnsubscribe.isUnsubscribed()) { break; } on.accept(observer, v); } break; default: on.accept(observer, v); break; } } if (COUNTER_UPDATER.addAndGet(this, -vs.size) <= 0) { break; } } while (true); }

Target:
private void pollQueue() { do { FastList vs; synchronized (this) { vs = queue; queue = new FastList(); } for (Object v : vs.array) { if (v == null) { break; } on.accept(observer, v); } if (COUNTER_UPDATER.addAndGet(this, -vs.size) <= 0) { break; } } while (true); }
Source:
public @Nullable SegmentStoreStatistics getTotalStatsForRange(long start, long end, IProgressMonitor monitor) { if (start == ETERNITY.getStartTime().toNanos() && end == ETERNITY.getEndTime().toNanos()) { waitForCompletion(); return getTotalStats(); } return getTotalStats(start, end, monitor); }

Target:
public @Nullable SegmentStoreStatistics getTotalStatsForRange(long start, long end, IProgressMonitor monitor) { @Nullable ITmfTrace trace = getTrace(); if (trace != null && (start == TmfTimeRange.ETERNITY.getStartTime().toNanos() && end == TmfTimeRange.ETERNITY.getEndTime().toNanos()) && (start <= trace.getStartTime().toNanos() && end >= trace.getEndTime().toNanos())) { waitForCompletion(); return getTotalStats(); } return getTotalStats(start, end, monitor); }
Source:
private static <T extends Annotation> T getClassAnnotation(Class<?> clazz, Class<T> annotationClass) { if (clazz == null) { return null; } T annot = clazz.getAnnotation(annotationClass); if (annot == null) { annot = getClassAnnotation(clazz.getSuperclass(), annotationClass); if (annot != null) { return annot; } } return annot; }

Target:
private static <T extends Annotation> T getClassAnnotation(Class<?> clazz, Class<T> annotationClass) { for (; clazz != null; clazz = clazz.getSuperclass()) { T t = clazz.getAnnotation(annotationClass); if (t != null) { return t; } } return null; }
Source:
private int getCurrentPostStatusIndex() { switch (PostStatus.fromPost(getPost())) { case DRAFT: return 1; case PENDING: return 2; case PRIVATE: return 3; case TRASHED: case UNKNOWN: case PUBLISHED: case SCHEDULED: return 0; } if (BuildConfig.DEBUG) { throw new IllegalStateException("Missing switch case."); } return 0; }

Target:
private int getCurrentPostStatusIndex() { switch (PostStatus.fromPost(getPost())) { case DRAFT: return 1; case PENDING: return 2; case PRIVATE: return 3; case TRASHED: case UNKNOWN: case PUBLISHED: case SCHEDULED: return 0; } return 0; }
Source:
public boolean skipValue() throws IOException { int remainingValues = 1; while(remainingValues > 0) { MessageFormat f = getNextFormat(); if(f == MessageFormat.EOF) return false; remainingValues += f.skip(this); remainingValues--; } return true; }

Target:
public boolean skipValue() throws IOException { int remainingValues = 1; while(remainingValues > 0) { MessageFormat f = getNextFormat(); remainingValues += f.skip(this); remainingValues--; } return true; }
Source:
public void evolve(){ temp_cells.clear(); for(int i=0; i<Properties.POPULATION; i++){ List<T> neighbors = this.getNeighbors(population, i); if (Properties.SHUFFLE_GOALS) Randomness.shuffle(neighbors); if (getFitnessFunction().isMaximizationFunction()) { Collections.sort(neighbors, Collections.reverseOrder()); } else { Collections.sort(neighbors); } List<T> parents = selectionFunction.select(neighbors,2); T parent1 = parents.get(0); T parent2 = parents.get(1); @SuppressWarnings("unchecked") T offspring1 = (T)parent1.clone(); @SuppressWarnings("unchecked") T offspring2 = (T)parent2.clone(); try { if (Randomness.nextDouble() <= Properties.CROSSOVER_RATE) { crossoverFunction.crossOver(offspring1, offspring2); } } catch (ConstructionFailedException e) { logger.info("CrossOver failed"); continue; } T bestOffspring = getBestOffspring(offspring1, offspring2); notifyMutation(bestOffspring); bestOffspring.mutate(); if (bestOffspring.isChanged()) { bestOffspring.updateAge(currentIteration); } if (!isTooLong(bestOffspring) && bestOffspring.size() != 0) temp_cells.add(bestOffspring); else temp_cells.add(population.get(i)); } }

Target:
public void evolve(){ temp_cells.clear(); for(int i=0; i<this.population.size(); i++){ List<T> neighbors = neighb.getNeighbors(population, i); if (getFitnessFunction().isMaximizationFunction()) { Collections.sort(neighbors, Collections.reverseOrder()); } else { Collections.sort(neighbors); } List<T> parents = selectionFunction.select(neighbors,2); T parent1 = parents.get(0); T parent2 = parents.get(1); @SuppressWarnings("unchecked") T offspring1 = (T)parent1.clone(); @SuppressWarnings("unchecked") T offspring2 = (T)parent2.clone(); try { if (Randomness.nextDouble() <= Properties.CROSSOVER_RATE) { crossoverFunction.crossOver(offspring1, offspring2); } } catch (ConstructionFailedException e) { logger.info("CrossOver failed"); continue; } T bestOffspring = getBestOffspring(offspring1, offspring2); notifyMutation(bestOffspring); bestOffspring.mutate(); if (bestOffspring.isChanged()) { bestOffspring.updateAge(currentIteration); } if (!isTooLong(bestOffspring) && bestOffspring.size() != 0) temp_cells.add(bestOffspring); else temp_cells.add(population.get(i)); } }
Source:
public synchronized void close() throws IOException { if (channelPools.isEmpty()) { return; } List<ListenableFuture<Void>> closingChannelsFutures = new ArrayList<>(); ListeningExecutorService listenableBatchPool = BigtableSessionSharedThreadPools.getInstance().getListeningExecutorService(); for (ChannelPool channelPool : channelPools) { closingChannelsFutures.add(listenableBatchPool.submit(createCallable(channelPool))); } channelPools.clear(); get(Futures.allAsList(closingChannelsFutures), "waiting for channels to be closed"); }

Target:
public synchronized void close() throws IOException { if (managedChannels.isEmpty()) { return; } long timeoutNanos = TimeUnit.SECONDS.toNanos(10); long endTimeNanos = System.nanoTime() + timeoutNanos; for (ManagedChannel channel : managedChannels) { channel.shutdown(); } for (ManagedChannel channel : managedChannels) { long awaitTimeNanos = endTimeNanos - System.nanoTime(); if (awaitTimeNanos <= 0) { break; } try { channel.awaitTermination(awaitTimeNanos, TimeUnit.NANOSECONDS); } catch (InterruptedException e) { throw new IOException("Interrupted while closing the channelPools"); } } for (ManagedChannel channel : managedChannels) { if (!channel.isTerminated()) { LOG.info("Could not close the channel after 10 seconds."); break; } } managedChannels.clear(); }
Source:
public int hashCode() { return HashUtil.combineHashCodes(getGraph().hashCode(),getMetadata().hashCode(),getName().hashCode()); }

Target:
public int hashCode() { int graphHash = (null != getGraph()) ? getGraph().hashCode() : 0; int metadataHash = (null != getMetadata()) ? getMetadata().hashCode() : 0; int nameHash = (null != getName()) ? getName().hashCode() : 0; return HashUtil.combineHashCodes(graphHash, metadataHash, nameHash); }
Source:
public List<Alert> getExampleAlerts() { List<Alert> alerts = new ArrayList<Alert>(); for (VulnType vulnType : VulnType.values()) { alerts.add( newAlert() .setName(getAlertElement(vulnType, "name")) .setRisk(Alert.RISK_MEDIUM) .setConfidence(Alert.CONFIDENCE_MEDIUM) .setDescription(getAlertElement(vulnType, "desc")) .setParam(HttpHeader.X_FRAME_OPTION) .setSolution(getAlertElement(vulnType, "soln")) .setReference(getAlertElement(vulnType, "refs")) .setCweId(16) .setWascId(15) .build()); } return alerts; }

Target:
public List<Alert> getExampleAlerts() { List<Alert> alerts = new ArrayList<Alert>(); for (VulnType vulnType : VulnType.values()) { alerts.add(buildAlert("", vulnType).build()); } return alerts; }
Source:
public GenericEntity<List<Branch>> branchList(@QueryParam("listMode") String listMode) throws ApiException { try (GitConnection gitConnection = getGitConnection()) { return new GenericEntity<List<Branch>>(gitConnection.branchList(listMode == null ? null : BranchListMode.valueOf(listMode))) { }; } }

Target:
public List<Branch> branchList(@QueryParam("listMode") String listMode) throws ApiException { try (GitConnection gitConnection = getGitConnection()) { return gitConnection.branchList(listMode == null ? null : BranchListMode.valueOf(listMode)); } catch (IllegalArgumentException exception) { throw new BadRequestException(exception.getMessage()); } }
Source:
public static TmfExperimentElement addExperiment(TmfProjectElement projectElement, String experimentName) { IFolder experimentFolder = projectElement.getExperimentsFolder().getResource(); IWorkspaceRoot workspaceRoot = experimentFolder.getWorkspace().getRoot(); IPath folderPath = experimentFolder.getFullPath().append(experimentName); final IFolder folder = workspaceRoot.getFolder(folderPath); WorkspaceModifyOperation operation = new WorkspaceModifyOperation() { @Override public void execute(IProgressMonitor monitor) throws CoreException { monitor.beginTask("", 1000); folder.create(false, true, monitor); monitor.done(); } }; try { PlatformUI.getWorkbench().getProgressService().busyCursorWhile(operation); } catch (InterruptedException exception) { } catch (InvocationTargetException exception) { } catch (RuntimeException exception) { } TmfImportHelper.forceFolderRefresh(experimentFolder); for (ITmfProjectModelElement el : projectElement.getExperimentsFolder().getChildren()) { if (el.getName().equals(experimentName) && (el instanceof TmfExperimentElement)) { return (TmfExperimentElement) el; } } return null; }

Target:
public static TmfExperimentElement addExperiment(TmfProjectElement projectElement, String experimentName) { IFolder experimentFolder = projectElement.getExperimentsFolder().getResource(); final IFolder folder = experimentFolder.getFolder(experimentName); WorkspaceModifyOperation operation = new WorkspaceModifyOperation() { @Override public void execute(IProgressMonitor monitor) throws CoreException { monitor.beginTask("", 1000); folder.create(false, true, monitor); monitor.done(); } }; try { PlatformUI.getWorkbench().getProgressService().busyCursorWhile(operation); } catch (InterruptedException exception) { } catch (InvocationTargetException exception) { } catch (RuntimeException exception) { } TmfImportHelper.forceFolderRefresh(experimentFolder); for (ITmfProjectModelElement el : projectElement.getExperimentsFolder().getChildren()) { if (el.getName().equals(experimentName) && (el instanceof TmfExperimentElement)) { return (TmfExperimentElement) el; } } return null; }
Source:
private boolean shouldCheckFilter(List<FilterSet> filterSetList, int index, int step) { boolean result = false; if (index < filterSetList.size() && filterSetList.get(index).getActionFilterOrder() == step) { result = true; } return result; }

Target:
private boolean shouldCheckFilter(List<FilterSet> filterSetList, int index, int step) { return index < filterSetList.size() && filterSetList.get(index).getActionFilterOrder() == step; }
Source:
private String sign() throws SignatureGenerationException { String header = Base64.encodeBase64URLSafeString(headerJson.getBytes(Charset.forName("UTF-8"))); String payload = Base64.encodeBase64URLSafeString(payloadJson.getBytes(Charset.forName("UTF-8"))); String content = String.format("%s.%s", header, payload); byte[] signatureBytes = algorithm.sign(content.getBytes(Charset.forName("UTF-8"))); String signature = Base64.encodeBase64URLSafeString((signatureBytes)); return String.format("%s.%s", content, signature); }

Target:
private String sign() throws SignatureGenerationException { String header = Base64.encodeBase64URLSafeString(headerJson.getBytes(Charset.forName(Charsets.UTF_8))); String payload = Base64.encodeBase64URLSafeString(payloadJson.getBytes(Charset.forName(Charsets.UTF_8))); String content = String.format("%s.%s", header, payload); byte[] signatureBytes = algorithm.sign(content.getBytes(Charset.forName(Charsets.UTF_8))); String signature = Base64.encodeBase64URLSafeString((signatureBytes)); return String.format("%s.%s", content, signature); }
Source:
public DynamicUrlContentTabView() { initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); frame.addLoadHandler((e) -> { resizeFrame(); }); Window.addResizeHandler((e) -> { resizeFrame(); }); }

Target:
public DynamicUrlContentTabView() { initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); frame.addLoadHandler(e -> { resizeFrame(); }); Window.addResizeHandler(e -> { resizeFrame(); }); }
Source:
public Builder withCacheSize(int maxByteCount) { if (maxByteCount < 0) { throw new IllegalArgumentException("maxByteCount < 0: " + maxByteCount); } cache = new PlatformLruCache(maxByteCount != 0 ? maxByteCount : 1); return this; }

Target:
public Builder withCacheSize(int maxByteCount) { if (maxByteCount < 0) { throw new IllegalArgumentException("maxByteCount < 0: " + maxByteCount); } cache = new PlatformLruCache(maxByteCount); return this; }
Source:
public void run() { try { while (isRunning()) { final RecordPublisherRunResult result = recordPublisher.run(startingPosition, batch -> { for (UserRecord userRecord : batch.getDeaggregatedRecords()) { if (filterDeaggregatedRecord(userRecord)) { deserializeRecordForCollectionAndUpdateState(userRecord); } } shardConsumerMetricsReporter.setAverageRecordSizeBytes(batch.getAverageRecordSizeBytes()); shardConsumerMetricsReporter.setNumberOfAggregatedRecords(batch.getAggregatedRecordSize()); shardConsumerMetricsReporter.setNumberOfDeaggregatedRecords(batch.getDeaggregatedRecordSize()); ofNullable(batch.getMillisBehindLatest()).ifPresent(shardConsumerMetricsReporter::setMillisBehindLatest); }); if (result == COMPLETE) { fetcherRef.updateState(subscribedShardStateIndex, SentinelSequenceNumber.SENTINEL_SHARD_ENDING_SEQUENCE_NUM.get()); break; } else { startingPosition = StartingPosition.continueFromSequenceNumber(lastSequenceNum); } } } catch (Throwable t) { fetcherRef.stopWithError(t); } }

Target:
public void run() { try { while (isRunning()) { final RecordPublisherRunResult result = recordPublisher.run(batch -> { for (UserRecord userRecord : batch.getDeaggregatedRecords()) { if (filterDeaggregatedRecord(userRecord)) { deserializeRecordForCollectionAndUpdateState(userRecord); } } shardConsumerMetricsReporter.setAverageRecordSizeBytes(batch.getAverageRecordSizeBytes()); shardConsumerMetricsReporter.setNumberOfAggregatedRecords(batch.getAggregatedRecordSize()); shardConsumerMetricsReporter.setNumberOfDeaggregatedRecords(batch.getDeaggregatedRecordSize()); ofNullable(batch.getMillisBehindLatest()).ifPresent(shardConsumerMetricsReporter::setMillisBehindLatest); return lastSequenceNum; }); if (result == COMPLETE) { fetcherRef.updateState(subscribedShardStateIndex, SentinelSequenceNumber.SENTINEL_SHARD_ENDING_SEQUENCE_NUM.get()); break; } } } catch (Throwable t) { fetcherRef.stopWithError(t); } }
Source:
private Quota fetchQuotaFromDB(Guid quotaId) { if (quotaId != null && quotaId != Guid.Empty) { if (!directQuotaMap.contains(quotaId)) { Quota quota = getQuotaDAO().getById(quotaId); directQuotaMap.put(quotaId, quota); storagePoolQuotaMap.putIfAbsent(quota.getStoragePoolId(), new HashMap<Guid, Quota>()); storagePoolQuotaMap.get(quota.getStoragePoolId()).put(quotaId, quota); } return directQuotaMap.get(quotaId); } return null; }

Target:
private Quota fetchQuotaFromDB(Guid quotaId) { if (quotaId != null && quotaId != Guid.Empty) { if (!directQuotaMap.contains(quotaId)) { Quota quota = getQuotaDAO().getById(quotaId); lock.readLock().lock(); directQuotaMap.put(quotaId, quota); storagePoolQuotaMap.putIfAbsent(quota.getStoragePoolId(), new HashMap<Guid, Quota>()); storagePoolQuotaMap.get(quota.getStoragePoolId()).put(quotaId, quota); lock.readLock().unlock(); } return directQuotaMap.get(quotaId); } return null; }
Source:
protected <T> T resolveTypeFromMap(List<Attachment> inputDataMap, String key, Class<T> clazz, T defaultValue) throws ApiException { try { String att = this.getAttributeValue(key, inputDataMap).orElse(null); if (null != att) { return (T) att; } } catch (Exception e) { log.debug("Failed to parse parameter ["+key+"]", e); } if(defaultValue != null) { return defaultValue; } throw new ApiException("Key +key+ not defined", 400); }

Target:
protected <T> T resolveTypeFromMap(List<Attachment> inputDataMap, String key, Class<T> clazz, T defaultValue) throws ApiException { T obj = defaultValue; try { obj = this.getAttributeValue(key, inputDataMap).map(a -> { return this.castAttribute(a, clazz); }).orElseGet(() -> { return defaultValue; }); } catch (Exception e) { log.debug("Failed to parse parameter ["+key+"]", e); } if (obj == null) { throw new ApiException("Key +key+ not defined", 400); } return obj; }
Source:
public ModifierKeywordTreeImpl MODIFIER_KEYWORD() { return b.<ModifierKeywordTreeImpl>nonterminal().is( f.modifierKeyword( b.firstOf( b.token(JavaKeyword.PUBLIC), b.token(JavaKeyword.PROTECTED), b.token(JavaKeyword.PRIVATE), b.token(JavaKeyword.ABSTRACT), b.token(JavaKeyword.STATIC), b.token(JavaKeyword.FINAL), b.token(JavaKeyword.TRANSIENT), b.token(JavaKeyword.VOLATILE), b.token(JavaKeyword.SYNCHRONIZED), b.token(JavaKeyword.NATIVE), b.token(JavaKeyword.DEFAULT), b.token(JavaKeyword.STRICTFP), b.token(JavaRestrictedKeyword.TRANSITIVE)))); }

Target:
public ModifierKeywordTreeImpl MODIFIER_KEYWORD() { return b.<ModifierKeywordTreeImpl>nonterminal().is( f.modifierKeyword( b.firstOf( b.token(JavaKeyword.PUBLIC), b.token(JavaKeyword.PROTECTED), b.token(JavaKeyword.PRIVATE), b.token(JavaKeyword.ABSTRACT), b.token(JavaKeyword.STATIC), b.token(JavaKeyword.FINAL), b.token(JavaKeyword.TRANSIENT), b.token(JavaKeyword.VOLATILE), b.token(JavaKeyword.SYNCHRONIZED), b.token(JavaKeyword.NATIVE), b.token(JavaKeyword.DEFAULT), b.token(JavaKeyword.STRICTFP)))); }
Source:
public static boolean isTestModeSet() { String testModeCacheDisabled = System.getProperty(NUXEO_TESTING_PROP_CACHE_DISABLED); if (Boolean.FALSE.equals(Boolean.parseBoolean(testModeCacheDisabled))) { if (testModeSet == null) { testModeSet = isBooleanPropertyTrue(NUXEO_TESTING_SYSTEM_PROP); } return testModeSet; } return isBooleanPropertyTrue(NUXEO_TESTING_SYSTEM_PROP); }

Target:
public static boolean isTestModeSet() { return isBooleanPropertyTrue(NUXEO_TESTING_SYSTEM_PROP); }
Source:
public List<ScriptResult<Object>> executeNodeSourceScript(@HeaderParam("sessionid") String sessionId, @FormParam("nodesource") String nodeSource, @FormParam("script") String script, @FormParam("scriptEngine") String scriptEngine) throws Throwable { RMProxyUserInterface rm = checkAccess(sessionId); List<ScriptResult<Object>> results = rm.executeScript(script, scriptEngine, TargetType.NODESOURCE_NAME.name(), Collections.singleton(nodeSource)); List<ScriptResult<Object>> awaitedResults = new LinkedList<>(); for (ScriptResult result : results) { awaitedResults.add(PAFuture.getFutureValue(result)); } checkEmptyScriptResults(awaitedResults); return awaitedResults; }

Target:
public List<ScriptResult<Object>> executeNodeSourceScript(@HeaderParam("sessionid") String sessionId, @FormParam("nodesource") String nodeSource, @FormParam("script") String script, @FormParam("scriptEngine") String scriptEngine) throws Throwable { RMProxyUserInterface rm = checkAccess(sessionId); List<ScriptResult<Object>> results = rm.executeScript(script, scriptEngine, TargetType.NODESOURCE_NAME.name(), Collections.singleton(nodeSource)); List<ScriptResult<Object>> awaitedResults = results.stream() .map(result -> PAFuture.getFutureValue(result)) .collect(Collectors.toList()); checkEmptyScriptResults(awaitedResults); return awaitedResults; }
Source:
public void update(UpdateOptions updateOptions) { updateOptions.newEmailOption.ifPresent(s -> email = s); updateOptions.nameOption.ifPresent(s -> { name = s; lastName = StringHelper.splitName(s)[1]; }); updateOptions.lastNameOption.ifPresent(s -> lastName = s); updateOptions.commentOption.ifPresent(s -> comments = s); updateOptions.googleIdOption.ifPresent(s -> googleId = s); updateOptions.teamNameOption.ifPresent(s -> team = s); updateOptions.sectionNameOption.ifPresent(s -> section = s.isEmpty() ? Const.DEFAULT_SECTION : s); }

Target:
public void update(UpdateOptions updateOptions) { updateOptions.newEmailOption.ifPresent(s -> email = s); updateOptions.nameOption.ifPresent(s -> { name = s; lastName = StringHelper.splitName(s)[1]; }); updateOptions.lastNameOption.ifPresent(s -> lastName = s); updateOptions.commentOption.ifPresent(s -> comments = s); updateOptions.googleIdOption.ifPresent(s -> googleId = s); updateOptions.teamNameOption.ifPresent(s -> team = s); updateOptions.sectionNameOption.ifPresent(s -> section = s); }
Source:
public void invalid_wrongType() { @Indexed(index = INDEX_NAME) class IndexedEntity { Integer id; String text; String invalid; @DocumentId public Integer getId() { return id; } @GenericField public String getText() { return text; } @IndexedEmbedded public String getInvalid() { return invalid; } } SubTest.expectException( () -> setupHelper.start() .withAnnotatedEntityTypes( IndexedEntity.class ) .setup() ) .assertThrown() .isInstanceOf( SearchException.class ) .hasMessageContaining( "HSEARCH700060: The indexed embedded property 'invalid' of type 'java.lang.String' does not provide any valid field." ); }

Target:
public void invalid_wrongType() { @Indexed(index = INDEX_NAME) class IndexedEntity { Integer id; String text; String invalid; @DocumentId public Integer getId() { return id; } @GenericField public String getText() { return text; } @IndexedEmbedded public String getInvalid() { return invalid; } } SubTest.expectException( () -> setupHelper.start() .withAnnotatedEntityTypes( IndexedEntity.class ) .setup() ) .assertThrown() .isInstanceOf( SearchException.class ) .hasMessageMatching( FailureReportUtils.buildFailureReportPattern() .typeContext( IndexedEntity.class.getName() ) .pathContext( ".invalid" ) .failure( "Type '" + String.class.getName() + "' cannot be indexed-embedded, because no index mapping (@GenericField, @FullTextField, ...) is defined for that type." ) .build() ); }
Source:
public void testFromByteArraySummerTime() throws Exception { final com.alliander.osgp.dto.valueobjects.smartmetering.CosemDateTimeDto cosemDateTime = this.dlmsHelperService .fromDateTimeValue(this.byteArraySummerTime()); assertTrue(cosemDateTime.isDateTimeSpecified()); final DateTime dateInSummerTime = cosemDateTime.asDateTime(); assertEquals("2015-07-21T14:53:07.230+02:00", ISODateTimeFormat.dateTime().print(dateInSummerTime)); }

Target:
public void testFromByteArraySummerTime() throws Exception { final CosemDateTimeDto cosemDateTime = this.dlmsHelperService.fromDateTimeValue(this.byteArraySummerTime()); assertTrue(cosemDateTime.isDateTimeSpecified()); final DateTime dateInSummerTime = cosemDateTime.asDateTime(); assertEquals("2015-07-21T14:53:07.230+02:00", ISODateTimeFormat.dateTime().print(dateInSummerTime)); }
Source:
public ExecutationType solutionFound(ThreadContext context, Solution solution) { if (solution == null) { return ExecutationType.CONTINUE; } return ExecutationType.STOP_ALL; }

Target:
public ExecutationType solutionFound(ThreadContext context, Solution solution) { return ExecutationType.STOP_ALL; }