auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void createNonValidSupportLevel() throws Exception { ObjectMapper mapper = new ObjectMapper(); BitstreamFormatRest bitstreamFormatRest = this.createRandomMockBitstreamRest(false); bitstreamFormatRest.setSupportLevel("NONVALID SUPPORT LVL"); String token = getAuthToken(admin.getEmail(), password); getClient(token).perform(post("/api/core/bitstreamformats/") .content(mapper.writeValueAsBytes(bitstreamFormatRest)).contentType(contentType)) <START> .andExpect(status().isBadRequest()); <END> }</code><technical_language>check bitstreamformat created all, i.e. a findAll return expected number of formats (the loaded in default configuration)</technical_language>

Target:
public void createNonValidSupportLevel() throws Exception { ObjectMapper mapper = new ObjectMapper(); BitstreamFormatRest bitstreamFormatRest = this.createRandomMockBitstreamRest(false); bitstreamFormatRest.setSupportLevel("NONVALID SUPPORT LVL"); String token = getAuthToken(admin.getEmail(), password); getClient(token).perform(post("/api/core/bitstreamformats/") .content(mapper.writeValueAsBytes(bitstreamFormatRest)).contentType(contentType)) .andExpect(status().isBadRequest()); getClient().perform(get("/api/core/bitstreamformats/")) .andExpect(status().isOk()) .andExpect(jsonPath("$.page.totalElements", is(DEFAULT_AMOUNT_FORMATS))); }
Source:
<code>public String getTableVersion(Table table, Transaction transaction) { SqlTransaction sqlTransaction = (SqlTransaction) transaction; String tableVersion = null; Class<?> tableClass = getMetadataDictionary().getEntityClass(table.getName(), table.getVersion()); VersionQuery versionAnnotation = tableClass.getAnnotation(VersionQuery.class); if (versionAnnotation != null) { String versionQueryString = versionAnnotation.sql(); NamedParamPreparedStatement stmt = sqlTransaction.initializeStatement(versionQueryString); <START> tableVersion = new TimedFunction<>(() -> { <END> try { ResultSet rs = stmt.executeQuery(); if (rs.next()) { return rs.getString(1); } else { return null; } } catch (SQLException e) { throw new IllegalStateException(e); } }, "Running Query: " + versionQueryString ).get(); } return tableVersion; }</code><technical_language>commonize this code a template function takes another function a result set argument java <T> runQuery(String query, Function<ResultSet, T> resultSetMapper) lines</technical_language>

Target:
public String getTableVersion(Table table, Transaction transaction) { String tableVersion = null; Class<?> tableClass = getMetadataDictionary().getEntityClass(table.getName(), table.getVersion()); VersionQuery versionAnnotation = tableClass.getAnnotation(VersionQuery.class); if (versionAnnotation != null) { String versionQueryString = versionAnnotation.sql(); SqlTransaction sqlTransaction = (SqlTransaction) transaction; ConnectionDetails details = getConnectionDetails(table.getDbConnectionName()); DataSource dataSource = details.getDataSource(); NamedParamPreparedStatement stmt = sqlTransaction.initializeStatement(versionQueryString, dataSource); tableVersion = CoerceUtil.coerce(runQuery(stmt, versionQueryString, SINGLE_RESULT_MAPPER), String.class); } return tableVersion; }
Source:
<code>private int index(Iterator<Item> iterator) throws DSpaceSolrIndexerException { try { int i = 0; SolrServer server = solrServerResolver.getServer(); ArrayList<SolrInputDocument> list = new ArrayList<>(); while (iterator.hasNext()) { try { Item item = iterator.next(); if (item.getHandle() == null) { log.warn("Skipped item without handle: " + item.getID()); } else { list.add(this.index(item)); } context.uncacheEntity(item); } catch (SQLException | MetadataBindException | ParseException | XMLStreamException | WritingXmlException ex) { log.error(ex.getMessage(), ex); } i++; if (i % 1000 == 0) { System.out.println(i + " items prepared so far..."); } <START> if (i % 10000 == 0) { <END> System.out.println(i + " items imported so far..."); server.add(list); server.commit(true, true); list.clear(); } } System.out.println("Total: " + i + " items"); server.add(list); server.commit(true, true); list.clear(); return i; } catch (SolrServerException | IOException ex) { throw new DSpaceSolrIndexerException(ex.getMessage(), ex); } }</code><technical_language>this intermediate commit point *configurable*? hoping committing 10,000 is a sane default, wondering out loud if worth making this a configuration setting</technical_language>

Target:
private int index(Iterator<Item> iterator) throws DSpaceSolrIndexerException { try { int i = 0; int batchSize = configurationService.getIntProperty("oai.import.batch.size", 1000); SolrServer server = solrServerResolver.getServer(); ArrayList<SolrInputDocument> list = new ArrayList<>(); while (iterator.hasNext()) { try { Item item = iterator.next(); if (item.getHandle() == null) { log.warn("Skipped item without handle: " + item.getID()); } else { list.add(this.index(item)); } context.uncacheEntity(item); } catch (SQLException | MetadataBindException | ParseException | XMLStreamException | WritingXmlException ex) { log.error(ex.getMessage(), ex); } i++; if (i % 1000 == 0) { System.out.println(i + " items prepared so far..."); } if (i % batchSize == 0) { System.out.println(i + " items imported so far..."); server.add(list); server.commit(); list.clear(); } } System.out.println("Total: " + i + " items"); server.add(list); server.commit(true, true); list.clear(); return i; } catch (SolrServerException | IOException ex) { throw new DSpaceSolrIndexerException(ex.getMessage(), ex); } }
Source:
<code>public static long hexToId(String hexString) { Assert.hasText(hexString, "Can't convert empty hex string to long"); try { return new BigInteger(hexString, 16).longValue(); } catch (NumberFormatException e) { <START> throw new IllegalArgumentException("Malformed id", e); <END> } }</code><technical_language>add hexString exception message</technical_language>

Target:
public static long hexToId(String hexString) { Assert.hasText(hexString, "Can't convert empty hex string to long"); try { return new BigInteger(hexString, 16).longValue(); } catch (NumberFormatException e) { throw new IllegalArgumentException("Malformed id [" + hexString + "]", e); } }
Source:
<code>public Promise<Multimap<String, Integer>> resolveToConceptsWithGroups(final BranchContext context) { if (conceptsWithGroups == null) { conceptsWithGroups = SnomedRequests.prepareSearchRelationship() .all() .filterByActive(true) .filterByCharacteristicTypes(SnomedEclRefinementEvaluator.ALLOWED_CHARACTERISTIC_TYPES) .filterBySource(ecl) .filterByGroup(1, Integer.MAX_VALUE) .setFields(SnomedRelationshipIndexEntry.Fields.ID, SnomedRelationshipIndexEntry.Fields.SOURCE_ID, SnomedRelationshipIndexEntry.Fields.GROUP) .build(context.id(), context.branchPath()) .execute(context.service(IEventBus.class)) .then(new Function<SnomedRelationships, Multimap<String, Integer>>() { @Override public Multimap<String, Integer> apply(SnomedRelationships input) { final Multimap<String, SnomedRelationship> relationshipsBySource = Multimaps.index(input, SnomedRelationship::getSourceId); <START> return Multimaps.transformValues(relationshipsBySource, SnomedRelationship::getGroup); <END> } }); } return conceptsWithGroups; }</code><technical_language>transformValues returns a Multimap view allows duplication, example below: Multimap<String, String> m = ImmutableSetMultimap.of( "a", "123", "b", "1234", "a", "abc", "a", "d"); Multimaps.transformValues(m, String::length) --> {a=[3, 3, 2], b=[4]} avoid this, wrap result of transformValues in ImmutableSetMultimap returning it</technical_language>

Target:
public Promise<Multimap<String, Integer>> resolveToConceptsWithGroups(final BranchContext context) { if (conceptsWithGroups == null) { conceptsWithGroups = SnomedRequests.prepareSearchRelationship() .all() .filterByActive(true) .filterByCharacteristicTypes(SnomedEclRefinementEvaluator.ALLOWED_CHARACTERISTIC_TYPES) .filterBySource(ecl) .filterByGroup(1, Integer.MAX_VALUE) .setFields(SnomedRelationshipIndexEntry.Fields.ID, SnomedRelationshipIndexEntry.Fields.SOURCE_ID, SnomedRelationshipIndexEntry.Fields.GROUP) .build(context.id(), context.branchPath()) .execute(context.service(IEventBus.class)) .then(new Function<SnomedRelationships, Multimap<String, Integer>>() { @Override public Multimap<String, Integer> apply(SnomedRelationships input) { final Multimap<String, SnomedRelationship> relationshipsBySource = Multimaps.index(input, SnomedRelationship::getSourceId); final Multimap<String, Integer> groupsByRelationshipId = Multimaps.transformValues(relationshipsBySource, SnomedRelationship::getGroup); return ImmutableSetMultimap.copyOf(groupsByRelationshipId); } }); } return conceptsWithGroups; }
Source:
<code><START> private static <END> File getVersionFile(URL workspaceUrl, boolean create) { if (workspaceUrl == null) { return null; } try { File metaDir = new File(workspaceUrl.getPath(), METADATA_FOLDER); if (!metaDir.exists() && (!create || !metaDir.mkdir())) { return null; } File versionFile = new File(metaDir, VERSION_FILENAME); if (!versionFile.exists() && (!create || !versionFile.createNewFile())) { return null; } return versionFile; } catch (IOException e) { return null; } }</code><technical_language>this</technical_language>

Target:
protected static File getVersionFile(URL workspaceUrl, boolean create) { if (workspaceUrl == null) { return null; } try { File metaDir = new File(workspaceUrl.getPath(), METADATA_FOLDER); if (!metaDir.exists() && (!create || !metaDir.mkdir())) { return null; } File versionFile = new File(metaDir, VERSION_FILENAME); if (!versionFile.exists() && (!create || !versionFile.createNewFile())) { return null; } return versionFile; } catch (IOException e) { return null; } }
Source:
<code>private static Pair<File, Integer> findValueInXml(ResourceType type, String name, File file) { if (AdtPlugin.fileContains(file, name)) { String xml = AdtPlugin.readFile(file); if (xml == null) { return null; } <START> InputSource is = new InputSource(new StringReader(xml)); <END> try { OffsetTrackingParser parser = new OffsetTrackingParser(); parser.parse(is); Document document = parser.getDocument(); return findValueInDocument(type, name, file, parser, document); } catch (SAXException e) { } catch (IOException e) { } } return null; }</code><technical_language>IIRC want is create InputSource top of InputStream, xml parser character encoding is in XML file itself, decoded readFile is XML-aware</technical_language>

Target:
private static Pair<File, Integer> findValueInXml(ResourceType type, String name, File file) { if (AdtPlugin.fileContains(file, name)) { try { InputSource is = new InputSource(new FileInputStream(file)); OffsetTrackingParser parser = new OffsetTrackingParser(); parser.parse(is); Document document = parser.getDocument(); return findValueInDocument(type, name, file, parser, document); } catch (SAXException e) { } catch (IOException e) { } } return null; }
Source:
<code><START> boolean isLegacyTaskApplication() { <END> return ApplicationUtil.isLegacyTaskApplication(appDesc); }</code><technical_language>Minor: prefer proxy a util method this class. this done caller directly</technical_language>

Target:
boolean isLegacyTaskApplication() { return LegacyTaskApplication.class.isAssignableFrom(appDesc.getAppClass()); }
Source:
<code>public PoolDTO createPool(@PathParam("owner_key") @Verify(Owner.class) String ownerKey, @ApiParam(name = "pool", required = true) PoolDTO inputPoolDTO) { log.info("Creating custom pool for owner {}: {}" + ownerKey, inputPoolDTO); Pool pool = new Pool(); Owner owner = findOwnerByKey(ownerKey); pool.setOwner(owner); <START> this.populateEntityOnCreate(pool, inputPoolDTO); <END> pool = poolManager.createAndEnrichPools(pool); return this.translator.translate(pool, PoolDTO.class); }</code><technical_language>need separate methods for create/update this. Do in one, pull unique bits callers for rest</technical_language>

Target:
public PoolDTO createPool(@PathParam("owner_key") @Verify(Owner.class) String ownerKey, @ApiParam(name = "pool", required = true) PoolDTO inputPoolDTO) { log.info("Creating custom pool for owner {}: {}", ownerKey, inputPoolDTO); Pool pool = new Pool(); Owner owner = findOwnerByKey(ownerKey); pool.setOwner(owner); this.populateEntity(pool, inputPoolDTO); pool.setContractNumber(inputPoolDTO.getContractNumber()); pool.setOrderNumber(inputPoolDTO.getOrderNumber()); pool.setAccountNumber(inputPoolDTO.getAccountNumber()); pool.setUpstreamPoolId(inputPoolDTO.getUpstreamPoolId()); pool.setSubscriptionSubKey(inputPoolDTO.getSubscriptionSubKey()); pool.setSubscriptionId(inputPoolDTO.getSubscriptionId()); if (inputPoolDTO.getProductId() != null) { pool.setProduct(findProduct(pool.getOwner(), inputPoolDTO.getProductId())); } if (inputPoolDTO.getDerivedProductId() != null) { pool.setDerivedProduct(findProduct(pool.getOwner(), inputPoolDTO.getDerivedProductId())); } if (inputPoolDTO.getSourceEntitlement() != null) { pool.setSourceEntitlement(findEntitlement(inputPoolDTO.getSourceEntitlement().getId())); } pool = poolManager.createAndEnrichPools(pool); return this.translator.translate(pool, PoolDTO.class); }
Source:
<code>public GroupsAddedToContactGroupOfFacility(List<Integer> groupsId, ContactGroup contactGroup) { this.groupsId = groupsId; this.contactGroup = contactGroup; <START> this.message = formatMessage("Groups (%s) successfully added from contact groups %s.", groupsId, contactGroup); <END> }</code><technical_language>'contact group' 'contact groups'</technical_language>

Target:
public GroupsAddedToContactGroupOfFacility(List<Integer> groupsId, ContactGroup contactGroup) { this.groupsId = groupsId; this.contactGroup = contactGroup; this.message = formatMessage("Groups (%s) successfully added to contact group %s.", groupsId, contactGroup); }
Source:
<code>public void launchTask(ExecutorDriver driver, TaskInfo taskInfo) { currentTaskId = taskInfo.getTaskId(); driver.sendStatusUpdate(TaskStatus.newBuilder() .setTaskId(currentTaskId) .setState(TaskState.TASK_STARTING) .build()); CrateExecutableInfo crateTask = null; try { crateTask = CrateExecutableInfo.fromStream(taskInfo.getData().toByteArray()); } catch (IOException e) { <START> LOGGER.debug("Could not de-serialize TaskInfo", e); <END> e.printStackTrace(); } if (crateTask != null) { LOGGER.debug("Prepare crateTask: {}", crateTask); boolean prepared = prepare(driver, crateTask); if (prepared) { task = new Task(crateTask); startProcess(driver, task); driver.sendStatusUpdate(TaskStatus.newBuilder() .setTaskId(currentTaskId) .setState(TaskState.TASK_RUNNING) .build()); return; } } fail(driver); }</code><technical_language>debug level error</technical_language>

Target:
public void launchTask(ExecutorDriver driver, TaskInfo taskInfo) { currentTaskId = taskInfo.getTaskId(); driver.sendStatusUpdate(TaskStatus.newBuilder() .setTaskId(currentTaskId) .setState(TaskState.TASK_STARTING) .build()); CrateExecutableInfo crateTask = null; try { crateTask = CrateExecutableInfo.fromStream(taskInfo.getData().toByteArray()); } catch (IOException e) { LOGGER.error("Could not de-serialize TaskInfo", e); } if (crateTask != null) { LOGGER.debug("Prepare crateTask: {}", crateTask); boolean prepared = prepare(driver, crateTask); if (prepared) { task = new Task(crateTask); startProcess(driver, task); driver.sendStatusUpdate(TaskStatus.newBuilder() .setTaskId(currentTaskId) .setState(TaskState.TASK_RUNNING) .build()); return; } } fail(driver); }
Source:
<code>private void runTest(Configuration conf ) throws Exception { conf.set(EncryptionPropertiesFactory.CRYPTO_FACTORY_CLASS_PROPERTY_NAME, "org.apache.parquet.crypto.propertiesfactory.SchemaCryptoPropertiesFactory"); <START> String file = createTempFile("test"); <END> markEncryptColumns(); encryptParquetFile(file, conf); decryptParquetFileAndValid(file, conf); }</code><technical_language>target class is classpath I class object related conf setter method well</technical_language>

Target:
private void runTest(Configuration conf ) throws Exception { conf.set(EncryptionPropertiesFactory.CRYPTO_FACTORY_CLASS_PROPERTY_NAME, SchemaCryptoPropertiesFactory.class.getName()); String file = createTempFile("test"); markEncryptColumns(); encryptParquetFile(file, conf); decryptParquetFileAndValid(file, conf); }
Source:
<code>public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { final IndentingPrintWriter ipw = new IndentingPrintWriter(pw, " "); ipw.println("DeviceStateMonitor:"); ipw.increaseIndent(); ipw.println("mIsTetheringOn=" + mIsTetheringOn); ipw.println("mIsInteractive=" + mIsInteractive); ipw.println("mIsCharging=" + mIsCharging); ipw.println("mIsPowerSaveOn=" + mIsPowerSaveOn); ipw.println("mLegacyScreenState=" + mLegacyScreenState); ipw.println("mIsLowDataExpected=" + mIsLowDataExpected); ipw.println("mUnsolicitedResponseFilter=" + mUnsolicitedResponseFilter); ipw.println("++++++++++++++++++++++++++++++++"); ipw.println("Local logs:"); ipw.increaseIndent(); mLocalLog.dump(fd, ipw, args); ipw.decreaseIndent(); ipw.decreaseIndent(); <START> ipw.println("++++++++++++++++++++++++++++++++"); <END> ipw.flush(); }</code><technical_language>nit: 2 decreaseIndent()</technical_language>

Target:
public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { final IndentingPrintWriter ipw = new IndentingPrintWriter(pw, " "); ipw.println("DeviceStateMonitor:"); ipw.increaseIndent(); ipw.println("mIsTetheringOn=" + mIsTetheringOn); ipw.println("mIsInteractive=" + mIsInteractive); ipw.println("mIsCharging=" + mIsCharging); ipw.println("mIsPowerSaveOn=" + mIsPowerSaveOn); ipw.println("mLegacyScreenState=" + mLegacyScreenState); ipw.println("mIsLowDataExpected=" + mIsLowDataExpected); ipw.println("mUnsolicitedResponseFilter=" + mUnsolicitedResponseFilter); ipw.println("Local logs:"); ipw.increaseIndent(); mLocalLog.dump(fd, ipw, args); ipw.decreaseIndent(); ipw.decreaseIndent(); ipw.println("++++++++++++++++++++++++++++++++"); ipw.flush(); }
Source:
<code>PercentType getColorTemperature() { JsonElement colorX = attributes.get(COLOR_X); if (colorX != null) { double x = attributes.get(COLOR_X).getAsInt(); double value = 0.0; <START> if (x > X[1]) { <END> value = (x - X[0]) / (X[1] - X[0]) / 2.0; } else { value = (x - X[1]) / (X[2] - X[1]) / 2.0 + 0.5; } return new PercentType((int) Math.round(value * 100.0)); } else { return null; } }</code><technical_language>This method a clearer in is on, is x is X shadowing other. is case x > X[1] is meaning of 2.0 0.5</technical_language>

Target:
PercentType getColorTemperature() { JsonElement colorX = attributes.get(COLOR_X); if (colorX != null) { double x = attributes.get(COLOR_X).getAsInt(); double value = 0.0; if (x > X[1]) { value = (x - X[1]) / (X[2] - X[1]) / 2.0 + 0.5; } else { value = (x - X[0]) / (X[1] - X[0]) / 2.0; } return new PercentType((int) Math.round(value * 100.0)); } else { return null; } }
Source:
<code>public String getName() { <START> return "OPEN_TRANSACTION"; <END> }</code><technical_language>Task name changed REPL_TRANSACTION</technical_language>

Target:
public String getName() { return "REPL_TRANSACTION"; }
Source:
<code>protected void run(Date lastRun) { String responseJSON; try { HttpRequest request = HttpRequest.get("<LINK_0>"); responseJSON = request.body(); } catch (HttpRequest.HttpRequestException e) { <START> return; <END> } JSONObject meta; try { meta = new JSONObject(responseJSON); } catch (JSONException e) { throw new RuntimeException(e); } SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); if (prefs.contains(PREFERENCE_KEY_ALPHA_COMMIT)) { if (!prefs.getString(PREFERENCE_KEY_ALPHA_COMMIT, "").equals(meta.optString("commit_hash", ""))) { showNotification(); } } prefs.edit().putString(PREFERENCE_KEY_ALPHA_COMMIT, meta.optString("commit_hash")).apply(); }</code><technical_language>this catch block removed</technical_language>

Target:
protected void run(Date lastRun) { String responseJSON; try { HttpRequest request = HttpRequest.get("<LINK_0>"); responseJSON = request.body(); } catch (HttpRequest.HttpRequestException | SecurityException e) { return; } JSONObject meta; try { meta = new JSONObject(responseJSON); } catch (JSONException e) { throw new RuntimeException(e); } SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); if (prefs.contains(PREFERENCE_KEY_ALPHA_COMMIT)) { if (!prefs.getString(PREFERENCE_KEY_ALPHA_COMMIT, "").equals(meta.optString("commit_hash", ""))) { showNotification(); } } prefs.edit().putString(PREFERENCE_KEY_ALPHA_COMMIT, meta.optString("commit_hash")).apply(); }
Source:
<code>public static String getMessage(AuditLogType logType) { final String result = getMessageOrNull(logType); <START> return result == null ? "" : result; <END> }</code><technical_language>please replace this line with: return StringUtils.defaultString(result); lines with: return StringUtils.defaultString(getMessageOrNull(logType));</technical_language>

Target:
public static String getMessage(AuditLogType logType) { return StringUtils.defaultString(getMessageOrNull(logType)); }
Source:
<code>protected void updateData(long start, long end, int nb, IProgressMonitor monitor) { if (fModule == null) { return; } ITmfStateSystem ss = fModule.getStateSystem(); if (ss == null) { return; } double[] xAxis = getXAxis(start, end, nb); if (xAxis.length == <START> 1) { <END> return; } setXAxis(xAxis); for (Integer quark : fQuarks) { try { double[] steps = new double[xAxis.length]; ITmfStateValue prev = ss.querySingleState(Math.max(ss.getStartTime(), (long) (start - (xAxis[1]))), quark).getStateValue(); for (int i = 0; i < xAxis.length; i++) { ITmfStateValue next = ss.querySingleState(start + (long) xAxis[i] - 1, quark).getStateValue(); long stateValue = prev.isNull() ? next.unboxLong() : next.unboxLong() - prev.unboxLong(); steps[i] = next.isNull() ? 0 : stateValue; prev = next; } setSeries(createSeriesName(ss, quark), steps); } catch (StateSystemDisposedException e) { } } updateDisplay(); }</code><technical_language>1 OK 0 in this case? if want iteration start 1</technical_language>

Target:
protected void updateData(long start, long end, int nb, IProgressMonitor monitor) { if (fModule == null) { return; } ITmfStateSystem ss = fModule.getStateSystem(); if (ss == null) { return; } double[] xAxis = getXAxis(start, end, nb); if (xAxis.length == 1) { return; } setXAxis(xAxis); for (Integer quark : fQuarks) { try { double[] steps = new double[xAxis.length]; Object prev = ss.querySingleState(Math.max(ss.getStartTime(), (long) (start - (xAxis[1]))), quark).getValue(); for (int i = 0; i < xAxis.length; i++) { Object next = ss.querySingleState(start + (long) xAxis[i] - 1, quark).getValue(); long prevValue = prev instanceof Long ? (long) prev : 0; long nextValue = next instanceof Long ? (long) next : 0; long stateValue = (prev == null) ? nextValue : nextValue - prevValue; steps[i] = (next == null) ? 0 : stateValue; prev = next; } setSeries(ss.getFullAttributePath(quark), steps); } catch (StateSystemDisposedException e) { return; } } updateDisplay(); }
Source:
<code>public void deserialize(TBase base, byte[] bytes, int offset, int len) throws TException { <START> TMemoryInputTransport trans = new TMemoryInputTransport(); <END> TBinaryProtocol protocol = new ThriftBinaryProtocol(trans, bytes.length, bytes.length); resetAndInitialize(protocol, len); trans.reset(bytes, offset, len); base.read(protocol); }</code><technical_language>re-using a performance impact -- is reusing them</technical_language>

Target:
public void deserialize(TBase base, byte[] bytes, int offset, int len) throws TException { if (len > lengthLimit) { lengthLimit = len + Double.valueOf(0.1 * len).longValue(); protocol = new ThriftBinaryProtocol(trans, lengthLimit, lengthLimit); } resetAndInitialize(protocol, len); trans.reset(bytes, offset, len); base.read(protocol); }
Source:
<code><START> public void shiftColumns(int startColumn, int endColumn, int n){ <END> FormulaShifter shifter = FormulaShifter.createForItemShift(this, false, startColumn, endColumn, n); HSSFColumnShifter columnShifter = new HSSFColumnShifter(this, shifter); columnShifter.shiftColumns(startColumn, endColumn, n); shiftFormulas(startColumn, endColumn, n, false); }</code><technical_language>fix inconsistent whitespace</technical_language>

Target:
public void shiftColumns(int startColumn, int endColumn, int n){ HSSFColumnShifter columnShifter = new HSSFColumnShifter(this); columnShifter.shiftColumns(startColumn, endColumn, n); int sheetIndex = _workbook.getSheetIndex(this); short externSheetIndex = _book.checkExternSheet(sheetIndex); String sheetName = _workbook.getSheetName(sheetIndex); FormulaShifter formulaShifter = FormulaShifter.createForColumnShift( externSheetIndex, sheetName, startColumn, endColumn, n, SpreadsheetVersion.EXCEL97); updateFormulasForShift(formulaShifter); }
Source:
<code>public CompletableFuture<DetectorResponseDTO> execute( DetectorRequestDTO request) { String serviceName = request.getServiceName(); String address = request.getAddress(); List<String> properties = request.getProperties(); Map<String, String> attributes = parse(properties); ServiceDetector detector = serviceDetectorRegistry.getDetectorByServiceName(serviceName, attributes); InetAddress ipAddress = null; try { ipAddress = InetAddress.getByName(address); } catch (UnknownHostException e1) { <START> e1.printStackTrace(); <END> } boolean isServiceDetected = false; System.out.println("Trying to get detector with service name: " + serviceName + " at " + ipAddress.toString()); final CompletableFuture<Boolean> future = detectService(detector, ipAddress); while (true) { try { isServiceDetected = future.get(1, TimeUnit.SECONDS); System.out.printf("\nThe '%s' service %s detected on %s\n", serviceName, isServiceDetected ? "WAS" : "WAS NOT", address); break; } catch (TimeoutException | InterruptedException | ExecutionException e) { future.completeExceptionally(e); } System.out.print("."); System.out.flush(); } DetectorResponseDTO response = new DetectorResponseDTO(); response.setDetected(isServiceDetected); final CompletableFuture<DetectorResponseDTO> output = new CompletableFuture<DetectorResponseDTO>(); output.complete(response); return output; }</code><technical_language>return a CompletableFuture pass exception completeExceptionally() in this case</technical_language>

Target:
public CompletableFuture<DetectorResponseDTO> execute( DetectorRequestDTO request) { String serviceName = request.getServiceName(); String address = request.getAddress(); Map<String, String> attributes = request.getAttributes(); ServiceDetector detector = serviceDetectorRegistry.getDetectorByServiceName(serviceName, attributes); DetectorHandler detectorHandler = new DetectorHandler(); final CompletableFuture<DetectorResponseDTO> output = detectorHandler.execute(detector, address); return output; }
Source:
<code><START> public ChoreService getChoreService() { <END> return this.choreService; }</code><technical_language>this private package private</technical_language>

Target:
synchronized ChoreService getChoreService() { if (choreService == null) { choreService = new ChoreService("AsyncConn Chore Service"); } return choreService; }
Source:
<code>public Config<T> withStrictProjectionString(String p) { <START> return new Config<T>(this.klass, this.filterPredicate, this.deprecatedProjectionString, Objects.requireNonNull(p, "projectionString")); <END> }</code><technical_language>suggestion return new Config<T>(this.klass, this.filterPredicate, this.deprecatedProjectionString, Objects.requireNonNull(p, "projectionString null"));</technical_language>

Target:
public Config<T> withStrictProjectionString(String p) { return new Config<T>(this.klass, this.filterPredicate, this.deprecatedProjectionString, Objects.requireNonNull(p, "projectionString cannot be null")); }
Source:
<code>private void rememberBestCost(CostEstimate currentCost,int planType) throws StandardException{ foundABestPlan=true; OptimizerTrace tracer = tracer(); if(optimizerTrace){ tracer.trace(OptimizerFlag.CHEAPEST_PLAN_SO_FAR,0,0,0.0); tracer.trace(OptimizerFlag.PLAN_TYPE,planType,0,0.0); tracer.trace(OptimizerFlag.COST_OF_CHEAPEST_PLAN_SO_FAR,0,0,0.0); } bestCost.setCost(currentCost); if((bestCost.getEstimatedCost()/NANOS_TO_MILLIS)<timeLimit) { timeLimit=bestCost.getEstimatedCost()/NANOS_TO_MILLIS; <START> if (timeLimit < 2000 && isPreparedStatement()) <END> timeLimit = 2000; } bestJoinOrderUsedPredsFromAbove=usingPredsPushedFromAbove; System.arraycopy(proposedJoinOrder,0,bestJoinOrder,0,numOptimizables); for(int i=0;i<numOptimizables;i++){ optimizableList.getOptimizable(bestJoinOrder[i]). rememberAsBest(planType,this); } if(requiredRowOrdering!=null){ if(planType==Optimizer.SORT_AVOIDANCE_PLAN) requiredRowOrdering.sortNotNeeded(); else requiredRowOrdering.sortNeeded(); } if(optimizerTrace){ if(requiredRowOrdering!=null){ tracer.trace(OptimizerFlag.SORT_NEEDED_FOR_ORDERING,planType,0,0.0); } tracer.trace(OptimizerFlag.REMEMBERING_BEST_JOIN_ORDER,0,0,0.0); } }</code><technical_language>Nitpick, a static constant instead of a hardcoded number</technical_language>

Target:
private void rememberBestCost(CostEstimate currentCost,int planType) throws StandardException{ foundABestPlan=true; OptimizerTrace tracer = tracer(); if(optimizerTrace){ tracer.trace(OptimizerFlag.CHEAPEST_PLAN_SO_FAR,0,0,0.0); tracer.trace(OptimizerFlag.PLAN_TYPE,planType,0,0.0); tracer.trace(OptimizerFlag.COST_OF_CHEAPEST_PLAN_SO_FAR,0,0,0.0); } bestCost.setCost(currentCost); if((bestCost.getEstimatedCost()/NANOS_TO_MILLIS)<timeLimit) { timeLimit=bestCost.getEstimatedCost()/NANOS_TO_MILLIS; if (timeLimit < PREPARED_STATEMENT_TIME_LIMIT_LOWER_BOUND && isPreparedStatement()) timeLimit = PREPARED_STATEMENT_TIME_LIMIT_LOWER_BOUND; } bestJoinOrderUsedPredsFromAbove=usingPredsPushedFromAbove; System.arraycopy(proposedJoinOrder,0,bestJoinOrder,0,numOptimizables); for(int i=0;i<numOptimizables;i++){ optimizableList.getOptimizable(bestJoinOrder[i]). rememberAsBest(planType,this); } if(requiredRowOrdering!=null){ if(planType==Optimizer.SORT_AVOIDANCE_PLAN) requiredRowOrdering.sortNotNeeded(); else requiredRowOrdering.sortNeeded(); } if(optimizerTrace){ if(requiredRowOrdering!=null){ tracer.trace(OptimizerFlag.SORT_NEEDED_FOR_ORDERING,planType,0,0.0); } tracer.trace(OptimizerFlag.REMEMBERING_BEST_JOIN_ORDER,0,0,0.0); } }
Source:
<code>public void setup() throws InjectionException { final Configuration layerConf = Tang.Factory.getTang().newConfigurationBuilder() .bindNamedParameter(LayerIndex.class, String.valueOf(0)) .bindNamedParameter(LayerInputShape.class, "4,2") .build(); final DropoutLayerConfigurationBuilder builder = DropoutLayerConfigurationBuilder <START> .newConfigurationBuilder() <END> .setDropoutRatio(0.5f); final Injector injector = Tang.Factory.getTang().newInjector(MATRIX_CONF); this.dropoutLayer = injector.forkInjector(layerConf, builder.build()) .getInstance(LayerBase.class); }</code><technical_language>discussed offline, please revert this change in DropoutLayerTest</technical_language>

Target:
public void setup() throws InjectionException { final Configuration layerConf = Tang.Factory.getTang().newConfigurationBuilder() .bindNamedParameter(LayerIndex.class, String.valueOf(0)) .bindNamedParameter(LayerInputShape.class, "4,2") .build(); final DropoutLayerConfigurationBuilder builder = DropoutLayerConfigurationBuilder .newConfigurationBuilder() .setDropoutRatio(0.5f); final Injector injector = Tang.Factory.getTang().newInjector(MATRIX_CONF); final MatrixFactory matrixFactoryForLayer = injector.getInstance(MatrixFactory.class); matrixFactoryForLayer.setRandomSeed(10); this.dropoutLayer = injector.forkInjector(layerConf, builder.build()) .getInstance(LayerBase.class); }
Source:
<code>public static void main(String[] args) { <START> ServiceDiscoveryService sd = serviceDiscovery(); <END> Chapter service = sd.findAny(); Saga goodOrderSaga = service.execute(newSaga("good_order")); Saga badOrderSaga = service.execute(newSaga("bad_order")); logger.info("orders: goodOrder is {}, badOrder is {}", goodOrderSaga.getResult(), badOrderSaga.getResult()); }</code><technical_language>Note in Java 11 local variable type inference var for local variables. Please check this code</technical_language>

Target:
public static void main(String[] args) { ServiceDiscoveryService sd = serviceDiscovery(); ChoreographyChapter service = sd.findAny(); Saga goodOrderSaga = service.execute(newSaga("good_order")); Saga badOrderSaga = service.execute(newSaga("bad_order")); LOGGER.info("orders: goodOrder is {}, badOrder is {}", goodOrderSaga.getResult(), badOrderSaga.getResult()); }
Source:
<code>public void testGetTempaltesForStorageDomain() { dao = dbFacade.getUnregisteredOVFDataDao(); List<OvfEntityData> ovfEntityDataList = <START> dao.getAllForStorageDomain(FixturesTool.STORAGE_DOAMIN_NFS2_1, "Template"); <END> assertTrue("a Tempalte should not be fetched for the specified storage domain", ovfEntityDataList.isEmpty()); }</code><technical_language>please appropiate constant instead of "Template"</technical_language>

Target:
public void testGetTempaltesForStorageDomain() { dao = dbFacade.getUnregisteredOVFDataDao(); List<OvfEntityData> ovfEntityDataList = dao.getAllForStorageDomainByEntityType(FixturesTool.STORAGE_DOAMIN_NFS2_1, "Template"); assertTrue("A Tempalte should not be fetched for the specified storage domain", ovfEntityDataList.isEmpty()); }
Source:
<code><START> public synchronized PhysicalPlan get() { <END> TopologyMaster.TMasterLocation tMasterLocation = stateManagerAdaptor.getTMasterLocation(topologyName); String host = tMasterLocation.getHost(); int port = tMasterLocation.getControllerPort(); String url = "http://" + host + ":" + port + "/get_current_physical_plan"; LOG.fine("tmaster physical plan query endpoint: " + url); HttpURLConnection con = NetworkUtils.getHttpConnection(url); NetworkUtils.sendHttpGetRequest(con); byte[] responseData = NetworkUtils.readHttpResponse(con); String encodedString = new String(responseData); LOG.fine("tmaster returns physical plan in base64 str: " + encodedString); byte[] decodedBytes = Base64.getDecoder().decode(encodedString); PhysicalPlan physicalPlan = null; try { physicalPlan = PhysicalPlan.parseFrom(decodedBytes); } catch (Exception e) { throw new InvalidStateException(topologyName, "Failed to fetch the physical plan"); } cachedPhysicalPlan = physicalPlan; return physicalPlan; }</code><technical_language>rename getPhysicalPlan is easier understand</technical_language>

Target:
public synchronized PhysicalPlan get() { TopologyMaster.TMasterLocation tMasterLocation = stateManagerAdaptor.getTMasterLocation(topologyName); String host = tMasterLocation.getHost(); int port = tMasterLocation.getControllerPort(); String url = "http://" + host + ":" + port + "/get_current_physical_plan"; LOG.fine("tmaster physical plan query endpoint: " + url); HttpURLConnection con = NetworkUtils.getHttpConnection(url); NetworkUtils.sendHttpGetRequest(con); byte[] responseData = NetworkUtils.readHttpResponse(con); physicalPlan = ParseResponseToPhysicalPlan(responseData); return physicalPlan; }
Source:
<code>public RelOptCost computeSelfCost(final RelOptPlanner planner, final RelMetadataQuery mq) { double cost = partialQuery.estimateCost(); if (joinRel.getCondition().isA(SqlKind.LITERAL) && !joinRel.getCondition().isAlwaysFalse()) { cost += CostEstimates.COST_JOIN_CROSS; } double multiplier = DruidRels.isScanOrMapping(this, true) ? 1 <START> : 1 / CostEstimates.MULTIPLIER_FILTER; <END> return planner.getCostFactory().makeCost(cost, 0, 0).multiplyBy(multiplier); }</code><technical_language>this if is filter. Is right</technical_language>

Target:
public RelOptCost computeSelfCost(final RelOptPlanner planner, final RelMetadataQuery mq) { double cost; if (computeLeftRequiresSubquery(getSomeDruidChild(left))) { cost = CostEstimates.COST_JOIN_SUBQUERY; } else { cost = partialQuery.estimateCost(); } if (computeRightRequiresSubquery(getSomeDruidChild(right))) { cost += CostEstimates.COST_JOIN_SUBQUERY; } if (joinRel.getCondition().isA(SqlKind.LITERAL) && !joinRel.getCondition().isAlwaysFalse()) { cost += CostEstimates.COST_JOIN_CROSS; } return planner.getCostFactory().makeCost(cost, 0, 0); }
Source:
<code>public boolean equals(Object o) { if (o instanceof HashSet) { final HashSet<?> that = (HashSet<?>) o; return this.tree.equals(that.tree); } else { return super.equals(o); <START> } <END> }</code><technical_language>implementation this: java @Override public boolean equals(Object o) { return Sets.equals(this, o); }</technical_language>

Target:
public boolean equals(Object o) { return Sets.equals(this, o); }
Source:
<code>public VersionInfo(Class<?> classInJar, String groupId, String artifactId, String gitPropertiesResource) { try { URL res = VersionInfo.class.getResource(VersionInfo.class.getSimpleName() + ".class"); URLConnection conn = res.openConnection(); if (conn instanceof JarURLConnection) { Manifest mf = ((JarURLConnection) conn).getManifest(); Attributes mainAttribs = mf.getMainAttributes(); String builtBy = mainAttribs.getValue("Built-By"); if(builtBy != null) { this.user = builtBy; } } Enumeration<URL> resources = VersionInfo.class.getClassLoader().getResources("META-INF/maven/" + groupId + "/" + artifactId + "/pom.properties"); while (resources.hasMoreElements()) { Properties pomInfo = new Properties(); pomInfo.load(resources.nextElement().openStream()); String v = pomInfo.getProperty("version", "unknown"); this.version = v; } <START> resources = VersionInfo.class.getClassLoader().getResources("dt-git.properties"); <END> while (resources.hasMoreElements()) { Properties gitInfo = new Properties(); gitInfo.load(resources.nextElement().openStream()); String commitAbbrev = gitInfo.getProperty("git.commit.id.abbrev", "unknown"); String branch = gitInfo.getProperty("git.branch", "unknown"); this.revision = "rev: " + commitAbbrev + " branch: " + branch; this.date = gitInfo.getProperty("git.build.time", this.date); this.user = gitInfo.getProperty("git.build.user.name", this.user); break; } } catch (IOException e) { org.slf4j.LoggerFactory.getLogger(VersionInfo.class).error("Failed to read version info", e); } }</code><technical_language>parametrize this dt-git.properties also</technical_language>

Target:
public VersionInfo(Class<?> classInJar, String groupId, String artifactId, String gitPropertiesResource) { try { URL res = classInJar.getResource(classInJar.getSimpleName() + ".class"); URLConnection conn = res.openConnection(); if (conn instanceof JarURLConnection) { Manifest mf = ((JarURLConnection) conn).getManifest(); Attributes mainAttribs = mf.getMainAttributes(); String builtBy = mainAttribs.getValue("Built-By"); if(builtBy != null) { this.user = builtBy; } } Enumeration<URL> resources = classInJar.getClassLoader().getResources("META-INF/maven/" + groupId + "/" + artifactId + "/pom.properties"); while (resources.hasMoreElements()) { Properties pomInfo = new Properties(); pomInfo.load(resources.nextElement().openStream()); String v = pomInfo.getProperty("version", "unknown"); this.version = v; } resources = VersionInfo.class.getClassLoader().getResources(gitPropertiesResource); while (resources.hasMoreElements()) { Properties gitInfo = new Properties(); gitInfo.load(resources.nextElement().openStream()); String commitAbbrev = gitInfo.getProperty("git.commit.id.abbrev", "unknown"); String branch = gitInfo.getProperty("git.branch", "unknown"); this.revision = "rev: " + commitAbbrev + " branch: " + branch; this.date = gitInfo.getProperty("git.build.time", this.date); this.user = gitInfo.getProperty("git.build.user.name", this.user); break; } } catch (IOException e) { org.slf4j.LoggerFactory.getLogger(VersionInfo.class).error("Failed to read version info", e); } }
Source:
<code><START> private void updateDatasetInCollection(Collection collection, String datasetID, HttpServletRequest request, String user) throws ZebedeeException, IOException, DatasetAPIException { <END> logInfo("PUT called on /collections/{}/datasets/{} endpoint") .addParameter("collectionID", collection.getId()) .addParameter("datasetID", datasetID) .log(); try (InputStream body = request.getInputStream()) { CollectionDataset dataset = ContentUtil.deserialise(body, CollectionDataset.class); datasetService.updateDatasetInCollection(collection, datasetID, dataset, user); } catch (JsonSyntaxException ex) { throw new BadRequestException(ex.getMessage()); } }</code><technical_language>add user logParameters please (there is a .user(String email) log builder need do addParameter. do this in places added new field (all places logging something)</technical_language>

Target:
private void updateDatasetInCollection(Collection collection, String datasetID, HttpServletRequest request, String user) throws ZebedeeException, IOException, DatasetAPIException { logInfo("PUT called on /collections/{}/datasets/{} endpoint") .addParameter("collectionID", collection.getId()) .addParameter("datasetID", datasetID) .user(user) .log(); try (InputStream body = request.getInputStream()) { CollectionDataset dataset = ContentUtil.deserialise(body, CollectionDataset.class); datasetService.updateDatasetInCollection(collection, datasetID, dataset, user); } catch (JsonSyntaxException ex) { throw new BadRequestException(ex.getMessage()); } }
Source:
<code>testResolvingServersWhenThereIsNoTheCorrespondingServiceAndIngressForTheSpecifiedMachine() { Service nonMatchedByPodService = createService("nonMatched", "foreignMachine", CONTAINER_PORT, null); Ingress ingress = createIngress( "nonMatched", "foreignMachine", Pair.of("http-server", new ServerConfigImpl("3054", "http", "/api", ATTRIBUTES_MAP))); KubernetesServerResolver serverResolver = new KubernetesServerResolver( <START> new NoopPathDemangler(), singletonList(nonMatchedByPodService), singletonList(ingress)); <END> Map<String, ServerImpl> resolved = serverResolver.resolve("machine"); assertTrue(resolved.isEmpty()); }</code><technical_language>tests for PathDemangler</technical_language>

Target:
testResolvingServersWhenThereIsNoTheCorrespondingServiceAndIngressForTheSpecifiedMachine() { Service nonMatchedByPodService = createService("nonMatched", "foreignMachine", CONTAINER_PORT, null); Ingress ingress = createIngress( "nonMatched", "foreignMachine", Pair.of("http-server", new ServerConfigImpl("3054", "http", "/api", ATTRIBUTES_MAP))); KubernetesServerResolver serverResolver = new KubernetesServerResolver( new NoopPathTransformInverter(), singletonList(nonMatchedByPodService), singletonList(ingress)); Map<String, ServerImpl> resolved = serverResolver.resolve("machine"); assertTrue(resolved.isEmpty()); }
Source:
<code>private InfinispanRequest(FullHttpRequest request, ChannelHandlerContext ctx) { this.request = request; queryStringDecoder = new QueryStringDecoder(request.uri()); streamId = Optional.ofNullable(request.headers().get(HttpConversionUtil.ExtensionHeaderNames.STREAM_ID.text())); this.nettyChannelContext = ctx; <START> String[] pathParams = queryStringDecoder.path().split("/"); <END> switch (pathParams.length) { case 4: context = pathParams[1]; cacheName = Optional.of(pathParams[2]); key = Optional.of(pathParams[3]); break; case 3: context = pathParams[1]; cacheName = Optional.of(pathParams[2]); key = Optional.empty(); break; case 2: context = pathParams[1]; cacheName = Optional.empty(); key = Optional.empty(); break; default: throw new IllegalArgumentException("Wrong number of Path Parameters"); } }</code><technical_language>optimization: do split, iterate string collect parts go</technical_language>

Target:
private InfinispanRequest(FullHttpRequest request, ChannelHandlerContext ctx) { this.request = request; queryStringDecoder = new QueryStringDecoder(request.uri()); streamId = Optional.ofNullable(request.headers().get(HttpConversionUtil.ExtensionHeaderNames.STREAM_ID.text())); this.nettyChannelContext = ctx; StringTokenizer pathTokenizer = new StringTokenizer(queryStringDecoder.path(), "/"); context = pathTokenizer.nextToken(); if (pathTokenizer.hasMoreTokens()) { cacheName = Optional.of(pathTokenizer.nextToken()); } else { cacheName = Optional.empty(); } if (pathTokenizer.hasMoreTokens()) { key = Optional.of(pathTokenizer.nextToken()); } else { key = Optional.empty(); } }
Source:
<code>public static List<Person> getPeople(int localTableBlogId) { List<Person> people = new ArrayList<>(); String[] args = { Integer.toString(localTableBlogId) }; Cursor c = getReadableDb().rawQuery("SELECT * FROM " + PEOPLE_TABLE + <START> " WHERE local_blog_id=? ORDER BY display_name, user_name", args); <END> try { while (c.moveToNext()) { Person person = getPersonFromCursor(c, localTableBlogId); people.add(person); } return people; } finally { SqlUtils.closeCursor(c); } }</code><technical_language>This case-sensitive sorting, "Nick Bradbury" "nick bradbury" next other in people list. I this case-insensitive web</technical_language>

Target:
public static List<Person> getPeople(int localTableBlogId) { List<Person> people = new ArrayList<>(); String[] args = { Integer.toString(localTableBlogId) }; Cursor c = getReadableDb().rawQuery("SELECT * FROM " + PEOPLE_TABLE + " WHERE local_blog_id=? ORDER BY lower(display_name), lower(user_name)", args); try { while (c.moveToNext()) { Person person = getPersonFromCursor(c, localTableBlogId); people.add(person); } return people; } finally { SqlUtils.closeCursor(c); } }
Source:
<code>static void loadExternalLinksFromExtensionElements(final org.kie.dmn.model.api.DRGElement source, final org.kie.workbench.common.dmn.api.definition.v1_1.DRGElement target) { if (!Objects.isNull(source.getExtensionElements())) { <START> for (final org.kie.dmn.model.api.DMNExternalLink el : source.getExtensionElements().getExternalLinks()) { <END> final DMNExternalLink external = new DMNExternalLink(); external.setDescription(el.getLinkDescription()); external.setUrl(el.getURL()); target.getLinksHolder().getValue().addLink(external); } } }</code><technical_language>get rid of outer if if replace source.getExtensionElements() getOrCreateExtensionElements(source). bringing discussion. If is is I fine</technical_language>

Target:
static void loadExternalLinksFromExtensionElements(final org.kie.dmn.model.api.DRGElement source, final org.kie.workbench.common.dmn.api.definition.v1_1.DRGElement target) { if (!Objects.isNull(source.getExtensionElements())) { for (final Object obj : source.getExtensionElements().getAny()) { if (obj instanceof ExternalLink) { final ExternalLink el = (ExternalLink) obj; final DMNExternalLink external = new DMNExternalLink(); external.setDescription(el.getName()); external.setUrl(el.getUrl()); target.getLinksHolder().getValue().addLink(external); } } } }
Source:
<code>public MemoryDataFragment( @JsonProperty("hostAddress") HostAddress hostAddress, @JsonProperty("rows") long rows) { this.hostAddress = requireNonNull(hostAddress, "hostAddress is null"); this.rows = rows; <START> } <END></code><technical_language>checkArgument rows is positive? Want if implements deletes deal that</technical_language>

Target:
public MemoryDataFragment( @JsonProperty("hostAddress") HostAddress hostAddress, @JsonProperty("rows") long rows) { this.hostAddress = requireNonNull(hostAddress, "hostAddress is null"); checkArgument(rows >= 0, "Rows number can not be negative"); this.rows = rows; }
Source:
<code>private static String <START> getUrl(Class<?> idc, <END> ImageDescriptor imageDescriptor) { try { if (urlField == null) { urlField = idc.getDeclaredField("url"); urlField.setAccessible(true); } return (String) urlField.get(imageDescriptor); } catch (SecurityException | NoSuchFieldException | IllegalArgumentException | IllegalAccessException e) { e.printStackTrace(); } return null; }</code><technical_language>I is this ImageDescriptor class, "?"</technical_language>

Target:
private static String getUrl(Class<?> idc, ImageDescriptor imageDescriptor) { try { if (urlField == null) { urlField = idc.getDeclaredField("url"); urlField.setAccessible(true); } Object value = urlField.get(imageDescriptor); if (value instanceof URL) { return ((URL) value).toExternalForm(); } return value.toString(); } catch (SecurityException | NoSuchFieldException | IllegalArgumentException | IllegalAccessException e) { e.printStackTrace(); } return null; }