auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testLimitedCteWithoutLimitInMainQueryButWithCollectionFetch() { Function<Integer, List<Person>> fetchPersonBatch = batch -> cbf.create(em, Person.class) .setProperty(ConfigurationProperties.INLINE_CTES, Boolean.FALSE.toString()) .with(PersonCTE.class) .from(Person.class) .bind("id").select("id") .bind("name").select("NULL") .bind("age").select("NULL") .bind("idx").select("NULL") .bind("owner").select("NULL") .orderByAsc("name") .setFirstResult(batch) .setMaxResults(1) .end() .from(Person.class) .fetch("ownedDocuments") .where("id").in().from(PersonCTE.class).select("id").end() .getResultList(); List<Person> personBatch1 = fetchPersonBatch.apply(0); List<Person> personBatch2 = fetchPersonBatch.apply(1); assertEquals(1, new HashSet<>(personBatch1).size()); assertEquals(2, personBatch1.get(0).getOwnedDocuments().size()); assertEquals(1, new HashSet<>(personBatch2).size()); assertEquals(2, personBatch2.get(0).getOwnedDocuments().size()); }

Target:
public void testLimitedCteWithoutLimitInMainQueryButWithCollectionFetch() { Function<Integer, List<Person>> fetchPersonBatch = batch -> cbf.create(em, Person.class) .with(PersonCTE.class, false) .from(Person.class) .bind("id").select("id") .bind("name").select("NULL") .bind("age").select("NULL") .bind("idx").select("NULL") .bind("owner").select("NULL") .orderByAsc("name") .setFirstResult(batch) .setMaxResults(1) .end() .from(Person.class) .fetch("ownedDocuments") .where("id").in().from(PersonCTE.class).select("id").end() .getResultList(); List<Person> personBatch1 = fetchPersonBatch.apply(0); List<Person> personBatch2 = fetchPersonBatch.apply(1); assertEquals(1, new HashSet<>(personBatch1).size()); assertEquals(2, personBatch1.get(0).getOwnedDocuments().size()); assertEquals(1, new HashSet<>(personBatch2).size()); assertEquals(2, personBatch2.get(0).getOwnedDocuments().size()); }
Source:
public QueryFactoryBuilder use(final BeanAdapter beanAdapter) { checkNotNull(beanAdapter); final TypeToken adapterForType = TypeToken.of(beanAdapter.getClass()) .getSupertype(BeanAdapter.class) .resolveType(BeanAdapter.class.getTypeParameters()[0]); beanAdapters.putIfAbsent(adapterForType.getRawType(), beanAdapter); return this; }

Target:
public QueryFactoryBuilder use(final BeanAdapter beanAdapter) { checkNotNull(beanAdapter); final TypeToken adapterForType = TypeToken.of(beanAdapter.getClass()) .getSupertype(BeanAdapter.class) .resolveType(BeanAdapter.class.getTypeParameters()[0]); beanAdapters.putIfAbsent(adapterForType.getType(), beanAdapter); return this; }
Source:
public void testExtents() throws Exception { String NOT_USED = null; DateFormatTransform transform = new DateFormatTransform("not used", NOT_USED, NOT_USED, NOT_USED); GregorianCalendar cal = new GregorianCalendar(); cal.clear(); cal.setTimeZone(TimeZone.getTimeZone("GMT")); int minYear = -292269052; Date parsed = transform.parseDate("" + minYear); cal.setTime(parsed); assertEquals(minYear - 1, - cal.get(Calendar.YEAR)); assertEquals(GregorianCalendar.BC,cal.get(Calendar.ERA)); cal.setTimeInMillis(Long.MAX_VALUE); int maxYear = cal.get(Calendar.YEAR); parsed = transform.parseDate("" + maxYear); cal.setTime(parsed); assertEquals(maxYear, cal.get(Calendar.YEAR)); assertEquals(GregorianCalendar.AD, cal.get(Calendar.ERA)); }

Target:
public void testExtents() throws Exception { DateFormatTransform transform = new DateFormatTransform("not used", null); GregorianCalendar cal = new GregorianCalendar(); cal.clear(); cal.setTimeZone(TimeZone.getTimeZone("GMT")); int minYear = -292269052; Date parsed = transform.parseDate("" + minYear); cal.setTime(parsed); assertEquals(minYear - 1, - cal.get(Calendar.YEAR)); assertEquals(GregorianCalendar.BC,cal.get(Calendar.ERA)); cal.setTimeInMillis(Long.MAX_VALUE); int maxYear = cal.get(Calendar.YEAR); parsed = transform.parseDate("" + maxYear); cal.setTime(parsed); assertEquals(maxYear, cal.get(Calendar.YEAR)); assertEquals(GregorianCalendar.AD, cal.get(Calendar.ERA)); }
Source:
public void run() { startTime = System.currentTimeMillis(); try { tajoClient = TajoHAClientUtil.getTajoClient(tajoConf, tajoClient); if (!tajoClient.getCurrentDatabase().equals(database)) tajoClient.selectDatabase(database); response = tajoClient.executeQuery(query); if (response == null) { LOG.error("Internal Error: SubmissionResponse is NULL"); error = new Exception("Internal Error: SubmissionResponse is NULL"); } else if (response.getResultCode() == ClientProtos.ResultCode.OK) { if (response.getIsForwarded()) { queryId = new QueryId(response.getQueryId()); getQueryResult(queryId); } else { if (!response.hasTableDesc() && !response.hasResultSet()) { } else { getSimpleQueryResult(response); } progress.set(100); } } else if (response.getResultCode() == ClientProtos.ResultCode.ERROR) { if (response.hasErrorMessage()) { StringBuffer errorMessage = new StringBuffer(response.getErrorMessage()); String modifiedMessage; if (errorMessage.length() > 200) { modifiedMessage = errorMessage.substring(0, 200); } else { modifiedMessage = errorMessage.toString(); } error = new Exception(modifiedMessage); } } } catch (Exception e) { LOG.error(e.getMessage(), e); error = e; } finally { running.set(false); finishTime = System.currentTimeMillis(); if (queryId != null) { tajoClient.closeQuery(queryId); } } }

Target:
public void run() { startTime = System.currentTimeMillis(); try { tajoClient = TajoHAClientUtil.getTajoClient(tajoConf, tajoClient); if (!tajoClient.getCurrentDatabase().equals(database)) tajoClient.selectDatabase(database); response = tajoClient.executeQuery(query); if (response == null) { LOG.error("Internal Error: SubmissionResponse is NULL"); error = new Exception("Internal Error: SubmissionResponse is NULL"); } else if (response.getResultCode() == ClientProtos.ResultCode.OK) { if (response.getIsForwarded()) { queryId = new QueryId(response.getQueryId()); getQueryResult(queryId); } else { if (!response.hasTableDesc() && !response.hasResultSet()) { } else { getSimpleQueryResult(response); } progress.set(100); } } else if (response.getResultCode() == ClientProtos.ResultCode.ERROR) { if (response.hasErrorMessage()) { StringBuffer errorMessage = new StringBuffer(response.getErrorMessage()); String modifiedMessage; if (errorMessage.length() > 200) { modifiedMessage = errorMessage.substring(0, 200); } else { modifiedMessage = errorMessage.toString(); } String lineSeparator = System.getProperty("line.separator"); modifiedMessage = modifiedMessage.replaceAll(lineSeparator, "<br/>"); error = new Exception(modifiedMessage); } } } catch (Exception e) { LOG.error(e.getMessage(), e); error = e; } finally { running.set(false); finishTime = System.currentTimeMillis(); if (queryId != null) { tajoClient.closeQuery(queryId); } } }
Source:
private String getModule(String shipName){ Set<ResourceUrn> configUrnList = Assets.getAssetHelper().list(Json.class, "[a-zA-Z]*:playerSpawnConfig"); for (ResourceUrn configUrn : configUrnList) {Json json = Assets.getJson(configUrn.toString()); JSONObject rootNode = json.getJsonValue(); if (rootNode.keySet().contains(shipName) && rootNode.get(shipName) instanceof JSONObject) { String moduleName = configUrn.toString().split(":")[0]; return moduleName; } } return "engine"; }

Target:
private String getModule(String shipName) { Set<ResourceUrn> configUrnList = Assets.getAssetHelper().list(Json.class, "[a-zA-Z]*:playerSpawnConfig"); for (ResourceUrn configUrn : configUrnList) {Json json = Assets.getJson(configUrn.toString()); JSONObject rootNode = json.getJsonValue(); if (rootNode.keySet().contains(shipName) && rootNode.get(shipName) instanceof JSONObject) { return configUrn.toString().split(":")[0]; } } return "engine"; }
Source:
protected HttpWebRequest buildEwsHttpWebRequest() throws Exception { try { HttpWebRequest request = getService().prepareHttpWebRequest(); getService().traceHttpRequestHeaders(TraceFlags.EwsRequestHttpHeaders, request); boolean needSignature = getService().getCredentials() != null && getService().getCredentials().isNeedSignature(); ByteArrayOutputStream requestStream = (ByteArrayOutputStream) request.getOutputStream(); EwsServiceXmlWriter writer = new EwsServiceXmlWriter(getService(), requestStream); writer.setRequireWSSecurityUtilityNamespace(needSignature); writeToXml(writer); if (needSignature) { getService().getCredentials().sign(requestStream); } if (getService().isTraceEnabledFor(TraceFlags.EwsRequest)) { getService().traceXml(TraceFlags.EwsRequest, requestStream); } return request; } catch (IOException e) { throw new ServiceRequestException(String.format(Strings.ServiceRequestFailed, e.getMessage()), e); } }

Target:
protected HttpWebRequest buildEwsHttpWebRequest() throws Exception { try { HttpWebRequest request = service.prepareHttpWebRequest(); service.traceHttpRequestHeaders(TraceFlags.EwsRequestHttpHeaders, request); ByteArrayOutputStream requestStream = (ByteArrayOutputStream) request.getOutputStream(); EwsServiceXmlWriter writer = new EwsServiceXmlWriter(service, requestStream); boolean needSignature = service.getCredentials() != null && service.getCredentials().isNeedSignature(); writer.setRequireWSSecurityUtilityNamespace(needSignature); writeToXml(writer); if (needSignature) { service.getCredentials().sign(requestStream); } if (service.isTraceEnabledFor(TraceFlags.EwsRequest)) { service.traceXml(TraceFlags.EwsRequest, requestStream); } return request; } catch (IOException e) { throw new ServiceRequestException(String.format(Strings.ServiceRequestFailed, e.getMessage()), e); } }
Source:
private static AppiumDriver getDriverSafe(WebDriver driver) { if (driver instanceof EventFiringWebDriver) { driver = ((EventFiringWebDriver) driver).getWrappedDriver(); if (driver instanceof AppiumDriver) { return (AppiumDriver) driver; } } if (driver instanceof Proxy) { InvocationHandler innerProxy = Proxy.getInvocationHandler(driver); Field locatorField = null; try { locatorField = innerProxy.getClass().getDeclaredField("arg$2"); } catch (NoSuchFieldException e) { e.printStackTrace(); } locatorField.setAccessible(true); WebDriver appiumDriver = null; try { appiumDriver = (WebDriver) locatorField.get(innerProxy); } catch (IllegalAccessException e) { e.printStackTrace(); } if (appiumDriver instanceof AppiumDriver) { return (AppiumDriver) driver; } } throw new ClassCastException("Appium Driver can not be casted from the actual driver."); }

Target:
private static AppiumDriver getDriverSafe(WebDriver driver) { if (driver instanceof EventFiringWebDriver) { driver = ((EventFiringWebDriver) driver).getWrappedDriver(); if (driver instanceof AppiumDriver) { return (AppiumDriver) driver; } } if (driver instanceof Proxy) { InvocationHandler innerProxy = Proxy.getInvocationHandler(driver); Field locatorField = null; try { locatorField = innerProxy.getClass().getDeclaredField("arg$2"); } catch (NoSuchFieldException e) { LOGGER.error(e.getMessage()); } if (locatorField!=null) { locatorField.setAccessible(true); WebDriver appiumDriver = null; try { appiumDriver = (WebDriver) locatorField.get(innerProxy); } catch (IllegalAccessException e) { LOGGER.error(e.getMessage()); } if (appiumDriver instanceof AppiumDriver) { return (AppiumDriver) appiumDriver; } } } throw new ClassCastException("Appium Driver can not be casted from the actual driver."); }
Source:
public void shouldResizeTerminal() { openMC("/"); try { for (String partOfContent : CHECK_MC_OPENING) { terminal.waitTextInFirstTerminal(partOfContent); } terminal.waitNoTextInFirstTerminal(".dockerenv"); } catch (TimeoutException ex) { fail("Known issue <LINK_0>", ex); } consoles.clickOnMaximizePanelIcon(); loader.waitOnClosed(); try { for (String partOfContent : CHECK_MC_OPENING) { terminal.waitTextInFirstTerminal(partOfContent); } terminal.waitTextInFirstTerminal(".dockerenv"); } catch (TimeoutException ex) { fail("Known issue <LINK_0>"); } consoles.clickOnMaximizePanelIcon(); loader.waitOnClosed(); try { for (String partOfContent : CHECK_MC_OPENING) { terminal.waitTextInFirstTerminal(partOfContent); } terminal.waitNoTextInFirstTerminal(".dockerenv"); } catch (TimeoutException ex) { fail("Known issue <LINK_0>", ex); } }

Target:
public void shouldResizeTerminal() { openMC("/"); try { for (String partOfContent : CHECK_MC_OPENING) { terminal.waitTextInFirstTerminal(partOfContent); } terminal.waitNoTextInFirstTerminal(".dockerenv"); } catch (TimeoutException ex) { fail("Known random failure <LINK_0>", ex); } consoles.clickOnMaximizePanelIcon(); loader.waitOnClosed(); try { for (String partOfContent : CHECK_MC_OPENING) { terminal.waitTextInFirstTerminal(partOfContent); } terminal.waitTextInFirstTerminal(".dockerenv"); } catch (TimeoutException ex) { fail("Known random failure <LINK_0>", ex); } consoles.clickOnMaximizePanelIcon(); loader.waitOnClosed(); try { for (String partOfContent : CHECK_MC_OPENING) { terminal.waitTextInFirstTerminal(partOfContent); } terminal.waitNoTextInFirstTerminal(".dockerenv"); } catch (TimeoutException ex) { fail("Known random failure <LINK_0>", ex); } }
Source:
public synchronized void reset(boolean cleanListeners) { acceptedChannels.forEach(IOUtil::closeResource); mappedConnections.values().forEach(conn -> close(conn, "EndpointManager is stopping")); connections.forEach(conn -> close(conn, "EndpointManager is stopping")); acceptedChannels.clear(); connectionsInProgress.clear(); mappedConnections.clear(); monitors.clear(); connections.clear(); if (cleanListeners) { connectionListeners.clear(); } }

Target:
public synchronized void reset(boolean cleanListeners) { acceptedChannels.forEach(IOUtil::closeResource); mappedConnections.values().forEach(conn -> close(conn, "TcpServerConnectionManager is stopping")); connections.forEach(conn -> close(conn, "TcpServerConnectionManager is stopping")); acceptedChannels.clear(); connectionsInProgress.clear(); mappedConnections.clear(); monitors.clear(); connections.clear(); if (cleanListeners) { connectionListeners.clear(); } }
Source:
public static String map(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType glusterVolumeType, String template) { switch (glusterVolumeType) { case DISTRIBUTE: return GlusterVolumeType.DISTRIBUTE.name(); case REPLICATE: return GlusterVolumeType.REPLICATE.name(); case DISTRIBUTED_REPLICATE: return GlusterVolumeType.DISTRIBUTED_REPLICATE.name(); case STRIPE: return GlusterVolumeType.STRIPE.name(); case DISTRIBUTED_STRIPE: return GlusterVolumeType.DISTRIBUTED_STRIPE.name(); default: return null; } }

Target:
public static String map(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType glusterVolumeType, String template) { switch (glusterVolumeType) { case DISTRIBUTE: return GlusterVolumeType.DISTRIBUTE.value(); case REPLICATE: return GlusterVolumeType.REPLICATE.value(); case DISTRIBUTED_REPLICATE: return GlusterVolumeType.DISTRIBUTED_REPLICATE.value(); case STRIPE: return GlusterVolumeType.STRIPE.value(); case DISTRIBUTED_STRIPE: return GlusterVolumeType.DISTRIBUTED_STRIPE.value(); default: return null; } }
Source:
@Override public void run() throws InterruptedException { Row row = null; while ((row = source.receive()) != null) { for (Object value: row.getValues()) { int i = 1; if (value instanceof List) { List list = (List) value; for (Object o : list) { if (rel.withOrdinality) { sink.send(Row.of(o, i++)); } else { sink.send(Row.of(o)); } } } else if (value instanceof Map) { Map map = (Map) value; for (Object key : map.keySet()) { if (rel.withOrdinality) { sink.send(Row.of(key, map.get(key), i++)); } else { sink.send(Row.of(key, map.get(key))); } } } else { throw new UnsupportedOperationException("Invalid type for unnest."); } } } }

Target:
@Override public void run() throws InterruptedException { Row row = null; while ((row = source.receive()) != null) { for (Object value: row.getValues()) { if (value == null) { throw new NullPointerException("NULL value for unnest."); } int i = 1; if (value instanceof List) { List list = (List) value; for (Object o : list) { if (rel.withOrdinality) { sink.send(Row.of(o, i++)); } else { sink.send(Row.of(o)); } } } else if (value instanceof Map) { Map map = (Map) value; for (Object key : map.keySet()) { if (rel.withOrdinality) { sink.send(Row.of(key, map.get(key), i++)); } else { sink.send(Row.of(key, map.get(key))); } } } else { throw new UnsupportedOperationException( String.format(Locale.ROOT, "Invalid type: %s for unnest.", value.getClass().getCanonicalName())); } } } }
Source:
private void onTextBoxBase(final TextBoxBase tb) { DeferredCommand.add(new Command() { public void execute() { String orig = strings.get(tb); orig = orig == null ? "" : orig; if (! orig.equals(tb.getText())) { widget.setEnabled(true); } } }); }

Target:
private void onTextBoxBase(final TextBoxBase tb) { DeferredCommand.add(new Command() { @Override public void execute() { String orig = strings.get(tb); if (orig == null) { orig = ""; } if (! orig.equals(tb.getText())) { widget.setEnabled(true); } } }); }
Source:
String readString() { byte mark = readByte(); switch(mark) { case 0: return ""; case 1: int size = readByte(); String str = new String(bytes, 0, pos, size); pos += size; return str; case 2: return readUTF(); case 3: default: throw new RuntimeException("Unknown marker(String). mark=" + mark); } }

Target:
String readString() { byte mark = readByte(); switch(mark) { case 0: return ""; case 1: int size = readByte(); String str = new String(bytes, 0, pos, size); pos += size; return str; case 2: return readUTF(); default: throw new RuntimeException("Unknown marker(String). mark=" + mark); } }
Source:
public void successfulBoot() throws ConfigurationPersistenceException { final ConfigurationFile configurationFile = environment.getHostConfigurationFile(); ConfigurationFile.InteractionPolicy policy = configurationFile.getInteractionPolicy(); hostPersister.successfulBoot(); if (domainPersister != null) { domainPersister.successfulBoot(); } }

Target:
public void successfulBoot() throws ConfigurationPersistenceException { hostPersister.successfulBoot(); if (domainPersister != null) { domainPersister.successfulBoot(); } }
Source:
private void saveFeedFile(String directory, String fileName) throws IOException { URL fileUrl = new URL(String.format("%s%s/%s.tbz", feedPath, directory, fileName)); File itunesFeedFile = new File(String.format( "%s%s/%s", localFilesPath, itunesDirectory, fileName )); FileUtils.copyURLToFile( fileUrl, itunesFeedFile ); String currentDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); s3client.put(String.format("%s_%s", fileName, currentDate), itunesFeedFile); }

Target:
private void saveFeedFile(String directory, String fileName) throws IOException { URL fileUrl = new URL(String.format("%s%s/%s.tbz", feedPath, directory, fileName)); File itunesFeedFile = new File(String.format( "%stmp_%s/%s", localFilesPath, itunesDirectory, fileName )); FileUtils.copyURLToFile( fileUrl, itunesFeedFile ); String currentDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); s3client.put(String.format("%s_%s", fileName, currentDate), itunesFeedFile); }
Source:
public void testGetHeaders() throws Exception { Api api = new Api("test.wikipedia.org"); String inputText = "Test String"; String inputTitle = "Test Title"; ApiResult result = api.action("parse") .param("title", inputTitle) .param("text", inputText) .param("prop", "wikitext") .get(); JSONObject jsonObject = result.asObject(); Map<String, List<String>> m = result.getHeaders(); assertNotNull(m); }

Target:
public void testGetHeaders() throws Exception { Api api = new Api("test.wikipedia.org"); String inputText = "Test String"; String inputTitle = "Test Title"; ApiResult result = api.action("parse") .param("title", inputTitle) .param("text", inputText) .param("prop", "wikitext") .get(); JSONObject jsonObject = result.asObject(); Map<String, List<String>> m = result.getHeaders(); assertNotNull(m); assertFalse(m.isEmpty()); assertTrue(m.containsKey("Content-Type")); }
Source:
public void tearDown() throws Exception { super.clearDB(); try { final Class<?> entityClass = getEntityClass(); final Class<?> historyClass = getHistoryClass(); final Class<?> trashClass = getTrashClass(); TransactionTemplate transactionTemplate = new TransactionTemplate(getDataTransactionManager()); transactionTemplate.execute(new TransactionCallbackWithoutResult() { @Override protected void doInTransactionWithoutResult(TransactionStatus status) { getDataPersistenceManager().deletePersistentAll(getAll(entityClass, false)); getDataPersistenceManager().deletePersistentAll(getAll(historyClass, false)); getDataPersistenceManager().deletePersistentAll(getAll(trashClass, false)); } }); } catch (ClassNotFoundException e) { throw new IllegalStateException(e); } }

Target:
public void tearDown() throws Exception { super.clearDB(); final Class<?> entityClass = getEntityClass(); final Class<?> historyClass = getHistoryClass(); final Class<?> trashClass = getTrashClass(); TransactionTemplate transactionTemplate = new TransactionTemplate(getDataTransactionManager()); transactionTemplate.execute(new TransactionCallbackWithoutResult() { @Override protected void doInTransactionWithoutResult(TransactionStatus status) { getDataPersistenceManager().deletePersistentAll(getAll(entityClass, false)); getDataPersistenceManager().deletePersistentAll(getAll(historyClass, false)); getDataPersistenceManager().deletePersistentAll(getAll(trashClass, false)); } }); }
Source:
protected void executeCommand() { String slaveHost = parameter.getSlaveNodeIp(); String slaveRootPassword = parameter.getSlavePassword(); String slaveSShFingerPrint = GlusterUtil.getInstance().getHostSSHFingerPrint(slaveHost); VDSReturnValue sessionCreateReturnValue = null; VDSReturnValue passwordlessSSHCreateReturnValue = runVdsCommand(VDSCommandType.CreatePasswordLessSSHSession, new GlusterSshSessionParameters(slaveHost, slaveSShFingerPrint, parameter.getUserName(), parameter.getSlavePassword())); if (passwordlessSSHCreateReturnValue.getSucceeded()) { sessionCreateReturnValue = runVdsCommand(VDSCommandType.GlusterVolumeGeoRepSessionCreate, new GlusterVolumeGeoRepVDSParamaters(upServer.getId(), masterVolume.getName(), slaveHost, slaveRootPassword, parameter.getSlaveVolumeName(), parameter.isForce())); if (!getSucceeded()) { handleVdsError(AuditLogType.GLUSTER_VOLUME_GEO_REP_CREATE_FAILED, sessionCreateReturnValue.getVdsError().getMessage()); return; } setSucceeded(sessionCreateReturnValue.getSucceeded()); } else { handleVdsError(AuditLogType.GLUSTER_VOLUME_PASSWORD_LESS_SSH_FAILED, passwordlessSSHCreateReturnValue.getVdsError().getMessage()); setSucceeded(false); } getReturnValue().setActionReturnValue(sessionCreateReturnValue); }

Target:
protected void executeCommand() { String slaveHost = parameter.getSlaveNodeIp(); String slaveUserPassword = parameter.getSlavePassword(); String slaveSShFingerPrint = GlusterUtil.getInstance().getHostSSHFingerPrint(slaveHost); VDSReturnValue sessionCreateReturnValue = null; VDSReturnValue passwordlessSSHCreateReturnValue = runVdsCommand(VDSCommandType.CreatePasswordLessSSHSession, new GlusterSshSessionParameters(slaveHost, slaveSShFingerPrint, parameter.getUserName(), parameter.getSlavePassword())); if (passwordlessSSHCreateReturnValue.getSucceeded()) { sessionCreateReturnValue = runVdsCommand(VDSCommandType.GlusterVolumeGeoRepSessionCreate, new GlusterVolumeGeoRepVDSParamaters(upServer.getId(), masterVolume.getName(), slaveHost, slaveUserPassword, parameter.getSlaveVolumeName(), parameter.isForce())); if (!getSucceeded()) { handleVdsError(AuditLogType.GLUSTER_VOLUME_GEO_REP_CREATE_FAILED, sessionCreateReturnValue.getVdsError().getMessage()); return; } setSucceeded(sessionCreateReturnValue.getSucceeded()); } else { handleVdsError(AuditLogType.GLUSTER_VOLUME_PASSWORD_LESS_SSH_FAILED, passwordlessSSHCreateReturnValue.getVdsError().getMessage()); setSucceeded(false); } getReturnValue().setActionReturnValue(sessionCreateReturnValue); }
Source:
public void setSortInfos(List<SortInfo> sortInfo) { if (sortInfoChanged(this.sortInfos, sortInfo)) { this.sortInfos = sortInfo; } }

Target:
public void setSortInfos(List<SortInfo> sortInfo) { if (sortInfoChanged(this.sortInfos, sortInfo)) { this.sortInfos = sortInfo; refresh(); } }
Source:
public IResource copy(final String newName, final boolean copySuppFiles) { final IPath newPath = getParent().getResource().getFullPath().addTrailingSeparator().append(newName); if (copySuppFiles) { String newElementPath = new Path(getElementPath()).removeLastSegments(1).append(newName).toString(); copySupplementaryFolder(newElementPath); } try { getResource().copy(newPath, IResource.FORCE | IResource.SHALLOW, null); IResource trace = ((IFolder) getParent().getResource()).findMember(newName); if( trace == null ) { return null; } if (trace.exists()) { if( trace instanceof IFolder) { IFolder folderTrace = (IFolder) trace; for (IResource member : folderTrace.members()) { if (TmfTrace.class.getCanonicalName().equals(member.getPersistentProperty(TmfCommonConstants.TRACETYPE))) { member.delete(true, null); } else if (TmfExperiment.class.getCanonicalName().equals(member.getPersistentProperty(TmfCommonConstants.TRACETYPE))) { member.delete(true, null); } } } } return trace; } catch (CoreException e) { } return null; }

Target:
public IResource copy(final String newName, final boolean copySuppFiles) { final IPath newPath = getParent().getResource().getFullPath().addTrailingSeparator().append(newName); if (copySuppFiles) { String newElementPath = new Path(getElementPath()).removeLastSegments(1).append(newName).toString(); copySupplementaryFolder(newElementPath); } try { getResource().copy(newPath, IResource.FORCE | IResource.SHALLOW, null); IResource trace = ((IFolder) getParent().getResource()).findMember(newName); if (trace instanceof IFolder) { IFolder folderTrace = (IFolder) trace; for (IResource member : folderTrace.members()) { if (TmfTrace.class.getCanonicalName().equals(member.getPersistentProperty(TmfCommonConstants.TRACETYPE))) { member.delete(true, null); } else if (TmfExperiment.class.getCanonicalName().equals(member.getPersistentProperty(TmfCommonConstants.TRACETYPE))) { member.delete(true, null); } } } return trace; } catch (CoreException e) { } return null; }
Source:
private void notifyCompletionToListeners(List<BackupUpdateListener> listeners, boolean backedupWrapperConfig) { String message = backedupWrapperConfig ? "Backup was generated successfully." : "Backup was generated successfully. WrapperConfig backup was skipped, as the Wrapper Config Dir path is unknown."; listeners.forEach(listener -> listener.completed(message)); }

Target:
private void notifyCompletionToListeners(List<BackupUpdateListener> listeners, boolean backedupWrapperConfig) { String message = backedupWrapperConfig ? "Backup was generated successfully." : "Backup was generated successfully. Backup of wrapper configuration was skipped as the wrapper configuration directory path is unknown."; listeners.forEach(listener -> listener.completed(message)); }
Source:
public boolean isDataAvailable(ScheduledTime t, Properties props) { String rawPathString = props.getProperty(PATH_KEY); Util.requireNonNull(rawPathString); String cookedPathString = tokenReplacer.replaceTimeTokens( rawPathString, t); try { Configuration conf = new Configuration(); FileSystem fs = FileSystem.get(URI.create(cookedPathString), conf); Path path = new Path(cookedPathString); boolean result = fs.exists(path); return result; } catch (IOException e) { return false; } }

Target:
public boolean isDataAvailable(ScheduledTime t, Properties props) throws Exception { String rawPathString = props.getProperty(PATH_KEY); Util.requireNonNull(rawPathString); String cookedPathString = tokenReplacer.replaceTimeTokens( rawPathString, t); Configuration conf = new Configuration(); FileSystem fs = FileSystem.get(URI.create(cookedPathString), conf); Path path = new Path(cookedPathString); boolean result = fs.exists(path); return result; }
Source:
public List<Storage> listStorages() { final List<Storage> storages; try { storages = storageDbRepository.listStorages(); } catch (RepositoryProblemException e) { LOG.error("DB error occurred when listing storages", e); throw new InternalNakadiException(e.getMessage()); } return storages; }

Target:
public List<Storage> listStorages() throws InternalNakadiException { final List<Storage> storages; try { storages = storageDbRepository.listStorages(); } catch (RepositoryProblemException e) { LOG.error("DB error occurred when listing storages", e); throw new InternalNakadiException(e.getMessage()); } return storages; }
Source:
private JPanel createJSonPathExtractorTasksPanel() { JPanel xpathActionPanel = new JPanel(); xpathActionPanel.setLayout(new BoxLayout(xpathActionPanel, BoxLayout.X_AXIS)); Border margin = new EmptyBorder(5, 5, 0, 5); xpathActionPanel.setBorder(margin); jsonPathExpressionField = new JLabeledTextField(JMeterUtils.getResString("jsonpath_tester_field")); xpathActionPanel.add(jsonPathExpressionField, BorderLayout.WEST); JButton xpathTester = new JButton(JMeterUtils.getResString("jsonpath_tester_button_test")); xpathTester.setActionCommand(JSONPATH_TESTER_COMMAND); xpathTester.addActionListener(this); xpathActionPanel.add(xpathTester, BorderLayout.EAST); jsonPathResultField = new JTextArea(); jsonPathResultField.setEditable(false); jsonPathResultField.setLineWrap(true); jsonPathResultField.setWrapStyleWord(true); JPanel xpathTasksPanel = new JPanel(new BorderLayout(0, 5)); xpathTasksPanel.add(xpathActionPanel, BorderLayout.NORTH); xpathTasksPanel.add(GuiUtils.makeScrollPane(jsonPathResultField), BorderLayout.CENTER); return xpathTasksPanel; }

Target:
private JPanel createJSonPathExtractorTasksPanel() { JPanel jsonPathActionPanel = new JPanel(); jsonPathActionPanel.setLayout(new BoxLayout(jsonPathActionPanel, BoxLayout.X_AXIS)); Border margin = new EmptyBorder(5, 5, 0, 5); jsonPathActionPanel.setBorder(margin); jsonPathExpressionField = new JLabeledTextField(JMeterUtils.getResString("jsonpath_tester_field")); jsonPathActionPanel.add(jsonPathExpressionField, BorderLayout.WEST); JButton xpathTester = new JButton(JMeterUtils.getResString("jsonpath_tester_button_test")); xpathTester.setActionCommand(JSONPATH_TESTER_COMMAND); xpathTester.addActionListener(this); jsonPathActionPanel.add(xpathTester, BorderLayout.EAST); jsonPathResultField = new JTextArea(); jsonPathResultField.setEditable(false); jsonPathResultField.setLineWrap(true); jsonPathResultField.setWrapStyleWord(true); JPanel xpathTasksPanel = new JPanel(new BorderLayout(0, 5)); xpathTasksPanel.add(jsonPathActionPanel, BorderLayout.NORTH); xpathTasksPanel.add(GuiUtils.makeScrollPane(jsonPathResultField), BorderLayout.CENTER); return xpathTasksPanel; }
Source:
private static void initialIndex() { index.add(key("key1"), def1.getName(), "node1 - value1"); index.add(key("key1"), def2.getName(), 1); index.add(key("key1"), def3.getName(), new String[]{"a", "b", "c"}); index.add(key("key2"), def1.getName(), "node2 - value2"); index.add(key("key2"), def2.getName(), 2); index.add(key("key2"), def3.getName(), new String[]{"d", "e", "f"}); index.add(key("key3"), def1.getName(), "node3 - value3"); index.add(key("key3"), def2.getName(), 3); index.add(key("key3"), def3.getName(), new String[]{"h", "i", "g"}); index.add(key("key4"), def1.getName(), "node4 - value4"); index.add(key("key4"), def2.getName(), 4); index.add(key("key4"), def3.getName(), new String[]{"j", "k", "l"}); index.add(key("key5"), def1.getName(), "node5 - value5"); index.add(key("key5"), def2.getName(), 5); index.add(key("key5"), def3.getName(), new String[]{"m", "n", "o"}); index.add(key("key6"), def1.getName(), "the quick Brown fox jumps over to the dog in at the gate"); index.add(key("key6"), def2.getName(), 55); index.add(key("key6"), def3.getName(), new String[]{"m", "n", "o"}); index.add(key("key7"), def5.getName(), "asd-sdf-dfg"); try { Thread.currentThread().sleep(1000); } catch (Exception e) { } }

Target:
private static void initialIndex() { index.add(key("key1"), def1.getName(), "node1 - value1"); index.add(key("key1"), def2.getName(), 1); index.add(key("key1"), def3.getName(), new String[]{"a", "b", "c"}); index.add(key("key2"), def1.getName(), "node2 - value2"); index.add(key("key2"), def2.getName(), 2); index.add(key("key2"), def3.getName(), new String[]{"d", "e", "f"}); index.add(key("key3"), def1.getName(), "node3 - value3"); index.add(key("key3"), def2.getName(), 3); index.add(key("key3"), def3.getName(), new String[]{"h", "i", "g"}); index.add(key("key4"), def1.getName(), "node4 - value4"); index.add(key("key4"), def2.getName(), 4); index.add(key("key4"), def3.getName(), new String[]{"j", "k", "l"}); index.add(key("key5"), def1.getName(), "node5 - value5"); index.add(key("key5"), def2.getName(), 5); index.add(key("key5"), def3.getName(), new String[]{"m", "n", "o"}); index.add(key("key6"), def1.getName(), "the quick Brown fox jumps over to the dog in at the gate"); index.add(key("key6"), def2.getName(), 55); index.add(key("key6"), def3.getName(), new String[]{"m", "n", "o"}); index.add(key("key7"), def5.getName(), "asd-sdf-dfg"); index.commit(); }
Source:
public SshClient create(HostAndPort socket, LoginCredentials credentials) { SshClient client = new SshjSshClient(backoffLimitedRetryHandler, socket, credentials, timeout, injector.getInstance(Connector.class)); injector.injectMembers(client); return client; }

Target:
public SshClient create(HostAndPort socket, LoginCredentials credentials) { SshClient client = new SshjSshClient(backoffLimitedRetryHandler, socket, credentials, timeout, getAgentConnector()); injector.injectMembers(client); return client; }
Source:
public void buildDependencyGraph(AbstractProject owner,DependencyGraph graph) { for (Object o : this) { if (o instanceof DependencyDeclarer) { DependencyDeclarer dd = (DependencyDeclarer) o; try { dd.buildDependencyGraph(owner,graph); } catch (RuntimeException e) { String projectName = owner == null ? "unknown" : owner.getFullDisplayName(); LOGGER.log(Level.SEVERE, "Failed to build dependency graph for " + projectName,e); } } } }

Target:
public void buildDependencyGraph(AbstractProject owner,DependencyGraph graph) { for (Object o : this) { if (o instanceof DependencyDeclarer) { DependencyDeclarer dd = (DependencyDeclarer) o; try { dd.buildDependencyGraph(owner,graph); } catch (RuntimeException e) { LOGGER.log(Level.SEVERE, "Failed to build dependency graph for " + owner,e); } } } }
Source:
public void testGetByIndex() { IndexMapper indexMapper = new IndexMapperByIndex(talend6Schema); DiOutgoingSchemaEnforcer enforcer = new DiOutgoingSchemaEnforcer(talend6Schema, indexMapper); enforcer.setWrapped(record); assertThat(enforcer.get(0), equalTo((Object) 1)); assertThat(enforcer.get(1), equalTo((Object) "User")); assertThat(enforcer.get(2), equalTo((Object) 100)); assertThat(enforcer.get(3), equalTo((Object) true)); assertThat(enforcer.get(4), equalTo((Object) new Date(1467170137872L))); assertThat(enforcer.get(5), equalTo((Object) new Date(1000L))); assertThat(enforcer.get(6), equalTo((Object) new Date(1000L))); assertThat(enforcer.get(7), equalTo((Object) new Date(1467170137872L))); }

Target:
public void testGetByIndex() { IndexMapper indexMapper = new IndexMapperByIndex(talend6Schema); DiOutgoingSchemaEnforcer enforcer = new DiOutgoingSchemaEnforcer(talend6Schema, indexMapper); enforcer.setWrapped(record); assertThat(enforcer.get(0), equalTo((Object) 1)); assertThat(enforcer.get(1), equalTo((Object) "User")); assertThat(enforcer.get(2), equalTo((Object) 100)); assertThat(enforcer.get(3), equalTo((Object) true)); assertThat(enforcer.get(4), equalTo((Object) new Date(1467170137872L))); assertThat(enforcer.get(5), equalTo((Object) DATE_COMPARE)); assertThat(enforcer.get(6), equalTo((Object) 1000)); assertThat(enforcer.get(7), equalTo((Object) new Date(1467170137872L))); }
Source:
public final <T> T build(Class<T> serviceClass, String userAgent) { ObjectMapper objectMapper = getObjectMapper(); ObjectMapper cborObjectMapper = getCborObjectMapper(); return Feign.builder() .contract(createContract()) .encoder( new InputStreamDelegateEncoder( new TextDelegateEncoder( new CborDelegateEncoder( cborObjectMapper, new JacksonEncoder(objectMapper))))) .decoder(createDecoder(objectMapper, cborObjectMapper)) .errorDecoder(FeignSerializableErrorErrorDecoder.INSTANCE) .client(createOkHttpClient(config.uris())) .options(createRequestOptions()) .logger(new Slf4jLogger(JaxRsClient.class)) .logLevel(Logger.Level.BASIC) .requestInterceptor(UserAgentInterceptor.of(userAgent)) .target(serviceClass, primaryUri); }

Target:
public final <T> T build(Class<T> serviceClass, String userAgent) { ObjectMapper objectMapper = getObjectMapper(); ObjectMapper cborObjectMapper = getCborObjectMapper(); return Feign.builder() .contract(createContract()) .encoder( new InputStreamDelegateEncoder( new TextDelegateEncoder( new CborDelegateEncoder( cborObjectMapper, new JacksonEncoder(objectMapper))))) .decoder(createDecoder(objectMapper, cborObjectMapper)) .errorDecoder(FeignSerializableErrorErrorDecoder.INSTANCE) .client(createOkHttpClient(userAgent, config.uris())) .options(createRequestOptions()) .logLevel(Logger.Level.NONE) .target(serviceClass, primaryUri); }
Source:
public static boolean conflictsWithExistingFilenames(String label, String directoryLabel, List<FileMetadata> fileMetadatas, DataFile dataFile) { List<String> filePathsAndNames = new ArrayList<>(); for (FileMetadata fileMetadata : fileMetadatas) { String path = ""; if (fileMetadata.getDirectoryLabel() != null) { path = fileMetadata.getDirectoryLabel() + "/"; } filePathsAndNames.add(path + fileMetadata.getLabel()); } if (label != null || directoryLabel != null) { String path = ""; if (directoryLabel != null) { path = directoryLabel + "/"; } if (label == null) { label = dataFile.getFileMetadata().getLabel(); } String incomingPathPlusFileName = path + label; logger.fine(filePathsAndNames.toString()); logger.fine("incomingPathName: " + incomingPathPlusFileName); if (filePathsAndNames.contains(incomingPathPlusFileName)) { return true; } } return false; }

Target:
public static boolean conflictsWithExistingFilenames(String label, String directoryLabel, List<FileMetadata> fileMetadatas, DataFile dataFile) { List<String> filePathsAndNames = getPathsAndFileNames(fileMetadatas); if (label != null || directoryLabel != null) { String path = ""; if (directoryLabel != null) { path = directoryLabel + "/"; } if (label == null) { label = dataFile.getFileMetadata().getLabel(); } String incomingPathPlusFileName = path + label; logger.fine(filePathsAndNames.toString()); logger.fine("incomingPathName: " + incomingPathPlusFileName); if (filePathsAndNames.contains(incomingPathPlusFileName)) { return true; } } return false; }
Source:
public static String createUniqueName(WsdlTestCase testCase, String testStepName) { if (testCase.getTestStepByName(testStepName) == null) { return testStepName; } String orgName = testStepName; int cnt = 1; while (testCase.getTestStepByName(testStepName) != null) { testStepName = orgName + " " + String.valueOf(cnt); cnt++; } return testStepName; }

Target:
public static String createUniqueName(WsdlTestCase testCase, String testStepName) { if (testCase.getTestStepByName(testStepName) == null) { return testStepName; } String originalName = testStepName; int count = 2; while (testCase.getTestStepByName(testStepName) != null) { testStepName = originalName + " " + String.valueOf(count); count++; } return testStepName; }
Source:
public final Object visitEvictCommand(InvocationContext ctx, EvictCommand command) throws Throwable { if (!passivation) { return invokeNextInterceptor(ctx, command); } final Object key = command.getKey(); try { cdl.lock(key, true); return invokeNextInterceptor(ctx, command); } finally { cdl.unlock(key); } }

Target:
public final Object visitEvictCommand(InvocationContext ctx, EvictCommand command) throws Throwable { if (!passivation) { return invokeNextInterceptor(ctx, command); } final Object key = command.getKey(); if (!cdl.lock(key, true)) { return null; } try { return invokeNextInterceptor(ctx, command); } finally { cdl.unlock(key); } }
Source:
public static <T> UnicastProcessor<T> create(int capacityHint, Runnable onCancelled, boolean delayError) { return new UnicastProcessor<T>(capacityHint, onCancelled,delayError); }

Target:
public static <T> UnicastProcessor<T> create(int capacityHint, Runnable onCancelled, boolean delayError) { ObjectHelper.requireNonNull(onCancelled, "onTerminate"); return new UnicastProcessor<T>(capacityHint, onCancelled, delayError); }
Source:
public ListAllODocumentsWidget(String id, IModel<OClass> model, IModel<ODocument> widgetDocumentModel) { super(id, model, widgetDocumentModel); IModel<DisplayMode> modeModel = DisplayMode.VIEW.asModel(); String sql = "select from " + getModelObject().getName(); ODocumentProvider provider = new ODocumentProvider(sql); provider.setFilterState(new ODocumentDataFilter(getModel(), sql, oClassIntrospector)); FilterForm<IODataFilter<ODocument, String>> filterForm = new FilterForm<>("form", provider); oClassIntrospector.defineDefaultSorting(provider, getModelObject()); OrienteerDataTable<ODocument, String> table = new OrienteerDataTable<ODocument, String>("table", oClassIntrospector.getColumnsFor(getModelObject(), true, modeModel), provider, 20); table.setTableFilterForm(filterForm); table.addCommand(new CreateODocumentCommand(table, getModel())); table.addCommand(new EditODocumentsCommand(table, modeModel, getModel())); table.addCommand(new SaveODocumentsCommand(table, modeModel)); table.addCommand(new CopyODocumentCommand(table, getModel())); table.addCommand(new DeleteODocumentCommand(table, getModel())); table.addCommand(new ExportCommand<ODocument>(table, new PropertyModel<String>(model, "name"))); filterForm.add(table); add(filterForm); }

Target:
public ListAllODocumentsWidget(String id, IModel<OClass> model, IModel<ODocument> widgetDocumentModel) { super(id, model, widgetDocumentModel); IModel<DisplayMode> modeModel = DisplayMode.VIEW.asModel(); String className = getModelObject().getName(); String sql = "select from " + className; IQueryBuilder<ODocument> builder = new ODefaultQueryBuilder<>(className); OQueryDataProvider<ODocument> provider = new OQueryDataProvider<>(sql); provider.setFilterState(new DefaultDataFilter<>(getModel(), builder)); FilterForm<IODataFilter<ODocument, String>> filterForm = new FilterForm<>("form", provider); oClassIntrospector.defineDefaultSorting(provider, getModelObject()); OrienteerDataTable<ODocument, String> table = new OrienteerDataTable<>("table", oClassIntrospector.getColumnsFor(getModelObject(), true, modeModel), provider, 20); table.addFilterForm(filterForm); table.addCommand(new CreateODocumentCommand(table, getModel())); table.addCommand(new EditODocumentsCommand(table, modeModel, getModel())); table.addCommand(new SaveODocumentsCommand(table, modeModel)); table.addCommand(new CopyODocumentCommand(table, getModel())); table.addCommand(new DeleteODocumentCommand(table, getModel())); table.addCommand(new ExportCommand<>(table, new PropertyModel<String>(model, "name"))); filterForm.add(table); add(filterForm); }
Source:
public static void add(Tech tech) { if (Assert.isNonEmpty(tech)) { if (tech.getParent() == null) { topLevelTech.add(tech); } allTech.add(tech); } }

Target:
public static void add(Tech tech) { if (tech != null) { if (tech.getParent() == null) { topLevelTech.add(tech); } allTech.add(tech); } }
Source:
public void testUpdateAllBrickTasksByHostIdBrickDir() { GlusterBrickEntity existingBrick = dao.getById(FixturesTool.GLUSTER_BRICK_UUID1); GlusterBrickEntity existingBrick2 = dao.getById(FixturesTool.GLUSTER_BRICK_UUID2); GlusterAsyncTask asyncTask = new GlusterAsyncTask(); asyncTask.setTaskId(FixturesTool.GLUSTER_ASYNC_TASK_ID1); GlusterBrickEntity updateBrick = new GlusterBrickEntity(); updateBrick.setBrickDirectory(existingBrick.getBrickDirectory()); updateBrick.setServerId(existingBrick.getServerId()); updateBrick.setAsyncTask(asyncTask); GlusterBrickEntity updateBrick2 = new GlusterBrickEntity(); updateBrick2.setBrickDirectory(existingBrick2.getBrickDirectory()); updateBrick2.setServerId(existingBrick2.getServerId()); updateBrick2.setAsyncTask(asyncTask); List<GlusterBrickEntity> bricks = new ArrayList<>(); bricks.add(updateBrick); bricks.add(updateBrick2); dao.updateAllBrickTasksByHostIdBrickDir(bricks); GlusterBrickEntity newEntity1 = dao.getById(FixturesTool.GLUSTER_BRICK_UUID1); GlusterBrickEntity newEntity2 = dao.getById(FixturesTool.GLUSTER_BRICK_UUID1); assertEquals(FixturesTool.GLUSTER_ASYNC_TASK_ID1, newEntity1.getAsyncTask().getTaskId()); assertEquals(FixturesTool.GLUSTER_ASYNC_TASK_ID1, newEntity2.getAsyncTask().getTaskId()); }

Target:
public void testUpdateAllBrickTasksByHostIdBrickDir() { GlusterBrickEntity existingBrick = dao.getById(FixturesTool.GLUSTER_BRICK_UUID1); GlusterBrickEntity existingBrick2 = dao.getById(FixturesTool.GLUSTER_BRICK_UUID2); GlusterAsyncTask asyncTask = new GlusterAsyncTask(); asyncTask.setTaskId(FixturesTool.GLUSTER_ASYNC_TASK_ID1); GlusterBrickEntity updateBrick = new GlusterBrickEntity(); updateBrick.setBrickDirectory(existingBrick.getBrickDirectory()); updateBrick.setServerId(existingBrick.getServerId()); updateBrick.setAsyncTask(asyncTask); GlusterBrickEntity updateBrick2 = new GlusterBrickEntity(); updateBrick2.setBrickDirectory(existingBrick2.getBrickDirectory()); updateBrick2.setServerId(existingBrick2.getServerId()); updateBrick2.setAsyncTask(asyncTask); List<GlusterBrickEntity> bricks = new ArrayList<>(); bricks.add(updateBrick); bricks.add(updateBrick2); dao.updateAllBrickTasksByHostIdBrickDirInBatch(bricks); GlusterBrickEntity newEntity1 = dao.getById(FixturesTool.GLUSTER_BRICK_UUID1); GlusterBrickEntity newEntity2 = dao.getById(FixturesTool.GLUSTER_BRICK_UUID1); assertEquals(FixturesTool.GLUSTER_ASYNC_TASK_ID1, newEntity1.getAsyncTask().getTaskId()); assertEquals(FixturesTool.GLUSTER_ASYNC_TASK_ID1, newEntity2.getAsyncTask().getTaskId()); }
Source:
private void processWorkerMetrics(final String srcId, final MetricMsg metricMsg) { for (final ByteBuffer encodedBuffer : metricMsg.getCustomMetrics()) { final DolphinWorkerMetrics workerMetrics = metricMsgCodec.decode(encodedBuffer.array()); final Map<String, Integer> tableToNumBlocks = metricMsg.getTableToNumBlocks(); final String hostname = metricMsg.getHostname(); switch (workerMetrics.getType()) { case BatchMetrics: final BatchMetrics batchMetrics = workerMetrics.getBatchMetrics(); final WorkerMetrics convertedBatchMetrics = convertBatchMetrics(metricMsg, tableToNumBlocks, hostname, batchMetrics); metricManager.storeWorkerMetrics(srcId, convertedBatchMetrics); break; case EpochMetrics: final EpochMetrics epochMetrics = workerMetrics.getEpochMetrics(); final WorkerMetrics convertedEpochMetrics = convertEpochMetrics(metricMsg, hostname, epochMetrics); metricManager.storeWorkerMetrics(srcId, convertedEpochMetrics); break; default: throw new RuntimeException("Unknown message type"); } LOG.log(Level.INFO, "Received a worker metric from {0}: {1}", new Object[] {workerMetrics, srcId}); } }

Target:
private void processWorkerMetrics(final String srcId, final MetricMsg metricMsg) { for (final ByteBuffer encodedBuffer : metricMsg.getCustomMetrics()) { final DolphinWorkerMetrics workerMetrics = metricMsgCodec.decode(encodedBuffer.array()); final Map<String, Integer> tableToNumBlocks = metricMsg.getTableToNumBlocks(); final String hostname = metricMsg.getHostname(); switch (workerMetrics.getType()) { case BatchMetrics: final BatchMetrics batchMetrics = workerMetrics.getBatchMetrics(); final WorkerMetrics convertedBatchMetrics = convertBatchMetrics(metricMsg, tableToNumBlocks, hostname, batchMetrics); metricManager.storeWorkerMetrics(srcId, convertedBatchMetrics); break; case EpochMetrics: final EpochMetrics epochMetrics = workerMetrics.getEpochMetrics(); final WorkerMetrics convertedEpochMetrics = convertEpochMetrics(metricMsg, hostname, epochMetrics); metricManager.storeWorkerMetrics(srcId, convertedEpochMetrics); break; default: throw new RuntimeException("Unknown message type"); } LOG.log(Level.INFO, "Received a worker metric from {0}: {1}", new Object[] {srcId, workerMetrics}); } }