auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private static HttpServletRequest createRequest( final String[] projects, final String[] groups) { final HttpServletRequest request = Mockito.mock(HttpServletRequest.class); <START> Mockito.when(request.getParameterValues("project")).thenReturn(projects); <END> Mockito.when(request.getParameterValues("group")).thenReturn(groups); return request; }</code><technical_language>static final values</technical_language>

Target:
private static HttpServletRequest createRequest( final String[] projects, final String[] groups) { final HttpServletRequest request = Mockito.mock(HttpServletRequest.class); Mockito.when(request.getParameterValues(PageConfig.PROJECT_PARAM_NAME)).thenReturn(projects); Mockito.when(request.getParameterValues(PageConfig.GROUP_PARAM_NAME)).thenReturn(groups); return request; }
Source:
<code>private void updatePostUploadProgressBar(ProgressBar view, PostModel post) { if (UploadService.isPostUploadingOrQueued(post)) { view.setVisibility(View.VISIBLE); <START> view.setProgress(Math.min(90, Math.round(UploadService.getMediaUploadProgressForPost(post) * 100))); <END> } else { view.setVisibility(View.GONE); } }</code><technical_language>I ask 90 means here</technical_language>

Target:
private void updatePostUploadProgressBar(ProgressBar view, PostModel post) { if (UploadService.isPostUploadingOrQueued(post)) { view.setVisibility(View.VISIBLE); int overallProgress = Math.round(UploadService.getMediaUploadProgressForPost(post) * 100); view.setProgress(Math.min(MAX_DISPLAYED_UPLOAD_PROGRESS, overallProgress)); } else { view.setVisibility(View.GONE); } }
Source:
<code>public void testPecanPie() { topLevelIngredient = new PecanPie().topLevelIngredient; <START> setUp(); <END> swappedIngredientList = Arrays.asList("dry_crust", "flaky_crust", "pie_crust", "pie_mix", "filling", "finished_filling", "PecanPie"); constituentNecessaryTraits = Arrays.asList("salt", "sugar"); constituentIngredients = new ArrayList<IngredientRecipe>(); constituentIngredientList = Arrays.asList("butter", "light_corn_syrup", "eggs", "flour", "pecans", "bourbon", "vanilla"); for (String ingredient : constituentIngredientList) { IngredientRecipe i = knowledgebase.getIngredient(ingredient); constituentIngredients.add(i); } useCount = new HashMap<String, Integer>(); useCount.put("butter", 2); useCount.put("light_corn_syrup", 1); useCount.put("eggs", 2); useCount.put("flour", 1); useCount.put("pecans", 1); useCount.put("vanilla", 1); useCount.put("bourbon", 1); useCount.put("white_sugar", 2); useCount.put("brown_sugar", 2); useCount.put("confectioners_sugar", 2); useCount.put("salt", 2); useCount.put("sea_salt", 2); testRecipe(); }</code><technical_language>setUp -> this.setUp() in instances too</technical_language>

Target:
public void testPecanPie() { topLevelIngredient = new PecanPie().topLevelIngredient; this.setUp(); swappedIngredientList = Arrays.asList("dry_crust", "flaky_crust", "pie_crust", "pie_mix", "filling", "finished_filling", "PecanPie"); constituentNecessaryTraits = Arrays.asList("salt", "sugar"); constituentIngredients = new ArrayList<IngredientRecipe>(); constituentIngredientList = Arrays.asList("butter", "light_corn_syrup", "eggs", "flour", "pecans", "bourbon", "vanilla"); for (String ingredient : constituentIngredientList) { IngredientRecipe i = knowledgebase.getIngredient(ingredient); constituentIngredients.add(i); } useCount = new HashMap<String, Integer>(); useCount.put("butter", 2); useCount.put("light_corn_syrup", 1); useCount.put("eggs", 2); useCount.put("flour", 1); useCount.put("pecans", 1); useCount.put("vanilla", 1); useCount.put("bourbon", 1); useCount.put("white_sugar", 2); useCount.put("brown_sugar", 2); useCount.put("confectioners_sugar", 2); useCount.put("salt", 2); useCount.put("sea_salt", 2); this.testRecipe(); }
Source:
<code>public void testAdapterReads(final String useFastAlgorithm) throws IOException { final File metricsTestDir = new File(TEST_DIR.getParentFile(), "metrics"); final File input = new File(metricsTestDir, "AlignedAdapterReads.sam"); final File outfile = File.createTempFile("test", ".wgs_metrics"); outfile.deleteOnExit(); final File ref = CHR_M_REFERENCE; <START> final String[] args = new String[]{ <END> "INPUT=" + input.getAbsolutePath(), "OUTPUT=" + outfile.getAbsolutePath(), "SAMPLE_SIZE=" + 10, "REFERENCE_SEQUENCE=" + ref.getAbsolutePath(), "USE_FAST_ALGORITHM=" + useFastAlgorithm }; Assert.assertEquals(runPicardCommandLine(args), 0); final MetricsFile<WgsMetrics, Comparable<?>> output = new MetricsFile<>(); try (FileReader reader = new FileReader(outfile)) { output.read(reader); } for (final WgsMetrics metrics : output.getMetrics()) { Assert.assertEquals(metrics.GENOME_TERRITORY, 16571); Assert.assertEquals(metrics.PCT_EXC_TOTAL, 1D); TestNGUtil.compareDoubleWithAccuracy(metrics.PCT_EXC_ADAPTER, 102 / (102 + 82D), 0.00001); TestNGUtil.compareDoubleWithAccuracy(metrics.PCT_EXC_MAPQ, 82 / (102 + 82D), 0.00001); Assert.assertEquals(metrics.PCT_EXC_DUPE, 0.0); Assert.assertEquals(metrics.PCT_EXC_UNPAIRED, 0.0); } }</code><technical_language>suggestion final String[] args = {</technical_language>

Target:
public void testAdapterReads(final String useFastAlgorithm) throws IOException { final File metricsTestDir = new File(TEST_DIR.getParentFile(), "metrics"); final File input = new File(metricsTestDir, "AlignedAdapterReads.sam"); final File outfile = File.createTempFile("test", ".wgs_metrics"); outfile.deleteOnExit(); final String[] args = { "INPUT=" + input.getAbsolutePath(), "OUTPUT=" + outfile.getAbsolutePath(), "SAMPLE_SIZE=" + 10, "REFERENCE_SEQUENCE=" + CHR_M_REFERENCE.getAbsolutePath(), "USE_FAST_ALGORITHM=" + useFastAlgorithm }; Assert.assertEquals(runPicardCommandLine(args), 0); final MetricsFile<WgsMetrics, Comparable<?>> output = new MetricsFile<>(); try (FileReader reader = new FileReader(outfile)) { output.read(reader); } for (final WgsMetrics metrics : output.getMetrics()) { Assert.assertEquals(metrics.GENOME_TERRITORY, 16571); Assert.assertEquals(metrics.PCT_EXC_TOTAL, 1D); TestNGUtil.compareDoubleWithAccuracy(metrics.PCT_EXC_ADAPTER, 102 / (102 + 82D), 0.00001); TestNGUtil.compareDoubleWithAccuracy(metrics.PCT_EXC_MAPQ, 82 / (102 + 82D), 0.00001); Assert.assertEquals(metrics.PCT_EXC_DUPE, 0.0); Assert.assertEquals(metrics.PCT_EXC_UNPAIRED, 0.0); } }
Source:
<code><START> private void validateContentAccessMode(Consumer consumer) throws BadRequestException { <END> if (!consumer.getOwner().isAllowedContentAccessMode(consumer.getContentAccessMode())) { throw new BadRequestException(i18n.tr( "The consumer cannot use the supplied content access mode.")); } if (consumer.getContentAccessMode() != null && !consumer.getType().isManifest()) { throw new BadRequestException(i18n.tr( "The consumer cannot be assigned a content access mode.")); } }</code><technical_language>this need in else block</technical_language>

Target:
private void validateContentAccessMode(Consumer consumer) throws BadRequestException { if (!consumer.getOwner().isAllowedContentAccessMode(consumer.getContentAccessMode())) { throw new BadRequestException(i18n.tr( "The consumer cannot use the supplied content access mode.")); } if (consumer.getContentAccessMode() != null && !consumer.isManifestDistributor()) { throw new BadRequestException(i18n.tr( "The consumer cannot be assigned a content access mode.")); } }
Source:
<code>private void encodeDistribution(DBObject dbObject, Described entity) { TranslatorUtils.fromIterable(dbObject, DISTRIBUTION_KEY, entity.getDistributions(), <START> new Function<Distribution, DBObject>() { <END> @Override public DBObject apply(Distribution distribution) { return distributionTranslator.toDBObject(new BasicDBObject(), distribution); } }); }</code><technical_language>lambda</technical_language>

Target:
private void encodeDistribution(DBObject dbObject, Described entity) { TranslatorUtils.fromIterable(dbObject, DISTRIBUTION_KEY, entity.getDistributions(), distribution -> distributionTranslator.toDBObject( new BasicDBObject(), distribution) ); }
Source:
<code>public void flattenToBuffer(ByteBuffer buf) throws IOException { byte flags = 0; if (m_isSinglePartition) { flags |= SINGLE_PARTITION_MASK; } if (m_nPartitions != null) { flags |= N_PARTITION_MASK; } if (m_shouldReturnResultTables) { flags |= SHOULD_RETURN_TABLES_MASK; } <START> if (m_shouldReturnResultTables) { <END> flags |= SHOULD_RETURN_TABLES_MASK; } buf.put(VoltDbMessageFactory.IV2_INITIATE_TASK_ID); super.flattenToBuffer(buf); buf.putLong(m_clientInterfaceHandle); buf.putLong(m_connectionId); buf.put(flags); if (m_nPartitions != null) { buf.putShort((short) m_nPartitions.length); for (int i : m_nPartitions) { buf.putInt(i); } } m_invocation.flattenToBuffer(buf); assert(buf.capacity() == buf.position()); buf.limit(buf.position()); }</code><technical_language>This block is duplicated</technical_language>

Target:
public void flattenToBuffer(ByteBuffer buf) throws IOException { byte flags = 0; if (m_isSinglePartition) { flags |= SINGLE_PARTITION_MASK; } if (m_isEveryPartition) { flags |= EVERY_PARTITION_MASK; } if (m_shouldReturnResultTables) { flags |= SHOULD_RETURN_TABLES_MASK; } if (m_nPartitions != null) { flags |= N_PARTITION_MASK; } buf.put(VoltDbMessageFactory.IV2_INITIATE_TASK_ID); super.flattenToBuffer(buf); buf.putLong(m_clientInterfaceHandle); buf.putLong(m_connectionId); buf.put(flags); if (m_nPartitions != null) { buf.putShort((short) m_nPartitions.length); for (int i : m_nPartitions) { buf.putInt(i); } } m_invocation.flattenToBuffer(buf); assert(buf.capacity() == buf.position()); buf.limit(buf.position()); }
Source:
<code>public QueryResult<Alert> queryAlerts(final AlertQuery query) { assertIsOpen(); LOGGER.debug() .setMessage("Querying") <START> .addData("queryAlerts", query) <END> .log(); final PagedList<models.ebean.Alert> pagedAlerts = _alertQueryGenerator.createAlertQuery(this, query); final Long etag = _alertQueryGenerator.getEtag(this, query.getOrganization()); final List<Alert> values = new ArrayList<>(); pagedAlerts.getList().forEach(ebeanAlert -> values.add(convertFromEbeanAlert(ebeanAlert))); return new DefaultQueryResult<>(values, pagedAlerts.getTotalCount(), etag.toString()); }</code><technical_language>I this change intended</technical_language>

Target:
public QueryResult<Alert> queryAlerts(final AlertQuery query) { assertIsOpen(); LOGGER.debug() .setMessage("Querying") .addData("query", query) .log(); final PagedList<models.ebean.Alert> pagedAlerts = createAlertQuery(_ebeanServer, query); final long etag = _ebeanServer.createQuery(AlertEtags.class) .where() .eq("organization.uuid", query.getOrganization().getId()) .findOneOrEmpty() .map(AlertEtags::getEtag) .orElse(0L); final List<Alert> values = new ArrayList<>(); pagedAlerts.getList().forEach(ebeanAlert -> values.add(convertFromEbeanAlert(ebeanAlert))); return new DefaultQueryResult<>(values, pagedAlerts.getTotalCount(), String.valueOf(etag)); }
Source:
<code>private static List<String> findErlFiles(@NotNull Collection<String> removedFiles) { return ContainerUtil.filter(removedFiles, new Condition<String>() { @Override public boolean value(String s) { <START> return s.endsWith(".erl"); <END> } }); }</code><technical_language>Extract a method for this. (You 'ends ".erl"' checks in code)</technical_language>

Target:
private static List<String> findErlFiles(@NotNull Collection<String> removedFiles) { return ContainerUtil.filter(removedFiles, new Condition<String>() { @Override public boolean value(String s) { return ErlangBuilderUtil.isSource(s); } }); }
Source:
<code>private String computeMd5DigestOfPlugins() { try { String digestOfBundledFolder = md5DigestOfFolderContent(bundledPlugins); String digestOfExternalFolder = md5DigestOfFolderContent(externalPlugins); <START> File tempFileToStoreMd5 = File.createTempFile("tempFileToStoreMd5", ".txt"); <END> BufferedWriter writer = new BufferedWriter(new FileWriter(tempFileToStoreMd5)); writer.write(String.format("digestOfBundledFolder:" + digestOfBundledFolder + "\tdigestOfExternalFolder:" + digestOfExternalFolder)); writer.close(); return md5DigestOfFile(tempFileToStoreMd5); } catch (Exception e) { throw new RuntimeException(String.format("Could not compute md5 of plugins. Exception occurred: %s", e.getStackTrace())); } }</code><technical_language>do need create a new file. create md5 string concatenation. a [apache commons digest](<LINK_0></technical_language>

Target:
private String computeMd5DigestOfPlugins() { try { String digestOfBundledFolder = md5DigestOfFolderContent(bundledPlugins); String digestOfExternalFolder = md5DigestOfFolderContent(externalPlugins); String digestOfPlugins = digestOfBundledFolder + digestOfExternalFolder; return DigestUtils.md5Hex(digestOfPlugins); } catch (Exception e) { throw new RuntimeException(String.format("Could not compute md5 of plugins. Exception occurred: %s", e.getStackTrace())); } }
Source:
<code>private void decodeFilterFlushLines(boolean endOfInput) throws IOException { in.flip(); while (true) { CoderResult result = decoder.decode(in, buf, endOfInput); if (result.isUnderflow()) { break; } else if (result.isOverflow()) { if (!filterFlushLines()) { buf.flip(); <START> buf = CharBuffer.allocate(buf.capacity() + DEFAULT_DECODER_CAPACITY).put(buf); <END> } } else { throw new IllegalStateException("CharsetDecoder is mis-configured. Result: " + result); } } in.compact(); }</code><technical_language>double size time instead of adding default capacity in case hit some large lines</technical_language>

Target:
private void decodeFilterFlushLines(boolean endOfInput) throws IOException { ensureOpen(); encodedBuf.flip(); while (true) { CoderResult result = decoder.decode(encodedBuf, decodedBuf, endOfInput); if (result.isUnderflow()) { break; } else if (result.isOverflow()) { if (!filterFlushLines()) { decodedBuf.flip(); decodedBuf = CharBuffer.allocate(decodedBuf.capacity() * 2).put(decodedBuf); } } else { throw new IllegalStateException("CharsetDecoder is mis-configured. Result: " + result); } } encodedBuf.compact(); }
Source:
<code>public List<JsonEntityBean> getParentGroups(String target) { IGroupMember member = GroupService.getEntity(target, IPerson.class); Iterator<IEntityGroup> iterator = member.getAncestorGroups().iterator(); List<JsonEntityBean> parents = new ArrayList<JsonEntityBean>(); while (iterator.hasNext()) { parents.add(groupListHelper.getEntity(iterator.next())); } <START> Collections.sort(parents); <END> return parents; }</code><technical_language>For refactor</technical_language>

Target:
public List<JsonEntityBean> getParentGroups(String target) { IGroupMember member = GroupService.getEntity(target, IPerson.class); List<JsonEntityBean> parents = new ArrayList<>(); for (IEntityGroup ancestor : member.getAncestorGroups()) { parents.add(groupListHelper.getEntity(ancestor)); } Collections.sort(parents); return parents; }
Source:
<code>public void testRawQuery() throws ErrnoException { for (Network network : getTestableNetworks()) { CountDownLatch latch = new CountDownLatch(1); <START> final int TIMEOUT_MS = 12_000; final String dname = "www.google.com"; <END> String msg = "Raw query " + dname; mDns.query(network, dname, CLASS_IN, TYPE_AAAA, FLAG_NO_CACHE_LOOKUP, mHandler, answer -> { if (answer == null) { fail(msg + " no answer returned"); } try { new CheckedDnsPacket(answer); Log.d(TAG, "Reported blob:" + byteArrayToHexString(answer)); latch.countDown(); } catch (DnsPacket.ParseException e) { Log.d(TAG, e.getMessage()); fail(msg + " no valid answer"); } } ); try { assertTrue(msg + " but no answer after " + TIMEOUT_MS + "ms.", latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS)); } catch (InterruptedException e) { } } }</code><technical_language>1. dname declared a globally constant string TEST_DNAME? 2. some of declarations moved of loop</technical_language>

Target:
public void testRawQuery() throws ErrnoException { final String dname = "www.google.com"; final String msg = "Raw query " + dname; for (Network network : getTestableNetworks()) { final CountDownLatch latch = new CountDownLatch(1); mDns.query(network, dname, CLASS_IN, TYPE_AAAA, FLAG_NO_CACHE_LOOKUP, mHandler, answer -> { if (answer == null) { fail(msg + " no answer returned"); } try { assertValidAnswer(msg, new DnsAnswer(answer)); Log.d(TAG, "Reported blob:" + byteArrayToHexString(answer)); latch.countDown(); } catch (DnsPacket.ParseException e) { fail(msg + e.getMessage()); } } ); try { assertTrue(msg + " but no answer after " + TIMEOUT_MS + "ms.", latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS)); } catch (InterruptedException e) { } } }
Source:
<code>public Serializable getDocValue(String solrFieldName, Object docValue) { AttributeFormat format = getType(solrFieldName); if (AttributeFormat.SHORT.equals(format)) { return Short.parseShort(docValue.toString()); } else if (AttributeFormat.OBJECT.equals(format)) { try (ByteArrayInputStream bais = new ByteArrayInputStream((byte[]) docValue); ObjectInputStream in = new ObjectInputStream(bais)) { return (Serializable) in.readObject(); } catch (IOException e) { LOGGER.info("IO exception loading input document", e); } catch (ClassNotFoundException e) { <START> LOGGER.info("Could not create object to return.", e); <END> } return null; } else { return ((Serializable) docValue); } }</code><technical_language>If want some more improvements in fix log levels. debug</technical_language>

Target:
public Serializable getDocValue(String solrFieldName, Object docValue) { AttributeFormat format = getType(solrFieldName); if (AttributeFormat.SHORT.equals(format)) { return Short.parseShort(docValue.toString()); } else if (AttributeFormat.OBJECT.equals(format)) { try (ByteArrayInputStream bais = new ByteArrayInputStream((byte[]) docValue); ObjectInputStream in = new ObjectInputStream(bais)) { return (Serializable) in.readObject(); } catch (IOException e) { LOGGER.debug("IO exception loading input document", e); } catch (ClassNotFoundException e) { LOGGER.debug("Could not create object to return.", e); } return null; } else { return ((Serializable) docValue); } }
Source:
<code>private void checkConstraintViolations(StudyIdentifier studyId, String taskId) { <START> List<SchedulePlan> plans = schedulePlanService.getSchedulePlans(ClientInfo.UNKNOWN_CLIENT, studyId, false); <END> SchedulePlan match = findFirstMatchingPlan(plans, taskId); if (match != null) { throw new ConstraintViolationException.Builder().withEntityKey("taskId", taskId) .withEntityKey("type", "CompoundActivityDefinition").withReferrerKey("guid", match.getGuid()) .withReferrerKey("type", "SchedulePlan").build(); } }</code><technical_language>offline conversation, consistent, if logically deleting, fine if check logically deleted schedule plans. if physically deleting, logically deleted schedule plans reference this, undeleted. (Here in SurveyService.)</technical_language>

Target:
private void checkConstraintViolations(StudyIdentifier studyId, String taskId) { List<SchedulePlan> plans = schedulePlanService.getSchedulePlans(ClientInfo.UNKNOWN_CLIENT, studyId, true); SchedulePlan match = findFirstMatchingPlan(plans, taskId); if (match != null) { throw new ConstraintViolationException.Builder().withMessage( "Cannot delete compound activity definition: it is referenced by a schedule plan that is still accessible through the API") .withEntityKey("taskId", taskId).withEntityKey("type", "CompoundActivityDefinition") .withReferrerKey("guid", match.getGuid()).withReferrerKey("type", "SchedulePlan").build(); } }
Source:
<code>public <START> CheckResult check(Change <END> c) { reset(); change = c; try { checkImpl(); CheckResult result = new CheckResult(); result.messages = messages; return result; } finally { if (rw != null) { rw.release(); } if (repo != null) { repo.close(); } } }</code><technical_language>This return in unexpected. This method render ChangeInfo. reason instantiate CheckResult. return messages</technical_language>

Target:
public List<String> check(Change c) { reset(); change = c; try { checkImpl(); return messages; } finally { if (rw != null) { rw.release(); } if (repo != null) { repo.close(); } } }
Source:
<code><START> @Override public void close() throws Exception { <END> if (input != null) { input.close(); } }</code><technical_language>@Override a separate line</technical_language>

Target:
public final void close() throws Exception { if (input != null) { input.close(); } }
Source:
<code>public void automaticHardwareIdSpecBuilderWrongDiskTest() { <START> float disk = 10; <END> AutomaticHardwareIdSpec.automaticHardwareIdSpecBuilder(2.0, 2048, -disk); }</code><technical_language>need for this variable. Pass directly</technical_language>

Target:
public void automaticHardwareIdSpecBuilderWrongDiskTest() { AutomaticHardwareIdSpec.automaticHardwareIdSpecBuilder(2.0, 2048, Optional.of(-10.0f)); }
Source:
<code>protected final Optional<PlanNodeStatsEstimate> doCalculate(UnionNode node, StatsProvider statsProvider, Lookup lookup, Session session, TypeProvider types) { checkArgument(!node.getSources().isEmpty(), "Empty Union is not supported"); Optional<PlanNodeStatsEstimate> estimate = Optional.empty(); for (int i = 0; i < node.getSources().size(); i++) { PlanNode source = node.getSources().get(i); PlanNodeStatsEstimate sourceStats = statsProvider.getStats(source); <START> PlanNodeStatsEstimate sourceStatsWithMappedSymbols = mapToOutputSymbols(sourceStats, toListMultimap(node.getVariableMapping()), i); <END> if (estimate.isPresent()) { estimate = Optional.of(addStatsAndCollapseDistinctValues(estimate.get(), sourceStatsWithMappedSymbols)); } else { estimate = Optional.of(sourceStatsWithMappedSymbols); } } return estimate; }</code><technical_language>need toListMultimap another copy, update mapToOutputSymbols Map<VariableReferenceExpression, List<VariableReferenceExpression>>. for other places toListMultimap</technical_language>

Target:
protected final Optional<PlanNodeStatsEstimate> doCalculate(UnionNode node, StatsProvider statsProvider, Lookup lookup, Session session, TypeProvider types) { checkArgument(!node.getSources().isEmpty(), "Empty Union is not supported"); Optional<PlanNodeStatsEstimate> estimate = Optional.empty(); for (int i = 0; i < node.getSources().size(); i++) { PlanNode source = node.getSources().get(i); PlanNodeStatsEstimate sourceStats = statsProvider.getStats(source); PlanNodeStatsEstimate sourceStatsWithMappedSymbols = mapToOutputSymbols(sourceStats, node, i); if (estimate.isPresent()) { estimate = Optional.of(addStatsAndCollapseDistinctValues(estimate.get(), sourceStatsWithMappedSymbols)); } else { estimate = Optional.of(sourceStatsWithMappedSymbols); } } return estimate; }
Source:
<code>public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); View view = inflater.inflate(R.layout.fragment_description_edit, container, false); unbinder = ButterKnife.bind(this, view); <START> getAppCompatActivity().getSupportActionBar().setDisplayHomeAsUpEnabled(true); <END> getAppCompatActivity().getSupportActionBar().setTitle(""); pageTitle = GsonUnmarshaller.unmarshal(PageTitle.class, getActivity().getIntent().getStringExtra(EXTRA_TITLE)); pageTitleText.setText(pageTitle.getDisplayText()); return view; }</code><technical_language>floundering toolbar code live if access Activity dependencies Fragment, live in Activity</technical_language>

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); View view = inflater.inflate(R.layout.fragment_description_edit, container, false); unbinder = ButterKnife.bind(this, view); pageTitle = GsonUnmarshaller.unmarshal(PageTitle.class, getActivity().getIntent().getStringExtra(EXTRA_TITLE)); pageTitleText.setText(pageTitle.getDisplayText()); return view; }
Source:
<code>public void register(FContext context, FAsyncCallback callback) throws TException { long opId = context.getOpId(); if (handlers.containsKey(opId)) { throw new FException("context already registered"); } context.setOpId(NEXT_OP_ID.incrementAndGet()); <START> handlers.put(opId, new Pair<>(callback, Thread.currentThread())); <END> }</code><technical_language>This needs register context's new opid</technical_language>

Target:
public void register(FContext context, FAsyncCallback callback) throws TException { if (handlers.containsKey(context.getOpId())) { throw new FException("context already registered"); } long opId = NEXT_OP_ID.incrementAndGet(); context.setOpId(opId); handlers.put(opId, new Pair<>(callback, Thread.currentThread())); }
Source:
<code>private void checkTarFileSetAttributesAllowed() { if (getProject() == null || (isReference() <START> && getRefid().getReferencedObject(getProject()) instanceof TarFileSet)) { <END> checkAttributesAllowed(); } }</code><technical_language>please whitespace changes separate PRs (or create all)</technical_language>

Target:
private void checkTarFileSetAttributesAllowed() { if (getProject() == null || (isReference() && (getRefid().getReferencedObject( getProject()) instanceof TarFileSet))) { checkAttributesAllowed(); } }
Source:
<code>public void enqueueEduDocument(EduDocument eduDocument) throws IOException, MessageException { if (!(eduDocument.getAny() instanceof Payload)) { log.error("Message attachement not instance of Payload."); throw new MeldingsUtvekslingRuntimeException("Message attachement ("+eduDocument.getAny()+") not instance of " + ""+Payload.class); } byte[] decryptedAsicPackage = decrypt((Payload)eduDocument.getAny()); Map<String, byte[]> contentFromAsic = getContentFromAsic(decryptedAsicPackage); IncomingConversationResource message = IncomingConversationResource.of(eduDocument.getConversationId(), eduDocument.getSenderOrgNumber(), eduDocument.getReceiverOrgNumber(), "OEP"); contentFromAsic.keySet().forEach(k -> message.addFileRef(k)); String filedir = props.getNextbest().getFiledir(); if (!filedir.endsWith("/")) { filedir = filedir+"/"; } filedir = filedir+eduDocument.getConversationId()+"/"; File localFile = new File(filedir+props.getNextbest().getAsicfile()); localFile.getParentFile().mkdirs(); try { <START> FileOutputStream os = new FileOutputStream(localFile); <END> BufferedOutputStream bos = new BufferedOutputStream(os); bos.write(decryptedAsicPackage); bos.close(); repoIn.save(message); } catch (IOException e) { e.printStackTrace(); } }</code><technical_language>![BLOCKER](<LINK_1> Close this "FileOutputStream". [![rule](<LINK_0>](<LINK_2></technical_language>

Target:
public void enqueueEduDocument(EduDocument eduDocument) throws MessageException { if (!(eduDocument.getAny() instanceof Payload)) { log.error("Message attachement not instance of Payload."); throw new MeldingsUtvekslingRuntimeException("Message attachement ("+eduDocument.getAny()+") not instance of " + ""+Payload.class); } byte[] decryptedAsicPackage = decrypt((Payload)eduDocument.getAny()); List<String> contentFromAsic = getContentFromAsic(decryptedAsicPackage); IncomingConversationResource message = IncomingConversationResource.of(eduDocument.getConversationId(), eduDocument.getSenderOrgNumber(), eduDocument.getReceiverOrgNumber(), "OEP"); contentFromAsic.forEach(message::addFileRef); String filedir = props.getNextbest().getFiledir(); if (!filedir.endsWith("/")) { filedir = filedir+"/"; } filedir = filedir+eduDocument.getConversationId()+"/"; File localFile = new File(filedir+props.getNextbest().getAsicfile()); localFile.getParentFile().mkdirs(); try { FileOutputStream os = new FileOutputStream(localFile); BufferedOutputStream bos = new BufferedOutputStream(os); bos.write(decryptedAsicPackage); bos.close(); os.close(); repoIn.save(message); } catch (IOException e) { log.error("Could not write asic container to disc.", e); } }
Source:
<code>public void execute() throws UpdateException, RestApiException { try { executeRefUpdates(); executeChangeOps(); reindexChanges(); gitRefUpdated.fire(project, <START> batchRefUpdate); <END> executePostOps(); } catch (UpdateException | RestApiException e) { throw e; } catch (Exception e) { Throwables.propagateIfPossible(e); throw new UpdateException(e); } }</code><technical_language>batchRefUpdate null get NPE fire method</technical_language>

Target:
public void execute() throws UpdateException, RestApiException { try { executeRefUpdates(); executeChangeOps(); reindexChanges(); if (batchRefUpdate != null) { gitRefUpdated.fire(project, batchRefUpdate); } executePostOps(); } catch (UpdateException | RestApiException e) { throw e; } catch (Exception e) { Throwables.propagateIfPossible(e); throw new UpdateException(e); } }
Source:
<code>private void monitorEngineThreadPools() { try { threadPoolInfoMap.clear(); Arrays.asList(threadMXBean.getAllThreadIds()) .stream() .forEach(threadId -> processThread(threadMXBean.getThreadInfo(threadId))); <START> StringJoiner info = new StringJoiner("\n", "ThreadPools Info\n", ""); <END> threadPoolInfoMap.entrySet() .stream() .forEach(entry -> info.add(entry.getValue().toString())); log.info(info.toString()); } catch (Exception ex) { log.info("Exception", ex); } }</code><technical_language>avoid new lines in log record break parsing logs in metrics store. Please log thread pool separately (one thread pool log.info invocation)</technical_language>

Target:
private void monitorEngineThreadPools() { try { threadPoolInfoMap.clear(); Arrays.asList(threadMXBean.getAllThreadIds()) .stream() .forEach(threadId -> processThread(threadMXBean.getThreadInfo(threadId))); threadPoolInfoMap.entrySet() .stream() .forEach(entry -> log.info(entry.getValue().toString())); } catch (Exception ex) { log.info("Error fetching thread pools data: {}", ex.getMessage()); log.debug("Exception", ex); } }
Source:
<code>private void initializeRequestLogger() { if (requestLogger == null) { try { final String loggingType = props.getProperty("druid.request.logging.type"); <START> if(loggingType != null && loggingType.equals("emitter")) { <END> setRequestLogger(Initialization.makeEmittingRequestLogger( getProps(), getEmitter() )); } else { setRequestLogger(Initialization.makeFileRequestLogger( getJsonMapper(), getScheduledExecutorFactory(), getProps() )); } } catch (IOException e) { throw Throwables.propagate(e); } lifecycle.addManagedInstance(requestLogger); } }</code><technical_language>invert this logic: "emitter".equals(loggingType)</technical_language>

Target:
private void initializeRequestLogger() { if (requestLogger == null) { try { final String loggingType = props.getProperty("druid.request.logging.type"); if("emitter".equals(loggingType)) { setRequestLogger(Initialization.makeEmittingRequestLogger( getProps(), getEmitter() )); } else { setRequestLogger(Initialization.makeFileRequestLogger( getJsonMapper(), getScheduledExecutorFactory(), getProps() )); } } catch (IOException e) { throw Throwables.propagate(e); } lifecycle.addManagedInstance(requestLogger); } }
Source:
<code>public ObjectInspector initialize(ObjectInspector[] arguments) throws UDFArgumentException { <START> if (arguments.length != 1) { <END> throw new UDFArgumentLengthException("The CountryNameUDF takes an array with only 1 element as argument"); } ObjectInspector arg1 = arguments[0]; if (arg1.getCategory() != Category.PRIMITIVE) { throw new UDFArgumentTypeException(0, "A string argument was expected but an argument of type " + arg1.getTypeName() + " was given."); } PrimitiveCategory primitiveCategory = ((PrimitiveObjectInspector) arg1).getPrimitiveCategory(); if (primitiveCategory != PrimitiveCategory.STRING) { throw new UDFArgumentTypeException(0, "A string argument was expected but an argument of type " + arg1.getTypeName() + " was given."); } argumentOI = arg1; return PrimitiveObjectInspectorFactory.writableStringObjectInspector; }</code><technical_language>GenericUDFHelper for functions here, checkArgSize</technical_language>

Target:
public ObjectInspector initialize(ObjectInspector[] arguments) throws UDFArgumentException { GenericUDFHelper argsHelper = new GenericUDFHelper(); argsHelper.checkArgsSize(arguments, 1, 1); argsHelper.checkArgPrimitive(arguments, 0); argsHelper.checkArgType(arguments, 0, PrimitiveCategory.STRING); argumentOI = (StringObjectInspector) arguments[0]; return PrimitiveObjectInspectorFactory.writableStringObjectInspector; }
Source:
<code>public Object getObjectForTextSelection(TextSelection selection, IEditorPart editor) { if (editor instanceof CEditor) { TextSelection textSelection = selection; try { if (selection != null) { <START> return SelectionConverter.getElementAtOffset(getInputCElement((CEditor) editor), textSelection); <END> } else { ICElement element = getInputCElement((CEditor) editor); return element; } } catch (CModelException e) { } } return null; }</code><technical_language>check if celement is null</technical_language>

Target:
public Object getObjectForTextSelection(TextSelection selection, IEditorPart editor) { if (editor instanceof CEditor) { TextSelection textSelection = selection; try { ICElement element = getInputCElement((CEditor) editor); if (element != null) { if (selection != null) { return SelectionConverter.getElementAtOffset(element, textSelection); } else { return element; } } } catch (CModelException e) { } } return null; }
Source:
<code>private Object[] createFileListInput() { try { IPackageFragment fPkgFragment= fResourceBundlePackage.getSelected(); if (fPkgFragment == null) return new Object[0]; List<Object> result= new ArrayList<>(1); for (Object <START> n : <END> fPkgFragment.getNonJavaResources()) { if (isPropertyFile(n)) { result.add(n); } } return result.toArray(); } catch (JavaModelException e) { ExceptionHandler.handle(e, NLSUIMessages.NLSAccessorConfigurationDialog_externalizing, NLSUIMessages .NLSAccessorConfigurationDialog_exception); return new Object[0]; } }</code><technical_language>rename nonJava</technical_language>

Target:
private Object[] createFileListInput() { try { IPackageFragment fPkgFragment= fResourceBundlePackage.getSelected(); if (fPkgFragment == null) return new Object[0]; List<Object> result= new ArrayList<>(1); for (Object nonJava : fPkgFragment.getNonJavaResources()) { if (isPropertyFile(nonJava)) { result.add(nonJava); } } return result.toArray(); } catch (JavaModelException e) { ExceptionHandler.handle(e, NLSUIMessages.NLSAccessorConfigurationDialog_externalizing, NLSUIMessages .NLSAccessorConfigurationDialog_exception); return new Object[0]; } }
Source:
<code>public void run() { SharedPreferences pm = PreferenceManager.getDefaultSharedPreferences(mContext); DataOutputStream dos = null; int ret = 1; String command = mContext.getApplicationInfo().dataDir + "/" + SyncthingService.BINARY_NAME; Process process = null; try { do { process = Runtime.getRuntime().exec("sh"); dos = new DataOutputStream(process.getOutputStream()); dos.writeBytes("HOME=" + Environment.getExternalStorageDirectory() + " "); dos.writeBytes("STTRACE=" + pm.getString("sttrace", "") + " "); dos.writeBytes("STNORESTART=1 "); dos.writeBytes("STNOUPGRADE=1 "); switch (mCommand) { case generate: dos.writeBytes(command + " -generate='" + mContext.getFilesDir() + "' -no-browser"); break; case main: dos.writeBytes(command + " -home='" + mContext.getFilesDir() + "' -no-browser"); break; case reset: dos.writeBytes(command + " -home='" + mContext.getFilesDir() + "' -reset"); break; case manual: dos.writeBytes(mManualCommand); break; <START> default: <END> Log.w(TAG, "Unknown command option"); } dos.writeBytes("\nexit\n"); dos.flush(); log(process.getInputStream(), Log.INFO); log(process.getErrorStream(), Log.WARN); ret = process.waitFor(); if (ret == 3) { Log.i(TAG, "Restarting syncthing"); mContext.startService(new Intent(mContext, SyncthingService.class) .setAction(SyncthingService.ACTION_RESTART)); } } while (ret == 3); } catch (IOException | InterruptedException e) { Log.e(TAG, "Failed to execute syncthing binary or read output", e); } finally { try { dos.close(); } catch (IOException e) { Log.w(TAG, "Failed to close shell stream", e); } process.destroy(); if (ret != 0) { Log.e(TAG_NATIVE, "Syncthing binary crashed with error code " + Integer.toString(ret)); } } }</code><technical_language>I move switch a static method SyncthingRunnable(Context, Command), call this(Context, f(Command)). simpler</technical_language>

Target:
public void run() { SharedPreferences pm = PreferenceManager.getDefaultSharedPreferences(mContext); DataOutputStream dos = null; int ret = 1; Process process = null; try { do { process = Runtime.getRuntime().exec("sh"); dos = new DataOutputStream(process.getOutputStream()); dos.writeBytes("HOME=" + Environment.getExternalStorageDirectory() + " "); dos.writeBytes("STTRACE=" + pm.getString("sttrace", "") + " "); dos.writeBytes("STNORESTART=1 "); dos.writeBytes("STNOUPGRADE=1 "); dos.writeBytes(mCommand); dos.writeBytes("\nexit\n"); dos.flush(); log(process.getInputStream(), Log.INFO); log(process.getErrorStream(), Log.WARN); niceSyncthing(); ret = process.waitFor(); if (ret == 3) { Log.i(TAG, "Restarting syncthing"); mContext.startService(new Intent(mContext, SyncthingService.class) .setAction(SyncthingService.ACTION_RESTART)); } } while (ret == 3); } catch (IOException | InterruptedException e) { Log.e(TAG, "Failed to execute syncthing binary or read output", e); } finally { try { dos.close(); } catch (IOException e) { Log.w(TAG, "Failed to close shell stream", e); } process.destroy(); if (ret != 0) { Log.e(TAG_NATIVE, "Syncthing binary crashed with error code " + Integer.toString(ret)); } } }
Source:
<code>public boolean applyEffectBlock(ItemStack stack, World world, BlockPos pos, EnumFacing facing, double impactX, double impactY, double impactZ, EntityLivingBase caster) { Block block = world.getBlockState(pos).getBlock(); if (block instanceof BlockFlower || block instanceof BlockTallGrass){ world.setBlockState(pos, Blocks.tallgrass.getDefaultState()); return true; }else if (block == Blocks.grass || block == Blocks.mycelium || block == Blocks.sandstone || block == Blocks.dirt){ world.setBlockState(pos, Blocks.sand.getDefaultState()); return true; }else if (block == Blocks.stone){ world.setBlockState(pos, Blocks.cobblestone.getDefaultState()); return true; }else if (block == Blocks.stonebrick && world.getBlockState(pos).getBlock().getMetaFromState(world.getBlockState(pos)) != 2){ world.setBlockMetadataWithNotify(blockx, blocky, blockz, 2, 2); return true; } if (block == Blocks.water || block == Blocks.flowing_water){ world.setBlockState(pos, Blocks.air.getDefaultState()); return true; }else{ switch (facing){ case EAST: pos = pos.east(); break; case NORTH: pos = pos.north(); break; case SOUTH: pos = pos.south(); break; case WEST: pos = pos.west(); break; case DOWN: pos = pos.down(); break; case UP: pos = pos.up(); break; <START> } <END> block = world.getBlockState(pos).getBlock(); if (block == Blocks.water || block == Blocks.flowing_water){ world.setBlockState(pos, Blocks.air.getDefaultState()); return true; } } return false; }</code><technical_language>switch collapsed pos = pos.offset(EnumFacing)</technical_language>

Target:
public boolean applyEffectBlock(ItemStack stack, World world, BlockPos pos, EnumFacing facing, double impactX, double impactY, double impactZ, EntityLivingBase caster) { Block block = world.getBlockState(pos).getBlock(); if (block instanceof BlockFlower || block instanceof BlockTallGrass){ world.setBlockState(pos, Blocks.tallgrass.getDefaultState()); return true; }else if (block == Blocks.grass || block == Blocks.mycelium || block == Blocks.sandstone || block == Blocks.dirt){ world.setBlockState(pos, Blocks.sand.getDefaultState()); return true; }else if (block == Blocks.stone){ world.setBlockState(pos, Blocks.cobblestone.getDefaultState()); return true; }else if (block == Blocks.stonebrick && world.getBlockState(pos).getBlock().getMetaFromState(world.getBlockState(pos)) != 2){ world.setBlockMetadataWithNotify(blockx, blocky, blockz, 2, 2); return true; } if (block == Blocks.water || block == Blocks.flowing_water){ world.setBlockState(pos, Blocks.air.getDefaultState()); return true; }else{ pos = pos.offset(facing); block = world.getBlockState(pos).getBlock(); if (block == Blocks.water || block == Blocks.flowing_water){ world.setBlockState(pos, Blocks.air.getDefaultState()); return true; } } return false; }
Source:
<code>private void captureScreenshot(ITestResult result) { Set<SeleniumWebDriver> webDrivers = new HashSet<>(); Object testInstance = result.getInstance(); collectInjectedWebDrivers(testInstance, webDrivers); webDrivers.forEach(webDriver -> captureScreenshot(result, webDriver)); <START> webDrivers.forEach(webDriver -> dumpHtmlCodeFromTheCurrentPage(result, webDriver)); <END> }</code><technical_language>good name for method for capture screenshot basically ok for</technical_language>

Target:
private void captureScreenshot(ITestResult result) { Set<SeleniumWebDriver> webDrivers = new HashSet<>(); Object testInstance = result.getInstance(); collectInjectedWebDrivers(testInstance, webDrivers); webDrivers.forEach(webDriver -> captureScreenshot(result, webDriver)); }
Source:
<code><START> public void testDetectedPingedDownNodeCallingInfrastructureManagerInternalRemoveNodeTrueFlag() <END> throws RMException, ClassNotFoundException { Node node = createNode(PROACTIVE_PROGRAMMING_NODE_URL); nodeSource.internalAddNode(node); nodeSource.detectedPingedDownNode(node.getNodeInformation().getURL()); verify(infrastructureManager).internalRemoveNode(any(Node.class), eq(true)); }</code><technical_language>fancy name</technical_language>

Target:
public void testDetectedPingedDownNodeCallingInfrastructureManagerInternalRemoveNodeTrueFlag() throws RMException, ClassNotFoundException { Node node = createNode(PROACTIVE_PROGRAMMING_NODE_URL); nodeSource.internalAddNode(node); nodeSource.detectedPingedDownNode(node.getNodeInformation().getURL()); verify(infrastructureManager).internalNotifyDownNode(any(Node.class)); }
Source:
<code>public void bundleFinished(final BundleProcessor context, final Bundle bundle) { vetoes.remove(bundle.getBundleId(), context); if (vetoes.get(bundle.getBundleId()).isEmpty()) { logger.debug("Finished loading meta-data of bundle '{}'.", bundle.getSymbolicName()); <START> synchronized (queue) { <END> for (T object : queue.removeAll(bundle.getBundleId())) { action.apply(object); } } } else { logger.debug("'{}' still vetoed by '{}', queueing '{}'", bundle.getSymbolicName(), vetoes.get(bundle.getBundleId()), queue.get(bundle.getBundleId())); } }</code><technical_language>synchronized for queue handling, do if add queue</technical_language>

Target:
public void bundleFinished(final BundleProcessor context, final Bundle bundle) { vetoes.remove(bundle.getBundleId(), context); if (vetoes.get(bundle.getBundleId()).isEmpty()) { logger.debug("Finished loading meta-data of bundle '{}'.", bundle.getSymbolicName()); for (T object : queue.removeAll(bundle.getBundleId())) { action.apply(object); } } else { logger.debug("'{}' still vetoed by '{}', queueing '{}'", bundle.getSymbolicName(), vetoes.get(bundle.getBundleId()), queue.get(bundle.getBundleId())); } }
Source:
<code>public void testTechnicalitiesCase001(Comparison comparison) throws IOException { EList<Conflict> conflicts = comparison.getConflicts(); assertEquals(1, conflicts.size()); Conflict conflict = conflicts.get(0); assertEquals(PSEUDO, conflict.getKind()); EList<Diff> differences = conflict.getDifferences(); assertEquals(2, differences.size()); TechnicalitiesFilter technicalitiesFilter = new TechnicalitiesFilter(); Predicate<? super EObject> predicate = technicalitiesFilter.getPredicateWhenSelected(); <START> assertFalse(predicate.apply(differences.get(0))); <END> assertFalse(predicate.apply(differences.get(1))); }</code><technical_language>forget predicates apply TreeNodes, diffs</technical_language>

Target:
public void testTechnicalitiesCase001(Comparison comparison) throws IOException { ConflictsGroupImpl group = new ThreeWayComparisonGroupProvider.ConflictsGroupImpl(comparison, "Conflict", new TestECrossReferenceAdapter()); group.buildSubTree(); assertEquals(1, group.getChildren().size()); TreeNode conflictNode = group.getChildren().get(0); assertEquals(1, conflictNode.getChildren().size()); TreeNode matchNode = conflictNode.getChildren().get(0); assertEquals(2, matchNode.getChildren().size()); TechnicalitiesFilter filter = new TechnicalitiesFilter(); Predicate<? super EObject> selected = filter.getPredicateWhenSelected(); Predicate<? super EObject> unselected = filter.getPredicateWhenUnselected(); TreeNode diffNode1 = matchNode.getChildren().get(0); assertTrue(selected.apply(diffNode1)); assertFalse(unselected.apply(diffNode1)); TreeNode diffNode2 = matchNode.getChildren().get(1); assertTrue(selected.apply(diffNode2)); assertFalse(unselected.apply(diffNode2)); }
Source:
<code>protected LicenseInfoParsingResult filterLicenses(LicenseInfoParsingResult result, Set<LicenseNameWithText> licencesToExclude) { Set<LicenseNameWithText> filteredLicenses = result.getLicenseInfo().getLicenseNamesWithTexts().stream().filter(license -> { for (LicenseNameWithText excludeLicense : licencesToExclude) { <START> if (Strings.nullToEmpty(license.getLicenseName()).equals(Strings.nullToEmpty(excludeLicense.getLicenseName())) <END> && Strings.nullToEmpty(license.getLicenseText()).equals(Strings.nullToEmpty(excludeLicense.getLicenseText())) && Strings.nullToEmpty(license.getAcknowledgements()) .equals(Strings.nullToEmpty(excludeLicense.getAcknowledgements()))) { return false; } } return true; }).collect(Collectors.toSet()); LicenseInfoParsingResult newResult = result.deepCopy(); newResult.getLicenseInfo().setLicenseNamesWithTexts(filteredLicenses); return newResult; }</code><technical_language>I a static import of Strings.nullToEmpty() is warranted this condition human-readable. Extracting comparison a method licenseNameWithTextEquals(license, excludedLicense) readability, IMO</technical_language>

Target:
protected LicenseInfoParsingResult filterLicenses(LicenseInfoParsingResult result, Set<LicenseNameWithText> licencesToExclude) { Set<LicenseNameWithText> filteredLicenses = result.getLicenseInfo().getLicenseNamesWithTexts().stream().filter(license -> { for (LicenseNameWithText excludeLicense : licencesToExclude) { if (LicenseNameWithTextUtils.licenseNameWithTextEquals(license, excludeLicense)) { return false; } } return true; }).collect(Collectors.toSet()); LicenseInfoParsingResult newResult = result.deepCopy(); newResult.getLicenseInfo().setLicenseNamesWithTexts(filteredLicenses); return newResult; }
Source:
<code>public CalciteStatement createStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { try { return super.createStatement(resultSetType, resultSetConcurrency, resultSetHoldability); } catch (SQLException e) { if (e.getCause().getCause() instanceof SQLException) { <START> throw (SQLException) e.getCause().getCause(); <END> } throw e; } }</code><technical_language>a utility method unwraps Exception? number of levels of Exception wrapping, level a time hit instance of SQLException</technical_language>

Target:
public CalciteStatement createStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { try { return super.createStatement(resultSetType, resultSetConcurrency, resultSetHoldability); } catch (SQLException e) { throw CalciteUtils.unwrapSqlException(e); } }
Source:
<code>private KeyPair getKeyPair(AmazonEC2 ec2) throws IOException { KeyPair keyPair = parent.getPrivateKey().find(ec2); if (keyPair == null) { LOGGER.log(Level.WARNING, "No matching keypair found on EC2. Is the EC2 private key a valid one?"); <START> } <END> return keyPair; }</code><technical_language>I this a WARNING, INFO text circumstances key is required, this part of normal operation</technical_language>

Target:
private KeyPair getKeyPair(AmazonEC2 ec2) throws IOException { KeyPair keyPair = parent.getPrivateKey().find(ec2); if (keyPair == null) { LOGGER.log(Level.INFO, "No matching keypair found on EC2. Is public key acquired via some other means?"); } return keyPair; }
Source:
<code>public CacheSet<K> keySet() { CacheStream<K> stream = getDelegate().keySet().stream().map( new ValueToTypedValueFunction<>(dataTypedCacheManager.dataType, dataTypedCacheManager.marshaller)); <START> return new SetAsCacheSet<>(stream.collect( <END> CacheCollectors.serializableCollector(Collectors::toSet))); }</code><technical_language>I familiar script cache stuff, this delazify cache contents hold memory. Is this okay</technical_language>

Target:
public CacheSet<K> keySet() { return new CacheSetMapper<>(getDelegate().keySet(), new ValueToTypedValueFunction<>( dataTypedCacheManager.dataType, dataTypedCacheManager.marshaller)); }