auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Promise<CLIOutputResponse> copy(Path project, Path source, Path destination, String comment, Credentials credentials) { final CopyRequest request = dtoFactory.createDto(CopyRequest.class) .withProjectPath(project.toString()) .withSource(source.toString()) .withDestination(destination.toString()) .withComment(comment) .withUsername(credentials.getUsername()) .withPassword(credentials.getPassword()); return asyncRequestFactory.createPostRequest(getBaseUrl() + "/copy", request) .loader(loader) .send(dtoUnmarshallerFactory.newUnmarshaller(CLIOutputResponse.class)); }

Target:
public Promise<CLIOutputResponse> copy(Path project, Path source, Path destination, String comment, Credentials credentials) { final CopyRequest request = dtoFactory.createDto(CopyRequest.class) .withProjectPath(project.toString()) .withSource(source.toString()) .withDestination(destination.toString()) .withComment(comment); if (credentials != null) { request.setUsername(credentials.getUsername()); request.setPassword(credentials.getPassword()); } return asyncRequestFactory.createPostRequest(getBaseUrl() + "/copy", request) .loader(loader) .send(dtoUnmarshallerFactory.newUnmarshaller(CLIOutputResponse.class)); }
Source:
void onContactsStatusRequestedFromServer(final Map<String, ContactStatus> contactsStatus) { if (updateContactStatus(contactsStatus)) { final Set<ContactDataComplete> contacts = createFullContactDataSet(); mState = State.INITIALIZED; notifyFullContactsListeners(contacts); } else { onError(); } }

Target:
void onContactsStatusRequestedFromServer(final Map<String, ContactStatus> contactsStatus) { if (updateContactStatus(contactsStatus)) { mState = State.INITIALIZED; notifyFullContactsListeners(createFullContactDataSet(), Error.NONE); } else { onError(Error.NO_INTERNET_CONNECTION); } }
Source:
static byte[] getRid(byte[] oscoreOption) { if (oscoreOption.length == 0) { oscoreOption = new byte[] { 0x00 }; } byte flagByte = oscoreOption[0]; int n = flagByte & 0x07; int k = flagByte & 0x08; int h = flagByte & 0x10; byte[] kid = null; int index = 1; index += n; if (h != 0) { int s = oscoreOption[index]; index += s + 1; } if (k != 0) { kid = Arrays.copyOfRange(oscoreOption, index, oscoreOption.length); } return kid; }

Target:
static byte[] getRid(byte[] oscoreOption) { if (oscoreOption.length == 0) { return null; } byte flagByte = oscoreOption[0]; int n = flagByte & 0x07; int k = flagByte & 0x08; int h = flagByte & 0x10; byte[] kid = null; int index = 1; index += n; if (h != 0) { int s = oscoreOption[index]; index += s + 1; } if (k != 0) { kid = Arrays.copyOfRange(oscoreOption, index, oscoreOption.length); } return kid; }
Source:
public Range getSearchRangeOnSingleValue(Object value) { if (Date.class.isAssignableFrom(dataType)) { Date center = (Date) value; Calendar cal = Calendar.getInstance(); cal.setTime(center); cal.setTimeInMillis(cal.getTimeInMillis() - before.longValue()); Date min = cal.getTime(); cal.setTime(center); cal.setTimeInMillis(cal.getTimeInMillis() + after.longValue()); Date max = cal.getTime(); return new DateRange(min, max); } else { throw new IllegalArgumentException("Unsupported value type " + dataType); } }

Target:
public Range getSearchRangeOnSingleValue(Object value) { if (Date.class.isAssignableFrom(dataType)) { Date center = (Date) value; Calendar cal = Calendar.getInstance(); cal.setTime(center); cal.setTimeInMillis(cal.getTimeInMillis() - before.longValue()); Date min = cal.getTime(); cal.setTime(center); cal.setTimeInMillis(cal.getTimeInMillis() + after.longValue()); Date max = cal.getTime(); return new DateRange(min, max); } throw new IllegalArgumentException("Unsupported value type " + dataType); }
Source:
public static short computeDuplicateScore(final SAMRecord record, final ScoringStrategy scoringStrategy, final boolean assumeMateCigar) { Short storedScore = (Short) record.getTransientAttribute(Attr.DuplicateScore); if (storedScore == null) { short score = 0; switch (scoringStrategy) { case SUM_OF_BASE_QUALITIES: score += getSumOfBaseQualities(record); break; case TOTAL_MAPPED_REFERENCE_LENGTH: if (!record.getReadUnmappedFlag()) { score += record.getCigar().getReferenceLength(); } if (assumeMateCigar && record.getReadPairedFlag() && !record.getMateUnmappedFlag()) { score += SAMUtils.getMateCigar(record).getReferenceLength(); } break; case RANDOM: score += (short) Math.sqrt(record.getReadName().hashCode()); } storedScore = score; record.setTransientAttribute(Attr.DuplicateScore, storedScore); } return storedScore; }

Target:
public static short computeDuplicateScore(final SAMRecord record, final ScoringStrategy scoringStrategy, final boolean assumeMateCigar) { Short storedScore = (Short) record.getTransientAttribute(Attr.DuplicateScore); if (storedScore == null) { short score = 0; switch (scoringStrategy) { case SUM_OF_BASE_QUALITIES: score += getSumOfBaseQualities(record); break; case TOTAL_MAPPED_REFERENCE_LENGTH: if (!record.getReadUnmappedFlag()) { score += record.getCigar().getReferenceLength(); } if (assumeMateCigar && record.getReadPairedFlag() && !record.getMateUnmappedFlag()) { score += SAMUtils.getMateCigar(record).getReferenceLength(); } break; case RANDOM: score += (short) (hasher.hashUnencodedChars(record.getReadName()) >> 16); } storedScore = score; record.setTransientAttribute(Attr.DuplicateScore, storedScore); } return storedScore; }
Source:
public void start() throws Exception { if (transport == null) throw new IllegalStateException("CacheViewManager only works in clustered cachesb"); self = transport.getAddress(); running = true; ThreadFactory tfViewInstaller = new ThreadFactory() { private volatile AtomicInteger count = new AtomicInteger(0); @Override public Thread newThread(Runnable r) { return new Thread(r, "CacheViewInstaller-" + count.incrementAndGet() + "," + self); } }; cacheViewInstallerExecutor = Executors.newCachedThreadPool(tfViewInstaller); viewTriggerThread = new ViewTriggerThread(); cacheManagerNotifier.addListener(listener); handleNewView(transport.getMembers(), false, true); }

Target:
public void start() throws Exception { if (transport == null) throw new ConfigurationException("CacheViewManager only works in clustered caches"); self = transport.getAddress(); running = true; ThreadFactory tfViewInstaller = new ThreadFactory() { private volatile AtomicInteger count = new AtomicInteger(0); @Override public Thread newThread(Runnable r) { return new Thread(r, "CacheViewInstaller-" + count.incrementAndGet() + "," + self); } }; cacheViewInstallerExecutor = Executors.newCachedThreadPool(tfViewInstaller); viewTriggerThread = new ViewTriggerThread(); cacheManagerNotifier.addListener(listener); handleNewView(transport.getMembers(), false, true); }
Source:
private String extractImageId(ServerInfo serverInfo) { String imageId = serverInfo.getMeta().get("image_id"); if (imageId == null) { ServerDrive serverBootDrive = null; for (ServerDrive serverDrive : serverInfo.getDrives()) { if (serverDrive.getBootOrder() > 0 && (serverBootDrive == null || serverDrive.getBootOrder() < serverBootDrive.getBootOrder())) { serverBootDrive = serverDrive; } } if (serverBootDrive != null) { imageId = serverBootDrive.getDriveUuid(); } } return imageId; }

Target:
private static String extractImageId(ServerInfo serverInfo) { String imageId = serverInfo.getMeta().get("image_id"); if (imageId == null) { ServerDrive serverBootDrive = null; for (ServerDrive serverDrive : serverInfo.getDrives()) { if (serverDrive.getBootOrder() != null && (serverBootDrive == null || serverDrive.getBootOrder() < serverBootDrive.getBootOrder())) { serverBootDrive = serverDrive; } } if (serverBootDrive != null) { imageId = serverBootDrive.getDriveUuid(); } } return imageId; }
Source:
private double getConsumerMetricValue(Consumer<?, ?> consumer, String clientId, String metricName) { Map<String, String> tags = new HashMap<>(2); tags.put("client-id", clientId); MetricName name = new MetricName(metricName, "lnkd", "", tags); return Optional.ofNullable(consumer).map(c -> c.metrics().get(name)).map(Metric::value).orElse(0.0); }

Target:
private double getConsumerMetricValue(Consumer<?, ?> consumer, String clientId, String metricName) { Map<String, String> tags = new HashMap<>(2); tags.put("client-id", clientId); MetricName name = new MetricName(metricName, "lnkd", "", tags); Metric metric = consumer.metrics().get(name); return (metric != null && metric.metricValue() instanceof Double) ? (Double) metric.metricValue() : 0.0; }
Source:
private static void executeDeleteQueryWithLikeOperator(Connection conn, String query, int tenantId) throws Exception { PreparedStatement ps = null; try { ps = conn.prepareStatement(query); String param = "%/" + String.valueOf(tenantId) + "/%"; ps.setNString(1, param); ps.executeUpdate(); } catch (SQLException e) { String errMsg = "Error executing query " + query + " for tenant: " + tenantId; log.error(errMsg, e); throw new Exception(errMsg, e); } finally { if (ps != null) { ps.close(); } } }

Target:
private static void executeDeleteQueryWithLikeOperator(Connection conn, String query, int tenantId) throws SQLException { try (PreparedStatement ps = conn.prepareStatement(query)) { String param = "%/cloud-services/" + String.valueOf(tenantId) + "/%"; ps.setNString(1, param); ps.executeUpdate(); if (log.isDebugEnabled()) { log.debug("Deletion query : " + query + "executed for tenant :" + tenantId); } } catch (SQLException e) { String errMsg = "Error executing query " + query + " for tenant: " + tenantId; throw new SQLException(errMsg, e); } }
Source:
public ImmutableMap<String, Long> collectWrongEpochs() { Map<String, Long> wrongEpochs = new HashMap<>(); clusterState.forEach((server, state) -> { try { state.get(timeout, TimeUnit.MILLISECONDS); } catch (Exception e) { if (e.getCause() instanceof WrongEpochException) { wrongEpochs.put(server, ((WrongEpochException) e.getCause()).getCorrectEpoch()); } } }); return ImmutableMap.copyOf(wrongEpochs); }

Target:
public ImmutableMap<String, Long> collectWrongEpochs() { Map<String, Long> wrongEpochs = new HashMap<>(); clusterState.forEach((server, state) -> { try { state.get(); } catch (Exception e) { if (e.getCause() instanceof WrongEpochException) { wrongEpochs.put(server, ((WrongEpochException) e.getCause()).getCorrectEpoch()); } } }); return ImmutableMap.copyOf(wrongEpochs); }
Source:
public ContainerStateMachine(RaftGroupId gid, ContainerDispatcher dispatcher, ThreadPoolExecutor chunkExecutor, XceiverServerRatis ratisServer, long expiryInterval, boolean isBlockTokenEnabled, TokenVerifier tokenVerifier, Configuration conf) { this.gid = gid; this.dispatcher = dispatcher; this.chunkExecutor = chunkExecutor; this.ratisServer = ratisServer; metrics = CSMMetrics.create(gid); this.writeChunkFutureMap = new ConcurrentHashMap<>(); applyTransactionCompletionMap = new ConcurrentHashMap<>(); stateMachineDataCache = CacheBuilder.newBuilder() .expireAfterAccess(expiryInterval, TimeUnit.MILLISECONDS) .maximumSize(chunkExecutor.getCorePoolSize()).build(); this.isBlockTokenEnabled = isBlockTokenEnabled; this.tokenVerifier = tokenVerifier; this.createContainerSet = new ConcurrentSkipListSet<>(); final int numContainerOpExecutors = conf.getInt( OzoneConfigKeys.DFS_CONTAINER_RATIS_NUM_CONTAINER_OP_EXECUTORS_KEY, OzoneConfigKeys.DFS_CONTAINER_RATIS_NUM_CONTAINER_OP_EXECUTORS_DEFAULT); this.executors = new ExecutorService[numContainerOpExecutors]; for (AtomicInteger i = new AtomicInteger(); i.get() < numContainerOpExecutors; i.incrementAndGet()) { this.executors[i.get()] = Executors.newSingleThreadExecutor(r -> { Thread t = new Thread(r); t.setName("RatisApplyTransactionExecutor " + i.get()); return t; }); } }

Target:
public ContainerStateMachine(RaftGroupId gid, ContainerDispatcher dispatcher, ThreadPoolExecutor chunkExecutor, XceiverServerRatis ratisServer, long expiryInterval, boolean isBlockTokenEnabled, TokenVerifier tokenVerifier, Configuration conf) { this.gid = gid; this.dispatcher = dispatcher; this.chunkExecutor = chunkExecutor; this.ratisServer = ratisServer; metrics = CSMMetrics.create(gid); this.writeChunkFutureMap = new ConcurrentHashMap<>(); applyTransactionCompletionMap = new ConcurrentHashMap<>(); stateMachineDataCache = CacheBuilder.newBuilder() .expireAfterAccess(expiryInterval, TimeUnit.MILLISECONDS) .maximumSize(chunkExecutor.getCorePoolSize()).build(); this.isBlockTokenEnabled = isBlockTokenEnabled; this.tokenVerifier = tokenVerifier; this.createContainerSet = new ConcurrentSkipListSet<>(); final int numContainerOpExecutors = conf.getInt( OzoneConfigKeys.DFS_CONTAINER_RATIS_NUM_CONTAINER_OP_EXECUTORS_KEY, OzoneConfigKeys.DFS_CONTAINER_RATIS_NUM_CONTAINER_OP_EXECUTORS_DEFAULT); this.executors = new ExecutorService[numContainerOpExecutors]; for (int i = 0; i < numContainerOpExecutors; i++) { final int index = i; this.executors[index] = Executors.newSingleThreadExecutor(r -> { Thread t = new Thread(r); t.setName("RatisApplyTransactionExecutor " + index); return t; }); } }
Source:
public List<String> resolve(List<String> names) { if (names == null) { return new ArrayList<>(); } final String defaultRack = defaultRackSupplier.get(); Preconditions.checkNotNull(defaultRack, "Default rack cannot be null"); List<String> rNames = resolver.resolve(names); if (rNames != null && rNames.size() == names.size()) { for (int i = 0; i < rNames.size(); ++i) { if (rNames.get(i) == null) { LOG.warn("Failed to resolve network location for {}, using default rack for it : {}.", rNames.get(i), defaultRack); rNames.set(i, defaultRack); } } return rNames; } LOG.warn("Failed to resolve network location for {}, using default rack for them : {}.", names, defaultRack); rNames = new ArrayList<>(names.size()); for (int i = 0; i < names.size(); ++i) { rNames.add(defaultRack); } return rNames; }

Target:
public List<String> resolve(List<String> names) { if (names == null) { return Collections.emptyList(); } final String defaultRack = defaultRackSupplier.get(); Preconditions.checkNotNull(defaultRack, "Default rack cannot be null"); List<String> rNames = resolver.resolve(names); if (rNames != null && rNames.size() == names.size()) { for (int i = 0; i < rNames.size(); ++i) { if (rNames.get(i) == null) { LOG.warn("Failed to resolve network location for {}, using default rack for it : {}.", rNames.get(i), defaultRack); rNames.set(i, defaultRack); } } return rNames; } LOG.warn("Failed to resolve network location for {}, using default rack for them : {}.", names, defaultRack); rNames = new ArrayList<>(names.size()); for (int i = 0; i < names.size(); ++i) { rNames.add(defaultRack); } return rNames; }
Source:
public ITmfTrace openMinimalTrace(String projectName, String traceName, Boolean isExperiment) throws FileNotFoundException { Map<String, Object> parameters = new HashMap<>(); parameters.put("name", traceName); String filePath = getFile(projectName, traceName, isExperiment).getLocation().getPath(); parameters.put("uri", filePath); QueryParameters query = new QueryParameters(parameters, Collections.emptyList()); TraceManagerService traceManager = new TraceManagerService(); Response response = traceManager.putTrace(query); Object traceObject = response.getEntity(); if (traceObject instanceof ITmfTrace) { return (ITmfTrace) traceObject; } throw new FileNotFoundException(); }

Target:
public ITmfTrace openMinimalTrace(String projectName, String traceName, Boolean isExperiment) throws FileNotFoundException { String path = getFile(projectName, traceName, isExperiment).getLocationURI().getPath(); ITmfTrace trace; try { trace = put(path, traceName, ""); if (trace != null) { return trace; } } catch (InstantiationException | IllegalAccessException | FileNotFoundException | TmfTraceException | CoreException | TmfTraceImportException e) { } throw new FileNotFoundException(); }
Source:
public static void handleSpecialProperties(String contentType, MessageContext axis2MessageCtx) { axis2MessageCtx.setProperty(Constants.Configuration.MESSAGE_TYPE, contentType); axis2MessageCtx.setProperty(Constants.Configuration.CONTENT_TYPE, contentType); Map headers = (Map) axis2MessageCtx.getProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS); if (headers != null) { headers.remove(HTTP.CONTENT_TYPE); headers.put(HTTP.CONTENT_TYPE, contentType); } }

Target:
public static void handleSpecialProperties(String contentType, MessageContext axis2MessageCtx) { axis2MessageCtx.setProperty(Constants.Configuration.MESSAGE_TYPE, contentType); axis2MessageCtx.setProperty(Constants.Configuration.CONTENT_TYPE, contentType); Map headers = (Map) axis2MessageCtx.getProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS); if (headers != null) { headers.put(HTTP.CONTENT_TYPE, contentType); } }
Source:
public abstract SyncUser run() throws ObjectServerError; public RealmAsyncTask start() { Future<?> authenticateRequest = networkPoolExecutor.submit(new Runnable() { @Override public void run() { try { postSuccess(Request.this.run()); } catch (ObjectServerError e) { postError(e); } } }); return new RealmAsyncTaskImpl(authenticateRequest, networkPoolExecutor); }

Target:
public abstract SyncUser run() throws ObjectServerError; public RealmAsyncTask start() { Future<?> authenticateRequest = networkPoolExecutor.submit(new Runnable() { @Override public void run() { try { postSuccess(Request.this.run()); } catch (ObjectServerError e) { postError(e); } catch (Throwable e) { postError(new ObjectServerError(ErrorCode.UNKNOWN, "Unexpected error", e)); } } }); return new RealmAsyncTaskImpl(authenticateRequest, networkPoolExecutor); }
Source:
private TableViewer buildAndLayoutTable(final TableViewer aViewer) { final Table table = aViewer.getTable(); ITableModel[] tableInfo = ConflictWithTableModel.values(); int size = tableInfo.length; for (int index = 0; index < size; index++) { createTableViewerColumn(tableInfo[index]); } TableLayout tableLayout = new TableLayout(); table.setLayout(tableLayout); table.setHeaderVisible(true); table.setLinesVisible(true); table.setData("conflictsWithTable"); return aViewer; }

Target:
private TableViewer buildAndLayoutTable(final TableViewer aViewer) { final Table table = aViewer.getTable(); ITableModel[] tableInfo = ConflictWithTableModel.values(); int size = tableInfo.length; for (int index = 0; index < size; index++) { createTableViewerColumn(tableInfo[index]); } TableLayout tableLayout = new TableLayout(); table.setLayout(tableLayout); table.setHeaderVisible(true); table.setLinesVisible(true); table.setData(CONFLICTS_WITH_TABLE); return aViewer; }
Source:
public void testDateColumn() { IonSqlQueryBuilder queryBuilder = new IonSqlQueryBuilder(new TypeRegistry()); List<HiveColumnHandle> columns = ImmutableList.of( new HiveColumnHandle("t1", HIVE_TIMESTAMP, parseTypeSignature(TIMESTAMP), 0, REGULAR, Optional.empty()), new HiveColumnHandle("t2", HIVE_DATE, parseTypeSignature(StandardTypes.DATE), 1, REGULAR, Optional.empty())); TupleDomain<HiveColumnHandle> tupleDomain = TupleDomain.withColumnDomains(ImmutableMap.of( columns.get(1), Domain.create(SortedRangeSet.copyOf(DATE, (List<Range>) ImmutableList.of(Range.equal(DATE, (long) DateTimeUtils.parseDate("2001-08-22")))), false))); assertEquals("SELECT s._1, s._2 FROM S3Object s WHERE (case s._2 when '' then null else CAST(s._2 AS TIMESTAMP) end = `2001-08-22`)", queryBuilder.buildSql(columns, tupleDomain)); }

Target:
public void testDateColumn() { IonSqlQueryBuilder queryBuilder = new IonSqlQueryBuilder(new TypeRegistry()); List<HiveColumnHandle> columns = ImmutableList.of( new HiveColumnHandle("t1", HIVE_TIMESTAMP, parseTypeSignature(TIMESTAMP), 0, REGULAR, Optional.empty()), new HiveColumnHandle("t2", HIVE_DATE, parseTypeSignature(StandardTypes.DATE), 1, REGULAR, Optional.empty())); TupleDomain<HiveColumnHandle> tupleDomain = withColumnDomains(ImmutableMap.of( columns.get(1), Domain.create(SortedRangeSet.copyOf(DATE, ImmutableList.of(Range.equal(DATE, (long) DateTimeUtils.parseDate("2001-08-22")))), false))); assertEquals("SELECT s._1, s._2 FROM S3Object s WHERE (case s._2 when '' then null else CAST(s._2 AS TIMESTAMP) end = `2001-08-22`)", queryBuilder.buildSql(columns, tupleDomain)); }
Source:
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (StringUtils.isEmpty(request.getParameter(SSOUtils.POST_ACTION_URL))) { throw new RuntimeException("No post action url found in request."); } if (StringUtils.isEmpty(request.getParameter(SSOUtils.VERSION))) { throw new RuntimeException("No version found in request."); } if (!SSOUtils.versionSupported(request.getParameter(SSOUtils.VERSION))) { throw new RuntimeException(String.format("Unsupported engine version %s found in request.", request.getParameter(SSOUtils.VERSION))); } if ("1".equals(request.getParameter("invalidate"))) { request.getSession(true).invalidate(); } if (!request.getParameterMap().isEmpty()) { request.getSession(true).setAttribute(SSOUtils.PARAMS_MAP, new HashMap<>(request.getParameterMap())); } if (SSOUtils.isUserAuthenticated(request.getSession(true))) { request.getRequestDispatcher(SSOUtils.LOGIN_PHASE4_URI).forward(request, response); } else { SSOConfig config = (SSOConfig) request.getServletContext().getAttribute(SSOUtils.SSO_CONFIG); String externalParamValue = request.getParameter("external"); boolean disableExternal = StringUtils.isEmpty(externalParamValue) ? false : "0".equals(externalParamValue); if (config.isEnableExternalAuth() && !disableExternal) { response.sendRedirect(request.getContextPath() + SSOUtils.LOGIN_EXTERNAL_URI); } else { response.sendRedirect(request.getContextPath() + SSOUtils.LOGIN_PHASE2_URI); } } }

Target:
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { if (StringUtils.isEmpty(request.getParameter(SSOUtils.POST_ACTION_URL))) { throw new RuntimeException("No post action url found in request."); } if (StringUtils.isEmpty(request.getParameter(SSOUtils.VERSION))) { throw new RuntimeException("No version found in request."); } if (!SSOUtils.versionSupported(request.getParameter(SSOUtils.VERSION))) { throw new RuntimeException(String.format("Unsupported engine version %s found in request.", request.getParameter(SSOUtils.VERSION))); } if (!"0".equals(request.getParameter("invalidate"))) { request.getSession(true).invalidate(); } if (!request.getParameterMap().isEmpty()) { request.getSession(true).setAttribute(SSOUtils.PARAMS_MAP, new HashMap<>(request.getParameterMap())); } if (SSOUtils.isUserAuthenticated(request.getSession(true))) { request.getRequestDispatcher(SSOUtils.LOGIN_PHASE4_URI).forward(request, response); } else { SSOConfig config = (SSOConfig) request.getServletContext().getAttribute(SSOUtils.SSO_CONFIG); String externalParamValue = request.getParameter("external"); boolean disableExternal = config.isCanBypassExternalAuth() && StringUtils.isEmpty(externalParamValue) ? false : "0".equals(externalParamValue); if (config.isEnableExternalAuth() && !disableExternal) { response.sendRedirect(request.getContextPath() + SSOUtils.LOGIN_EXTERNAL_URI); } else { response.sendRedirect(request.getContextPath() + SSOUtils.LOGIN_PHASE2_URI); } } }
Source:
private Set<InstanceMetaData> getRemainingGoodInstances(Map<String, InstanceMetaData> allInstancesByInstanceId, Map<String, InstanceMetaData> instancesToRepair, Map<String, InstanceStatus> healthMap, boolean forceRepair) { return allInstancesByInstanceId.values().stream() .filter(instanceMetaData -> !instancesToRepair.containsKey(instanceMetaData.getInstanceId())) .filter(instanceMetaData -> { if (forceRepair) { return !INVALID_REPAIR_STATUSES.contains(instanceMetaData.getInstanceStatus()); } else { return healthMap.containsKey(instanceMetaData.getInstanceId()) && healthMap.get(instanceMetaData.getInstanceId()).isAvailable(); } }) .collect(Collectors.toSet()); }

Target:
private Set<InstanceMetaData> getRemainingGoodInstances(Map<String, InstanceMetaData> allInstancesByInstanceId, Map<String, InstanceMetaData> instancesToRepair, Map<String, InstanceStatus> healthMap, boolean forceRepair) { Set<InstanceMetaData> remainingGoodInstances = allInstancesByInstanceId.values().stream() .filter(instanceMetaData -> !instancesToRepair.containsKey(instanceMetaData.getInstanceId())) .filter(instanceMetaData -> { if (forceRepair) { return !INVALID_REPAIR_STATUSES.contains(instanceMetaData.getInstanceStatus()); } else { return healthMap.containsKey(instanceMetaData.getInstanceId()) && healthMap.get(instanceMetaData.getInstanceId()).isAvailable(); } }) .collect(Collectors.toSet()); LOGGER.debug("Remaining good instances [{}]", remainingGoodInstances); return remainingGoodInstances; }
Source:
private MapSqlParameterSource createInterfaceParametersMapper(VdsNetworkInterface nic) { return getCustomMapSqlParameterSource() .addValue("addr", nic.getAddress()) .addValue("bond_name", nic.getBondName()) .addValue("bond_type", nic.getBondType()) .addValue("gateway", nic.getGateway()) .addValue("id", nic.getId()) .addValue("is_bond", nic.getBonded()) .addValue("bond_opts", nic.getBondOptions()) .addValue("mac_addr", nic.getMacAddress()) .addValue("name", nic.getName()) .addValue("network_name", nic.getNetworkName()) .addValue("speed", nic.getSpeed()) .addValue("subnet", nic.getSubnet()) .addValue("boot_protocol", nic.getBootProtocol()) .addValue("type", nic.getType()) .addValue("vds_id", nic.getVdsId()) .addValue("vlan_id", nic.getVlanId()) .addValue("mtu", nic.getMtu()) .addValue("bridged", nic.isBridged()) .addValue("qos_overridden", nic.isQosOverridden()) .addValue("labels", SerializationFactory.getSerializer().serialize(nic.getLabels())) .addValue("custom_properties", SerializationFactory.getSerializer() .serialize(nic.hasCustomProperties() ? nic.getCustomProperties() : null)); }

Target:
private MapSqlParameterSource createInterfaceParametersMapper(VdsNetworkInterface nic) { return getCustomMapSqlParameterSource() .addValue("addr", nic.getAddress()) .addValue("bond_name", nic.getBondName()) .addValue("bond_type", nic.getBondType()) .addValue("gateway", nic.getGateway()) .addValue("id", nic.getId()) .addValue("is_bond", nic.getBonded()) .addValue("bond_opts", nic.getBondOptions()) .addValue("mac_addr", nic.getMacAddress()) .addValue("name", nic.getName()) .addValue("network_name", nic.getNetworkName()) .addValue("speed", nic.getSpeed()) .addValue("subnet", nic.getSubnet()) .addValue("boot_protocol", nic.getBootProtocol()) .addValue("type", nic.getType()) .addValue("vds_id", nic.getVdsId()) .addValue("vlan_id", nic.getVlanId()) .addValue("mtu", nic.getMtu()) .addValue("bridged", nic.isBridged()) .addValue("qos_overridden", nic.isQosOverridden()) .addValue("labels", SerializationFactory.getSerializer().serialize(nic.getLabels())) .addValue("custom_properties", nic.hasCustomProperties() ? SerializationFactory.getSerializer().serialize(nic.getCustomProperties()) : null); }
Source:
private Map<String, String> createThemeAssociations() { Map<String, String> result = new HashMap<String, String>(); IExtensionRegistry registry = RegistryFactory.getRegistry(); IExtensionPoint extPoint = registry.getExtensionPoint("org.eclipse.e4.ui.css.swt.theme"); for (IExtension e : extPoint.getExtensions()) { for (IConfigurationElement ce : e.getConfigurationElements()) { if (ce.getName().equals("themeassociation")) { String themeId = ce.getAttribute("themeid"); String osVersion = ce.getAttribute("os_version"); result.put(osVersion != null ? themeId + osVersion : themeId, ce.getAttribute("colorsandfonts")); } } } return result; }

Target:
private Map<String, String> createThemeAssociations() { Map<String, String> result = new HashMap<String, String>(); IExtensionRegistry registry = RegistryFactory.getRegistry(); IExtensionPoint extPoint = registry.getExtensionPoint(E4_THEME_EXTENSION_POINT); for (IExtension e : extPoint.getExtensions()) { for (IConfigurationElement ce : e.getConfigurationElements()) { if (ce.getName().equals(ATT_THEME_ASSOCIATION)) { String themeId = ce.getAttribute(ATT_THEME_ID); String osVersion = ce.getAttribute(ATT_OS_VERSION); result.put(osVersion != null ? themeId + osVersion : themeId, ce.getAttribute(ATT_COLOR_AND_FONT_ID)); } } } return result; }
Source:
public void commit(EDBCommit commit) throws EDBException { if (commit.isCommitted()) { throw new EDBException("EDBCommit was already commitet!"); } commit.finalize(); JPAHead nextHead; if (head != null) { LOGGER.debug("adding a new JPAHead"); nextHead = new JPAHead(head, commit.getTimestamp()); } else { LOGGER.debug("creating the first JPAHead"); nextHead = new JPAHead(commit.getTimestamp()); } for (String del : commit.getDeletions()) { nextHead.delete(del); } for (EDBObject update : commit.getObjects()) { String uid = update.getUID(); nextHead.replace(uid, update); } try { performUtxAction(UTXACTION.BEGIN); long timestamp = commit.getTimestamp(); commit.setCommitted(true); LOGGER.debug("persisting JPACommit and the new JPAHead"); entityManager.persist(commit); entityManager.persist(nextHead); LOGGER.debug("persisting the elements of the new JPAHead"); for (JPAObject o : nextHead.getJPAObjects()) { entityManager.persist(o); } LOGGER.debug("setting the deleted elements as deleted"); for (String id : commit.getDeletions()) { EDBObject o = new EDBObject(id, timestamp); o.put("@isDeleted", new Boolean(true)); JPAObject j = new JPAObject(o); entityManager.persist(j); } performUtxAction(UTXACTION.COMMIT); head = nextHead; } catch (Exception ex) { try { performUtxAction(UTXACTION.ROLLBACK); } catch (Exception e) { throw new EDBException("Failed to rollback transaction to DB", e); } throw new EDBException("Failed to commit transaction to DB", ex); } }

Target:
public Long commit(EDBCommit commit) throws EDBException { if (commit.isCommitted()) { throw new EDBException("EDBCommit was already commitet!"); } long timestamp = System.currentTimeMillis(); commit.setTimestamp(timestamp); JPAHead nextHead; if (head != null) { LOGGER.debug("adding a new JPAHead"); nextHead = new JPAHead(head, timestamp); } else { LOGGER.debug("creating the first JPAHead"); nextHead = new JPAHead(timestamp); } for (String del : commit.getDeletions()) { nextHead.delete(del); } for (EDBObject update : commit.getObjects()) { String oid = update.getOID(); update.updateTimestamp(timestamp); nextHead.replace(oid, update); } try { performUtxAction(UTXACTION.BEGIN); commit.setCommitted(true); LOGGER.debug("persisting JPACommit and the new JPAHead"); entityManager.persist(commit); entityManager.persist(nextHead); LOGGER.debug("persisting the elements of the new JPAHead"); for (JPAObject o : nextHead.getJPAObjects()) { entityManager.persist(o); } LOGGER.debug("setting the deleted elements as deleted"); for (String id : commit.getDeletions()) { EDBObject o = new EDBObject(id); o.updateTimestamp(timestamp); o.put("isDeleted", new Boolean(true)); JPAObject j = new JPAObject(o); entityManager.persist(j); } performUtxAction(UTXACTION.COMMIT); head = nextHead; } catch (Exception ex) { try { performUtxAction(UTXACTION.ROLLBACK); } catch (Exception e) { throw new EDBException("Failed to rollback transaction to DB", e); } throw new EDBException("Failed to commit transaction to DB", ex); } return timestamp; }
Source:
protected ContentFeatureSource createFeatureSource(ContentEntry entry, Query query) { return new MemoryFeatureStore(entry, query) { @Override protected QueryCapabilities buildQueryCapabilities() { return new QueryCapabilities() { @Override public boolean isUseProvidedFIDSupported() { return true; } }; } @Override protected FeatureWriter<SimpleFeatureType, SimpleFeature> getWriterInternal( Query query, int flags) throws IOException { return new MemoryFeatureWriter(getState(), query) { @Override public void write() throws IOException { if (Boolean.TRUE.equals(current.getUserData().get(Hints.USE_PROVIDED_FID))) { if (current.getUserData().containsKey(Hints.PROVIDED_FID)) { String fid = (String) current.getUserData().get(Hints.PROVIDED_FID); FeatureId id = new FeatureIdImpl(fid); current = new SimpleFeatureImpl(current.getAttributes(), current.getFeatureType(), id); } } super.write(); } }; } }; }

Target:
protected ContentFeatureSource createFeatureSource(ContentEntry entry, Query query) { return new MemoryFeatureStore(entry, query); }
Source:
protected AbstractEmitter(final Builder<?> builder) { Preconditions.checkArgument(builder.threadCount > 0, "threadCount must be greater than 0"); if (builder.httpClientAdapter != null) { this.httpClientAdapter = builder.httpClientAdapter; } else { Preconditions.checkNotNull(builder.collectorUrl, "Collector url must be specified if not using a httpClientAdapter"); OkHttpClient client = new OkHttpClient.Builder() .connectTimeout(5, TimeUnit.SECONDS) .readTimeout(5, TimeUnit.SECONDS) .writeTimeout(5, TimeUnit.SECONDS) .build(); this.httpClientAdapter = OkHttpClientAdapter.builder() .url(builder.collectorUrl) .httpClient(client) .build(); } this.requestCallback = builder.requestCallback; this.executor = Executors.newScheduledThreadPool(builder.threadCount); }

Target:
protected AbstractEmitter(final Builder<?> builder) { Preconditions.checkArgument(builder.threadCount > 0, "threadCount must be greater than 0"); if (builder.httpClientAdapter != null) { this.httpClientAdapter = builder.httpClientAdapter; } else { Preconditions.checkNotNull(builder.collectorUrl, "Collector url must be specified if not using a httpClientAdapter"); this.httpClientAdapter = OkHttpClientAdapter.builder() .url(builder.collectorUrl) .httpClient( new OkHttpClient()) .build(); } this.requestCallback = builder.requestCallback; this.executor = Executors.newScheduledThreadPool(builder.threadCount); }
Source:
public void performOpsAction(final Connection c, final long clientHandle, final OpsSelector selector, final ParameterSet params) throws Exception { m_es.submit(new Runnable() { @Override public void run() { try { collectStatsImpl(c, clientHandle, selector, params); } catch (Exception e) { hostLog.warn("Exception while attempting to collect stats", e); if (e instanceof ConcurrentModificationException) { sendErrorResponse(c, ClientResponse.GRACEFUL_FAILURE, "Statistics are unavailable, try again (" + e.getMessage() + ").", clientHandle); } else { sendErrorResponse(c, ClientResponse.OPERATIONAL_FAILURE, "Failed to get statistics (" + e.getMessage() + ").", clientHandle); } } } }); }

Target:
public void performOpsAction(final Connection c, final long clientHandle, final OpsSelector selector, final ParameterSet params) throws Exception { m_es.submit(new Runnable() { @Override public void run() { try { collectStatsImpl(c, clientHandle, selector, params); } catch (Exception e) { hostLog.warn("Exception while attempting to collect stats", e); sendErrorResponse(c, ClientResponse.OPERATIONAL_FAILURE, "Failed to get statistics (" + e.getMessage() + ").", clientHandle); } } }); }
Source:
public String toString() { StringBuilder result = new StringBuilder(); if (getLang() != null && !getLang().equals("und")) { result.append("Id: ").append(getId()); result.append(", Language Code: ").append(getLang()); } if (isNotBlank(getAudioTrackTitleFromMetadata())) { if (result.length() > 0) { result.append(", "); } result.append("Audio Track Title From Metadata: ").append(getAudioTrackTitleFromMetadata()); } if (result.length() > 0) { result.append(", "); } result.append("Audio Codec: ").append(getAudioCodec()); result.append(", Bitrate: ").append(getBitRate()); if (getBitsperSample() != 16) { result.append(", Bits per Sample: ").append(getBitsperSample()); } if (getAudioProperties() != null) { result.append(", ").append(getAudioProperties()); } if (isNotBlank(getArtist())) { result.append(", Artist: ").append(getArtist()); } if (isNotBlank(getAlbum())) { result.append(", Album: ").append(getAlbum()); } if (isNotBlank(getAlbumArtist())) { result.append(", Album Album: ").append(getAlbumArtist()); } if (isNotBlank(getSongname())) { result.append(", Track Name: ").append(getSongname()); } if (getYear() != 0) { result.append(", Year: ").append(getYear()); } if (getTrack() != 0) { result.append(", Track: ").append(getTrack()); } if (isNotBlank(getGenre())) { result.append(", Genre: ").append(getGenre()); } if (isNotBlank(getMuxingModeAudio())) { result.append(", Muxing Mode: ").append(getMuxingModeAudio()); } return result.toString(); }

Target:
public String toString() { StringBuilder result = new StringBuilder(); if (getLang() != null && !getLang().equals("und")) { result.append("Id: ").append(getId()); result.append(", Language Code: ").append(getLang()); } if (isNotBlank(getAudioTrackTitleFromMetadata())) { if (result.length() > 0) { result.append(", "); } result.append("Audio Track Title From Metadata: ").append(getAudioTrackTitleFromMetadata()); } if (result.length() > 0) { result.append(", "); } result.append("Audio Codec: ").append(getAudioCodec()); result.append(", Bitrate: ").append(getBitRate()); if (getBitsperSample() != 16) { result.append(", Bits per Sample: ").append(getBitsperSample()); } if (getAudioProperties() != null) { result.append(", ").append(getAudioProperties()); } if (isNotBlank(getArtist())) { result.append(", Artist: ").append(getArtist()); } if (isNotBlank(getAlbum())) { result.append(", Album: ").append(getAlbum()); } if (isNotBlank(getAlbumArtist())) { result.append(", Album Artist: ").append(getAlbumArtist()); } if (isNotBlank(getSongname())) { result.append(", Track Name: ").append(getSongname()); } if (getYear() != 0) { result.append(", Year: ").append(getYear()); } if (getTrack() != 0) { result.append(", Track: ").append(getTrack()); } if (isNotBlank(getGenre())) { result.append(", Genre: ").append(getGenre()); } if (isNotBlank(getMuxingModeAudio())) { result.append(", Muxing Mode: ").append(getMuxingModeAudio()); } return result.toString(); }
Source:
public MainTabBasicListItemActionButton(String tooltipText, ImageResource enabledImage, ImageResource disabledImage, String additionalStyle) { super(); initWidget(WidgetUiBinder.uiBinder.createAndBindUi(this)); setTooltipText(tooltipText); setEnabledHtml(SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(enabledImage).getHTML())); setDisabledHtml(SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(disabledImage).getHTML())); stylableButtonHolder.addStyleName(additionalStyle); }

Target:
public MainTabBasicListItemActionButton(String tooltipText, ImageResource enabledImage, ImageResource disabledImage, String additionalStyle) { initWidget(WidgetUiBinder.uiBinder.createAndBindUi(this)); setTooltipText(tooltipText); setEnabledHtml(SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(enabledImage).getHTML())); setDisabledHtml(SafeHtmlUtils.fromTrustedString(AbstractImagePrototype.create(disabledImage).getHTML())); stylableButtonHolder.addStyleName(additionalStyle); }
Source:
public GraphicCanvas(Composite parent) { super(parent); m_objects = new ArrayList<IGraphicObject>(); Listener mouseListener = new Listener() { public void handleEvent(Event event) { switch (event.type) { case SWT.MouseEnter: case SWT.MouseMove: IGraphicObject obj = getGraphicObject(event.x, event.y); if (obj != null && obj instanceof ITooltipProvider) { String tooltip = ((ITooltipProvider) obj).getTooltip(event.x, event.y); setToolTipText(tooltip); } break; } } }; addListener(SWT.MouseMove, mouseListener); addListener(SWT.MouseEnter, mouseListener); }

Target:
public GraphicCanvas(Composite parent) { super(parent); m_objects = new ArrayList<IGraphicObject>(); Listener mouseListener = new Listener() { public void handleEvent(Event event) { switch (event.type) { case SWT.MouseEnter: case SWT.MouseMove: IGraphicObject obj = getGraphicObject(event.x, event.y); if (obj instanceof ITooltipProvider) { String tooltip = ((ITooltipProvider) obj).getTooltip(event.x, event.y); setToolTipText(tooltip); } break; } } }; addListener(SWT.MouseMove, mouseListener); addListener(SWT.MouseEnter, mouseListener); }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_add_hb1ac); Toolbar toolbar = (Toolbar) findViewById(R.id.activity_main_toolbar); if (toolbar != null) { setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setElevation(2); } this.retrieveExtra(); AddA1CPresenter presenter = new AddA1CPresenter(this); setPresenter(presenter); presenter.setReadingTimeNow(); readingTextView = (TextView) findViewById(R.id.hb1ac_add_value); unitTextView = (TextView) findViewById(R.id.hb1ac_unit); this.createDateTimeViewAndListener(); this.createFANViewAndListener(); if (!"percentage".equals(presenter.getA1CUnitMeasuerement())) { unitTextView.setText(getString(R.string.mmol_mol)); } FormatDateTime formatDateTime = new FormatDateTime(getApplicationContext()); if (this.isEditing()) { setTitle(R.string.title_activity_add_hb1ac_edit); HB1ACReading readingToEdit = presenter.getHB1ACReadingById(getEditId()); readingTextView.setText(new StringBuilder().append(this.numberFormat.format(readingToEdit.getReading())).append("").toString()); Calendar cal = Calendar.getInstance(); cal.setTime(readingToEdit.getCreated()); this.getAddDateTextView().setText(formatDateTime.getDate(cal)); this.getAddTimeTextView().setText(formatDateTime.getTime(cal)); presenter.updateReadingSplitDateTime(readingToEdit.getCreated()); } else { this.getAddDateTextView().setText(formatDateTime.getCurrentDate()); this.getAddTimeTextView().setText(formatDateTime.getCurrentTime()); } }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_add_hb1ac); Toolbar toolbar = findViewById(R.id.activity_main_toolbar); if (toolbar != null) { setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setElevation(2); } this.retrieveExtra(); AddA1CPresenter presenter = new AddA1CPresenter(this); setPresenter(presenter); presenter.setReadingTimeNow(); readingTextView = findViewById(R.id.hb1ac_add_value); unitTextView = findViewById(R.id.hb1ac_unit); this.createDateTimeViewAndListener(); this.createFANViewAndListener(); if (!"percentage".equals(presenter.getA1CUnitMeasuerement())) { unitTextView.setText(getString(R.string.mmol_mol)); } FormatDateTime formatDateTime = new FormatDateTime(getApplicationContext()); if (this.isEditing()) { setTitle(R.string.title_activity_add_hb1ac_edit); HB1ACReading readingToEdit = presenter.getHB1ACReadingById(getEditId()); readingTextView.setText(this.numberFormat.format(readingToEdit.getReading())); Calendar cal = Calendar.getInstance(); cal.setTime(readingToEdit.getCreated()); this.getAddDateTextView().setText(formatDateTime.getDate(cal)); this.getAddTimeTextView().setText(formatDateTime.getTime(cal)); presenter.updateReadingSplitDateTime(readingToEdit.getCreated()); } else { this.getAddDateTextView().setText(formatDateTime.getCurrentDate()); this.getAddTimeTextView().setText(formatDateTime.getCurrentTime()); } }
Source:
public static StarlarkInt multiply(StarlarkInt x, StarlarkInt y) { try { long xl = x.toLongFast(); long yl = y.toLongFast(); long zl = xl * yl; int leadingZeros = Long.numberOfLeadingZeros(xl) + Long.numberOfLeadingZeros(~xl) + Long.numberOfLeadingZeros(yl) + Long.numberOfLeadingZeros(~yl); if (leadingZeros > Long.SIZE + 1) { return StarlarkInt.of(zl); } if (leadingZeros < Long.SIZE || (xl < 0 && yl == Long.MIN_VALUE)) { throw OVERFLOW; } if (xl == 0 || zl / xl == yl) { return StarlarkInt.of(zl); } } catch (Overflow unused) { } BigInteger xbig = x.toBigInteger(); BigInteger ybig = y.toBigInteger(); BigInteger zbig = xbig.multiply(ybig); return StarlarkInt.of(zbig); }

Target:
public static StarlarkInt multiply(StarlarkInt x, StarlarkInt y) { if (x instanceof Int32 && y instanceof Int32) { long xl = ((Int32) x).v; long yl = ((Int32) y).v; return StarlarkInt.of(xl * yl); } try { long xl = x.toLongFast(); long yl = y.toLongFast(); long xlo = xl & 0xFFFFFFFFL; long xhi = xl >> 32; long ylo = yl & 0xFFFFFFFFL; long yhi = yl >> 32; long zlo = xlo * ylo; long t = xhi * ylo + (zlo >>> 32); long z1 = t & 0xFFFFFFFFL; long z2 = t >> 32; z1 += xlo * yhi; long z128hi = xhi * yhi + z2 + (z1 >> 32); long z128lo = xl * yl; if (z128hi == (z128lo & Long.MIN_VALUE) >> 63) { return StarlarkInt.of(z128lo); } } catch (Overflow unused) { } if (x == ZERO || y == ONE) { return x; } else if (y == ZERO || x == ONE) { return y; } else if (x == MINUS_ONE) { return StarlarkInt.uminus(y); } else if (y == MINUS_ONE) { return StarlarkInt.uminus(x); } BigInteger xbig = x.toBigInteger(); BigInteger ybig = y.toBigInteger(); BigInteger zbig = xbig.multiply(ybig); StarlarkInt z = StarlarkInt.of(zbig); if (!(z instanceof Big)) { throw new AssertionError(String.format( "bug in multiplication: %s * %s = %s, must be long multiplication", x, y, z)); } return z; }
Source:
private Predicate<MethodInfo> filterMethods() { return Stream.of( this.filter, filterSyntheticMethods(), isGeneratedEnumMethod().negate(), isGroovyClass().negate() ).reduce(x -> true, Predicate::and); }

Target:
private Predicate<MethodInfo> filterMethods() { return this.filter .and(filterSyntheticMethods()) .and(isGeneratedEnumMethod().negate()) .and(isGroovyClass().negate()); }
Source:
private Element getBoostrapProps () { Element retVal = null; Plugin plugin = getPlugin("io.openliberty.tools", "liberty-maven-plugin"); Xpp3Dom config = getPluginConfig(plugin, ""); Xpp3Dom bootstrapPropsConfig = config.getChildren("bootstrapProperties")[0]; if (bootstrapPropsConfig != null) { List<Element> elements = new ArrayList<Element>(); for (Xpp3Dom child : bootstrapPropsConfig.getChildren()) { elements.add(new Element(child.getName(), child.getValue())); } retVal = new Element("bootstrapProperties", elements.toArray(new Element[elements.size()])); } return retVal; }

Target:
private Element getBoostrapProps () { Element retVal = null; Plugin plugin = getPlugin("io.openliberty.tools", "liberty-maven-plugin"); Xpp3Dom config = getPluginConfig(plugin, ""); if (config.getChild("bootstrapProperties") != null) { Xpp3Dom bootstrapPropsConfig = config.getChildren("bootstrapProperties")[0]; if (bootstrapPropsConfig != null) { List<Element> elements = new ArrayList<Element>(); for (Xpp3Dom child : bootstrapPropsConfig.getChildren()) { elements.add(new Element(child.getName(), child.getValue())); } retVal = new Element("bootstrapProperties", elements.toArray(new Element[elements.size()])); } } return retVal; }
Source:
protected TmfXYChartViewer createChartViewer(Composite parent) { return new CounterChartViewer(parent, new TmfXYChartSettings(null, null, null, 1), fXYPresentationProvider); }

Target:
protected TmfXYChartViewer createChartViewer(Composite parent) { return new CounterChartViewer(parent, new TmfXYChartSettings(null, null, null, 1)); }
Source:
public boolean canBeMemberWithReason(PerunSession sess, Vo vo, User user, String loa) throws InternalErrorException, VoNotExistsException, ExtendMembershipException, PrivilegeException { Utils.checkPerunSession(sess); getPerunBl().getVosManagerBl().checkVoExists(sess, vo); if (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, vo) && !AuthzResolver.isAuthorized(sess, Role.SELF, user) && !AuthzResolver.isAuthorized(sess, Role.PERUNOBSERVER)) { throw new PrivilegeException(sess, "canBeMemberWithReason"); } return getMembersManagerBl().canBeMemberWithReason(sess, vo, user, loa); }

Target:
public boolean canBeMemberWithReason(PerunSession sess, Vo vo, User user, String loa) throws InternalErrorException, VoNotExistsException, ExtendMembershipException, PrivilegeException { Utils.checkPerunSession(sess); getPerunBl().getVosManagerBl().checkVoExists(sess, vo); if (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, vo) && !AuthzResolver.isAuthorized(sess, Role.VOOBSERVER, vo) && !AuthzResolver.isAuthorized(sess, Role.SELF, user) && !AuthzResolver.isAuthorized(sess, Role.PERUNOBSERVER)) { throw new PrivilegeException(sess, "canBeMemberWithReason"); } return getMembersManagerBl().canBeMemberWithReason(sess, vo, user, loa); }