auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> public static String replaceMediaFileWithUrl(Context context, @NonNull String postContent, String localMediaId, MediaFile mediaFile) { <END> if (mediaFile != null) { String remoteUrl = Utils.escapeQuotes(mediaFile.getFileURL()); if (!mediaFile.isVideo()) { AttributesImpl attrs = new AttributesImpl(); attrs.addAttribute("", "src", "src", "string", remoteUrl); AztecText content = new AztecText(context); content.fromHtml(postContent); content.clearOverlays(AztecEditorFragment.ImagePredicate.localMediaIdPredicate(localMediaId), attrs); content.refreshText(); postContent = content.toHtml(false); } else { } } return postContent; }</code><technical_language>This line is 120 characters</technical_language>

Target:
public static String replaceMediaFileWithUrl(Context context, @NonNull String postContent, String localMediaId, MediaFile mediaFile) { if (mediaFile != null) { String remoteUrl = Utils.escapeQuotes(mediaFile.getFileURL()); if (!mediaFile.isVideo()) { AttributesImpl attrs = new AttributesImpl(); attrs.addAttribute("", "src", "src", "string", remoteUrl); AztecText content = new AztecText(context); content.fromHtml(postContent); content.clearOverlays(ImagePredicate.localMediaIdPredicate(localMediaId), attrs); content.refreshText(); postContent = content.toHtml(false); } else { } } return postContent; }
Source:
<code>public void testStoreReconnect() { PersistenceAvailabilityListener pal = new PersistenceAvailabilityListener(); Cache<Object, Object> cache = createManagerAndGetCache(0); cache.addListener(pal); assertEquals(0, pal.availableCount.get()); assertEquals(0, pal.unavailableCount.get()); cache.put(1, 1); PersistenceManager pm = TestingUtil.extractComponent(cache, PersistenceManager.class); assertTrue(pm.isAvailable()); DummyInMemoryStore dims = TestingUtil.getFirstWriter(cache); dims.setAvailable(false); eventually(() -> !pm.isAvailable()); eventuallyEquals(1, () -> pal.unavailableCount.get()); try { cache.put(1, 2); fail("Expected " + StoreUnavailableException.class.getSimpleName()); } catch (PersistenceException ignore) { <START> } <END> dims.setAvailable(true); eventually(pm::isAvailable); eventuallyEquals(1, () -> pal.availableCount.get()); cache.put(1, 3); assertEquals(3, cache.get(1)); }</code><technical_language>I eventually* for both, feels code testing does. listeners invoked availability status changes, I suggest a regular assertTrue(pm.isAvailable()) checking listener</technical_language>

Target:
public void testStoreReconnect() { PersistenceAvailabilityListener pal = new PersistenceAvailabilityListener(); Cache<Object, Object> cache = createManagerAndGetCache(0); cache.addListener(pal); assertEquals(0, pal.availableCount.get()); assertEquals(0, pal.unavailableCount.get()); cache.put(1, 1); PersistenceManager pm = TestingUtil.extractComponent(cache, PersistenceManager.class); assertTrue(pm.isAvailable()); DummyInMemoryStore dims = TestingUtil.getFirstWriter(cache); dims.setAvailable(false); eventually(() -> !pm.isAvailable()); eventuallyEquals(1, () -> pal.unavailableCount.get()); try { cache.put(1, 2); fail("Expected " + StoreUnavailableException.class.getSimpleName()); } catch (PersistenceException ignore) { } dims.setAvailable(true); eventuallyEquals(1, () -> pal.availableCount.get()); assertTrue(pm.isAvailable()); cache.put(1, 3); assertEquals(3, cache.get(1)); }
Source:
<code>public ModelAndView removeByFName(HttpServletRequest request, HttpServletResponse response, @RequestParam(value = "fname", required = true) String fname) throws IOException { IUserInstance ui = userInstanceManager.getUserInstance(request); IPerson per = getPerson(ui, response); UserPreferencesManager upm = (UserPreferencesManager) ui.getPreferencesManager(); IUserLayoutManager ulm = upm.getUserLayoutManager(); try { String elementId = ulm.getUserLayout().findNodeId(new PortletSubscribeIdResolver(fname)); if (elementId != null && elementId.startsWith(Constants.FRAGMENT_ID_USER_PREFIX) && ulm.getNode(elementId) instanceof org.apereo.portal.layout.node.UserLayoutFolderDescription) { removeSubscription(per, elementId, ulm); } else { if (!ulm.deleteNode(elementId)) { logger.info( "Failed to remove element ID from layout root folder ID {}, delete node returned false", elementId, ulm.getRootFolderId()); <START> response.sendError(HttpServletResponse.SC_FORBIDDEN); <END> return new ModelAndView( "jsonView", Collections.singletonMap( "error", getMessage( "error.element.update", "Unable to update element", RequestContextUtils.getLocale(request)))); } } ulm.saveUserLayout(); return new ModelAndView("jsonView", Collections.EMPTY_MAP); } catch (PortalException e) { return handlePersistError(request, response, e); } }</code><technical_language>This parent conditional checks if id client is valid? this a HttpServletResponse.SC_BAD_REQUEST error</technical_language>

Target:
public ModelAndView removeByFName( HttpServletRequest request, HttpServletResponse response, @RequestParam(value = "fname", required = true) String fname ) throws IOException { IUserInstance ui = userInstanceManager.getUserInstance(request); IPerson per = getPerson(ui, response); UserPreferencesManager upm = (UserPreferencesManager) ui.getPreferencesManager(); IUserLayoutManager ulm = upm.getUserLayoutManager(); try { String elementId = ulm.getUserLayout().findNodeId(new PortletSubscribeIdResolver(fname)); if (elementId != null && elementId.startsWith(Constants.FRAGMENT_ID_USER_PREFIX) && ulm.getNode(elementId) instanceof org.apereo.portal.layout.node.UserLayoutFolderDescription) { removeSubscription(per, elementId, ulm); } else if (elementId != null) { if (!ulm.deleteNode(elementId)) { logger.info( "Failed to remove element ID from layout root folder ID {}, delete node returned false", elementId, ulm.getRootFolderId()); response.setStatus(HttpServletResponse.SC_FORBIDDEN); return new ModelAndView( "jsonView", Collections.singletonMap( "error", getMessage( "error.element.update", "Unable to update element", RequestContextUtils.getLocale(request)))); } } else { response.sendError(HttpServletResponse.SC_BAD_REQUEST); return null; } ulm.saveUserLayout(); return new ModelAndView("jsonView", Collections.EMPTY_MAP); } catch (PortalException e) { return handlePersistError(request, response, e); } }
Source:
<code>public void removeExpiredAlerts(){ LocalDateTime expiredDate = DatabaseUtilities.getCurrentDateTime(); String sql = "DELETE FROM sms_alerts WHERE court_date < '"+DatabaseUtilities.convertLocalDateTimeToDatabaseDateString(expiredDate.plusDays(2))+"'"; <START> jdbcTemplate.execute(sql, new PreparedStatementCallback<Boolean>(){ <END> @Override public Boolean doInPreparedStatement(PreparedStatement ps) throws SQLException, DataAccessException { return ps.execute(); } }); }</code><technical_language>this prepared statement business? This a verbose compared in for deletes in jdbc</technical_language>

Target:
public void removeExpiredAlerts(){ LocalDateTime expiredDate = DatabaseUtilities.getCurrentDateTime().plusDays(2); Map<String, Object> parameterMap = new HashMap<String, Object>(); parameterMap.put("expiredDate", DatabaseUtilities.convertLocalDateTimeToDatabaseDateString(expiredDate)); try{ jdbcTemplate.update(getSql("SMSAlert/remove-expired-SMSAlerts.sql"), parameterMap); }catch(Exception e){ LogSystem.LogDBException(e); } }
Source:
<code><START> public void start() { <END> this.counter = Counter.build().name(COUNTER_NAME) .help("Log4j log statements at various log levels") .labelNames("level") .register(registry); trace = counter.labels("trace"); debug = counter.labels("debug"); info = counter.labels("info"); warn = counter.labels("warn"); error = counter.labels("error"); super.start(); }</code><technical_language>start called multiple times</technical_language>

Target:
public void start() { super.start(); }
Source:
<code>public void should_pass_if_size_of_actual_is_equal_to_expected_size() { <START> strings.assertHasSizeLessThanOrEqualTo(someInfo(), "Han", 3); <END> }</code><technical_language>assertHasSizeGreaterThanOrEqualTo</technical_language>

Target:
public void should_pass_if_size_of_actual_is_equal_to_expected_size() { strings.assertHasSizeGreaterThanOrEqualTo(someInfo(), "Han", 3); }
Source:
<code>public Map<KOut, VOut> execute() throws CacheException { if (mapper == null) throw new NullPointerException("A valid reference of Mapper is not set " + mapper); if (reducer == null) throw new NullPointerException("A valid reference of Reducer is not set " + reducer); if(!isLocalOnly && distributeReducePhase()){ boolean useCompositeKeys = useIntermediateSharedCache(); String intermediateCacheName = DEFAULT_TMP_CACHE_CONFIGURATION_NAME; if (useIntermediatePerTaskCache()) { intermediateCacheName = taskId.toString(); } try { executeTaskInit(intermediateCacheName); Set<KOut> allMapPhasesResponses = executeMapPhase(useCompositeKeys); return executeReducePhase(allMapPhasesResponses, useCompositeKeys); } catch (Exception cause){ throw new CacheException(cause); } finally { if(useIntermediatePerTaskCache()){ EmbeddedCacheManager cm = cache.getCacheManager(); cm.getCache(intermediateCacheName).getAdvancedCache().withFlags(Flag.CACHE_MODE_LOCAL).clear(); <START> cm.removeCache(intermediateCacheName); <END> } } } else { try { return executeMapPhaseWithLocalReduction(); } catch (Exception cause){ throw new CacheException(cause); } } }</code><technical_language>This call is cluster wide clear top of other stuff. clear() call is redundant. removeCache call is enough clear cache, cluster wide remove cache altogether. If wanna fix it, need clear local delete removeCache call. sense call removeCache locally. If removeCache is called, risk of a temporary cache defined? tested</technical_language>

Target:
public Map<KOut, VOut> execute() throws CacheException { if (mapper == null) throw new NullPointerException("A valid reference of Mapper is not set " + mapper); if (reducer == null) throw new NullPointerException("A valid reference of Reducer is not set " + reducer); if(!isLocalOnly && distributeReducePhase()){ boolean useCompositeKeys = useIntermediateSharedCache(); String intermediateCacheName = DEFAULT_TMP_CACHE_CONFIGURATION_NAME; if (useIntermediatePerTaskCache()) { intermediateCacheName = taskId.toString(); } try { executeTaskInit(intermediateCacheName); Set<KOut> allMapPhasesResponses = executeMapPhase(useCompositeKeys); return executeReducePhase(allMapPhasesResponses, useCompositeKeys); } catch (Exception cause){ throw new CacheException(cause); } finally { if(useIntermediatePerTaskCache()){ EmbeddedCacheManager cm = cache.getCacheManager(); cm.removeCache(intermediateCacheName); } } } else { try { return executeMapPhaseWithLocalReduction(); } catch (Exception cause){ throw new CacheException(cause); } } }
Source:
<code>public void testProcessNonJavaFiles() throws Exception { final List<String> lines = new ArrayList<>(Arrays.asList("package com.puppycrawl.tools.checkstyle;", "", "error public class InputTreeWalkerFileWithViolation {}")); final TreeWalker treeWalker = new TreeWalker(); final PackageObjectFactory factory = new PackageObjectFactory( new HashSet<>(), Thread.currentThread().getContextClassLoader()); treeWalker.setModuleFactory(factory); treeWalker.configure(new DefaultConfiguration("default config")); final DefaultConfiguration childConfig = createCheckConfig(JavadocParagraphCheck.class); treeWalker.setupChild(childConfig); <START> <END> try { treeWalker.processFiltered(new File("input.java"), lines); fail("Exception expected"); } catch (CheckstyleException ex) { assertEquals("Invalid exception message", "MismatchedTokenException occurred during the analysis of file input.java.", ex.getMessage()); } try { treeWalker.processFiltered(new File("input.txt"), lines); } catch (CheckstyleException ex) { fail("Exception is not expected, file with txt extension should not be processed"); } }</code><technical_language>catching exception failing is bad practice. Exception populated junit runner display user</technical_language>

Target:
public void testProcessNonJavaFiles() throws Exception { final TreeWalker treeWalker = new TreeWalker(); final PackageObjectFactory factory = new PackageObjectFactory( new HashSet<>(), Thread.currentThread().getContextClassLoader()); treeWalker.setModuleFactory(factory); treeWalker.configure(new DefaultConfiguration("default config")); final DefaultConfiguration childConfig = createCheckConfig(JavadocParagraphCheck.class); treeWalker.setupChild(childConfig); final List<String> lines = new ArrayList<>(Arrays.asList("package com.puppycrawl.tools.checkstyle;", "", "error public class InputTreeWalkerFileWithViolation {}")); try { treeWalker.processFiltered(new File("input.java"), lines); fail("Exception expected"); } catch (CheckstyleException ex) { assertEquals("Invalid exception message", "MismatchedTokenException occurred during the analysis of file input.java.", ex.getMessage()); } treeWalker.processFiltered(new File("input.txt"), lines); }
Source:
<code>private LastDataPointMessage buildLastDataPointResponse( <START> final String metricName, final RollupPeriod period, final ImmutableSet<String> tags, <END> final MetricsQueryResponse response, @Nullable final Throwable failure) { final LastDataPointMessage.Builder builder = new LastDataPointMessage.Builder() .setMetricName(metricName) .setPeriod(period); if (failure != null) { builder.setFailure(true); builder.setThrowable(failure); } else { builder.setFailure(false); builder.setTags(tags); builder.setLastDataPointTime(response.getQueries().get(0).getResults().get(0).getValues().get(0).getTime()); } return builder.build(); }</code><technical_language>Convention wrap is wrap wrap each. e.g. private LastDataPointMessage buildLastDataPointResponse( final String metricName, final RollupPeriod period, final ImmutableSet<String> tags, ...);</technical_language>

Target:
private LastDataPointMessage buildLastDataPointResponse( final String metricName, final RollupPeriod period, final ImmutableSet<String> tags, final MetricsQueryResponse response, @Nullable final Throwable failure) { final LastDataPointMessage.Builder builder = new LastDataPointMessage.Builder() .setMetricName(metricName) .setPeriod(period) .setTags(tags); if (failure != null) { builder.setFailure(failure); } else { if (response.getQueries().isEmpty() || response.getQueries().get(0).getResults().isEmpty()) { builder.setFailure(new Exception("Unexpected query results.")); } else if (response.getQueries().get(0).getResults().get(0).getValues().isEmpty()) { builder.setLastDataPointTime(null); } else { builder.setLastDataPointTime(response.getQueries().get(0).getResults().get(0).getValues().get(0).getTime()); } } return builder.build(); }
Source:
<code>protected static <TClass, TAnnotation extends Annotation> void scanClass(String className, Class<TClass> superClass, Class<TAnnotation> annotationClass, String requirePackage, Consumer<Class<? extends TClass>> consumer) { if (requirePackage != null && !className.startsWith(requirePackage)) return; Class<?> clazz; try { System.setErr(NULL_PRINT_STREAM); clazz = Class.forName(className); System.setErr(ERR_PRINT_STREAM); } catch (Throwable t) { <START> log.trace("Cannot load class " + className); <END> return; } TAnnotation annotation = clazz.getAnnotation(annotationClass); if (annotation != null) { if (!superClass.isAssignableFrom(clazz)) { return; } consumer.accept((Class<? extends TClass>) clazz); } }</code><technical_language>Logging exception useful</technical_language>

Target:
protected static <TClass, TAnnotation extends Annotation> void scanClass(String className, Class<TClass> superClass, Class<TAnnotation> annotationClass, String requirePackage, Consumer<Class<? extends TClass>> consumer) { if (requirePackage != null && !className.startsWith(requirePackage)) return; Class<?> clazz; try { System.setErr(NULL_PRINT_STREAM); clazz = Class.forName(className); System.setErr(ERR_PRINT_STREAM); } catch (ClassNotFoundException e) { log.trace("Cannot load class " + className, e); return; } catch (NoClassDefFoundError e) { log.trace("Cannot load class " + className, e); return; } catch (LinkageError e) { log.trace("Cannot load class " + className, e); return; } TAnnotation annotation = clazz.getAnnotation(annotationClass); if (annotation != null) { if (!superClass.isAssignableFrom(clazz)) { return; } consumer.accept((Class<? extends TClass>) clazz); } }
Source:
<code>public MissingMethodException(String method, Class type, Object[] arguments, boolean isStatic) { super(); this.method = method; this.type = type; this.isStatic = isStatic; <START> this.arguments = arguments == null ? new Object[0] : arguments; <END> }</code><technical_language>extract EMPTY_OBJECT_ARRAY avoid creating object array multiple times</technical_language>

Target:
public MissingMethodException(String method, Class type, Object[] arguments, boolean isStatic) { super(); this.method = method; this.type = type; this.isStatic = isStatic; this.arguments = arguments == null ? EMPTY_OBJECT_ARRAY : arguments; }
Source:
<code><START> public void testIsDrawable_InvalidReusableSubprocess() throws Exception { <END> testIsDrawable(CaseManagementDiagram.class, ReusableSubprocess.class, false); }</code><technical_language>Exception is thrown</technical_language>

Target:
public void testIsDrawable_InvalidReusableSubprocess() { testIsDrawable(CaseManagementDiagram.class, ReusableSubprocess.class, false); }
Source:
<code>public NutchDocument filter(NutchDocument doc, Parse parse, Text url, CrawlDatum datum, Inlinks inlinks) throws IndexingException { Outlink[] outlinks = parse.getData().getOutlinks(); try { if (outlinks != null) { Set<String> hosts = new HashSet<String>(); for (Outlink outlink : outlinks) { String linkUrl = outlink.getToUrl(); String outHost = new URL(linkUrl).getHost(); if (indexHost) { <START> linkUrl = new URL(outlink.getToUrl()).getHost(); <END> if (hosts.contains(linkUrl)) continue; hosts.add(linkUrl); } addFilteredLink("outlinks", url.toString(), linkUrl, outHost, filterOutlinks, doc); } } } catch (MalformedURLException e) { LOG.error("Malformed URL in {}: {}", url, e.getMessage()); } if (null != inlinks) { Iterator<Inlink> iterator = inlinks.iterator(); Set<String> inlinkHosts = new HashSet<String>(); try { while (iterator.hasNext()) { Inlink link = iterator.next(); String linkUrl = link.getFromUrl(); String inHost = new URL(link.getFromUrl()).getHost(); if (indexHost) { linkUrl = new URL(link.getFromUrl()).getHost(); if (inlinkHosts.contains(linkUrl)) continue; inlinkHosts.add(linkUrl); } addFilteredLink("inlinks", url.toString(), linkUrl, inHost, filterInlinks, doc); } } catch (MalformedURLException e) { LOG.error("Malformed URL in {}: {}", url, e.getMessage()); } } return doc; }</code><technical_language>linkurl is equal outHost - simplified</technical_language>

Target:
public NutchDocument filter(NutchDocument doc, Parse parse, Text url, CrawlDatum datum, Inlinks inlinks) throws IndexingException { Outlink[] outlinks = parse.getData().getOutlinks(); if (outlinks != null) { Set<String> hosts = new HashSet<String>(); for (Outlink outlink : outlinks) { try { String linkUrl = outlink.getToUrl(); String outHost = new URL(linkUrl).getHost().toLowerCase(); if (indexHost) { linkUrl = outHost; if (hosts.contains(linkUrl)) continue; hosts.add(linkUrl); } addFilteredLink("outlinks", url.toString(), linkUrl, outHost, filterOutlinks, doc); } catch (MalformedURLException e) { LOG.error("Malformed URL in {}: {}", url, e.getMessage()); } } } if (null != inlinks) { Iterator<Inlink> iterator = inlinks.iterator(); Set<String> inlinkHosts = new HashSet<String>(); while (iterator.hasNext()) { try { Inlink link = iterator.next(); String linkUrl = link.getFromUrl(); String inHost = new URL(linkUrl).getHost().toLowerCase(); if (indexHost) { linkUrl = inHost; if (inlinkHosts.contains(linkUrl)) continue; inlinkHosts.add(linkUrl); } addFilteredLink("inlinks", url.toString(), linkUrl, inHost, filterInlinks, doc); } catch (MalformedURLException e) { LOG.error("Malformed URL in {}: {}", url, e.getMessage()); } } } return doc; }
Source:
<code>private void addMemberToGroupsFromTriggerAttribute(PerunSession sess, Group group, Member member) { ArrayList<String> groupsForAddition; try { groupsForAddition = getPerunBl().getAttributesManagerBl().getAttribute(sess, group, AttributesManager.NS_GROUP_ATTR_DEF+":groupTrigger").valueAsList(); } catch (InternalErrorException | WrongAttributeAssignmentException | AttributeNotExistsException | <START> NumberFormatException e) { <END> log.error("Error while getting groupTrigger attribute, Exception message: " + e.toString()); return; } if (groupsForAddition == null) return; for (String groupId : groupsForAddition) { try { Group one = getGroupById(sess, Integer.parseInt(groupId)); addDirectMember(sess, one, member); } catch (InternalErrorException | WrongReferenceAttributeValueException | AlreadyMemberException | WrongAttributeValueException | GroupNotExistsException e) { log.error("Member could not be added to the group, Exception message: " + e.toString()); } } }</code><technical_language>Please do separate lines, is hard read</technical_language>

Target:
private void addMemberToGroupsFromTriggerAttribute(PerunSession sess, Group group, Member member) { ArrayList<String> groupsForAddition; try { groupsForAddition = getPerunBl().getAttributesManagerBl().getAttribute(sess, group, AttributesManager.NS_GROUP_ATTR_DEF+":groupTrigger").valueAsList(); } catch (InternalErrorException | WrongAttributeAssignmentException | AttributeNotExistsException | NumberFormatException e) { log.error("Error while getting groupTrigger attribute, Exception message: " + e.toString()); return; } if (groupsForAddition == null) return; for (String groupId : groupsForAddition) { try { Group groupForAddition = getGroupById(sess, Integer.parseInt(groupId)); addDirectMember(sess, groupForAddition, member); } catch (InternalErrorException | WrongReferenceAttributeValueException | AlreadyMemberException | WrongAttributeValueException | GroupNotExistsException e) { log.error("Member could not be added to the group, Exception message: " + e.toString()); } } }
Source:
<code><START> public int getActivePartitionCount() { <END> InetSocketAddress thisAddress = hazelcastInstance.getCluster().getLocalMember().getSocketAddress(MEMBER); return managedObject.getMemberPartitionsIfAssigned(new Address(thisAddress)).size(); }</code><technical_language><LINK_0></technical_language>

Target:
public int getActivePartitionCount() { InetSocketAddress thisAddress = hazelcastInstance.getCluster().getLocalMember().getSocketAddress(); return managedObject.getMemberPartitionsIfAssigned(new Address(thisAddress)).size(); }
Source:
<code>private void putMetadataWithoutChangingSettings(final TableReference tableRef, final byte[] meta) { long ts = System.currentTimeMillis(); try { cellValuePutter.put("put", AtlasDbConstants.DEFAULT_METADATA_TABLE, KeyValueServices.toConstantTimestampValues( ImmutableMap.of(CassandraKeyValueServices.getMetadataCell(tableRef), meta).entrySet(), ts)); } catch (Exception e) { throw QosAwareThrowables.unwrapAndThrowRateLimitExceededOrAtlasDbDependencyException(e); } try { new CellRangeDeleter(clientPool, wrappingQueryRunner, deleteConsistency, no -> System.currentTimeMillis()) .deleteAllTimestamps(AtlasDbConstants.DEFAULT_METADATA_TABLE, <START> ImmutableMap.of(CassandraKeyValueServices.getMetadataCell(tableRef), ts), true); <END> } catch (AtlasDbDependencyException e) { log.info("Failed to delete old table metadata for table because not all Cassandra nodes are up. However," + "the table has been dropped and the table metadata reflecting this has been successfully " + "persisted.", LoggingArgs.tableRef(tableRef), e); } }</code><technical_language>I remember if getAllTimestamps returns sentinel; if technically this _is_ a behaviour change. I remember details of set metadata table</technical_language>

Target:
private void putMetadataWithoutChangingSettings(final TableReference tableRef, final byte[] meta) { long ts = System.currentTimeMillis(); try { cellValuePutter.put("put", AtlasDbConstants.DEFAULT_METADATA_TABLE, KeyValueServices.toConstantTimestampValues( ImmutableMap.of(CassandraKeyValueServices.getMetadataCell(tableRef), meta).entrySet(), ts)); } catch (Exception e) { throw Throwables.unwrapAndThrowAtlasDbDependencyException(e); } try { new CellRangeDeleter(clientPool, wrappingQueryRunner, deleteConsistency, no -> System.currentTimeMillis()) .deleteAllTimestamps(AtlasDbConstants.DEFAULT_METADATA_TABLE, ImmutableMap.of(CassandraKeyValueServices.getMetadataCell(tableRef), ts), false); } catch (AtlasDbDependencyException e) { log.info("Failed to delete old table metadata for table because not all Cassandra nodes are up. However," + "the table has been dropped and the table metadata reflecting this has been successfully " + "persisted.", LoggingArgs.tableRef(tableRef), e); } }
Source:
<code>public Response<Set<String>> apply(ChangeResource req, Input input) throws AuthException, OrmException, IOException, BadRequestException { if (input == null || Strings.isNullOrEmpty(input.hashtags)) { throw new BadRequestException("Hashtags are required"); } ChangeControl control = req.getControl(); ChangeUpdate update = updateFactory.create(control); ChangeNotes notes = control.getNotes().load(); Set<String> hashtags = new HashSet<String>(); Set<String> oldHashtags = notes.getHashtags(); if (oldHashtags != null) { hashtags.addAll(oldHashtags); } <START> hashtags.removeAll(Arrays.asList(input.hashtags.split(","))); <END> update.setHashtags(hashtags); update.commit(); ChangeUtil.bumpRowVersionNotLastUpdatedOn(req.getChange().getId(), db.get()); return Response.ok(hashtags); }</code><technical_language>avoid errors, for; Splitter.on(',').trimResults().omitEmptyStrings().splitToList(input.hashtags);</technical_language>

Target:
public Response<Set<String>> apply(ChangeResource req, Input input) throws AuthException, OrmException, IOException, BadRequestException { if (input == null || Strings.isNullOrEmpty(input.hashtags)) { throw new BadRequestException("Hashtags are required"); } ChangeControl control = req.getControl(); if(!control.canEditHashtags()){ throw new AuthException("Editing hashtags not permitted"); } ChangeUpdate update = updateFactory.create(control); ChangeNotes notes = control.getNotes().load(); Set<String> hashtags = new HashSet<String>(); Set<String> oldHashtags = notes.getHashtags(); if (oldHashtags != null) { hashtags.addAll(oldHashtags); } hashtags.removeAll(Arrays.asList(input.hashtags.split(","))); update.setHashtags(hashtags); update.commit(); ChangeUtil.bumpRowVersionNotLastUpdatedOn(req.getChange().getId(), db.get()); return Response.ok(hashtags); }
Source:
<code>private String colorizeMessage(String message, String outcome) { if (!"".equals(outcome.toLowerCase())) { switch (outcome) { case "success": <START> return Util.formatSuccessMessage(message); <END> case "fail": case "failed": case "failure": case "error": return Util.formatErrorMessage(message); case "cancelled": case "warn": case "warning": return Util.formatWarnMessage(message); } } return message; }</code><technical_language>check Util expose this constant, in case not, interesting add them</technical_language>

Target:
private String colorizeMessage(String message, String outcome) { if (outcome != null && !outcome.isEmpty()) { switch (outcome) { case "success": return Util.formatSuccessMessage(message); case "fail": case "failed": case "failure": case "error": return Util.formatErrorMessage(message); case "cancelled": case "warn": case "warning": return Util.formatWarnMessage(message); } } return message; }
Source:
<code>public AsyncFuture<ModelNode> executeAsync(ModelNode modelNode, OperationMessageHandler handler) { <START> ExecutorService executor = Executors.newSingleThreadExecutor(); <END> Future<ModelNode> submit = executor.submit(new ModelNodeFromModelNodeCallable(modelNode)); ModelNode result = getFutureResult(submit); return new HttpModelControllerClientAsyncFutureTask(executor, result); }</code><technical_language>is executor shut down? I guess ...AsyncFutureTask shutdown executor completed, leaking threads. this class a close method, Executors.newCachedThreadPool() executor for entire instance of this class, shutdown in close method</technical_language>

Target:
public AsyncFuture<ModelNode> executeAsync(ModelNode modelNode, OperationMessageHandler handler) { ExecutorService executor = obtainExecutorService(); Future<ModelNode> submit = executor.submit(new ModelNodeFromModelNodeCallable(modelNode)); ModelNode result = getFutureResult(submit); return new HttpModelControllerClientAsyncFutureTask(executor, result); }
Source:
<code>private String removeAbstract(String line) { <START> String tmp = line; <END> if (isAbstractClassLine(tmp)) { logging.info("Found abstract class. Convert it to a interface"); tmp = tmp.replace(ABSTRACT_CLASS_SIGNITURE + " ", "interface I"); if (tmp.contains(":")) { tmp = tmp.substring(0, tmp.indexOf(":")) + "{"; } tmp = tmp.replace(" {", "SoapBinding {"); } else { if (tmp.contains("abstract")) { logging.info("Found abstract method. Convert it"); tmp = tmp.replace("abstract", ""); tmp = tmp.replace("public", ""); tmp = tmp.replace("private", ""); tmp = tmp.replace("protected", ""); } } return tmp; }</code><technical_language>rename tmpLine</technical_language>

Target:
private String removeAbstract(String line) { String tmpLine = line; if (isAbstractClassLine(tmpLine)) { logging.info("Found abstract class. Convert it to a interface"); tmpLine = tmpLine.replace(ABSTRACT_CLASS_SIGNITURE + " ", "interface I"); if (tmpLine.contains(":")) { tmpLine = tmpLine.substring(0, tmpLine.indexOf(":")) + "{"; } tmpLine = tmpLine.replace(" {", "SoapBinding {"); } else { if (tmpLine.contains("abstract")) { logging.info("Found abstract method. Convert it"); tmpLine = tmpLine.replace("abstract", ""); tmpLine = tmpLine.replace("public", ""); tmpLine = tmpLine.replace("private", ""); tmpLine = tmpLine.replace("protected", ""); } } return tmpLine; }
Source:
<code>public void InteractiveMaps_037_VerifyEmbedMapAddPinType() { WikiBasePageObject base = new WikiBasePageObject(driver); base.logInCookie(credentials.userName, credentials.password, wikiURL); ArticlePageObject article = new ArticlePageObject(driver); article.openArticleByName(wikiURL, InteractiveMapsContent.embedMapArticleName); EmbedMapComponentObject embedMapDialog = article.clickViewEmbedMap(); embedMapDialog.clickEditPinTypesButton(); CreatePinTypesComponentObject pinTypesDialog = new CreatePinTypesComponentObject(driver); pinTypesDialog.verifyPinTypesDialog(); pinTypesDialog.typeManyPinTypeTitle(InteractiveMapsContent.pinTypeName, 4); pinTypesDialog.clickSave(); embedMapDialog.verifyPinTypeExist(InteractiveMapsContent.pinTypeName); <START> } <END></code><technical_language>@ukaka Amount of tests is drastically increase. However, create Jira ticket split tests</technical_language>

Target:
public void InteractiveMaps_037_VerifyEmbedMapAddPinType() { WikiBasePageObject base = new WikiBasePageObject(driver); base.logInCookie(credentials.userName, credentials.password, wikiURL); ArticlePageObject article = new ArticlePageObject(driver); article.openArticleByName(wikiURL, InteractiveMapsContent.embedMapArticleName); EmbedMapComponentObject embedMapDialog = article.clickViewEmbedMap(); CreatePinTypesComponentObject pinTypesDialog = embedMapDialog.clickEditPinTypesButton(); pinTypesDialog.verifyPinTypesDialog(); pinTypesDialog.deletePinTypes(); pinTypesDialog.typeManyPinTypeTitle(InteractiveMapsContent.pinTypeName, 4); pinTypesDialog.clickSave(); embedMapDialog.verifyPinTypeExist(InteractiveMapsContent.pinTypeName); }
Source:
<code>public void compressJar(String pluginKey, Path sourceDir, Path targetJarFile) { if (configuration.getBoolean(PROPERTY_PLUGIN_COMPRESSION_ENABLE).orElse(false)) { Path targetPack200Path = FileUtils.getPack200FilePath(targetJarFile); Path sourcePack200Path = sourceDir.resolve(targetPack200Path.getFileName()); if (Files.isRegularFile(sourcePack200Path)) { try { LOG.debug("Found pack200: " + sourcePack200Path); Files.copy(sourcePack200Path, targetPack200Path); } catch (IOException e) { LOG.error("Failed to copy pack200 file from " + sourcePack200Path + " to " + targetPack200Path); <START> return; <END> } } else { pack200(targetJarFile, targetPack200Path, pluginKey); } String hash = calculateMd5(targetPack200Path); RemotePluginFile compressedPlugin = new RemotePluginFile(targetPack200Path.getFileName().toString(), hash); compressedPlugins.put(pluginKey, compressedPlugin); } }</code><technical_language>I : * pack200 original here, instead of returning, * throw ISE (as pack200 method is doing) file missing compressedPlugins map, I expect some weird issues in this case. throwing exception prevent SQ starting solution</technical_language>

Target:
public void compressJar(String pluginKey, Path sourceDir, Path targetJarFile) { if (configuration.getBoolean(PROPERTY_PLUGIN_COMPRESSION_ENABLE).orElse(false)) { Path targetPack200Path = FileUtils.getPack200FilePath(targetJarFile); Path sourcePack200Path = sourceDir.resolve(targetPack200Path.getFileName()); if (Files.isRegularFile(sourcePack200Path)) { try { LOG.debug("Found pack200: " + sourcePack200Path); Files.copy(sourcePack200Path, targetPack200Path); } catch (IOException e) { throw new IllegalStateException("Failed to copy pack200 file from " + sourcePack200Path + " to " + targetPack200Path, e); } } else { pack200(targetJarFile, targetPack200Path, pluginKey); } String hash = calculateMd5(targetPack200Path); RemotePluginFile compressedPlugin = new RemotePluginFile(targetPack200Path.getFileName().toString(), hash); compressedPlugins.put(pluginKey, compressedPlugin); } }
Source:
<code>public void refreshGlusterServices() { if (getServiceNameMap().isEmpty()) { populateServiceMap(); } List<VDSGroup> clusters = getClusterDao().getAll(); for (VDSGroup cluster : clusters) { if (supportsGlusterServicesFeature(cluster)) { try { List<VDS> serversList = getClusterUtils().getAllServers(cluster.getId()); <START> if(serversList != null && serversList.size() == 0) { <END> Map<ServiceType, GlusterServiceStatus> statusMap = new HashMap<>(); for(ServiceType type : getClusterServiceMap(cluster).keySet()) { statusMap.put(type, GlusterServiceStatus.UNKNOWN); } addOrUpdateClusterServices(cluster, statusMap); continue; } List<Callable<Map<String, GlusterServiceStatus>>> taskList = createTaskList(serversList); if (taskList != null && taskList.size() > 0) { refreshClusterServices(cluster, ThreadPoolUtil.invokeAll(taskList)); } } catch (Exception e) { log.errorFormat("Error while refreshing service statuses of cluster {0}!", cluster.getName(), e); } } } }</code><technical_language>please serversList.isEmpty()</technical_language>

Target:
public void refreshGlusterServices() { if (getServiceNameMap().isEmpty()) { populateServiceMap(); } List<VDSGroup> clusters = getClusterDao().getAll(); for (VDSGroup cluster : clusters) { if (supportsGlusterServicesFeature(cluster)) { try { List<VDS> serversList = getClusterUtils().getAllServers(cluster.getId()); if (serversList.isEmpty()) { Map<ServiceType, GlusterServiceStatus> statusMap = new HashMap<>(); for (ServiceType type : getClusterServiceMap(cluster).keySet()) { statusMap.put(type, GlusterServiceStatus.UNKNOWN); } addOrUpdateClusterServices(cluster, statusMap); } else { List<Callable<Map<String, GlusterServiceStatus>>> taskList = createTaskList(serversList); if (taskList != null && taskList.size() > 0) { refreshClusterServices(cluster, ThreadPoolUtil.invokeAll(taskList)); } } } catch (Exception e) { log.errorFormat("Error while refreshing service statuses of cluster {0}!", cluster.getName(), e); } } } }
Source:
<code>private boolean containsNull() { <START> return nullsBufferContainsNull || remainingNullsContainsNulls(); <END> }</code><technical_language>inline remainingNullsContainsNulls: private boolean containsNull() { if (nullsBufferContainsNull) { return true; } for (int i = 0; i < remainingNullsCount; i++) { if (remainingNullsFromLastBatch[i]) { return true; } } return false; }</technical_language>

Target:
private boolean containsNull() { if (nullsBufferContainsNull) { return true; } for (int i = 0; i < remainingNullsCount; i++) { if (remainingNullsFromLastBatch[i]) { return true; } } return false; }
Source:
<code>private void inferReturnTypeFromInferedArgs(MethodInvocationTree tree, Resolve.Env methodEnv, List<JavaType> argTypes, List<JavaType> typeParamTypes, JavaType returnType, TypeSubstitution typeSubstitution) { List<JavaType> parameterTypes = getParameterTypes(tree.arguments()); if(!parameterTypes.equals(argTypes)) { IdentifierTree identifier = null; Resolution resolution = null; Tree methodSelect = tree.methodSelect(); if (methodSelect.is(Tree.Kind.MEMBER_SELECT)) { MemberSelectExpressionTree mset = (MemberSelectExpressionTree) methodSelect; JavaType type = getType(mset.expression()); if(type.isTagged(JavaType.DEFERRED)) { throw new IllegalStateException("type of arg should not be defered anymore ??"); } identifier = mset.identifier(); resolution = resolve.findMethod(methodEnv, type, identifier.name(), parameterTypes, typeParamTypes); } else if (methodSelect.is(Tree.Kind.IDENTIFIER)) { identifier = (IdentifierTree) methodSelect; resolution = resolve.findMethod(methodEnv, identifier.name(), parameterTypes, typeParamTypes); } if(resolution != null && returnType != resolution.type() && resolution.symbol().isMethodSymbol()) { MethodJavaType methodType = (MethodJavaType) resolution.type(); if(!methodType.resultType.isTagged(JavaType.DEFERRED)) { registerType(tree, resolve.applySubstitution(methodType.resultType, typeSubstitution)); <START> registerType(identifier, resolution.type()); <END> } } } else { registerType(tree, resolve.applySubstitution(returnType, typeSubstitution)); } }</code><technical_language>resolution.type() replaced methodType</technical_language>

Target:
private void inferReturnTypeFromInferedArgs(MethodInvocationTree tree, Resolve.Env methodEnv, List<JavaType> argTypes, List<JavaType> typeParamTypes, JavaType returnType, TypeSubstitution typeSubstitution) { List<JavaType> parameterTypes = getParameterTypes(tree.arguments()); if(!parameterTypes.equals(argTypes)) { IdentifierTree identifier = null; Resolution resolution = null; Tree methodSelect = tree.methodSelect(); if (methodSelect.is(Tree.Kind.MEMBER_SELECT)) { MemberSelectExpressionTree mset = (MemberSelectExpressionTree) methodSelect; JavaType type = getType(mset.expression()); if(type.isTagged(JavaType.DEFERRED)) { throw new IllegalStateException("type of arg should not be defered anymore ??"); } identifier = mset.identifier(); resolution = resolve.findMethod(methodEnv, type, identifier.name(), parameterTypes, typeParamTypes); } else if (methodSelect.is(Tree.Kind.IDENTIFIER)) { identifier = (IdentifierTree) methodSelect; resolution = resolve.findMethod(methodEnv, identifier.name(), parameterTypes, typeParamTypes); } if(resolution != null && returnType != resolution.type() && resolution.symbol().isMethodSymbol()) { MethodJavaType methodType = (MethodJavaType) resolution.type(); if(!methodType.resultType.isTagged(JavaType.DEFERRED)) { registerType(tree, resolve.applySubstitution(methodType.resultType, typeSubstitution)); registerType(identifier, methodType); } } } else { registerType(tree, resolve.applySubstitution(returnType, typeSubstitution)); } }
Source:
<code>public void putMonitoredEntity(String entityName, String entityType) throws FalconException{ MonitoredEntityBean monitoredEntityBean = new MonitoredEntityBean(); monitoredEntityBean.setEntityName(entityName); <START> monitoredEntityBean.setEntityType(entityType.toLowerCase()); <END> EntityManager entityManager = getEntityManager(); try { beginTransaction(entityManager); entityManager.persist(monitoredEntityBean); } finally { commitAndCloseTransaction(entityManager); } }</code><technical_language>this change</technical_language>

Target:
public void putMonitoredEntity(String entityName, String entityType) throws FalconException{ MonitoredEntityBean monitoredEntityBean = new MonitoredEntityBean(); monitoredEntityBean.setEntityName(entityName); monitoredEntityBean.setEntityType(entityType); EntityManager entityManager = getEntityManager(); try { beginTransaction(entityManager); entityManager.persist(monitoredEntityBean); } finally { commitAndCloseTransaction(entityManager); } }
Source:
<code>protected List<Entitlement> createEntitlements(Consumer consumer, Map<String, Integer> poolQuantityMap, CallerType caller) throws EntitlementRefusedException { <START> BindContext context = new BindContext(poolCurator, consumerCurator, i18n); <END> context = BindContext.build(context, consumer, poolQuantityMap); BindChain chain = new BindChain(); PreEntitlementRulesCheck rules = new PreEntitlementRulesCheck(enforcer); chain.addOperation(PreEntitlementRulesCheck.build(rules, caller)); chain.addOperation(new HandleEntitlements(poolCurator, entitlementCurator)); chain.addOperation(new ToDo(this)); HandleCertificates certOp = new HandleCertificates(ecGenerator, entitlementCertificateCurator, entitlementCurator); chain.addOperation(certOp); ComplianceCommand complianceCommand = new ComplianceCommand(complianceRules); chain.addOperation(complianceCommand); chain.preProcess(context); if (context.getException() == null) { context.lockPools(); chain.execute(context); } if (context.getException() != null) { throw context.getException(); } poolCurator.flush(); return new ArrayList<Entitlement>(context.getEntitlementMap().values()); }</code><technical_language>changes happening a transaction context. \@Transactional is removed createEnittlements method I a change in lock time</technical_language>

Target:
protected List<Entitlement> createEntitlements(Consumer consumer, Map<String, Integer> poolQuantityMap, CallerType caller) throws EntitlementRefusedException { Collection<Entitlement> ents = bindChainFactory. create(consumer, poolQuantityMap, caller). run(); poolCurator.flush(); return new ArrayList<Entitlement>(ents); }
Source:
<code>public void performApply(ILaunchConfigurationWorkingCopy wconfig) { wconfig.setAttribute(PerfPlugin.ATTR_Kernel_Location, txtKernelLocation.getText()); wconfig.setAttribute(PerfPlugin.ATTR_Record_Realtime, chkRecordRealtime.getSelection()); wconfig.setAttribute(PerfPlugin.ATTR_Record_Verbose, chkRecordVerbose.getSelection()); wconfig.setAttribute(PerfPlugin.ATTR_SourceLineNumbers, chkSourceLineNumbers.getSelection()); wconfig.setAttribute(PerfPlugin.ATTR_Kernel_SourceLineNumbers, chkKernelSourceLineNumbers.getSelection()); wconfig.setAttribute(PerfPlugin.ATTR_Multiplex, chkMultiplexEvents.getSelection()); wconfig.setAttribute(PerfPlugin.ATTR_ModuleSymbols, chkModuleSymbols.getSelection()); wconfig.setAttribute(PerfPlugin.ATTR_HideUnresolvedSymbols, chkHideUnresolvedSymbols.getSelection()); wconfig.setAttribute(PerfPlugin.ATTR_ShowSourceDisassembly, chkShowSourceDisassembly.getSelection()); wconfig.setAttribute(PerfPlugin.ATTR_ShowStat, chkShowStat.getSelection()); wconfig.setAttribute(PerfPlugin.ATTR_StatRunCount, statRunCount.getSelection()); <START> if(chkShowStat.getSelection()){ <END> toggleButtonsEnablement(false); } else{ toggleButtonsEnablement(true); } }</code><technical_language>This merged conditional in chkShowStat's selection listener</technical_language>

Target:
public void performApply(ILaunchConfigurationWorkingCopy wconfig) { wconfig.setAttribute(PerfPlugin.ATTR_Kernel_Location, txtKernelLocation.getText()); wconfig.setAttribute(PerfPlugin.ATTR_Record_Realtime, chkRecordRealtime.getSelection()); wconfig.setAttribute(PerfPlugin.ATTR_Record_Verbose, chkRecordVerbose.getSelection()); wconfig.setAttribute(PerfPlugin.ATTR_SourceLineNumbers, chkSourceLineNumbers.getSelection()); wconfig.setAttribute(PerfPlugin.ATTR_Kernel_SourceLineNumbers, chkKernelSourceLineNumbers.getSelection()); wconfig.setAttribute(PerfPlugin.ATTR_Multiplex, chkMultiplexEvents.getSelection()); wconfig.setAttribute(PerfPlugin.ATTR_ModuleSymbols, chkModuleSymbols.getSelection()); wconfig.setAttribute(PerfPlugin.ATTR_HideUnresolvedSymbols, chkHideUnresolvedSymbols.getSelection()); wconfig.setAttribute(PerfPlugin.ATTR_ShowSourceDisassembly, chkShowSourceDisassembly.getSelection()); wconfig.setAttribute(PerfPlugin.ATTR_ShowStat, chkShowStat.getSelection()); wconfig.setAttribute(PerfPlugin.ATTR_StatRunCount, statRunCount.getSelection()); }
Source:
<code>public InputStream getRequestEntity() { try { if (!(requestEntity instanceof ResettableServletInputStreamWrapper)) { requestEntity = new ResettableServletInputStreamWrapper( <START> ByteStreams.toByteArray(requestEntity)); <END> } requestEntity.reset(); } finally { return requestEntity; } }</code><technical_language>Wondering this do large file upload support</technical_language>

Target:
public InputStream getRequestEntity() { if (requestEntity == null) { return requestEntity; } try { if (!(requestEntity instanceof ResettableServletInputStreamWrapper)) { requestEntity = new ResettableServletInputStreamWrapper( StreamUtils.copyToByteArray(requestEntity)); } requestEntity.reset(); } finally { return requestEntity; } }
Source:
<code>public void setPropertyValue(String propertyName, String value){ <START> setParam("property."+propertyName+".default", value); <END> }</code><technical_language>calling setParam("property." + propertyName, value) concise distro.properties</technical_language>

Target:
public void setPropertyValue(String propertyName, String value){ setParam("property."+propertyName, value); }
Source:
<code>public void testConfigRoundtrip() throws Exception { String name = "testSlave"; JCloudsSlaveTemplate originalTemplate = new JCloudsSlaveTemplate(name, "imageId", "hardwareId", 1, 512, "osFamily", "osVersion", "jclouds-slave-type1 jclouds-type2", "Description", <START> "initScript", null, "1", false, null, null, true, null, "jenkins", false, <END> null, false, 5, 0, true, "jenkins", true); List<JCloudsSlaveTemplate> templates = new ArrayList<JCloudsSlaveTemplate>(); templates.add(originalTemplate); JCloudsCloud originalCloud = new JCloudsCloud("aws-profile", "aws-ec2", "identity", "credential", "privateKey", "publicKey", "endPointUrl", 1, 30, 600*1000, 600*1000, templates); hudson.clouds.add(originalCloud); submit(createWebClient().goTo("configure").getFormByName("config")); assertEqualBeans(originalCloud, JCloudsCloud.getByName("aws-profile"), "profile,providerName,identity,credential,privateKey,publicKey,endPointUrl"); assertEqualBeans(originalTemplate, JCloudsCloud.getByName("aws-profile").getTemplate(name), "name,cores,ram,osFamily,osVersion,labelString,description,initScript,numExecutors,stopOnTerminate"); }</code><technical_language>This extra null loose -- u empty string proper string formatting launching agent process</technical_language>

Target:
public void testConfigRoundtrip() throws Exception { String name = "testSlave"; JCloudsSlaveTemplate originalTemplate = new JCloudsSlaveTemplate(name, "imageId", "hardwareId", 1, 512, "osFamily", "osVersion", "jclouds-slave-type1 jclouds-type2", "Description", "initScript", null, "1", false, null, null, true, null, "jenkins", false, null, false, 5, 0, true, "jenkins", true); List<JCloudsSlaveTemplate> templates = new ArrayList<JCloudsSlaveTemplate>(); templates.add(originalTemplate); JCloudsCloud originalCloud = new JCloudsCloud("aws-profile", "aws-ec2", "identity", "credential", "privateKey", "publicKey", "endPointUrl", 1, 30, 600*1000, 600*1000, null, templates); hudson.clouds.add(originalCloud); submit(createWebClient().goTo("configure").getFormByName("config")); assertEqualBeans(originalCloud, JCloudsCloud.getByName("aws-profile"), "profile,providerName,identity,credential,privateKey,publicKey,endPointUrl"); assertEqualBeans(originalTemplate, JCloudsCloud.getByName("aws-profile").getTemplate(name), "name,cores,ram,osFamily,osVersion,labelString,description,initScript,numExecutors,stopOnTerminate"); }