auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void createTables(Map<TableReference, byte[]> tableRefToTableMetadata) { if (tableRefToTableMetadata.isEmpty()) { return; } if (tableRefToTableMetadata.size() == 1) { Entry<TableReference, byte[]> element = Iterables.getOnlyElement(tableRefToTableMetadata.entrySet()); createTable(element.getKey(), element.getValue()); return; } for (TableReference tableRef : tableRefToTableMetadata.keySet()) { sanityCheckTableName(tableRef); } tableRefToTableMetadata.entrySet().forEach(entry -> sanityCheckTableMetadata(entry.getKey(), entry.getValue())); delegate.createTables(tableRefToTableMetadata); }

Target:
public void createTables(Map<TableReference, byte[]> tableRefToTableMetadata) { if (tableRefToTableMetadata.isEmpty()) { return; } if (tableRefToTableMetadata.size() == 1) { Entry<TableReference, byte[]> element = Iterables.getOnlyElement(tableRefToTableMetadata.entrySet()); createTable(element.getKey(), element.getValue()); return; } tableRefToTableMetadata.keySet().forEach(ValidatingQueryRewritingKeyValueService::sanityCheckTableName); tableRefToTableMetadata.entrySet().forEach(entry -> sanityCheckTableMetadata(entry.getKey(), entry.getValue())); delegate.createTables(tableRefToTableMetadata); }
Source:
private CapabilityCollection loadAllCapabilities() { final List<AccessSection> allCapabilities = new ArrayList<AccessSection>(); ProjectState s = this; do { final AccessSection capabilitiesSection = s.getConfig().getAccessSection(AccessSection.GLOBAL_CAPABILITIES); if (capabilitiesSection != null) { allCapabilities.add(capabilitiesSection); } Project.NameKey parent = s.getProject().getParent(); final Set<Project.NameKey> seen = new HashSet<Project.NameKey>(); seen.add(getProject().getNameKey()); if (parent == null || !seen.add(parent)) { if (s.isAllProjects) { break; } else { parent = allProjectsName; } allCapabilities.add(projectCache.getAllProjects().getConfig() .getAccessSection(AccessSection.GLOBAL_CAPABILITIES)); break; } s = projectCache.get(parent); } while (s != null); return new CapabilityCollection(allCapabilities); }

Target:
private CapabilityCollection loadAllCapabilities() { final List<AccessSection> allCapabilities = new ArrayList<AccessSection>(); ProjectState s = this; final Set<Project.NameKey> seen = new HashSet<Project.NameKey>(); do { final AccessSection capabilitiesSection = s.getConfig().getAccessSection(AccessSection.GLOBAL_CAPABILITIES); if (capabilitiesSection != null) { allCapabilities.add(capabilitiesSection); } if (s.isAllProjects) { break; } final Project.NameKey parent = s.getProject().getParent(); seen.add(getProject().getNameKey()); if (!seen.add(parent)) { break; } s = projectCache.get(parent); } while (s != null); return new CapabilityCollection(allCapabilities); }
Source:
public QuietPeriodIndicator(@NonNull Registry registry, @NonNull QuietPeriodIndicatorConfigurationProperties config) { this.registry = registry; long startEpochMillis = parseIso(config.getStartIso()); long endEpochMillis = parseIso(config.getEndIso()); this.startEpochMillis = startEpochMillis; this.endEpochMillis = endEpochMillis; this.suppressedTriggerTypes = config.getSuppressedTriggerTypes(); this.enabled = config.isEnabled() && (startEpochMillis > 0 && endEpochMillis > 0); if (this.enabled) { log.info("Enabling quiet periods. Span in millis: to {}, ISO to (inclusive)", startEpochMillis, endEpochMillis, config.getStartIso(), config.getEndIso()); log.info("Will suppress triggers of types during quiet periods.", config.getSuppressedTriggerTypes()); } else { log.info("Not enabling quiet periods."); } PolledMeter.using(registry).withName("quietPeriod.enabled").monitorValue(this, QuietPeriodIndicator::gaugeMonitor); quietPeriodTestId = registry.createId("quietPeriod.tests"); }

Target:
public QuietPeriodIndicator(@NonNull Registry registry, @NonNull QuietPeriodIndicatorConfigurationProperties config) { this.registry = registry; long startEpochMillis = parseIso(config.getStartIso()); long endEpochMillis = parseIso(config.getEndIso()); this.startEpochMillis = startEpochMillis; this.endEpochMillis = endEpochMillis; this.suppressedTriggerTypes = config.getSuppressedTriggerTypes(); this.enabled = config.isEnabled() && (startEpochMillis > 0 && endEpochMillis > 0); if (this.enabled) { log.warn("Enabling quiet periods. Span in millis: to {}, ISO to (inclusive)", startEpochMillis, endEpochMillis, config.getStartIso(), config.getEndIso()); log.warn("Will suppress triggers of types during quiet periods.", config.getSuppressedTriggerTypes()); } PolledMeter.using(registry).withName("quietPeriod.enabled").monitorValue(this, QuietPeriodIndicator::gaugeMonitor); quietPeriodTestId = registry.createId("quietPeriod.tests"); }
Source:
public void executeOrFail(DependencyCarrier dependencies, PlannerContext plannerContext, RowConsumer consumer, Row parameters, SubQueryResults subQueryResults) { if (analysis.tables().isEmpty()) { consumer.accept(InMemoryBatchIterator.empty(SENTINEL), null); return; } Function<? super Symbol, Object> eval = x -> SymbolEvaluator.evaluate( plannerContext.transactionContext(), plannerContext.functions(), x, parameters, subQueryResults ); ArrayList<String> toRefresh = new ArrayList<>(); for (Map.Entry<Table<Symbol>, DocTableInfo> table : analysis.tables().entrySet()) { var tableInfo = table.getValue(); var tableSymbol = table.getKey(); if (tableSymbol.partitionProperties().isEmpty()) { toRefresh.addAll(Arrays.asList(tableInfo.concreteOpenIndices())); } else { var partitionName = toPartitionName( tableInfo, tableSymbol.partitionProperties().stream().map(p -> p.map(eval)).collect(toList())); if (!tableInfo.partitions().contains(partitionName)) { throw new PartitionUnknownException(partitionName); } toRefresh.add(partitionName.asIndexName()); } } RefreshRequest request = new RefreshRequest(toRefresh.toArray(String[]::new)); request.indicesOptions(IndicesOptions.lenientExpandOpen()); var transportRefreshAction = dependencies.transportActionProvider().transportRefreshAction(); transportRefreshAction.execute( request, new OneRowActionListener<>( consumer, response -> new Row1(toRefresh.isEmpty() ? -1L : (long) toRefresh.size()) ) ); }

Target:
public void executeOrFail(DependencyCarrier dependencies, PlannerContext plannerContext, RowConsumer consumer, Row parameters, SubQueryResults subQueryResults) { if (analysis.tables().isEmpty()) { consumer.accept(InMemoryBatchIterator.empty(SENTINEL), null); return; } Function<? super Symbol, Object> eval = x -> SymbolEvaluator.evaluate( plannerContext.transactionContext(), plannerContext.functions(), x, parameters, subQueryResults ); ArrayList<String> toRefresh = new ArrayList<>(); for (Map.Entry<Table<Symbol>, DocTableInfo> table : analysis.tables().entrySet()) { var tableInfo = table.getValue(); var tableSymbol = table.getKey(); if (tableSymbol.partitionProperties().isEmpty()) { toRefresh.addAll(Arrays.asList(tableInfo.concreteOpenIndices())); } else { var partitionName = toPartitionName( tableInfo, Lists2.map(tableSymbol.partitionProperties(), p -> p.map(eval))); if (!tableInfo.partitions().contains(partitionName)) { throw new PartitionUnknownException(partitionName); } toRefresh.add(partitionName.asIndexName()); } } RefreshRequest request = new RefreshRequest(toRefresh.toArray(String[]::new)); request.indicesOptions(IndicesOptions.lenientExpandOpen()); var transportRefreshAction = dependencies.transportActionProvider().transportRefreshAction(); transportRefreshAction.execute( request, new OneRowActionListener<>( consumer, response -> new Row1(toRefresh.isEmpty() ? -1L : (long) toRefresh.size()) ) ); }
Source:
private IStatus runWait(IProgressMonitor monitor) { boolean allStarted = false; long startTime = System.currentTimeMillis(); long endTime = startTime + maxWait; IModule[] modules = server.getModules(); monitor.beginTask("Checking module states for " + server.getName(), maxWait * 1000); while( !allStarted && System.currentTimeMillis() < endTime) { allStarted = true; long thisLoopStart = System.currentTimeMillis(); for( int i = 0; i < modules.length; i++ ) { IModule[] temp = new IModule[]{modules[i]}; int state = getModuleState(temp, new SubProgressMonitor(monitor, 1000)); ((Server)server).setModuleState(temp, state); boolean started = state == IServer.STATE_STARTED; allStarted = allStarted && started; ((Server)server).setModuleState(temp, state); } try { Thread.sleep(500); } catch(InterruptedException ie) { } long timeDif = System.currentTimeMillis() - thisLoopStart; monitor.worked((int)timeDif - (modules.length * 100)); } return Status.OK_STATUS; }

Target:
private IStatus runWait(IProgressMonitor monitor) { boolean allStarted = false; long startTime = System.currentTimeMillis(); long endTime = startTime + maxWait; IModule[] modules = server.getModules(); monitor.beginTask("Checking module states for " + server.getName(), maxWait * 1000); while( !allStarted && System.currentTimeMillis() < endTime) { allStarted = true; long thisLoopStart = System.currentTimeMillis(); for( int i = 0; i < modules.length; i++ ) { IModule[] temp = new IModule[]{modules[i]}; int state = getModuleState(temp, new SubProgressMonitor(monitor, 1000)); boolean started = state == IServer.STATE_STARTED; allStarted = allStarted && started; ((Server)server).setModuleState(temp, state); } try { Thread.sleep(500); } catch(InterruptedException ie) { } long timeDif = System.currentTimeMillis() - thisLoopStart; monitor.worked((int)timeDif - (modules.length * 100)); } return Status.OK_STATUS; }
Source:
private void writeResource(Resource r) throws IOException { try { Map<String, Property> props = getProperties(r); int len = calcMaxLength(props.keySet()); boolean first = true; _ps.newLine(); writeValue(r); for ( Map.Entry<String, Property> entry : props.entrySet() ) { if ( first ) { first = false; } else { _ps.append(" ;"); } _ps.newLine(); writePropertyDecl(entry.getKey(), len); writePropertyValues(r, entry.getValue()); } _ps.append(" ."); _ps.newLine(); } catch (IOException e) { throw e; } catch (Throwable t) { throw new IOException("Unexpected exception while writting: " + r.getURI(), t); } }

Target:
private void writeResource(Resource r) throws IOException { Map<String, Property> props = getProperties(r); int len = calcMaxLength(props.keySet()); boolean first = true; bufferedWriter.newLine(); writeValue(r); for (Map.Entry<String, Property> entry : props.entrySet()) { if (first) { first = false; } else { bufferedWriter.append(" ;"); } bufferedWriter.newLine(); writePropertyDecl(entry.getKey(), len); writePropertyValues(r, entry.getValue()); } bufferedWriter.append(" ."); bufferedWriter.newLine(); }
Source:
public RuntimeCapabilityRegistration removeCapability(String capabilityName, CapabilityContext context, PathAddress registrationPoint) { try { writeLock.lock(); CapabilityId capabilityId = new CapabilityId(capabilityName, context); RuntimeCapabilityRegistration removed = null; RuntimeCapabilityRegistration candidate = capabilities.get(capabilityId); if (candidate != null) { RegistrationPoint rp = new RegistrationPoint(registrationPoint, null); if (candidate.removeRegistrationPoint(rp)) { if (candidate.getRegistrationPointCount() == 0) { removed = capabilities.remove(capabilityId); requirements.remove(capabilityId); runtimeOnlyRequirements.remove(capabilityId); } else { Map<String, RuntimeRequirementRegistration> candidateRequirements = requirements.get(capabilityId); if (candidateRequirements != null) { for (String req : candidateRequirements.keySet().toArray(new String[candidateRequirements.size()])) { removeRequirement(new RuntimeRequirementRegistration(req, capabilityName, context, rp), false); } } candidateRequirements = runtimeOnlyRequirements.get(capabilityId); if (candidateRequirements != null) { for (String req : candidateRequirements.keySet().toArray(new String[candidateRequirements.size()])) { removeRequirement(new RuntimeRequirementRegistration(req, capabilityName, context, rp), true); } } } } } if (removed != null) { modified = true; } return removed; } finally { writeLock.unlock(); } }

Target:
public RuntimeCapabilityRegistration removeCapability(String capabilityName, CapabilityContext context, PathAddress registrationPoint) { writeLock.lock(); try { CapabilityId capabilityId = new CapabilityId(capabilityName, context); RuntimeCapabilityRegistration removed = null; RuntimeCapabilityRegistration candidate = capabilities.get(capabilityId); if (candidate != null) { RegistrationPoint rp = new RegistrationPoint(registrationPoint, null); if (candidate.removeRegistrationPoint(rp)) { if (candidate.getRegistrationPointCount() == 0) { removed = capabilities.remove(capabilityId); requirements.remove(capabilityId); runtimeOnlyRequirements.remove(capabilityId); } else { Map<String, RuntimeRequirementRegistration> candidateRequirements = requirements.get(capabilityId); if (candidateRequirements != null) { for (String req : candidateRequirements.keySet().toArray(new String[candidateRequirements.size()])) { removeRequirement(new RuntimeRequirementRegistration(req, capabilityName, context, rp), false); } } candidateRequirements = runtimeOnlyRequirements.get(capabilityId); if (candidateRequirements != null) { for (String req : candidateRequirements.keySet().toArray(new String[candidateRequirements.size()])) { removeRequirement(new RuntimeRequirementRegistration(req, capabilityName, context, rp), true); } } } } } if (removed != null) { modified = true; } return removed; } finally { writeLock.unlock(); } }
Source:
public InMemoryClientRegistrationRepository(ClientRegistration... registrations) { this.registrations = toUnmodifiableMapByRegistrationId(Stream.of(checkEmptyRegistrations(registrations, Assert::notEmpty))); }

Target:
public InMemoryClientRegistrationRepository(ClientRegistration... registrations) { Assert.notEmpty(registrations, "registrations cannot be empty"); this.registrations = createClientRegistrationIdToClientRegistration(Arrays.asList(registrations)); }
Source:
private Condition parse(FunctionDef functionDef) throws ParseException { parseReturnSentence(); functionName = parseFunctionName(); functionName = functionName.substring(KIE_FUNCTIONS.length(), functionName.length()); Condition condition = new Condition(functionName); String param; String[] variableParam; boolean first = true; for (ParamDef paramDef : functionDef.getParams()) { if (first) { variableParam = parseVariableParam(); param = variableParam[0] + (variableParam[1] != null ? ("." + variableParam[1]) : ""); first = false; } else { parseParamDelimiter(); param = parseStringParameter(); } condition.addParam(param); } parseFunctionClose(); parseSentenceClose(); return condition; }

Target:
private Condition parse(FunctionDef functionDef) throws ParseException { parseReturnSentence(); functionName = parseFunctionName(); functionName = functionName.substring(KIE_FUNCTIONS.length()); parseFunctionOpen(); Condition condition = new Condition(functionName); String param; String[] variableParam; boolean first = true; for (ParamDef ignored : functionDef.getParams()) { if (first) { variableParam = parseVariableParam(); param = variableParam[0] + (variableParam[1] != null ? ("." + variableParam[1]) : ""); first = false; } else { parseParamDelimiter(); param = parseStringParameter(); } condition.addParam(param); } parseFunctionClose(); parseSentenceClose(); return condition; }
Source:
private String exportReport(final ExecResult execResult, final ReportExportFormat format) { notNull(execResult, "execResult"); notNull(format, "format"); final ObjectNode root = mapper.createObjectNode(); final ObjectNode child = mapper.createObjectNode(); child.put("result", execResult.getJsonNode()); child.put("format", format.name().toLowerCase()); root.put("result_req", child); try { return restTemplate.postForObject(EXPORTING_URI, root, UriResponse.class).getUri(); } catch (GoodDataException | RestClientException e) { throw new GoodDataException("Unable to export report", e); } }

Target:
private String exportReport(final ExecResult execResult, final ReportExportFormat format) { notNull(execResult, "execResult"); notNull(format, "format"); final ObjectNode root = mapper.createObjectNode(); final ObjectNode child = mapper.createObjectNode(); child.put("result", execResult.getJsonNode()); child.put("format", format.getValue()); root.put("result_req", child); try { return restTemplate.postForObject(EXPORTING_URI, root, UriResponse.class).getUri(); } catch (GoodDataException | RestClientException e) { throw new GoodDataException("Unable to export report", e); } }
Source:
public void testExecutableAttributes() throws Exception { FS fs = FS.DETECTED; org.junit.Assume.assumeTrue(fs.getClass().equals(FS_POSIX_Java7.class)); File f = new File(trash, "bla"); assertTrue(f.createNewFile()); assertFalse(fs.canExecute(f)); String umask = readUmask(); if (umask == null) { return; } char others = umask.charAt(umask.length() - 1); boolean badUmask; if (others != '0' && others != '2' && others != '4' && others != '6') { badUmask = true; } else { badUmask = false; } Set<PosixFilePermission> permissions = readPermissions(f); assertTrue(!permissions.contains(PosixFilePermission.OTHERS_EXECUTE)); assertTrue(!permissions.contains(PosixFilePermission.GROUP_EXECUTE)); assertTrue(!permissions.contains(PosixFilePermission.OWNER_EXECUTE)); fs.setExecute(f, true); permissions = readPermissions(f); assertTrue("'owner' execute permission not set", permissions.contains(PosixFilePermission.OWNER_EXECUTE)); assertTrue("'group' execute permission not set", permissions.contains(PosixFilePermission.GROUP_EXECUTE)); if (badUmask) { assertFalse("'others' execute permission set", permissions.contains(PosixFilePermission.OTHERS_EXECUTE)); fail("Unexpected umask during test execution: " + umask); } else { assertTrue("'others' execute permission not set", permissions.contains(PosixFilePermission.OTHERS_EXECUTE)); } }

Target:
public void testExecutableAttributes() throws Exception { FS fs = FS.DETECTED; assumeTrue(fs instanceof FS_POSIX_Java7); File f = new File(trash, "bla"); assertTrue(f.createNewFile()); assertFalse(fs.canExecute(f)); String umask = readUmask(); org.junit.Assume.assumeNotNull(umask); char others = umask.charAt(umask.length() - 1); boolean badUmask; if (others != '0' && others != '2' && others != '4' && others != '6') { badUmask = true; } else { badUmask = false; } Set<PosixFilePermission> permissions = readPermissions(f); assertTrue(!permissions.contains(PosixFilePermission.OTHERS_EXECUTE)); assertTrue(!permissions.contains(PosixFilePermission.GROUP_EXECUTE)); assertTrue(!permissions.contains(PosixFilePermission.OWNER_EXECUTE)); fs.setExecute(f, true); permissions = readPermissions(f); assertTrue("'owner' execute permission not set", permissions.contains(PosixFilePermission.OWNER_EXECUTE)); assertTrue("'group' execute permission not set", permissions.contains(PosixFilePermission.GROUP_EXECUTE)); if (badUmask) { assertFalse("'others' execute permission set", permissions.contains(PosixFilePermission.OTHERS_EXECUTE)); System.err.println("WARNING: your system's umask: \"" + umask + "\" doesn't allow FSJava7Test to test if setting posix" + " permissions for \"others\" works properly"); assumeFalse(badUmask); } else { assertTrue("'others' execute permission not set", permissions.contains(PosixFilePermission.OTHERS_EXECUTE)); } }
Source:
public List<Class> getSupportedTypes() { return new ArrayList<>(Arrays.asList(Period.class)); }

Target:
public List<Class> getSupportedTypes() { return Collections.singletonList(Period.class); }
Source:
public static void init() { final SpongePlayerDataHandler handlerInstance = Holder.INSTANCE; if (!Sponge.isServerAvailable() || handlerInstance.hasInitialized) { return; } final Path filePath = DimensionManager.getCurrentSavesDirectory().get().resolve("data").resolve (SPONGE_DATA); try { handlerInstance.playerDir = filePath; Files.createDirectories(handlerInstance.playerDir); final List<Path> playerFiles = new ArrayList<>(); try (DirectoryStream<Path> stream = Files.newDirectoryStream(filePath, "*.{dat}")) { for (Path entry : stream) { playerFiles.add(entry); } } catch (DirectoryIteratorException e) { SpongeImpl.getLogger().error("Something happened when trying to gather all player files", e); } for (Path playerFile : playerFiles) { File actualFile = playerFile.toFile(); if (actualFile.exists() && actualFile.isFile()) { FileInputStream stream = new FileInputStream(actualFile); NBTTagCompound compound = CompressedStreamTools.readCompressed(stream); stream.close(); DataContainer container = NbtTranslator.getInstance().translateFrom(compound); SpongePlayerData data = container.getSerializable(DataQuery.of(), SpongePlayerData.class).get(); handlerInstance.playerDataMap.put(data.uuid, data); } } playerFiles.clear(); } catch (FileAlreadyExistsException e) { SpongeImpl.getLogger().error("Someone went and created a file for the desired path: {}", filePath); } catch (Exception e) { e.printStackTrace(); } handlerInstance.hasInitialized = true; }

Target:
public static void init() { final SpongePlayerDataHandler handlerInstance = Holder.INSTANCE; if (!Sponge.isServerAvailable() || handlerInstance.hasInitialized) { return; } handlerInstance.playerDataMap = new ConcurrentHashMap<>(); final Path filePath = DimensionManager.getCurrentSavesDirectory().get().resolve("data").resolve (SPONGE_DATA); try { handlerInstance.playerDir = filePath; Files.createDirectories(handlerInstance.playerDir); final List<Path> playerFiles = new ArrayList<>(); try (DirectoryStream<Path> stream = Files.newDirectoryStream(filePath, "*.{dat}")) { for (Path entry : stream) { playerFiles.add(entry); } } catch (DirectoryIteratorException e) { SpongeImpl.getLogger().error("Something happened when trying to gather all player files", e); } for (Path playerFile : playerFiles) { if (Files.isReadable(playerFile)) { NBTTagCompound compound; try (final InputStream stream = Files.newInputStream(playerFile)) { compound = CompressedStreamTools.readCompressed(stream); } if (compound == null) { throw new RuntimeException("Failed to decompress player data within [" + playerFile + "]!"); } DataContainer container = NbtTranslator.getInstance().translateFrom(compound); SpongePlayerData data = container.getSerializable(DataQuery.of(), SpongePlayerData.class).get(); handlerInstance.playerDataMap.put(data.uuid, data); } } playerFiles.clear(); } catch (FileAlreadyExistsException e) { SpongeImpl.getLogger().error("Someone went and created a file for the desired path: {}", filePath); } catch (Exception e) { e.printStackTrace(); } handlerInstance.hasInitialized = true; }
Source:
public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); final News news = Parcels.unwrap(getActivity().getIntent().getParcelableExtra(Constants.NEWS)); setUpFAB(view, news); this.newsDetail = (RecyclerView) view.findViewById(R.id.news_detail); this.newsDetail.setHasFixedSize(true); LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity()); layoutManager.setOrientation(LinearLayoutManager.VERTICAL); this.newsDetail.setLayoutManager(layoutManager); this.newsDetail.setAdapter(new NewsDetailAdapter(this, news)); RecyclerView.ItemDecoration itemDecoration = new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST); this.newsDetail.addItemDecoration(itemDecoration); }

Target:
public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); News news = Parcels.unwrap(getActivity().getIntent().getParcelableExtra(Constants.NEWS)); setUpFAB(view, news); this.newsDetail = (RecyclerView) view.findViewById(R.id.news_detail); this.newsDetail.setHasFixedSize(true); LinearLayoutManager layoutManager = new LinearLayoutManager(getActivity()); layoutManager.setOrientation(LinearLayoutManager.VERTICAL); this.newsDetail.setLayoutManager(layoutManager); this.newsDetail.setAdapter(new NewsDetailAdapter(this, news)); RecyclerView.ItemDecoration itemDecoration = new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST); this.newsDetail.addItemDecoration(itemDecoration); }
Source:
private void fillActions(WorkflowInstance instance, boolean includeStateVariables, Long requestedMaxActions) { long maxActions = getMaxActions(requestedMaxActions); String sql = sqlVariants .limit("select nflow_workflow_action.* from nflow_workflow_action where workflow_id = ? order by id desc", maxActions); List<WorkflowInstanceAction.Builder> actionBuilders = jdbc.query(sql, new WorkflowInstanceActionRowMapper(sqlVariants), instance.id); if (includeStateVariables) { Map<Long, Map<String, String>> actionStates = fetchActionStateVariables(instance, actionBuilders.size(), maxActions); actionBuilders.forEach(builder -> { Map<String, String> actionState = actionStates.get(builder.getId()); if (actionState != null) { builder.setUpdatedStateVariables(actionState); } }); } instance.actions.addAll(actionBuilders.stream().map(WorkflowInstanceAction.Builder::build).collect(toList())); }

Target:
private void fillActions(WorkflowInstance instance, boolean includeStateVariables, Long requestedMaxActions) { long maxActions = getMaxActions(requestedMaxActions); String sql = sqlVariants .limit("select nflow_workflow_action.* from nflow_workflow_action where workflow_id = ? order by id desc", maxActions); List<WorkflowInstanceAction.Builder> actionBuilders = jdbc.query(sql, new WorkflowInstanceActionRowMapper(sqlVariants), instance.id); if (includeStateVariables) { Map<Long, Map<String, String>> actionStates = fetchActionStateVariables(instance, actionBuilders.size(), maxActions); actionBuilders.forEach(builder -> { Map<String, String> actionState = actionStates.get(builder.getId()); if (actionState != null) { builder.setUpdatedStateVariables(actionState); } }); } actionBuilders.stream().map(WorkflowInstanceAction.Builder::build).forEach(instance.actions::add); }
Source:
public boolean isRecurring() { return period == null && cronExpression == null ? false : true; }

Target:
public boolean isRecurring() { return period != null || cronExpression != null; }
Source:
public static HealthCheckRegistry getHealthCheckRegistry() { if(healthCheckRegistry == null) { healthCheckRegistry = CrudCheckConfiguration.createHealthCheckRegistry(); } return healthCheckRegistry; }

Target:
public static HealthCheckRegistry getHealthCheckRegistry() { if(healthCheckRegistry == null) { healthCheckRegistry = createHealthCheckRegistry(); } return healthCheckRegistry; }
Source:
public void removeThreadFilters(IExecutionDMContext[] threads) throws CoreException { synchronized (fFilteredThreadsByTarget) { if (threads != null && threads.length > 0) { IContainerDMContext target = DMContexts.getAncestorOfType(threads[0], IContainerDMContext.class); Set<IExecutionDMContext> set = fFilteredThreadsByTarget.get(target); if (set != null) { set.removeAll(Arrays.asList(threads)); if (set.isEmpty()) { fFilteredThreadsByTarget.remove(target); } } } } }

Target:
public void removeThreadFilters( IExecutionDMContext[] threads ) throws CoreException { if ( threads != null && threads.length > 0 ) { IContainerDMContext target = DMContexts.getAncestorOfType(threads[0], IContainerDMContext.class); Set<IExecutionDMContext> set = fFilteredThreadsByTarget.get( target ); if ( set != null ) { set.removeAll( Arrays.asList( threads ) ); if ( set.isEmpty() ) { fFilteredThreadsByTarget.remove( target ); } } } }
Source:
public void reset(ExtSed sed, boolean dataMayChange) { boolean fixed; try { fixed = this.getVisualizerPreferences() .getSelectedSedPreferences().getPlotPreferences().getFixed(); } catch (NullPointerException ex) { fixed = this.getVisualizerPreferences().getPlotPreferences().getFixed(); } resetPlot(sed, fixed, dataMayChange); }

Target:
public void reset(ExtSed sed, boolean dataMayChange) { boolean fixed = this.getPlotPreferences(sed).getFixed(); resetPlot(sed, fixed, dataMayChange); }
Source:
Set<Status> ignoredStates() { return EnumSet.of( Status.REQUESTED, Status.CREATE_IN_PROGRESS, Status.UPDATE_IN_PROGRESS, Status.UPDATE_REQUESTED, Status.STOP_REQUESTED, Status.START_REQUESTED, Status.STOP_IN_PROGRESS, Status.START_IN_PROGRESS, Status.WAIT_FOR_SYNC, Status.MAINTENANCE_MODE_ENABLED, Status.EXTERNAL_DATABASE_CREATION_IN_PROGRESS, Status.BACKUP_IN_PROGRESS, Status.BACKUP_FAILED, Status.BACKUP_FINISHED, Status.RESTORE_IN_PROGRESS, Status.RESTORE_FAILED, Status.RESTORE_FINISHED ); }

Target:
Set<Status> ignoredStates() { return EnumSet.of( Status.REQUESTED, Status.CREATE_IN_PROGRESS, Status.UPDATE_IN_PROGRESS, Status.UPDATE_REQUESTED, Status.STOP_REQUESTED, Status.START_REQUESTED, Status.STOP_IN_PROGRESS, Status.START_IN_PROGRESS, Status.WAIT_FOR_SYNC, Status.MAINTENANCE_MODE_ENABLED, Status.EXTERNAL_DATABASE_CREATION_IN_PROGRESS, Status.BACKUP_IN_PROGRESS, Status.RESTORE_IN_PROGRESS ); }
Source:
public String getHostName() throws IOException, InterruptedException { String cachedHostName = this.cachedHostName; if(cachedHostName != null) return cachedHostName; VirtualChannel channel = getChannel(); if(channel==null) return null; for( String address : channel.call(new ListPossibleNames())) { try { InetAddress ia = InetAddress.getByName(address); if(!(ia instanceof Inet4Address)) { LOGGER.fine(address+" is not an IPv4 address"); continue; } if(!ComputerPinger.checkIsReachable(ia, 3)) { LOGGER.fine(address+" didn't respond to ping"); continue; } cachedHostName = ia.getCanonicalHostName(); this.cachedHostName = cachedHostName; return cachedHostName; } catch (IOException e) { LOGGER.log(Level.FINE, "Failed to parse "+address,e); } } cachedHostName = channel.call(new GetFallbackName()); this.cachedHostName = cachedHostName; return cachedHostName; }

Target:
public String getHostName() throws IOException, InterruptedException { if(hostNameCached) return cachedHostName; VirtualChannel channel = getChannel(); if(channel==null) return null; for( String address : channel.call(new ListPossibleNames())) { try { InetAddress ia = InetAddress.getByName(address); if(!(ia instanceof Inet4Address)) { LOGGER.fine(address+" is not an IPv4 address"); continue; } if(!ComputerPinger.checkIsReachable(ia, 3)) { LOGGER.fine(address+" didn't respond to ping"); continue; } cachedHostName = ia.getCanonicalHostName(); hostNameCached = true; return cachedHostName; } catch (IOException e) { LOGGER.log(Level.FINE, "Failed to parse "+address,e); } } cachedHostName = channel.call(new GetFallbackName()); hostNameCached = true; return cachedHostName; }
Source:
public void setExcludedPatterns(Collection<String> regularExpressions) { regularExpressions.forEach(regex -> excludeRegex(regex)); }

Target:
public void setExcludedPatterns(Collection<String> regularExpressions) { excludedPatterns.clear(); regularExpressions.forEach(regex -> excludeRegex(regex)); }
Source:
public void convertWorks() { WorkflowExecutor executor = new WorkflowExecutor(1, "host", 2, "executorGroup", now(), now().plusMinutes(1), now() .plusMinutes(15), now().plusSeconds(-7)); ListWorkflowExecutorResponse resp = converter.convert(executor); assertThat(resp.id, is(executor.id)); assertThat(resp.host, is(executor.host)); assertThat(resp.pid, is(executor.pid)); assertThat(resp.executorGroup, is(executor.executorGroup)); assertThat(resp.started, is(executor.started)); assertThat(resp.active, is(executor.active)); assertThat(resp.expires, is(executor.expires)); assertThat(resp.stopped, is(executor.stopped)); }

Target:
public void convertWorks() { WorkflowExecutor executor = new WorkflowExecutor(1, "host", 2, "executorGroup", now(), now().plusMinutes(1), now().plusMinutes(15), now().minusSeconds(7)); ListWorkflowExecutorResponse resp = converter.convert(executor); assertThat(resp.id, is(executor.id)); assertThat(resp.host, is(executor.host)); assertThat(resp.pid, is(executor.pid)); assertThat(resp.executorGroup, is(executor.executorGroup)); assertThat(resp.started, is(executor.started)); assertThat(resp.active, is(executor.active)); assertThat(resp.expires, is(executor.expires)); assertThat(resp.stopped, is(executor.stopped)); }
Source:
protected void onResume() { super.onResume(); Intent callingintent = getIntent(); Bundle extras = callingintent.getExtras(); extras.getString("message_type_id"); extras.getString("message"); String myString = extras.getString("extrasString"); Log.e("EXTRAS", extras.toString()); final IntentFilter filter = new IntentFilter("com.google.android.c2dm.intent.RECEIVE"); filter.addCategory("com.example.gcm"); filter.setPriority(1); registerReceiver(dynamicReceiver, filter, "com.google.android.c2dm.permission.SEND", null); }

Target:
protected void onResume() { super.onResume(); final IntentFilter filter = new IntentFilter("com.google.android.c2dm.intent.RECEIVE"); filter.addCategory("com.example.gcm"); filter.setPriority(1); registerReceiver(dynamicReceiver, filter, "com.google.android.c2dm.permission.SEND", null); }
Source:
private void applyDiff(MapDiff<? extends K, ? extends V> diff, Map<K, V> map) { for (K name : diff.getRemovedKeys()) map.remove(name); for (K key : diff.getChangedKeys()) { map.put(key, diff.getNewValue(key)); } for (K key : diff.getAddedKeys()) { map.put(key, diff.getNewValue(key)); } }

Target:
private void applyDiff(MapDiff<? extends K, ? extends V> diff, Map<K, V> map) { for (K key : diff.getRemovedKeys()) { map.remove(key); } for (K key : diff.getChangedKeys()) { map.put(key, diff.getNewValue(key)); } for (K key : diff.getAddedKeys()) { map.put(key, diff.getNewValue(key)); } }
Source:
public final Object visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command) throws Throwable { wrapEntryIfNeeded(ctx, command); if (ctx.lookupEntry(command.getKey()) != null && ctx.lookupEntry(command.getKey()).getMetadata() instanceof L1Metadata) { log.tracef("Put with L1 metadata"); } return setSkipRemoteGetsAndInvokeNextForDataCommand(ctx, command); }

Target:
public final Object visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command) throws Throwable { wrapEntryIfNeeded(ctx, command); return setSkipRemoteGetsAndInvokeNextForDataCommand(ctx, command); }
Source:
Rescheduler rescheduler() { checkState(rescheduler != null, "Rescheduler is not initialized"); return rescheduler; }

Target:
private Rescheduler rescheduler() { checkState(rescheduler != null, "Rescheduler is not initialized"); return rescheduler; }
Source:
public void run() { if(isValid()) { if(getRunLocal() == false) { try{ ScpClient scpclient = new ScpClient(); serverfileName = fileName.substring(fileName.lastIndexOf('/')+1); tmpfileName="/tmp/"+ serverfileName; scpclient.transfer(fileName,tmpfileName); } catch (JSchException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } final String[] script = buildStandardScript(); final String[] envVars = getEnvironmentVariables(); if(continueRun) { Display.getDefault().asyncExec(new Runnable() { public void run() { final ScriptConsole console; if(getRunLocal() == false) { console = ScriptConsole.getInstance(serverfileName); console.run(script, envVars, new PasswordPrompt(IDESessionSettings.password), new StapErrorParser()); scriptConsoleInitialized(console); } else { console = ScriptConsole.getInstance(fileName); console.runLocally(script, envVars, new PasswordPrompt(IDESessionSettings.password), new StapErrorParser()); scriptConsoleInitialized(console); } } }); } } }

Target:
public void run() { if(isValid()) { if(getRunLocal() == false) { try{ ScpClient scpclient = new ScpClient(); serverfileName = fileName.substring(fileName.lastIndexOf('/')+1); tmpfileName="/tmp/"+ serverfileName; scpclient.transfer(fileName,tmpfileName); } catch (JSchException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } final String[] script = buildStandardScript(); final String[] envVars = getEnvironmentVariables(); if(continueRun) { Display.getDefault().asyncExec(new Runnable() { public void run() { final ScriptConsole console; if(getRunLocal() == false) { console = ScriptConsole.getInstance(serverfileName); console.run(script, envVars, new PasswordPrompt(IDESessionSettings.password), new StapErrorParser()); } else { console = ScriptConsole.getInstance(fileName); console.runLocally(script, envVars, new PasswordPrompt(IDESessionSettings.password), new StapErrorParser()); } scriptConsoleInitialized(console); } }); } } }
Source:
private String getArtifactText() throws NoOpenCoreException, SolrServerException{ String indexedText = KeywordSearch.getServer().getSolrContent(this.objectId, 1); if (indexedText == null || indexedText.isEmpty()) { return NbBundle.getMessage(ExtractedContentViewer.class, "ExtractedContentViewer.getSolrContent.noTxtYetMsg", "artifact"); } indexedText = EscapeUtil.escapeHtml(indexedText).trim(); StringBuilder sb = new StringBuilder(indexedText.length() + 20); sb.append("<pre>").append(indexedText).append("</pre>"); return sb.toString(); }

Target:
private String getArtifactText() throws NoOpenCoreException, SolrServerException { String indexedText = KeywordSearch.getServer().getSolrContent(this.objectId, 1); if (indexedText == null || indexedText.isEmpty()) { return Bundle.IndexedText_errorMessage_errorGettingText(); } indexedText = EscapeUtil.escapeHtml(indexedText).trim(); StringBuilder sb = new StringBuilder(indexedText.length() + 20); sb.append("<pre>").append(indexedText).append("</pre>"); return sb.toString(); }
Source:
public HttpResponse doRemoveJobFromView(@QueryParameter String name) throws IOException, ServletException { checkPermission(View.CONFIGURE); if(name==null) throw new Failure("Query parameter 'name' is required"); TopLevelItem item = resolveName(name); if (item==null) throw new Failure("Query parameter 'name' does not correspond to a known item"); if (remove(item)) owner.save(); return HttpResponses.ok(); }

Target:
public HttpResponse doRemoveJobFromView(@QueryParameter String name) throws IOException, ServletException { checkPermission(View.CONFIGURE); if(name==null) throw new Failure("Query parameter 'name' is required"); TopLevelItem item = resolveName(name); if (item==null) throw new Failure("Query parameter 'name' does not correspond to a known and readable item"); if (remove(item)) owner.save(); return HttpResponses.ok(); }
Source:
public void performAction() { boolean isSinglePanelViewNow = mainFrame.toggleSinglePanel(); if (isSinglePanelViewNow) { this.previousRatio = mainFrame.getSplitPane().getSplitRatio(); hideOtherPanel(); } else { mainFrame.getSplitPane().setSplitRatio(this.previousRatio); showOtherPanel(); } }

Target:
public void performAction() { boolean isSinglePanelViewNow = mainFrame.toggleSinglePanel(); if (isSinglePanelViewNow) { previousRatio = mainFrame.getSplitPane().getSplitRatio(); hideInactivePanel(); } else { mainFrame.getSplitPane().setSplitRatio(previousRatio); showInactivePanel(); } }
Source:
public void start() { if (timer != null) { throw new IllegalStateException("ServerChecker is already started"); } timer = new Timer("Server-" + serverRef + "-readiness-checker", true); timer.schedule(new ServerCheckingTask(), 0); }

Target:
public void start() { timer.schedule(new ServerCheckingTask(), 0); }
Source:
public void upload(File file, String objectId, String md5, final boolean redo) throws IOException { boolean flag = redo; for (int retry = 0; retry < retryNumber; retry++) try { if (flag) { startUpload(file, objectId, md5, flag); } else { resumeIfPossible(file, objectId, md5, retry == 0 ? true : false); } return; } catch (NotRetryableException e) { log.warn( "Upload was not completed successfully in the last execution. Checking data integrity. Please wait..."); flag = !storageService.isUploadDataRecoverable(objectId, file.length()); } }

Target:
public void upload(File file, String objectId, String md5, final boolean redo) throws IOException { boolean tryAgain = redo; for (int retry = 0; retry < retryNumber; retry++) try { if (tryAgain) { startUpload(file, objectId, md5, tryAgain); } else { resumeIfPossible(file, objectId, md5, retry == 0 ? true : false); } return; } catch (NotRetryableException e) { log.warn( "Upload was not completed successfully in the last execution. Checking data integrity. Please wait..."); tryAgain = !storageService.isUploadDataRecoverable(objectId, file.length()); } }
Source:
public IStatus transferSettings(IPath newWorkspaceRoot) { File srcFolder = new File(getOldPath().toOSString()); File destFolder = new File(getNewPath(newWorkspaceRoot).toOSString()); if (!destFolder.exists()) { destFolder.mkdirs(); } if (srcFolder.isDirectory()) { String[] files = srcFolder.list(); if (files == null) { files = new String[0]; } for (String file : files) { File srcFile = new File(srcFolder.getPath().toString(), file); File destFile = new File(destFolder.getPath().toString(), file); try { copyFiles(srcFile, destFile); } catch (IOException e) { return new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e.getMessage()); } } } return Status.OK_STATUS; }

Target:
public IStatus transferSettings(IPath newWorkspaceRoot) { File srcFolder = new File(getOldPath().toOSString()); File destFolder = new File(getNewPath(newWorkspaceRoot).toOSString()); if (!destFolder.exists()) { destFolder.mkdirs(); } if (srcFolder.isDirectory()) { String[] files = srcFolder.list(); if (files == null) { return new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, "Content from directory '" + srcFolder.getAbsolutePath() + "' can not be listed."); } for (String file : files) { File srcFile = new File(srcFolder.getPath().toString(), file); File destFile = new File(destFolder.getPath().toString(), file); try { copyFiles(srcFile, destFile); } catch (IOException e) { return new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, e.getMessage()); } } } return Status.OK_STATUS; }
Source:
public Response execute() throws IOException { SettableFuture<Response> future = SettableFuture.create(); enqueue(new Callback() { @Override public void onFailure(Call _call, IOException exception) { future.setException(exception); } @Override public void onResponse(Call _call, Response response) { if (!future.set(response) && response.body() != null) { response.body().close(); } } }); try { return future.get(); } catch (InterruptedException e) { getDelegate().cancel(); if (!future.setException(e)) { closeResponseBody(future); } Thread.currentThread().interrupt(); throw new InterruptedIOException("Call was interrupted during execution"); } catch (ExecutionException e) { getDelegate().cancel(); if (e.getCause() instanceof IoRemoteException) { RemoteException wrappedException = ((IoRemoteException) e.getCause()).getWrappedException(); RemoteException correctStackTrace = new RemoteException( wrappedException.getError(), wrappedException.getStatus()); correctStackTrace.initCause(e); throw correctStackTrace; } else if (e.getCause() instanceof IOException) { throw (IOException) e.getCause(); } else { throw new SafeIoException("Failed to execute call", e); } } }

Target:
public Response execute() throws IOException { SettableFuture<Response> future = SettableFuture.create(); enqueue(new Callback() { @Override public void onFailure(Call _call, IOException exception) { future.setException(exception); } @Override public void onResponse(Call _call, Response response) { future.set(response); } }); try { return future.get(); } catch (InterruptedException e) { getDelegate().cancel(); Futures.addCallback(future, ResponseClosingCallback.INSTANCE, MoreExecutors.directExecutor()); Thread.currentThread().interrupt(); throw new InterruptedIOException("Call cancelled via interruption"); } catch (ExecutionException e) { getDelegate().cancel(); if (e.getCause() instanceof IoRemoteException) { RemoteException wrappedException = ((IoRemoteException) e.getCause()).getWrappedException(); RemoteException correctStackTrace = new RemoteException( wrappedException.getError(), wrappedException.getStatus()); correctStackTrace.initCause(e); throw correctStackTrace; } else if (e.getCause() instanceof IoUnknownRemoteException) { UnknownRemoteException wrappedException = ((IoUnknownRemoteException) e.getCause()) .getUnknownRemoteException(); UnknownRemoteException correctStackTrace = new UnknownRemoteException( wrappedException.getStatus(), wrappedException.getBody()); correctStackTrace.initCause(e); throw correctStackTrace; } else if (e.getCause() instanceof IOException) { throw (IOException) e.getCause(); } else { throw new SafeIoException("Failed to execute call", e); } } }
Source:
public Optional<MatchmakerQueue> getMatchmakerQueue(String technicalName) { List<MatchmakerQueue> queue = getAll("/data/matchmakerQueue", ImmutableMap.of( "filter", rsql(qBuilder().string("technicalName").eq(technicalName)))); if (queue.isEmpty()) { return Optional.empty(); } return Optional.ofNullable(queue.get(0)); }

Target:
public Optional<MatchmakerQueue> getMatchmakerQueue(String technicalName) { List<MatchmakerQueue> queue = getAll("/data/matchmakerQueue", java.util.Map.of( INCLUDE, "leaderboard", FILTER, rsql(qBuilder().string("technicalName").eq(technicalName)))); if (queue.isEmpty()) { return Optional.empty(); } return Optional.ofNullable(queue.get(0)); }
Source:
public RequestMatcher value(String parameter, Matcher<Iterable<? extends String>> matchers) { return new AbstractFormDataRequestMatcher() { @Override protected void matchInternal(MultiValueMap<String, String> requestParams) { assertValueCount(parameter, requestParams, 1); List<String> values = requestParams.get(parameter); assertThat("Request parameter [" + parameter + "]", values, matchers); } }; }

Target:
public RequestMatcher value(String parameter, Matcher<Iterable<? extends String>> matchers) { return request -> { MultiValueMap<String, String> requestParams = FormDataRequestParser.requestParams(request); assertValueCount(parameter, requestParams, 1); List<String> values = requestParams.get(parameter); assertThat("Request parameter [" + parameter + "]", values, matchers); }; }
Source:
public Predicate<IResourceType> get() { if (this.currentPredicate == null) { return ReloadRequirements.all(); } return this.currentPredicate; }

Target:
public Predicate<IResourceType> get() { if (this.currentPredicate == null && false) { return ReloadRequirements.all(); } return this.currentPredicate; }
Source:
public String validate(String parameterValue) throws ValidationException { String uppercaseModel = model.toUpperCase(); try { if (uppercaseModel.startsWith(IntegerParserValidator.INTEGER_TYPE)) { new IntegerParserValidator(model).parseAndValidate(parameterValue); } else if (uppercaseModel.startsWith(LongParserValidator.LONG_TYPE)) { new LongParserValidator(model).parseAndValidate(parameterValue); } else if (uppercaseModel.startsWith(DoubleParserValidator.DOUBLE_TYPE)) { new DoubleParserValidator(model).parseAndValidate(parameterValue); } else if (uppercaseModel.startsWith(FloatParserValidator.FLOAT_TYPE)) { new FloatParserValidator(model).parseAndValidate(parameterValue); } else if (uppercaseModel.startsWith(ShortParserValidator.SHORT_TYPE)) { new ShortParserValidator(model).parseAndValidate(parameterValue); } else if (uppercaseModel.startsWith(BooleanParserValidator.BOOLEAN_TYPE)) { new BooleanParserValidator(model).parseAndValidate(parameterValue); } else if (uppercaseModel.startsWith(URLParserValidator.URL_TYPE)) { new URLParserValidator(model).parseAndValidate(parameterValue); } else if (uppercaseModel.startsWith(URIParserValidator.URI_TYPE)) { new URIParserValidator(model).parseAndValidate(parameterValue); } else if (uppercaseModel.startsWith(DateTimeParserValidator.DATETIME_TYPE)) { new DateTimeParserValidator(model).parseAndValidate(parameterValue); } else if (uppercaseModel.startsWith(ListParserValidator.LIST_TYPE)) { new ListParserValidator(model).parseAndValidate(parameterValue); } else if (uppercaseModel.startsWith(RegexpParserValidator.REGEXP_TYPE)) { new RegexpParserValidator(model).parseAndValidate(parameterValue); } else if (uppercaseModel.startsWith(ModelFromURLParserValidator.MODEL_FROM_URL_TYPE)) { new ModelFromURLParserValidator(model).parseAndValidate(parameterValue); } } catch (Exception e) { throw new ValidationException(e.getMessage(), e); } return parameterValue; }

Target:
public String validate(String parameterValue) throws ValidationException { try { ParserValidator validator = createParserValidator(); if (validator != null) { validator.parseAndValidate(parameterValue); } return parameterValue; } catch (Exception e) { throw new ValidationException(e.getMessage(), e); } }