auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void flushHashTable(boolean complete) throws HiveException { countAfterReport = 0; if (complete) { for (Map.Entry<KeyWrapper, AggregationBuffer[]> entry : hashAggregations.entrySet()) { forward(entry.getKey().getKeyArray(), entry.getValue()); } hashAggregations = null; LOG.info("Hash Table completed flushed"); return; } int oldSize = hashAggregations.size(); <START> LOG.info("Hash Tbl flush: #hash table = " + oldSize); <END> Iterator<Map.Entry<KeyWrapper, AggregationBuffer[]>> iter = hashAggregations .entrySet().iterator(); int numDel = 0; while (iter.hasNext()) { Map.Entry<KeyWrapper, AggregationBuffer[]> m = iter.next(); forward(m.getKey().getKeyArray(), m.getValue()); iter.remove(); numDel++; if (numDel * 10 >= oldSize) { LOG.info("Hash Table flushed: new size = " + hashAggregations.size()); return; } } }</code><technical_language>skipping string garbage for this, I switch format</technical_language>

Target:
private void flushHashTable(boolean complete) throws HiveException { countAfterReport = 0; if (complete) { for (Map.Entry<KeyWrapper, AggregationBuffer[]> entry : hashAggregations.entrySet()) { forward(entry.getKey().getKeyArray(), entry.getValue()); } hashAggregations = null; LOG.info("Hash Table completed flushed"); return; } int oldSize = hashAggregations.size(); LOG.info("Hash Tbl flush: #hash table = {}", oldSize); Iterator<Map.Entry<KeyWrapper, AggregationBuffer[]>> iter = hashAggregations .entrySet().iterator(); int numDel = 0; while (iter.hasNext()) { Map.Entry<KeyWrapper, AggregationBuffer[]> m = iter.next(); forward(m.getKey().getKeyArray(), m.getValue()); iter.remove(); numDel++; if (numDel * 10 >= oldSize) { LOG.info("Hash Table flushed: new size = {}", hashAggregations.size()); return; } } }
Source:
<code>public boolean isItemValidForSlot(int slot, ItemStack stack) { if (slot == SLOT_INPUT) { boolean b1 = FluidItemHelper.isContainer(stack); boolean b2 = FluidItemHelper.isEmptyContainer(stack); FluidStack filter = getFilterFluid(); boolean b3 = filter == null; boolean b4 = FluidItemHelper.containsFluid(stack, filter); <START> return b1 && (b2 || b3 || b4); <END> } return false; }</code><technical_language>This is efficient looses short circuit property of Boolean logic</technical_language>

Target:
public boolean isItemValidForSlot(int slot, ItemStack stack) { if (slot == SLOT_INPUT) { if (!FluidItemHelper.isContainer(stack)) return false; if (FluidItemHelper.isEmptyContainer(stack)) return true; FluidStack filter = getFilterFluid(); return filter == null || FluidItemHelper.containsFluid(stack, filter); } return false; }
Source:
<code>GdkColor getContextColor () { long fontHandle = fontHandle (); long context = OS.gtk_widget_get_style_context (fontHandle); GdkRGBA rgba = new GdkRGBA (); if (OS.GTK_VERSION < OS.VERSION(3, 18, 0)) { rgba = display.styleContextGetColor (context, OS.GTK_STATE_FLAG_NORMAL, rgba); } else { <START> int styleState = OS.gtk_widget_get_state_flags(handle); <END> rgba = display.styleContextGetColor (context, styleState, rgba); } return display.toGdkColor (rgba); }</code><technical_language>need styleState variable all</technical_language>

Target:
GdkColor getContextColor () { long fontHandle = fontHandle (); long context = OS.gtk_widget_get_style_context (fontHandle); int styleState = OS.gtk_widget_get_state_flags(handle); GdkRGBA rgba = new GdkRGBA (); rgba = display.styleContextGetColor (context, styleState, rgba); return display.toGdkColor (rgba); }
Source:
<code>public String getIoThreadsAndEmulatorPinningCpus(VM vm, Map<String, Object> cpuPinning, MemoizingSupplier<List<VdsNumaNode>> hostNumaNodesSupplier, int vdsCpuThreads) { if (vm.getVmType() != VmType.HighPerformance) { return null; } List<VmNumaNode> vmNumaNodes = vmNumaNodeDao.getAllVmNumaNodeByVmId(vm.getId()); Optional<VmNumaNode> pinnedVmNumaNode = vmNumaNodes.stream().filter(d -> !d.getVdsNumaNodeList().isEmpty()).findAny(); if (MapUtils.isEmpty(cpuPinning) || !pinnedVmNumaNode.isPresent() || vm.getNumOfIoThreads() == 0) { String msgReason1 = MapUtils.isEmpty(cpuPinning) ? "CPU Pinning topology is not set": ""; String msgReason2 = vm.getNumOfIoThreads() == 0 ? "IO Threads is not enabled": ""; String msgReason3 = !pinnedVmNumaNode.isPresent() ? "vm's virtual NUMA nodes are not pinned to host's NUMA nodes": ""; <START> String finalMsgReason = Arrays.asList(msgReason1, msgReason2, msgReason3).stream().filter(r -> !r.isEmpty()).collect(Collectors.joining(", ")) + "."; <END> log.warn("No IO thread(s) pinning and Emulator thread(s) pinning for High Performance VM due to wrong configuration: {}", vm.getName(), vm.getId(), finalMsgReason); return null; } return findCpusToPinIoAndEmulator(vm, cpuPinning, hostNumaNodesSupplier, vdsCpuThreads); }</code><technical_language>1. filter empty strings this simpler - replacing empty strings null values enables replace (r -> !r.isEmpty()) (Objects::nonNull) 2. please break this long line</technical_language>

Target:
public String getIoThreadsAndEmulatorPinningCpus(VM vm, Map<String, Object> cpuPinning, MemoizingSupplier<List<VdsNumaNode>> hostNumaNodesSupplier, int vdsCpuThreads) { if (vm.getVmType() != VmType.HighPerformance) { return null; } List<VmNumaNode> vmNumaNodes = vmNumaNodeDao.getAllVmNumaNodeByVmId(vm.getId()); Optional<VmNumaNode> pinnedVmNumaNode = vmNumaNodes.stream().filter(d -> !d.getVdsNumaNodeList().isEmpty()).findAny(); if (MapUtils.isEmpty(cpuPinning) || !pinnedVmNumaNode.isPresent() || vm.getNumOfIoThreads() == 0) { String msgReason1 = MapUtils.isEmpty(cpuPinning) ? "CPU Pinning topology is not set": null; String msgReason2 = vm.getNumOfIoThreads() == 0 ? "IO Threads is not enabled": null; String msgReason3 = !pinnedVmNumaNode.isPresent() ? "vm's virtual NUMA nodes are not pinned to host's NUMA nodes": null; String finalMsgReason = Arrays.asList(msgReason1, msgReason2, msgReason3).stream() .filter(Objects::nonNull).collect(Collectors.joining(", ")) + "."; log.warn("No IO thread(s) pinning and Emulator thread(s) pinning for High Performance VM due to wrong configuration: {}", vm.getName(), vm.getId(), finalMsgReason); return null; } return findCpusToPinIoAndEmulator(vm, cpuPinning, hostNumaNodesSupplier, vdsCpuThreads); }
Source:
<code>public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { if (expand) { monitor.beginTask("Tree item expansion", 1); TransactionalEditingDomain domain = session.getTransactionalEditingDomain(); CommandStack commandStack = domain.getCommandStack(); CompoundCommand expandDTreeItemCmd = new CompoundCommand("Expand " + dTreeItem.getName() + " tree item"); GlobalContext globalContext = new GlobalContext(session.getModelAccessor(), session.getInterpreter(), session.getSemanticResources()); expandDTreeItemCmd.append(new DTreeItemExpansionChangeCommand(globalContext, domain, dTreeItem, monitor, true)); if (!Platform.getPreferencesService().getBoolean(SiriusPlugin.ID, SiriusPreferencesKeys.PREF_AUTO_REFRESH.name(), false, null)) { SiriusCommand result = new SiriusCommand(domain); result.getTasks().add(new RefreshTreeElementTask(dTreeItem)); expandDTreeItemCmd.append(result); } commandStack.execute(expandDTreeItemCmd); } else { TransactionalEditingDomain domain = session.getTransactionalEditingDomain(); CommandStack commandStack = domain.getCommandStack(); GlobalContext globalContext = new GlobalContext(session.getModelAccessor(), session.getInterpreter(), session.getSemanticResources()); Command collapseDTreeItemCmd = new DTreeItemExpansionChangeCommand(globalContext, domain, dTreeItem, monitor, false); commandStack.execute(collapseDTreeItemCmd); <START> } <END> } finally { monitor.done(); } }</code><technical_language>is common code if else block, factorize it</technical_language>

Target:
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { TransactionalEditingDomain domain = session.getTransactionalEditingDomain(); CommandStack commandStack = domain.getCommandStack(); GlobalContext globalContext = new GlobalContext(session.getModelAccessor(), session.getInterpreter(), session.getSemanticResources()); if (expand) { monitor.beginTask("Tree item expandion", 1); CompoundCommand expandDTreeItemCmd = new CompoundCommand("Expand " + dTreeItem.getName() + " tree item"); expandDTreeItemCmd.append(new DTreeItemExpansionChangeCommand(globalContext, domain, dTreeItem, monitor, true)); if (!Platform.getPreferencesService().getBoolean(SiriusPlugin.ID, SiriusPreferencesKeys.PREF_AUTO_REFRESH.name(), false, null)) { SiriusCommand result = new SiriusCommand(domain); result.getTasks().add(new RefreshTreeElementTask(dTreeItem)); expandDTreeItemCmd.append(result); } commandStack.execute(expandDTreeItemCmd); } else { monitor.beginTask("Tree item collabsing", 1); Command collapseDTreeItemCmd = new DTreeItemExpansionChangeCommand(globalContext, domain, dTreeItem, monitor, false); commandStack.execute(collapseDTreeItemCmd); } } finally { monitor.done(); } }
Source:
<code>public void addAllKException(Collection<KException> kex) { <START> if (this.options.warnings == GlobalOptions.Warnings.NONE) <END> return; if (this.options.warnings == GlobalOptions.Warnings.ALL) { exceptions.addAll(kex); } else if (this.options.warnings == GlobalOptions.Warnings.NORMAL) { for (KException e : kex) { if (e.getType() != ExceptionType.HIDDENWARNING) exceptions.add(e); } } else throw new AssertionError("Unexpected warning type!"); }</code><technical_language>a registerInternal works. need kind of if/else clause, do a filter method method calls</technical_language>

Target:
public void addAllKException(Collection<KException> kex) { for (KException e : kex) registerInternal(e); }
Source:
<code>public Response get(@PathParam("id") UUIDParam id, @QueryParam("depth") @DefaultValue("1") int depth, @QueryParam("types") List<String> relationNames) { Optional<SearchResult> searchResult = searchStore.getSearchResult(id.get()); SXSSFWorkbook workbook = new SXSSFWorkbook(); if (searchResult.isPresent()) { final SearchResult result = searchResult.get(); workbook = excelExportService .searchResultToExcel(result.getSearchResult(), result.getSearchDescription().getType(), depth, relationNames); } else { <START> workbook.createSheet("result").createRow(0).createCell(0).setCellValue("Search with id " + id + " not found."); <END> } return Response.ok((StreamingOutput) workbook::write) .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"result.xlsx\"") .build(); }</code><technical_language>Return a 404 NOT_FOUND search result found. This is Timbuctoo v3 works</technical_language>

Target:
public Response get(@PathParam("id") UUIDParam id, @QueryParam("depth") @DefaultValue("1") int depth, @QueryParam("types") List<String> relationNames) { Optional<SearchResult> searchResult = searchStore.getSearchResult(id.get()); if (searchResult.isPresent()) { final SearchResult result = searchResult.get(); SXSSFWorkbook workbook = excelExportService .searchResultToExcel(result.getSearchResult(), result.getSearchDescription().getType(), depth, relationNames); return Response.ok((StreamingOutput) workbook::write) .header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=\"result.xlsx\"") .build(); } return Response .status(Response.Status.NOT_FOUND) .build(); }
Source:
<code>public ActionResponse execute(StatsTrendRequest parameter) throws QueryStoreException { if (null == parameter.getFilters()) { parameter.setFilters(Lists.<Filter>newArrayList(new AnyFilter(parameter.getTable()))); } <START> String field = parameter.getField(); <END> if (null == field || field.isEmpty()) { throw new QueryStoreException(QueryStoreException.ErrorCode.INVALID_REQUEST, "Invalid field name"); } try { AbstractAggregationBuilder aggregation = buildAggregation(parameter); SearchResponse response = getConnection().getClient().prepareSearch( ElasticsearchUtils.getIndices(parameter.getTable(), parameter)) .setTypes(ElasticsearchUtils.TYPE_NAME) .setQuery(new ElasticSearchQueryGenerator(parameter.getCombiner()).genFilter(parameter.getFilters())) .setSize(0) .setSearchType(SearchType.COUNT) .addAggregation(aggregation) .execute() .actionGet(); Aggregations aggregations = response.getAggregations(); if (aggregations != null) { return buildResponse(parameter, aggregations); } return null; } catch (Exception e) { logger.error("Error running stats query: ", e); throw new QueryStoreException(QueryStoreException.ErrorCode.QUERY_EXECUTION_ERROR, "Error running stats query.", e); } }</code><technical_language>is this check removed</technical_language>

Target:
public ActionResponse execute(StatsTrendRequest parameter) throws QueryStoreException { parameter.setTable(ElasticsearchUtils.getValidTableName(getParameter().getTable())); if (parameter.getTable() == null) { throw new QueryStoreException(QueryStoreException.ErrorCode.INVALID_REQUEST, "Invalid table name"); } if (null == parameter.getFilters()) { parameter.setFilters(Lists.<Filter>newArrayList(new AnyFilter(parameter.getTable()))); } String field = parameter.getField(); if (null == field || field.isEmpty()) { throw new QueryStoreException(QueryStoreException.ErrorCode.INVALID_REQUEST, "Invalid field name"); } try { AbstractAggregationBuilder aggregation = buildAggregation(parameter); SearchResponse response = getConnection().getClient().prepareSearch( ElasticsearchUtils.getIndices(parameter.getTable(), parameter)) .setTypes(ElasticsearchUtils.DOCUMENT_TYPE_NAME) .setQuery(new ElasticSearchQueryGenerator(parameter.getCombiner()).genFilter(parameter.getFilters())) .setSize(0) .setSearchType(SearchType.COUNT) .addAggregation(aggregation) .execute() .actionGet(); Aggregations aggregations = response.getAggregations(); if (aggregations != null) { return buildResponse(parameter, aggregations); } return null; } catch (Exception e) { logger.error("Error running stats query: ", e); throw new QueryStoreException(QueryStoreException.ErrorCode.QUERY_EXECUTION_ERROR, "Error running stats query.", e); } }
Source:
<code>public void initialize(final Context context) { super.initialize(context); String outNodeId = element.getTargetNode() != null ? element.getTargetNode().getUUID() : null; if (null != outNodeId) { ArrayParser outgoingParser = new ArrayParser("outgoing"); outgoingParser.addParser(new ObjectParser("").addParser(new StringFieldParser("resourceId", outNodeId))); super.addParser(outgoingParser); } ViewConnector viewConnector = (ViewConnector) element.getContent(); ObjectParser docker1ObjParser; if (viewConnector.hasValidSourceMagnetCoords()) { docker1ObjParser = new ObjectParser("") .addParser(new IntegerFieldParser("x", viewConnector.getSourceMagnetX().intValue())) .addParser(new IntegerFieldParser("y", viewConnector.getSourceMagnetY().intValue())); } else { docker1ObjParser = new ObjectParser("") .addParser(new IntegerFieldParser("x", -1)) .addParser(new IntegerFieldParser("y", -1)); } ObjectParser docker2ObjParser; if (viewConnector.hasValidTargetMagnetCoords()) { docker2ObjParser = new ObjectParser("") .addParser(new IntegerFieldParser("x", viewConnector.getTargetMagnetX().intValue())) .addParser(new IntegerFieldParser("y", viewConnector.getTargetMagnetY().intValue())); } else { docker2ObjParser = new ObjectParser("") .addParser(new IntegerFieldParser("x", -1)) .addParser(new IntegerFieldParser("y", -1)); <START> } <END> ArrayParser dockersParser = new ArrayParser("dockers") .addParser(docker1ObjParser) .addParser(docker2ObjParser); super.addParser(dockersParser); }</code><technical_language>java new ObjectParser("") .addParser(new IntegerFieldParser("x", -1)); .addParser(new IntegerFieldParser("y", -1)); moved separate method avoid duplication logic replaced line ternary operator: java docker2ObjParse = createObjectParser(viewConnector.hasValidSourceMagnetCoords ? viewConnector.getTargetMagnetX().intValue() : -1);</technical_language>

Target:
public void initialize(final Context context) { super.initialize(context); String outNodeId = element.getTargetNode() != null ? element.getTargetNode().getUUID() : null; if (null != outNodeId) { ArrayParser outgoingParser = new ArrayParser("outgoing"); outgoingParser.addParser(new ObjectParser("").addParser(new StringFieldParser("resourceId", outNodeId))); super.addParser(outgoingParser); } ViewConnector viewConnector = (ViewConnector) element.getContent(); ObjectParser docker1ObjParser = createDockerObjectParser(viewConnector.getSourceMagnet()); ObjectParser docker2ObjParser = createDockerObjectParser(viewConnector.getTargetMagnet()); ArrayParser dockersParser = new ArrayParser("dockers") .addParser(docker1ObjParser) .addParser(docker2ObjParser); super.addParser(dockersParser); }
Source:
<code>public void handle(MotechEvent event) { <START> if (!getIsHandled()) { <END> setIsHandled(true); LOGGER.info("Handling the motech event with subject: {}", event.getSubject()); Map<String, Object> eventParams = event.getParameters(); eventParams.putAll(event.getMetadata()); TasksEventParser parser = null; if (eventParams != null) { parser = taskService.findCustomParser((String) eventParams.get(TasksEventParser.CUSTOM_PARSER_EVENT_KEY)); } String triggerSubject = parser == null ? event.getSubject() : parser.parseEventSubject(event.getSubject(), eventParams); Map<String, Object> parameters = parser == null ? eventParams : parser.parseEventParameters(event.getSubject(), eventParams); List<Task> tasks = taskService.findActiveTasksForTriggerSubject(triggerSubject); for (Task task : tasks) { handleTask(task, parameters, false); } setIsHandled(false); } }</code><technical_language>this flag dependent task</technical_language>

Target:
public void handle(MotechEvent event) { LOGGER.info("Handling the motech event with subject: {}", event.getSubject()); Map<String, Object> eventParams = event.getParameters(); eventParams.putAll(event.getMetadata()); TasksEventParser parser = null; if (eventParams != null) { parser = taskService.findCustomParser((String) eventParams.get(TasksEventParser.CUSTOM_PARSER_EVENT_KEY)); } String triggerSubject = parser == null ? event.getSubject() : parser.parseEventSubject(event.getSubject(), eventParams); Map<String, Object> parameters = parser == null ? eventParams : parser.parseEventParameters(event.getSubject(), eventParams); List<Task> tasks = taskService.findActiveTasksForTriggerSubject(triggerSubject); for (Task task : tasks) { checkAndHandleTask(task, parameters, false); } }
Source:
<code>public <T> T newProxy(String name, Class<T> type) { lock.lock(); try { connect(); return JMX.newMBeanProxy(mbeanServerConn, new ObjectName(name), type); } catch (Exception e) { <START> throw new RuntimeException(e); <END> } finally { lock.unlock(); } }</code><technical_language>create a custom runtime exception more easily catch errors related JMX Connections</technical_language>

Target:
private <T> T newProxy(String name, Class<T> type) { lock.lock(); try { connect(); return JMX.newMBeanProxy(mbeanServerConn, new ObjectName(name), type); } catch (Exception e) { throw new JmxRuntimeException("Failed to create proxy for " + name, e); } finally { lock.unlock(); } }
Source:
<code>public BalanWanderingKnight(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}{W}"); this.addSuperType(SuperType.LEGENDARY); this.subtype.add("Cat"); <START> this.subtype.add("Knight"); <END> this.power = new MageInt(3); this.toughness = new MageInt(3); this.addAbility(FirstStrikeAbility.getInstance()); ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new GainAbilitySourceEffect(DoubleStrikeAbility.getInstance()), EquippedMultipleSourceCondition.instance, rule); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BalanWanderingKnightEffect(), new ManaCostsImpl("{1}{W}"))); }</code><technical_language>Please new method of adding more subtypes a card. ie, this.subtype.add(SubType.Cat, SubType.Knight); String methods deprecated</technical_language>

Target:
public BalanWanderingKnight(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}{W}"); this.addSuperType(SuperType.LEGENDARY); this.subtype.add(SubType.CAT, SubType.KNIGHT); this.power = new MageInt(3); this.toughness = new MageInt(3); this.addAbility(FirstStrikeAbility.getInstance()); ConditionalContinuousEffect effect = new ConditionalContinuousEffect(new GainAbilitySourceEffect(DoubleStrikeAbility.getInstance()), EquippedMultipleSourceCondition.instance, rule); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BalanWanderingKnightEffect(), new ManaCostsImpl("{1}{W}"))); }
Source:
<code>public Event deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { if (!json.isJsonObject()) { throw new JsonParseException("Not an object"); } JsonElement typeJson = json.getAsJsonObject().get("type"); if (typeJson == null || !typeJson.isJsonPrimitive() || !typeJson.getAsJsonPrimitive().isString()) { throw new JsonParseException("Type is not a string: " + typeJson); } String type = typeJson.getAsJsonPrimitive().getAsString(); <START> Class cls <END> = EventTypes.getClass(type); if (cls == null) { throw new JsonParseException("unknown event type: " + type); } return context.deserialize(json, cls); }</code><technical_language>Class<?></technical_language>

Target:
public Event deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { if (!json.isJsonObject()) { throw new JsonParseException("Not an object"); } JsonElement typeJson = json.getAsJsonObject().get("type"); if (typeJson == null || !typeJson.isJsonPrimitive() || !typeJson.getAsJsonPrimitive().isString()) { throw new JsonParseException("Type is not a string: " + typeJson); } String type = typeJson.getAsJsonPrimitive().getAsString(); Class<?> cls = EventTypes.getClass(type); if (cls == null) { throw new JsonParseException("unknown event type: " + type); } return context.deserialize(json, cls); }
Source:
<code>public void createNullName() { thrown.expect(NullPointerException.class); new HtmlSubsetLanguage(null, null, 6, ImmutableSet.of(BlockType.PARAGRAPH), ImmutableSet.of(SpanType.BOLD), <START> ImmutableMap.of(SpanType.ITALIC, "italic"), Collections.<SpanHtmlElementStrategy> <END> emptyList()); }</code><technical_language>(here below) is used, consider passing ImmutableMap.of() instead</technical_language>

Target:
public void createNullName() { thrown.expect(NullPointerException.class); new HtmlSubsetLanguage(null, null, 6, ImmutableSet.of(BlockType.PARAGRAPH), ImmutableSet.of(SpanType.BOLD), ImmutableMap.<SpanType, String> of(), Collections.<SpanHtmlElementStrategy> emptyList()); }
Source:
<code>public RepoObjectMetadata getObjectVersion(AssetIdentity assetIdentity, String repr, int revisionNumber) { String parentArticleDoi = getParentDoi(assetIdentity.getIdentifier()); if (parentArticleDoi == null) throw entityNotFound("Unrecognized asset DOI"); String parentArticleUuid = findRevisionUuid(parentArticleDoi, revisionNumber); if (parentArticleUuid == null) throw entityNotFound("Revision not found"); RepoObjectMetadata repoObjectMetadata = null; try { RepoCollectionMetadata articleCollection = contentRepoService.getCollection(RepoVersion.create(parentArticleDoi, parentArticleUuid)); Map<String, ?> articleMetadata = (Map<String, ?>) articleCollection.getJsonUserMetadata().get(); Collection<Map<String, ?>> assets = (Collection<Map<String, ?>>) articleMetadata.get("assets"); RepoVersion assetVersion = findAssetVersion(repr, assets, assetIdentity); repoObjectMetadata = contentRepoService.getRepoObjectMetadata(assetVersion); } catch(NotFoundException nfe) { <START> entityNotFound(nfe.getMessage()); <END> } return repoObjectMetadata; }</code><technical_language>throw is missing</technical_language>

Target:
public RepoObjectMetadata getObjectVersion(AssetIdentity assetIdentity, String repr, int revisionNumber) { String parentArticleDoi = getParentDoi(assetIdentity.getIdentifier()); if (parentArticleDoi == null) { throw reportNotFound(assetIdentity, " parent article DOI"); } String parentArticleUuid = findRevisionUuid(parentArticleDoi, revisionNumber); if (parentArticleUuid == null) { throw reportNotFound(assetIdentity, "parent article UUID"); } try { RepoCollectionMetadata articleCollection = contentRepoService.getCollection(RepoVersion.create(parentArticleDoi, parentArticleUuid)); Map<String, ?> articleMetadata = (Map<String, ?>) articleCollection.getJsonUserMetadata().get(); Collection<Map<String, ?>> assets = (Collection<Map<String, ?>>) articleMetadata.get("assets"); RepoVersion assetVersion = findAssetVersion(repr, assets, assetIdentity); return contentRepoService.getRepoObjectMetadata(assetVersion); } catch(NotFoundException nfe) { throw reportNotFound(assetIdentity, "object metadata", nfe); } }
Source:
<code>public void sendVerificationmail(User user, String url) { String message = "Please click on the following link to complete your registration: <a href=\"" + <START> url + "\">" + url + "</a><br><br>If the link does not work, please copy the link and" + <END> " paste it in your browser."; sendMail(user.getEmail(), user.getUsername(), "Confirm your registration", message); }</code><technical_language>Please <br /> instead of <br></technical_language>

Target:
public void sendVerificationmail(User user, String url) { String message = "Please click on the following link to complete your registration: <a href=\"" + url + "\">" + url + "</a><br /><br />If the link does not work, please copy the link and" + " paste it into your browser."; sendMail(user.getEmail(), user.getUsername(), "Confirm your registration", message); }
Source:
<code>public int find(Text name, MgcpEndpoint[] endpoints) { if (name.equals(ALL)) { k = 0; for(int i=0;i<completeList.size();i++) { endpoints[k++] = completeList.get(i).endpoint; } return completeList.size(); } if (name.equals(ANY)) { MgcpEndpoint endp=queue.poll(); while(endp==null && installer!=null && installer.canExpand()) { if(logger.isDebugEnabled()) logger.debug("No free endpoints,expanding"); synchronized(installer) { installer.newEndpoint(); } endp=queue.poll(); } if(endp!=null) { endp.lock(); endpoints[0] = endp; if(logger.isDebugEnabled()) { logger.debug("Endpoint " + endp.getName() + " taken"); <START> logger.debug("Free " + endp.getEndpoint().toString() + " endpoints " + queue.size()); <END> } return 1; } return 0; } int value=name.toInteger(); if(value>0 && value<=completeList.size()) { endpoints[0] = completeList.get(value-1).endpoint; return 1; } return 0; }</code><technical_language>a single log line "Endpoint xxx (free=yyy)"</technical_language>

Target:
public int find(Text name, MgcpEndpoint[] endpoints) { if (name.equals(ALL)) { k = 0; for(int i=0;i<completeList.size();i++) { endpoints[k++] = completeList.get(i).endpoint; } return completeList.size(); } if (name.equals(ANY)) { MgcpEndpoint endp=queue.poll(); while(endp==null && installer!=null && installer.canExpand()) { if(logger.isDebugEnabled()) logger.debug("No free endpoints,expanding"); synchronized(installer) { installer.newEndpoint(); } endp=queue.poll(); } if(endp!=null) { endp.lock(); endpoints[0] = endp; if(logger.isDebugEnabled()) { logger.debug("Endpoint " + endp.getName() + " taken (free="+queue.size()+")"); } return 1; } return 0; } int value=name.toInteger(); if(value>0 && value<=completeList.size()) { endpoints[0] = completeList.get(value-1).endpoint; return 1; } return 0; }
Source:
<code>public void testValidationFail() throws IOException { <START> final String json = TestingResources.get("org/kiji/mapreduce/mapping/foo-test-invalid.json"); <END> TableImportDescriptorDesc mappingDesc = (TableImportDescriptorDesc) FromJson.fromJsonString(json, TableImportDescriptorDesc.SCHEMA$); KijiTableImportDescriptor mapping = new KijiTableImportDescriptor(mappingDesc); final KijiTableLayout fooLayout = new KijiTableLayout(KijiTableLayouts.getLayout(KijiTableLayouts.FOO_TEST), null); mapping.validateDestination(fooLayout); }</code><technical_language>nit: a constant for foo-test-invalid.json</technical_language>

Target:
public void testValidationFail() throws IOException { final String json = TestingResources.get(FOO_INVALID_DESCRIPTOR); TableImportDescriptorDesc mappingDesc = (TableImportDescriptorDesc) FromJson.fromJsonString(json, TableImportDescriptorDesc.SCHEMA$); KijiTableImportDescriptor mapping = new KijiTableImportDescriptor(mappingDesc); final KijiTableLayout fooLayout = new KijiTableLayout(KijiMRTestLayouts.getTestLayout(), null); try { mapping.validateDestination(fooLayout); fail("Should've gotten an InvalidTableImportDescription by here."); } catch (InvalidTableImportDescriptorException ie) { assertEquals("Table 'test' does not contain column 'info:first_name_nonexistant'.", ie.getMessage()); } }
Source:
<code>public static Envelope deserializeEnvelope(Slice shape) { if (shape == null) { return null; } BasicSliceInput input = shape.getInput(); input.readInt(); Envelope overallEnvelope = null; while (input.available() > 0) { int length = input.readInt(); ByteBuffer buffer = input.readSlice(length).toByteBuffer().slice().order(LITTLE_ENDIAN); int type = buffer.getInt(); Envelope envelope; if (type == 1) { double x = buffer.getDouble(); double y = buffer.getDouble(); envelope = new Envelope(x, y, x, y); } else { double xmin = buffer.getDouble(); double ymin = buffer.getDouble(); <START> double xmax = buffer.getDouble(); <END> double ymax = buffer.getDouble(); envelope = new Envelope(xmin, ymin, xmax, ymax); } if (overallEnvelope == null) { overallEnvelope = envelope; } else { overallEnvelope.merge(envelope); } } return overallEnvelope; }</code><technical_language>Slice shape contains raw data for envelope. calling repeatedly Envelope#merge(com.esri.core.geometry.Envelope) quadratic complexity</technical_language>

Target:
public static Envelope deserializeEnvelope(Slice shape) { if (shape == null) { return null; } BasicSliceInput input = shape.getInput(); input.readInt(); Envelope overallEnvelope = null; while (input.available() > 0) { int length = input.readInt(); ByteBuffer buffer = input.readSlice(length).toByteBuffer().order(LITTLE_ENDIAN); int type = buffer.getInt(); Envelope envelope = null; if (type == POINT_TYPE) { double x = buffer.getDouble(); double y = buffer.getDouble(); if (!isEsriNaN(x)) { Verify.verify(!isEsriNaN(y)); envelope = new Envelope(x, y, x, y); } } else { double xMin = buffer.getDouble(); double yMin = buffer.getDouble(); double xMax = buffer.getDouble(); double yMax = buffer.getDouble(); if (!isEsriNaN(xMin)) { Verify.verify(!isEsriNaN(xMax)); Verify.verify(!isEsriNaN(yMin)); Verify.verify(!isEsriNaN(yMax)); envelope = new Envelope(xMin, yMin, xMax, yMax); } } if (envelope != null) { if (overallEnvelope == null) { overallEnvelope = envelope; } else { overallEnvelope.merge(envelope); } } } return overallEnvelope; }
Source:
<code>private AboutInfo promptForFeature() throws WorkbenchException { ArrayList welcomeFeatures = new ArrayList(); URL productUrl = null; IProduct product = Platform.getProduct(); if (product != null) { productUrl = ProductProperties.getWelcomePageUrl(product); welcomeFeatures.add(new AboutInfo(product)); } AboutInfo[] features = IDEWorkbenchPlugin.getDefault() .getFeatureInfos(); for (int i = 0; i < features.length; i++) { URL url = features[i].getWelcomePageURL(); <START> if (url != null && productUrl != null && !url.toString().equals(productUrl.toString())) { <END> welcomeFeatures.add(features[i]); } } Shell shell = workbenchWindow.getShell(); if (welcomeFeatures.size() == 0) { MessageDialog.openInformation(shell, IDEWorkbenchMessages.QuickStartMessageDialog_title, IDEWorkbenchMessages.QuickStartMessageDialog_message); return null; } features = new AboutInfo[welcomeFeatures.size()]; welcomeFeatures.toArray(features); FeatureSelectionDialog d = new FeatureSelectionDialog(shell, features, product == null ? null : product.getId(), IDEWorkbenchMessages.WelcomePageSelectionDialog_title, IDEWorkbenchMessages.WelcomePageSelectionDialog_message, IIDEHelpContextIds.WELCOME_PAGE_SELECTION_DIALOG); if (d.open() != Window.OK || d.getResult().length != 1) { return null; } return (AboutInfo) d.getResult()[0]; }</code><technical_language>I separate this change others rework it, avoid url.equals() calls result is clear for me: original code add url if productUrl null, changed code not</technical_language>

Target:
private AboutInfo promptForFeature() throws WorkbenchException { ArrayList welcomeFeatures = new ArrayList(); URL productUrl = null; IProduct product = Platform.getProduct(); if (product != null) { productUrl = ProductProperties.getWelcomePageUrl(product); welcomeFeatures.add(new AboutInfo(product)); } AboutInfo[] features = IDEWorkbenchPlugin.getDefault() .getFeatureInfos(); for (int i = 0; i < features.length; i++) { URL url = features[i].getWelcomePageURL(); if (url != null && (productUrl == null || !url.toString().equals(productUrl.toString())) { welcomeFeatures.add(features[i]); } } Shell shell = workbenchWindow.getShell(); if (welcomeFeatures.size() == 0) { MessageDialog.openInformation(shell, IDEWorkbenchMessages.QuickStartMessageDialog_title, IDEWorkbenchMessages.QuickStartMessageDialog_message); return null; } features = new AboutInfo[welcomeFeatures.size()]; welcomeFeatures.toArray(features); FeatureSelectionDialog d = new FeatureSelectionDialog(shell, features, product == null ? null : product.getId(), IDEWorkbenchMessages.WelcomePageSelectionDialog_title, IDEWorkbenchMessages.WelcomePageSelectionDialog_message, IIDEHelpContextIds.WELCOME_PAGE_SELECTION_DIALOG); if (d.open() != Window.OK || d.getResult().length != 1) { return null; } return (AboutInfo) d.getResult()[0]; }
Source:
<code>protected void testAccessControl() throws Exception { dataBundle = getTypicalDataBundle(); <START> removeAndRestoreTypicalDataBundle(); <END> String[] submissionParams = new String[]{}; verifyOnlyAdminsCanAccess(submissionParams); }</code><technical_language>is this line needed in other tests touched in this PR</technical_language>

Target:
protected void testAccessControl() throws Exception { String[] submissionParams = new String[]{}; verifyOnlyAdminsCanAccess(submissionParams); }
Source:
<code>private void validateEventSize(final BatchItem item) throws EventValidationException { <START> if (item.getEvent().toString().getBytes().length > nakadiSettings.getEventMaxBytes()) <END> throw new EventValidationException("Event too large"); }</code><technical_language>getBytes() setting default locale. Please pass <LINK_0> object function. check do cases this stupid getByte() is done</technical_language>

Target:
private void validateEventSize(final BatchItem item) throws EventValidationException { if (item.getEventSize() > nakadiSettings.getEventMaxBytes()) { throw new EventValidationException("Event too large: " + item.getEventSize() + " bytes, max size is " + nakadiSettings.getEventMaxBytes() + " bytes"); } }
Source:
<code><START> public List<AddOn> getUpdatedAddOns() { <END> return getLocalVersionInfo().getUpdatedAddOns(this.getLatestVersionInfo()); }</code><technical_language>Protected instead? Or, other extensions able access/change returned AddOn(s)</technical_language>

Target:
protected List<AddOn> getUpdatedAddOns() { return getLocalVersionInfo().getUpdatedAddOns(this.getLatestVersionInfo()); }
Source:
<code><START> private static final ModelUtils getModelUtils() { <END> return Utils.getComponent(ModelUtils.class); }</code><technical_language>needs this method static</technical_language>

Target:
private final ModelUtils getModelUtils() { return Utils.getComponent(ModelUtils.class); }
Source:
<code><START> private void preRenderSetupLightGeometry() { <END> READ_ONLY_GBUFFER.setRenderBufferMask(false, false, true); glStencilFunc(GL_NOTEQUAL, 0, 0xFF); glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_COLOR); }</code><technical_language>place more simplified content of this method straight process(). of ideally glStencil|BlendFunc calls StateChanges. If do GSOC deadline add a TODO</technical_language>

Target:
private void preRenderSetupLightGeometry() { READ_ONLY_GBUFFER.bind(); READ_ONLY_GBUFFER.setRenderBufferMask(false, false, true); glStencilFunc(GL_NOTEQUAL, 0, 0xFF); glDepthMask(true); glDisable(GL_DEPTH_TEST); glEnable(GL_BLEND); glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_COLOR); glEnable(GL_CULL_FACE); glCullFace(GL_FRONT); }
Source:
<code>private void testBound(final int maxThreads, int totalTasks) { BoundedExecutor boundedExecutor = new BoundedExecutor(executorService, maxThreads); final AtomicInteger activeThreadCount = new AtomicInteger(); final CountDownLatch startLatch = new CountDownLatch(1); final CountDownLatch completeLatch = new CountDownLatch(totalTasks); final AtomicBoolean failed = new AtomicBoolean(); for (int i = 0; i < totalTasks; i++) { boundedExecutor.execute(new Runnable() { @Override public void run() { try { Uninterruptibles.awaitUninterruptibly(startLatch); int count = activeThreadCount.incrementAndGet(); if (count < 1 || count > maxThreads) { failed.set(true); } activeThreadCount.decrementAndGet(); } finally { completeLatch.countDown(); } } }); } startLatch.countDown(); <START> Uninterruptibles.awaitUninterruptibly(completeLatch); END> Assert.assertFalse(failed.get()); }</code><technical_language>Set a 1 minute timeout</technical_language>

Target:
private void testBound(final int maxThreads, int totalTasks) { BoundedExecutor boundedExecutor = new BoundedExecutor(executorService, maxThreads); final AtomicInteger activeThreadCount = new AtomicInteger(); final CountDownLatch startLatch = new CountDownLatch(1); final CountDownLatch completeLatch = new CountDownLatch(totalTasks); final AtomicBoolean failed = new AtomicBoolean(); for (int i = 0; i < totalTasks; i++) { boundedExecutor.execute(new Runnable() { @Override public void run() { try { Uninterruptibles.awaitUninterruptibly(startLatch); int count = activeThreadCount.incrementAndGet(); if (count < 1 || count > maxThreads) { failed.set(true); } activeThreadCount.decrementAndGet(); } finally { completeLatch.countDown(); } } }); } startLatch.countDown(); Uninterruptibles.awaitUninterruptibly(completeLatch, 1, TimeUnit.MINUTES); Assert.assertFalse(failed.get()); }
Source:
<code>private String calculateEtag(List<EnvironmentConfig> environmentConfigs) { final String environmentConfigSegment = environmentConfigs .stream() .map(this::etagFor) .collect(Collectors.joining(SEP_CHAR)); <START> return DigestUtils.sha256Hex(StringUtils.joinWith(SEP_CHAR, currentUsername().getUsername(), environmentConfigSegment)); <END> }</code><technical_language>@vishaldevgire @kritika-singh3 -- This ETag Computation a problem. Environments viewed super admins. view of environments change based super administrator accessing (unlike dashboard). Adding user information while computing ETag result ETags based user is accessing it. IMO, ETag computation logic for environments user agnostic. result in ETag</technical_language>

Target:
private String calculateEtag(List<EnvironmentConfig> environmentConfigs) { final String environmentConfigSegment = environmentConfigs .stream() .map(this::etagFor) .collect(Collectors.joining(SEP_CHAR)); return DigestUtils.sha256Hex(environmentConfigSegment); }
Source:
<code>public void endMeasuringLatency() { if (_endTime != 0L) { <START> throw new HelixException( <END> String.format("Needs to call startMeasuringLatency first! Metric name: %s", _metricName)); } _endTime = System.currentTimeMillis(); _lastEmittedMetricValue = _endTime - _startTime; updateValue(_lastEmittedMetricValue); }</code><technical_language>This fail business logic. Please throw Exceptions. If _endTime != 0, log error ignore this recording</technical_language>

Target:
public void endMeasuringLatency() { if (_startTime == VALUE_NOT_SET || _endTime != VALUE_NOT_SET) { LOG.error( "Needs to call startMeasuringLatency first! Ignoring and resetting the metric. Metric name: {}", _metricName); reset(); return; } _endTime = System.currentTimeMillis(); _lastEmittedMetricValue = _endTime - _startTime; updateValue(_lastEmittedMetricValue); reset(); }
Source:
<code>public static Set<TransformExpressionTree> collectExpressionsToTransform(BrokerRequest brokerRequest, AggregationFunctionContext[] functionContexts) { Set<TransformExpressionTree> expressionTrees = new LinkedHashSet<>(); for (AggregationFunctionContext functionContext : functionContexts) { AggregationFunction function = functionContext.getAggregationFunction(); <START> if (!function.getType().equals(AggregationFunctionType.COUNT)) { <END> expressionTrees.addAll(function.getInputExpressions()); } } if (brokerRequest.isSetGroupBy()) { for (String expression : brokerRequest.getGroupBy().getExpressions()) { expressionTrees.add(TransformExpressionTree.compileToExpressionTree(expression)); } } return expressionTrees; }</code><technical_language>need specialize this. CountAggregationFunction return empty list</technical_language>

Target:
public static Set<TransformExpressionTree> collectExpressionsToTransform(BrokerRequest brokerRequest, AggregationFunctionContext[] functionContexts) { Set<TransformExpressionTree> expressionTrees = new LinkedHashSet<>(); for (AggregationFunctionContext functionContext : functionContexts) { AggregationFunction function = functionContext.getAggregationFunction(); expressionTrees.addAll(function.getInputExpressions()); } if (brokerRequest.isSetGroupBy()) { for (String expression : brokerRequest.getGroupBy().getExpressions()) { expressionTrees.add(TransformExpressionTree.compileToExpressionTree(expression)); } } return expressionTrees; }
Source:
<code>Swift2ThriftGenerator(final Swift2ThriftGeneratorConfig config) throws FileNotFoundException { this.verbose = config.isVerbose(); String defaultPackage = config.getDefaultPackage(); <START> if (defaultPackage.isEmpty()) <END> this.defaultPackage = ""; else this.defaultPackage = defaultPackage + "."; OutputStream os = config.getOutputFile() != null ? new FileOutputStream(config.getOutputFile()) : System.out; this.outputStreamWriter = new OutputStreamWriter(os, Charsets.UTF_8); Map<String, String> paramIncludeMap = config.getIncludeMap(); this.thriftTypeRenderer = new ThriftTypeRenderer(ImmutableMap.<ThriftType,String>of()); for (Map.Entry<String, String> entry: paramIncludeMap.entrySet()) { Class<?> cls = load(entry.getKey()); if (cls == null) continue; Object result = convertToThrift(cls); if (result != null) this.includeMap.put(result, entry.getValue()); } }</code><technical_language>Code style is one-liner blocks {}</technical_language>

Target:
Swift2ThriftGenerator(final Swift2ThriftGeneratorConfig config) throws FileNotFoundException { this.verbose = config.isVerbose(); String defaultPackage = config.getDefaultPackage(); if (defaultPackage.isEmpty()) { this.defaultPackage = ""; } else { this.defaultPackage = defaultPackage + "."; } OutputStream os = config.getOutputFile() != null ? new FileOutputStream(config.getOutputFile()) : System.out; this.outputStreamWriter = new OutputStreamWriter(os, Charsets.UTF_8); Map<String, String> paramIncludeMap = config.getIncludeMap(); this.thriftTypeRenderer = new ThriftTypeRenderer(ImmutableMap.<ThriftType,String>of()); for (Map.Entry<String, String> entry: paramIncludeMap.entrySet()) { Class<?> cls = load(entry.getKey()); if (cls == null) { continue; } Object result = convertToThrift(cls); if (result != null) { this.includeMap.put(result, entry.getValue()); } } }
Source:
<code>public static Status parseStatusMessage(String statusMessage, Throwable error) { String message = null; if (error != null) { message = error.getMessage(); if (message == null) { message = error.getClass().getSimpleName(); return Status.UNKNOWN.withDescription(message); } <START> } <END> if (error == null && statusMessage.equalsIgnoreCase("success")) { return Status.OK; } return Status.UNKNOWN.withDescription(statusMessage); }</code><technical_language>this is easier reason if (error != null) { } else if (statusMessage.equals(...)) else Also, this "success" string from? hard connect two. I set in EventHubProducer. I suggest creating some public constant</technical_language>

Target:
public static Status parseStatusMessage(String statusMessage, Throwable error) { if (error != null) { final String message = error.getMessage(); return message != null ? Status.UNKNOWN.withDescription(message) : Status.UNKNOWN.withDescription(error.getClass().getSimpleName()); } else if (statusMessage.equalsIgnoreCase("success")) { return Status.OK; } else { return Status.UNKNOWN.withDescription(statusMessage); } }
Source:
<code>public void draw(SpriteBatch batch, float dt) { currnetAnim.update(dt, true, facing); <START> shieldAnim.update(dt, true, facing); <END> currnetAnim.draw(batch, dt, unit.getX(), unit.getY()); batch.draw(hpBar, unit.getX() + UnitHelper.HP_BAR_X, unit.getY() + UnitHelper.HP_BAR_Y, hpWidth, UnitHelper.HP_BAR_HEIGHT); if(unit.isInDefensePosition()) shieldAnim.draw(batch, dt, unit.getX(), unit.getY()); }</code><technical_language>if(unit.isInDefensePosition())</technical_language>

Target:
public void draw(SpriteBatch batch, float dt) { currnetAnim.update(dt, true, facing); currnetAnim.draw(batch, dt, unit.getX(), unit.getY()); batch.draw(hpBar, unit.getX() + UnitHelper.HP_BAR_X, unit.getY() + UnitHelper.HP_BAR_Y, hpWidth, UnitHelper.HP_BAR_HEIGHT); if(unit.isInDefensePosition()){ shieldAnim.update(dt, true, facing); shieldAnim.draw(batch, dt, unit.getX(), unit.getY()); } }
Source:
<code><START> public UseStatementTree GROUP_USE_STATEMENT() { <END> return b.<UseStatementTree>nonterminal(Kind.GROUP_USE_STATEMENT).is( f.groupUseStatement( b.token(PHPKeyword.USE), b.optional( b.firstOf( b.token(PHPKeyword.CONST), b.token(PHPKeyword.FUNCTION))), NAMESPACE_NAME(), b.token(NS_SEPARATOR), b.token(LCURLYBRACE), GROUP_USE_CLAUSE(), b.zeroOrMore(f.newTuple89(b.token(PHPPunctuator.COMMA), GROUP_USE_CLAUSE())), b.token(RCURLYBRACE), EOS())); }</code><technical_language>@vilchik-elena This matches function ns1\{function f}; not</technical_language>

Target:
public UseStatementTree GROUP_USE_STATEMENT() { return b.<UseStatementTree>nonterminal(Kind.GROUP_USE_STATEMENT).is( f.groupUseStatement( b.token(PHPKeyword.USE), b.optional(USE_TYPE()), NAMESPACE_NAME(), b.token(NS_SEPARATOR), b.token(LCURLYBRACE), GROUP_USE_CLAUSE(), b.zeroOrMore(f.newTuple89(b.token(PHPPunctuator.COMMA), GROUP_USE_CLAUSE())), b.token(RCURLYBRACE), EOS())); }
Source:
<code>protected void initUnregisteredEntity(Guid entityId, Guid storageDomainId) { if (!isUnregisteredEntityExists()) { List<OvfEntityData> ovfEntityList = unregisteredOVFDataDao.getByEntityIdAndStorageDomain(entityId, storageDomainId); if (!ovfEntityList.isEmpty()) { ovfEntityData = ovfEntityList.get(0); try { setUnregisteredEntityAndImages(ovfEntityData.getOvfData()); } catch (OvfReaderException e) { log.error("Failed to parse a given ovf configuration: {}:\n{}", e.getMessage(), ovfEntityData.getOvfData()); <START> log.debug("Exception", <END> e); } } } }</code><technical_language>Add ":" space</technical_language>

Target:
protected void initUnregisteredEntity(Guid entityId, Guid storageDomainId) { if (!isUnregisteredEntityExists()) { List<OvfEntityData> ovfEntityList = unregisteredOVFDataDao.getByEntityIdAndStorageDomain(entityId, storageDomainId); if (!ovfEntityList.isEmpty()) { ovfEntityData = ovfEntityList.get(0); try { setUnregisteredEntityAndImages(ovfEntityData.getOvfData()); } catch (OvfReaderException e) { log.error("Failed to parse a given ovf configuration: {}:\n{}", e.getMessage(), ovfEntityData.getOvfData()); log.debug("Exception: ", e); } } } }
Source:
<code>public void remove() { <START> throw new RuntimeException("Method remove() is not implemented."); <END> }</code><technical_language>nit: UnsupportedOperationException (java.lang) is more descriptive</technical_language>

Target:
public void remove() { throw new UnsupportedOperationException("Method remove() is not implemented."); }