auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void onNetworkMonitorCreated(INetworkMonitor networkMonitor) { <START> enforceNetworkStackPackagePermission(); <END> mHandler.sendMessage(mHandler.obtainMessage(EVENT_REGISTER_NETWORK_AGENT, new Pair<>(mNai, networkMonitor))); }</code><technical_language>do need permission checks? I assuming callback is coming object system is explicitly bound to, enough proof sender is authorized perform action. If do need here, do need other callbacks well</technical_language>

Target:
public void onNetworkMonitorCreated(INetworkMonitor networkMonitor) { mHandler.sendMessage(mHandler.obtainMessage(EVENT_REGISTER_NETWORK_AGENT, new Pair<>(mNai, networkMonitor))); }
Source:
<code>public GroupResource parse(TopLevelResource parent, IdString id) throws ResourceNotFoundException, Exception { final CurrentUser user = self.get(); if (user instanceof AnonymousUser) { throw new AuthException("Authentication required"); } else if(!(user instanceof IdentifiedUser)) { throw new ResourceNotFoundException(id); } GroupDescription.Basic d = parse(id.get()); AccountGroup group = GroupDescriptions.toAccountGroup(d); if (group == null) { <START> throw new ResourceNotFoundException(id); <END> } GroupControl ctl = groupControlFactory.controlFor(group); if (!ctl.isVisible()) { throw new ResourceNotFoundException(id); } return new GroupResource(ctl); }</code><technical_language>failing for external groups? if I want retrieve name of external group GET /groups/<uuid-of-external-group>/name ? Is this anymore</technical_language>

Target:
public GroupResource parse(TopLevelResource parent, IdString id) throws ResourceNotFoundException, Exception { final CurrentUser user = self.get(); if (user instanceof AnonymousUser) { throw new AuthException("Authentication required"); } else if(!(user instanceof IdentifiedUser)) { throw new ResourceNotFoundException(id); } GroupControl ctl = groupControlFactory.controlFor(parse(id.get())); if (!ctl.isVisible()) { throw new ResourceNotFoundException(id); } return new GroupResource(ctl); }
Source:
<code>public static void main(String[] args) throws Exception { VerifiableProperties properties = ToolUtils.getVerifiableProperties(args); CopierConfig config = new CopierConfig(properties); StoreConfig storeConfig = new StoreConfig(properties); ClusterMapConfig clusterMapConfig = new ClusterMapConfig(properties); HelixPropertyStoreConfig helixPropertyStoreConfig = new HelixPropertyStoreConfig(properties); ClusterAgentsFactory clusterAgentsFactory = <START> Utils.getObj(clusterMapConfig.clusterMapClusterAgentsFactory, clusterMapConfig, helixPropertyStoreConfig, <END> config.hardwareLayoutFilePath, config.partitionLayoutFilePath); try (ClusterMap clusterMap = clusterAgentsFactory.getClusterMap()) { StoreKeyFactory storeKeyFactory = Utils.getObj(storeConfig.storeKeyFactory, clusterMap); File srcDir = new File(config.srcStoreDirPath); File tgtDir = new File(config.tgtStoreDirPath); StoreMetrics metrics = new StoreMetrics(clusterMap.getMetricRegistry()); DiskSpaceAllocator diskSpaceAllocator = new DiskSpaceAllocator(false, null, 0, new StorageManagerMetrics(clusterMap.getMetricRegistry())); try (StoreCopier storeCopier = new StoreCopier("src", srcDir, tgtDir, config.storeCapacity, config.fetchSizeInBytes, storeConfig, metrics, storeKeyFactory, new DiskIOScheduler(null), diskSpaceAllocator, Collections.emptyList(), SystemTime.getInstance())) { storeCopier.copy(new StoreFindTokenFactory(storeKeyFactory).getNewFindToken()); } } }</code><technical_language>This change reverted too</technical_language>

Target:
public static void main(String[] args) throws Exception { VerifiableProperties properties = ToolUtils.getVerifiableProperties(args); CopierConfig config = new CopierConfig(properties); StoreConfig storeConfig = new StoreConfig(properties); ClusterMapConfig clusterMapConfig = new ClusterMapConfig(properties); ClusterAgentsFactory clusterAgentsFactory = Utils.getObj(clusterMapConfig.clusterMapClusterAgentsFactory, clusterMapConfig, config.hardwareLayoutFilePath, config.partitionLayoutFilePath); try (ClusterMap clusterMap = clusterAgentsFactory.getClusterMap()) { StoreKeyFactory storeKeyFactory = Utils.getObj(storeConfig.storeKeyFactory, clusterMap); File srcDir = new File(config.srcStoreDirPath); File tgtDir = new File(config.tgtStoreDirPath); StoreMetrics metrics = new StoreMetrics(clusterMap.getMetricRegistry()); DiskSpaceAllocator diskSpaceAllocator = new DiskSpaceAllocator(false, null, 0, new StorageManagerMetrics(clusterMap.getMetricRegistry())); try (StoreCopier storeCopier = new StoreCopier("src", srcDir, tgtDir, config.storeCapacity, config.fetchSizeInBytes, storeConfig, metrics, storeKeyFactory, new DiskIOScheduler(null), diskSpaceAllocator, Collections.emptyList(), SystemTime.getInstance())) { storeCopier.copy(new StoreFindTokenFactory(storeKeyFactory).getNewFindToken()); } } }
Source:
<code>private ReportRunner<ReportTemplate> getReportRunner(ReportTemplate reportTemplate) { if (reportTemplate instanceof TradeReportTemplate) { ReportRunner<? extends ReportTemplate> runner = new TradeReportRunner(); <START> return (ReportRunner<ReportTemplate>) runner; <END> } throw new IllegalArgumentException(Messages.format("Unsupported report type: {}", reportTemplate.getClass().getSimpleName())); }</code><technical_language>this inlined? Is unchecked</technical_language>

Target:
private ReportRunner<ReportTemplate> getReportRunner(ReportTemplate reportTemplate) { if (reportTemplate instanceof TradeReportTemplate) { return (ReportRunner) new TradeReportRunner(); } throw new IllegalArgumentException(Messages.format("Unsupported report type: {}", reportTemplate.getClass().getSimpleName())); }
Source:
<code>public int hashCode() { int result = name != null ? name.hashCode() : 0; <START> result = 37 * result + getSketchValue().hashCode(); <END> return result; }</code><technical_language>SketchHolder overrides equals hashCode. This is a bug, if a visible effect in production this patch (I of offhand depend SketchHolder's hash code consistent equals). affect correctness of this new class's equals/hashCode methods. please fix SketchHolder in this patch - I delegates underlying Sketch's hashCode method enough</technical_language>

Target:
public int hashCode() { int result = name != null ? name.hashCode() : 0; result = 37 * result + sketchValue.hashCode(); return result; }
Source:
<code>private void detectComplexOrderby() { <START> if (! hasOrderByColumns() || (! m_hasAggregateExpression && m_groupByColumns.isEmpty())) { <END> return; } Set<AbstractExpression> missingGroupBySet = new HashSet<>(); for (ParsedColInfo col : m_groupByColumns) { if (col.groupByInDisplay) { continue; } if (col.expression.hasAnySubexpressionOfClass( ParameterValueExpression.class)) { assert(hasComplexGroupby()); m_isComplexOrderBy = true; return; } missingGroupBySet.add(col.expression); } for (ParsedColInfo orderCol : m_orderColumns) { AbstractExpression expr = orderCol.expression; if (expr.hasAnySubexpressionOfClass(ParameterValueExpression.class)) { m_isComplexOrderBy = true; return; } if (expr.hasSubExpressionFrom(missingGroupBySet)) { m_isComplexOrderBy = true; return; } } }</code><technical_language>isGrouped() is defined !m_groupByColumnsisEmpty() !isGrouped() in place of m_groupByColumns.isEmpty()</technical_language>

Target:
private void detectComplexOrderby() { m_isComplexOrderBy = false; if (! hasOrderByColumns() || (! m_hasAggregateExpression && !isGrouped())) { return; } Set<AbstractExpression> missingGroupBySet = new HashSet<>(); for (ParsedColInfo col : m_groupByColumns) { if (col.groupByInDisplay) { continue; } if (col.expression.hasAnySubexpressionOfClass( ParameterValueExpression.class)) { assert(hasComplexGroupby()); m_isComplexOrderBy = true; return; } missingGroupBySet.add(col.expression); } for (ParsedColInfo orderCol : m_orderColumns) { AbstractExpression expr = orderCol.expression; if (expr.hasAnySubexpressionOfClass(ParameterValueExpression.class)) { m_isComplexOrderBy = true; return; } if (expr.hasSubExpressionFrom(missingGroupBySet)) { m_isComplexOrderBy = true; return; } } }
Source:
<code>private void applyVmInterfaceSpecificStyles() { <START> mainInfoPanel.getElement().getStyle().setPaddingBottom(0, Style.Unit.PX); <END> mainInfoPanel.getElement().getStyle().setPaddingTop(0, Style.Unit.PX); detailedInfoContainer.getElement().getStyle().setMarginLeft(0, Style.Unit.PX); detailedInfoContainer.getElement().getStyle().setWidth(100, Style.Unit.PCT); descriptionPanel.getElement().getStyle().setWidth(10, Style.Unit.PCT); descriptionHeaderPanel.getElement().getStyle().setWidth(100, Style.Unit.PCT); descriptionHeaderPanel.getElement().getStyle().setFontSize(20, Style.Unit.PX); descriptionPanel.removeStyleName(PatternflyConstants.PF_LIST_VIEW_DESCRIPTION); }</code><technical_language>get of padding/margins/font sizes/etc a css class. add a specific class divs, _scss file add them</technical_language>

Target:
private void applyVmInterfaceSpecificStyles() { listGroupItem.addStyleName(NETWORK_LIST_ITEM); descriptionPanel.getElement().getStyle().setWidth(10, Style.Unit.PCT); descriptionPanel.removeStyleName(PatternflyConstants.PF_LIST_VIEW_DESCRIPTION); }
Source:
<code>public void setUp() { db = fongo.getDB(); experiment = Submission.SrlExperiment.newBuilder() .setProblemId(PROBLEM_ID) .setAssignmentId(new ObjectId().toString()) .setCourseId(new ObjectId().toString()) .setUserId(USER_USER) .setSubmission(Submission.SrlSubmission.getDefaultInstance()) .build(); try { AuthenticationHelper.setMockPermissions(authChecker, null, null, null, null, Authentication.AuthResponse.PermissionLevel.NO_PERMISSION); when(optionChecker.authenticateDate(any(AuthenticationDataCreator.class), anyLong())) .thenReturn(false); when(optionChecker.isItemPublished(any(AuthenticationDataCreator.class))) .thenReturn(false); when(optionChecker.isItemRegistrationRequired(any(AuthenticationDataCreator.class))) .thenReturn(true); } catch (DatabaseAccessException e) { e.printStackTrace(); <START> } catch (AuthenticationException e) { <END> e.printStackTrace(); } authenticator = new Authenticator(authChecker, optionChecker); }</code><technical_language>combine 2 catches 1</technical_language>

Target:
public void setUp() throws Exception { db = fongo.getDB(); experiment = Submission.SrlExperiment.newBuilder() .setProblemId(PROBLEM_ID) .setAssignmentId(new ObjectId().toString()) .setCourseId(new ObjectId().toString()) .setUserId(USER_USER) .setSubmission(Submission.SrlSubmission.getDefaultInstance()) .build(); AuthenticationHelper.setMockPermissions(authChecker, null, null, null, null, Authentication.AuthResponse.PermissionLevel.NO_PERMISSION); when(optionChecker.authenticateDate(any(AuthenticationDataCreator.class), anyLong())) .thenReturn(false); when(optionChecker.isItemPublished(any(AuthenticationDataCreator.class))) .thenReturn(false); when(optionChecker.isItemRegistrationRequired(any(AuthenticationDataCreator.class))) .thenReturn(true); authenticator = new Authenticator(authChecker, optionChecker); }
Source:
<code>private void checkDuplicateRegistration(String name, Set<String> items, String type) { if(items.contains(name)) { LOGGER.warn("Overriding the existing registered with the name: {}", type, name); } <START> items.add(name); <END> }</code><technical_language>a small note: add(...) method Set<T> returns false if element exists in set contains check is superfluous. code changed to: if (!items.add(name)) { LOGGER.warn("Overriding existing registered name: {}", type, name); }</technical_language>

Target:
private void checkDuplicateRegistration(String name, Set<String> items, String type) { if(!items.add(name)) { LOGGER.warn("Overriding the existing registered with the name: {}", type, name); } }
Source:
<code>public CompletableFuture<URL> getAddress(final String namespace, final String name) { final URL cachedURL = cache.get(namespace + ":" + name); if(cachedURL != null) { final CompletableFuture<URL> future = new CompletableFuture<>(); future.complete(cachedURL); return future; } else { return httpClient.get(discoveryServiceEndpoint + "/services/" + namespace + "/" + name).withoutContent().readString().execute().handle((r, e) -> { if (e != null) { throw new DolphinRuntimeException("Can not get address for namespace " + namespace + " and name " + name, e); } try { <START> URL url = new URL(r.getContent()); <END> cache.put(namespace + ":" + name, url); return url; } catch (MalformedURLException e1) { throw new DolphinRuntimeException("Can not get address for namespace " + namespace + " and name " + name, e); } }); } }</code><technical_language>Add final keyword</technical_language>

Target:
public CompletableFuture<URL> getAddress(final String namespace, final String name) { final URL cachedURL = cache.get(namespace + ":" + name); if(cachedURL != null) { final CompletableFuture<URL> future = new CompletableFuture<>(); future.complete(cachedURL); return future; } else { return httpClient.get(discoveryServiceEndpoint + "/services/" + namespace + "/" + name).withoutContent().readString().execute().handle((r, e) -> { if (e != null) { throw new DolphinRuntimeException("Can not get address for namespace " + namespace + " and name " + name, e); } try { final URL url = new URL(r.getContent()); cache.put(namespace + ":" + name, url); return url; } catch (final MalformedURLException e1) { throw new DolphinRuntimeException("Can not get address for namespace " + namespace + " and name " + name, e); } }); } }
Source:
<code>public boolean isTrue() { <START> return (RandomUtils.nextInt() * pct / 100) == 1; <END> }</code><technical_language>please explain this work? I assume pct = 100 means 100% probability, ie. return true. This requires nextInt=1, RandomUtils.nextInt() returns values 0 Integer.MAX_VALUE, probability. other hand, for pct = 1 this returns true for nextInt in [100, 199], higher probability for pct = 100, 1%</technical_language>

Target:
public boolean isTrue() { return (RandomUtils.nextInt(0, 100) <= pct); }
Source:
<code><START> private void addTokenToResponse(final HttpServletResponse response, final String token, final Boolean addCookie) <END> throws IOException { if (addCookie) { Cookie cookie = new Cookie(AUTHORIZATION_COOKIE, token); cookie.setHttpOnly(true); response.addCookie(cookie); } response.setHeader(AUTHORIZATION_HEADER, String.format("%s %s", AUTHORIZATION_TYPE, token)); }</code><technical_language>add inline info explaining need authentication cookies Shibboleth authentication headers due redirects</technical_language>

Target:
private void addTokenToResponse(final HttpServletResponse response, final String token, final Boolean addCookie) throws IOException { if (addCookie) { Cookie cookie = new Cookie(AUTHORIZATION_COOKIE, token); cookie.setHttpOnly(true); cookie.setSecure(true); response.addCookie(cookie); } response.setHeader(AUTHORIZATION_HEADER, String.format("%s %s", AUTHORIZATION_TYPE, token)); }
Source:
<code>public boolean isFeedbackSessionCompletedByStudent(FeedbackSessionAttributes fsa, String userEmail) throws EntityDoesNotExistException { <START> if (fsa == null) { <END> throw new EntityDoesNotExistException( "Trying to check a feedback session that does not exist."); } if (fsa.respondingStudentList.contains(userEmail)) { return true; } String feedbackSessionName = fsa.feedbackSessionName; String courseId = fsa.courseId; List<FeedbackQuestionAttributes> allQuestions = fqLogic.getFeedbackQuestionsForStudents(feedbackSessionName, courseId); return allQuestions.isEmpty(); }</code><technical_language>fsa a parameter, reasonable expect not-null. assertion instead</technical_language>

Target:
public boolean isFeedbackSessionCompletedByStudent(FeedbackSessionAttributes fsa, String userEmail) throws EntityDoesNotExistException { Assumption.assertNotNull(fsa); if (fsa.respondingStudentList.contains(userEmail)) { return true; } String feedbackSessionName = fsa.feedbackSessionName; String courseId = fsa.courseId; List<FeedbackQuestionAttributes> allQuestions = fqLogic.getFeedbackQuestionsForStudents(feedbackSessionName, courseId); return allQuestions.isEmpty(); }
Source:
<code>public <K, V> Cache<K, V> getCache(String cacheName) { Cache<K, V> cache = super.getCache(cacheName); if (dataType == DataType.UTF8) { <START> return (Cache<K, V>) cache.getAdvancedCache().withEncoder(UTF8Encoder.INSTANCE).withSubject(subject); <END> } Encoder encoder = marshaller.isPresent() ? new MarshallerEncoder(marshaller.get()) : IdentityEncoder.INSTANCE; AdvancedCache<K, V> advancedCache = (AdvancedCache<K, V>) cache.getAdvancedCache().withEncoder(encoder).withSubject(subject); return advancedCache; }</code><technical_language>encoder precalculated in constructor: Class<? extends Encoder> encoderClass = dataType == DataType.UTF8 ? UTF8KeyValueEncoder.class : marshaller.isPresent() ? GenericJbossMarshallerEncoder.class : IdentityEncoder.class; getCache reduced a one-liner</technical_language>

Target:
public <K, V> Cache<K, V> getCache(String cacheName) { Cache<K, V> cache = super.getCache(cacheName); return (AdvancedCache<K, V>) cache.getAdvancedCache().withEncoding(encoderClass).withSubject(subject); }
Source:
<code>public static ByteBuf encodeMetadata( ByteBufAllocator allocator, String customAuthType, ByteBuf metadata) { int actualASCIILength = ByteBufUtil.utf8Bytes(customAuthType); if (actualASCIILength != customAuthType.length()) { throw new IllegalArgumentException("custom auth type must be US_ASCII characters only"); } if (actualASCIILength < 1 || actualASCIILength > 128) { throw new IllegalArgumentException( <START> "custom auth type must have a strictly positive length that fits on 7 unsigned bits, ie" + " 1-128"); <END> } int capacity = 1 + actualASCIILength; ByteBuf headerBuffer = allocator.buffer(capacity, capacity); headerBuffer.writeByte(actualASCIILength - 1); ByteBufUtil.reserveAndWriteUtf8(headerBuffer, customAuthType, actualASCIILength); return allocator.compositeBuffer(2).addComponents(true, headerBuffer, metadata); }</code><technical_language>line changed suggestion "custom auth type a strictly positive length fits 7 unsigned bits, 1-128");</technical_language>

Target:
public static ByteBuf encodeMetadata( ByteBufAllocator allocator, String customAuthType, ByteBuf metadata) { int actualASCIILength = ByteBufUtil.utf8Bytes(customAuthType); if (actualASCIILength != customAuthType.length()) { throw new IllegalArgumentException("custom auth type must be US_ASCII characters only"); } if (actualASCIILength < 1 || actualASCIILength > 128) { throw new IllegalArgumentException( "custom auth type must have a strictly positive length that fits on 7 unsigned bits, ie 1-128"); } int capacity = 1 + actualASCIILength; ByteBuf headerBuffer = allocator.buffer(capacity, capacity); headerBuffer.writeByte(actualASCIILength - 1); ByteBufUtil.reserveAndWriteUtf8(headerBuffer, customAuthType, actualASCIILength); return allocator.compositeBuffer(2).addComponents(true, headerBuffer, metadata); }
Source:
<code>public Component getContent(Project project, ExtensionUtil util) { Layout layout = new CssLayout(); layout.addStyleName(STYLE_MAILING_INFOBOX); layout.setSizeFull(); HtmlBuilder html = new HtmlBuilder(); InfoExtension ext = project.getExtension(InfoExtension.class); if (ext != null) { Set<String> mailingLists = ext.getMailingLists(); if (mailingLists.size() > 0) { MailingListMapper mapper = new MailingListMapper(); html.append("<ul>"); for (String mailingList : ext.getMailingLists()) { html.append("<li>"); html.appendMailToLink(mailingList); List<Link> mappedLinks = mapper.getMappedLinks(configService, project.getProjectId(), mailingList, LinkMapper.ALL_PURPOSES); if (!mappedLinks.isEmpty()) { html.appendLineBreak(); html.appendLinks(mappedLinks); } html.append("</li>"); } html.append("</ul>"); } } if (html.length() > 0) { createLabel(layout, html.toString()); addLastModifiedInfo(layout, ext); } else { createLabel(layout, "This project has no mailing lists."); } <START> addLastModifiedInfo(layout, ext); <END> return layout; }</code><technical_language>this renders timestamp</technical_language>

Target:
public Component getContent(Project project, ExtensionUtil util) { Layout layout = new CssLayout(); layout.addStyleName(STYLE_MAILING_INFOBOX); layout.setSizeFull(); HtmlBuilder html = new HtmlBuilder(); InfoExtension ext = project.getExtension(InfoExtension.class); if (ext != null) { Set<String> mailingLists = ext.getMailingLists(); if (mailingLists.size() > 0) { MailingListMapper mapper = new MailingListMapper(); html.append("<ul>"); for (String mailingList : ext.getMailingLists()) { html.append("<li>"); html.appendMailToLink(mailingList); List<Link> mappedLinks = mapper.getMappedLinks(configService, project.getProjectId(), mailingList, LinkMapper.ALL_PURPOSES); if (!mappedLinks.isEmpty()) { html.appendLineBreak(); html.appendLinks(mappedLinks); } html.append("</li>"); } html.append("</ul>"); } } if (html.length() > 0) { createLabel(layout, html.toString()); } else { createLabel(layout, "This project has no mailing lists."); } return layout; }
Source:
<code><START> public void testEnableStatistics() throws IntrospectionException, InstanceNotFoundException, <END> MalformedObjectNameException, ReflectionException, AttributeNotFoundException, MBeanException { String mBeanName = getMBeanName(enableStatisticsTestCacheName); try { cacheManager.enableStatistics(enableStatisticsTestCacheName, false); } catch (NullPointerException npe) { npe.printStackTrace(); fail("NullPointerException thrown while attempting to disable statistics"); } assertTrue("Statistics register as enabled after disabling", !(Boolean) mBeanServer.getAttribute(new ObjectName(mBeanName), "StatisticsEnabled")); try { cacheManager.enableStatistics(enableStatisticsTestCacheName, true); } catch (NullPointerException npe) { npe.printStackTrace(); fail("NullPointerException thrown while attempting to enable statistics"); } assertTrue("Statistics register as disabled after enabling", (Boolean) mBeanServer.getAttribute(new ObjectName(mBeanName), "StatisticsEnabled")); }</code><technical_language>throws Exception</technical_language>

Target:
public void testEnableStatistics() throws Exception { ObjectName mBeanName = getMBeanName(enableStatisticsTestCacheName, "Statistics"); cacheManager.enableStatistics(enableStatisticsTestCacheName, true); assertTrue("Statistics register as disabled after enabling", mBeanServer.isRegistered(mBeanName)); cacheManager.enableStatistics(enableStatisticsTestCacheName, false); assertFalse("Statistics register as enabled after disabling", mBeanServer.isRegistered(mBeanName)); }
Source:
<code>private void setCorrelationId(HttpContext httpContext, SourceRequest request) { String externalCorrelationId = request.getHeaders().get(PassThroughConstants.CORRELATION_ID); String corId; long corTime = System.currentTimeMillis(); if (externalCorrelationId == null) { corId = UUID.randomUUID().toString(); } else { corId = externalCorrelationId; } httpContext.setAttribute(PassThroughConstants.CORRELATION_ID, corId); <START> httpContext.setAttribute(PassThroughConstants.CORRELATION_REQUEST_ARRIVED_TIME, corTime); <END> }</code><technical_language>method name set correlationId here, I set request arrival time here. set property place calling this method. this method need request arrival time, parse a parameter in method</technical_language>

Target:
private void setCorrelationId(HttpContext httpContext, SourceRequest request) { String externalCorrelationId = request.getHeaders().get(PassThroughConstants.CORRELATION_ID); String corId; if (externalCorrelationId == null) { corId = UUID.randomUUID().toString(); } else { corId = externalCorrelationId; } httpContext.setAttribute(PassThroughConstants.CORRELATION_ID, corId); }
Source:
<code>private PgClassTable.Entry relationToPgClassEntry(RelationInfo info) { <START> return new PgClassTable.Entry(OidHash.relationOid(info), OidHash.schemaOid(info.ident().schema()), info.ident(), info.ident().name(), info.relationType(), info.columns().size(), info.primaryKey().size() > 0); <END> }</code><technical_language>suggestion return new PgClassTable.Entry( OidHash.relationOid(info), OidHash.schemaOid(info.ident().schema()), info.ident(), info.ident().name(), info.relationType(), info.columns().size(), info.primaryKey().size() > 0);</technical_language>

Target:
private PgClassTable.Entry relationToPgClassEntry(RelationInfo info) { return new PgClassTable.Entry( OidHash.relationOid(info), OidHash.schemaOid(info.ident().schema()), info.ident(), info.ident().name(), toEntryType(info.relationType()), info.columns().size(), info.primaryKey().size() > 0); }
Source:
<code>public void closeDirty() { try { <START> close(false); <END> } catch (final RuntimeException e) { log.warn(String.format("Ignoring uncaught error in unclean close of active task %s", id), e); } log.info("Closed dirty"); }</code><technical_language>Ditto here, if swallowed exception close, is unnecessary another swallow here</technical_language>

Target:
public void closeDirty() { close(false); log.info("Closed dirty"); }
Source:
<code>public Attribute loadAttribute(String name, String attName) throws EntityNotFoundException { Product product = null; try { product = productManager.load(name); } catch (EntityNotFoundException e) { log.warning("The product: " + name + " is not in the database"); throw new APIException(new EntityNotFoundException(Product.class,name, e)); } try { return product.getAttribute(attName); } catch (Exception e) { log.warning("Attribute not found : " + attName); <START> throw new APIException(new EntityNotFoundException(Metadata.class, "Attribute not found : " + attName, attName)); <END> } }</code><technical_language>gt 120</technical_language>

Target:
public Attribute loadAttribute(String name, String attName) throws APIException { Product product = null; try { product = productManager.load(name); } catch (EntityNotFoundException e) { log.warning("The product: " + name + " is not in the database"); throw new APIException(new EntityNotFoundException(Product.class,name, e)); } try { return product.getAttribute(attName); } catch (Exception e) { log.warning("Attribute not found : " + attName); throw new APIException(new EntityNotFoundException(Metadata.class, "Attribute not found : " + attName, attName)); } }
Source:
<code>public static SeasonalityDefinition of(DoubleArray seasonalityMonthOnMonth, ShiftType adjustmentType) { <START> return SeasonalityDefinition.builder() <END> .seasonalityMonthOnMonth(seasonalityMonthOnMonth) .adjustmentType(adjustmentType).build(); }</code><technical_language>Call new SeasonalityDefinition(a, b) avoid object creation</technical_language>

Target:
public static SeasonalityDefinition of(DoubleArray seasonalityMonthOnMonth, ShiftType adjustmentType) { ArgChecker.isTrue(seasonalityMonthOnMonth.size() == 12, "seasonality must be of length 12"); return new SeasonalityDefinition(seasonalityMonthOnMonth, adjustmentType); }
Source:
<code>public String getText(final Object element) { if (element == null) { return ""; <START> } <END> return ((FileDiff) element).getLabel(element); }</code><technical_language>super() returns "" null. differ</technical_language>

Target:
public String getText(final Object element) { if (element == null) { return null; } return ((FileDiff) element).getLabel(element); }
Source:
<code>public synchronized void updateMemoryPoolAssignments(MemoryPoolAssignmentsRequest assignments) { if (coordinatorId != null && coordinatorId.equals(assignments.getCoordinatorId()) && assignments.getVersion() <= currentMemoryPoolAssignmentVersion) { return; } currentMemoryPoolAssignmentVersion = assignments.getVersion(); if (coordinatorId != null && !coordinatorId.equals(assignments.getCoordinatorId())) { log.warn("Switching coordinator affinity from " + coordinatorId + " to " + assignments.getCoordinatorId()); } coordinatorId = assignments.getCoordinatorId(); for (MemoryPoolAssignment assignment : assignments.getAssignments()) { if (assignment.getPoolId().equals(GENERAL_POOL)) { queryContexts.getUnchecked(assignment.getQueryId()).setMemoryPool(localMemoryManager.getGeneralPool()); } else if (assignment.getPoolId().equals(RESERVED_POOL)) { MemoryPool reservedPool = localMemoryManager.getReservedPool() .orElseThrow(() -> new IllegalArgumentException(format("Cannot move %s to the reserved pool as the reserved pool is not enabled", assignment.getQueryId()))); queryContexts.getUnchecked(assignment.getQueryId()).setMemoryPool(reservedPool); } else { <START> new IllegalArgumentException(format("Cannot move %s to %s as the given memory pool id is invalid", assignment.getQueryId(), assignment.getPoolId())); <END> } } }</code><technical_language>replace source target</technical_language>

Target:
public synchronized void updateMemoryPoolAssignments(MemoryPoolAssignmentsRequest assignments) { if (coordinatorId != null && coordinatorId.equals(assignments.getCoordinatorId()) && assignments.getVersion() <= currentMemoryPoolAssignmentVersion) { return; } currentMemoryPoolAssignmentVersion = assignments.getVersion(); if (coordinatorId != null && !coordinatorId.equals(assignments.getCoordinatorId())) { log.warn("Switching coordinator affinity from " + coordinatorId + " to " + assignments.getCoordinatorId()); } coordinatorId = assignments.getCoordinatorId(); for (MemoryPoolAssignment assignment : assignments.getAssignments()) { if (assignment.getPoolId().equals(GENERAL_POOL)) { queryContexts.getUnchecked(assignment.getQueryId()).setMemoryPool(localMemoryManager.getGeneralPool()); } else if (assignment.getPoolId().equals(RESERVED_POOL)) { MemoryPool reservedPool = localMemoryManager.getReservedPool() .orElseThrow(() -> new IllegalArgumentException(format("Cannot move %s to the reserved pool as the reserved pool is not enabled", assignment.getQueryId()))); queryContexts.getUnchecked(assignment.getQueryId()).setMemoryPool(reservedPool); } else { new IllegalArgumentException(format("Cannot move %s to %s as the target memory pool id is invalid", assignment.getQueryId(), assignment.getPoolId())); } } }
Source:
<code>public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } <START> ChePluginReference cheServiceReference = (ChePluginReference) o; <END> return Objects.equals(name, cheServiceReference.name) && Objects.equals(version, cheServiceReference.version) && Objects.equals(parameters, cheServiceReference.parameters); }</code><technical_language>cheServiceReference -> chePluginReference Please usages of service is replaced plugin</technical_language>

Target:
public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ChePluginReference chePluginReference = (ChePluginReference) o; return Objects.equals(name, chePluginReference.name) && Objects.equals(version, chePluginReference.version) && Objects.equals(parameters, chePluginReference.parameters); }
Source:
<code><START> public Boolean getAlignSampling() { <END> return _alignSampling; }</code><technical_language>If @Nullable Optional</technical_language>

Target:
public Optional<Boolean> getAlignSampling() { return _alignSampling; }
Source:
<code>Request build() { String apiUrl = this.apiUrl; StringBuilder url = new StringBuilder(apiUrl); if (apiUrl.endsWith("/")) { url.deleteCharAt(url.length() - 1); } url.append(relativeUrl); StringBuilder queryParams = this.queryParams; if (queryParams != null) { url.append(queryParams); } RequestBody body = this.body; <START> if (formEncodingBuilder != null) { <END> body = formEncodingBuilder.build(); } else if (multipartBuilder != null) { body = multipartBuilder.build(); } Headers.Builder headerBuilder = this.headers; if (contentTypeHeader != null) { if (body != null) { body = new MediaTypeOverridingRequestBody(body, contentTypeHeader); } else { if (headerBuilder == null) { headerBuilder = new Headers.Builder(); } headerBuilder.add("Content-Type", contentTypeHeader); } } Headers headers = headerBuilder != null ? headerBuilder.build() : NO_HEADERS; return new Request.Builder() .url(url.toString()) .method(requestMethod, body) .headers(headers) .build(); }</code><technical_language>Smells a bit weird this is if/else block, if form encoding higher priority multipart, in reality mutually exclusive</technical_language>

Target:
Request build() { String apiUrl = this.apiUrl; StringBuilder url = new StringBuilder(apiUrl); if (apiUrl.endsWith("/")) { url.deleteCharAt(url.length() - 1); } url.append(relativeUrl); StringBuilder queryParams = this.queryParams; if (queryParams != null) { url.append(queryParams); } RequestBody body = this.body; if (body == null) { if (formEncodingBuilder != null) { body = formEncodingBuilder.build(); } else if (multipartBuilder != null) { body = multipartBuilder.build(); } } Headers.Builder headerBuilder = this.headers; if (contentTypeHeader != null) { if (body != null) { body = new MediaTypeOverridingRequestBody(body, contentTypeHeader); } else { if (headerBuilder == null) { headerBuilder = new Headers.Builder(); } headerBuilder.add("Content-Type", contentTypeHeader); } } Headers headers = headerBuilder != null ? headerBuilder.build() : NO_HEADERS; return new Request.Builder() .url(url.toString()) .method(requestMethod, body) .headers(headers) .build(); }
Source:
<code>public void testConvertProfileGenericDataResponseDto() { final ProfileGenericDataResponseDto dto = this.makeProfileGenericDataResponseDto(); final ProfileGenericDataResponse result = this.mapper.map(dto, ProfileGenericDataResponse.class); <START> Assert.assertTrue(result != null && result instanceof ProfileGenericDataResponse); <END> }</code><technical_language>use: import static org.hamcrest.CoreMatchers.instanceOf; ... assertNotNull(result); assertThat(result, instanceOf(ClassName.class));</technical_language>

Target:
public void testConvertProfileGenericDataResponseDto() { final ProfileGenericDataResponseDto dto = this.makeProfileGenericDataResponseDto(); final ProfileGenericDataResponse result = this.mapper.map(dto, ProfileGenericDataResponse.class); assertNotNull("mapping ProfileGenericDataResponse should not return null", result); assertThat("mapping ProfileGenericDataResponse should return correct type", result, instanceOf(ProfileGenericDataResponse.class)); }
Source:
<code>public static GSSContext getGssContext(Subject subject, String servicePrincipal) { return Subject.doAs(subject, (PrivilegedAction<GSSContext>) () -> { GSSContext context = null; try { Principal subjectPrincipal = subject.getPrincipals().iterator().next(); GSSName gssUserName = gssManager.createName(subjectPrincipal.getName(), GSSName.NT_USER_NAME); GSSCredential clientCredential = gssManager.createCredential(gssUserName, GSSCredential.DEFAULT_LIFETIME, KERBEROS_OID, GSSCredential.INITIATE_ONLY); GSSName gssServiceName = gssManager.createName(servicePrincipal, null); <START> context = gssManager.createContext(gssServiceName, SPNEGO_OID, clientCredential, GSSContext.INDEFINITE_LIFETIME); <END> context.requestMutualAuth(true); context.requestConf(true); context.requestInteg(true); context.requestCredDeleg(false); return context; } catch (GSSException e) { throw Throwables.propagate(e); } }); }</code><technical_language>Move variable creation</technical_language>

Target:
public static GSSContext getGssContext(Subject subject, String servicePrincipal) { return Subject.doAs(subject, (PrivilegedAction<GSSContext>) () -> { try { Principal subjectPrincipal = subject.getPrincipals().iterator().next(); GSSName gssUserName = gssManager.createName(subjectPrincipal.getName(), GSSName.NT_USER_NAME); GSSCredential clientCredential = gssManager.createCredential(gssUserName, GSSCredential.DEFAULT_LIFETIME, KERBEROS_OID, GSSCredential.INITIATE_ONLY); GSSName gssServiceName = gssManager.createName(servicePrincipal, null); GSSContext context = null; context = gssManager.createContext(gssServiceName, SPNEGO_OID, clientCredential, GSSContext.INDEFINITE_LIFETIME); context.requestMutualAuth(true); context.requestConf(true); context.requestInteg(true); context.requestCredDeleg(false); return context; } catch (GSSException e) { throw Throwables.propagate(e); } }); }
Source:
<code>protected AbstractFixedIntervalTask( String id, <START> TaskResource taskResource, <END> String dataSource, Interval interval ) { this(id, id, taskResource, dataSource, interval); }</code><technical_language>is a constr, takes (id,groupId,resource, dataSource,interval) in indexTask, instead of adding a new</technical_language>

Target:
protected AbstractFixedIntervalTask( String id, TaskResource taskResource, String dataSource, Interval interval ) { this( id, id, taskResource == null ? new TaskResource(id, 1) : taskResource, dataSource, interval ); }
Source:
<code>private boolean detachUsers() { if (getVm().getVmPoolId() == null) { return false; } List<DbUser> users = getDbUserDao().getAllForVm(getVmId()); if (users == null || users.isEmpty()) { if (!templateVersionChanged) { runInternalActionWithTasksContext(VdcActionType.RestoreStatelessVm, new VmOperationParameterBase(getVmId()), getLock()); } return true; } <START> if (VmPoolType.Automatic.equals(getVmPoolType())) { <END> for (DbUser dbUser : users) { runInternalActionWithTasksContext(VdcActionType.DetachUserFromVmFromPool, new DetachUserFromVmFromPoolParameters(getVm().getVmPoolId(), dbUser.getId(), getVmId(), !templateVersionChanged), getLock()); } return true; } return false; }</code><technical_language>getVmPoolType() == VmPoolType.Automatic ? is more similar ("if pool-type is automatic..") this version</technical_language>

Target:
private boolean detachUsers() { if (getVm().getVmPoolId() == null) { return false; } List<DbUser> users = getDbUserDao().getAllForVm(getVmId()); if (users == null || users.isEmpty()) { if (!templateVersionChanged) { runInternalActionWithTasksContext(VdcActionType.RestoreStatelessVm, new VmOperationParameterBase(getVmId()), getLock()); } return true; } if (getVmPoolType() == VmPoolType.Automatic) { for (DbUser dbUser : users) { runInternalActionWithTasksContext(VdcActionType.DetachUserFromVmFromPool, new DetachUserFromVmFromPoolParameters(getVm().getVmPoolId(), dbUser.getId(), getVmId(), !templateVersionChanged), getLock()); } return true; } return false; }
Source:
<code>public void are_columns_created() { Job job1 = createJobAndBuild(); String jobDslScript = "listView('"+ LIST_VIEW_NAME +"') {\n" + " columns {\n" + " status()\n" + " weather()\n" + " name()\n" + " lastSuccess()\n" + " lastFailure()\n" + " lastDuration()\n" + " buildButton()\n" + " }\n" + " jobs{\n" + " name('"+job1.name+"')\n" + " }\n" + "}"; openNewlyCreatedListView(jobDslScript, LIST_VIEW_NAME); <START> Assert.assertThat(driver, hasElement(By.xpath(" END> Assert.assertThat(driver, hasElement(By.xpath(" Assert.assertThat(driver, hasElement(By.xpath(" Assert.assertThat(driver, hasElement(By.xpath(" Assert.assertThat(driver, hasElement(By.xpath(" Assert.assertThat(driver, hasElement(By.xpath(" Assert.assertThat(driver, hasElement(By.xpath(" }</code><technical_language>XPATH part of view. (Or is work existing getColumn method?) better: assertThat(view, hasColumnHeader("Name"))</technical_language>

Target:
public void are_columns_created() { Job job1 = createJobAndBuild(); String jobDslScript = "listView('"+ LIST_VIEW_NAME +"') {\n" + " columns {\n" + " status()\n" + " weather()\n" + " name()\n" + " lastSuccess()\n" + " lastFailure()\n" + " lastDuration()\n" + " buildButton()\n" + " }\n" + " jobs{\n" + " name('"+job1.name+"')\n" + " }\n" + "}"; View view = openNewlyCreatedListView(jobDslScript, LIST_VIEW_NAME); assertThat(view, containsColumnHeaderTooltip("Status of the last build")); assertThat(view, containsColumnHeaderTooltip("Weather report showing aggregated status of recent builds")); assertThat(view, containsColumnHeader("Name")); assertThat(view, containsColumnHeader("Last Success")); assertThat(view, containsColumnHeader("Last Failure")); assertThat(view, containsColumnHeader("Last Duration")); assertThat(view, containsImage("clock.png")); }
Source:
<code><START> public List<Hardware> listHardwareProfiles() { <END> float disk = 20; List<Float> diskOptions = new ArrayList<Float>(); while (disk <= 2000) { diskOptions.add(disk); disk += 10; } List<Hardware> hardwares = Lists.newArrayList(); for (int core = 1; core <= 16; core++) { for (int ram : new int[]{1024, 2 * 1024, 4 * 1024, 8 * 1024, 10 * 1024, 16 * 1024, 24 * 1024, 28 * 1024, 32 * 1024, 64 * 1024, 128 * 1024}) { for (float size : diskOptions) { String id = String.format("cpu=%d,ram=%s,disk=%f", core, ram, size); hardwares.add(new HardwareBuilder() .ids(id) .ram(ram) .hypervisor("kvm") .name(id) .processor(new Processor(core, 1d)) .volume(new VolumeImpl(size, true, true)) .build()); } } } return hardwares; }</code><technical_language>is a hardcoded list instead of calling API</technical_language>

Target:
public List<HardwareFlavour> listHardwareProfiles() { return api.serverApi().listHardwareFlavours(); }
Source:
<code>static String sha256(Path path) { try (InputStream in = Files.newInputStream(path)) { MessageDigest digest = MessageDigest.getInstance("SHA-256"); byte[] buffer = new byte[BUFFER_SIZE]; int read = 0; do { read = in.read(buffer); <START> digest.update(buffer); <END> } while (read > 0); return Util.toHexString(digest.digest()); } catch (NoSuchFileException e) { return null; } catch (Exception e) { throw new RuntimeException(e); } }</code><technical_language>suggestion digest.update(buffer, 0, read);</technical_language>

Target:
static String sha256(Path path) { try (ByteChannel channel = Files.newByteChannel(path, StandardOpenOption.READ)) { MessageDigest digest = MessageDigest.getInstance("SHA-256"); if (channel instanceof FileChannel) { FileChannel fileChannel = (FileChannel) channel; MappedByteBuffer byteBuffer = fileChannel.map(FileChannel.MapMode.READ_ONLY, 0, fileChannel.size()); digest.update(byteBuffer); } else { ByteBuffer bb = ByteBuffer.allocate(BUFFER_SIZE); while (channel.read(bb) != -1) { bb.flip(); digest.update(bb); bb.flip(); } } return Util.toHexString(digest.digest()); } catch (NoSuchFileException e) { return null; } catch (Exception e) { throw new RuntimeException(e); } }
Source:
<code>private static boolean isValidTypeRefExpression(GoType goType) { if (goType instanceof GoParType) { <START> goType = ((GoParType)goType).getType(); <END> } if (goType instanceof GoPointerType) { goType = ((GoPointerType)goType).getType(); if (goType == null) return false; } GoTypeReferenceExpression refExpr = goType.getTypeReferenceExpression(); if (refExpr == null) return isValidType(goType); GoType baseType = GoPsiImplUtil.findBaseTypeFromRef(refExpr); if (!(baseType instanceof GoSpecType)) return false; goType = ((GoSpecType)baseType).getType(); return isValidType(goType); }</code><technical_language>if is a parType parType</technical_language>

Target:
private static boolean isValidTypeRefExpression(GoType goType) { if (goType instanceof GoParType) { goType = ((GoParType)goType).getType(); } if (goType instanceof GoPointerType) { goType = ((GoPointerType)goType).getType(); if (goType == null) return false; } return isValidType(goType.getUnderlyingType()); }
Source:
<code>public String getAppKey() { <START> return thingIfApi.getAppKey(); <END> }</code><technical_language>Adding this a field is good manner</technical_language>

Target:
public String getAppKey() { return this.thingIfApi.getAppKey(); }
Source:
<code>public void canAcquireLockOnMultipleCellsOnSameRow(ConflictHandler conflictHandler) { Assume.assumeTrue(conflictHandler.lockCellsForConflicts()); PreCommitCondition canAcquireLockOnDifferentCell = (ignored) -> { LockResponse response = acquireCellLock("row1", "col2"); assertTrue(response.wasSuccessful()); }; Transaction transaction = startTransaction(canAcquireLockOnDifferentCell, conflictHandler); put(transaction, "row1", "col1", "100"); <START> transaction.commit(); <END> }</code><technical_language>extract 3 statements a method takes a condition conflict-handler</technical_language>

Target:
public void canAcquireLockOnMultipleCellsOnSameRow(ConflictHandler conflictHandler) { Assume.assumeTrue(conflictHandler.lockCellsForConflicts()); PreCommitCondition canAcquireLockOnDifferentCell = (ignored) -> { LockResponse response = acquireCellLock(ROW, OTHER_COLUMN); assertTrue(response.wasSuccessful()); }; commitWriteWith(canAcquireLockOnDifferentCell, conflictHandler); }
Source:
<code>protected Supplier<String> internalGetAttribute(String attr) { Widget widget = getWidget(); switch(attr){ case "style": return () -> <START> swtStyles; <END> case "class": return () -> Objects.toString(getCSSClass(widget), ""); case "swt-data-class": return () -> { Object data = widget.getData(); if (data == null) { return ""; } StringBuilder sb = new StringBuilder(); for (Class<?> clazz = data.getClass(); clazz != Object.class; sb.append(' ')) { sb.append(clazz.getName()); clazz = clazz.getSuperclass(); } return sb.toString(); }; default: Object o = widget.getData(attr.toLowerCase()); if (o != null) { return () -> o.toString(); } } return null; }</code><technical_language>This is unsafe, swtStyles is protected set null, contract is return supplier null values. This rewritten check for null first</technical_language>

Target:
protected Supplier<String> internalGetAttribute(String attr) { Widget widget = getWidget(); switch(attr){ case "style": return () -> swtStyles != null ? swtStyles : ""; case "class": return () -> Objects.toString(getCSSClass(widget), ""); case "swt-data-class": return () -> { Object data = widget.getData(); if (data == null) { return ""; } StringBuilder sb = new StringBuilder(); for (Class<?> clazz = data.getClass(); clazz != Object.class; sb.append(' ')) { sb.append(clazz.getName()); clazz = clazz.getSuperclass(); } return sb.toString(); }; default: Object o = widget.getData(attr.toLowerCase()); if (o != null) { return () -> o.toString(); } } return null; }
Source:
<code>public Image deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext context) throws JsonParseException { JsonObject json = jsonElement.getAsJsonObject(); Map<String, Object> complexMetatdata = null; Map<String, String> metadata = null; JsonElement meta = json.get(METADATA); if (meta != null && meta.isJsonObject()) { metadata = Maps.newTreeMap(); complexMetatdata = Maps.newTreeMap(); for (Map.Entry<String, JsonElement> e : meta.getAsJsonObject().entrySet()) { Object value; if (e.getValue().isJsonArray()) { value = context.deserialize(e.getValue().getAsJsonArray(), ArrayList.class); <START> } else if (e.getValue().isJsonObject()) { <END> value = context.deserialize(e.getValue().getAsJsonArray(), TreeMap.class); } else if (e.getValue().isJsonPrimitive()) { value = e.getValue().getAsJsonPrimitive().getAsString(); } else { continue; } if (value instanceof String) { metadata.put(e.getKey(), (String) value); } complexMetatdata.put(e.getKey(), value); } json.remove(METADATA); } return apply(context.<ImageInternal>deserialize(json, ImageInternal.class), metadata, complexMetatdata); }</code><technical_language>ImageAdapterTest. need unit test this class itself</technical_language>

Target:
public Image deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext context) throws JsonParseException { JsonObject json = jsonElement.getAsJsonObject(); Map<String, String> metadata = null; List<BlockDeviceMapping> blockDeviceMapping = null; JsonElement meta = json.get(METADATA); if (meta != null && meta.isJsonObject()) { metadata = Maps.newTreeMap(); for (Map.Entry<String, JsonElement> e : meta.getAsJsonObject().entrySet()) { Object value; if (e.getValue().isJsonArray()) { value = context.deserialize(e.getValue().getAsJsonArray(), ArrayList.class); } else if (e.getValue().isJsonObject()) { value = context.deserialize(e.getValue().getAsJsonObject(), TreeMap.class); } else if (e.getValue().isJsonPrimitive()) { value = e.getValue().getAsJsonPrimitive().getAsString(); } else { continue; } if (value instanceof String) { metadata.put(e.getKey(), (String) value); } else if (value instanceof List && BLOCK_DEVICE_MAPPING.equals(e.getKey())) { blockDeviceMapping = context.deserialize(e.getValue(), new TypeToken<List<BlockDeviceMapping>>(){}.getType()); } } json.remove(METADATA); } return apply(context.<ImageInternal>deserialize(json, ImageInternal.class), metadata, blockDeviceMapping); }