auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testClusterSnapshotWithCacheNodeFilter() throws Exception { int grids = 4; CacheConfiguration<Integer, Integer> ccfg = txCacheConfig(new CacheConfiguration<Integer, Integer>(DEFAULT_CACHE_NAME)) .setNodeFilter(node -> node.consistentId().toString().endsWith("1")); for (int i = 0; i < grids; i++) startGrid(optimize(getConfiguration(getTestIgniteInstanceName(i)).setCacheConfiguration())); IgniteEx ig0 = grid(0); ig0.cluster().baselineAutoAdjustEnabled(false); ig0.cluster().state(ACTIVE); for (int i = 0; i < CACHE_KEYS_RANGE; i++) ig0.getOrCreateCache(ccfg).put(i, i); forceCheckpoint(); ig0.snapshot().createSnapshot(SNAPSHOT_NAME).get(); stopAllGrids(); IgniteEx snp = startGridsFromSnapshot(grids, SNAPSHOT_NAME); assertSnapshotCacheKeys(snp.cache(ccfg.getName())); }

Target:
public void testClusterSnapshotWithCacheNodeFilter() throws Exception { int grids = 4; CacheConfiguration<Integer, Integer> ccfg = txCacheConfig(new CacheConfiguration<Integer, Integer>(DEFAULT_CACHE_NAME)) .setNodeFilter(node -> node.consistentId().toString().endsWith("1")); IgniteEx ig0 = startGridsWithoutCache(grids); for (int i = 0; i < CACHE_KEYS_RANGE; i++) ig0.getOrCreateCache(ccfg).put(i, i); ig0.snapshot().createSnapshot(SNAPSHOT_NAME).get(); stopAllGrids(); IgniteEx snp = startGridsFromSnapshot(grids, cfg -> resolveSnapshotWorkDirectory(cfg.setCacheConfiguration()).getAbsolutePath(), SNAPSHOT_NAME, true); awaitPartitionMapExchange(); checkCacheDiscoveryDataConsistent(); CacheGroupDescriptor descr = snp.context().cache().cacheGroupDescriptors() .get(CU.cacheId(ccfg.getName())); assertNotNull(descr); assertNotNull(descr.config().getNodeFilter()); assertEquals(ccfg.getNodeFilter().apply(grid(1).localNode()), descr.config().getNodeFilter().apply(grid(1).localNode())); assertSnapshotCacheKeys(snp.cache(ccfg.getName())); }
Source:
public void maintainNotFoundCache( ResourceStoreRequest request ) throws ItemNotFoundException { if ( isNotFoundCacheActive() ) { if ( getNotFoundCache().contains( request.getRequestPath() ) ) { if ( getNotFoundCache().isExpired( request.getRequestPath() ) ) { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "The path " + request.getRequestPath() + " is in NFC but expired." ); } removeFromNotFoundCache( request ); } else { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "The path " + request.getRequestPath() + " is in NFC and still active, throwing ItemNotFoundException." ); } throw new ItemNotFoundException( reasonFor( request, this, "The path %s is in NFC of repository %s.", request.getRequestPath(), this ) ); } } } }

Target:
public void maintainNotFoundCache( ResourceStoreRequest request ) throws ItemNotFoundException { if ( isNotFoundCacheActive() ) { if ( getNotFoundCache().contains( request.getRequestPath() ) ) { if ( getNotFoundCache().isExpired( request.getRequestPath() ) ) { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "The path " + request.getRequestPath() + " is in NFC but expired." ); } removeFromNotFoundCache( request ); } else { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "The path " + request.getRequestPath() + " is in NFC and still active, throwing ItemNotFoundException." ); } throw new ItemNotFoundException( reasonFor( request, this, "The path %s is still cached as not found for repository %s", request.getRequestPath(), this ) ); } } } }
Source:
public void run() { boolean live = (liveLock != null); boolean lostLock; boolean keepMonitoring = true; while (keepMonitoring) { lostLock = true; try { lostLock = (liveLock != null && !liveLock.isValid()) || liveLock == null; if (!lostLock) { logger.debug("Server still has the lock, double check status is live"); byte state = getState(); if (state == LIVE) { logger.debug("Status is set to live"); } else { logger.debug("Status is not live"); } } } catch (Exception exception) { logger.error(exception.getMessage(), exception); lostLock = true; } if (lostLock) { logger.warn("Lost the lock according to the monitor, notifying listeners"); notifyLostLock(); } try { Thread.sleep(LOCK_MONITOR_TIMEOUT_MILLIES); } catch (InterruptedException e) { } live = liveLock != null; keepMonitoring = live && !lostLock; if (!keepMonitoring) { logger.info("Bailing out the locking monitoring"); } } }

Target:
public void run() { boolean lostLock = true; try { if (liveLock == null) { logger.debug("Livelock is null"); } lostLock = (liveLock != null && !liveLock.isValid()) || liveLock == null; if (!lostLock) { logger.debug("Server still has the lock, double check status is live"); byte state = getState(); if (state == LIVE) { logger.debug("Status is set to live"); } else { logger.debug("Status is not live"); } } } catch (Exception exception) { logger.error(exception.getMessage(), exception); lostLock = true; } if (lostLock) { logger.warn("Lost the lock according to the monitor, notifying listeners"); notifyLostLock(); } }
Source:
private Object borrow(GenericObjectPool pool) { try { return pool.borrowObject(); } catch (Exception e) { throw new ParquetCompressionCodecException(e); } }

Target:
public <T> T borrow(GenericObjectPool pool) { try { return (T) pool.borrowObject(); } catch (Exception e) { throw new ParquetCompressionCodecException(e); } }
Source:
public Disk mapRow(ResultSet rs, int rowNum) throws SQLException { Disk disk = DiskRowMapper.instance.mapRow(rs, rowNum); disk.setPlugged(rs.getBoolean("is_plugged")); disk.setReadOnly(rs.getBoolean("is_readonly")); disk.setLogicalName(rs.getString("logical_name")); if (disk.getDiskStorageType() == DiskStorageType.LUN) { ((LunDisk) disk).setUsingScsiReservation(rs.getBoolean("is_scsi_reservation_used")); } return disk; }

Target:
public Disk mapRow(ResultSet rs, int rowNum) throws SQLException { Disk disk = DiskRowMapper.instance.mapRow(rs, rowNum); disk.setPlugged(rs.getBoolean("is_plugged")); disk.setReadOnly(rs.getBoolean("is_readonly")); disk.setLogicalName(rs.getString("logical_name")); if (disk.getDiskStorageType() == DiskStorageType.LUN) { ((LunDisk) disk).setUsingScsiReservation(rs.getBoolean("is_using_scsi_reservation")); } return disk; }
Source:
private Map<String,Set<String>> getAgentNamesForMonitoringParameters(Set<PlotNode> plotNodeList) { Map<String,Set<String>> agentNames = new HashMap<String, Set<String>>(); for (PlotNode plotNode : plotNodeList) { for (MetricNameDto metricNameDto : plotNode.getMetricNameDtoList()) { if ((metricNameDto.getOrigin() == MetricNameDto.Origin.MONITORING) || (metricNameDto.getOrigin() == MetricNameDto.Origin.TEST_GROUP_METRIC) || (metricNameDto.getOrigin()== MetricNameDto.Origin.SESSION_SCOPE_TG)) { MonitoringIdUtils.MonitoringId monitoringId = MonitoringIdUtils.splitMonitoringMetricId(metricNameDto.getMetricName()); if (monitoringId != null) { for (String key : defaultMonitoringParams.keySet()) { if (defaultMonitoringParams.get(key).contains(monitoringId.getMonitoringName())) { if (!agentNames.containsKey(key)) { agentNames.put(key,new HashSet<String>()); } agentNames.get(key).add(monitoringId.getAgentName()); } } } } } } return agentNames; }

Target:
private Map<String,Set<String>> getAgentNamesForMonitoringParameters(Set<PlotNode> plotNodeList) { Map<String,Set<String>> agentNames = new HashMap<String, Set<String>>(); for (PlotNode plotNode : plotNodeList) { for (MetricNameDto metricNameDto : plotNode.getMetricNameDtoList()) { if ((metricNameDto.getOrigin() == MetricNameDto.Origin.MONITORING) || (metricNameDto.getOrigin() == MetricNameDto.Origin.TEST_GROUP_METRIC)) { MonitoringIdUtils.MonitoringId monitoringId = MonitoringIdUtils.splitMonitoringMetricId(metricNameDto.getMetricName()); if (monitoringId != null) { for (String key : defaultMonitoringParams.keySet()) { if (defaultMonitoringParams.get(key).contains(monitoringId.getMonitoringName())) { if (!agentNames.containsKey(key)) { agentNames.put(key,new HashSet<String>()); } agentNames.get(key).add(monitoringId.getAgentName()); } } } } } } return agentNames; }
Source:
public void buildTranslationCaches() { myTranslationCache = Caffeine.newBuilder() .maximumSize(10000) .expireAfterWrite(1, TimeUnit.HOURS) .build(); myTranslationWithReverseCache = Caffeine.newBuilder() .maximumSize(10000) .expireAfterWrite(1, TimeUnit.HOURS) .build(); }

Target:
public void buildTranslationCaches() { Long timeout = myDaoConfig.getTranslationCachesExpireAfterWriteInMinutes(); myTranslationCache = Caffeine.newBuilder() .maximumSize(10000) .expireAfterWrite(timeout, TimeUnit.MINUTES) .build(); myTranslationWithReverseCache = Caffeine.newBuilder() .maximumSize(10000) .expireAfterWrite(timeout, TimeUnit.MINUTES) .build(); }
Source:
private void displayJSONMessages(){ String result = ""; ServiceId serviceId = call.getService(); MethodId mid = call.getMethod(); if(serviceId == null){ String serviceNotSet = new StringResourceModel("json.view.ServiceNotSet", this, null).getString(); info(serviceNotSet); return; } if(mid == null){ String methodNotSet = new StringResourceModel("json.view.MethodNotSet", this, null).getString(); info(methodNotSet); return; } org.openengsb.core.api.remote.MethodCall mc = new org.openengsb.core.api.remote.MethodCall(mid.getName(),call.getArgumentsAsArray()); Map<String,String> metaData = new HashMap<String,String>(); if(serviceId.getServiceId() == null){ metaData.put("serviceId", serviceId.getDomainName()); }else{ metaData.put("serviceId", serviceId.getServiceId()); } metaData.put("contextId", this.getSessionContextId()); mc.setMetaData(metaData); MethodCallRequest mcr = new MethodCallRequest(mc,"randomCallId"); BeanDescription auth = BeanDescription.fromObject(new Password("yourpassword")); SecureRequest secureRequest = SecureRequest.create(mcr, "yourusername", auth); try { result = JsonUtils.createObjectMapperWithIntroSpectors().writeValueAsString(secureRequest); } catch (IOException ex) { handleExceptionWithFeedback(ex); } String jsonPrefix = new StringResourceModel("json.view.MessagePrefix", this, null).getString(); String typeToReplace = ",\"type\":"; while(result.contains(typeToReplace)){ int posAfterType = result.indexOf(typeToReplace)+typeToReplace.length(); String firstPart = result.substring(0,result.indexOf(typeToReplace)); String lastPart = result.substring(posAfterType,result.length()); int endOfArgs = lastPart.indexOf("}]"); int firstSemicolon = lastPart.indexOf(","); if(firstSemicolon < endOfArgs){ lastPart = lastPart.substring(lastPart.indexOf(","), lastPart.length()); } result = firstPart + lastPart; } result = result.replaceAll(",\"processId\":null,\"origin\":null", ""); info(jsonPrefix+" "+result); }

Target:
private void displayJSONMessages(){ ServiceId serviceId = fetchCurrentSelectService(); MethodId methodId = fetchCurrentSelectMethod(); if(serviceId == null){ String serviceNotSet = new StringResourceModel("json.view.ServiceNotSet", this, null).getString(); info(serviceNotSet); return; } if(methodId == null){ String methodNotSet = new StringResourceModel("json.view.MethodNotSet", this, null).getString(); info(methodNotSet); return; } String jsonResult = parseRequestToJsonString(createSecureRequest(serviceId, methodId)); String jsonPrefix = new StringResourceModel("json.view.MessagePrefix", this, null).getString(); jsonResult = filterUnnessecaryArgumentsFromJsonMessage(jsonResult); info(String.format("%s %s", jsonPrefix, jsonResult)); }
Source:
private String mountNfs(Connection conn, String remoteDir, String localDir) { if (localDir == null) { localDir = "/var/cloud_mount/" + UUID.nameUUIDFromBytes(remoteDir.getBytes()); } return callHostPlugin(conn, "cloud-plugin-storage", "mountNfsSecondaryStorage", "localDir", localDir, "remoteDir", remoteDir); }

Target:
private String mountNfs(Connection conn, String remoteDir, String localDir) { if (localDir == null) { localDir = BASE_MOUNT_POINT_ON_REMOTE + UUID.nameUUIDFromBytes(remoteDir.getBytes()); } return callHostPlugin(conn, "cloud-plugin-storage", "mountNfsSecondaryStorage", "localDir", localDir, "remoteDir", remoteDir); }
Source:
public String getMessage() { return String.format("No items to createDefault feed %s", spec); }

Target:
public String getMessage() { return String.format("No items to create feed %s", spec); }
Source:
private void setVdsmId(String eventName, String eventUrl) { if (!eventName.equals(AnsibleConstants.TASK_VDSM_ID)) { return; } String vdsmid = runnerClient.getVdsmId(eventUrl); log.info( "Host reports unique id {}", getVds().getHostName(), vdsmid ); final List<String> hosts = vdsDao.getAllWithUniqueId(vdsmid) .stream() .filter(vds -> !vds.getId().equals(getVds().getId())) .map(VDS::getName) .collect(Collectors.toList()); if (!hosts.isEmpty()) { log.error( "Host reports duplicate unique id of following hosts {}", getVds().getHostName(), vdsmid, hosts ); throw new SoftError( String.format( "Host %1$s reports unique id which already registered for %2$s", getVds().getHostName(), hosts ) ); } log.info("Assigning unique id to Host {}", vdsmid, getVds().getHostName()); getVds().setUniqueId(vdsmid); TransactionSupport.executeInNewTransaction(() -> { vdsStaticDao.update(getVds().getStaticData()); return null; }); }

Target:
private void setVdsmId(String eventName, String eventUrl) { if (!eventName.equals(AnsibleConstants.TASK_VDSM_ID)) { return; } String vdsmid = runnerClient.getVdsmId(eventUrl); log.info( "Host reports unique id {}", getVds().getHostName(), vdsmid ); final String hosts = vdsDao.getAllWithUniqueId(vdsmid) .stream() .filter(vds -> !vds.getId().equals(getVds().getId())) .map(VDS::getName) .collect(Collectors.joining(",")); if (!hosts.isEmpty()) { log.error( "Host reports duplicate unique id of following hosts {}", getVds().getHostName(), vdsmid, hosts ); throw new SoftError( String.format( "Host %1$s reports unique id which already registered for %2$s", getVds().getHostName(), hosts ) ); } log.info("Assigning unique id to Host {}", vdsmid, getVds().getHostName()); getVds().setUniqueId(vdsmid); TransactionSupport.executeInNewTransaction(() -> { vdsStaticDao.update(getVds().getStaticData()); return null; }); }
Source:
public byte[] toByteArray() { return ByteBuffer.allocate(8).putLong(valueLong).array(); }

Target:
public byte[] toByteArray() { return null; }
Source:
public static String[] splitName(String fullName){ fullName = fullName.trim().replaceAll("\\s+", " "); String lastName = fullName.substring(fullName.lastIndexOf(" ")+1).trim(); String firstName = fullName.replace(lastName, "").trim(); String[] splited ={firstName, lastName}; return splited; }

Target:
public static String[] splitName(String fullName){ if(fullName == null){ return null; } String lastName = fullName.substring(fullName.lastIndexOf(" ")+1).trim(); String firstName = fullName.replace(lastName, "").trim(); String[] splitNames = {firstName, lastName}; return splitNames; }
Source:
private void updateInfo() { if(selectedMsg != null) { statusView.setVisibility(View.VISIBLE); final LatLong msgCoord = coordFromMsgGlobalPositionInt(selectedMsg); if(lastGCSPosition == null || lastGCSPosition.getLatitude() == 0 || lastGCSPosition .getLongitude() == 0) { distanceView.setText(R.string.status_waiting_for_gps, TextView.BufferType.NORMAL); azimuthView.setText(""); } else { String distance = getString(R.string.editor_info_window_distance) + String.format(" %.01fm", MathUtils.getDistance(lastGCSPosition, msgCoord)); if(lastGCSBearingTo != Float.MAX_VALUE) { final String bearing = String.format(" @ %.0f°", lastGCSBearingTo); distance += bearing; } distanceView.setText(distance); if(lastGCSAzimuth != Double.MAX_VALUE) { final String azimuth = String.format("Heading: %.0f°", lastGCSAzimuth); azimuthView.setText(azimuth); } } latView.setText(getString(R.string.waypoint_latitude) + String.format(" %f°", msgCoord.getLatitude())); lonView.setText(getString(R.string.waypoint_longitude) + String.format(" %f°", msgCoord.getLongitude())); } else { statusView.setVisibility(View.INVISIBLE); latView.setText(""); lonView.setText(""); distanceView.setText(""); azimuthView.setText(""); } }

Target:
private void updateInfo() { if(selectedMsg != null) { statusView.setVisibility(View.VISIBLE); final LatLong msgCoord = coordFromMsgGlobalPositionInt(selectedMsg); if(lastGCSPosition == null || lastGCSPosition.getLatitude() == 0 || lastGCSPosition .getLongitude() == 0) { distanceView.setText(R.string.status_waiting_for_gps, TextView.BufferType.NORMAL); azimuthView.setText(""); } else { String distance = getString(R.string.editor_info_window_distance, MathUtils.getDistance(lastGCSPosition, msgCoord)); if(lastGCSBearingTo != Float.MAX_VALUE) { final String bearing = String.format(" @ %.0f°", lastGCSBearingTo); distance += bearing; } distanceView.setText(distance); if(lastGCSAzimuth != Double.MAX_VALUE) { final String azimuth = getString(R.string.editor_info_window_heading, lastGCSAzimuth); azimuthView.setText(azimuth); } } latView.setText(getString(R.string.waypoint_latitude, msgCoord.getLatitude())); lonView.setText(getString(R.string.waypoint_longitude, msgCoord.getLongitude())); } else { statusView.setVisibility(View.INVISIBLE); latView.setText(""); lonView.setText(""); distanceView.setText(""); azimuthView.setText(""); } }
Source:
public Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> getInsertRuntime(IDataSource<String> dataSource, IOperatorSchema propagatedSchema, IVariableTypeEnvironment typeEnv, List<LogicalVariable> keys, LogicalVariable payLoadVar, List<LogicalVariable> additionalFilterKeyFields, List<LogicalVariable> additionalNonFilteringFields, RecordDescriptor recordDesc, JobGenContext context, JobSpecification jobSpec, boolean bulkload) throws AlgebricksException { return null; }

Target:
public Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> getInsertRuntime(IDataSource<String> dataSource, IOperatorSchema propagatedSchema, IVariableTypeEnvironment typeEnv, List<LogicalVariable> keys, LogicalVariable payLoadVar, List<LogicalVariable> additionalFilterKeyFields, List<LogicalVariable> additionalNonFilteringFields, RecordDescriptor recordDesc, JobGenContext context, JobSpecification jobSpec, boolean bulkload) throws AlgebricksException { throw new UnsupportedOperationException(); }
Source:
public void run() { Repository repo = historyPage.getCurrentRepo(); if (repo != null) { String repoSepcificKey = getRepositorySpecificFirstParentPreferenceKey( repo); String newValue = isChecked() ? IPreferenceStore.TRUE : IPreferenceStore.FALSE; historyPage.store.putValue(repoSepcificKey, newValue); if (historyPage.store.needsSaving()) try { historyPage.store.save(); } catch (IOException e) { Activator.handleError(e.getMessage(), e, false); } } historyPage.refresh(); }

Target:
public void run() { final String prefKey = UIPreferences.RESOURCEHISTORY_SHOW_FIRST_PARENT_ONLY_DEFAULT; Repository repo = historyPage.getCurrentRepo(); if (repo != null) { String repoSepcificKey = getRepoSpecificKey(repo, prefKey); boolean newBoolean = isChecked(); if (newBoolean == historyPage.store.getBoolean(prefKey)) { historyPage.store.setToDefault(repoSepcificKey); } else { String newValue = newBoolean ? IPreferenceStore.TRUE : IPreferenceStore.FALSE; historyPage.store.putValue(repoSepcificKey, newValue); } historyPage.saveStoreIfNeeded(); } historyPage.refresh(); }
Source:
private static String getUserAgent() { final String defaultVersion = "dev-" + System.currentTimeMillis(); try (InputStream stream = BigtableConstants.class.getResourceAsStream("bigtable-hbase.properties")) { if (stream == null) { LOG.error("Could not load properties file bigtable-hbase.properties"); return defaultVersion; } Properties properties = new Properties(); properties.load(stream); String value = properties.getProperty("bigtable.hbase.user_agent"); if (value == null) { LOG.error("bigtable.hbase.user_agent not found in bigtable-hbase.properties."); } else if (value.startsWith("$")){ LOG.info("project.version token is not replaced."); } else { return value; } } catch (IOException e) { LOG.error( String.format("Error while trying to get project.version from bigtable-hbase.properties"), e); } return defaultVersion; }

Target:
private static String getUserAgent() { final String defaultUserAgent = "bigtable-hbase/dev-" + System.currentTimeMillis(); try (InputStream stream = BigtableConstants.class.getResourceAsStream("bigtable-hbase.properties")) { if (stream == null) { LOG.error("Could not load properties file bigtable-hbase.properties"); return defaultUserAgent; } Properties properties = new Properties(); properties.load(stream); String value = properties.getProperty("bigtable.hbase.user_agent"); if (value == null) { LOG.error("bigtable.hbase.user_agent not found in bigtable-hbase.properties."); } else if (value.startsWith("$")){ LOG.info("bigtable.hbase.user_agent property is not replaced."); } else { return value; } } catch (IOException e) { LOG.error( String.format("Error while trying to get user agent name from bigtable-hbase.properties"), e); } return defaultUserAgent; }
Source:
private String getContentType(String name) { name = name.toLowerCase(); if (name.endsWith(".class")) { return ClassfileComparator.TYPE; } if (name.endsWith(".jar") || name.endsWith(".zip")) { return NestedZipComparator.TYPE; } if (name.endsWith(".properties") || name.endsWith(".mappings")) { return PropertiesComparator.TYPE; } if ("meta-inf/manifest.mf".equals(name)) { return ManifestComparator.TYPE; } return DefaultContentsComparator.TYPE; }

Target:
private String getContentType(String name) { name = name.toLowerCase(Locale.ENGLISH); if (name.endsWith(".class")) { return ClassfileComparator.TYPE; } if (name.endsWith(".jar") || name.endsWith(".zip")) { return NestedZipComparator.TYPE; } if (name.endsWith(".properties") || name.endsWith(".mappings")) { return PropertiesComparator.TYPE; } if ("meta-inf/manifest.mf".equals(name)) { return ManifestComparator.TYPE; } return DefaultContentsComparator.TYPE; }
Source:
public Object[] getElements(Object inputElement) { List<RepositoryTreeNode> nodes = new ArrayList<RepositoryTreeNode>(); List<String> directories = new ArrayList<String>(); RepositoryUtil repositoryUtil = Activator.getDefault().getRepositoryUtil(); if (inputElement instanceof Collection) { for (Iterator it = ((Collection) inputElement).iterator(); it .hasNext();) { Object next = it.next(); if (next instanceof RepositoryTreeNode) nodes.add((RepositoryTreeNode) next); else if (next instanceof String) directories.add((String) next); } } else if (inputElement instanceof IWorkspaceRoot) { directories.addAll(repositoryUtil.getConfiguredRepositories()); } for (String directory : directories) { try { File gitDir = new File(directory); if (gitDir.exists()) { RepositoryNode rNode = new RepositoryNode(null, repositoryCache .lookupRepository(gitDir)); nodes.add(rNode); } else { repositoryUtil.removeDir(gitDir); } } catch (IOException e) { } } Collections.sort(nodes); return nodes.toArray(); }

Target:
public Object[] getElements(Object inputElement) { List<RepositoryTreeNode> nodes = new ArrayList<RepositoryTreeNode>(); List<String> directories = new ArrayList<String>(); RepositoryUtil repositoryUtil = Activator.getDefault().getRepositoryUtil(); if (inputElement instanceof Collection) { for (Iterator it = ((Collection) inputElement).iterator(); it .hasNext();) { Object next = it.next(); if (next instanceof RepositoryTreeNode) nodes.add((RepositoryTreeNode) next); else if (next instanceof String) directories.add((String) next); } } else if (inputElement instanceof IWorkspaceRoot) { directories.addAll(repositoryUtil.getConfiguredRepositories()); } for (String directory : directories) { try { File gitDir = new File(directory); if (gitDir.exists()) { RepositoryNode rNode = new RepositoryNode(null, repositoryCache .lookupRepository(gitDir)); nodes.add(rNode); } else repositoryUtil.removeDir(gitDir); } catch (IOException e) { } } Collections.sort(nodes); return nodes.toArray(); }
Source:
public <U> OptimizeStatement<U> map(Function<? super T, ? extends U> mapper) { return new OptimizeStatement( tables.stream().map(t -> t.map(mapper)).collect(toList()), properties.map(mapper) ); }

Target:
public <U> OptimizeStatement<U> map(Function<? super T, ? extends U> mapper) { return new OptimizeStatement( Lists2.map(tables, x -> x.map(mapper)), properties.map(mapper) ); }
Source:
public T messageType(String messageType) { this.messageType = messageType; getAction().setMessageType(messageType); if (MessageType.BINARY.name().equals(messageType)) { getMessageContentBuilder().add(binaryMessageConstructionInterceptor); } if (MessageType.GZIP.name().equals(messageType)) { getMessageContentBuilder().add(gzipMessageConstructionInterceptor); } return self; }

Target:
public T messageType(String messageType) { this.messageType = messageType; getAction().setMessageType(messageType); if (binaryMessageConstructionInterceptor.supportsMessageType(messageType)) { getMessageContentBuilder().add(binaryMessageConstructionInterceptor); } if (gzipMessageConstructionInterceptor.supportsMessageType(messageType)) { getMessageContentBuilder().add(gzipMessageConstructionInterceptor); } return self; }
Source:
public static void initializeDefaultPreferences(IEclipsePreferences defaultPreferences) { Preferences prefs= defaultPreferences.node(INDEXER_NODE); prefs.put(KEY_INDEXER_ID, IPDOMManager.ID_FAST_INDEXER); prefs.putBoolean(KEY_INDEX_ALL_FILES, true); prefs.putBoolean(KEY_INDEX_UNUSED_HEADERS_WITH_DEFAULT_LANG, true); prefs.putBoolean(KEY_INDEX_UNUSED_HEADERS_WITH_ALTERNATE_LANG, false); prefs.putBoolean(KEY_INDEX_ON_OPEN, false); prefs.putBoolean(KEY_INCLUDE_HEURISTICS, true); prefs.putInt(KEY_SKIP_FILES_LARGER_THAN_MB, DEFAULT_FILE_SIZE_LIMIT); prefs.putBoolean(KEY_SKIP_ALL_REFERENCES, false); prefs.putBoolean(KEY_SKIP_IMPLICIT_REFERENCES, false); prefs.putBoolean(KEY_SKIP_TYPE_REFERENCES, false); prefs.putBoolean(KEY_SKIP_MACRO_REFERENCES, false); prefs.put(KEY_INDEX_IMPORT_LOCATION, DEFAULT_INDEX_IMPORT_LOCATION); prefs.putBoolean(KEY_INDEX_ALL_HEADER_VERSIONS, false); prefs.put(KEY_INDEX_ALL_VERSIONS_SPECIFIC_HEADERS, DEFAULT_INDEX_ALL_VERSIONS_SPECIFIC_HEADERS); }

Target:
public static void initializeDefaultPreferences(IEclipsePreferences defaultPreferences) { Preferences prefs= defaultPreferences.node(INDEXER_NODE); prefs.put(KEY_INDEXER_ID, IPDOMManager.ID_FAST_INDEXER); prefs.putBoolean(KEY_INDEX_ALL_FILES, true); prefs.putBoolean(KEY_INDEX_UNUSED_HEADERS_WITH_DEFAULT_LANG, true); prefs.putBoolean(KEY_INDEX_UNUSED_HEADERS_WITH_ALTERNATE_LANG, false); prefs.putBoolean(KEY_INDEX_ON_OPEN, false); prefs.putBoolean(KEY_INCLUDE_HEURISTICS, true); prefs.putInt(KEY_SKIP_FILES_LARGER_THAN_MB, DEFAULT_FILE_SIZE_LIMIT); prefs.putBoolean(KEY_SKIP_ALL_REFERENCES, false); prefs.putBoolean(KEY_SKIP_IMPLICIT_REFERENCES, false); prefs.putBoolean(KEY_SKIP_TYPE_REFERENCES, false); prefs.putBoolean(KEY_SKIP_MACRO_REFERENCES, false); prefs.put(KEY_INDEX_IMPORT_LOCATION, DEFAULT_INDEX_IMPORT_LOCATION); prefs.putBoolean(KEY_INDEX_ALL_HEADER_VERSIONS, false); }
Source:
public TmfStatisticsTreeNode getTop() { if (fTopNode == null) { fTopNode = this; while (fTopNode.getParent() != null && fTopNode.getParent().getParent() != null) { fTopNode = fTopNode.getParent(); } } return fTopNode; }

Target:
public TmfStatisticsTreeNode getTop() { return fTopNode; }
Source:
public CPPStreamConnectionProvider() throws UnsupportedOperationException { List<String> commands = new ArrayList<>(); if (store.getString(PreferenceConstants.P_SERVER_CHOICE).equals("cquery")) { languageServer = new CqueryLanguageServer(); } else if (store.getString(PreferenceConstants.P_SERVER_CHOICE).equals("clangd")) { languageServer = new ClangdLanguageServer(); } else { throw new UnsupportedOperationException("Unsupported Language Server"); } File defaultLSLocation = getDefaultLSLocation(store.getString(PreferenceConstants.P_SERVER_CHOICE)); if(defaultLSLocation != null) { store.setDefault(PreferenceConstants.P_SERVER_PATH, defaultLSLocation.getAbsolutePath()); } File languageServerLocation = getLanguageServerLocation(); String parent = ""; String flags = store.getString(PreferenceConstants.P_SERVER_OPTIONS); if (languageServerLocation != null) { commands.add(languageServerLocation.getAbsolutePath()); if (!flags.isEmpty()) { commands.add(flags); } parent = languageServerLocation.getParent(); } setWorkingDirectory(parent); setCommands(commands); }

Target:
public CPPStreamConnectionProvider() throws UnsupportedOperationException { List<String> commands = new ArrayList<>(); if (store.getString(PreferenceConstants.P_SERVER_CHOICE).equals(CQUERY_ID)) { languageServer = new CqueryLanguageServer(); } else if (store.getString(PreferenceConstants.P_SERVER_CHOICE).equals(CLANGD_ID)) { languageServer = new ClangdLanguageServer(); } else { throw new UnsupportedOperationException("Unsupported Language Server"); } File defaultLSLocation = getDefaultLSLocation(store.getString(PreferenceConstants.P_SERVER_CHOICE)); if(defaultLSLocation != null) { store.setDefault(PreferenceConstants.P_SERVER_PATH, defaultLSLocation.getAbsolutePath()); } File languageServerLocation = getLanguageServerLocation(); String parent = ""; String flags = store.getString(PreferenceConstants.P_SERVER_OPTIONS); if (languageServerLocation != null) { commands.add(languageServerLocation.getAbsolutePath()); if (!flags.isEmpty()) { commands.add(flags); } parent = languageServerLocation.getParent(); } setWorkingDirectory(parent); setCommands(commands); }
Source:
static String saveGetLocation(WebDriver driver) { logger.entering(driver); String location = "n/a"; try { if (driver != null) { location = driver.getCurrentUrl(); } } catch (Exception exception) { logger.log(Level.FINEST, "Current location couldn't be retrieved by getCurrentUrl().", exception); } logger.exiting(location); return location; }

Target:
static String saveGetLocation(WebDriver driver) { logger.entering(driver); String location = "n/a"; try { if (driver != null) { location = driver.getCurrentUrl(); } } catch (Exception exception) { logger.log( Level.WARNING, "Current location couldn't be retrieved by getCurrentUrl(). This can be SAFELY IGNORED if testing a non-web mobile application. Reason: " + exception.getClass().getName() + ": " + exception.getMessage()); } logger.exiting(location); return location; }
Source:
private static void printJobs() { Job[] jobs = Job.getJobManager().find(null); for (Job job : jobs) { System.err.println(job.toString() + " state: " + jobStateToString(job.getState())); for (StackTraceElement stractTraceElement : job.getThread().getStackTrace()) { System.err.println(" " + stractTraceElement); } System.err.println(); } }

Target:
private static void printJobs() { Job[] jobs = Job.getJobManager().find(null); for (Job job : jobs) { System.err.println(job.toString() + " state: " + jobStateToString(job.getState())); Thread thread = job.getThread(); if (thread != null) { for (StackTraceElement stractTraceElement : thread.getStackTrace()) { System.err.println(" " + stractTraceElement); } } System.err.println(); } }
Source:
public void update() { if (!getWorldIn().isRemote && getParts().isEmpty()) { getWorldIn().setBlockToAir(getPosIn()); return; } for (IMultipart part : getParts()) { if (part instanceof ITickable) { ((ITickable) part).update(); } } }

Target:
public void update() { for (IMultipart part : container.getTickingParts()) { if (part instanceof ITickable) { ((ITickable) part).update(); } } }
Source:
protected <T extends Message, C extends MessageCodec<T>> C bind(Class<C> clazz) throws InstantiationException, IllegalAccessException, InvocationTargetException { boolean dynamicId = false; Constructor<C> constructor; try { constructor = clazz.getConstructor(); } catch (NoSuchMethodException e) { try { constructor = clazz.getConstructor(int.class); dynamicId = true; } catch (NoSuchMethodException e1) { throw (InstantiationException) new InstantiationException().initCause(e1); } } C codec; if (dynamicId) { int id; if (dynamicPacketMap.getKeys().contains(clazz.getName())) { id = dynamicPacketMap.register(clazz.getName()); } else { id = nextId.getAndIncrement(); } codec = constructor.newInstance(id); codec.setDynamic(true); } else { codec = constructor.newInstance(); codec.setOpcode(nextId.getAndIncrement()); } register(codec); dynamicPacketMap.register(clazz.getName(), codec.getOpcode()); return codec; }

Target:
protected <T extends Message, C extends MessageCodec<T>> C bind(Class<C> clazz) throws InstantiationException, IllegalAccessException, InvocationTargetException { boolean dynamicId = false; Constructor<C> constructor; try { constructor = clazz.getConstructor(); } catch (NoSuchMethodException e) { try { constructor = clazz.getConstructor(int.class); dynamicId = true; } catch (NoSuchMethodException e1) { throw (InstantiationException) new InstantiationException().initCause(e1); } } if (dynamicPacketMap.getKeys().contains(clazz.getName())) { return (C) find(dynamicPacketMap.register(clazz.getName())); } final C codec; if (dynamicId) { int id; do { id = nextId.getAndIncrement(); } while (find(id) != null); codec = constructor.newInstance(id); codec.setDynamic(true); } else { codec = constructor.newInstance(); final MessageCodec<?> prevCodec = find(codec.getOpcode()); if (prevCodec != null) { throw new IllegalStateException("Trying to bind a static opcode where one already exists. Static: " + clazz.getSimpleName() + " Other: " + prevCodec.getClass().getSimpleName()); } } register(codec); dynamicPacketMap.register(clazz.getName(), codec.getOpcode()); return codec; }
Source:
public Response addMetadataStoreRealm(@PathParam("realm") String realm) { try { LOG.error("updating {}", _namespace, realm); _metadataStoreDirectory.addMetadataStoreRealm(_namespace, realm); } catch (IllegalArgumentException ex) { return notFound(ex.getMessage()); } return OK(); }

Target:
public Response addMetadataStoreRealm(@PathParam("realm") String realm) { try { _metadataStoreDirectory.addMetadataStoreRealm(_namespace, realm); } catch (IllegalArgumentException ex) { return notFound(ex.getMessage()); } return created(); }
Source:
@Override public void unparseCall(SqlWriter writer, SqlCall call, int leftPrec, int rightPrec) { switch (call.getKind()) { case FLOOR: if (call.operandCount() != 2) { super.unparseCall(writer, call, leftPrec, rightPrec); return; } unparseFloor(writer, call); break; default: if (call.getOperator() == SqlStdOperatorTable.CONCAT) { unparseConcat(writer, call); break; } super.unparseCall(writer, call, leftPrec, rightPrec); } }

Target:
@Override public void unparseCall(SqlWriter writer, SqlCall call, int leftPrec, int rightPrec) { switch (call.getKind()) { case FLOOR: if (call.operandCount() != 2) { super.unparseCall(writer, call, leftPrec, rightPrec); return; } unparseFloor(writer, call); break; default: super.unparseCall(writer, call, leftPrec, rightPrec); } }
Source:
private static File moveToFinalLocation(File tmpFile) throws Exception { String pluginName; try (JarFile jf = new JarFile(tmpFile)) { pluginName = jf.getManifest().getMainAttributes().getValue("Short-Name"); } if (pluginName == null) { throw new IllegalArgumentException("JAR does not look like a plugin"); } File target = new File(Jenkins.get().getPluginManager().rootDir, pluginName + ".jpi"); Files.move(tmpFile.toPath(), target.toPath(), StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.ATOMIC_MOVE); return target; }

Target:
private static File moveToFinalLocation(File tmpFile) throws Exception { String pluginName; try (JarFile jf = new JarFile(tmpFile)) { Manifest mf = jf.getManifest(); if (mf == null) { throw new IllegalArgumentException("JAR lacks a manifest"); } pluginName = mf.getMainAttributes().getValue("Short-Name"); } if (pluginName == null) { throw new IllegalArgumentException("JAR manifest lacks a Short-Name attribute and so does not look like a plugin"); } File target = new File(Jenkins.get().getPluginManager().rootDir, pluginName + ".jpi"); Files.move(tmpFile.toPath(), target.toPath(), StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.ATOMIC_MOVE); return target; }
Source:
private boolean isEnabled(HazelcastInstance client) { HazelcastClientInstanceImpl clientInstanceImpl = getHazelcastClientInstanceImpl(client); ClientListenerService listenerService = clientInstanceImpl.getListenerService(); Collection<EventHandler> values = ((SmartClientListenerService) listenerService).getEventHandlers().values(); boolean found = false; for (EventHandler value : values) { if (value instanceof SmartClientInvocationService.BackupEventHandler) { found = true; } } return found; }

Target:
private boolean isEnabled(HazelcastInstance client) { HazelcastClientInstanceImpl clientInstanceImpl = getHazelcastClientInstanceImpl(client); ClientListenerService listenerService = clientInstanceImpl.getListenerService(); Collection<EventHandler> values = ((SmartClientListenerService) listenerService).getEventHandlers().values(); for (EventHandler value : values) { if (value instanceof SmartClientInvocationService.BackupEventHandler) { return true; } } return false; }
Source:
private String i18n(String key) { String result = GanttLanguage.getInstance().getText(key); if (result== null){ result = key; } return result; }

Target:
private String i18n(String key) { return InternationalizationKt.getRootLocalizer().formatText(key); }
Source:
public TumorType(TumorType otherTumorType) { this.id = otherTumorType.id; this.code = otherTumorType.code; this.color = otherTumorType.color; this.name = otherTumorType.name; if (otherTumorType.mainType != null) { this.mainType = new MainType(otherTumorType.mainType); } this.NCI = new ArrayList<String>(otherTumorType.NCI); this.UMLS = new ArrayList<String>(otherTumorType.UMLS); this.tissue = otherTumorType.tissue; this.children = new HashMap<String, TumorType>(otherTumorType.children.size()); for (Map.Entry<String, TumorType> entry : otherTumorType.children.entrySet()) { this.children.put(entry.getKey(), new TumorType(entry.getValue())); } this.parent = otherTumorType.parent; this.deprecated = otherTumorType.deprecated; this.history = new ArrayList<String>(otherTumorType.history); if (otherTumorType.links != null) { this.links = new Links(otherTumorType.links); } this.level = otherTumorType.level; }

Target:
public TumorType(TumorType otherTumorType) { this.id = otherTumorType.id; this.code = otherTumorType.code; this.color = otherTumorType.color; this.name = otherTumorType.name; if (otherTumorType.mainType != null) { this.mainType = new MainType(otherTumorType.mainType); } this.NCI = new ArrayList<String>(otherTumorType.NCI); this.UMLS = new ArrayList<String>(otherTumorType.UMLS); this.tissue = otherTumorType.tissue; this.children = new HashMap<String, TumorType>(otherTumorType.children); this.parent = otherTumorType.parent; this.deprecated = otherTumorType.deprecated; this.history = new ArrayList<String>(otherTumorType.history); if (otherTumorType.links != null) { this.links = new Links(otherTumorType.links); } this.level = otherTumorType.level; }
Source:
public boolean handleClear() { selectedVersions.clear(); IAtsChangeSet changes = AtsClientService.get().createChangeSet("Update Found-In-Location"); changes.unrelateAll(getArtifact(), getRelation()); changes.executeIfNeeded(); notifyXModifiedListeners(); return true; }

Target:
public boolean handleClear() { selectedVersions.clear(); IAtsChangeSet changes = AtsClientService.get().createChangeSet("Update Found-In-Version"); changes.unrelateAll(getArtifact(), getRelation()); changes.executeIfNeeded(); notifyXModifiedListeners(); return true; }
Source:
private KafkaStreamImporterConfig(URI uri, List<HostAndPort> brokers, String topic, int partition, HostAndPort partitionLeader, String groupId, int fetchSize, int soTimeout, String procedure, String commitPolicy, FormatterBuilder formatterBuilder) { m_uri = uri; m_brokers = brokers; m_topic = topic; m_partition = partition; m_partitionLeader = partitionLeader; m_groupId = groupId; m_fetchSize = fetchSize; m_soTimeout = soTimeout; m_procedure = procedure; KafkaImporterCommitPolicy cp; long triggerValue; try { cp = KafkaImporterCommitPolicy.fromString(commitPolicy); triggerValue = KafkaImporterCommitPolicy.fromStringTriggerValue(commitPolicy, cp); } catch (Exception ex) { m_logger.warn("Failed to configure commit policy: " + commitPolicy); cp = KafkaImporterCommitPolicy.COMMIT_POLICY_NONE; triggerValue = 0; } m_commitPolicy = cp; m_triggerValue = triggerValue; m_formatterBuilder = formatterBuilder; }

Target:
private KafkaStreamImporterConfig(URI uri, List<HostAndPort> brokers, String topic, int partition, HostAndPort partitionLeader, String groupId, int fetchSize, int soTimeout, String procedure, String commitPolicy, FormatterBuilder formatterBuilder) { m_uri = uri; m_brokers = brokers; m_topic = topic; m_partition = partition; m_partitionLeader = partitionLeader; m_groupId = groupId; m_fetchSize = fetchSize; m_soTimeout = soTimeout; m_procedure = procedure; KafkaImporterCommitPolicy cp; m_commitPolicy = KafkaImporterCommitPolicy.fromString(commitPolicy); m_triggerValue = KafkaImporterCommitPolicy.fromStringTriggerValue(commitPolicy, m_commitPolicy); m_formatterBuilder = formatterBuilder; }
Source:
public void info() throws Exception { String json = "{\"app.time.timestamp.format\":\"YYYY\"}"; this.mockMvc.perform( get("/streams/deployments/{timelog}?reuse-deployment-properties=true", "timelog") .contentType(MediaType.APPLICATION_JSON) .content(json)) .andDo(print()) .andExpect(status().isOk()) .andDo(this.documentationHandler.document( pathParameters(parameterWithName("timelog") .description("The name of an existing stream definition (required)")), requestParameters(parameterWithName("reuse-deployment-properties") .description(parameterWithName("The name of the flag to reuse the deployment properties"))) )); }

Target:
public void info() throws Exception { String json = "{\"app.time.timestamp.format\":\"YYYY\"}"; this.mockMvc.perform( get("/streams/deployments/{timelog}?reuse-deployment-properties=true", "timelog") .contentType(MediaType.APPLICATION_JSON) .content(json)) .andExpect(status().isOk()) .andDo(this.documentationHandler.document( pathParameters(parameterWithName("timelog") .description("The name of an existing stream definition (required)")), requestParameters(parameterWithName("reuse-deployment-properties") .description(parameterWithName("The name of the flag to reuse the deployment properties"))) )); }
Source:
public static Expression color(Object value, Factory factory) { Color color = null; if (value instanceof String) { Matcher m = HEX_PATTERN.matcher((String) value); if (m.matches()) { color = parseColorAsHex(m); } if (color == null) { m = RGB_PATTERN.matcher((String) value); if (m.matches()) { color = parseColorAsRGB(m); } } if (color == null) { color = Colors.get((String) value); } } else if (value instanceof Integer) { color = new Color((int) value); } if (value != null) value = value.toString(); String hex = null; if (color != null) { hex = String.format("#%02x%02x%02x", color.getRed(), color.getGreen(), color.getBlue()); hex = hex.toUpperCase(); } return color != null ? factory.filter.literal(hex) : expression((String) value, factory); }

Target:
public static Expression color(Object value, Factory factory) { Color color = null; if (value instanceof String) { Matcher m = HEX_PATTERN.matcher((String) value); if (m.matches()) { color = parseColorAsHex(m); } if (color == null) { m = RGB_PATTERN.matcher((String) value); if (m.matches()) { color = parseColorAsRGB(m); } } if (color == null) { color = Colors.get((String) value); } } else if (value instanceof Integer) { color = new Color((int) value); } if (value != null) value = value.toString(); return color != null ? factory.filter.literal(color) : expression((String) value, factory); }
Source:
public void testCheckForSchemeFailWithException() throws KettleFileException { String invalidVfsFilename = "{\"sport_hitting_tm\":{\"copyRight\":\" Copyright 2019 MLB Advanced Media, L.P. Use of any" + " content on this page acknowledges agreement to the terms posted here <LINK_0>" + ".com/components/copyright.txt \",\"queryResults\":{\"created\":\"2019-07-19T20:57:27\",\"totalSize\":\"1\"," + "\"row\":{\"gidp\":\"5\",\"sac\":\"0\",\"np\":\"1681\",\"sport_code\":\"mlb\",\"hgnd\":\"14\",\"tb\":\"209\"," + "\"gidp_opp\":\"55\",\"sport_id\":\"1\",\"bb\":\"77\",\"avg\":\".305\",\"slg\":\".663\",\"team_full\":\"Los " + "Angeles Angels\",\"ops\":\"1.117\",\"hbp\":\"11\",\"league_full\":\"American League\"," + "\"team_abbrev\":\"LAA\",\"so\":\"70\",\"hfly\":\"33\",\"wo\":\"0\",\"league_id\":\"103\",\"sf\":\"3\"," + "\"team_seq\":\"1\",\"league\":\"AL\",\"hpop\":\"0\",\"cs\":\"2\",\"season\":\"2019\",\"sb\":\"8\"," + "\"go_ao\":\"0.55\",\"ppa\":\"4.14\",\"player_id\":\"545361\",\"ibb\":\"11\",\"team_id\":\"108\"," + "\"roe\":\"2\",\"go\":\"54\",\"hr\":\"30\",\"rbi\":\"75\",\"babip\":\".303\",\"lob\":\"121\"," + "\"end_date\":\"2019-07-19T00:00:00\",\"xbh\":\"52\",\"league_short\":\"American\",\"g\":\"91\",\"d\":\"21\"," + "\"sport\":\"MLB\",\"team_short\":\"LA Angels\",\"tpa\":\"406\",\"h\":\"96\",\"obp\":\".453\"," + "\"hldr\":\"49\",\"t\":\"1\",\"ao\":\"98\",\"r\":\"75\",\"ab\":\"315\"}}}}"; KettleVFS.getScheme( invalidVfsFilename ); }

Target:
public void testCheckForSchemeFailWithException() throws KettleFileException { String invalidVfsFilename = "{\"textMessage\":{\"textMessage\":\" textMessage" + "textMessage \",\"textMessage\":{textMessage}}}"; KettleVFS.getScheme( invalidVfsFilename ); }
Source:
public void supplyVanillaManipulators(List<DataManipulator<?, ?>> manipulators) { super.supplyVanillaManipulators(manipulators); manipulators.add(new SpongeTargetedEntityData()); }

Target:
public void supplyVanillaManipulators(List<DataManipulator<?, ?>> manipulators) { super.supplyVanillaManipulators(manipulators); manipulators.add(getTargetData()); manipulators.add(getDirectionalData()); }
Source:
final void continuouslyRestart(long interval) throws IOException, InterruptedException { LOGGER.entering(new Object[] { interval }); while (true) { if (!isInitialized()) { FileDownloader.checkForDownloads(getType(), getLauncherOptions() .isFileDownloadCheckTimeStampOnInvocation(), getLauncherOptions() .isFileDownloadCleanupOnInvocation()); } startProcess(false); while (!handler.hasResult()) { LOGGER.fine("Child process still running. Going back to sleep."); Thread.sleep(interval); } if (handler.hasResult()) { ExecuteException e = handler.getException(); if (e != null) { LOGGER.log(Level.SEVERE, handler.getException().getMessage(), handler.getException()); } } LOGGER.info("Child process quit. Restarting it."); setInitialized(false); } }

Target:
final void continuouslyRestart(long interval) throws IOException, InterruptedException { LOGGER.entering(interval); while (true) { if (!isInitialized()) { FileDownloader.checkForDownloads(getType(), getLauncherOptions() .isFileDownloadCheckTimeStampOnInvocation(), getLauncherOptions() .isFileDownloadCleanupOnInvocation()); } startProcess(false); while (!handler.hasResult()) { LOGGER.fine("Child process still running. Going back to sleep."); Thread.sleep(interval); } if (handler.hasResult()) { ExecuteException e = handler.getException(); if (e != null) { LOGGER.log(Level.SEVERE, handler.getException().getMessage(), handler.getException()); } } LOGGER.info("Child process quit. Restarting it."); setInitialized(false); } }
Source:
public boolean handle(CorfuMsg message, ChannelHandlerContext ctx) { if (handlerMap.containsKey(message.getMsgType())) { try { Object ret = handlerMap.get(message.getMsgType()) .handle(message, ctx, client.getRouter()); if (ret != null) { client.getRouter().completeRequest(message.getRequestID(), ret); } } catch (Exception | Error e) { client.getRouter().completeExceptionally(message.getRequestID(), e); } return true; } return false; }

Target:
public boolean handle(CorfuMsg message, ChannelHandlerContext ctx) { if (handlerMap.containsKey(message.getMsgType())) { try { Object ret = handlerMap.get(message.getMsgType()) .handle(message, ctx, client.getRouter()); if (ret != null) { client.getRouter().completeRequest(message.getRequestID(), ret); } } catch (Throwable e) { client.getRouter().completeExceptionally(message.getRequestID(), e); } return true; } return false; }
Source:
public View onCreateActionView() { View chooserView = super.onCreateActionView(); Drawable icon = mContext.getResources().getDrawable(R.drawable.ic_share_24dp); Class clazz = chooserView.getClass(); try { Method method = clazz.getMethod("setExpandActivityOverflowButtonDrawable", Drawable.class); method.invoke(chooserView, icon); } catch (NoSuchMethodException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } return chooserView; }

Target:
public View onCreateActionView() { return null; }