auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static Schema getSchema(Object object) throws IllegalArgumentException { if (object == null) { return PRIMITIVE_SCHEMAS.get("Null"); <START> } else if (object instanceof Boolean) { <END> return PRIMITIVE_SCHEMAS.get("Boolean"); } else if (object instanceof Integer) { return PRIMITIVE_SCHEMAS.get("Integer"); } else if (object instanceof Long) { return PRIMITIVE_SCHEMAS.get("Long"); } else if (object instanceof Float) { return PRIMITIVE_SCHEMAS.get("Float"); } else if (object instanceof Double) { return PRIMITIVE_SCHEMAS.get("Double"); } else if (object instanceof CharSequence) { return PRIMITIVE_SCHEMAS.get("String"); } else if (object instanceof byte[]) { return PRIMITIVE_SCHEMAS.get("Bytes"); } else if (object instanceof GenericContainer) { return ((GenericContainer) object).getSchema(); } else { ClientLogger logger = new ClientLogger(AvroSchemaUtils.class); throw logger.logExceptionAsError( new IllegalArgumentException( "Unsupported Avro type. Supported types are null, Boolean, Integer, Long, " + "Float, Double, String, byte[] and IndexedRecord")); } }</code><technical_language>checking object primitive representations here? boolean Boolean, int Integer, etc</technical_language>

Target:
public static Schema getSchema(Object object) throws IllegalArgumentException { if (object == null) { return PRIMITIVE_SCHEMAS.get("Null"); } else if (object instanceof Boolean) { return PRIMITIVE_SCHEMAS.get("Boolean"); } else if (object instanceof Integer) { return PRIMITIVE_SCHEMAS.get("Integer"); } else if (object instanceof Long) { return PRIMITIVE_SCHEMAS.get("Long"); } else if (object instanceof Float) { return PRIMITIVE_SCHEMAS.get("Float"); } else if (object instanceof Double) { return PRIMITIVE_SCHEMAS.get("Double"); } else if (object instanceof CharSequence) { return PRIMITIVE_SCHEMAS.get("String"); } else if (object instanceof byte[] || object instanceof ByteBuffer) { return PRIMITIVE_SCHEMAS.get("Bytes"); } else if (object instanceof GenericContainer) { return ((GenericContainer) object).getSchema(); } else { ClientLogger logger = new ClientLogger(AvroSchemaUtils.class); throw logger.logExceptionAsError( new IllegalArgumentException( "Unsupported Avro type. Supported types are null, Boolean, Integer, Long, " + "Float, Double, String, byte[] and IndexedRecord")); } }
Source:
<code>private void resolveConfigurations(Rule rule) { List<ConfigDescriptionParameter> configDescriptions = rule.getConfigurationDescriptions(); Configuration configuration = rule.getConfiguration(); ConfigurationNormalizer.normalizeConfiguration(configuration, ConfigurationNormalizer.getConfigDescriptionMap(configDescriptions)); Map<String, Object> configurationProperties = configuration.getProperties(); if (rule.getTemplateUID() == null) { String uid = rule.getUID(); try { validateConfiguration(configDescriptions, new HashMap<>(configurationProperties)); resolveModuleConfigReferences(rule.getModules(Module.class), configurationProperties); ConfigurationNormalizer.normalizeModuleConfigurations(rule.getModules(Module.class), moduleTypeRegistry); <START> } catch (Exception e) { <END> RuleStatusInfo statusInfo = disabledRulesStorage != null && disabledRulesStorage.get(uid) == null ? new RuleStatusInfo(RuleStatus.UNINITIALIZED, RuleStatusDetail.CONFIGURATION_ERROR, e.getLocalizedMessage()) : new RuleStatusInfo(RuleStatus.DISABLED, RuleStatusDetail.CONFIGURATION_ERROR, e.getLocalizedMessage()); addToRuleEngine(rule, statusInfo); throw new IllegalArgumentException(String.format("The rule '%s' has incorrect configurations", uid), e); } } }</code><technical_language>catch generic Exceptions. this more specific</technical_language>

Target:
private void resolveConfigurations(Rule rule) { List<ConfigDescriptionParameter> configDescriptions = rule.getConfigurationDescriptions(); Configuration configuration = rule.getConfiguration(); ConfigurationNormalizer.normalizeConfiguration(configuration, ConfigurationNormalizer.getConfigDescriptionMap(configDescriptions)); Map<String, Object> configurationProperties = configuration.getProperties(); if (rule.getTemplateUID() == null) { String uid = rule.getUID(); try { validateConfiguration(configDescriptions, new HashMap<>(configurationProperties)); resolveModuleConfigReferences(rule.getModules(), configurationProperties); ConfigurationNormalizer.normalizeModuleConfigurations(rule.getModules(), moduleTypeRegistry); } catch (IllegalArgumentException e) { throw new IllegalArgumentException(String.format("The rule '%s' has incorrect configurations", uid), e); } } }
Source:
<code>public void getTaskData(Set<String> taskIds, TaskRepository taskRepository, TaskDataCollector collector, IOperationMonitor monitor) throws BugzillaRestException { BugzillaRestConfiguration config; try { config = connector.getRepositoryConfiguration(taskRepository); } catch (CoreException e1) { throw new BugzillaRestException(e1); } Iterable<String> taskIdsTemp = Iterables.transform(taskIds, function); Iterable<List<String>> partitions = Iterables.partition(taskIdsTemp, MAX_RETRIEVED_PER_QUERY); for (List<String> list : partitions) { Joiner joiner = Joiner.on(",id=").skipNulls(); String urlIDList = "id=" + joiner.join(list); try { List<TaskData> taskDataArray = new BugzillaRestGetTaskData(client, connector, urlIDList, taskRepository) .run(monitor); for (TaskData taskData : taskDataArray) { config.updateProductOptions(taskData); config.addValidOperations(taskData); collector.accept(taskData); } } catch (BugzillaRestException e) { throw e; <START> } catch (Exception e) { <END> throw new BugzillaRestException(e); } } }</code><technical_language>other exceptions do expect here? Catching Exception is a good idea</technical_language>

Target:
public void getTaskData(Set<String> taskIds, TaskRepository taskRepository, TaskDataCollector collector, IOperationMonitor monitor) throws BugzillaRestException { BugzillaRestConfiguration config; try { config = connector.getRepositoryConfiguration(taskRepository); } catch (CoreException e1) { throw new BugzillaRestException(e1); } Iterable<String> taskIdsTemp = Iterables.transform(taskIds, function); Iterable<List<String>> partitions = Iterables.partition(taskIdsTemp, MAX_RETRIEVED_PER_QUERY); for (List<String> list : partitions) { Joiner joiner = Joiner.on(",id=").skipNulls(); String urlIDList = "id=" + joiner.join(list); try { List<TaskData> taskDataArray = new BugzillaRestGetTaskData(client, connector, urlIDList, taskRepository) .run(monitor); for (TaskData taskData : taskDataArray) { config.updateProductOptions(taskData); config.addValidOperations(taskData); collector.accept(taskData); } } catch (BugzillaRestException e) { throw e; } catch (RuntimeException e) { Throwable cause = e.getCause(); if (cause instanceof CoreException) { throw new BugzillaRestException(cause); } throw e; } } }
Source:
<code>public static List<MetricType> userTypes() { <START> return Arrays.asList(Arrays.copyOf(MetricType.values(), 3)); <END> }</code><technical_language>creating a static final EnumSet instead of creating a list call</technical_language>

Target:
public static EnumSet<MetricType> userTypes() { return userDefinableTypes; }
Source:
<code>protected void doRun(IProgressMonitor monitor) throws CoreException { SubMonitor progress = SubMonitor.convert(monitor, MakeUIPlugin.getResourceString("MakeCCWizard.task_name"), 10); super.doRun(progress.split(9)); if (newProject != null) { CCorePlugin.getDefault().convertProjectFromCtoCC(newProject, progress.split(1)); } else <START> progress.worked(1); <END> }</code><technical_language>Missing curly braces</technical_language>

Target:
protected void doRun(IProgressMonitor monitor) throws CoreException { SubMonitor progress = SubMonitor.convert(monitor, MakeUIPlugin.getResourceString("MakeCCWizard.task_name"), 10); super.doRun(progress.split(9)); if (newProject != null) { CCorePlugin.getDefault().convertProjectFromCtoCC(newProject, progress.split(1)); } else { progress.worked(1); } }
Source:
<code>public void writeConfiguration(String host, int port) throws IOException { Message m = Message.createMessage("config"); m.addTag("reindex"); <START> ByteArrayOutputStream baos = new ByteArrayOutputStream(); <END> XMLEncoder e = new XMLEncoder(baos); e.writeObject(configuration); e.close(); m.setText(baos.toString()); m.write(host, port); }</code><technical_language><LINK_0></technical_language>

Target:
public void writeConfiguration(String host, int port) throws IOException { Message m = Message.createMessage("config"); m.addTag("reindex"); m.setText(configuration.getXMLRepresentationAsString()); m.write(host, port); }
Source:
<code>public void addInput(Page page) { requireNonNull(page, "page is null"); if (page.getPositionCount() == 0) { return; } page = pagePreprocessor.apply(page); if (useOptmizedPartitionedOutputOperator) { <START> partitionFunction.ariaPartitionPage(page); <END> } else { partitionFunction.partitionPage(page); } operatorContext.recordOutput(page.getSizeInBytes(), page.getPositionCount()); long partitionsSizeInBytes = partitionFunction.getSizeInBytes(); systemMemoryContext.setBytes(partitionsSizeInBytes + partitionsInitialRetainedSize); }</code><technical_language>aria in code - partitionPageOptimized</technical_language>

Target:
public void addInput(Page page) { requireNonNull(page, "page is null"); if (page.getPositionCount() == 0) { return; } page = pagePreprocessor.apply(page); partitionFunction.partitionPage(page); operatorContext.recordOutput(page.getSizeInBytes(), page.getPositionCount()); long partitionsSizeInBytes = partitionFunction.getSizeInBytes(); systemMemoryContext.setBytes(partitionsSizeInBytes + partitionsInitialRetainedSize); }
Source:
<code>public PagesSpatialIndexSupplier( Session session, LongArrayList addresses, List<Type> types, List<Integer> outputChannels, List<List<Block>> channels, int geometryChannel, Optional<Integer> radiusChannel, Optional<Integer> partitionChannel, SpatialPredicate spatialRelationshipTest, Optional<JoinFilterFunctionCompiler.JoinFilterFunctionFactory> filterFunctionFactory, Map<Integer, Rectangle> partitions, LocalMemoryContext localUserMemoryContext) { <START> requireNonNull(localUserMemoryContext); <END> this.session = session; this.addresses = addresses; this.types = types; this.outputChannels = outputChannels; this.channels = channels; this.spatialRelationshipTest = spatialRelationshipTest; this.filterFunctionFactory = filterFunctionFactory; this.partitions = partitions; this.rtree = buildRTree(addresses, channels, geometryChannel, radiusChannel, partitionChannel, localUserMemoryContext); this.radiusChannel = radiusChannel; this.memorySizeInBytes = INSTANCE_SIZE + (rtree.isEmpty() ? 0 : STRTREE_INSTANCE_SIZE + computeMemorySizeInBytes(rtree.getRoot())); }</code><technical_language>add error message: requireNonNull(localUserMemoryContext, "localUserMemoryContext is null");</technical_language>

Target:
public PagesSpatialIndexSupplier( Session session, LongArrayList addresses, List<Type> types, List<Integer> outputChannels, List<List<Block>> channels, int geometryChannel, Optional<Integer> radiusChannel, Optional<Integer> partitionChannel, SpatialPredicate spatialRelationshipTest, Optional<JoinFilterFunctionCompiler.JoinFilterFunctionFactory> filterFunctionFactory, Map<Integer, Rectangle> partitions, LocalMemoryContext localUserMemoryContext) { requireNonNull(localUserMemoryContext, "localUserMemoryContext is null"); this.session = session; this.addresses = addresses; this.types = types; this.outputChannels = outputChannels; this.channels = channels; this.spatialRelationshipTest = spatialRelationshipTest; this.filterFunctionFactory = filterFunctionFactory; this.partitions = partitions; this.rtree = buildRTree(addresses, channels, geometryChannel, radiusChannel, partitionChannel, localUserMemoryContext); this.radiusChannel = radiusChannel; this.memorySizeInBytes = INSTANCE_SIZE + rtree.getEstimatedSizeInBytes(); }
Source:
<code>private long extractLongKey(QueryableEntry entry) { Object key = entry.getAttributeValue(keyAttribute); <START> if (key == null) { <END> throw new NullPointerException("non-null unique key value is required"); } if (!Numbers.isLongRepresentable(key.getClass())) { throw new NullPointerException("integer-valued unique key value is required"); } return ((Number) key).longValue(); }</code><technical_language>checks similar previous method avoid code duplication</technical_language>

Target:
private long extractLongKey(QueryableEntry entry) { Object key = entry.getAttributeValue(keyAttribute); return extractLongKey(key); }
Source:
<code>protected void handleExceptionWhileProcessingMetadata(Member member, Exception e) { <START> if (e instanceof HazelcastInstanceNotActiveException) { <END> logger.finest(e); } else if (logger.isWarningEnabled()) { logger.warning(format("Can't extract invalidation meta-data of %s", member), e); } }</code><technical_language>handling IllegalStateException here? this handle cases i think, for example HazelcastClientNotActiveException is missing fix in this PR. (same for HazelcastInstanceNotActiveException)</technical_language>

Target:
protected void handleExceptionWhileProcessingMetadata(Member member, Exception e) { if (e instanceof IllegalStateException) { logger.finest(e); } else if (logger.isWarningEnabled()) { logger.warning(format("Can't fetch or extract invalidation meta-data of %s", member), e); } }
Source:
<code>public void test_addKeyListenerKeyPressedAdapterLorg_eclipse_swt_events_KeyListener() { <START> KeyListener listener = KeyListener.keyPressedAdapter(event -> { <END> eventOccurred = true; }); control.addKeyListener(listener); eventOccurred = false; control.notifyListeners(SWT.KeyDown, new Event()); assertTrue(eventOccurred); control.removeKeyListener(listener); eventOccurred = false; control.notifyListeners(SWT.KeyDown, new Event()); assertFalse(eventOccurred); }</code><technical_language>shorter version? KeyListener listener = KeyListener.keyPressedAdapter(event -> eventOccurred = true);</technical_language>

Target:
public void test_addKeyListenerKeyPressedAdapterLorg_eclipse_swt_events_KeyListener() { KeyListener listener = KeyListener.keyPressedAdapter(event -> eventOccurred = true); control.addKeyListener(listener); eventOccurred = false; control.notifyListeners(SWT.KeyDown, new Event()); assertTrue(eventOccurred); control.removeKeyListener(listener); eventOccurred = false; control.notifyListeners(SWT.KeyDown, new Event()); assertFalse(eventOccurred); }
Source:
<code>public String computeHmac256(final String stringToSign) { try { Mac hmacSha256 = Mac.getInstance("HmacSHA256"); hmacSha256.init(new SecretKeySpec(this.accountKey, "HmacSHA256")); byte[] utf8Bytes = stringToSign.getBytes(StandardCharsets.UTF_8); return Base64.getEncoder().encodeToString(hmacSha256.doFinal(utf8Bytes)); } catch (final NoSuchAlgorithmException e) { throw new RuntimeException("There is no such algorithm. Error Details: " + e.getMessage()); } catch (InvalidKeyException e) { <START> throw new RuntimeException("Please double check the account key. Error details: " + e.getMessage()); <END> } }</code><technical_language>clientLogger logAndThrow API</technical_language>

Target:
public String computeHmac256(final String stringToSign) { try { Mac hmacSha256 = Mac.getInstance("HmacSHA256"); hmacSha256.init(new SecretKeySpec(this.accountKey, "HmacSHA256")); byte[] utf8Bytes = stringToSign.getBytes(StandardCharsets.UTF_8); return Base64.getEncoder().encodeToString(hmacSha256.doFinal(utf8Bytes)); } catch (final NoSuchAlgorithmException e) { String errorMsg = "There is no such algorithm. Error Details: " + e.getMessage(); logger.asWarning().log(errorMsg); throw new RuntimeException(errorMsg); } catch (InvalidKeyException e) { String errorMsg = "Please double check the account key. Error details: " + e.getMessage(); logger.asWarning().log(errorMsg); throw new RuntimeException(errorMsg); } }
Source:
<code>public static Date convertEventTimestampToDate(String timestamp) throws ParseException { <START> if (StringUtils.isBlank(timestamp)) { <END> throw new IllegalArgumentException("Pod event timestamp can not be blank"); } return dateFormat.parse(timestamp); }</code><technical_language>org.eclipse.che.ide.util.StringUtils.isNullOrEmpty com.google.common.base.Strings.isNullOrEmpty</technical_language>

Target:
public static Date convertEventTimestampToDate(String timestamp) throws ParseException { if (Strings.isNullOrEmpty(timestamp)) { throw new IllegalArgumentException("Pod event timestamp can not be blank"); } return dateFormat.parse(timestamp); }
Source:
<code>private static void readRepositoryCategory(IConfigurationElement element) { String id = element.getAttribute(ELMNT_REPOSITORY_CATEGORY_ID); String label = element.getAttribute(ELMNT_REPOSITORY_CATEGORY_LABEL); String rank = element.getAttribute(ELMNT_REPOSITORY_CATEGORY_RANK); <START> RepositoryCategory cat = new RepositoryCategory(id, label, Integer.parseInt(rank)); <END> repositoryCategories.put(cat.getId(), cat); }</code><technical_language>needs handle NumberFormatException</technical_language>

Target:
private static void readRepositoryCategory(IConfigurationElement element) { String id = element.getAttribute(ELEMENT_REPOSITORY_CATEGORY_ID); String label = element.getAttribute(ELEMENT_REPOSITORY_CATEGORY_LABEL); String rank = element.getAttribute(ELEMENT_REPOSITORY_CATEGORY_RANK); int rankInt; try { rankInt = Integer.parseInt(rank); } catch (NumberFormatException e) { rankInt = 0; } RepositoryCategory cat = new RepositoryCategory(id, label, rankInt); repositoryCategories.put(cat.getId(), cat); }
Source:
<code>public void testLambdaBug1470() throws Exception { <START> String code = IOUtils.toString(ParserCornersTest.class.getResourceAsStream("LambdaBug1470.java"), <END> StandardCharsets.UTF_8); parseJava18(code); }</code><technical_language>of method readAsString(...) instead</technical_language>

Target:
public void testLambdaBug1470() { String code = readAsString("LambdaBug1470.java"); parseJava18(code); }
Source:
<code>public JailPanel(int totalPieces) { super(false); <START> if(totalPieces % 4 == 0) { <END> mJailSize = BoardSize.withDimensions(JAIL_WIDTH, totalPieces / JAIL_WIDTH); } else { mJailSize = BoardSize.withDimensions(JAIL_WIDTH, (totalPieces / JAIL_WIDTH) + 1); } mSquareLabels = new ArrayList<>(totalPieces); setBorder(UiUtility.createBorder(Messages.getString("PlayGamePanel.capturedPieces"))); setLayout(new GridLayout(mJailSize.height, mJailSize.width)); createGrid(); }</code><technical_language>totalPieces % JAIL_WIDTH</technical_language>

Target:
public JailPanel(int totalPieces) { super(false); if(totalPieces % JAIL_WIDTH == 0) { mJailSize = BoardSize.withDimensions(JAIL_WIDTH, totalPieces / JAIL_WIDTH); } else { mJailSize = BoardSize.withDimensions(JAIL_WIDTH, (totalPieces / JAIL_WIDTH) + 1); } mSquareLabels = new ArrayList<>(totalPieces); setBorder(UiUtility.createBorder(Messages.getString("PlayGamePanel.capturedPieces"))); setLayout(new GridLayout(mJailSize.height, mJailSize.width)); createGrid(); }
Source:
<code>public void predicate_nativeField_exists() { StubMappingSearchScope scope = indexManager.createSearchScope(); IndexSearchQuery<DocumentReference> query = scope.query() .asReference() <START> .predicate( f -> f.exists().onField( "nativeField" ) ) <END> .toQuery(); assertThat( query ) .hasDocRefHitsAnyOrder( INDEX_NAME, FIRST_ID, SECOND_ID, THIRD_ID, FOURTH_ID ); }</code><technical_language>onField feel natural for exists? consistency is better</technical_language>

Target:
public void predicate_nativeField_exists() { StubMappingSearchScope scope = indexManager.createSearchScope(); SubTest.expectException( "exists() predicate on unsupported native field", () -> scope.predicate().exists().onField( "nativeField" ) ) .assertThrown() .isInstanceOf( SearchException.class ) .hasMessageContaining( "Native fields do not support defining predicates with the DSL: use the Lucene extension and a native query." ) .satisfies( FailureReportUtils.hasContext( EventContexts.fromIndexFieldAbsolutePath( "nativeField" ) ) ); }
Source:
<code>private void send(final String destId, final AvroPSMsg msg) { final ConnectionFactory<AvroPSMsg> connFactory = psNetworkSetup.getConnectionFactory(); <START> if (connFactory == null) { <END> throw new RuntimeException("ConnectionFactory has not been registered or has been removed"); } final Connection<AvroPSMsg> conn = connFactory .newConnection(identifierFactory.getNewInstance(destId)); try { conn.open(); conn.write(msg); } catch (final NetworkException ex) { throw new RuntimeException("NetworkException during connection open/write", ex); } }</code><technical_language>mention in case this condition occurs</technical_language>

Target:
private void send(final String destId, final AvroPSMsg msg) { final ConnectionFactory<AvroPSMsg> connFactory = psNetworkSetup.getConnectionFactory(); if (connFactory == null) { throw new RuntimeException("ConnectionFactory has not been registered, or has been removed accidentally"); } final Connection<AvroPSMsg> conn = connFactory .newConnection(identifierFactory.getNewInstance(destId)); try { conn.open(); conn.write(msg); } catch (final NetworkException ex) { throw new RuntimeException("NetworkException during connection open/write", ex); } }
Source:
<code>protected void executeCommand() { lunsToUpdateInDb = getLunsToUpdateInDb(); <START> if (acquireLockInternal()) { <END> TransactionSupport.executeInNewTransaction(() -> { Collection<LUNs> oldLuns = lunIdToDiskIdOfDirectLunsAttachedToVmsInPool.keySet() .stream() .map(lunDao::get) .collect(Collectors.toList()); CompensationContext context = getCompensationContext(); context.snapshotEntities(oldLuns); lunDao.updateAllInBatch(lunsToUpdateInDb); context.stateChanged(); log.info("LUNs with IDs: [" + lunsToUpdateInDb.stream().map(LUNs::getLUNId).collect(Collectors.joining(", ")) + "] were updated in the DB."); setSucceeded(true); return null; }); freeLock(); } else { addCustomValue("DisksIds", lunsToUpdateInDb.stream() .map(LUNs::getDiskId).map(Guid::toString).collect(Collectors.joining(", "))); auditLogDirector.log(this, AuditLogType.DIRECT_LUNS_COULD_NOT_BE_SYNCED); } }</code><technical_language>This is racy nature - below</technical_language>

Target:
protected void executeCommand() { lunsToUpdateInDb = getLunsToUpdateInDb(); TransactionSupport.executeInNewTransaction(() -> { Collection<LUNs> oldLuns = diskToLunIdsOfDirectLunsAttachedToVmsInPool.values() .stream() .map(lunDao::get) .collect(Collectors.toList()); CompensationContext context = getCompensationContext(); context.snapshotEntities(oldLuns); lunDao.updateAllInBatch(lunsToUpdateInDb); context.stateChanged(); log.info(lunsToUpdateInDb.stream().map(LUNs::getLUNId).collect( Collectors.joining(", ", "LUNs with IDs: [", "] were updated in the DB."))); setSucceeded(true); return null; }); }
Source:
<code>public void onNewJobModelAvailable(final String version) { debounceTimer.scheduleAfterDebounceTime(ScheduleAfterDebounceTime.JOB_MODEL_VERSION_CHANGE, 0, () -> { LOG.info("pid=" + processorId + "new JobModel available"); <START> metrics.newJobModel.inc(); <END> if (coordinatorListener != null) { coordinatorListener.onJobModelExpired(); } newJobModel = zkUtils.getJobModel(version); LOG.info("pid=" + processorId + ": new JobModel available. ver=" + version + "; jm = " + newJobModel); barrier.join(version, processorId); }); }</code><technical_language>please explain significance of "new-jobmodel-generated" metric? number of times jobmodel generated number of times this processor notified a jobmodel change? If is former, I this metric incremented leader. If is latter, rename metric "new-jobmodel-available"</technical_language>

Target:
public void onNewJobModelAvailable(final String version) { debounceTimer.scheduleAfterDebounceTime(ScheduleAfterDebounceTime.JOB_MODEL_VERSION_CHANGE, 0, () -> { LOG.info("pid=" + processorId + "new JobModel available"); if (coordinatorListener != null) { coordinatorListener.onJobModelExpired(); } newJobModel = zkUtils.getJobModel(version); LOG.info("pid=" + processorId + ": new JobModel available. ver=" + version + "; jm = " + newJobModel); barrier.join(version, processorId); }); }
Source:
<code>public synchronized static void <START> setReactorsMap(String <END> vmId, ReactorClient client){ reactorsMap.put(vmId, client); }</code><technical_language>Lack of consistency in naming. Please fix</technical_language>

Target:
public static void setReactorsMap(String vmId, ReactorClient client){ reactorsMap.put(vmId, client); }
Source:
<code>public void checkResourceIsClosableAndReusable() { GenericObjectPoolConfig config = new GenericObjectPoolConfig(); config.setMaxTotal(1); config.setBlockWhenExhausted(false); JedisPool pool = new JedisPool(config, hnp.getHost(), hnp.getPort(), 2000, "foobared", 0, "closable-resuable-pool", false, null, null, null); <START> Jedis jedis = pool.getResource(); <END> try { jedis.set("hello", "jedis"); } finally { jedis.close(); } Jedis jedis2 = pool.getResource(); try { assertEquals(jedis, jedis2); assertEquals("jedis", jedis2.get("hello")); } finally { jedis2.close(); } }</code><technical_language>Jedis is closeable</technical_language>

Target:
public void checkResourceIsClosableAndReusable() { GenericObjectPoolConfig config = new GenericObjectPoolConfig(); config.setMaxTotal(1); config.setBlockWhenExhausted(false); try (JedisPool pool = new JedisPool(config, hnp.getHost(), hnp.getPort(), 2000, "foobared", 0, "closable-resuable-pool", false, null, null, null)) { Jedis jedis = pool.getResource(); jedis.set("hello", "jedis"); jedis.close(); Jedis jedis2 = pool.getResource(); assertEquals(jedis, jedis2); assertEquals("jedis", jedis2.get("hello")); jedis2.close(); } }
Source:
<code>protected Object executeInTransaction(DataStore dataStore, Transactional action) { log.debug("executeInTransaction"); Object result = null; try (DataStoreTransaction tx = dataStore.beginTransaction()) { JsonApiDocument jsonApiDoc = new JsonApiDocument(); MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>(); RequestScope scope = new RequestScope("query", NO_VERSION, jsonApiDoc, tx, null, queryParams, UUID.randomUUID(), elide.getElideSettings()); result = action.execute(tx, scope); tx.flush(scope); tx.commit(scope); <START> } catch (IOException e) { <END> log.error("IOException: {}", e); throw new IllegalStateException(e); } return result; }</code><technical_language>throw exception IllegalStateException</technical_language>

Target:
protected Object executeInTransaction(DataStore dataStore, Transactional action) { log.debug("executeInTransaction"); Object result = null; try (DataStoreTransaction tx = dataStore.beginTransaction()) { JsonApiDocument jsonApiDoc = new JsonApiDocument(); MultivaluedMap<String, String> queryParams = new MultivaluedHashMap<String, String>(); RequestScope scope = new RequestScope("", "query", NO_VERSION, jsonApiDoc, tx, null, queryParams, UUID.randomUUID(), elide.getElideSettings()); result = action.execute(tx, scope); tx.flush(scope); tx.commit(scope); } catch (IOException e) { log.error("IOException: {}", e); throw new IllegalStateException(e); } return result; }
Source:
<code>public static QuantityType<?> operator_divide(QuantityType<?> x, Number y) { BigDecimal yValue = numberToBigDecimal(y); if (x == null) { <START> return new QuantityType<>("0").divide(yValue); <END> } else if (yValue == null) { return x.divide(NULL_DEFINITION); } else { return x.divide(yValue); } }</code><technical_language>kind of sense 0/y a result? 1/y</technical_language>

Target:
public static QuantityType<?> operator_divide(QuantityType<?> x, Number y) { BigDecimal yValue = numberToBigDecimal(y); return x.divide(yValue); }
Source:
<code>public int execute(DriverContext driverContext) { if (Utilities.FILE_OP_LOGGER.isTraceEnabled()) { Utilities.FILE_OP_LOGGER.trace("Executing ReplTxnTask for " + work.getTxnIds()); } try { if (work.getOperationType() == ReplTxnWork.OperationType.REPL_OPEN_TXN) { List<Long> txnIdsItr = driverContext.getCtx().getHiveTxnManager() .replOpenTxn(work.getReplPolicy(), work.getTxnIds(), work.getNumTxns()); for (int i = 0; i < txnIdsItr.size(); i++) { LOG.info( "Replayed OpenTxn Event for policy " + work.getReplPolicy() + " with srcTxn " + work .getTxnId(i) + " and target txn id " + txnIdsItr.get(i)); } } else if (work.getOperationType() == ReplTxnWork.OperationType.REPL_COMMI_TXN) { <START> driverContext.getCtx().getHiveTxnManager().replCommitTxn(work.getReplPolicy(), work.getTxnId(0)); <END> LOG.info("Replayed CommitTxn Event for policy " + work.getReplPolicy() + " with srcTxn " + work.getTxnId(0) + " and target txn id " + work.getTxnId(0)); } else if (work.getOperationType() == ReplTxnWork.OperationType.REPL_ABORT_TXN) { driverContext.getCtx().getHiveTxnManager().replRollbackTxn(work.getReplPolicy(), work.getTxnId(0)); LOG.info("Replayed AbortTxn Event for policy " + work.getReplPolicy() + " with srcTxn " + work.getTxnId(0)); } return 0; } catch (Exception e) { console.printError("Failed with exception " + e.getMessage(), "\n" + StringUtils.stringifyException(e)); setException(e); return 1; } }</code><technical_language>local variable for driverContext.getCtx().getHiveTxnManager()</technical_language>

Target:
public int execute(DriverContext driverContext) { String replPolicy = work.getReplPolicy(); if (Utilities.FILE_OP_LOGGER.isTraceEnabled()) { Utilities.FILE_OP_LOGGER.trace("Executing ReplTxnTask " + work.getOperationType().toString() + " for txn ids : " + work.getTxnIds().toString() + " replPolicy : " + replPolicy); } try { HiveTxnManager txnManager = driverContext.getCtx().getHiveTxnManager(); String user = UserGroupInformation.getCurrentUser().getUserName(); LOG.debug("Replaying " + work.getOperationType().toString() + " Event for policy " + replPolicy + " with srcTxn " + work.getTxnIds().toString()); switch(work.getOperationType()) { case REPL_OPEN_TXN: List<Long> txnIds = txnManager.replOpenTxn(replPolicy, work.getTxnIds(), user); assert txnIds.size() == work.getTxnIds().size(); LOG.info("Replayed OpenTxn Event for policy " + replPolicy + " with srcTxn " + work.getTxnIds().toString() + " and target txn id " + txnIds.toString()); return 0; case REPL_ABORT_TXN: for (long txnId : work.getTxnIds()) { txnManager.replRollbackTxn(replPolicy, txnId); LOG.info("Replayed AbortTxn Event for policy " + replPolicy + " with srcTxn " + txnId); } return 0; case REPL_COMMIT_TXN: for (long txnId : work.getTxnIds()) { txnManager.replCommitTxn(replPolicy, txnId); LOG.info("Replayed CommitTxn Event for policy " + replPolicy + " with srcTxn " + txnId); } return 0; default: LOG.error("Operation Type " + work.getOperationType() + " is not supported "); return 1; } } catch (Exception e) { console.printError("Failed with exception " + e.getMessage(), "\n" + StringUtils.stringifyException(e)); setException(e); return 1; } }
Source:
<code>public void exceptional_SV_should_contain_exception_type_in_toString() { SymbolicValue.ExceptionalSymbolicValue unknownException = new SymbolicValue.ExceptionalSymbolicValue(null); <START> assertThat(unknownException.toString()).contains(String.valueOf(unknownException.hashCode() % 100)); <END> assertThat(unknownException.toString()).contains("!unknownException!"); JavaSymbol.PackageJavaSymbol packageSymbol = new JavaSymbol.PackageJavaSymbol("org.foo.bar", null); JavaSymbol.TypeJavaSymbol exceptionSymbol = new JavaSymbol.TypeJavaSymbol(Flags.PUBLIC, "MyException", packageSymbol); Type exceptionType = new ClassJavaType(exceptionSymbol); SymbolicValue.ExceptionalSymbolicValue knownException = new SymbolicValue.ExceptionalSymbolicValue(exceptionType); assertThat(knownException.toString()).contains(String.valueOf(knownException.hashCode() % 100)); assertThat(knownException.toString()).contains("org.foo.bar.MyException!"); }</code><technical_language>stupid test that, "unknownException" text. This worth changing</technical_language>

Target:
public void exceptional_SV_should_contain_exception_type_in_toString() { SymbolicValue.ExceptionalSymbolicValue unknownException = new SymbolicValue.ExceptionalSymbolicValue(null); assertThat(unknownException.toString()).contains("!unknownException!"); JavaSymbol.PackageJavaSymbol packageSymbol = new JavaSymbol.PackageJavaSymbol("org.foo.bar", null); JavaSymbol.TypeJavaSymbol exceptionSymbol = new JavaSymbol.TypeJavaSymbol(Flags.PUBLIC, "MyException", packageSymbol); Type exceptionType = new ClassJavaType(exceptionSymbol); SymbolicValue.ExceptionalSymbolicValue knownException = new SymbolicValue.ExceptionalSymbolicValue(exceptionType); assertThat(knownException.toString()).contains("org.foo.bar.MyException!"); }
Source:
<code>public Connection getConnectionInternal() { <START> int MAX_RETRIES = 7; <END> for (int retryCount = 0; retryCount < MAX_RETRIES; ++retryCount) { try { if (conn == null) { Class.forName(driverClass); conn = DriverManager.getConnection(connectionString, username.orNull(), password.orNull()); } else if (isExpired() || conn.isClosed()) { resetConnection(); } updateExpiration(); return conn; } catch (Exception e) { if (retryCount == MAX_RETRIES - 1) { throw new RuntimeException(e); } try { Thread.sleep(Math.round(Math.pow(2, retryCount)) * 1000); } catch (Exception ignored) { } } } return null; }</code><technical_language>preference for this configurable (eg. environment variable, class variable), some limits and/or sanity checks in place, clients of this library this explicitly if desired. This of 7 some default is more easily discoverable a private static final constant top of this class, in some relevant constants class</technical_language>

Target:
public Connection getConnectionInternal() { for (int retryCount = 0; retryCount < GET_CONNECTION_MAX_RETRIES; ++retryCount) { try { if (conn == null) { Class.forName(driverClass); conn = DriverManager.getConnection(connectionString, username.orNull(), password.orNull()); } else if (isExpired() || conn.isClosed()) { resetConnection(); } updateExpiration(); return conn; } catch (Exception e) { if (retryCount == GET_CONNECTION_MAX_RETRIES - 1) { throw new RuntimeException(String.format("Could not establish connection after %d attempts", GET_CONNECTION_MAX_RETRIES), e); } try { Thread.sleep(Math.round(Math.pow(2, retryCount)) * 1000); } catch (Exception ignored) { } } } throw new RuntimeException(String.format("Could not establish connection after %d attempts", GET_CONNECTION_MAX_RETRIES)); }
Source:
<code>public boolean select(Viewer viewer, Object parentElement, Object element) { DRepresentationDescriptor repDesc = null; if (element instanceof DRepresentationDescriptor) { repDesc = (DRepresentationDescriptor) element; } else if (element instanceof RepresentationItemImpl) { repDesc = ((RepresentationItemImpl) element).getDRepresentationDescriptor(); <START> } <END> if (repDesc != null) { return !new DRepresentationQuery(repDesc.getRepresentation()).isDanglingRepresentation(); } return true; }</code><technical_language>add another "elseif (element instanceof DRepresentation) {" get parent DRepresentationDescriptor</technical_language>

Target:
public boolean select(Viewer viewer, Object parentElement, Object element) { DRepresentation representation = null; if (element instanceof DRepresentation) { representation = (DRepresentation) element; } else if (element instanceof DRepresentationDescriptor) { representation = ((DRepresentationDescriptor) element).getRepresentation(); } else if (element instanceof RepresentationItemImpl) { DRepresentationDescriptor repDesc = ((RepresentationItemImpl) element).getDRepresentationDescriptor(); if (repDesc != null) { representation = repDesc.getRepresentation(); } } if (representation != null) { return !new DRepresentationQuery(representation).isDanglingRepresentation(); } return true; }
Source:
<code>Collection<Session> getSessionsByIp(final InetAddress ip) { <START> return listeningSessions.containsKey(ip) ? listeningSessions.get(ip).values() : Set.of(); <END> }</code><technical_language>suggestion return listeningSessions.getOrDefault(ip, Map.of()).values();</technical_language>

Target:
Collection<Session> getSessionsByIp(final InetAddress ip) { return listeningSessions.getOrDefault(ip, Map.of()).values(); }
Source:
<code>default void onMessageBatch(List<Message> messages) { throw new UnsupportedOperationException( <START> "The container has been configured with 'consumerBatchEnabled' but the listener is not " <END> + "a 'BatchMessageListener"); }</code><technical_language>I consumerBatchEnabled context sense here. is a listener contract resposibility worry a container state..</technical_language>

Target:
default void onMessageBatch(List<Message> messages) { throw new UnsupportedOperationException("This listener does not support message batches"); }
Source:
<code><START> public void whenReadEventsConsumerIsBlocked() throws Exception { <END> final FloodService.Flooder flooder = new FloodService.Flooder(EVENT_TYPE_NAME, FloodService.Type.CONSUMER_ET); new Thread(() -> { try { Thread.sleep(3000); NakadiControllerAT.blockFlooder(flooder); } catch (final Exception e) { e.printStackTrace(); } }).start(); given() .header(new Header("X-nakadi-cursors", xNakadiCursors)) .param("batch_limit", "1") .param("stream_timeout", "60") .param("batch_flush_timeout", "10") .when() .get(STREAM_ENDPOINT); NakadiControllerAT.unblockFlooder(flooder); }</code><technical_language>this test works? tests</technical_language>

Target:
public void whenReadEventsConsumerIsBlocked() throws Exception { final FloodService.Flooder flooder = new FloodService.Flooder(EVENT_TYPE_NAME, FloodService.Type.CONSUMER_ET); new Thread(() -> { try { Thread.sleep(3000); SettingsControllerAT.blockFlooder(flooder); } catch (final Exception e) { e.printStackTrace(); } }).start(); given() .header(new Header("X-nakadi-cursors", xNakadiCursors)) .param("batch_limit", "1") .param("stream_timeout", "60") .param("batch_flush_timeout", "10") .when() .get(STREAM_ENDPOINT); SettingsControllerAT.unblockFlooder(flooder); }
Source:
<code>private static List<Type> toTypes(List<Type> groupByTypes, List<Aggregator> aggregates) { ImmutableList.Builder<Type> builder = ImmutableList.builder(); <START> builder.addAll(groupByTypes); <END> aggregates.stream().forEach(aggregator -> builder.add(aggregator.getType())); return builder.build(); }</code><technical_language>Do want support partial streaming aggregations now</technical_language>

Target:
private static List<Type> toTypes(List<Type> groupByTypes, List<Aggregator> aggregates) { ImmutableList.Builder<Type> builder = ImmutableList.builder(); builder.addAll(groupByTypes); aggregates.stream() .map(Aggregator::getType) .forEach(builder::add); return builder.build(); }
Source:
<code>private String formatHour(int hour) { int hourToDisplay = hour; if(timeSetting == WearableConfigurationUtil.TIME_12_HOUR) { hourToDisplay = (hour % WearableConfigurationUtil.TIME_12_HOUR) == 0 ? <START> WearableConfigurationUtil.TIME_12_HOUR : hour%WearableConfigurationUtil.TIME_12_HOUR; <END> } return String.format(Locale.getDefault(), "%02d", hourToDisplay); }</code><technical_language>spaces 2nd %. I enable checkstyle for this module too</technical_language>

Target:
private String formatHour(int hour) { int hourToDisplay = hour; if(mTimeSetting == WearableConfigurationUtil.TIME_12_HOUR) { hourToDisplay = (hour % WearableConfigurationUtil.TIME_12_HOUR) == 0 ? WearableConfigurationUtil.TIME_12_HOUR : hour % WearableConfigurationUtil.TIME_12_HOUR; } return String.format(Locale.getDefault(), "%02d", hourToDisplay); }
Source:
<code>private void endSuccessfullySynchronous() { if (reloadVmTemplateFromDB() != null) { endDefaultOperations(); } <START> sealVmTemplate(); <END> setSucceeded(true); }</code><technical_language>tasks --> disks, need seal it, right</technical_language>

Target:
private void endSuccessfullySynchronous() { if (reloadVmTemplateFromDB() != null) { endDefaultOperations(); } setSucceeded(true); }
Source:
<code>public <T> T readUnmarshallByteArray(Transport transport, short status) { byte[] bytes = transport.readArray(); Marshaller marshaller = transport.getTransportFactory().getMarshaller(); return MarshallerUtil.bytes2obj(marshaller, bytes, status); <START> } <END></code><technical_language>This method is duplicated Codec10, extract a common place</technical_language>

Target:
public <T> T readUnmarshallByteArray(Transport transport, short status) { return CodecUtils.readUnmarshallByteArray(transport, status); }
Source:
<code>public boolean isUpToDate(NdResourceFile file) throws CoreException { if (file != null && file.isDoneIndexing()) { String location = <START> file.getLocation().getString(); <END> FileStateCache cache = FileStateCache.getCache(getNd()); Boolean cachedResult = cache.get(location); if (cachedResult != null) { return cachedResult; } Path locationPath = new Path(location); boolean result = file.getFingerprint().test(locationPath, null).matches(); cache.put(location, result); return result; } return false; }</code><technical_language>getString method renamed reflect semantics of return value</technical_language>

Target:
public boolean isUpToDate(NdResourceFile file) throws CoreException { if (file != null && file.isDoneIndexing()) { String location = file.getLocation().getString(); FileStateCache cache = FileStateCache.getCache(getNd()); Boolean cachedResult = cache.isUpToDate(location); if (cachedResult != null) { return cachedResult; } Path locationPath = new Path(location); boolean result = file.getFingerprint().test(locationPath, null).matches(); cache.put(location, result); return result; } return false; }
Source:
<code>private ExchangeInfoDAOFileImpl() { super(); String fileName = getExchangeFileLocation(); <START> LOG.debug("Reading exchangeInfo from file: " + fileName); <END> if (fileName != null) { file = new File(fileName); } }</code><technical_language>parameterized logging</technical_language>

Target:
private ExchangeInfoDAOFileImpl() { super(); String fileName = getExchangeFileLocation(); LOG.debug("Reading exchangeInfo from file: {}", fileName); if (fileName != null) { file = new File(fileName); } }
Source:
<code>public void commit() { try { orcWriter.close(); } catch (IOException | UncheckedIOException e) { try { rollbackAction.call(); } catch (Exception ignored) { } throw new PrestoException(HIVE_WRITER_CLOSE_ERROR, "Error committing write to Hive", e); } if (validationInputFactory.isPresent()) { try { try (OrcDataSource input = validationInputFactory.get().get()) { long startThreadCpuTime = THREAD_MX_BEAN.getCurrentThreadCpuTime(); orcWriter.validate(input); <START> validationCpuNanos.getAndAdd(THREAD_MX_BEAN.getCurrentThreadCpuTime() - startThreadCpuTime); <END> } } catch (IOException | UncheckedIOException e) { throw new PrestoException(HIVE_WRITE_VALIDATION_FAILED, e); } } }</code><technical_language>I addAndGet puts important word first</technical_language>

Target:
public void commit() { try { orcWriter.close(); } catch (IOException | UncheckedIOException e) { try { rollbackAction.call(); } catch (Exception ignored) { } throw new PrestoException(HIVE_WRITER_CLOSE_ERROR, "Error committing write to Hive", e); } if (validationInputFactory.isPresent()) { try { try (OrcDataSource input = validationInputFactory.get().get()) { long startThreadCpuTime = THREAD_MX_BEAN.getCurrentThreadCpuTime(); orcWriter.validate(input); validationCpuNanos += THREAD_MX_BEAN.getCurrentThreadCpuTime() - startThreadCpuTime; } } catch (IOException | UncheckedIOException e) { throw new PrestoException(HIVE_WRITE_VALIDATION_FAILED, e); } } }
Source:
<code>public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest req = (HttpServletRequest) request; HttpServletResponse rsp = (HttpServletResponse) response; ReceivePack rp; try { rp = receivePackFactory.create(req, getRepository(req)); <START> if (postReceiveHook != null) <END> rp.setPostReceiveHook(PostReceiveHookChain.newChain( postReceiveHook, rp.getPostReceiveHook())); } catch (ServiceNotAuthorizedException e) { rsp.sendError(SC_UNAUTHORIZED); return; } catch (ServiceNotEnabledException e) { sendError(req, rsp, SC_FORBIDDEN); return; } try { req.setAttribute(ATTRIBUTE_HANDLER, rp); chain.doFilter(req, rsp); } finally { req.removeAttribute(ATTRIBUTE_HANDLER); } }</code><technical_language>I recommend setting postReceiveHook = PostReceiveHook.NULL in constructor, drop this null check. newChain is smart enough collapse out NULLs (but nulls). This matches behavior in ReceivePack</technical_language>

Target:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest req = (HttpServletRequest) request; HttpServletResponse rsp = (HttpServletResponse) response; ReceivePack rp; try { rp = receivePackFactory.create(req, getRepository(req)); rp.setPostReceiveHook(PostReceiveHookChain.newChain( postReceiveHook, rp.getPostReceiveHook())); } catch (ServiceNotAuthorizedException e) { rsp.sendError(SC_UNAUTHORIZED); return; } catch (ServiceNotEnabledException e) { sendError(req, rsp, SC_FORBIDDEN); return; } try { req.setAttribute(ATTRIBUTE_HANDLER, rp); chain.doFilter(req, rsp); } finally { req.removeAttribute(ATTRIBUTE_HANDLER); } }
Source:
<code>public boolean matches(NameKey name) { if (projectPatterns.isEmpty()) { return true; } else { String projectName = name.get(); for (String pattern : projectPatterns) { if (isRE(pattern)) { <START> if (projectName.matches(pattern)) { <END> return true; } } else if (isWildcard(pattern)) { if (projectName.startsWith(pattern.substring(0, pattern.length() - 1))) { return true; } } else { if (projectName.equals(pattern)) { return true; } } } return false; } }</code><technical_language>ReplicationFilter instances short-living (created for a command dropped)? If yes, this code is OK. Otherwise, if a ReplicationFilter instance multiple time, sense compile regular expressions cache Pattern instances</technical_language>

Target:
public boolean matches(NameKey name) { boolean isMatch; if (projectPatterns.isEmpty()) { isMatch = true; } else { isMatch = false; String projectName = name.get(); for (String pattern : projectPatterns) { isMatch = matchesPattern(projectName, pattern); if (isMatch) { break; } } } return isMatch; }
Source:
<code><START> private String generateOvfStoreDescription(Date updateDate, boolean isUpdated, Long size) { <END> Map<String, Object> description = new HashMap<>(); description.put(OvfInfoFileConstants.IsUpdated, isUpdated); description.put(OvfInfoFileConstants.DiskDescription, OvfInfoFileConstants.OvfStoreDescriptionLabel); description.put(OvfInfoFileConstants.LastUpdated, updateDate.toString()); description.put(OvfInfoFileConstants.Domains, Arrays.asList(getParameters().getStorageDomainId())); if (size != null) { description.put(OvfInfoFileConstants.Size, size); } return buildJson(description); }</code><technical_language>Dont want remove updateDate</technical_language>

Target:
private String generateOvfStoreDescription(Date updateDate, boolean isUpdated, Long size) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append(OvfInfoFileConstants.IsUpdated); stringBuilder.append(":"); stringBuilder.append(isUpdated); stringBuilder.append(","); stringBuilder.append(OvfInfoFileConstants.DiskDescription); stringBuilder.append(":"); stringBuilder.append(OvfInfoFileConstants.OvfStoreDescriptionLabel); stringBuilder.append(","); stringBuilder.append(OvfInfoFileConstants.LastUpdated); stringBuilder.append(":"); stringBuilder.append(updateDate); stringBuilder.append(","); stringBuilder.append(OvfInfoFileConstants.Domains); stringBuilder.append(":"); stringBuilder.append(Arrays.asList(getParameters().getStorageDomainId())); if (size != null) { stringBuilder.append(","); stringBuilder.append(OvfInfoFileConstants.OvfDataSize); stringBuilder.append(":"); stringBuilder.append(size); } return stringBuilder.toString(); }