auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void renvAction(final String action) { String errorMessage = "Error during " + action; ProgressIndicator indicator = globalDisplay_.getProgressIndicator(errorMessage); indicator.onProgress("Performing " + action.toLowerCase() + "..."); renvServer_.renvActions(action, new ServerRequestCallback<JsArray<RenvAction>>() { @Override public void onResponseReceived(JsArray<RenvAction> response) { indicator.onCompleted(); if (response.length() == 0) { globalDisplay_.showMessage( GlobalDisplay.MSG_INFO, "Up to Date", "The project is already up to date."); return; } final OperationWithInput<Void> operation = (Void input) -> { String code = "renv::" + action.toLowerCase() + "(confirm = FALSE)"; events_.fireEvent(new SendToConsoleEvent(code, true)); }; RenvActionDialog dialog = new RenvActionDialog(action, response, operation); dialog.showModal(); } @Override public void onError(ServerError error) { Debug.logError(error); indicator.onError(errorMessage); } }); }

Target:
private void renvAction(final String action) { String errorMessage = "Error during " + action; ProgressIndicator indicator = globalDisplay_.getProgressIndicator(errorMessage); indicator.onProgress("Performing " + action.toLowerCase() + "..."); renvServer_.renvActions(action, new ServerRequestCallback<JsArray<RenvAction>>() { @Override public void onResponseReceived(JsArray<RenvAction> response) { indicator.onCompleted(); if (response.length() == 0) { globalDisplay_.showMessage( GlobalDisplay.MSG_INFO, "Up to Date", "The project is already up to date."); return; } final OperationWithInput<Void> operation = (Void input) -> { String code = "renv::" + action.toLowerCase() + "(confirm = FALSE)"; events_.fireEvent(new SendToConsoleEvent(code, true)); }; RenvActionDialog dialog = new RenvActionDialog(action, response, operation); dialog.showModal(); } @Override public void onError(ServerError error) { Debug.logError(error); indicator.onError(error.getUserMessage()); } }); }
Source:
NettyPartitionRequestClient createPartitionRequestClient(ConnectionID connectionId) throws IOException, InterruptedException { Object entry; NettyPartitionRequestClient client = null; while (client == null) { entry = clients.get(connectionId); if (entry != null) { if (entry instanceof NettyPartitionRequestClient) { client = (NettyPartitionRequestClient) entry; } else { ConnectingChannel future = (ConnectingChannel) entry; client = future.waitForChannel(); clients.replace(connectionId, future, client); } } else { ConnectingChannel connectingChannel = new ConnectingChannel(connectionId, this); Object old = clients.putIfAbsent(connectionId, connectingChannel); if (old == null) { int count = 0; ChannelException exception = null; do { try { exception = null; connectingChannel.error = null; LOG.info("Connecting to at attempt", connectionId.getAddress(), count); nettyClient.connect(connectionId.getAddress()).addListener(connectingChannel); client = connectingChannel.waitForChannel(); clients.replace(connectionId, connectingChannel, client); } catch (ChannelException e) { LOG.error("Failed times to connect to {}", count, connectionId.getAddress(), e); exception = e; } count++; } while (count <= retryNumber); if (exception != null) { throw exception; } } else if (old instanceof ConnectingChannel) { try { client = ((ConnectingChannel) old).waitForChannel(); } catch (IOException e) { LOG.info("Continue to waitForChannel until the original thread has completed or failed"); } clients.replace(connectionId, old, client); } else { client = (NettyPartitionRequestClient) old; } } if (!client.incrementReferenceCounter()) { destroyPartitionRequestClient(connectionId, client); client = null; } } return client; }

Target:
NettyPartitionRequestClient createPartitionRequestClient(ConnectionID connectionId) { NettyPartitionRequestClient client = null; while (client == null) { client = (NettyPartitionRequestClient) clients.computeIfAbsent(connectionId, unused -> { int tried = 0; while (true) { ConnectingChannel connectingChannel = null; try { connectingChannel = new ConnectingChannel(connectionId, this); nettyClient.connect(connectionId.getAddress()).addListener(connectingChannel); return connectingChannel.waitForChannel(); } catch (IOException | InterruptedException | ChannelException e) { LOG.error("Failed times to connect to {}", tried, connectionId.getAddress(), e); if (++tried > retryNumber) { throw new CompletionException(e); } } } }); if (!client.incrementReferenceCounter()) { destroyPartitionRequestClient(connectionId, client); client = null; } } return client; }
Source:
protected void executeCommand() { getNetwork().setId(Guid.newGuid()); NetworkUtils.setNetworkVdsmName(getNetwork()); TransactionSupport.executeInNewTransaction(() -> { networkDao.save(getNetwork()); if (getNetwork().isVmNetwork() && getParameters().isVnicProfileRequired()) { vnicProfileDao.save(networkHelper.createVnicProfile(getNetwork())); } networkHelper.addPermissionsOnNetwork(getUserId(), getNetwork().getId()); return null; }); postSaveAction(); getReturnValue().setActionReturnValue(getNetwork().getId()); setSucceeded(true); }

Target:
protected void executeCommand() { getNetwork().setId(Guid.newGuid()); NetworkUtils.setNetworkVdsmName(getNetwork()); TransactionSupport.executeInNewTransaction(() -> { networkDao.save(getNetwork()); if (getNetwork().isVmNetwork() && getParameters().isVnicProfileRequired()) { vnicProfileDao.save(networkHelper.createVnicProfile(getNetwork())); } networkHelper.addPermissionsOnNetwork(getUserId(), getNetwork().getId()); return null; }); ActionReturnValue clusterReturnValue = attachToClusters(); if (clusterReturnValue.getSucceeded()) { getReturnValue().setActionReturnValue(getNetwork().getId()); } setSucceeded(clusterReturnValue.getSucceeded()); }
Source:
public void setup() throws Exception { context.registerSerializer("spotify100", Spotify100Serializer.class); context.registerSerializer("spotify100proto", Spotify100ProtoSerializer.class); context.registerSerializer("spotify100protobatch", Spotify100ProtoBatchSerializer.class); context.registerSerializer("to-string", ToStringSerializer.class); }

Target:
public void setup() throws Exception { context.registerSerializer("spotify100", Spotify100Serializer.class); context.registerSerializer("spotify100proto", Spotify100ProtoSerializer.class); context.registerSerializer("to-string", ToStringSerializer.class); }
Source:
public void verifyClosedAccountMessage() { waitForElementByElement(messagePlaceholder); Assertion.assertEquals( "Your account has been disabled by Wikia.", messagePlaceholder.getText() ); }

Target:
public void verifyClosedAccountMessage() { waitForElementByElement(messagePlaceholder); Assertion.assertEquals( disabledAccountMessage, messagePlaceholder.getText() ); }
Source:
public DataBag exec(Tuple input) throws IOException { String inputString = null; if(input.size() == 0) { return null; } if(input.size() == 1) { inputString = input.get(0).toString(); } if(input.size() == 2) { modelPath = input.get(1).toString(); inputString = input.get(0).toString(); } if(inputString == null || inputString == "") { return null; } DataBag outBag = bf.newDefaultBag(); if(isFirst == true || this.tokenizer == null) { String loadFile = getFilename(); InputStream file = new FileInputStream(loadFile); InputStream buffer = new BufferedInputStream(file); TokenizerModel model = new TokenizerModel(buffer); this.tokenizer = new TokenizerME(model); isFirst = false; } String tokens[] = this.tokenizer.tokenize(inputString); for(String token : tokens) { Tuple outTuple = tf.newTuple(token); outBag.add(outTuple); } return outBag; }

Target:
public DataBag exec(Tuple input) throws IOException { String inputString = null; if(input.size() == 0) { return null; } if(input.size() == 1) { inputString = input.get(0).toString(); } if(inputString == null || inputString == "") { return null; } DataBag outBag = bf.newDefaultBag(); if(isFirst == true || this.tokenizer == null) { String loadFile = getFilename(); InputStream file = new FileInputStream(loadFile); InputStream buffer = new BufferedInputStream(file); TokenizerModel model = new TokenizerModel(buffer); this.tokenizer = new TokenizerME(model); isFirst = false; } String tokens[] = this.tokenizer.tokenize(inputString); for(String token : tokens) { Tuple outTuple = tf.newTuple(token); outBag.add(outTuple); } return outBag; }
Source:
public void enqueueLog(Path wal) { if (!this.filterInWALs.test(wal)) { LOG.trace("NOT replicating {}", wal); return; } String logPrefix = AbstractFSWALProvider.getWALPrefixFromWALName(wal.getName()); PriorityBlockingQueue<Path> queue = queues.get(logPrefix); if (queue == null) { queue = new PriorityBlockingQueue<>(queueSizePerGroup, new LogsComparator()); queues.put(logPrefix, queue); if (this.isSourceActive() && this.walEntryFilter != null) { tryStartNewShipper(logPrefix, queue); } } queue.put(wal); if (LOG.isTraceEnabled()) { LOG.trace("{} Added wal to queue of source {}.", logPeerId(), logPrefix, this.replicationQueueInfo.getQueueId()); } this.metrics.incrSizeOfLogQueue(); int queueSize = queue.size(); if (queueSize > this.logQueueWarnThreshold) { LOG.warn("{} WAL group queue size: exceeds value of " + "replication.source.wal.queue.warn: {}", logPeerId(), logPrefix, queueSize, logQueueWarnThreshold); } }

Target:
public void enqueueLog(Path wal) { if (!this.filterInWALs.test(wal)) { LOG.trace("NOT replicating {}", wal); return; } String logPrefix = AbstractFSWALProvider.getWALPrefixFromWALName(wal.getName()); PriorityBlockingQueue<Path> queue = queues.get(logPrefix); if (queue == null) { queue = new PriorityBlockingQueue<>(queueSizePerGroup, new LogsComparator()); queues.put(logPrefix, queue); if (this.isSourceActive() && this.walEntryFilter != null) { tryStartNewShipper(logPrefix, queue); } } queue.put(wal); if (LOG.isTraceEnabled()) { LOG.trace("{} Added wal to queue of source {}.", logPeerId(), logPrefix, this.replicationQueueInfo.getQueueId()); } this.metrics.incrSizeOfLogQueue(); int queueSize = queue.size(); if (queueSize > this.logQueueWarnThreshold) { LOG.warn("{} WAL group queue size: exceeds value of " + "replication.source.log.queue.warn: {}", logPeerId(), logPrefix, queueSize, logQueueWarnThreshold); } }
Source:
private void populateSYSNATURALNUMBERS(TransactionController tc) throws StandardException{ TabInfoImpl ti = getNonCoreTI(SYSNATURALNUMBERS_CATALOG_NUM); for (int i = 1; i <= 2048; i++) { NaturalNumberDescriptor nnd = new NaturalNumberDescriptor(i); ExecRow row = ti.getCatalogRowFactory().makeRow(nnd, null); ti.insertRow(row, tc); } }

Target:
private void populateSYSNATURALNUMBERS(TransactionController tc) throws StandardException{ SYSNATURALNUMBERSRowFactory.populateSYSNATURALNUMBERS(getNonCoreTI(SYSNATURALNUMBERS_CATALOG_NUM), tc); }
Source:
public URI recentChanges(Date startTime, JSONObject continueObject, int batchSize) { URIBuilder builder = apiBuilder(); builder.addParameter("action", "query"); builder.addParameter("list", "recentchanges"); builder.addParameter("rcdir", "newer"); builder.addParameter("rcprop", "title|ids|timestamp"); StringBuilder nsBuilder = new StringBuilder(); for (long i : entityNamespaces) { nsBuilder.append(i).append("|"); } nsBuilder.deleteCharAt(nsBuilder.length() - 1); builder.addParameter("rcnamespace", nsBuilder.toString()); builder.addParameter("rclimit", Integer.toString(batchSize)); if (continueObject == null) { builder.addParameter("continue", ""); builder.addParameter("rcstart", outputDateFormat().format(startTime)); } else { builder.addParameter("continue", continueObject.get("continue").toString()); builder.addParameter("rccontinue", continueObject.get("rccontinue").toString()); } return build(builder); }

Target:
public URI recentChanges(Date startTime, JSONObject continueObject, int batchSize) { URIBuilder builder = apiBuilder(); builder.addParameter("action", "query"); builder.addParameter("list", "recentchanges"); builder.addParameter("rcdir", "newer"); builder.addParameter("rcprop", "title|ids|timestamp"); builder.addParameter("rcnamespace", getEntityNamespacesString("|")); builder.addParameter("rclimit", Integer.toString(batchSize)); if (continueObject == null) { builder.addParameter("continue", ""); builder.addParameter("rcstart", outputDateFormat().format(startTime)); } else { builder.addParameter("continue", continueObject.get("continue").toString()); builder.addParameter("rccontinue", continueObject.get("rccontinue").toString()); } return build(builder); }
Source:
public Builder() { options = new BigtableOptions(); options.appProfileId = BIGTABLE_APP_PROFILE_DEFAULT; options.dataHost = isDirectPathEnabled() ? BIGTABLE_DIRECTPATH_DATA_HOST_DEFAULT : BIGTABLE_DATA_HOST_DEFAULT; options.adminHost = BIGTABLE_ADMIN_HOST_DEFAULT; options.port = BIGTABLE_PORT_DEFAULT; options.dataChannelCount = BIGTABLE_DATA_CHANNEL_COUNT_DEFAULT; options.usePlaintextNegotiation = false; options.useCachedDataPool = false; options.useGCJClient = false; options.bulkOptions = BulkOptions.builder().build(); options.retryOptions = new RetryOptions.Builder().build(); options.callOptionsConfig = CallOptionsConfig.builder().build(); options.credentialOptions = CredentialOptions.defaultCredentials(); options.useBatch = false; }

Target:
public Builder() { options = new BigtableOptions(); options.appProfileId = BIGTABLE_APP_PROFILE_DEFAULT; options.dataHost = isDirectPathEnabled() ? BIGTABLE_DIRECTPATH_DATA_HOST_DEFAULT : BIGTABLE_DATA_HOST_DEFAULT; options.adminHost = BIGTABLE_ADMIN_HOST_DEFAULT; options.port = BIGTABLE_PORT_DEFAULT; options.dataChannelCount = BIGTABLE_DATA_CHANNEL_COUNT_DEFAULT; options.usePlaintextNegotiation = false; options.useCachedDataPool = false; options.useGCJClient = false; options.bulkOptions = BulkOptions.builder() .setMaxInflightRpcs( BulkOptions.BIGTABLE_MAX_INFLIGHT_RPCS_PER_CHANNEL_DEFAULT * options.dataChannelCount) .build(); options.retryOptions = new RetryOptions.Builder().build(); options.callOptionsConfig = CallOptionsConfig.builder().build(); options.credentialOptions = CredentialOptions.defaultCredentials(); options.useBatch = false; }
Source:
private boolean needToRemoveLabel(Boolean isNativeContainer, String dataMode) { if(!isNativeContainer) { return true; } if(!dataMode.isEmpty() && dataMode!=null && (dataMode.equals(NetworkConstants.NETWORK_MODE_HOST) || dataMode.equals(NetworkConstants.NETWORK_MODE_CONTAINER))) { return true; } return false; }

Target:
private boolean needToRemoveLabel(Boolean isNativeContainer, String dataMode) { if(!isNativeContainer) { return true; } if(!StringUtils.isEmpty(dataMode) && (dataMode.equals(NetworkConstants.NETWORK_MODE_HOST) || dataMode.equals(NetworkConstants.NETWORK_MODE_CONTAINER))) { return true; } return false; }
Source:
public Tracking<RAW, BASE> track(Collection<RAW> rawInput, Collection<BASE> baseInput) { Tracking<RAW, BASE> tracking = new Tracking<>(rawInput, baseInput); match(tracking, LineAndLineHashKey::new, true); match(tracking, LineHashAndMessageKey::new, true); return tracking; }

Target:
public Tracking<RAW, BASE> track(Collection<RAW> rawInput, Collection<BASE> baseInput) { Tracking<RAW, BASE> tracking = new Tracking<>(rawInput, baseInput); match(tracking, LineAndLineHashKey::new); match(tracking, LineHashAndMessageKey::new); return tracking; }
Source:
private List<String> getMavenArtifactsRelatedArgs (String mavenArtifacts) { List<String> args = new ArrayList<>(); if (mavenArtifacts != null && !mavenArtifacts.isEmpty()) { args.add("--artifacts"); args.add(mavenArtifacts); args.add("--artifactRepositories"); args.add((String) conf.get("mavenRepoUrl")); String proxyUrl = (String) conf.get("httpProxyUrl"); if (StringUtils.isNotEmpty(proxyUrl)) { args.add("--proxyUrl"); args.add(proxyUrl); String proxyUsername = (String) conf.get("httpProxyUsername"); String proxyPassword = (String) conf.get("httpProxyPassword"); if (proxyUsername != null && proxyPassword != null) { args.add("--proxyUsername"); args.add(proxyUsername); args.add("--proxyPassword"); args.add(proxyPassword); } } } return args; }

Target:
private List<String> getMavenArtifactsRelatedArgs (String mavenArtifacts) { List<String> args = new ArrayList<>(); if (mavenArtifacts != null && !mavenArtifacts.isEmpty()) { args.add("--artifacts"); args.add(mavenArtifacts); args.add("--artifactRepositories"); args.add((String) conf.get("mavenRepoUrl")); String proxyUrl = (String) conf.get(com.hortonworks.streamline.common.Constants.CONFIG_HTTP_PROXY_URL); if (StringUtils.isNotEmpty(proxyUrl)) { args.add("--proxyUrl"); args.add(proxyUrl); String proxyUsername = (String) conf.get(com.hortonworks.streamline.common.Constants.CONFIG_HTTP_PROXY_USERNAME); String proxyPassword = (String) conf.get(com.hortonworks.streamline.common.Constants.CONFIG_HTTP_PROXY_PASSWORD); if (proxyUsername != null && proxyPassword != null) { args.add("--proxyUsername"); args.add(proxyUsername); args.add("--proxyPassword"); args.add(proxyPassword); } } } return args; }
Source:
protected void fireRefreshFormPropertiesEvent() { final ClientSession session = sessionManager.getCurrentSession(); if (session != null) { final CanvasHandler canvasHandler = session.getCanvasHandler(); if (canvasHandler != null) { refreshFormPropertiesEvent.fire(new RefreshFormProperties(session, nodeUUID)); } } }

Target:
protected void fireRefreshFormPropertiesEvent() { final ClientSession session = sessionManager.getCurrentSession(); if (session != null) { final CanvasHandler canvasHandler = session.getCanvasHandler(); if (canvasHandler != null) { refreshFormPropertiesEvent.fire(new RefreshFormPropertiesEvent(session, nodeUUID)); } } }
Source:
public static String buildJsonArray(List<UpdateData> updateData) { final OutputStream os = new ByteArrayOutputStream(); final ObjectMapper mapper = new ObjectMapper(); String json = ""; try { mapper.writeValue(os, updateData); final byte[] data = ((ByteArrayOutputStream) os).toByteArray(); json = new String(data, "UTF-8"); } catch (IOException e) { throw new RuntimeException(e); } return json; }

Target:
public static String buildJsonArray(List<UpdateData> updateData) { final OutputStream os = new ByteArrayOutputStream(); final ObjectMapper mapper = new ObjectMapper(); final String json; try { mapper.writeValue(os, updateData); final byte[] data = ((ByteArrayOutputStream) os).toByteArray(); json = new String(data, "UTF-8"); } catch (IOException e) { throw new RuntimeException(e); } return json; }
Source:
private static void validateCurrentVersion(Devfile devFile) throws DevfileFormatException { if (Strings.isNullOrEmpty(devFile.getApiVersion())) { throw new DevfileFormatException("Provided Devfile has no spec version specified"); } if (!CURRENT_API_VERSION.equals(devFile.getApiVersion())) { throw new DevfileFormatException( format("Provided Devfile has unsupported version '%s'", devFile.getApiVersion())); } }

Target:
private static void validateCurrentVersion(Devfile devFile) throws DevfileFormatException { if (Strings.isNullOrEmpty(devFile.getApiVersion())) { throw new DevfileFormatException("Provided Devfile has no API version specified"); } if (!CURRENT_API_VERSION.equals(devFile.getApiVersion())) { throw new DevfileFormatException( format( "Provided Devfile has unsupported version '%s'. The following versions are" + " supported: %s", devFile.getApiVersion(), singleton(CURRENT_API_VERSION))); } }
Source:
public void open(ExecutionContext ctx) throws Exception { super.open(ctx); ValueStateDescriptor<BaseRow> stateDesc = new ValueStateDescriptor<>("preRowState", rowTypeInfo); StateTtlConfig ttlConfig = createTtlConfig(minRetentionTime, stateCleaningEnabled); if (ttlConfig.isEnabled()) { stateDesc.enableTimeToLive(ttlConfig); } state = ctx.getRuntimeContext().getState(stateDesc); }

Target:
public void open(ExecutionContext ctx) throws Exception { super.open(ctx); ValueStateDescriptor<BaseRow> stateDesc = new ValueStateDescriptor<>("preRowState", rowTypeInfo); StateTtlConfig ttlConfig = createTtlConfig(minRetentionTime); if (ttlConfig.isEnabled()) { stateDesc.enableTimeToLive(ttlConfig); } state = ctx.getRuntimeContext().getState(stateDesc); }
Source:
public void run(InputStream importStream, AgentPrincipals agent, String uuid, String mimeType) throws Exception { PID pid = PIDs.get(uuid); aclService.assertHasAccess("User does not have permission to add/update collection thumbnails", pid, agent.getPrincipals(), Permission.editDescription); try { if (!containsIgnoreCase(mimeType, "image")) { throw new IllegalArgumentException("Uploaded file is not an image"); } String thumbnailBasePath = idToPath(uuid, HASHED_PATH_DEPTH, HASHED_PATH_SIZE); String filePath = storagePath.resolve(thumbnailBasePath).resolve(uuid).toString(); File finalLocation = new File(filePath); copyInputStreamToFile(importStream, finalLocation); Document msg = makeEnhancementOperationBody(agent.getUsername(), pid, false); messageSender.sendMessage(msg); log.info("Job to to add thumbnail to collection has been queued by {}", uuid, agent.getUsername()); } catch (IllegalArgumentException e) { log.error("Uploaded file for collection is not an image file", uuid); throw e; } }

Target:
public void run(InputStream importStream, AgentPrincipals agent, String uuid, String mimeType) throws Exception { PID pid = PIDs.get(uuid); aclService.assertHasAccess("User does not have permission to add/update collection thumbnails", pid, agent.getPrincipals(), Permission.editDescription); if (!containsIgnoreCase(mimeType, "image")) { log.error("Uploaded file for collection is not an image file", uuid); throw new IllegalArgumentException("Uploaded file is not an image"); } String thumbnailBasePath = idToPath(uuid, HASHED_PATH_DEPTH, HASHED_PATH_SIZE); File finalLocation = storagePath.resolve(thumbnailBasePath).resolve(uuid).toFile(); copyInputStreamToFile(importStream, finalLocation); Document msg = makeEnhancementOperationBody(agent.getUsername(), pid, false); messageSender.sendMessage(msg); log.info("Job to to add thumbnail to object has been queued by {}", uuid, agent.getUsername()); }
Source:
public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException { try { String requestUUID = UUID.randomUUID().toString(); LOGGER.debug(HEADER_REQUEST_UUID + ": " + requestUUID); MDC.put(HEADER_REQUEST_UUID, requestUUID); if (req instanceof HttpServletRequest) { ((HttpServletRequest) req).setAttribute(HEADER_REQUEST_UUID, requestUUID); } else { LOGGER.info("ServletRequest of type: " + req.getClass()); } if (resp instanceof HttpServletResponse) { ((HttpServletResponse) resp).setHeader(HEADER_REQUEST_UUID, requestUUID); } else { LOGGER.info("ServletResponse of type: " + resp.getClass()); } chain.doFilter(req, resp); } finally { MDC.remove(HEADER_REQUEST_UUID); } }

Target:
public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException { try { String requestUUID = String.valueOf(UUID.randomUUID().getMostSignificantBits()); LOGGER.debug(HEADER_REQUEST_UUID + ": " + requestUUID); MDC.put(HEADER_REQUEST_UUID, requestUUID); if (req instanceof HttpServletRequest) { ((HttpServletRequest) req).setAttribute(HEADER_REQUEST_UUID, requestUUID); } else { LOGGER.info("ServletRequest of type: " + req.getClass()); } if (resp instanceof HttpServletResponse) { ((HttpServletResponse) resp).setHeader(HEADER_REQUEST_UUID, requestUUID); } else { LOGGER.info("ServletResponse of type: " + resp.getClass()); } chain.doFilter(req, resp); } finally { MDC.remove(HEADER_REQUEST_UUID); } }
Source:
private static char[] encodeHex(byte[] data, char[] toDigits) { int l = data.length; char[] out = new char[l << 1]; int i = 0; for (int var5 = 0; i < l; ++i) { out[var5++] = toDigits[(240 & data[i]) >>> 4]; out[var5++] = toDigits[15 & data[i]]; } return out; }

Target:
private static char[] encodeHex(byte[] data, char[] toDigits) { int l = data.length; char[] out = new char[l << 1]; int i = 0; for (int j = 0; i < l; ++i) { out[j++] = toDigits[(240 & data[i]) >>> 4]; out[j++] = toDigits[15 & data[i]]; } return out; }
Source:
@Override public void load(Request request, int networkPolicy, Callback callback) { try { Source source = Okio.source(getInputStream(request)); callback.onSuccess(new Result(null, source, DISK, getFileExifRotation(request.uri))); } catch (Exception e) { callback.onError(e); } }

Target:
@Override public void load(Request request, int networkPolicy, Callback callback) { boolean signaledCallback = false; try { Source source = Okio.source(getInputStream(request)); signaledCallback = true; callback.onSuccess(new Result(null, source, DISK, getFileExifRotation(request.uri))); } catch (Exception e) { if (!signaledCallback) { callback.onError(e); } } }
Source:
public static NumberRange<Double> getMinMax( ListFeatureCollection fc, Expression attributeExpression) { double min = fc.stream() .mapToDouble(f -> attributeExpression.evaluate(f, Double.class)) .min() .getAsDouble(); double max = fc.stream() .mapToDouble(f -> attributeExpression.evaluate(f, Double.class)) .max() .getAsDouble(); return new NumberRange<>(Double.class, min, max); }

Target:
public static NumberRange<Double> getMinMax( ListFeatureCollection fc, Expression attributeExpression) { DoubleSummaryStatistics stats = fc.stream() .collect( Collectors.summarizingDouble( f -> attributeExpression.evaluate(f, Double.class))); return new NumberRange<>(Double.class, stats.getMin(), stats.getMax()); }
Source:
public org.codice.solr.client.solrj.SolrClient newClient(String coreName) { Args.notEmpty(coreName, "Cannot create Solr client. Missing core name."); if (getSolrDir() != null) { ConfigurationStore.getInstance().setDataDirectoryPath(getSolrDir()); } LOGGER.debug( "Solr({}): Creating an HTTP Solr client using url [{}]", coreName, getCoreUrl(coreName)); return new SolrClientAdapter(coreName, () -> createSolrHttpClient(coreName)); }

Target:
public org.codice.solr.client.solrj.SolrClient newClient(String coreName) { Args.notEmpty(coreName, "Cannot create Solr client. Solr core name"); String solrDir = getProperty(SOLR_DATA_DIR); Args.notEmpty(solrDir, "Cannot create Solr client. Solr data directory"); ConfigurationStore.getInstance().setDataDirectoryPath(solrDir); LOGGER.debug( "Solr({}): Creating an HTTP Solr client using url [{}]", coreName, getCoreUrl(coreName)); return new SolrClientAdapter(coreName, () -> createSolrHttpClient(coreName)); }
Source:
public void populate(List<CategoryDTO> categories) { Platform.runLater(() -> { Set<String> themedCategories = Sets.newHashSet( "custom", "development", "games", "graphics", "internet", "multimedia", "office", "other", "science" ); final List<LeftButton> leftButtonList = new ArrayList<>(); for (CategoryDTO category : categories) { if(category.getType() == CategoryDTO.CategoryType.INSTALLERS) { final LeftButton categoryButton = new LeftButton(category.getName()); if (themedCategories.contains(category.getName().toLowerCase())) { final String themeName = new String(category.getName().toLowerCase() + "Button"); categoryButton.getStyleClass().add(themeName); } else { categoryButton.setStyle("-fx-background-image: url('" + category.getIcon() + "');"); } categoryButton.setOnMouseClicked(event -> selectCategory(category)); leftButtonList.add(categoryButton); } } categoryView.setNodes(leftButtonList); showAvailableApps(); }); }

Target:
public void populate(List<CategoryDTO> categories) { Platform.runLater(() -> { final List<LeftButton> leftButtonList = new ArrayList<>(); for (CategoryDTO category : categories) { if(category.getType() == CategoryDTO.CategoryType.INSTALLERS) { final LeftButton categoryButton = new LeftButton(category.getName()); final String resource = String.format("icons/mainwindow/apps/%s.png", category.getName().toLowerCase()); if (themeManager.resourceExists(resource)) { categoryButton.setStyle("-fx-background-image: url('" + themeManager.getResourceUrl(resource) + "');"); } else { categoryButton.setStyle("-fx-background-image: url('" + category.getIcon() + "');"); } categoryButton.setOnMouseClicked(event -> selectCategory(category)); leftButtonList.add(categoryButton); } } categoryView.setNodes(leftButtonList); showAvailableApps(); }); }
Source:
public Object read(final RecordTwoEvent traceRead) throws InterruptedException { ObjectTransitionSafepoint.INSTANCE.unregister(); if (VmSettings.REPLAY) { Activity reader = TracingActivityThread.currentThread().getActivity(); ChannelReadRecord crr = (ChannelReadRecord) reader.getNextReplayEvent(); assert crr != null : reader; assert channel.getId() == crr.channelId; while (numReads.get() != crr.readNo) { Thread.sleep(5); } } try { synchronized (this) { if (VmSettings.ACTOR_TRACING) { traceRead.record(channel.getId(), numReads.getAndIncrement()); } return cell.take(); } } finally { if (VmSettings.REPLAY) { numReads.incrementAndGet(); } ObjectTransitionSafepoint.INSTANCE.register(); } }

Target:
public Object read(final RecordTwoEvent traceRead) throws InterruptedException { ObjectTransitionSafepoint.INSTANCE.unregister(); if (VmSettings.REPLAY) { ReplayData.replayDelayNumberedEvent(this, channel.getId()); } try { synchronized (this) { if (VmSettings.ACTOR_TRACING) { traceRead.record(channel.getId(), numReads); numReads++; } return cell.take(); } } finally { if (VmSettings.REPLAY) { numReads++; } ObjectTransitionSafepoint.INSTANCE.register(); } }
Source:
protected ILaunchConfiguration findLaunchConfiguration(IResource resource, String mode) { ILaunchConfiguration configuration = null; ILaunchConfigurationType configType = getLaunchConfigType(); List<ILaunchConfiguration> candidateConfigs = Collections.emptyList(); try { ILaunchConfiguration[] configs = DebugPlugin.getDefault() .getLaunchManager().getLaunchConfigurations(configType); candidateConfigs = new ArrayList<>(configs.length); for (ILaunchConfiguration config : configs) { String sourcePath = config.getAttribute( IBuildDockerImageLaunchConfigurationConstants.SOURCE_PATH_LOCATION, ""); boolean workspaceRelative = config .getAttribute(IBuildDockerImageLaunchConfigurationConstants.SOURCE_PATH_WORKSPACE_RELATIVE_LOCATION, false); IPath dockerfilePath = getPath(sourcePath, workspaceRelative); if (dockerfilePath.equals(resource.getLocation())) { candidateConfigs.add(config); } } } catch (CoreException e) { Activator.log(e); } int candidateCount = candidateConfigs.size(); if (candidateCount < 1) { configuration = createConfiguration(resource, mode, true); } else if (candidateCount == 1) { configuration = candidateConfigs.get(0); } else { configuration = chooseConfiguration(candidateConfigs); } return configuration; }

Target:
protected ILaunchConfiguration findLaunchConfiguration(IResource resource, String mode) { ILaunchConfiguration configuration = null; ILaunchConfigurationType configType = getLaunchConfigType(); List<ILaunchConfiguration> candidateConfigs = Collections.emptyList(); try { ILaunchConfiguration[] configs = DebugPlugin.getDefault() .getLaunchManager().getLaunchConfigurations(configType); candidateConfigs = new ArrayList<>(configs.length); for (ILaunchConfiguration config : configs) { String sourcePath = config.getAttribute( IBuildDockerImageLaunchConfigurationConstants.SOURCE_PATH_LOCATION, ""); boolean workspaceRelative = config .getAttribute(IBuildDockerImageLaunchConfigurationConstants.SOURCE_PATH_WORKSPACE_RELATIVE_LOCATION, false); IPath dockerfilePath = getPath(sourcePath, workspaceRelative); if (dockerfilePath .equals(resource.getLocation().removeLastSegments(1))) { candidateConfigs.add(config); } } } catch (CoreException e) { Activator.log(e); } int candidateCount = candidateConfigs.size(); if (candidateCount < 1) { configuration = createConfiguration(resource, mode, true); } else if (candidateCount == 1) { configuration = candidateConfigs.get(0); } else { configuration = chooseConfiguration(candidateConfigs); } return configuration; }
Source:
private List<DiskInterface> getSupportedDiskInterfaces(int osId, Version version) { List<String> supportedDiskInterfaceNames = getOsRepository().getDiskInterfaces(osId, version); List<DiskInterface> supportedDiskInterfaces = new ArrayList<DiskInterface>(); for (String interfaceName : supportedDiskInterfaceNames) { try { supportedDiskInterfaces.add(DiskInterface.valueOf(interfaceName)); } catch (IllegalArgumentException e) { LOG.errorFormat("Can't find the value {0} in the enum DiskInterface. Error: {1}", ((interfaceName == null) ? "null" : interfaceName), e.toString()); } } return supportedDiskInterfaces; }

Target:
private static List<DiskInterface> getSupportedDiskInterfaces(int osId, Version version) { List<String> supportedDiskInterfaceNames = SimpleDependecyInjector.getInstance().get(OsRepository.class).getDiskInterfaces(osId, version); List<DiskInterface> supportedDiskInterfaces = new ArrayList<DiskInterface>(); for (String interfaceName : supportedDiskInterfaceNames) { try { supportedDiskInterfaces.add(DiskInterface.valueOf(interfaceName)); } catch (IllegalArgumentException e) { log.errorFormat("Can't find the value {0} in the enum DiskInterface.", interfaceName); } } return supportedDiskInterfaces; }
Source:
public void getMetaDataParams(AMFPacket metaDataPacket, IMediaStream stream) { WMSProperties props = stream.getProperties(); AMFDataList dataList = new AMFDataList(metaDataPacket.getData()); IMediaStreamActionNotify2 actionNotify; if (dataList.size() < 2) return; if (dataList.get(1).getType() == AMFData.DATA_TYPE_OBJECT) { AMFDataObj obj = (AMFDataObj) dataList.get(1); String videocodec, audiocodec; if (obj.containsKey(ONMETADATA_VIDEOCODECID)){ try { videocodec = FLVUtils.videoCodecToString(obj.getInt(ONMETADATA_VIDEOCODECID)); } catch (NumberFormatException e){ videocodec = obj.getString(ONMETADATA_VIDEOCODECID); } obj.put(ONMETADATA_VIDEOCODECIDSTR, videocodec); } if (obj.containsKey(ONMETADATA_AUDIOCODECID)){ try{ audiocodec = FLVUtils.audioCodecToString(obj.getInt(ONMETADATA_AUDIOCODECID)); } catch (NumberFormatException e){ audiocodec = obj.getString(ONMETADATA_VIDEOCODECID); } obj.put(ONMETADATA_AUDIOCODECIDSTR, audiocodec); } synchronized (props) { props.put(AMFSETDATAFRAME, obj); actionNotify = (IMediaStreamActionNotify2) stream.getProperties().get("streamActionNotifier"); } if (actionNotify != null) { stream.removeClientListener(actionNotify); logger.info("removeClientListener: " + stream.getSrc()); } } }

Target:
public void getMetaDataParams(AMFPacket metaDataPacket, IMediaStream stream) { AMFDataList dataList = new AMFDataList(metaDataPacket.getData()); for (int i = 0 ; i < dataList.size(); i++ ){ logger.debug("[" + stream.getName() +" ] Found DATA_TYPE_OBJECT"); AMFData amfData = dataList.get(i); if (amfData.getType() == AMFData.DATA_TYPE_OBJECT) { AMFDataObj obj = (AMFDataObj) amfData; String videocodec, audiocodec; if (obj.containsKey(ONMETADATA_VIDEOCODECID)){ try { videocodec = FLVUtils.videoCodecToString(obj.getInt(ONMETADATA_VIDEOCODECID)); } catch (NumberFormatException e){ videocodec = obj.getString(ONMETADATA_VIDEOCODECID); } obj.put(ONMETADATA_VIDEOCODECIDSTR, videocodec); } if (obj.containsKey(ONMETADATA_AUDIOCODECID)){ try{ audiocodec = FLVUtils.audioCodecToString(obj.getInt(ONMETADATA_AUDIOCODECID)); } catch (NumberFormatException e){ audiocodec = obj.getString(ONMETADATA_VIDEOCODECID); } obj.put(ONMETADATA_AUDIOCODECIDSTR, audiocodec); } WMSProperties props = stream.getProperties(); synchronized (props) { props.put(AMFSETDATAFRAME, obj); } removeListener(stream); return; } } logger.warn("[" + stream.getName() +" ] metadata not found"); }
Source:
public void evaluate() throws Throwable { IBeforeTest before = null; log.debug("Run before class extensions for test class " + testClass.getJavaClass().getName()); try { befores.sort(new PriorityComparator()); for (IBeforeTest bfr : befores) { before = bfr; if (before.hasToRun()){ log.debug("Run method runBeforeTestClass() of class " + before.getClass().getCanonicalName()); before.runBeforeTestClass(config, testClass); } } } catch (Throwable e) { log.error("Run method runBeforeTestClass() of class " + before.getClass().getCanonicalName() + " failed", e); if (isScreenshotRequired(e)) { createScreenshot("BeforeClassExt", before.getClass()); } throw e; } nextStatement.evaluate(); }

Target:
public void evaluate() throws Throwable { IBeforeTest before = null; log.debug("Run before class extensions for test class " + testClass.getJavaClass().getName()); try { befores.sort(new PriorityComparator()); for (IBeforeTest bfr : befores) { before = bfr; if (before.hasToRun()){ log.debug("Run method runBeforeTestClass() of class " + before.getClass().getCanonicalName()); before.runBeforeTestClass(config, testClass); } } } catch (Throwable e) { if(ScreenshotCapturer.shouldCaptureScreenshotOnException(e)){ log.error("Run method runBeforeTestClass() of class " + before.getClass().getCanonicalName() + " failed", e); createScreenshot("BeforeClassExt", before.getClass()); } throw e; } nextStatement.evaluate(); }
Source:
int foo() throws InterruptedException { int x = 1; int a = 2; while (true) { try { if (x > 0) { break; } else if (x < 0) { ; } else { break; } switch (a) { case 1: { break; } case (1 + 2): { break; } case 0: break; default: break; } } catch (Exception e) { break; } finally { break; } } synchronized (this) { do { x = 2; } while (x == 2); } synchronized (this) { do while (x == 2); } for (int k = 0; k < 1; k++) { String innerBlockVariable = ""; } for (int k = 0; k < 1; k++) return a; }

Target:
int foo() throws InterruptedException { int x = 1; int a = 2; while (true) { try { if (x > 0) { break; } else if (x < 0) { ; } else { break; } switch (a) { case 0: break; default: break; } } catch (Exception e) { break; } finally { break; } } synchronized (this) { do { x = 2; } while (x == 2); } synchronized (this) { do while (x == 2); } for (int k = 0; k < 1; k++) { String innerBlockVariable = ""; } for (int k = 0; k < 1; k++) return a; }
Source:
private void validateOptions(char role) throws IllegalArgumentException { if (role == 'P') { if (!ObjectHelper.isEmpty(consumerType) || persistentTailTracking || !ObjectHelper.isEmpty(tailTrackDb) || !ObjectHelper.isEmpty(tailTrackCollection) || !ObjectHelper.isEmpty(tailTrackField) || cursorRegenerationDelay != 1000L) { throw new IllegalArgumentException("consumerType, tailTracking, cursorRegenerationDelay options cannot appear on a producer endpoint"); } } else if (role == 'C') { if (!ObjectHelper.isEmpty(operation) || dynamicity || outputType != null) { throw new IllegalArgumentException("operation, dynamicity, outputType " + "options cannot appear on a consumer endpoint"); } if (consumerType == MongoDbConsumerType.tailable) { if (tailTrackIncreasingField == null) { throw new IllegalArgumentException("tailTrackIncreasingField option must be set for tailable cursor MongoDB consumer endpoint"); } if (persistentTailTracking && (ObjectHelper.isEmpty(persistentId))) { throw new IllegalArgumentException("persistentId is compulsory for persistent tail tracking"); } if (persistentTailTracking && (ObjectHelper.isEmpty(persistentId))) { throw new IllegalArgumentException("persistentId is compulsory for persistent tail tracking"); } } } else { throw new IllegalArgumentException("Unknown endpoint role"); } }

Target:
private void validateOptions(char role) throws IllegalArgumentException { if (role == 'P') { if (!ObjectHelper.isEmpty(consumerType) || persistentTailTracking || !ObjectHelper.isEmpty(tailTrackDb) || !ObjectHelper.isEmpty(tailTrackCollection) || !ObjectHelper.isEmpty(tailTrackField) || cursorRegenerationDelay != 1000L) { throw new IllegalArgumentException("consumerType, tailTracking, cursorRegenerationDelay options cannot appear on a producer endpoint"); } } else if (role == 'C') { if (!ObjectHelper.isEmpty(operation) || dynamicity || outputType != null) { throw new IllegalArgumentException("operation, dynamicity, outputType " + "options cannot appear on a consumer endpoint"); } if (consumerType == MongoDbConsumerType.tailable) { if (tailTrackIncreasingField == null) { throw new IllegalArgumentException("tailTrackIncreasingField option must be set for tailable cursor MongoDB consumer endpoint"); } if (persistentTailTracking && (ObjectHelper.isEmpty(persistentId))) { throw new IllegalArgumentException("persistentId is compulsory for persistent tail tracking"); } } } else { throw new IllegalArgumentException("Unknown endpoint role"); } }
Source:
private boolean matchesVersionInternal(Element element) { String schemaLocation = element.getAttributeNS("<LINK_0>", "schemaLocation"); return schemaLocation.matches("(?m).*spring-security-3\\.[12].*.xsd.*") || schemaLocation.matches("(?m).*spring-security.xsd.*") || !schemaLocation.matches("(?m).*spring-security.*"); }

Target:
private boolean matchesVersionInternal(Element element) { String schemaLocation = element.getAttributeNS("<LINK_0>", "schemaLocation"); return schemaLocation.matches("(?m).*spring-security-3\\.2.*.xsd.*") || schemaLocation.matches("(?m).*spring-security.xsd.*") || !schemaLocation.matches("(?m).*spring-security.*"); }
Source:
public String display(Type type, Object value) throws HTMLDisplayerException { return display(type, value, new HashMap<>()); }

Target:
public String display(Type type, Object value) throws HTMLDisplayerException { return display(type, value, Collections.emptyMap()); }
Source:
private void generateScript(String scriptName, AutomationConfiguration configuration) { Path scriptDirPath = configuration.getScriptLocation().orElseThrow(() -> new BriefcaseException("No script location directory defined")); String storageDir = appPreferences.getBriefcaseDir().orElseThrow(() -> new BriefcaseException("")).getParent().toString(); String template = "java -jar briefcase.jar --export --form_id {0} --storage_directory " + storageDir + " --export_directory /tmp --export_filename {1}.csv"; try { PrintWriter writer = new PrintWriter(scriptDirPath.toFile() + File.pathSeparator + scriptName); List<BriefcaseFormDefinition> forms = formCache.getForms(); System.out.println(forms.size()); System.out.println(storageDir); for (BriefcaseFormDefinition form: forms) { Object[] params = new Object[]{form.getFormId(), form.getFormName()}; String command = MessageFormat.format(template, params); writer.println(command); writer.close(); } writer.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } }

Target:
private void generateScript(String scriptName, AutomationConfiguration configuration) { Path scriptDirPath = configuration.getScriptLocation().orElseThrow(BriefcaseException::new); Path storageDir = appPreferences.getBriefcaseDir().orElseThrow(BriefcaseException::new).getParent(); String exportTemplate = "java -jar {0} --export --form_id {1} --storage_directory {2} --export_directory {3} --export_filename {4}.csv"; String template = "java -jar {0} --form_id {1} --storage_directory {2}{3}"; List<String> scriptLines = new ArrayList<>(); String jarInstructions = writeBriefcaseJarToScript(); scriptLines.add(jarInstructions); String briefcaseJar = isWindows() ? "%JAR%" : "$JAR"; List<String> pullInstructions = forms.getPullSelectedForms() .stream() .map(form -> MessageFormat.format( template, briefcaseJar, form.getFormDefinition().getFormId(), storageDir.toString(), getParams(pullSource.orElseThrow(BriefcaseException::new).getPullCliParams()) )).collect(toList()); scriptLines.addAll(pullInstructions); List<String> exportInstructions = forms.getExportSelectedForms() .stream() .map(form -> MessageFormat.format( exportTemplate, briefcaseJar, form.getFormDefinition().getFormId(), storageDir.toString(), "/tmp", form.getFormName() )) .collect(Collectors.toList()); scriptLines.add(""); scriptLines.add(""); scriptLines.addAll(exportInstructions); List<String> pushInstructions = forms.getPushSelectedForms() .stream() .map(form -> MessageFormat.format( template, briefcaseJar, form.getFormDefinition().getFormId(), storageDir.toString(), getParams(pushSource.orElseThrow(BriefcaseException::new).getPushCliParams()) )).collect(toList()); scriptLines.add(""); scriptLines.add(""); scriptLines.addAll(pushInstructions); try { Files.write( scriptDirPath.resolve(scriptName), scriptLines, CREATE, TRUNCATE_EXISTING ); view.showConfirmation(); } catch (IOException e) { throw new BriefcaseException(e); } }
Source:
@Test void testAggregateCaseToFilter() { final String sql = "select\n" + " sum(sal) as sum_sal,\n" + " count(distinct case\n" + " when job = 'CLERK'\n" + " then deptno else null end) as count_distinct_clerk,\n" + " sum(case when deptno = 10 then sal end) as sum_sal_d10,\n" + " sum(case when deptno = 20 then sal else 0 end) as sum_sal_d20,\n" + " sum(case when deptno = 30 then 1 else 0 end) as count_d30,\n" + " sum(case when deptno = 40 then 1 end) as count_d40,\n" + " count(case when deptno = 50 then 'x' end) as count_d50,\n" + " count(case when deptno = 20 then 1 end) as count_d20\n" + "from emp"; sql(sql).withRule(CoreRules.AGGREGATE_CASE_TO_FILTER).check(); }

Target:
@Test void testAggregateCaseToFilter() { final String sql = "select\n" + " sum(sal) as sum_sal,\n" + " count(distinct case\n" + " when job = 'CLERK'\n" + " then deptno else null end) as count_distinct_clerk,\n" + " sum(case when deptno = 10 then sal end) as sum_sal_d10,\n" + " sum(case when deptno = 20 then sal else 0 end) as sum_sal_d20,\n" + " sum(case when deptno = 30 then 1 else 0 end) as count_d30,\n" + " sum(case when deptno = 40 then 1 end) as count_d40,\n" + " sum(case when deptno = 50 then 1 else null end) as count_d50,\n" + " sum(case when deptno = 60 then null end) as sum_null_d60,\n" + " sum(case when deptno = 70 then null else 1 end) as sum_null_d70,\n" + " count(case when deptno = 10 then 'x' end) as count_d10,\n" + " count(case when deptno = 20 then 1 end) as count_d20\n" + "from emp"; sql(sql).withRule(CoreRules.AGGREGATE_CASE_TO_FILTER).check(); }
Source:
private void dataCenterWithClusterSelectedItemChanged(Object sender, EventArgs args) { String selectedTimeZone = ""; Integer selectedOsId = null; if (getTimeZone().getSelectedItem() != null) { selectedTimeZone = getTimeZone().getSelectedItem().getTimeZoneKey().toString(); } if (getOSType().getSelectedItem() != null) { selectedOsId = getOSType().getSelectedItem(); } behavior.dataCenterWithClusterSelectedItemChanged(); refreshMigrationPolicies(); updateMigrationRelatedFields(); DataCenterWithCluster dataCenterWithCluster = getDataCenterWithClustersList().getSelectedItem(); if (dataCenterWithCluster != null && dataCenterWithCluster.getDataCenter() != null) { getDisksAllocationModel().setQuotaEnforcementType(dataCenterWithCluster.getDataCenter() .getQuotaEnforcementType()); } updateMigrationOptions(); handleQxlClusterLevel(); updateWatchdogModels(); updateBootMenu(); getInstanceImages().updateActionsAvailability(); initGraphicsConsoles(); updateSoundCard(); updateResumeBehavior(); updateBiosType(); if (selectedOsId != null) { getBehavior().updateOSValue(selectedOsId); } if (!selectedTimeZone.isEmpty()) { getBehavior().updateTimeZone(selectedTimeZone); } }

Target:
private void dataCenterWithClusterSelectedItemChanged(Object sender, EventArgs args) { String selectedTimeZone = ""; Integer selectedOsId = null; if (getTimeZone().getSelectedItem() != null) { selectedTimeZone = getBehavior().getSelectedTimeZone(); } if (getOSType().getSelectedItem() != null) { selectedOsId = getBehavior().getSelectedOSType(); } behavior.dataCenterWithClusterSelectedItemChanged(); refreshMigrationPolicies(); updateMigrationRelatedFields(); DataCenterWithCluster dataCenterWithCluster = getDataCenterWithClustersList().getSelectedItem(); if (dataCenterWithCluster != null && dataCenterWithCluster.getDataCenter() != null) { getDisksAllocationModel().setQuotaEnforcementType(dataCenterWithCluster.getDataCenter() .getQuotaEnforcementType()); } updateMigrationOptions(); handleQxlClusterLevel(); updateWatchdogModels(); updateBootMenu(); getInstanceImages().updateActionsAvailability(); initGraphicsConsoles(); updateSoundCard(); updateResumeBehavior(); updateBiosType(); getBehavior().updateOSValue(selectedOsId); if (!selectedTimeZone.isEmpty()) { getBehavior().updateTimeZone(selectedTimeZone); } }
Source:
public List<Menu> getMenuItems() { MenuItem[] items = ml.getItemsFromMenu(mh.getMenuFromMenuItem(menuItem)); List<Menu> menus = new ArrayList<>(items.length); for (MenuItem item : items){ String title = mh.getMenuItemText(item); if(title.isEmpty()) continue; List<String> path = mh.getMenuPath(item); menus.add(new ShellMenu(path.toArray(new String[1]))); } return menus; }

Target:
public List<Menu> getMenuItems() { MenuItem[] items = ml.getItemsFromMenu(mh.getMenuFromMenuItem(menuItem)); List<Menu> menus = new ArrayList<>(items.length); for (MenuItem item : items){ if(mh.getMenuItemText(item).isEmpty()) continue; menus.add(new DefaultMenu(item)); } return menus; }
Source:
public ContentTypeManager() { super(null, InstanceScope.INSTANCE); }

Target:
private ContentTypeManager() { super(null, InstanceScope.INSTANCE); }