auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void configurePipeline(PipelineConfigurer configurer) throws IllegalArgumentException { super.configurePipeline(configurer); if (this.config.format == null || this.config.format.isEmpty()) { throw new IllegalArgumentException("Format is not specified. Allowed values are DEFAULT, EXCEL, MYSQL," + " RFC4180, PDL & TDF"); } if (!this.config.format.equalsIgnoreCase("DEFAULT") && !this.config.format.equalsIgnoreCase("EXCEL") && !this.config.format.equalsIgnoreCase("MYSQL") && !this.config.format.equalsIgnoreCase("RFC4180") && !this.config.format.equalsIgnoreCase("TDF") && !this.config.format.equalsIgnoreCase("PDL")) { throw new IllegalArgumentException("Format specified is not one of the allowed values. Allowed values are " + "DEFAULT, EXCEL, MYSQL, RFC4180, PDL & TDF"); } if (configurer.getStageConfigurer().getInputSchema() != null) { Schema.Field inputSchemaField = configurer.getStageConfigurer().getInputSchema().getField(config.field); if (inputSchemaField == null) { throw new IllegalArgumentException( "Field " + config.field + " is not present in the input schema, it is expected"); } else { if (!inputSchemaField.getSchema().getType().equals(Schema.Type.STRING)) { throw new IllegalArgumentException( <START> "Field Type " + config.field + " should be String"); <END> } } } try { Schema outputSchema = Schema.parseJson(this.config.schema); configurer.getStageConfigurer().setOutputSchema(outputSchema); } catch (IOException e) { throw new IllegalArgumentException("Format of schema specified is invalid. Please check the format."); } }</code><technical_language>Type for Field + config.field + String</technical_language>

Target:
public void configurePipeline(PipelineConfigurer configurer) throws IllegalArgumentException { super.configurePipeline(configurer); if (this.config.format == null || this.config.format.isEmpty()) { throw new IllegalArgumentException("Format is not specified. Allowed values are DEFAULT, EXCEL, MYSQL," + " RFC4180, PDL & TDF"); } if (!this.config.format.equalsIgnoreCase("DEFAULT") && !this.config.format.equalsIgnoreCase("EXCEL") && !this.config.format.equalsIgnoreCase("MYSQL") && !this.config.format.equalsIgnoreCase("RFC4180") && !this.config.format.equalsIgnoreCase("TDF") && !this.config.format.equalsIgnoreCase("PDL")) { throw new IllegalArgumentException("Format specified is not one of the allowed values. Allowed values are " + "DEFAULT, EXCEL, MYSQL, RFC4180, PDL & TDF"); } if (configurer.getStageConfigurer().getInputSchema() != null) { Schema.Field inputSchemaField = configurer.getStageConfigurer().getInputSchema().getField(config.field); if (inputSchemaField == null) { throw new IllegalArgumentException( "Field " + config.field + " is not present in the input schema"); } else { if (!inputSchemaField.getSchema().getType().equals(Schema.Type.STRING)) { throw new IllegalArgumentException( "Type for field " + config.field + " must be String"); } } } try { Schema outputSchema = Schema.parseJson(this.config.schema); configurer.getStageConfigurer().setOutputSchema(outputSchema); } catch (IOException e) { throw new IllegalArgumentException("Format of schema specified is invalid. Please check the format."); } }
Source:
<code>private void applyProperties(AssociationKey associationKey, RowKey rowKey, Relationship relationship) { String[] rowKeyIndexColumnNames = associationKey.getRowKeyIndexColumnNames(); for ( int i = 0; i < rowKeyIndexColumnNames.length; i++ ) { <START> for ( int j = 0; j < rowKey.getColumnNames().length; j++ ) { <END> if ( rowKeyIndexColumnNames[i].equals( rowKey.getColumnNames()[j] ) ) { relationship.setProperty( rowKeyIndexColumnNames[i], rowKey.getColumnValues()[j] ); break; } } } }</code><technical_language>RowKey#getColumnValue(String name)? This this code a bit easier grasp</technical_language>

Target:
private void applyProperties(AssociationKey associationKey, RowKey rowKey, Relationship relationship) { String[] indexColumns = associationKey.getMetadata().getRowKeyIndexColumnNames(); for ( int i = 0; i < indexColumns.length; i++ ) { String propertyName = indexColumns[i]; Object propertyValue = rowKey.getColumnValue( propertyName ); relationship.setProperty( propertyName, propertyValue ); } }
Source:
<code>private Diagnostic handleMigrationOptions() { Diagnostic migrationMismatchDiagnostic = null; VSMVersionSAXParser parser = new VSMVersionSAXParser(uri); String loadedVersion = parser.getVersion(new NullProgressMonitor()); boolean migrationIsNeeded = true; if (loadedVersion != null) { Version parsedLoadedVersion = Version.parseVersion(loadedVersion); Version lastMigrationVersion = VSMMigrationService.getInstance().getLastMigrationVersion(); boolean attemptToLoadMoreRecentVSM = lastMigrationVersion.compareTo(parsedLoadedVersion) < 0; if (attemptToLoadMoreRecentVSM) { migrationMismatchDiagnostic = new <START> XMIException(MessageFormat.format(Messages.DescriptionResourceImpl_versionMismatchMessage, <END> uri, parsedLoadedVersion, lastMigrationVersion)); } migrationIsNeeded = VSMMigrationService.getInstance().isMigrationNeeded(parsedLoadedVersion); } Object versionOption = this.getDefaultLoadOptions().get(AbstractSiriusMigrationService.OPTION_RESOURCE_MIGRATION_LOADEDVERSION); if (!migrationIsNeeded && versionOption != null) { removeMigrationMechanism(); } else if (migrationIsNeeded && (versionOption == null || !versionOption.equals(loadedVersion))) { DescriptionResourceImpl.addMigrationOptions(loadedVersion, this.getDefaultLoadOptions(), this.getDefaultSaveOptions()); } return migrationMismatchDiagnostic; }</code><technical_language>Strange XMIException here, imply is corrupted XMI level, is case. Especially is a AirdResourceVersionMismatchException defined in patch implements Resource.Diagnostic</technical_language>

Target:
private Diagnostic handleMigrationOptions() { Diagnostic migrationMismatchDiagnostic = null; VSMVersionSAXParser parser = new VSMVersionSAXParser(uri); String loadedVersion = parser.getVersion(new NullProgressMonitor()); boolean migrationIsNeeded = true; if (loadedVersion != null) { Version parsedLoadedVersion = Version.parseVersion(loadedVersion); Version lastMigrationVersion = VSMMigrationService.getInstance().getLastMigrationVersion(); boolean attemptToLoadMoreRecentVSM = lastMigrationVersion.compareTo(parsedLoadedVersion) < 0; if (attemptToLoadMoreRecentVSM) { migrationMismatchDiagnostic = new ResourceVersionMismatchDiagnostic(uri, parsedLoadedVersion, lastMigrationVersion); } migrationIsNeeded = VSMMigrationService.getInstance().isMigrationNeeded(parsedLoadedVersion); } Object versionOption = this.getDefaultLoadOptions().get(AbstractSiriusMigrationService.OPTION_RESOURCE_MIGRATION_LOADEDVERSION); if (!migrationIsNeeded && versionOption != null) { removeMigrationMechanism(); } else if (migrationIsNeeded && (versionOption == null || !versionOption.equals(loadedVersion))) { DescriptionResourceImpl.addMigrationOptions(loadedVersion, this.getDefaultLoadOptions(), this.getDefaultSaveOptions()); } return migrationMismatchDiagnostic; }
Source:
<code>public <T> T get(String key, String field) { RedisConnection<byte[], byte[]> redisCommands = null; try { redisCommands = getRedisConnection(); byte[] serializedData = redisCommands.hget(key.getBytes(), field.getBytes()); T deserializeObject = new JavaSerializer().deserializeObject(serializedData); return deserializeObject; } catch (Exception e) { <START> logger.error("Exception Occurred while getting a value from redis", e); <END> } finally { closeConnection(redisCommands); } return null; }</code><technical_language>Catching exception hides network- classpath/structural problems returns null caller</technical_language>

Target:
public <T> T get(String key, String field) { RedisConnection<byte[], byte[]> redisCommands = null; try { redisCommands = getRedisConnection(); byte[] serializedData = redisCommands.hget(key.getBytes(), field.getBytes()); T deserializeObject = codec.deserializeObject(serializedData); return deserializeObject; } finally { closeConnection(redisCommands); } }
Source:
<code>public void testScaffoldSetup() throws Exception { Project project = projectHelper.createWebProject(); try (CommandController c = testHarness.createWizardController(ScaffoldSetupWizard.class, project.getRoot())) { c.initialize(); c.setValueFor("provider", "Mock Scaffold Provider"); c.setValueFor("webRoot", ""); Assert.assertTrue(c.isValid()); Result result = c.execute(); <START> Assert.assertNotNull(result); <END> } }</code><technical_language>Is this test testing much? assert result is a failure: !(result instanceof Failed) for instance</technical_language>

Target:
public void testScaffoldSetup() throws Exception { Project project = projectHelper.createWebProject(); Imported<ScaffoldProvider> providerInstances = registry.getServices(ScaffoldProvider.class); ScaffoldProvider scaffoldProvider = providerInstances.get(); Assert.assertFalse(scaffoldProvider.isSetup(new ScaffoldSetupContext("", project))); try (WizardCommandController c = testHarness.createWizardController(ScaffoldSetupWizard.class, project.getRoot())) { c.initialize(); c.setValueFor("provider", "Mock Scaffold Provider"); c.setValueFor("webRoot", ""); Assert.assertTrue(c.isValid()); Assert.assertFalse(c.canMoveToNextStep()); Result result = c.execute(); Assert.assertNotNull(result); Assert.assertFalse(result instanceof Failed); Assert.assertTrue(scaffoldProvider.isSetup(new ScaffoldSetupContext("", project))); } }
Source:
<code>private Set<Integer> getTimeseriesLayerIds(int layerId) throws ActionException { Set<Integer> timeseriesLayerIds = new HashSet<>(); for (OskariLayer layer : mapLayerService.findAll()) { JSONObject options = layer.getOptions(); try { if (options != null && options.has("timeseries")) { JSONObject timeseriesOptions = options.getJSONObject("timeseries"); <START> Integer metadataLayerId = timeseriesOptions.getJSONObject("metadata").getInt("layer"); <END> if (metadataLayerId == layerId) { timeseriesLayerIds.add(layer.getId()); } } } catch (JSONException e) { throw new ActionException("Cannot parse layer metadata options for layer: " + layer.getName() + ", id: " + layer.getId()); } } return timeseriesLayerIds; }</code><technical_language>This throw a NPE if options timeseries metadata it</technical_language>

Target:
private Set<Integer> getTimeseriesLayerIds(int layerId) throws ActionException { Set<Integer> timeseriesLayerIds = new HashSet<>(); for (OskariLayer layer : mapLayerService.findAll()) { JSONObject options = layer.getOptions(); try { if (options != null && options.has("timeseries")) { JSONObject timeseriesOptions = options.getJSONObject("timeseries"); JSONObject timeseriesMetadata = timeseriesOptions.optJSONObject("metadata"); if (timeseriesMetadata == null) { continue; } Integer metadataLayerId = timeseriesMetadata.getInt("layer"); if (metadataLayerId == layerId) { timeseriesLayerIds.add(layer.getId()); } } } catch (JSONException e) { throw new ActionException("Cannot parse layer metadata options for layer: " + layer.getName() + ", id: " + layer.getId()); } } return timeseriesLayerIds; }
Source:
<code>public void testRecover() throws Exception { CountDownLatch countDownLatch = new CountDownLatch(2); final AtomicReference<Boolean> notified = new AtomicReference<Boolean>(false); <START> NotifyListener listner = new NotifyListener() { <END> @Override public void notify(List<URL> urls) { notified.set(Boolean.TRUE); } }; MockRegistry mockRegistry = new MockRegistry(registryUrl, countDownLatch); mockRegistry.register(serviceUrl); mockRegistry.subscribe(serviceUrl, listner); Assert.assertEquals(mockRegistry.getRegistered().size(), 1); Assert.assertEquals(mockRegistry.getSubscribed().size(), 1); mockRegistry.recover(); Assert.assertEquals(mockRegistry.getFailedSubscribed().size(), 1); Assert.assertEquals(countDownLatch.getCount(), 0); }</code><technical_language>please fix typo listner, listener</technical_language>

Target:
public void testRecover() throws Exception { CountDownLatch countDownLatch = new CountDownLatch(4); final AtomicReference<Boolean> notified = new AtomicReference<Boolean>(false); NotifyListener listener = new NotifyListener() { @Override public void notify(List<URL> urls) { notified.set(Boolean.TRUE); } }; MockRegistry mockRegistry = new MockRegistry(registryUrl, countDownLatch); mockRegistry.register(serviceUrl); mockRegistry.subscribe(serviceUrl, listener); Assert.assertEquals(1, mockRegistry.getRegistered().size()); Assert.assertEquals(1, mockRegistry.getSubscribed().size()); mockRegistry.recover(); countDownLatch.await(); Assert.assertEquals(0, mockRegistry.getFailedRegistered().size()); Assert.assertEquals(null, mockRegistry.getFailedSubscribed().get(registryUrl)); Assert.assertEquals(countDownLatch.getCount(), 0); }
Source:
<code>public int compare(final Account account1, final Account account2) { <START> if (account1.getPreferredEmail() != null <END> && account2.getPreferredEmail() != null) { return account1.getPreferredEmail().compareTo( account2.getPreferredEmail()); } if (account1.getFullName() != null && account2.getFullName() != null) { return account1.getFullName().compareTo(account2.getFullName()); } return Integer.valueOf(account1.getId().get()).compareTo( Integer.valueOf(account2.getId().get())); }</code><technical_language>This stable, is it? compare email "" , full name</technical_language>

Target:
public int compare(final Account account1, final Account account2) { if (account1.getPreferredEmail() != null && !account1.getPreferredEmail().isEmpty() && account2.getPreferredEmail() != null && !account2.getPreferredEmail().isEmpty()) { return account1.getPreferredEmail().compareTo( account2.getPreferredEmail()); } if (account1.getFullName() != null && !account1.getFullName().isEmpty() && account2.getFullName() != null && !account2.getFullName().isEmpty()) { return account1.getFullName().compareTo(account2.getFullName()); } return Integer.valueOf(account1.getId().get()).compareTo( Integer.valueOf(account2.getId().get())); }
Source:
<code>public void onNext(final AggregationMessage aggregationMessage) { final String workerId = aggregationMessage.getSourceId().toString(); final String localState = codec.decode(aggregationMessage.getData().array()); final String globalState = globalStateMachine.getCurrentState(); <START> switch (globalState) { <END> case STATE_INIT: break; case STATE_RUN: if (localState.equals(STATE_INIT)) { sendResponseMessage(workerId, new byte[0]); return; } break; case STATE_CLEANUP: default: throw new RuntimeException("Invalid state"); } blockedWorkerIds.add(workerId); LOG.log(Level.FINE, "Receive a synchronization message from {0}. {1} messages have been received out of {2}.", new Object[]{workerId, blockedWorkerIds.size(), numWorkersToSync}); tryReleaseWorkers(); }</code><technical_language>helpful remind here, especially mentioning _In case a worker's local state is globally synchronized state, this implies worker is added EM. If so, worker is replied continue reaches global state_</technical_language>

Target:
public void onNext(final AggregationMessage aggregationMessage) { final String workerId = aggregationMessage.getSourceId().toString(); final String localState = codec.decode(aggregationMessage.getData().array()); final String globalState = globalStateMachine.getCurrentState(); switch (globalState) { case STATE_INIT: if (!localState.equals(STATE_INIT)) { throw new RuntimeException("Individual workers cannot overtake the global state"); } break; case STATE_RUN: if (localState.equals(STATE_INIT)) { sendResponseMessage(workerId, EMPTY_DATA); return; } else if (!localState.equals(STATE_RUN)) { throw new RuntimeException("Individual workers cannot overtake the global state"); } break; case STATE_CLEANUP: throw new RuntimeException("Workers never call the global barrier in STATE_CLEANUP state"); default: throw new RuntimeException("Invalid state"); } blockWorker(workerId); }
Source:
<code>public HttpMessage setProtocolVersion(HttpVersion version) { ObjectUtil.checkNotNull(version, "version"); <START> this.version = version; <END> return this; }</code><technical_language>nit: merge lines checkNotNull return argument</technical_language>

Target:
public HttpMessage setProtocolVersion(HttpVersion version) { this.version = ObjectUtil.checkNotNull(version, "version"); return this; }
Source:
<code>private void validate() { assertThat(localSegment, Objects::nonNull, <START> () -> new AxonConfigurationException("The localSegment may not be null")); <END> assertThat(channel, Objects::nonNull, () -> new AxonConfigurationException("JChannel may not be null")); assertThat(clusterName, Objects::nonNull, () -> new AxonConfigurationException("The clusterName may not be null")); assertThat(serializer, Objects::nonNull, () -> new AxonConfigurationException("Serializer may not be null")); assertThat(routingStrategy, Objects::nonNull, () -> new AxonConfigurationException("RoutingStrategy may not be null")); assertThat(consistentHashChangeListener, Objects::nonNull, () -> new AxonConfigurationException("ConsistentHashChangeListener may not be null")); }</code><technical_language>Null values this point reported a property null, a mandatory property for provided</technical_language>

Target:
protected void validate() { assertNonNull(localSegment, "The localSegment is a hard requirement and should be provided"); assertNonNull(channel, "The JChannel is a hard requirement and should be provided"); assertClusterName(clusterName, "The clusterName is a hard requirement and should be provided"); assertNonNull(serializer, "The Serializer is a hard requirement and should be provided"); assertNonNull(routingStrategy, "The RoutingStrategy is a hard requirement and should be provided"); assertNonNull(consistentHashChangeListener, "The ConsistentHashChangeListener is a hard requirement and should be provided"); }
Source:
<code>private Object unwrapBinary(Object obj, BinaryReaderHandles hnds) { if (obj instanceof BinaryObjectImpl) { BinaryObjectImpl obj0 = (BinaryObjectImpl)obj; return marsh.deserialize(BinaryHeapInputStream.create(obj0.array(), obj0.start()), hnds); } <START> else if (obj instanceof BinaryObject ) <END> return ((BinaryObject)obj).deserialize(); else if (BinaryUtils.knownCollection(obj)) return unwrapCollection((Collection<Objects>)obj, hnds); else if (BinaryUtils.knownMap(obj)) return unwrapMap((Map<Object, Object>)obj, hnds); else if (obj instanceof Object[]) return unwrapArray((Object[])obj, hnds); else return obj; }</code><technical_language>Cosmetic. Extra space BinaryObject )</technical_language>

Target:
private Object unwrapBinary(Object obj, BinaryReaderHandles hnds) { if (obj instanceof BinaryObjectImpl) { BinaryObjectImpl obj0 = (BinaryObjectImpl)obj; return marsh.deserialize(BinaryHeapInputStream.create(obj0.array(), obj0.start()), hnds); } else if (obj instanceof BinaryObject) return ((BinaryObject)obj).deserialize(); else if (BinaryUtils.knownCollection(obj)) return unwrapCollection((Collection<Object>)obj, hnds); else if (BinaryUtils.knownMap(obj)) return unwrapMap((Map<Object, Object>)obj, hnds); else if (obj instanceof Object[]) return unwrapArray((Object[])obj, hnds); else return obj; }
Source:
<code>public void put(String handle, LocalDateTime lastUsed) { storageLock.lock(); try { if (_storage == null) { <START> throw new RuntimeException(EXCEPTION_STORAGE); <END> } if (lastUsed == null) { _storage.put(LAST_USED.getKey(handle), (String) null); } else { String gsonStr = gson.toJson(lastUsed); _storage.put(LAST_USED.getKey(handle), gsonStr); } } finally { storageLock.unlock(); } }</code><technical_language>do throw RuntimeException</technical_language>

Target:
public void put(String handle, LocalDateTime lastUsed) { storageLock.lock(); try { if (storage == null) { throw new IllegalStateException(EXCEPTION_STORAGE); } if (lastUsed == null) { storage.put(LAST_USED.getKey(handle), (String) null); } else { String gsonStr = gson.toJson(lastUsed); storage.put(LAST_USED.getKey(handle), gsonStr); } } finally { storageLock.unlock(); } }
Source:
<code><START> public ArrayList<LinkInfo> getRemoteGoToLinks() throws IOException { <END> if (remoteGoToLinks == null) { loadAndPreflightPdf(); remoteGoToLinks = parseForLinks(PDActionRemoteGoTo.SUB_TYPE); } return remoteGoToLinks; }</code><technical_language>List<LinkInfo> (check for other method signatures)</technical_language>

Target:
public List<LinkInfo> getRemoteGoToLinks() throws IOException { if (remoteGoToLinks == null) { loadAndPreflightPdf(); remoteGoToLinks = parseForLinks(PDActionRemoteGoTo.SUB_TYPE); } return remoteGoToLinks; }
Source:
<code>private void breakModifies(ProgressMonitor pm) throws IOException { if (breakScore <= 0) return; ArrayList<DiffEntry> newEntries = new ArrayList<DiffEntry>(entries.size()); pm.beginTask(JGitText.get().renamesBreakingModifies, entries.size()); for (int i = 0; i < entries.size(); i++) { DiffEntry e = entries.get(i); <START> if (e.getChangeType() == ChangeType.MODIFY) { <END> final int score = calculateModifyScore(e); if (score < breakScore) { List<DiffEntry> tmp = DiffEntry.breakModify(e); DiffEntry del = tmp.get(0); del.score = score; deleted.add(del); added.add(tmp.get(1)); } else { newEntries.add(e); } } pm.update(1); } entries = newEntries; }</code><technical_language>Non-modify entries added newEntries</technical_language>

Target:
private void breakModifies(ProgressMonitor pm) throws IOException { if (breakScore <= 0) return; ArrayList<DiffEntry> newEntries = new ArrayList<DiffEntry>(entries.size()); pm.beginTask(JGitText.get().renamesBreakingModifies, entries.size()); for (int i = 0; i < entries.size(); i++) { DiffEntry e = entries.get(i); if (e.getChangeType() == ChangeType.MODIFY) { final int score = calculateModifyScore(e); if (score < breakScore) { List<DiffEntry> tmp = DiffEntry.breakModify(e); DiffEntry del = tmp.get(0); del.score = score; deleted.add(del); added.add(tmp.get(1)); } else { newEntries.add(e); } } else { newEntries.add(e); } pm.update(1); } entries = newEntries; }
Source:
<code>public void sendJsonMessage(String json) throws OperationFailedException { try { assertConnected(); org.jivesoftware.smack.packet.Message msg = new org.jivesoftware.smack.packet.Message(); msg.setType(org.jivesoftware.smack.packet.Message.Type.groupchat); msg.addExtension(new JsonMessageExtension(json)); MessageEventManager. addNotificationsRequests(msg, true, false, false, true); multiUserChat.sendMessage(msg); } <START> catch (NotConnectedException | InterruptedException ex){ <END> throw new OperationFailedException( "Failed to send JSON message " + json , OperationFailedException.GENERAL_ERROR , ex); } }</code><technical_language>brackets match coding style</technical_language>

Target:
public void sendJsonMessage(String json) throws OperationFailedException { org.jivesoftware.smack.packet.Message msg = new org.jivesoftware.smack.packet.Message(); msg.addExtension(new JsonMessageExtension(json)); sendMessage(msg); }
Source:
<code>public static void placeSteamOven(World world, BlockPos pos, List<ItemStack> input, List<ItemStack> output) { MultiBlockPattern pattern = TileSteamOven.patterns.get(0); Map<Character, IBlockState> blockMapping = new HashMap<Character, IBlockState>(); IBlockState base = RailcraftBlocks.getBlockMachineAlpha().getDefaultState(); <START> IBlockState steamOven = base.withProperty(MachineProxyAlpha.VARIANT, EnumMachineAlpha.STEAM_OVEN); <END> blockMapping.put('B', steamOven); TileEntity tile = pattern.placeStructure(world, pos, blockMapping); if (tile instanceof TileSteamOven) { TileSteamOven master = (TileSteamOven) tile; for (int slot = 0; slot < 9; slot++) { if (input != null && slot < input.size()) master.inv.setInventorySlotContents(TileSteamOven.SLOT_INPUT + slot, input.get(slot)); if (output != null && slot < output.size()) master.inv.setInventorySlotContents(TileSteamOven.SLOT_OUTPUT + slot, output.get(slot)); } } }</code><technical_language>EnumMachineAlpha.STEAM_OVEN.getState()</technical_language>

Target:
public static void placeSteamOven(World world, BlockPos pos, List<ItemStack> input, List<ItemStack> output) { MultiBlockPattern pattern = TileSteamOven.patterns.get(0); Map<Character, IBlockState> blockMapping = new HashMap<Character, IBlockState>(); blockMapping.put('B', EnumMachineAlpha.STEAM_OVEN.getState()); TileEntity tile = pattern.placeStructure(world, pos, blockMapping); if (tile instanceof TileSteamOven) { TileSteamOven master = (TileSteamOven) tile; for (int slot = 0; slot < 9; slot++) { if (input != null && slot < input.size()) master.inv.setInventorySlotContents(TileSteamOven.SLOT_INPUT + slot, input.get(slot)); if (output != null && slot < output.size()) master.inv.setInventorySlotContents(TileSteamOven.SLOT_OUTPUT + slot, output.get(slot)); } } }
Source:
<code>public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (obj instanceof ErrorPage) { ErrorPage other = (ErrorPage) obj; boolean rtn = true; <START> rtn = ObjectUtils.nullSafeEquals(getExceptionName(), other.getExceptionName()); <END> rtn = rtn && ObjectUtils.nullSafeEquals(this.path, other.path); rtn = rtn && this.status == other.status; return rtn; } return false; }</code><technical_language>Thanks for suggestion. assigning rtn 117 line 118, combined: boolean rtn = ObjectUtils.nullSafeEquals(getExceptionName(), other.getExceptionName());</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (obj instanceof ErrorPage) { ErrorPage other = (ErrorPage) obj; boolean rtn = ObjectUtils.nullSafeEquals(getExceptionName(), other.getExceptionName()); rtn = rtn && ObjectUtils.nullSafeEquals(this.path, other.path); rtn = rtn && this.status == other.status; return rtn; } return false; }
Source:
<code>protected boolean shouldNotFilter(HttpServletRequest request) { final HttpSession session = request.getSession(false); if (session != null && !session.isNew()) { log.debug("User has a session: {}", request.getRemoteUser(), session.getId()); log.debug("Max inactive interval: {}", session.getMaxInactiveInterval()); final Instant ctime = Instant.ofEpochMilli(session.getCreationTime()); final Instant atime = Instant.ofEpochMilli(session.getLastAccessedTime()); <START> log.debug("Session creation time: {}, last access time: {}", ctime, atime); <END> return true; } else { log.debug("User does not have a session", request.getRemoteUser()); } return REST_API_SERVLET_PATH.equalsIgnoreCase(request.getServletPath()); }</code><technical_language>Consider wrapping lines 47 - 49 in a log.isDebugEnabled() conditional</technical_language>

Target:
protected boolean shouldNotFilter(HttpServletRequest request) { final HttpSession session = request.getSession(false); if (session != null && !session.isNew()) { log.debug("User has a session: {}", request.getRemoteUser(), session.getId()); log.debug("Max inactive interval: {}", session.getMaxInactiveInterval()); if (log.isDebugEnabled()) { final Instant ctime = Instant.ofEpochMilli(session.getCreationTime()); final Instant atime = Instant.ofEpochMilli(session.getLastAccessedTime()); log.debug("Session creation time: {}, last access time: {}", ctime, atime); } return true; } else { log.debug("User does not have a session", request.getRemoteUser()); } return REST_API_SERVLET_PATH.equalsIgnoreCase(request.getServletPath()); }
Source:
<code>private VolumeType getType() { <START> if (!getStorageDomain().getStorageType().isOpenStackDomain() && <END> getParameters().getVolumeFormat() == VolumeFormat.RAW) { return VolumeType.Preallocated; } return VolumeType.Sparse; }</code><technical_language>This is fragile, break add new storage type. check for storage types (block file?). Also, this change is creating volumes vdsm supporting deferred preallocation, bad performance regression creating big raw images. This is place do checks, need modify code creating new volumes, code creating copying volumes</technical_language>

Target:
private VolumeType getType() { if ((getStorageDomain().getStorageType().isBlockDomain() || getStorageDomain().getStorageType().isFileDomain()) && getParameters().getVolumeFormat() == VolumeFormat.RAW) { return VolumeType.Preallocated; } return VolumeType.Sparse; }
Source:
<code>private void addVersionAndBranchTags(String remotePath, CVSTag[] tags) { TagCacheEntry entry = getTagCacheEntryFor(remotePath, true); entry.accessed(); for (int i = 0; i < tags.length; i++) { if (tags[i].getType() != CVSTag.DATE) { if (!getAllKnownTagsForParents(entry).contains(tags[i])) { <START> removeTagFromChildrenCacheEntries(entry, tags[i], false); <END> entry.tags.add(tags[i]); } } } }</code><technical_language>safe, if this tag for this entry, this entry removed, I understand boolean in signature of method. I changed method removes tags children necessary I added removing tag current entry. more clear now</technical_language>

Target:
private void addVersionAndBranchTags(String remotePath, CVSTag[] tags) { String name = getCachePathFor(remotePath); TagCacheEntry entry = (TagCacheEntry)versionAndBranchTags.get(name); if (entry == null) { entry = new TagCacheEntry(); versionAndBranchTags.put(name, entry); } else { entry.accessed(); } for (int i = 0; i < tags.length; i++) { if(tags[i].getType() != CVSTag.DATE){ entry.tags.add(tags[i]); } } }
Source:
<code>public QueryResponse getSpecies() throws IOException { Properties properties = new Properties(); <START> properties.load(DBAdaptorConnector.class.getResourceAsStream("/eva.properties")); <END> return setQueryResponse(archiveEvaproDbAdaptor.getSpecies(properties.getProperty("eva.version"), true)); }</code><technical_language>Is a need read prop file for request</technical_language>

Target:
public QueryResponse getSpecies() { return setQueryResponse(archiveEvaproDbAdaptor.getSpecies(properties.getProperty("eva.version"), true)); }
Source:
<code>void messageConsumptionCycle() { while (!killed) { long incrementedClock = 0; UpdateMessage message = null; if (!internalMessageQueue.isEmpty()) message = internalMessageQueue.removeFirst(); else synchronized (externalMessageLock) { if (!externalMessageQueue.isEmpty()) { message = takeExternalMessage(); } else { incrementedClock = ++clock; } } if (message == null) { localUpdateTermination(incrementedClock); while (message == null) { synchronized (externalMessageLock) { while (externalMessageQueue.isEmpty()) { try { externalMessageLock.wait(); } catch (InterruptedException e) { if (killed) return; } } message = takeExternalMessage(); } } } <START> message.receiver.update(message.direction, message.updateElement, null); <END> } }</code><technical_language>Marking this a high-priority functional correctness issue</technical_language>

Target:
void messageConsumptionCycle() { while (!killed) { long incrementedClock = 0; UpdateMessage message = null; if (!internalMessageQueue.isEmpty()) message = internalMessageQueue.removeFirst(); else synchronized (externalMessageLock) { if (!externalMessageQueue.isEmpty()) { message = takeExternalMessage(); } else { incrementedClock = ++clock; } } if (message == null) { localUpdateTermination(incrementedClock); while (message == null) { synchronized (externalMessageLock) { while (externalMessageQueue.isEmpty()) { try { externalMessageLock.wait(); } catch (InterruptedException e) { if (killed) return; } } message = takeExternalMessage(); } } } message.receiver.update(message.direction, message.updateElement, DifferentialTimestamp.ZERO); } }
Source:
<code>public boolean equals(Object o) { if (this == o) { return true; } if (o == null || o.getClass() != getClass()) { return false; } PeriodBroadcastDistributionRule that = (PeriodBroadcastDistributionRule) o; if (!Objects.equals(period, that.period)) { return false; } <START> if (!Objects.equals(includeFuture, that.includeFuture)) { <END> return false; } return Objects.equals(colocatedDataSources, that.colocatedDataSources); }</code><technical_language>includeFuture null. if (includeFuture != that.includeFuture)</technical_language>

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || o.getClass() != getClass()) { return false; } PeriodBroadcastDistributionRule that = (PeriodBroadcastDistributionRule) o; if (!Objects.equals(period, that.period)) { return false; } if (includeFuture != that.includeFuture) { return false; } return Objects.equals(colocatedDataSources, that.colocatedDataSources); }
Source:
<code>protected HttpClient createHttpClient() <START> throws Error <END> { int port = getPort(); Lookup<AuthSchemeProvider> authSchemeProvider = null; CredentialsProvider credsProvider = new BasicCredentialsProvider(); AuthScope authScope = new AuthScope(getHost(), port, AuthScope.ANY_REALM, AuthScope.ANY_SCHEME); if (user != null && user.length() > 0) { credsProvider.setCredentials( authScope, new UsernamePasswordCredentials(user, password) ); } else if (kerberos) { authSchemeProvider = RegistryBuilder.<AuthSchemeProvider>create() .register(AuthSchemes.SPNEGO, new SPNegoSchemeFactory(true)) .build(); credsProvider.setCredentials( authScope, new Credentials() { @Override public Principal getUserPrincipal() { return null; } @Override public String getPassword() { return null; } } ); } RequestConfig globalConfig = RequestConfig.custom() .setCookieSpec(CookieSpecs.IGNORE_COOKIES) .setConnectTimeout(timeout) .build(); HttpClientBuilder clientBuilder = HttpClientBuilder.create() .setConnectionManager(new BasicHttpClientConnectionManager(createConnectionSocketFactoryRegistry())) .setDefaultRequestConfig(globalConfig) .setDefaultCredentialsProvider(credsProvider) .setDefaultAuthSchemeRegistry(authSchemeProvider); if (!compress) { clientBuilder.disableContentCompression(); } return new HttpClient45(clientBuilder.build()); }</code><technical_language>is this needed</technical_language>

Target:
protected HttpClient createHttpClient() { int port = getPort(); Lookup<AuthSchemeProvider> authSchemeProvider = null; CredentialsProvider credsProvider = new BasicCredentialsProvider(); AuthScope authScope = new AuthScope(getHost(), port, AuthScope.ANY_REALM, AuthScope.ANY_SCHEME); if (user != null && user.length() > 0) { credsProvider.setCredentials( authScope, new UsernamePasswordCredentials(user, password) ); } else if (kerberos) { authSchemeProvider = RegistryBuilder.<AuthSchemeProvider>create() .register(AuthSchemes.SPNEGO, new SPNegoSchemeFactory(true)) .build(); credsProvider.setCredentials( authScope, new Credentials() { @Override public Principal getUserPrincipal() { return null; } @Override public String getPassword() { return null; } } ); } RequestConfig globalConfig = RequestConfig.custom() .setCookieSpec(CookieSpecs.IGNORE_COOKIES) .setConnectTimeout(timeout) .build(); HttpClientBuilder clientBuilder = HttpClientBuilder.create() .setConnectionManager(new BasicHttpClientConnectionManager(createConnectionSocketFactoryRegistry())) .setDefaultRequestConfig(globalConfig) .setDefaultCredentialsProvider(credsProvider) .setDefaultAuthSchemeRegistry(authSchemeProvider); if (!compress) { clientBuilder.disableContentCompression(); } return new HttpClient45(clientBuilder.build()); }
Source:
<code>public void bindPubSubProducer(String name, MessageChannel moduleOutputChannel, Properties properties) { validateProducerProperties(name, properties, SUPPORTED_PUBSUB_PRODUCER_PROPERTIES); RabbitPropertiesAccessor accessor = new RabbitPropertiesAccessor(properties); String exchangeName = applyPrefix(accessor.getPrefix(this.defaultPrefix), name); <START> declareExchangeIfNotPresent(new FanoutExchange(exchangeName)); <END> AmqpOutboundEndpoint endpoint = new AmqpOutboundEndpoint(determineRabbitTemplate(accessor)); endpoint.setExchangeName(exchangeName); endpoint.setRoutingKey(name); configureOutboundHandler(endpoint, accessor); doRegisterProducer(name, moduleOutputChannel, endpoint, accessor); }</code><technical_language>want this a TopicExchange well, instead of a FanoutExchange</technical_language>

Target:
public void bindPubSubProducer(String name, MessageChannel moduleOutputChannel, Properties properties) { validateProducerProperties(name, properties, SUPPORTED_PUBSUB_PRODUCER_PROPERTIES); RabbitPropertiesAccessor accessor = new RabbitPropertiesAccessor(properties); String exchangeName = applyPrefix(accessor.getPrefix(this.defaultPrefix), name); declareExchangeIfNotPresent(new TopicExchange(exchangeName)); AmqpOutboundEndpoint endpoint = new AmqpOutboundEndpoint(determineRabbitTemplate(accessor)); endpoint.setExchangeName(exchangeName); endpoint.setRoutingKey(name); configureOutboundHandler(endpoint, accessor); doRegisterProducer(name, moduleOutputChannel, endpoint, accessor); }
Source:
<code>private List<KeyRange> getRegionRowKeyRanges() throws SQLException { List<HRegionLocation> regionLocations = getRegionBoundaries(scanGrouper); List<KeyRange> regionKeyRanges = Lists.newArrayListWithExpectedSize(regionLocations.size()); <START> for(HRegionLocation regionLocation : regionLocations){ <END> HRegionInfo regionInfo = regionLocation.getRegionInfo(); KeyRange range = KeyRange.getKeyRange(regionInfo.getStartKey(), true, regionInfo.getEndKey(), false); regionKeyRanges.add(range); } return regionKeyRanges; }</code><technical_language>change "for(" "for ("? Other places too</technical_language>

Target:
private List<KeyRange> getRegionRowKeyRanges() throws SQLException { List<HRegionLocation> regionLocations = getRegionBoundaries(scanGrouper); List<KeyRange> regionKeyRanges = Lists.newArrayListWithCapacity(regionLocations.size()); for (int i = 0; i < regionLocations.size(); i++) { HRegionLocation regionLocation = regionLocations.get(i); HRegionInfo regionInfo = regionLocation.getRegionInfo(); byte[] startKey = regionInfo.getStartKey(); byte[] endKey = regionInfo.getEndKey(); KeyRange range = KeyRange.getKeyRange(startKey, endKey); regionKeyRanges.add(range); } return regionKeyRanges; }
Source:
<code>public void handleDelete(ActionParameters params) throws ActionException { final User user = params.getUser(); <START> final long id = ConversionHelper.getLong(params.getRequiredParam(PARAM_ID), -1); <END> if (!service.canModifyCategory(user, id)) { throw new ActionDeniedException("Tried to delete category: " + id); } try { layerService.delete(new long {id}); } catch (ServiceException e) { LOG.warn(e); throw new ActionException("Failed to delete layers"); } AuditLog.user(params.getClientIp(), params.getUser()) .withParam("id", id) .deleted(AuditLog.ResourceType.MYPLACES_LAYER); JSONObject response = new JSONObject(); JSONHelper.putValue(response, KEY_SUCCESS, true); ResponseHelper.writeResponse(params, response); }</code><technical_language>Prefer ActionParameters.getRequiredParamLong(PARAM_ID) instead. If id is a long want fail ActionDeniedException a ActionParamsExcepton instead</technical_language>

Target:
public void handleDelete(ActionParameters params) throws ActionException { final User user = params.getUser(); final long id = params.getRequiredParamLong(PARAM_ID); if (!service.canModifyCategory(user, id)) { throw new ActionDeniedException("Tried to delete category: " + id); } try { layerService.delete(new long {id}); } catch (ServiceException e) { LOG.warn(e); throw new ActionException("Failed to delete layers"); } AuditLog.user(params.getClientIp(), params.getUser()) .withParam("id", id) .deleted(AuditLog.ResourceType.MYPLACES_LAYER); JSONObject response = new JSONObject(); JSONHelper.putValue(response, KEY_SUCCESS, true); ResponseHelper.writeResponse(params, response); }
Source:
<code>private Set<LoadBalancer> createLoadBalancers(StackV4Request source, Stack stack) { Set<LoadBalancer> loadBalancers = new HashSet<>(); Set<TargetGroup> targetGroups = new HashSet<>(); if (StackType.DATALAKE.equals(source.getType())) { LOGGER.info("Setting up load balancers for stack {}", source.getName()); <START> Set<String> knoxGatewayGroupNames = loadBalancerConfigService.getKnoxGatewayGroups(stack); <END> Set<InstanceGroup> knoxGatewayGroups = stack.getInstanceGroups().stream() .filter(ig -> knoxGatewayGroupNames.contains(ig.getGroupName())) .collect(Collectors.toSet()); if (!knoxGatewayGroups.isEmpty()) { LOGGER.info("Knox gateway instance found; enabling Knox load balancer configuration."); TargetGroup targetGroup = new TargetGroup(); targetGroup.setType(TargetGroupType.KNOX.name()); targetGroup.setInstanceGroups(knoxGatewayGroups); targetGroups.add(targetGroup); knoxGatewayGroups.forEach(ig -> ig.addTargetGroup(targetGroup)); } } if (!targetGroups.isEmpty()) { LoadBalancer loadBalancer = new LoadBalancer(); loadBalancer.setStack(stack); loadBalancer.setType(LoadBalancerType.PRIVATE.name()); loadBalancer.setTargetGroups(targetGroups); targetGroups.forEach(tg -> tg.setLoadBalancer(loadBalancer)); loadBalancers.add(loadBalancer); } return loadBalancers; }</code><technical_language>this in entitlement</technical_language>

Target:
private Set<LoadBalancer> createLoadBalancers(StackV4Request source, Stack stack) { Set<LoadBalancer> loadBalancers = new HashSet<>(); Set<TargetGroup> targetGroups = new HashSet<>(); if (StackType.DATALAKE.equals(source.getType()) && entitlementService.datalakeLoadBalancerEnabled(ThreadBasedUserCrnProvider.getUserCrn(), ThreadBasedUserCrnProvider.getAccountId())) { LOGGER.info("Setting up load balancers for stack {}", source.getName()); Set<String> knoxGatewayGroupNames = loadBalancerConfigService.getKnoxGatewayGroups(stack); Set<InstanceGroup> knoxGatewayGroups = stack.getInstanceGroups().stream() .filter(ig -> knoxGatewayGroupNames.contains(ig.getGroupName())) .collect(Collectors.toSet()); if (!knoxGatewayGroups.isEmpty()) { LOGGER.info("Knox gateway instance found; enabling Knox load balancer configuration."); TargetGroup targetGroup = new TargetGroup(); targetGroup.setType(TargetGroupType.KNOX); targetGroup.setInstanceGroups(knoxGatewayGroups); targetGroups.add(targetGroup); knoxGatewayGroups.forEach(ig -> ig.addTargetGroup(targetGroup)); } } if (!targetGroups.isEmpty()) { LoadBalancer loadBalancer = new LoadBalancer(); loadBalancer.setStack(stack); loadBalancer.setType(LoadBalancerType.PRIVATE); loadBalancer.setTargetGroups(targetGroups); targetGroups.forEach(tg -> tg.setLoadBalancer(loadBalancer)); loadBalancers.add(loadBalancer); } return loadBalancers; }
Source:
<code>public static void sendGeoIntent(@NonNull Activity activity, @NonNull Location location, String placeName) { String geoStr = "geo:0,0?q=" + location.getLatitude() + "," + location.getLongitude(); if (!TextUtils.isEmpty(placeName)) { geoStr += "(" + <START> placeName +")"; <END> } try { activity.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(geoStr))); } catch (ActivityNotFoundException e) { FeedbackUtil.showMessage(activity, R.string.error_no_maps_app); } }</code><technical_language>If end this solution, please call Uri.encode this appended label string (as directed in <LINK_0> Also, please add a space '+' resolve checkstyle failure in CI</technical_language>

Target:
public static void sendGeoIntent(@NonNull Activity activity, @NonNull Location location, String placeName) { String geoStr = "geo:0,0?q=" + location.getLatitude() + "," + location.getLongitude(); if (!TextUtils.isEmpty(placeName)) { geoStr += "(" + placeName + ")"; } try { activity.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(Uri.encode(geoStr)))); } catch (ActivityNotFoundException e) { FeedbackUtil.showMessage(activity, R.string.error_no_maps_app); } }
Source:
<code>protected void delete(Context context, Integer id) throws AuthorizeException { try { MetadataSchema metadataSchema = metadataSchemaService.find(context, id); if (metadataSchema == null) { throw new ResourceNotFoundException("metadata schema with id: " + id + " not found"); } metadataSchemaService.delete(context, metadataSchema); } catch (SQLException e) { <START> throw new RuntimeException(e.getMessage(), e); <END> } }</code><technical_language>Again, getMessage() replaced a more informative error</technical_language>

Target:
protected void delete(Context context, Integer id) throws AuthorizeException { try { MetadataSchema metadataSchema = metadataSchemaService.find(context, id); if (metadataSchema == null) { throw new ResourceNotFoundException("metadata schema with id: " + id + " not found"); } metadataSchemaService.delete(context, metadataSchema); } catch (SQLException e) { throw new RuntimeException( "error while trying to delete " + MetadataSchemaRest.NAME + " with id: " + id, e ); } }
Source:
<code>public ScoredCandidates<T> generate( T content, ResultDescription desc, EquivToTelescopeResults equivToTelescopeResults ) { DefaultScoredCandidates.Builder<T> candidates = DefaultScoredCandidates.fromSource("Alias"); desc.startStage("Resolving aliases:"); EquivToTelescopeComponent generatorComponent = EquivToTelescopeComponent.create(); generatorComponent.setComponentName("Alias Equivalence Generator"); for (Alias alias : content.getAliases()) { desc.appendText(alias.toString()); } <START> desc.finishStage(); <END> Set<T> resolvedContentForAliases = content.getAliases().parallelStream() .filter(alias -> namespaceToMatch == null || alias.getNamespace().equals(namespaceToMatch)) .map(this::getLookupEntries) .flatMap(MoreStreams::stream) .map(this::getResolvedContent) .map(ResolvedContent::getAllResolvedResults) .flatMap(MoreStreams::stream) .filter(cls::isInstance) .map(cls::cast) .collect(MoreCollectors.toImmutableSet()); for (T identified : resolvedContentForAliases) { if (java.util.Objects.equals(content.getId(), identified.getId())) { continue; } if (identified.isActivelyPublished()) { candidates.addEquivalent(identified, Score.nullScore()); desc.appendText("Resolved %s", identified.getCanonicalUri()); } } equivToTelescopeResults.addGeneratorResult(generatorComponent); return candidates.build(); }</code><technical_language>description a bit more specific, e.g. alias matched, stage finished end of process</technical_language>

Target:
public ScoredCandidates<T> generate( T content, ResultDescription desc, EquivToTelescopeResults equivToTelescopeResults ) { DefaultScoredCandidates.Builder<T> candidates = DefaultScoredCandidates.fromSource("Alias"); desc.startStage("Resolving aliases:"); EquivToTelescopeComponent generatorComponent = EquivToTelescopeComponent.create(); generatorComponent.setComponentName("Alias Equivalence Generator"); for (Alias alias : content.getAliases()) { desc.appendText(alias.toString()); } desc.finishStage(); Set<T> resolvedContentForAliases = content.getAliases().parallelStream() .filter(alias -> namespaceToMatch == null || alias.getNamespace().equals(namespaceToMatch)) .map(this::getLookupEntries) .flatMap(MoreStreams::stream) .map(this::getResolvedContent) .map(ResolvedContent::getAllResolvedResults) .flatMap(MoreStreams::stream) .filter(cls::isInstance) .map(cls::cast) .collect(MoreCollectors.toImmutableSet()); for (T identified : resolvedContentForAliases) { if (java.util.Objects.equals(content.getId(), identified.getId())) { continue; } if (identified.isActivelyPublished()) { candidates.addEquivalent(identified, Score.nullScore()); desc.appendText("Found potential candidate in %s", identified.getCanonicalUri()); } } equivToTelescopeResults.addGeneratorResult(generatorComponent); return candidates.build(); }
Source:
<code>private void updateQcowCompat() { <START> if (getImage().getVolumeFormat().equals(VolumeFormat.COW)) { <END> getImage().setQcowCompat(QcowCompat.QCOW2_V2); if (FeatureSupported.qcowCompatSupported(getStoragePool().getCompatibilityVersion())) { QemuImageInfo qemuImageInfo = ImagesHandler.getQemuImageInfoFromVdsm(getStoragePool().getId(), getStorageDomainId(), getImage().getImage().getDiskId(), getImage().getImageId(), false); if (qemuImageInfo != null) { getImage().setQcowCompat(qemuImageInfo.getQcowCompat()); } imageDao.update(getImage().getImage()); } } }</code><technical_language>consider extracting a method this code is similar BaseImagesCommand. a nice day :)</technical_language>

Target:
private void updateQcowCompat() { if (getImage().getVolumeFormat().equals(VolumeFormat.COW)) { getImage().setQcowCompat(QcowCompat.QCOW2_V2); if (FeatureSupported.qcowCompatSupported(getStoragePool().getCompatibilityVersion())) { QemuImageInfo qemuImageInfo = ImagesHandler.getQemuImageInfoFromVdsm(getStoragePool().getId(), getStorageDomainId(), getImage().getImage().getDiskId(), getImage().getImageId(), false); if (qemuImageInfo != null) { getImage().setQcowCompat(qemuImageInfo.getQcowCompat()); } } imageDao.update(getImage().getImage()); } }