auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private VectorizedParquetColumnReader buildVectorizedParquetReader( TypeInfo typeInfo, Type type, PageReadStore pages, List<ColumnDescriptor> columnDescriptors, boolean skipTimestampConversion, int depth) throws IOException { List<ColumnDescriptor> descriptors = getAllColumnDescriptorByType(depth, type, columnDescriptors); switch (typeInfo.getCategory()) { case PRIMITIVE: if (columnDescriptors == null || columnDescriptors.isEmpty()) { return null; } else { return new VectorizedPrimitiveColumnReader(descriptors.get(0), pages.getPageReader(descriptors.get(0)), skipTimestampConversion, type); } case STRUCT: StructTypeInfo structTypeInfo = (StructTypeInfo) typeInfo; List<VectorizedParquetColumnReader> fieldReaders = new ArrayList<>(); List<TypeInfo> fieldTypes = structTypeInfo.getAllStructFieldTypeInfos(); List<Type> types = type.asGroupType().getFields(); for (int i = 0; i < fieldTypes.size(); i++) { VectorizedParquetColumnReader r = buildVectorizedParquetReader(fieldTypes.get(i), types.get(i), pages, descriptors, skipTimestampConversion, depth + 1); if (r != null) { fieldReaders.add(r); } } if (fieldReaders.size() > 0) { return new VectorizedStructReader(fieldReaders); } else { return null; } case LIST: case MAP: case UNION: default: throw new RuntimeException("Unsupported category " + typeInfo.getCategory().name()); } }

Target:
private VectorizedColumnReader buildVectorizedParquetReader( TypeInfo typeInfo, Type type, PageReadStore pages, List<ColumnDescriptor> columnDescriptors, boolean skipTimestampConversion, int depth) throws IOException { List<ColumnDescriptor> descriptors = getAllColumnDescriptorByType(depth, type, columnDescriptors); switch (typeInfo.getCategory()) { case PRIMITIVE: if (columnDescriptors == null || columnDescriptors.isEmpty()) { throw new RuntimeException( "Failed to find related Parquet column descriptor with type " + type); } else { return new VectorizedPrimitiveColumnReader(descriptors.get(0), pages.getPageReader(descriptors.get(0)), skipTimestampConversion, type); } case STRUCT: StructTypeInfo structTypeInfo = (StructTypeInfo) typeInfo; List<VectorizedColumnReader> fieldReaders = new ArrayList<>(); List<TypeInfo> fieldTypes = structTypeInfo.getAllStructFieldTypeInfos(); List<Type> types = type.asGroupType().getFields(); for (int i = 0; i < fieldTypes.size(); i++) { VectorizedColumnReader r = buildVectorizedParquetReader(fieldTypes.get(i), types.get(i), pages, descriptors, skipTimestampConversion, depth + 1); if (r != null) { fieldReaders.add(r); } else { throw new RuntimeException( "Fail to build Parquet vectorized reader based on Hive type " + fieldTypes.get(i) .getTypeName() + " and Parquet type" + types.get(i).toString()); } } return new VectorizedStructColumnReader(fieldReaders); case LIST: case MAP: case UNION: default: throw new RuntimeException("Unsupported category " + typeInfo.getCategory().name()); } }
Source:
public Map<String, String> createUnmaterializedReference (String resourceName, Resource resource){ Assert.notNull(resource, "Resource argument cannot be null."); Assert.isNull(resource.getHref(), "Resource "+ resourceName +" must be unmaterialized and not have an 'href' property."); Map<String, String> reference = ResourceUtil.filterNonStringvalues(((AbstractResource) resource).dirtyProperties); return reference; }

Target:
public Map<String, String> createUnmaterializedReference (String resourceName, Resource resource){ Assert.notNull(resource, "Resource argument cannot be null."); Assert.isNull(resource.getHref(), "Resource "+ resourceName +" must be unmaterialized and not have an 'href' property."); Map<String, String> reference = ResourceUtil.filterNonStringvaluesWithiResourceDirtyProperties(resource); return reference; }
Source:
public String getStatus() { if (StringUtils.isBlank(status)) { status = STATUS_OK; } if (StringUtils.isNotBlank(error)) { status = STATUS_ERROR; } if (StringUtils.isNotBlank(failure)) { status = STATUS_FAILURE; } return status; }

Target:
public Status getStatus() { if (StringUtils.isNotBlank(error)) { return Status.ERROR; } if (StringUtils.isNotBlank(failure)) { return Status.FAILURE; } if (skipped != null) { return Status.SKIPPED; } return Status.OK; }
Source:
public Iterator<String> getCodecs() { return codecs; }

Target:
public String[] getCodecs() { return codecs; }
Source:
private int removePrefixes(char[] s, int len) { if (len > 5 && StemmerUtil.startsWith(s, len, "naj")) return StemmerUtil.deleteN(s, 0, len, 3); return len; }

Target:
private int removePrefixes(char[] s, int len) { if (len > 5 && startsWith(s, len, "naj")) { return deleteN(s, 0, len, 3); } return len; }
Source:
protected BeanDefinitionBuilder parseHandler(Element element, ParserContext parserContext) { BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(RedisQueueOutboundGateway.class); builder.addConstructorArgValue(element.getAttribute("control-queue")); String connectionFactory = element.getAttribute("connection-factory"); if (!StringUtils.hasText(connectionFactory)) { connectionFactory = "redisConnectionFactory"; } builder.addConstructorArgReference(connectionFactory); IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "reply-channel","outputChannel"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "expect-message"); IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "serializer"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "reply-timeout", "timeout"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "requires-reply"); return builder; }

Target:
protected BeanDefinitionBuilder parseHandler(Element element, ParserContext parserContext) { BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(RedisQueueOutboundGateway.class); builder.addConstructorArgValue(element.getAttribute("queue")); String connectionFactory = element.getAttribute("connection-factory"); if (!StringUtils.hasText(connectionFactory)) { connectionFactory = "redisConnectionFactory"; } builder.addConstructorArgReference(connectionFactory); IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "reply-channel","outputChannel"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "extract-payload"); IntegrationNamespaceUtils.setReferenceIfAttributeDefined(builder, element, "serializer"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "reply-timeout", "receiveTimeout"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "requires-reply"); return builder; }
Source:
public <T> T executeReadWriteTransaction(SessionWork<T> sessionWork) { return executeReadWriteTransaction(sessionWork, true); }

Target:
public <T> T executeReadWriteTransaction(SessionWork<T> sessionWork) { return tryExecuteTransactionLoop(sessionWork, true, true); }
Source:
public static ParcelFileDescriptor[] createPipe() throws IOException { Path path = TempDirectory.create(); File file = new File(path.toFile(), "pipe-" + System.nanoTime()); if (file.exists() && !file.delete()) { throw new IOException("Cannot delete pipe file: " + file.getAbsolutePath()); } if (!file.createNewFile()) { throw new IOException("Cannot create pipe file: " + file.getAbsolutePath()); } ParcelFileDescriptor readSide = open(file, ParcelFileDescriptor.MODE_READ_ONLY); ParcelFileDescriptor writeSide = open(file, ParcelFileDescriptor.MODE_READ_WRITE); file.deleteOnExit(); return new ParcelFileDescriptor[]{readSide, writeSide}; }

Target:
public static ParcelFileDescriptor[] createPipe() throws IOException { File file = new File(RuntimeEnvironment.getTempDirectory().create(PIPE_TMP_DIR).toFile(), PIPE_FILE_NAME); if (!file.createNewFile()) { throw new IOException("Cannot create pipe file: " + file.getAbsolutePath()); } ParcelFileDescriptor readSide = open(file, ParcelFileDescriptor.MODE_READ_ONLY); ParcelFileDescriptor writeSide = open(file, ParcelFileDescriptor.MODE_READ_WRITE); file.deleteOnExit(); return new ParcelFileDescriptor[]{readSide, writeSide}; }
Source:
public int insertNewTaskResult(TaskResult taskResult) throws InternalErrorException { int newTaskResultId = Utils.getNewId(jdbc, "tasks_results_id_seq"); byte[] standardMessage = null; byte[] errorMessage = null; if(taskResult.getStandardMessage() != null) standardMessage = taskResult.getStandardMessage().getBytes(StandardCharsets.UTF_8); if(taskResult.getErrorMessage() != null) errorMessage = taskResult.getErrorMessage().getBytes(StandardCharsets.UTF_8); standardMessage = clearZeroBytesFromString(standardMessage, 4000); errorMessage = clearZeroBytesFromString(errorMessage, 4000); jdbc.update( "insert into tasks_results(" + "id, " + "task_id, " + "engine_id, " + "destination_id, " + "status, " + "err_message, " + "std_message, " + "return_code, " + "timestamp) values (?,?,?,?,?,?,?, " + Compatibility.toDate("?","'DD-MM-YYYY HH24:MI:SS'") + ")", newTaskResultId, taskResult.getTaskId(), 0, taskResult.getDestinationId(), taskResult.getStatus().toString(), errorMessage == null ? null : new String(errorMessage, StandardCharsets.UTF_8), standardMessage == null ? null : new String(standardMessage, StandardCharsets.UTF_8), taskResult.getReturnCode(), getDateFormatter().format(taskResult.getTimestamp())); return newTaskResultId; }

Target:
public int insertNewTaskResult(TaskResult taskResult) throws InternalErrorException { int newTaskResultId = Utils.getNewId(jdbc, "tasks_results_id_seq"); byte[] standardMessage = null; byte[] errorMessage = null; if(taskResult.getStandardMessage() != null) standardMessage = taskResult.getStandardMessage().getBytes(StandardCharsets.UTF_8); if(taskResult.getErrorMessage() != null) errorMessage = taskResult.getErrorMessage().getBytes(StandardCharsets.UTF_8); standardMessage = clearZeroBytesFromString(standardMessage, 4000); errorMessage = clearZeroBytesFromString(errorMessage, 4000); jdbc.update( "insert into tasks_results(" + "id, " + "task_id, " + "engine_id, " + "destination_id, " + "status, " + "err_message, " + "std_message, " + "return_code, " + "timestamp) values (?,?,?,?,?,?,?, " + Compatibility.toDate("?","'DD-MM-YYYY HH24:MI:SS'") + ")", newTaskResultId, taskResult.getTaskId(), 1, taskResult.getDestinationId(), taskResult.getStatus().toString(), errorMessage == null ? null : new String(errorMessage, StandardCharsets.UTF_8), standardMessage == null ? null : new String(standardMessage, StandardCharsets.UTF_8), taskResult.getReturnCode(), getDateFormatter().format(taskResult.getTimestamp())); return newTaskResultId; }
Source:
public void setup() { rateLimiter = mock(RateLimiter.class); rateLimiterFilter = new RateLimiterFilter(rateLimiter, new ObjectMapper()); Account account = new Account(ACCOUNT_ID, TokenPaymentType.CARD, "some-token-link"); SecurityContext mockSecurityContext = mock(SecurityContext.class); lenient().when(mockSecurityContext.getUserPrincipal()).thenReturn(account); lenient().when(mockContainerRequestContext.getSecurityContext()).thenReturn(mockSecurityContext); lenient().when(mockContainerRequestContext.getMethod()).thenReturn("GET"); when(mockContainerRequestContext.getUriInfo()).thenReturn(mockUriInfo); when(mockUriInfo.getPath()).thenReturn(""); }

Target:
public void setup() { rateLimiter = mock(RateLimiter.class); rateLimiterFilter = new RateLimiterFilter(rateLimiter, new ObjectMapper()); when(mockContainerRequestContext.getUriInfo()).thenReturn(mockUriInfo); when(mockUriInfo.getPath()).thenReturn(""); }
Source:
public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); app = (WikipediaApp)getActivity().getApplicationContext(); for (int i = 0; i < ACTION_ITEMS_ALL.length; i++) { actionViews[i] = getView().findViewById(ACTION_ITEMS_ALL[i]); actionViews[i].setOnClickListener(this); } for (int i = 0; i < ACTION_ITEMS_LOGGED_IN_ONLY.length; i++) { loggedInOnyActionViews[i] = getView().findViewById(ACTION_ITEMS_LOGGED_IN_ONLY[i]); } wikipediaZeroText = (TextView) getView().findViewById(R.id.nav_item_zero); randomHandler = new RandomHandler(getView().findViewById(R.id.nav_item_random), getView().findViewById(R.id.nav_item_random_icon), getView().findViewById(R.id.nav_item_random_progressbar), new RandomHandler.RandomListener() { @Override public void onRandomPageReceived(PageTitle title) { if (!isAdded()) { return; } if (title == null) { ((PageActivity) getActivity()).showNetworkError(); } else { HistoryEntry historyEntry = new HistoryEntry(title, HistoryEntry.SOURCE_RANDOM); ((PageActivity) getActivity()).displayNewPage(title, historyEntry, true); } } }); }

Target:
public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); app = (WikipediaApp)getActivity().getApplicationContext(); for (int i = 0; i < ACTION_ITEMS_ALL.length; i++) { actionViews[i] = getView().findViewById(ACTION_ITEMS_ALL[i]); actionViews[i].setOnClickListener(this); } for (int i = 0; i < ACTION_ITEMS_LOGGED_IN_ONLY.length; i++) { loggedInOnyActionViews[i] = getView().findViewById(ACTION_ITEMS_LOGGED_IN_ONLY[i]); } wikipediaZeroText = (TextView) getView().findViewById(R.id.nav_item_zero); randomHandler = new RandomHandler(getView().findViewById(R.id.nav_item_random), getView().findViewById(R.id.nav_item_random_icon), getView().findViewById(R.id.nav_item_random_progressbar), new RandomHandler.RandomListener() { @Override public void onRandomPageReceived(@Nullable PageTitle title) { if (!isAdded()) { return; } if (title == null) { ((PageActivity) getActivity()).showNetworkError(); } else { HistoryEntry historyEntry = new HistoryEntry(title, HistoryEntry.SOURCE_RANDOM); ((PageActivity) getActivity()).displayNewPage(title, historyEntry, true); } } }); }
Source:
public Function1D<Double, Double> getVolatilityFunction(final double forward, final double[] strikes, final double expiry, final double[] impliedVols) { final List<SABRFormulaData> modelParams; final int n; if (getModel() instanceof SABRHaganVolatilityFunction) { modelParams = getFittedModelParameters(forward, strikes, expiry, impliedVols); n = strikes.length; } else { modelParams = getFittedModelParametersGlobal(forward, strikes, expiry, impliedVols); n = 1; } return new Function1D<Double, Double>() { @SuppressWarnings("synthetic-access") @Override public Double evaluate(final Double strike) { final EuropeanVanillaOption option = new EuropeanVanillaOption(strike, expiry, true); final Function1D<SABRFormulaData, Double> volFunc = getModel().getVolatilityFunction(option, forward); if (n == 1) { return volFunc.evaluate(modelParams.get(0)); } final int index = SurfaceArrayUtils.getLowerBoundIndex(strikes, strike); if (index == 0) { return volFunc.evaluate(modelParams.get(0)); } if (index >= n - 2) { return volFunc.evaluate(modelParams.get(n - 3)); } final double w = getWeightingFunction().getWeight(strikes, index, strike); if (w == 1) { return volFunc.evaluate(modelParams.get(index - 1)); } else if (w == 0) { return volFunc.evaluate(modelParams.get(index)); } else { return w * volFunc.evaluate(modelParams.get(index - 1)) + (1 - w) * volFunc.evaluate(modelParams.get(index)); } } }; }

Target:
public Function1D<Double, Double> getVolatilityFunction(final double forward, final double[] strikes, final double expiry, final double[] impliedVols) { final List<SABRFormulaData> modelParams; final int n; List<SABRFormulaData> modelParamsTmp; int nTmp; try { modelParamsTmp = getFittedModelParameters(forward, strikes, expiry, impliedVols); nTmp = strikes.length; } catch (final Exception e) { nTmp = 1; modelParamsTmp = getFittedModelParametersGlobal(forward, strikes, expiry, impliedVols); } modelParams = modelParamsTmp; n = nTmp; if (n == 1) { return new Function1D<Double, Double>() { @SuppressWarnings("synthetic-access") @Override public Double evaluate(final Double strike) { final EuropeanVanillaOption option = new EuropeanVanillaOption(strike, expiry, true); final Function1D<SABRFormulaData, Double> volFunc = getModel().getVolatilityFunction(option, forward); return volFunc.evaluate(modelParams.get(0)); } }; } return getVolatilityFunctionFromModelParameters(forward, strikes, expiry, modelParams); }
Source:
public String createUrl(String details) { details = details == null ? "" : details; String encodedUrl; try { URI uri = new URI(WEB_PROTOCOL, domainName, API_ENDPOINT + details, null); encodedUrl = uri.toString(); } catch (URISyntaxException e) { encodedUrl = WEB_PROTOCOL + "://" + domainName + API_ENDPOINT + details; } return encodedUrl; }

Target:
public String createUrl(String details) { details = details == null ? "" : details; String encodedUrl; try { URI uri = new URI(WEB_PROTOCOL, domainName, API_ENDPOINT + details, null); encodedUrl = uri.toString(); return encodedUrl; } catch (URISyntaxException e) { LOGGER.severe("Exception message=" + e.getMessage() + " Failed to create URI for Domain Name=" + domainName + " with url details=" + details); return ""; } }
Source:
public AnimalInWater(final Animal anim, final EventDispatcher eventDispatcher) { super(eventDispatcher); this.animal = anim; Timer tmr = new Timer(); tmr.scheduleAtFixedRate(new TimerTask() { @Override public void run() { AnimalInWater.this.animal.returnToBoat(); tmr.cancel(); } }, RESPAWN_DELAY, RESPAWN_DELAY); }

Target:
public AnimalInWater(final Animal anim, final EventDispatcher eventDispatcher) { super(eventDispatcher); this.animal = anim; Timer tmr = new Timer(); tmr.scheduleAtFixedRate(new TimerTask() { @Override public void run() { animal.returnToBoat(); tmr.cancel(); } }, RESPAWN_DELAY, RESPAWN_DELAY); }
Source:
private void downloadData(EntityType entityType, ExcelWriter writer) throws IOException { List<Object> headers = StreamSupport.stream(entityType.getAttributes().spliterator(), false) .filter(attr -> attr.getDataType() != AttributeType.COMPOUND) .map(Attribute::getName) .collect(Collectors.toList()); if (!writer.hasSheet(entityType.getId())) { writer.createSheet(entityType.getId(), headers); } writer.writeRows( dataService.findAll(entityType.getId()).map(DataRowMapper::mapDataRow), entityType.getId()); }

Target:
private void downloadData(EntityType entityType, ExcelWriter writer) { List<Object> headers = Streams.stream(entityType.getAttributes()) .filter(attr -> attr.getDataType() != AttributeType.COMPOUND) .map(Attribute::getName) .collect(toList()); if (!writer.hasSheet(entityType.getId())) { writer.createSheet(entityType.getId(), headers); } dataService .getRepository(entityType.getId()) .forEachBatched(entities -> writeRows(entities, entityType, writer), BATCH_SIZE); }
Source:
public void onSaveHosts() { final MultipleHostsModel hostsModel = (MultipleHostsModel) getWindow(); if (hostsModel == null) { return; } if (!hostsModel.validate()) { return; } hostsModel.startProgress(null); ArrayList<VdcActionParametersBase> parametersList = new ArrayList<VdcActionParametersBase>(); for (Object object : hostsModel.getHosts().getItems()) { HostDetailModel hostDetailModel = (HostDetailModel) ((EntityModel) object).getEntity(); VDS host = new VDS(); host.setVdsName(hostDetailModel.getName()); host.setHostName(hostDetailModel.getAddress()); host.setSSHKeyFingerprint(hostDetailModel.getFingerprint()); host.setPort(54321); host.setVdsGroupId(getEntity().getId()); host.setpm_enabled(false); AddVdsActionParameters parameters = new AddVdsActionParameters(); parameters.setVdsId(host.getId()); parameters.setvds(host); parameters.setPassword(hostDetailModel.getPassword()); parameters.setUsername("root"); parameters.setOverrideFirewall(false); parameters.setRebootAfterInstallation(getEntity().supportsVirtService()); parametersList.add(parameters); } Frontend.RunMultipleAction(VdcActionType.AddVds, parametersList, true, new IFrontendMultipleActionAsyncCallback() { @Override public void executed(FrontendMultipleActionAsyncResult result) { hostsModel.stopProgress(); boolean isAllCanDoPassed = true; for (VdcReturnValueBase returnValueBase : result.getReturnValue()) { isAllCanDoPassed = isAllCanDoPassed && returnValueBase.getCanDoAction(); if (!isAllCanDoPassed) { break; } } if (isAllCanDoPassed) { updateAlerts(); cancel(); } } }, null); }

Target:
public void onSaveHosts() { final MultipleHostsModel hostsModel = (MultipleHostsModel) getWindow(); if (hostsModel == null) { return; } if (!hostsModel.validate()) { return; } hostsModel.startProgress(null); ArrayList<VdcActionParametersBase> parametersList = new ArrayList<VdcActionParametersBase>(); for (Object object : hostsModel.getHosts().getItems()) { HostDetailModel hostDetailModel = (HostDetailModel) ((EntityModel) object).getEntity(); VDS host = new VDS(); host.setVdsName(hostDetailModel.getName()); host.setHostName(hostDetailModel.getAddress()); host.setSSHKeyFingerprint(hostDetailModel.getFingerprint()); host.setPort(54321); host.setSSHPort(22); host.setSSHUsername("root"); host.setVdsGroupId(getEntity().getId()); host.setpm_enabled(false); AddVdsActionParameters parameters = new AddVdsActionParameters(); parameters.setVdsId(host.getId()); parameters.setvds(host); parameters.setPassword(hostDetailModel.getPassword()); parameters.setOverrideFirewall(false); parameters.setRebootAfterInstallation(getEntity().supportsVirtService()); parametersList.add(parameters); } Frontend.RunMultipleAction(VdcActionType.AddVds, parametersList, true, new IFrontendMultipleActionAsyncCallback() { @Override public void executed(FrontendMultipleActionAsyncResult result) { hostsModel.stopProgress(); boolean isAllCanDoPassed = true; for (VdcReturnValueBase returnValueBase : result.getReturnValue()) { isAllCanDoPassed = isAllCanDoPassed && returnValueBase.getCanDoAction(); if (!isAllCanDoPassed) { break; } } if (isAllCanDoPassed) { updateAlerts(); cancel(); } } }, null); }
Source:
public static void addFogColor(EntityViewRenderEvent.FogColors event) { BlockState state = event.getInfo().getFluidState().getBlockState(); IWorldReader world = event.getInfo().getRenderViewEntity().world; BlockPos pos = event.getInfo().getBlockPos(); Entity entity = event.getInfo().getRenderViewEntity(); Vec3d originalColor = new Vec3d(event.getRed(), event.getGreen(), event.getBlue()); float partialTick = (float) (event.getRenderPartialTicks()); Vec3d fogColor = event.getInfo().getFluidState().getBlockState().getBlock().getFogColor(state, world, pos, entity, originalColor, partialTick); if(event.getInfo().getFluidState().getBlockState().getBlock().getFogColor(state, world, pos, entity, originalColor, partialTick) != null) { event.setRed((float) fogColor.getX()); event.setGreen((float) fogColor.getY()); event.setBlue((float) fogColor.getZ()); } }

Target:
public static void addFogColor(EntityViewRenderEvent.FogColors event) { BlockState state = event.getInfo().getFluidState().getBlockState(); IWorldReader world = event.getInfo().getRenderViewEntity().world; BlockPos pos = event.getInfo().getBlockPos(); Entity entity = event.getInfo().getRenderViewEntity(); Vec3d originalColor = new Vec3d(event.getRed(), event.getGreen(), event.getBlue()); float partialTick = (float) (event.getRenderPartialTicks()); if(state.getBlock() instanceof IMSFog) { IMSFog fog = (IMSFog) (state.getBlock()); Vec3d fogColor = fog.getMSFogColor(state, world, pos, entity, originalColor, partialTick); event.setRed((float) fogColor.getX()); event.setGreen((float) fogColor.getY()); event.setBlue((float) fogColor.getZ()); } }
Source:
protected Object computeValue(PermanentProperty prop, Object value, Object last, Flag flag) { if (prop == Value.IN_TIMEOUT) { Timeout t = scoreBoard.getCurrentTimeout(); return t.isRunning() && this == t.getOwner() && !t.isReview(); } if (prop == Value.IN_OFFICIAL_REVIEW) { Timeout t = scoreBoard.getCurrentTimeout(); return t.isRunning() && this == t.getOwner() && t.isReview(); } if (prop == Value.TRIP_SCORE && flag != Flag.COPY && scoreBoard.isInJam() && (Integer)value > 0) { if (getCurrentTrip().getNumber() == 1 && !getScoreBoard().isInOvertime()) { set(Value.TRIP_SCORE,0); getRunningOrEndedTeamJam().addScoringTrip(); set(Value.TRIP_SCORE,value); } tripScoreTimerTask.cancel(); tripScoreTimer.purge(); tripScoreTimerTask = new TimerTask() { @Override public void run() { execute(Command.ADD_TRIP); } }; tripScoreTimer.schedule(tripScoreTimerTask, 4000); } if (prop == Value.NO_INITIAL && flag != Flag.COPY) { if (!(Boolean)value && (Boolean)last) { execute(Command.ADD_TRIP); } else if ((Boolean)value && !(Boolean)last && getCurrentTrip().getNumber() == 2 && (Integer)get(Value.JAM_SCORE) == 0) { execute(Command.REMOVE_TRIP); } } if (prop == Value.INJURY && flag != Flag.COPY && (Boolean)value) { set(Value.CALLOFF, false); } if (prop == Value.CALLOFF && flag != Flag.COPY && (Boolean)value) { set(Value.INJURY, false); } return value; }

Target:
protected Object computeValue(PermanentProperty prop, Object value, Object last, Flag flag) { if (prop == Value.IN_TIMEOUT) { Timeout t = scoreBoard.getCurrentTimeout(); return t.isRunning() && this == t.getOwner() && !t.isReview(); } if (prop == Value.IN_OFFICIAL_REVIEW) { Timeout t = scoreBoard.getCurrentTimeout(); return t.isRunning() && this == t.getOwner() && t.isReview(); } if (prop == Value.TRIP_SCORE && flag != Flag.COPY && (Integer)value > 0) { if (getCurrentTrip().getNumber() == 1 && !getScoreBoard().isInOvertime()) { getCurrentTrip().set(ScoringTrip.Value.ANNOTATION,"Points were added without Trip +1\n" + get(ScoringTrip.Value.ANNOTATION)); execute(Command.ADD_TRIP); } if (scoreBoard.isInJam()) { tripScoreTimerTask.cancel(); tripScoreTimer.purge(); tripScoreTimerTask = new TimerTask() { @Override public void run() { execute(Command.ADD_TRIP); } }; tripScoreTimer.schedule(tripScoreTimerTask, 4000); } } if (prop == Value.NO_INITIAL && flag != Flag.COPY) { if (!(Boolean)value && (Boolean)last) { execute(Command.ADD_TRIP); } else if ((Boolean)value && !(Boolean)last && getCurrentTrip().getNumber() == 2 && (Integer)get(Value.JAM_SCORE) == 0) { execute(Command.REMOVE_TRIP); } } if (prop == Value.INJURY && flag != Flag.COPY && (Boolean)value) { set(Value.CALLOFF, false); } if (prop == Value.CALLOFF && flag != Flag.COPY && (Boolean)value) { set(Value.INJURY, false); } return value; }
Source:
private void throwOrDelay(Throwable e, String actionName, int attempts) throws CloudStorageException { if (e instanceof CloudStorageException) { CloudStorageException cse = (CloudStorageException) e; if (cse.isRetryable() && attempts < maxAttempts) { long delay = (cse.getRetryDelayMs() > 0) ? cse.getRetryDelayMs() : defaultRetryDelay; logger.error(String.format("%s failed attempt %d, retrying after %d ms.", actionName, attempts, delay)); try { Thread.sleep(delay); } catch (InterruptedException iex) { } vcrMetrics.retryCount.inc(); vcrMetrics.retryWaitTime.update(delay, TimeUnit.MILLISECONDS); } else { throw cse; } } else { throw new CloudStorageException(actionName + " failed", e); } }

Target:
private void throwOrDelay(Throwable e, String actionName, int attempts) throws CloudStorageException { if (e instanceof CloudStorageException) { CloudStorageException cse = (CloudStorageException) e; if (cse.isRetryable() && attempts < maxAttempts) { long delay = (cse.getRetryDelayMs() > 0) ? cse.getRetryDelayMs() : defaultRetryDelay; logger.error("{} failed attempt {}, retrying after ms.", actionName, attempts, delay); try { Thread.sleep(delay); } catch (InterruptedException iex) { } vcrMetrics.retryCount.inc(); vcrMetrics.retryWaitTimeMsec.inc(delay); } else { throw cse; } } else { throw new CloudStorageException(actionName + " failed", e); } }
Source:
private TreeNode findNode(TreeNode node, SystemTreeItemModel model) { TreeNode result = null; if(node == null) { return null; } int i = 0; while(result == null && i < node.getChildCount()) { if(null != model && model.equals(node.getChildValue(i))) { result = node.setChildOpen(i, true); break; } if(node.isChildOpen(i)) { result = findNode(node.setChildOpen(i, true), model); } i++; } return result; }

Target:
private TreeNode findNode(TreeNode node, SystemTreeItemModel model) { TreeNode result = null; if (node == null) { return null; } int i = 0; while (result == null && i < node.getChildCount()) { if (model != null && model.equals(node.getChildValue(i))) { result = node.setChildOpen(i, true); break; } if (node.isChildOpen(i)) { result = findNode(node.setChildOpen(i, true), model); } i++; } return result; }
Source:
protected void doWork(IProgressMonitor monitor) throws Exception { long start = System.currentTimeMillis(); StringBuffer response = new StringBuffer(); ByteArrayInputStream inputStream = null; try { Map<String, String> parameters = new HashMap<String, String>(); parameters.put("sessionId", ClientSessionManager.getSessionId()); if (DbUtil.isDbInit()) { parameters.put("wait", "true"); } StringBuilder payload = new StringBuilder(XML_START); for (int data : gammaIds) { payload.append(PREFIX); payload.append(data); payload.append(POSTFIX); } payload.append(XML_FINISH); inputStream = new ByteArrayInputStream(payload.toString().getBytes("UTF-8")); String url = HttpUrlBuilderClient.getInstance().getOsgiServletServiceUrl(OseeServerContext.SEARCH_TAGGING_CONTEXT, parameters); response.append(HttpProcessor.put(new URL(url), inputStream, "application/xml", "UTF-8")); OseeLog.logf(Activator.class, Level.FINEST, "Transmitted to Tagger in [%d ms]", System.currentTimeMillis() - start); } catch (Exception ex) { if (response.length() > 0) { response.append("\n"); } response.append(ex.getLocalizedMessage()); OseeLog.log(Activator.class, Level.SEVERE, response.toString(), ex); } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException ex) { OseeLog.log(Activator.class, Level.SEVERE, ex); } } } }

Target:
protected void doWork(IProgressMonitor monitor) throws Exception { long start = System.currentTimeMillis(); StringBuilder response = new StringBuilder(); ByteArrayInputStream inputStream = null; try { Map<String, String> parameters = new HashMap<String, String>(); parameters.put("sessionId", ClientSessionManager.getSessionId()); if (DbUtil.isDbInit()) { parameters.put("wait", "true"); } StringBuilder payload = new StringBuilder(XML_START); for (int data : gammaIds) { payload.append(PREFIX); payload.append(data); payload.append(POSTFIX); } payload.append(XML_FINISH); inputStream = new ByteArrayInputStream(payload.toString().getBytes("UTF-8")); String url = HttpUrlBuilderClient.getInstance().getOsgiServletServiceUrl(OseeServerContext.SEARCH_TAGGING_CONTEXT, parameters); response.append(HttpProcessor.put(new URL(url), inputStream, "application/xml", "UTF-8")); OseeLog.logf(Activator.class, Level.FINEST, "Transmitted to Tagger in [%d ms]", System.currentTimeMillis() - start); } catch (Exception ex) { if (response.length() > 0) { response.append("\n"); } response.append(ex.getLocalizedMessage()); OseeLog.log(Activator.class, Level.SEVERE, response.toString(), ex); } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException ex) { OseeLog.log(Activator.class, Level.SEVERE, ex); } } } }
Source:
public boolean process( File paramFile1, File paramFile2, File[] paramArayOfFile ) throws MojoExecutionException { try { return (Boolean) processMethod.invoke( merger, paramFile1, paramFile2, paramArayOfFile ); } catch ( IllegalArgumentException e ) { log.error( "Cannot merge the manifests", e ); throw new MojoExecutionException( "Cannot merge the manifests", e ); } catch ( IllegalAccessException e ) { log.error( "Cannot merge the manifests", e ); throw new MojoExecutionException( "Cannot merge the manifests", e ); } catch ( InvocationTargetException e ) { log.error( "Cannot merge the manifests", e ); throw new MojoExecutionException( "Cannot merge the manifests", e ); } }

Target:
public boolean process( File paramFile1, File paramFile2, File[] paramArayOfFile ) throws MojoExecutionException { try { return (Boolean) processMethod.invoke( merger, paramFile1, paramFile2, paramArayOfFile ); } catch ( Exception e ) { log.error( "Cannot merge the manifests", e ); throw new MojoExecutionException( "Cannot merge the manifests", e ); } }
Source:
private static ExpressionRewriter createRewrite() { return (expression, context) -> ExpressionTreeRewriter.rewriteWith(new com.facebook.presto.sql.tree.ExpressionRewriter<Void>() { @Override public Expression rewriteCurrentPath(CurrentPath node, Void context, ExpressionTreeRewriter<Void> treeRewriter) { return DesugarCurrentPath.getCall(node); } }, expression); }

Target:
private static ExpressionRewriter createRewrite() { return (expression, context) -> rewriteWith(new com.facebook.presto.sql.tree.ExpressionRewriter<Void>() { @Override public Expression rewriteCurrentPath(CurrentPath node, Void context, ExpressionTreeRewriter<Void> treeRewriter) { return DesugarCurrentPath.getCall(node); } }, expression); }
Source:
public void focusOnPatchSet(int patchSetNumber) { if (patchSetNumber > 0 && patchSetNumber <= patchSetSections.size()) { int index = patchSetNumber - 1; SubSectionManager section = patchSetSections.get(index); if (section != null) { section.assignFocus(); } } }

Target:
public void focusOnPatchSet(int patchSetNumber) { if (patchSetNumber > 0 && patchSetNumber <= patchSetSections.size()) { int index = patchSetNumber - 1; SubSectionManager section = patchSetSections.get(index); section.reveal(); } }
Source:
public static void getObject_test8() throws Exception { if (!mintEnv) { System.out.println("Test: getObject(String bucketName, String objectName)"); } long startTime = System.currentTimeMillis(); try { String objectName = getRandomName(); InputStream is = new ContentInputStream(0); client.putObject(bucketName, objectName, is, 0, nullContentType); is.close(); is = client.getObject(bucketName, objectName); is.close(); client.removeObject(bucketName, objectName); mintSuccessLog("getObject(String bucketName, String objectName)", null, startTime); } catch (Exception e) { mintFailedLog("getObject(String bucketName, String objectName)", null, startTime, null, e.toString() + " >>> " + Arrays.toString(e.getStackTrace())); throw e; } }

Target:
public static void getObject_test8() throws Exception { if (!mintEnv) { System.out.println("Test: getObject(String bucketName, String objectName) zero size object"); } long startTime = System.currentTimeMillis(); try { String objectName = getRandomName(); InputStream is = new ContentInputStream(0); client.putObject(bucketName, objectName, is, 0, nullContentType); is.close(); is = client.getObject(bucketName, objectName); is.close(); client.removeObject(bucketName, objectName); mintSuccessLog("getObject(String bucketName, String objectName)", null, startTime); } catch (Exception e) { mintFailedLog("getObject(String bucketName, String objectName)", null, startTime, null, e.toString() + " >>> " + Arrays.toString(e.getStackTrace())); throw e; } }
Source:
public void testGetCache() throws Exception { Map<String, String> ieCache = WininetUtil.getCache(); assertTrue("WinInet cache should have some items in it.", ieCache.size() > 1); boolean historyEntryFound = false; boolean googleLogoOrOtherImageFound = false; for (String URL : ieCache.keySet()) { if (URL.startsWith("Visited:") && URL.contains("www.google.com")) { historyEntryFound = true; } else if (URL.contains("google.com") && (URL.endsWith("png") || URL.endsWith("jpg"))) { googleLogoOrOtherImageFound = true; } } assertTrue("Google logo (or other image) should have been found in the browser cache.", googleLogoOrOtherImageFound); assertTrue("History entry for google.com should have been found in the browser cache.", historyEntryFound); Runtime.getRuntime().exec("taskkill.exe /f /im iexplore.exe"); }

Target:
public void testGetCache() throws Exception { Map<String, String> ieCache = WininetUtil.getCache(); assertNotNull("WinInet cache should have some items in it.", ieCache.size() > 1); boolean historyEntryFound = false; boolean googleLogoOrOtherImageFound = false; for (String URL : ieCache.keySet()) { if (URL.startsWith("Visited:") && URL.contains("www.google.com")) { historyEntryFound = true; } else if (URL.contains("google.com") && (URL.endsWith("png") || URL.endsWith("jpg"))) { googleLogoOrOtherImageFound = true; } } assertTrue("Google logo (or other image) should have been found in the browser cache.", googleLogoOrOtherImageFound); assertTrue("History entry for google.com should have been found in the browser cache.", historyEntryFound); }
Source:
public void registerProvider(final InputStream stream) { final Type type = new TypeToken<TaskDataProvider>() .getType(); final TaskDataProvider provider = (TaskDataProvider) motechJsonReader.readFromStream(stream, type); LOGGER.info("Registering the provider with name: {}", provider.getName()); Set<TaskError> errors = TaskDataProviderValidator.validate(provider); if (!isEmpty(errors)) { throw new ValidationException(TaskDataProviderValidator.TASK_DATA_PROVIDER, errors); } addProvider(provider); }

Target:
public void registerProvider(final InputStream stream) { final Type type = new TypeToken<TaskDataProvider>() .getType(); final TaskDataProvider provider = (TaskDataProvider) motechJsonReader.readFromStream(stream, type); LOGGER.info("Registering a task data provider with name: {}", provider.getName()); Set<TaskError> errors = TaskDataProviderValidator.validate(provider); if (!isEmpty(errors)) { throw new ValidationException(TaskDataProviderValidator.TASK_DATA_PROVIDER, errors); } addProvider(provider); }
Source:
public boolean addAll(Collection<? extends XWikiAttachment> c) { onUpdate(); for (XWikiAttachment x : c) { map.put(x.getFilename(), x); added(x); } this.list.clear(); this.list.addAll(map.values()); return true; }

Target:
public boolean addAll(Collection<? extends XWikiAttachment> c) { boolean changed = false; for (XWikiAttachment x : c) { XWikiAttachment put = map.put(x.getFilename(), x); if (put != x) { changed = true; added(x); } } if (changed) { updatedMap(); } return changed; }
Source:
public void resilientToLargeNumberOfRequests() throws InterruptedException, ExecutionException { MultiplexingCompletionService<String, Integer> boundedService = MultiplexingCompletionService.create( ImmutableMap.of(KEY_1, createBoundedExecutor(2), KEY_2, createBoundedExecutor(2))); for (int i = 0; i < 50_000; i++) { try { boundedService.submit(KEY_1, getSleepCallable(5_000)); } catch (RejectedExecutionException e) { } } boundedService.submit(KEY_2, getSleepCallable(1)); assertThat(boundedService.poll(1, TimeUnit.SECONDS).get()).isEqualTo(1); }

Target:
public void resilientToLargeNumberOfRequests() throws InterruptedException, ExecutionException { MultiplexingCompletionService<String, Integer> boundedService = MultiplexingCompletionService.create( ImmutableMap.of(KEY_1, createBoundedExecutor(2), KEY_2, createBoundedExecutor(2))); for (int i = 0; i < 4; i++) { try { boundedService.submit(KEY_1, getSleepCallable(5_000)); } catch (RejectedExecutionException e) { e.printStackTrace(); } } boundedService.submit(KEY_2, getSleepCallable(1)); assertThat(boundedService.poll(1, TimeUnit.SECONDS).get()).isEqualTo(1); }
Source:
public void addReplicators(Replicator... replicators) { synchronized (this.replicators) { if (this.replicators == null) { this.replicators = new ArrayList<Replicator>(); } this.replicators.addAll(Arrays.asList(replicators)); } }

Target:
public void addReplicators(Replicator... replicators) { synchronized (this.replicators) { this.replicators.addAll(Arrays.asList(replicators)); } }
Source:
public void onExecute(CommandSender sender, String[] args) { if (sender instanceof Player) { if (sender.hasPermission("slimefun.charge.command")) { Player p = ((Player) sender).getPlayer(); final ItemStack item = p.getInventory().getItemInMainHand(); final SlimefunItem slimefunItem = SlimefunItem.getByItem(item); if (slimefunItem instanceof Rechargeable){ ((Rechargeable) slimefunItem).addItemCharge(item, ((Rechargeable) slimefunItem).getMaxItemCharge(item)); SlimefunPlugin.getLocalization().sendMessage(sender, "commands.charge.charge-success", true); } else { SlimefunPlugin.getLocalization().sendMessage(sender, "commands.charge.not-rechargeable", true); } } else { SlimefunPlugin.getLocalization().sendMessage(sender, "messages.no-permission", true); } } else { SlimefunPlugin.getLocalization().sendMessage(sender, "messages.only-players", true); } }

Target:
public void onExecute(CommandSender sender, String[] args) { if (sender instanceof Player) { if (sender.hasPermission("slimefun.charge.command")) { Player p = (Player) sender; ItemStack item = p.getInventory().getItemInMainHand(); SlimefunItem slimefunItem = SlimefunItem.getByItem(item); if (slimefunItem instanceof Rechargeable) { Rechargeable rechargeableItem = (Rechargeable) slimefunItem; rechargeableItem.setItemCharge(item, rechargeableItem.getMaxItemCharge(item)); SlimefunPlugin.getLocalization().sendMessage(sender, "commands.charge.charge-success", true); } else { SlimefunPlugin.getLocalization().sendMessage(sender, "commands.charge.not-rechargeable", true); } } else { SlimefunPlugin.getLocalization().sendMessage(sender, "messages.no-permission", true); } } else { SlimefunPlugin.getLocalization().sendMessage(sender, "messages.only-players", true); } }
Source:
private static byte[] getPngBytes(MultipartFile file) { try { BufferedImage image = ImageIO.read(file.getInputStream()); if (image == null) { throw InvalidDataException.notSupportedPhotoFileType(); } ByteArrayOutputStream pngBytes = new ByteArrayOutputStream(); ImageIO.write(image, "png", pngBytes); return pngBytes.toByteArray(); } catch (IOException e) { throw YonaException.unexpected(e); } }

Target:
private static byte[] getPngBytes(MultipartFile file) { try (InputStream inStream = file.getInputStream()) { BufferedImage image = ImageIO.read(inStream); if (image == null) { throw InvalidDataException.unsupportedPhotoFileType(); } ByteArrayOutputStream pngBytes = new ByteArrayOutputStream(); ImageIO.write(image, "png", pngBytes); return pngBytes.toByteArray(); } catch (IOException e) { throw YonaException.unexpected(e); } }
Source:
public static FirewallType valueOf(int value) { return map.get(value); }

Target:
public static FirewallType valueOf(int value) { FirewallType firewallType = valuesById.get(value); if (firewallType != null) { return firewallType; } throw new IllegalArgumentException("FirewallType does not have any mapping for value: " + value); }
Source:
public void preparePartitions( final Map config, final int totalTasks, final int taskIndex, final SpoutOutputCollector collector) throws Exception { this.collector = collector; if (stateStore == null) { String zkEndpointAddress = eventHubConfig.getZkConnectionString(); if (StringUtils.isBlank(zkEndpointAddress)) { @SuppressWarnings("unchecked") List<String> zkServers = (List<String>) config.get(Config.STORM_ZOOKEEPER_SERVERS); Integer zkPort = ((Number) config.get(Config.STORM_ZOOKEEPER_PORT)).intValue(); zkEndpointAddress = String.join(",", zkServers.stream().map(x -> x + ":" + zkPort).collect(Collectors.toList())); } stateStore = new ZookeeperStateStore(zkEndpointAddress, Integer.parseInt(config.get(Config.STORM_ZOOKEEPER_RETRY_TIMES).toString()), Integer.parseInt(config.get(Config.STORM_ZOOKEEPER_RETRY_INTERVAL).toString())); } stateStore.open(); LOGGER.info("TaskIndex: " + taskIndex + ", TotalTasks: " + totalTasks + ", Total Partitions:" + eventHubConfig.getPartitionCount()); partitionCoordinator = new StaticPartitionCoordinator(eventHubConfig, taskIndex, totalTasks, stateStore, pmFactory, recvFactory); for (IPartitionManager partitionManager : partitionCoordinator.getMyPartitionManagers()) { partitionManager.open(); } }

Target:
public void preparePartitions( final Map config, final int totalTasks, final int taskIndex, final SpoutOutputCollector collector) throws Exception { this.collector = collector; if (this.stateStore == null) { final String zkEndpointAddress = !StringUtils.isBlank(this.eventHubConfig.getZkConnectionString()) ? this.eventHubConfig.getZkConnectionString() : this.getZooKeeperEndpointAddress(config); this.stateStore = new ZookeeperStateStore(zkEndpointAddress, Integer.parseInt(config.get(Config.STORM_ZOOKEEPER_RETRY_TIMES).toString()), Integer.parseInt(config.get(Config.STORM_ZOOKEEPER_RETRY_INTERVAL).toString())); } this.stateStore.open(); LOGGER.info("EventHub: " + this.eventHubPath+ ", TaskIndex: " + taskIndex + ", TotalTasks: " + totalTasks + ", Total Partitions:" + this.eventHubConfig.getPartitionCount()); this.partitionCoordinator = new StaticPartitionCoordinator( this.eventHubConfig, taskIndex, totalTasks, this.stateStore, this.pmFactory, this.recvFactory); for (final IPartitionManager partitionManager : partitionCoordinator.getMyPartitionManagers()) { partitionManager.open(); } }
Source:
protected void executeCommand() { VDS vds = getVds(); VDSGroup cluster = getVdsGroup(); boolean vdsmVersionSupportedByEngine = false; Version partialVdcVersion = new Version(new Version(Config.<String> GetValue(ConfigValues.VdcVersion)).toString(2)); RpmVersion vdsVersion = vds.getVersion(); Version vdsmVersion = new Version(vdsVersion.getMajor(),vdsVersion.getMinor()); if (!StringUtils.isEmpty(vds.getSupportedEngines())) { vdsmVersionSupportedByEngine = vds.getSupportedENGINESVersionsSet().contains(partialVdcVersion); } if (!vdsmVersionSupportedByEngine && !Config.<HashSet<Version>> GetValue(ConfigValues.SupportedVDSMVersions).contains(vdsmVersion)) { reportNonOperationReason(NonOperationalReason.VERSION_INCOMPATIBLE_WITH_CLUSTER, Config.<HashSet<Version>> GetValue(ConfigValues.SupportedVDSMVersions).toString(), vdsmVersion.toString()); } else if (!VersionSupport.checkClusterVersionSupported(cluster.getcompatibility_version(), vds)) { reportNonOperationReason(NonOperationalReason.CLUSTER_VERSION_INCOMPATIBLE_WITH_CLUSTER, cluster.getcompatibility_version().toString(), vds.getSupportedClusterLevels().toString()); } setSucceeded(true); }

Target:
protected void executeCommand() { VDS vds = getVds(); VDSGroup cluster = getVdsGroup(); boolean isEngineSupportedByVdsm = false; Version partialVdcVersion = new Version(new Version(Config.<String> GetValue(ConfigValues.VdcVersion)).toString(2)); RpmVersion vdsVersion = vds.getVersion(); Version vdsmVersion = new Version(vdsVersion.getMajor(), vdsVersion.getMinor()); if (!StringUtils.isEmpty(vds.getSupportedEngines())) { isEngineSupportedByVdsm = vds.getSupportedENGINESVersionsSet().contains(partialVdcVersion); } if (!isEngineSupportedByVdsm && !Config.<HashSet<Version>> GetValue(ConfigValues.SupportedVDSMVersions).contains(vdsmVersion)) { reportNonOperationReason(NonOperationalReason.VERSION_INCOMPATIBLE_WITH_CLUSTER, Config.<HashSet<Version>> GetValue(ConfigValues.SupportedVDSMVersions).toString(), vdsmVersion.toString()); } else if (!VersionSupport.checkClusterVersionSupported(cluster.getcompatibility_version(), vds)) { reportNonOperationReason(NonOperationalReason.CLUSTER_VERSION_INCOMPATIBLE_WITH_CLUSTER, cluster.getcompatibility_version().toString(), vds.getSupportedClusterLevels().toString()); } setSucceeded(true); }