auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void setup() { storageEraser = spy(new StorageEraser(storagePathProvider)); storageMigrator = spy(new StorageMigrator(storagePathProvider, storageStateProvider, storageEraser)); doNothing().when(storageMigrator).reopenDatabases(); doNothing().when(storageEraser).clearOdkDirOnScopedStorage(); doNothing().when(storageEraser).deleteOdkDirFromUnscopedStorage(); }

Target:
public void setup() { storageMigrator = spy(new StorageMigrator(storagePathProvider, storageStateProvider, storageEraser, storageMigrationRepository, generalSharedPreferences, referenceManager)); doNothing().when(storageMigrator).reopenDatabases(); doNothing().when(storageEraser).clearOdkDirOnScopedStorage(); doNothing().when(storageEraser).deleteOdkDirFromUnscopedStorage(); doReturn("/sdcard/odk/layers/countries/countries-raster.mbtiles").when(generalSharedPreferences).get(KEY_REFERENCE_LAYER); }
Source:
public Object visitGetAllCommand(InvocationContext ctx, GetAllCommand command) throws Throwable { if (command.hasAnyFlag(FlagBitSets.CACHE_MODE_LOCAL | FlagBitSets.SKIP_REMOTE_LOOKUP)) { return invokeNext(ctx, command); } if (!ctx.isOriginLocal()) { for (Object key : command.getKeys()) { if (ctx.lookupEntry(key) == null) { return UnsureResponse.INSTANCE; } } return invokeNext(ctx, command); } GetAllSuccessHandler getAllSuccessHandler = new GetAllSuccessHandler(command); CompletableFuture<Void> allFuture = remoteGetAll(ctx, command, command.getKeys(), getAllSuccessHandler); if (allFuture == null) { return invokeNext(ctx, command); } return asyncValue(allFuture).thenApply(ctx, command, getAllSuccessHandler); }

Target:
public Object visitGetAllCommand(InvocationContext ctx, GetAllCommand command) throws Throwable { if (command.hasAnyFlag(FlagBitSets.CACHE_MODE_LOCAL | FlagBitSets.SKIP_REMOTE_LOOKUP)) { return invokeNext(ctx, command); } if (!ctx.isOriginLocal()) { for (Object key : command.getKeys()) { if (ctx.lookupEntry(key) == null) { return UnsureResponse.INSTANCE; } } return invokeNext(ctx, command); } GetAllSuccessHandler getAllSuccessHandler = new GetAllSuccessHandler(command); CompletableFuture<Void> allFuture = remoteGetAll(ctx, command, command.getKeys(), getAllSuccessHandler); return asyncValue(allFuture).thenApply(ctx, command, getAllSuccessHandler); }
Source:
default @Nonnull Map<Long, ILogData> peekAll(RuntimeLayout runtimeLayout, Set<Long> globalAddresses) { return globalAddresses.parallelStream() .map(a -> new SimpleImmutableEntry<>(a, peek(runtimeLayout, a))) .collect(Collectors.toMap(SimpleImmutableEntry::getKey, SimpleImmutableEntry::getValue)); }

Target:
default @Nonnull Map<Long, ILogData> peekAll(RuntimeLayout runtimeLayout, Set<Long> globalAddresses) { return globalAddresses .parallelStream() .collect(Collectors.toMap(Function.identity(), a -> peek(runtimeLayout, a))); }
Source:
protected void testAccessControl_instructorSubmitStudentResponse_accessible() { ______TS("Student intends to access own response, but logged in as instructor, should be accessible"); loginAsInstructor(instructor1OfCourse1.getGoogleId()); assertEquals(student1InCourse1.getEmail(), student1ResponseToStudent1.getGiver()); FeedbackResponseUpdateRequest updateRequest = getUpdateRequest(student1ResponseToStudent1.getRecipient()); String[] studentAccessOwnPersonParams = new String[] { Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), Const.ParamsNames.FEEDBACK_RESPONSE_ID, student1ResponseToStudent1.getId(), Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON, student1InCourse1.getEmail(), }; verifyCanAccess(updateRequest, studentAccessOwnPersonParams); }

Target:
protected void testAccessControl_instructorSubmitStudentResponse_accessible() { ______TS("Instructor attempts to edit student's response with appropriate permission, should be accessible"); loginAsInstructor(instructor1OfCourse1.getGoogleId()); assertEquals(student1InCourse1.getEmail(), student1ResponseToStudent1.getGiver()); FeedbackResponseUpdateRequest updateRequest = getUpdateRequest(student1ResponseToStudent1.getRecipient()); String[] studentAccessOwnPersonParams = new String[] { Const.ParamsNames.INTENT, Intent.STUDENT_SUBMISSION.toString(), Const.ParamsNames.FEEDBACK_RESPONSE_ID, student1ResponseToStudent1.getId(), Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON, student1InCourse1.getEmail(), }; verifyCanAccess(updateRequest, studentAccessOwnPersonParams); }
Source:
public static void reportInAppUpdateResult(boolean result, String failureReason) { Bundle bundle = new Bundle(); bundle.putInt(FirebaseAnalytics.Param.SUCCESS, result ? 1 : 0); bundle.putString(CCAnalyticsParam.REASON, failureReason); reportEvent(CCAnalyticsEvent.IN_APP_UPDATE_EVENT, bundle); }

Target:
public static void reportInAppUpdateResult(boolean result, String failureReason) { Bundle bundle = new Bundle(); bundle.putLong(FirebaseAnalytics.Param.VALUE, result ? 1 : 0); bundle.putString(CCAnalyticsParam.REASON, failureReason); reportEvent(CCAnalyticsEvent.IN_APP_UPDATE_EVENT, bundle); }
Source:
public StaticPluginLocator(T... plugins) { this.plugins = Collections.unmodifiableSet(new HashSet(Arrays.asList(plugins))); }

Target:
public StaticPluginLocator(T... plugins) { this.plugins = new LinkedHashSet<>(plugins.length); Collections.addAll(this.plugins, plugins); }
Source:
public TableType tableType() { if (isView()) { return TableType.VIRTUAL_VIEW; } else if (isMaterializedView()) { return TableType.MATERIALIZED_VIEW; } return table.getTableType(); }

Target:
public TableType tableType() { return table.getTableType(); }
Source:
private String resolveHostNetworkAddress(String networkName, Function<VdsNetworkInterface, String> ipFunction) { if (networkName == null) { return null; } return host.getInterfaces() .stream() .filter(new InterfaceByNetworkNamePredicate(networkName)) .map(ipFunction) .filter(e -> e != null) .findFirst() .orElse(null); }

Target:
private String resolveHostNetworkAddress(String networkName, Function<VdsNetworkInterface, String> ipFunction) { if (networkName == null) { return null; } return host.getInterfaces() .stream() .filter(new InterfaceByNetworkNamePredicate(networkName)) .map(ipFunction) .filter(Objects::nonNull) .findFirst() .orElse(null); }
Source:
static void call(Button b, final String project) { b.setEnabled(false); new CreateChangeDialog(b, new Project.NameKey(project)) { { sendButton.setText("Create"); message.setText("Insert the description of the change."); } @Override public void onSend() { ChangeApi.createChange(project, getDestinationBranch(), message.getText(), new GerritCallback<ChangeInfo>() { @Override public void onSuccess(ChangeInfo result) { sent = true; hide(); Gerrit.display(PageLinks.toChange(result.legacy_id())); } @Override public void onFailure(Throwable caught) { enableButtons(true); super.onFailure(caught); } }); } }.center(); }

Target:
static void call(Button b, final String project) { b.setEnabled(false); new CreateChangeDialog(b, new Project.NameKey(project)) { { sendButton.setText(Util.C.buttonCreate()); message.setText(Util.C.buttonCreateDescription()); } @Override public void onSend() { ChangeApi.createChange(project, getDestinationBranch(), message.getText(), new GerritCallback<ChangeInfo>() { @Override public void onSuccess(ChangeInfo result) { sent = true; hide(); Gerrit.display(PageLinks.toChange(result.legacy_id())); } @Override public void onFailure(Throwable caught) { enableButtons(true); super.onFailure(caught); } }); } }.center(); }
Source:
private void addPolicies(EntitySpec<?> entitySpec, Object policies) { List<PolicySpec<?>> policySpecs = new ArrayList<PolicySpec<? extends Policy>>(); if (policies instanceof Iterable) { for (Object policy : (Iterable<Object>)policies) { if (policy instanceof Map) { String policyTypeName = ((Map<?, ?>) policy).get("policyType").toString(); Class<? extends Policy> policyType = null; try { policyType = (Class<? extends Policy>) Class.forName(policyTypeName); } catch (ClassNotFoundException e) { throw Exceptions.propagate(e); } policySpecs.add(PolicySpec.create(policyType) .configure((Map<?, ?>) ((Map<?, ?>) policy).get("brooklyn.config"))); } else { throw new IllegalArgumentException("policy should be map, not " + policy.getClass()); } } } else if (policies != null) { throw new IllegalArgumentException("policies body should be iterable, not " + policies.getClass()); } if (policySpecs.size() > 0) { entitySpec.policySpecs(policySpecs); } }

Target:
private void addPolicies(EntitySpec<?> entitySpec, Object policies) { List<PolicySpec<?>> policySpecs = new ArrayList<PolicySpec<? extends Policy>>(); if (policies instanceof Iterable) { for (Object policy : (Iterable<Object>)policies) { if (policy instanceof Map) { String policyTypeName = ((Map<?, ?>) policy).get("policyType").toString(); Class<? extends Policy> policyType = null; try { policyType = (Class<? extends Policy>) Class.forName(policyTypeName); } catch (ClassNotFoundException e) { throw Exceptions.propagate(e); } policySpecs.add(toCorePolicySpec(policyType, (Map<?, ?>) ((Map<?, ?>) policy).get("brooklyn.config"))); } else { throw new IllegalArgumentException("policy should be map, not " + policy.getClass()); } } } else if (policies != null) { throw new IllegalArgumentException("policies body should be iterable, not " + policies.getClass()); } if (policySpecs.size() > 0) { entitySpec.policySpecs(policySpecs); } }
Source:
public void testValidateUniqueProxyId() throws Exception { Settings settings = new Settings(); Proxy proxy = new Proxy(); String id = null; proxy.setId(null); proxy.setHost("www.example.com"); settings.addProxy( proxy ); settings.addProxy( proxy ); SimpleProblemCollector problems = new SimpleProblemCollector(); validator.validate( settings, problems ); assertEquals( 1, problems.messages.size() ); assertContains( problems.messages.get( 0 ), "'proxies.proxy.id' must be unique" + " but found duplicate proxy with id " + null); }

Target:
public void testValidateUniqueProxyId() throws Exception { Settings settings = new Settings(); Proxy proxy = new Proxy(); String id = null; proxy.setId(id); proxy.setHost("www.example.com"); settings.addProxy( proxy ); settings.addProxy( proxy ); SimpleProblemCollector problems = new SimpleProblemCollector(); validator.validate( settings, problems ); assertEquals( 1, problems.messages.size() ); assertContains( problems.messages.get( 0 ), "'proxies.proxy.id' must be unique" + " but found duplicate proxy with id " + id); }
Source:
private boolean continueWithNotice(Event event) { String nodeID = event.hasNodeid() ? String.valueOf(event.getNodeid()) : null; String ipAddr = event.getInterface(); String service = event.getService(); boolean continueNotice = false; if(nodeID == null) { return false; } if (nodeID == null || ipAddr == null || service == null || ipAddr.equals("0.0.0.0")) { LOG.debug("nodeID={} ipAddr={} service={}. Not checking DB, continuing...", nodeID, ipAddr, service); return true; } try { String notify = getNotificationManager().getServiceNoticeStatus(nodeID, ipAddr, service); if ("Y".equals(notify)) { continueNotice = true; LOG.debug("notify status for service on interface/node {}/{} is 'Y', continuing...", service, ipAddr, nodeID); } else { LOG.debug("notify status for service on interface/node {}/{} is {}, not continuing...", service, ipAddr, nodeID, notify); } } catch (Throwable e) { continueNotice = true; LOG.error("Not able to get notify status for service on interface/node {}/{}. Continuing notice... {}", service, ipAddr, nodeID, e.getMessage()); } return continueNotice; }

Target:
private boolean continueWithNotice(Event event) { String nodeID = event.hasNodeid() ? String.valueOf(event.getNodeid()) : null; String ipAddr = event.getInterface(); String service = event.getService(); boolean continueNotice = false; if (nodeID == null || ipAddr == null || service == null || ipAddr.equals("0.0.0.0")) { LOG.debug("nodeID={} ipAddr={} service={}. Not checking DB, continuing...", nodeID, ipAddr, service); return true; } try { String notify = getNotificationManager().getServiceNoticeStatus(nodeID, ipAddr, service); if ("Y".equals(notify)) { continueNotice = true; LOG.debug("notify status for service on interface/node {}/{} is 'Y', continuing...", service, ipAddr, nodeID); } else { LOG.debug("notify status for service on interface/node {}/{} is {}, not continuing...", service, ipAddr, nodeID, notify); } } catch (Throwable e) { continueNotice = true; LOG.error("Not able to get notify status for service on interface/node {}/{}. Continuing notice... {}", service, ipAddr, nodeID, e.getMessage()); } return continueNotice; }
Source:
public int requestThrottleInflight() { if (requestThrottler != null) { return requestThrottler.getInflight(); } return 0; }

Target:
private int requestThrottleInflight() { if (requestThrottler != null) { return requestThrottler.getInflight(); } return 0; }
Source:
public static int findNodeId(Cluster cluster, HostMatcher matcher) { if(isSingleLocalCluster(cluster, matcher)) { int nodeId = cluster.getNodeIds().iterator().next(); logger.info(" Cluster is a single local node cluster. Node Id " + nodeId); return nodeId; } List<Node> matches = Lists.newArrayList(); for(Node node: cluster.getNodes()) { if(matcher.match(node)) { logger.info(node.briefToString() + " matched the current cluster "); matches.add(node); } } if(matches.isEmpty()) { throw new VoldemortApplicationException(" No nodes in the cluster matched the current node " + Arrays.toString(cluster.getNodes().toArray())); } else if ( matches.size() > 1) { throw new VoldemortApplicationException(" More than one node matched " + Arrays.toString(matches.toArray())); } else { logger.info(" computed node Id match successfully " + matches.get(0).briefToString()); return matches.get(0).getId(); } }

Target:
public static int findNodeId(Cluster cluster, HostMatcher matcher) { logger.info(" Using Matcher " + matcher.getDebugInfo()); if(isSingleLocalCluster(cluster, matcher)) { int nodeId = cluster.getNodeIds().iterator().next(); logger.info(" Cluster is a single local node cluster. Node Id " + nodeId); return nodeId; } List<Node> matches = Lists.newArrayList(); for(Node node: cluster.getNodes()) { if(matcher.match(node)) { logger.info(node.briefToString() + " matched the current cluster "); matches.add(node); } } if(matches.isEmpty()) { throw new VoldemortApplicationException(" No nodes in the cluster matched the current node " + Arrays.toString(cluster.getNodes().toArray())); } else if ( matches.size() > 1) { String errorMessage = " More than one node matched " + Arrays.toString(matches.toArray()); logger.error(errorMessage); throw new VoldemortApplicationException(errorMessage); } else { logger.info(" computed node Id match successfully " + matches.get(0).briefToString()); return matches.get(0).getId(); } }
Source:
default int getSizeOfProperty(JsonObject object) throws DataException { if (object != null) { try { JsonArray jsonArray = (JsonArray) object.get(this.toString()); return jsonArray.size(); } catch (RuntimeException e) { throw new DataException("Not possible to retrieve size of array for key " + this.toString() + ". Exception: " + e.getMessage()); } } return 0; }

Target:
default int getSizeOfProperty(JsonObject object) throws DataException { if (Objects.nonNull(object)) { try { return object.getJsonArray(this.toString()).size(); } catch (ClassCastException | NullPointerException e) { throw new DataException("Not possible to retrieve size of array for key " + this.toString() + ". Exception: " + e.getMessage()); } } return 0; }
Source:
protected void introDefaultInstance(CodeWriter writer, EntityType model, String defaultName) throws IOException { String simpleName = !defaultName.isEmpty() ? defaultName : variableNameFunction.apply(model); Type queryType = typeMappings.getPathType(model, model, true); String alias = simpleName; if (keywords.contains(simpleName.toUpperCase())) { alias += "1"; } writer.publicStaticFinal(queryType, simpleName, NEW + queryType.getSimpleName() + "(\"" + alias + "\")"); }

Target:
protected void introDefaultInstance(CodeWriter writer, EntityType model, String defaultName) throws IOException { String simpleName = !defaultName.isEmpty() ? defaultName : model.getModifiedSimpleName(); Type queryType = typeMappings.getPathType(model, model, true); String alias = simpleName; if (keywords.contains(simpleName.toUpperCase())) { alias += "1"; } writer.publicStaticFinal(queryType, simpleName, NEW + queryType.getSimpleName() + "(\"" + alias + "\")"); }
Source:
private boolean internalValidateAndSetQuota() { if (isInternalExecution()) { return true; } if (getStoragePool() == null && getActionType().getQuotaDependency() != VdcActionType.QuotaDependency.NONE) { log.error("Command: " + this.getClass().getName() + ". Storage pool is not available for quota calculation. "); return false; } QuotaConsumptionParametersWrapper quotaConsumptionParametersWrapper = new QuotaConsumptionParametersWrapper(this, getReturnValue().getCanDoActionMessages()); quotaConsumptionParametersWrapper.setParameters(getQuotaConsumptionParameters()); return true; }

Target:
private boolean internalValidateAndSetQuota() { if (isInternalExecution()) { return true; } if (getStoragePool() == null && isQuotaDependant()) { log.error("Command: " + this.getClass().getName() + ". Storage pool is not available for quota calculation. "); return false; } QuotaConsumptionParametersWrapper quotaConsumptionParametersWrapper = new QuotaConsumptionParametersWrapper(this, getReturnValue().getCanDoActionMessages()); quotaConsumptionParametersWrapper.setParameters(getQuotaConsumptionParameters()); return true; }
Source:
protected void executeCommand() { if (getParameters().getRefresh() || getSessionDataContainer().isSsoOvirtAppApiScope(getParameters().getSessionId())) { getSessionDataContainer().updateSessionLastActiveTime(getParameters().getSessionId()); } if (validatePermissions()) { if (validateInputs()) { long start = System.currentTimeMillis(); try { returnValue.setSucceeded(true); executeQueryCommand(); } catch (RuntimeException ex) { returnValue.setSucceeded(false); Throwable th = ex instanceof EngineException ? ex : ex.getCause(); if (th instanceof EngineException) { EngineException vdcExc = (EngineException) th; if (vdcExc.getErrorCode() != null && !vdcExc.isUseRootCause()) { returnValue.setExceptionString(vdcExc.getErrorCode().toString()); } else { returnValue.setExceptionString(vdcExc.isUseRootCause() ? ExceptionUtils.getRootCauseMessage(vdcExc) : vdcExc.getMessage()); } log.error("Query '{}' failed: {}", getClass().getSimpleName(), vdcExc.isUseRootCause() ? ExceptionUtils.getRootCauseMessage(vdcExc) : vdcExc.getMessage()); log.error("Exception", vdcExc); } else { returnValue.setExceptionString(ex.getMessage()); log.error("Query '{}' failed: {}", getClass().getSimpleName(), ex.getMessage()); log.error("Exception", ex); } } finally { log.debug("Query took ms", getCommandName(), System.currentTimeMillis() - start); } } else { log.error("Query execution failed due to invalid inputs: {}", returnValue.getExceptionString()); } } else { String errMessage = "Query execution failed due to insufficient permissions."; log.error(errMessage); returnValue.setExceptionString(errMessage); } }

Target:
protected void executeCommand() { if (getParameters().getRefresh() || getSessionDataContainer().isSsoOvirtAppApiScope(getParameters().getSessionId())) { getSessionDataContainer().updateSessionLastActiveTime(getParameters().getSessionId()); } if (validatePermissions()) { if (validateInputs()) { long start = System.currentTimeMillis(); try { returnValue.setSucceeded(true); executeQueryCommand(); } catch (RuntimeException ex) { returnValue.setSucceeded(false); Throwable th = ex instanceof EngineException ? ex : ex.getCause(); if (th instanceof EngineException) { EngineException vdcExc = (EngineException) th; if (vdcExc.getErrorCode() != null && !vdcExc.isUseRootCause()) { returnValue.setExceptionString(vdcExc.getErrorCode().toString()); } else { returnValue.setExceptionString(vdcExc.getMessage()); } log.error("Query '{}' failed: {}", getClass().getSimpleName(), vdcExc.getMessage()); log.error("Exception", vdcExc); } else { returnValue.setExceptionString(ex.getMessage()); log.error("Query '{}' failed: {}", getClass().getSimpleName(), ex.getMessage()); log.error("Exception", ex); } } finally { log.debug("Query took ms", getCommandName(), System.currentTimeMillis() - start); } } else { log.error("Query execution failed due to invalid inputs: {}", returnValue.getExceptionString()); } } else { String errMessage = "Query execution failed due to insufficient permissions."; log.error(errMessage); returnValue.setExceptionString(errMessage); } }
Source:
public void perform(GraphRewrite event, EvaluationContext context) { List<FileModel> inputPaths = WindupConfigurationService.getConfigurationModel(event.getGraphContext()) .getInputPaths(); if (Iterables.size(inputPaths) > 1) { createGlobalAppDependencyGraphReport(event.getGraphContext()); } inputPaths.stream() .filter(inputPath -> !ProjectModel.TYPE_VIRTUAL.equals(inputPath.getProjectModel().getProjectType())) .forEach(inputPath -> createSingleAppDependencyGraphReport(event.getGraphContext(), inputPath.getProjectModel())); }

Target:
public void perform(GraphRewrite event, EvaluationContext context) { List<FileModel> inputPaths = WindupConfigurationService.getConfigurationModel(event.getGraphContext()) .getInputPaths(); if (inputPaths.size() > 1) { createGlobalAppDependencyGraphReport(event.getGraphContext()); } inputPaths.stream() .filter(inputPath -> !ProjectModel.TYPE_VIRTUAL.equals(inputPath.getProjectModel().getProjectType())) .forEach(inputPath -> createSingleAppDependencyGraphReport(event.getGraphContext(), inputPath.getProjectModel())); }
Source:
public void loadBuildData(@NotNull Properties properties) { loadBuildVersionAndTimeData(properties); loadBuildHostData(properties); loadBuildNumber(System.getenv(), properties); }

Target:
public void loadBuildData(@NotNull Properties properties) { loadBuildVersionAndTimeData(properties); loadBuildHostData(properties); loadBuildNumber(properties); }
Source:
public MaxwellKafkaProducer(MaxwellContext context, Properties kafkaProperties, String kafkaTopic) { super(context); this.queue = new ArrayBlockingQueue<>(100); BlockingQueue<Runnable> runQueue = new ArrayBlockingQueue<>(100); this.worker = new MaxwellKafkaProducerWorker(context, kafkaProperties, kafkaTopic, this.queue); Thread thread = new Thread(this.worker, "maxwell-kafka-worker"); thread.setDaemon(true); thread.start(); }

Target:
public MaxwellKafkaProducer(MaxwellContext context, Properties kafkaProperties, String kafkaTopic) { super(context); this.queue = new ArrayBlockingQueue<>(100); this.worker = new MaxwellKafkaProducerWorker(context, kafkaProperties, kafkaTopic, this.queue); Thread thread = new Thread(this.worker, "maxwell-kafka-worker"); thread.setDaemon(true); thread.start(); }
Source:
void requestBannerAd(@NonNull Context context, @NonNull String appId, @NonNull AdSize adSize) { adLayout = new RelativeLayout(context) { @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); attach(); } @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); detach(); } }; int adLayoutHeight = adSize.getHeightInPixels(context); if (adLayoutHeight <= 0) { float density = context.getResources().getDisplayMetrics().density; adLayoutHeight = Math.round(mAdConfig.getAdSize().getHeight() * density); } RelativeLayout.LayoutParams adViewLayoutParams = new RelativeLayout.LayoutParams(adSize.getWidthInPixels(context), adLayoutHeight); adLayout.setLayoutParams(adViewLayoutParams); Log.d(TAG, "requestBannerAd: " + this); mPendingRequestBanner = true; VungleInitializer.getInstance() .initialize( appId, context.getApplicationContext(), new VungleInitializer.VungleInitializationListener() { @Override public void onInitializeSuccess() { loadBanner(); } @Override public void onInitializeError(String errorMessage) { Log.d(TAG, "SDK init failed: " + VungleBannerAdapter.this); VungleListener listener = getVungleListener(); mVungleManager.removeActiveBannerAd(placementId); if (mPendingRequestBanner && listener != null) { listener.onAdFailedToLoad(AdRequest.ERROR_CODE_INTERNAL_ERROR); } } }); }

Target:
void requestBannerAd(@NonNull Context context, @NonNull String appId, @NonNull AdSize adSize) { adLayout = new RelativeLayout(context) { @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); attach(); } @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); detach(); } }; int adLayoutHeight = adSize.getHeightInPixels(context); if (adLayoutHeight <= 0) { float density = context.getResources().getDisplayMetrics().density; adLayoutHeight = Math.round(mAdConfig.getAdSize().getHeight() * density); } RelativeLayout.LayoutParams adViewLayoutParams = new RelativeLayout.LayoutParams(adSize.getWidthInPixels(context), adLayoutHeight); adLayout.setLayoutParams(adViewLayoutParams); Log.d(TAG, "requestBannerAd: " + this); mPendingRequestBanner = true; VungleInitializer.getInstance() .initialize( appId, context.getApplicationContext(), new VungleInitializer.VungleInitializationListener() { @Override public void onInitializeSuccess() { loadBanner(); } @Override public void onInitializeError(String errorMessage) { Log.d(TAG, "SDK init failed: " + VungleBannerAdapter.this); VungleListener listener = getVungleListener(); mVungleManager.removeActiveBannerAd(placementId, vungleBannerAd); if (mPendingRequestBanner && listener != null) { listener.onAdFailedToLoad(AdRequest.ERROR_CODE_INTERNAL_ERROR); } } }); }
Source:
protected @Nonnull Set<String> loadPluginsFromWar(@Nonnull String fromPath, @CheckForNull FilenameFilter filter) { Set<String> names = new HashSet(); ServletContext context = Jenkins.getInstance().servletContext; Set<String> plugins = Util.fixNull((Set<String>) context.getResourcePaths(fromPath)); Set<URL> copiedPlugins = new HashSet<>(); Set<URL> dependencies = new HashSet<>(); for( String pluginPath : plugins) { String fileName = pluginPath.substring(pluginPath.lastIndexOf('/')+1); if(fileName.length()==0) { continue; } try { names.add(fileName); URL url = context.getResource(pluginPath); if (filter != null) { if (!filter.accept(new File(url.getFile()), fileName)) { continue; } } copyBundledPlugin(url, fileName); copiedPlugins.add(url); try { addDependencies(url, fromPath, dependencies); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Failed to resolve dependencies for the bundled plugin " + fileName, e); } } catch (IOException e) { LOGGER.log(Level.SEVERE, "Failed to extract the bundled plugin "+fileName,e); } } for (URL dependency : dependencies) { if (copiedPlugins.contains(dependency)) { continue; } String fileName = new File(dependency.getFile()).getName(); try { names.add(fileName); copyBundledPlugin(dependency, fileName); copiedPlugins.add(dependency); } catch (IOException e) { LOGGER.log(Level.SEVERE, "Failed to extract the bundled dependency plugin " + fileName, e); } } return names; }

Target:
protected @Nonnull Set<String> loadPluginsFromWar(@Nonnull String fromPath, @CheckForNull FilenameFilter filter) { Set<String> names = new HashSet(); ServletContext context = Jenkins.getInstance().servletContext; Set<String> plugins = Util.fixNull((Set<String>) context.getResourcePaths(fromPath)); Set<URL> copiedPlugins = new HashSet<>(); Set<URL> dependencies = new HashSet<>(); for( String pluginPath : plugins) { String fileName = pluginPath.substring(pluginPath.lastIndexOf('/')+1); if(fileName.length()==0) { continue; } try { URL url = context.getResource(pluginPath); if (filter != null && url != null) { if (!filter.accept(new File(url.getFile()).getParentFile(), fileName)) { continue; } } names.add(fileName); copyBundledPlugin(url, fileName); copiedPlugins.add(url); try { addDependencies(url, fromPath, dependencies); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Failed to resolve dependencies for the bundled plugin " + fileName, e); } } catch (IOException e) { LOGGER.log(Level.SEVERE, "Failed to extract the bundled plugin "+fileName,e); } } for (URL dependency : dependencies) { if (copiedPlugins.contains(dependency)) { continue; } String fileName = new File(dependency.getFile()).getName(); try { names.add(fileName); copyBundledPlugin(dependency, fileName); copiedPlugins.add(dependency); } catch (IOException e) { LOGGER.log(Level.SEVERE, "Failed to extract the bundled dependency plugin " + fileName, e); } } return names; }
Source:
public List<ScanFilter> getScanFilters() { List<ScanFilter> scanFilterList = new ArrayList<>(); try { scanFilterList.addAll( GenericFilterUtility.getScanFilter( incTagList.getSelectedValuesList(), excTagList.getSelectedValuesList(), TagScanFilter::new)); scanFilterList.addAll( GenericFilterUtility.getScanFilter( methodList.getSelectedValuesList(), null, MethodScanFilter::new)); scanFilterList.addAll( GenericFilterUtility.getScanFilter( codeList.getSelectedValuesList(), null, HttpStatusCodeScanFilter::new)); scanFilterList.addAll( GenericFilterUtility.getScanFilter( strToRegexList(regexInc.getText()), strToRegexList(regexExc.getText()), UrlPatternScanFilter::new)); } catch (PatternSyntaxException e1) { throw e1; } return scanFilterList; }

Target:
public List<ScanFilter> getScanFilters() { List<ScanFilter> scanFilterList = new ArrayList<>(); scanFilterList.addAll( GenericFilterUtility.createScanFilter( incTagList.getSelectedValuesList(), excTagList.getSelectedValuesList(), TagScanFilter::new)); scanFilterList.addAll( GenericFilterUtility.createScanFilter( methodList.getSelectedValuesList(), null, MethodScanFilter::new)); scanFilterList.addAll( GenericFilterUtility.createScanFilter( codeList.getSelectedValuesList(), null, HttpStatusCodeScanFilter::new)); scanFilterList.addAll( GenericFilterUtility.createScanFilter( strToRegexList(regexInc.getText()), strToRegexList(regexExc.getText()), UrlPatternScanFilter::new)); return scanFilterList; }
Source:
public List<UpgradeCheck> getFilteredUpgradeChecks(UpgradePack upgradePack) throws AmbariException { List<UpgradeCheck> upgradeChecks = new ArrayList<>(); upgradeChecks.addAll(m_builtInChecks); Set<UpgradeCheck> pluginChecks = m_pluginChecks.get(upgradePack); if (null == pluginChecks) { pluginChecks = new TreeSet<>(new PreUpgradeCheckComparator()); m_pluginChecks.put(upgradePack, pluginChecks); List<String> pluginCheckClassNames = upgradePack.getPrerequisiteChecks(); if (null != pluginCheckClassNames && !pluginCheckClassNames.isEmpty()) { StackId ownerStackId = upgradePack.getOwnerStackId(); StackInfo stackInfo = metainfoProvider.get().getStack(ownerStackId); ClassLoader classLoader = stackInfo.getLibraryClassLoader(); if (null != classLoader) { for (String pluginCheckClassName : pluginCheckClassNames) { try { Class<? extends UpgradeCheck> upgradeCheckClass = (Class<? extends UpgradeCheck>) classLoader.loadClass( pluginCheckClassName); pluginChecks.add(upgradeCheckClass.newInstance()); LOG.info("Registered pre-upgrade check for stack {}", upgradeCheckClass, ownerStackId); } catch (Exception exception) { LOG.error("Unable to load the upgrade check {}", pluginCheckClassName, exception); } } } else { LOG.error( "Unable to perform the following upgrade checks because no libraries could be loaded for the stack: {}", ownerStackId, StringUtils.join(pluginCheckClassNames, ",")); } } } final Set<UpgradeCheck> combinedUpgradeChecks = new TreeSet<>(new PreUpgradeCheckComparator()); combinedUpgradeChecks.addAll(m_builtInChecks); combinedUpgradeChecks.addAll(pluginChecks); return new LinkedList<>(combinedUpgradeChecks); }

Target:
public List<UpgradeCheck> getFilteredUpgradeChecks(UpgradePack upgradePack) throws AmbariException { List<UpgradeCheck> builtInRequiredChecks = new ArrayList<>(); for (UpgradeCheck builtInCheck : m_builtInChecks) { if (isBuiltInCheckRequired(builtInCheck, upgradePack.getType())) { builtInRequiredChecks.add(builtInCheck); } } Set<UpgradeCheck> pluginChecks = m_pluginChecks.get(upgradePack); if (null == pluginChecks) { pluginChecks = new TreeSet<>(new PreUpgradeCheckComparator()); m_pluginChecks.put(upgradePack, pluginChecks); List<String> pluginCheckClassNames = upgradePack.getPrerequisiteChecks(); if (null != pluginCheckClassNames && !pluginCheckClassNames.isEmpty()) { loadPluginUpgradeChecksFromStack(upgradePack, pluginChecks); } } final Set<UpgradeCheck> combinedUpgradeChecks = new TreeSet<>(new PreUpgradeCheckComparator()); combinedUpgradeChecks.addAll(builtInRequiredChecks); combinedUpgradeChecks.addAll(pluginChecks); return new LinkedList<>(combinedUpgradeChecks); }
Source:
public void TestLoadConfig() { ApplicationRunnerMain.ApplicationRunnerCommandLine cmdLine = new ApplicationRunnerMain.ApplicationRunnerCommandLine(); OptionSet options = cmdLine.parser().parse( "--config-loader-factory", "org.apache.samza.config.loaders.PropertiesConfigLoaderFactory", "--config-loader-properties", "path=" + getClass().getResource("/test.properties").getPath(), "-config", String.format("%s=%s", ApplicationConfig.APP_CLASS, MockStreamApplication.class.getName()), "-config", String.format("app.runner.class=%s", TestApplicationRunnerInvocationCounts.class.getName())); Config actual = cmdLine.loadConfig(options); assertEquals(4, actual.size()); assertEquals("org.apache.samza.config.loaders.PropertiesConfigLoaderFactory", actual.get(JobConfig.CONFIG_LOADER_FACTORY)); assertEquals( getClass().getResource("/test.properties").getPath(), actual.get(ConfigLoaderFactory.CONFIG_LOADER_PROPERTIES_PREFIX + "path")); assertEquals(MockStreamApplication.class.getName(), actual.get(ApplicationConfig.APP_CLASS)); assertEquals(TestApplicationRunnerInvocationCounts.class.getName(), actual.get("app.runner.class")); }

Target:
public void TestLoadConfig() { ApplicationRunnerMain.ApplicationRunnerCommandLine cmdLine = new ApplicationRunnerMain.ApplicationRunnerCommandLine(); OptionSet options = cmdLine.parser().parse( "--config-loader-factory", "org.apache.samza.config.loaders.PropertiesConfigLoaderFactory", "--config-loader-properties", "path=" + getClass().getResource("/test.properties").getPath(), "-config", String.format("%s=%s", ApplicationConfig.APP_CLASS, MockStreamApplication.class.getName()), "-config", String.format("app.runner.class=%s", TestApplicationRunnerInvocationCounts.class.getName())); Config actual = cmdLine.loadConfig(options); Config expected = new MapConfig(ImmutableMap.of( JobConfig.CONFIG_LOADER_FACTORY, "org.apache.samza.config.loaders.PropertiesConfigLoaderFactory", ConfigLoaderFactory.CONFIG_LOADER_PROPERTIES_PREFIX + "path", getClass().getResource("/test.properties").getPath(), ApplicationConfig.APP_CLASS, MockStreamApplication.class.getName(), "app.runner.class", TestApplicationRunnerInvocationCounts.class.getName())); assertEquals(expected, actual); }
Source:
CompletableFuture<Acknowledge> runApplicationAndShutdownClusterAsync( final DispatcherGateway dispatcher, final ScheduledExecutor scheduledExecutor) { applicationCompletionFuture = runApplicationAsync(dispatcher, scheduledExecutor, false); return applicationCompletionFuture .handle((r, t) -> { final ApplicationStatus applicationStatus; if (t != null) { applicationStatus = t instanceof CancellationException ? ApplicationStatus.CANCELED : ApplicationStatus.FAILED; LOG.warn("Application {}: ", applicationStatus, t); } else { applicationStatus = ApplicationStatus.SUCCEEDED; LOG.info("Application completed SUCCESSFULLY"); } return dispatcher.shutDownCluster(applicationStatus); }) .thenCompose(Function.identity()); }

Target:
CompletableFuture<Acknowledge> runApplicationAndShutdownClusterAsync( final DispatcherGateway dispatcher, final ScheduledExecutor scheduledExecutor) { applicationCompletionFuture = fixJobIdAndRunApplicationAsync(dispatcher, scheduledExecutor); return applicationCompletionFuture .handle((r, t) -> { final ApplicationStatus applicationStatus; if (t != null) { final Optional<JobCancellationException> cancellationException = ExceptionUtils.findThrowable(t, JobCancellationException.class); if (cancellationException.isPresent()) { applicationStatus = ApplicationStatus.CANCELED; } else if (t instanceof CancellationException) { applicationStatus = ApplicationStatus.UNKNOWN; } else { applicationStatus = ApplicationStatus.FAILED; } LOG.warn("Application {}: ", applicationStatus, t); } else { applicationStatus = ApplicationStatus.SUCCEEDED; LOG.info("Application completed SUCCESSFULLY"); } return dispatcher.shutDownCluster(applicationStatus); }) .thenCompose(Function.identity()); }
Source:
CloseableIterator<RepresentativeReadIndexer> representativeReadIndicesIterator() { return this.representativeReadIndicesForDuplicates.iterator(); }

Target:
CloseableIterator<RepresentativeReadIndexer> representativeReadIndicesIterator() { return representativeReadIndicesForDuplicates.iterator(); }
Source:
public synchronized void add(byte[] data, int offset, int count) throws IOException { if (data == null) throw new NullPointerException("data == null"); if ((offset | count) < 0 || count > data.length - offset) { throw new IndexOutOfBoundsException(); } expandIfNecessary(count); boolean wasEmpty = isEmpty(); int position = wasEmpty ? HEADER_LENGTH : wrapPosition(last.position + Element.HEADER_LENGTH + last.length); Element newLast = new Element(position, count); writeInt(buffer, 0, count); ringWrite(newLast.position, buffer, 0, Element.HEADER_LENGTH); ringWrite(newLast.position + Element.HEADER_LENGTH, data, offset, count); int firstPosition = wasEmpty ? newLast.position : first.position; writeHeader(fileLength, elementCount + 1, firstPosition, newLast.position); last = newLast; elementCount++; if (wasEmpty) first = last; }

Target:
public synchronized void add(byte[] data, int offset, int count) throws IOException { if (data == null) { throw new NullPointerException("data == null"); } if ((offset | count) < 0 || count > data.length - offset) { throw new IndexOutOfBoundsException(); } expandIfNecessary(count); boolean wasEmpty = isEmpty(); int position = wasEmpty ? HEADER_LENGTH : wrapPosition(last.position + Element.HEADER_LENGTH + last.length); Element newLast = new Element(position, count); writeInt(buffer, 0, count); ringWrite(newLast.position, buffer, 0, Element.HEADER_LENGTH); ringWrite(newLast.position + Element.HEADER_LENGTH, data, offset, count); int firstPosition = wasEmpty ? newLast.position : first.position; writeHeader(fileLength, elementCount + 1, firstPosition, newLast.position); last = newLast; elementCount++; if (wasEmpty) first = last; }
Source:
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (bean instanceof ClientResources) { ClientResources cr = (ClientResources) bean; if (cr.tracing() == null) { return cr.mutate().tracing(BraveTracing.create(this.tracing)).build(); } } return bean; }

Target:
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (bean instanceof ClientResources) { ClientResources cr = (ClientResources) bean; if (!cr.tracing().isEnabled()) { if (log.isDebugEnabled()) { log.debug( "Lettuce ClientResources bean is auto-configured to enable tracing."); } return cr.mutate().tracing(BraveTracing.create(this.tracing)).build(); } if (log.isDebugEnabled()) { log.debug( "Lettuce ClientResources bean is skipped for auto-configuration because tracing was already enabled."); } } return bean; }
Source:
public void testContrib() throws Exception { deployContrib("org.nuxeo.ecm.core.api.tests", "OSGI-INF/test-pathsegment-contrib.xml"); applyInlineDeployments(); PathSegmentService service = Framework.getService(PathSegmentService.class); assertNotNull(service); DocumentModel doc = DocumentModelProxy.newDocumentModel("My Document"); assertEquals("my-document", service.generatePathSegment(doc)); }

Target:
public void testContrib() throws Exception { pushInlineDeployments("org.nuxeo.ecm.core.api.tests:OSGI-INF/test-pathsegment-contrib.xml"); PathSegmentService service = Framework.getService(PathSegmentService.class); assertNotNull(service); DocumentModel doc = DocumentModelProxy.newDocumentModel("My Document"); assertEquals("my-document", service.generatePathSegment(doc)); }
Source:
@Override protected void cleanup() { _agsPub.watch(null); TargetSelection.deafTo(getContextTargetObsComp(), selectionListener); getDataObject().removePropertyChangeListener(TargetObsComp.TARGET_ENV_PROP, primaryButtonUpdater); getDataObject().removePropertyChangeListener(TargetObsComp.TARGET_ENV_PROP, guidingPanelUpdater); super.cleanup(); }

Target:
@Override protected void cleanup() { _agsPub.unwatch(); TargetSelection.deafTo(getContextTargetObsComp(), selectionListener); getDataObject().removePropertyChangeListener(TargetObsComp.TARGET_ENV_PROP, primaryButtonUpdater); getDataObject().removePropertyChangeListener(TargetObsComp.TARGET_ENV_PROP, guidingPanelUpdater); super.cleanup(); }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mSceneView= findViewById(R.id.sceneView); Portal portal = new Portal(getResources().getString(R.string.portal_url), false); PortalItem portalItem = new PortalItem(portal, "a13c3c3540144967bc933cb5e498b8e4"); ArcGISScene scene = new ArcGISScene(portalItem); mSceneView.setScene(scene); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mSceneView= findViewById(R.id.sceneView); Portal portal = new Portal(getResources().getString(R.string.portal_url), false); PortalItem portalItem = new PortalItem(portal, getString(R.string.item_id)); ArcGISScene scene = new ArcGISScene(portalItem); mSceneView.setScene(scene); }
Source:
public static String mapToApi(FeedScopedId arg) { if (arg == null) { return null; } return arg.getFeedId() + ":" + arg.getId(); }

Target:
public static String mapToApi(FeedScopedId arg) { if (arg == null) { return null; } return arg.getFeedId() + SEPARATOR + arg.getId(); }
Source:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_search_history, container, false); ButterKnife.bind(this, rootView); recentSearches = recentSearchesDao.recentSearches(10); recent_searches_delete_button.setOnClickListener(v -> { new AlertDialog.Builder(getContext()) .setMessage(getString(R.string.delete_recent_searches_dialog)) .setPositiveButton(android.R.string.yes, (dialog, which) -> { recentSearchesDao.deleteAll(recentSearches); Toast.makeText(getContext(),getString(R.string.search_history_deleted),Toast.LENGTH_SHORT).show(); recentSearches = recentSearchesDao.recentSearches(10); adapter = new ArrayAdapter<String>(getContext(),R.layout.item_recent_searches, recentSearches); recentSearchesList.setAdapter(adapter); adapter.notifyDataSetChanged(); dialog.dismiss(); }) .setNegativeButton(android.R.string.no, null) .create() .show(); }); currentThemeIsDark = PreferenceManager.getDefaultSharedPreferences(getContext()).getBoolean("theme", false); if (currentThemeIsDark) { adapter = new ArrayAdapter<String>(getContext(), R.layout.item_recent_searches_dark_theme, recentSearches); } else { adapter = new ArrayAdapter<String>(getContext(), R.layout.item_recent_searches, recentSearches); } recentSearchesList.setAdapter(adapter); recentSearchesList.setOnItemClickListener((parent, view, position, id) -> ( (SearchActivity)getContext()).updateText(recentSearches.get(position))); adapter.notifyDataSetChanged(); return rootView; }

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.inflate(R.layout.fragment_search_history, container, false); ButterKnife.bind(this, rootView); recentSearches = recentSearchesDao.recentSearches(10); if(recentSearches.isEmpty()) { recent_searches_delete_button.setVisibility(View.GONE); recent_searches_text_view.setText(R.string.no_recent_searches); } recent_searches_delete_button.setOnClickListener(v -> { new AlertDialog.Builder(getContext()) .setMessage(getString(R.string.delete_recent_searches_dialog)) .setPositiveButton(android.R.string.yes, (dialog, which) -> { recentSearchesDao.deleteAll(recentSearches); recent_searches_delete_button.setVisibility(View.GONE); recent_searches_text_view.setText(R.string.no_recent_searches); Toast.makeText(getContext(),getString(R.string.search_history_deleted),Toast.LENGTH_SHORT).show(); recentSearches = recentSearchesDao.recentSearches(10); adapter = new ArrayAdapter<String>(getContext(),R.layout.item_recent_searches, recentSearches); recentSearchesList.setAdapter(adapter); adapter.notifyDataSetChanged(); dialog.dismiss(); }) .setNegativeButton(android.R.string.no, null) .create() .show(); }); currentThemeIsDark = PreferenceManager.getDefaultSharedPreferences(getContext()).getBoolean("theme", false); setAdapterForThemes(getContext(), currentThemeIsDark); recentSearchesList.setAdapter(adapter); recentSearchesList.setOnItemClickListener((parent, view, position, id) -> ( (SearchActivity)getContext()).updateText(recentSearches.get(position))); adapter.notifyDataSetChanged(); return rootView; }
Source:
public static boolean isLocalVariableDef(DetailAST node) { boolean localVariableDef = false; if (TokenUtil.isOfType(node, TokenTypes.VARIABLE_DEF)) { final DetailAST parent = node.getParent(); localVariableDef = TokenUtil.isOfType(parent, TokenTypes.SLIST, TokenTypes.FOR_INIT, TokenTypes.FOR_EACH_CLAUSE); } if (TokenUtil.isOfType(node, TokenTypes.PARAMETER_DEF)) { final DetailAST parent = node.getParent(); localVariableDef = TokenUtil.isOfType(parent.getType(), TokenTypes.LITERAL_CATCH); } if (TokenUtil.isOfType(node, TokenTypes.RESOURCE)) { localVariableDef = true; } return localVariableDef; }

Target:
public static boolean isLocalVariableDef(DetailAST node) { boolean localVariableDef = false; if (node.getType() == TokenTypes.VARIABLE_DEF) { final DetailAST parent = node.getParent(); localVariableDef = TokenUtil.isOfType(parent, TokenTypes.SLIST, TokenTypes.FOR_INIT, TokenTypes.FOR_EACH_CLAUSE); } if (node.getType() == TokenTypes.PARAMETER_DEF) { final DetailAST parent = node.getParent(); localVariableDef = parent.getType() == TokenTypes.LITERAL_CATCH; } if (node.getType() == TokenTypes.RESOURCE) { localVariableDef = true; } return localVariableDef; }
Source:
public static String printParameterSummary(final PlottingDetails pdp) { final StringBuilder sb = new StringBuilder(); sb.append("Output:\n<LI>Spectra "); switch (pdp.getPlotLimits()) { case AUTO: sb.append("autoscaled."); break; default: sb.append("plotted over range " + pdp.getPlotWaveL()*1000 + " - " + pdp.getPlotWaveU()*1000); } sb.append("\n"); return sb.toString(); }

Target:
public static String printParameterSummary(final PlottingDetails pdp) { final StringBuilder sb = new StringBuilder(); sb.append("Output:\n<LI>Spectra "); switch (pdp.getPlotLimits()) { case AUTO: sb.append("autoscaled."); break; case USER: sb.append("plotted over range " + pdp.getPlotWaveL()*1000 + " - " + pdp.getPlotWaveU()*1000); default: throw new Error(); } sb.append("\n"); return sb.toString(); }