auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected int doWork() { IOUtil.assertFileIsReadable(INPUT); IOUtil.assertFileIsWritable(OUTPUT); log.info("Checking to see if input file has been downsampled with this program before."); checkProgramRecords(); opticalDuplicateFinder = new PhysicalLocation(); log.info("Starting first pass. Examining read distribution in tiles."); fillTileMinMaxCoord(); log.info("First pass done."); log.info("Starting second pass. Outputting reads."); outputSamRecords(); log.info("Second pass done."); final double finalP = kept / (double) total; if (Math.abs(finalP - PROBABILITY) / (Math.min(finalP, PROBABILITY) + 1e-10) > .2) { log.warn(String.format("You've requested PROBABILITY=%g, the resulting downsampling resulted in a rate of %f.", PROBABILITY, finalP)); } log.info(String.format("Finished! Kept %d out of %d reads (P=%g).", kept, total, finalP)); return 0; }

Target:
protected int doWork() { IOUtil.assertFileIsReadable(INPUT); IOUtil.assertFileIsWritable(OUTPUT); log.info("Checking to see if input file has been downsampled with this program before."); checkProgramRecords(); opticalDuplicateFinder = new PhysicalLocation(); log.info("Starting first pass. Examining read distribution in tiles."); fillTileMinMaxCoord(); log.info("First pass done."); log.info("Starting second pass. Outputting reads."); outputSamRecords(); log.info("Second pass done."); final double finalP = kept / (double) total; if (Math.abs(finalP - FRACTION) / (Math.min(finalP, FRACTION) + 1e-10) > ACCEPTABLE_FUDGE_FACTOR) { log.warn(String.format("You've requested FRACTION=%g, the resulting downsampling resulted in a rate of %f.", FRACTION, finalP)); } log.info(String.format("Finished! Kept %d out of %d reads (P=%g).", kept, total, finalP)); return 0; }
Source:
public void beforeTestExecution(ExtensionContext extensionContext) { String displayName = extensionContext.getDisplayName(); getStore(extensionContext).put(extensionContext.getRequiredTestMethod(), System.currentTimeMillis()); String testName = ""; String fullyQualifiedTestName = ""; if (extensionContext.getTestMethod().isPresent()) { Method method = extensionContext.getTestMethod().get(); testName = method.getName(); fullyQualifiedTestName = method.getDeclaringClass().getName() + "." + testName; } if (!Objects.equals(displayName, testName)) { System.out.printf("Starting test %s (%s), ", fullyQualifiedTestName, displayName); } else { System.out.printf("Starting test %s, ", fullyQualifiedTestName); } }

Target:
public void beforeTestExecution(ExtensionContext extensionContext) { String displayName = extensionContext.getDisplayName(); String testName = ""; String fullyQualifiedTestName = ""; if (extensionContext.getTestMethod().isPresent()) { Method method = extensionContext.getTestMethod().get(); testName = method.getName(); fullyQualifiedTestName = method.getDeclaringClass().getName() + "." + testName; } StringBuilder logPrefixBuilder = new StringBuilder("Starting test ") .append(fullyQualifiedTestName); if (!Objects.equals(displayName, testName)) { logPrefixBuilder.append("(") .append(displayName) .append(")"); } logPrefixBuilder.append(","); getStore(extensionContext).put(extensionContext.getRequiredTestMethod(), new TestInformation(logPrefixBuilder.toString(), System.currentTimeMillis())); }
Source:
public Map getMap() { return map; }

Target:
public Map<String, Object> getMap() { return map; }
Source:
public static String getMvnVersion() { Properties prop = new Properties(); String version = null; try { prop.load(new FileInputStream("src/main/resources/config.properties")); version = prop.getProperty("mvnVersion"); } catch (IOException e) { } return version; }

Target:
public String getMvnVersion() { return mvnVersion; }
Source:
public TestkitResponse process( TestkitState testkitState ) { return Optional.ofNullable( testkitState.getTransactions().getOrDefault( data.txId, null ) ) .map( tx -> { tx.commit(); return transaction( data.txId ); } ) .orElseThrow( () -> new RuntimeException( "Could not find transaction" ) ); }

Target:
public TestkitResponse process( TestkitState testkitState ) { return Optional.ofNullable( testkitState.getTransactions().get( data.txId ) ) .map( tx -> { tx.commit(); return transaction( data.txId ); } ) .orElseThrow( () -> new RuntimeException( "Could not find transaction" ) ); }
Source:
public BoundedSSPIterator(SystemConsumer systemConsumer, SystemStreamPartition systemStreamPartition, String endOffset, SystemAdmin admin) { this.systemConsumer = systemConsumer; this.endOffset = endOffset; this.admin = admin; this.fetchSet = new HashSet<>(); this.fetchSet.add(systemStreamPartition); this.peeks = new ArrayDeque<>(); }

Target:
public BoundedSSPIterator(SystemConsumer systemConsumer, SystemStreamPartition systemStreamPartition, String endOffset, SystemAdmin admin) { this.systemConsumer = systemConsumer; this.endOffset = endOffset; this.admin = admin; this.fetchSet = ImmutableSet.of(systemStreamPartition); this.peeks = new ArrayDeque<>(); }
Source:
public void registerListener(Listener listener) { Method[] methods = listener.getClass().getMethods(); for (Method method : methods) { if (method.isAnnotationPresent(EventHandler.class)) { EventHandler handler = method.getAnnotation(EventHandler.class); Importance importance = handler.importance(); Class<?>[] params = method.getParameterTypes(); if (params.length == 1) { Class<?> clazz = params[0]; Class<?> c = clazz; boolean b = true; while (b) { if (!c.getSuperclass().equals(Object.class)) { c = c.getSuperclass(); } else { b = false; } } if (c.equals(Event.class)) { Class<? extends Event> eventType = clazz.asSubclass(Event.class); ManagerList listeners = ManagerList.getManagers().get(eventType); if (listeners == null) { listeners = new ManagerList(); ManagerList.getManagers().put(eventType, listeners); } RegisteredListener rl = new RegisteredListener(listener, importance, method); listeners.register(rl); } } else { throw new PluginLoadException("Listener " + method.getName() + " has " + (params.length == 0 ? "no parameters!" : "more than one parameter") + "!"); } } } }

Target:
public void registerListener(Listener listener) { Method[] methods = listener.getClass().getMethods(); for (Method method : methods) { if (method.isAnnotationPresent(EventHandler.class)) { EventHandler handler = method.getAnnotation(EventHandler.class); Importance importance = handler.importance(); Class<?>[] params = method.getParameterTypes(); if (params.length == 1) { Class<?> clazz = params[0]; Class<?> c = clazz; boolean b = true; while (b) { if (!c.getSuperclass().equals(Object.class)) { c = c.getSuperclass(); } else { b = false; } } if (c.equals(Event.class)) { Class<? extends Event> eventType = clazz.asSubclass(Event.class); ManagerList listeners = ManagerList.getManagers().get(eventType); if (listeners == null) { listeners = new ManagerList(); ManagerList.getManagers().put(eventType, listeners); } RegisteredListener rl = new RegisteredListener(listener, importance, method); listeners.register(rl); } } else { TridentLogger.getGlobal().warning("Listener " + method.getName() + " has " + (params.length == 0 ? "no parameters!" : "more than one parameter") + "!"); } } } }
Source:
public static Type toType(byte code) { for (Type type: Type.values()) { if(type.getCode() == code) { return type; } } throw new UnsupportedOperationException("Invalid message type code: " + code); }

Target:
public static Type toType(byte code) { for (Type type: Type.values()) { if(type.getCode() == code) { return type; } } throw new IllegalArgumentException("Invalid message type code: " + code); }
Source:
private ValidationResult validateForMacsInUse(List<VmNetworkInterface> vnics, MacPool macPool) { final List<String> macsInUse = vnics .stream() .map(VmNetworkInterface::getMacAddress) .filter(Objects::nonNull) .filter(macPool::isMacInUse) .collect(Collectors.toList()); final EngineMessage msg = EngineMessage.NETWORK_MAC_ADDRESS_IN_USE; return ValidationResult .failWith(msg, ReplacementUtils.getListVariableAssignmentString(msg, macsInUse)) .unless(macsInUse.isEmpty()); }

Target:
private ValidationResult validateForMacsInUse(List<VmNetworkInterface> vnics, MacPool macPool) { final List<String> macsInUse = vnics .stream() .map(VmNetworkInterface::getMacAddress) .filter(Objects::nonNull) .filter(macPool::isMacInUse) .collect(Collectors.toList()); final EngineMessage msg = EngineMessage.NETWORK_MAC_ADDRESS_IN_USE_DETAILED; return ValidationResult .failWith(msg, ReplacementUtils.getListVariableAssignmentString(msg, macsInUse)) .unless(macsInUse.isEmpty()); }
Source:
private String buildClosedLaborAccountsForDateRangeSQL(Map<String, Date> dateRange) { SimpleDateFormat formatter = new SimpleDateFormat("dd-MMM-yy", Locale.US); StringBuilder sqlBuilder = new StringBuilder("SELECT A.FIN_COA_CD AS ACCT_FIN_COA_CD, A.ACCOUNT_NBR AS ACCT_ACCOUNT_NBR, "); sqlBuilder.append("S.SUB_ACCT_NBR AS SUB_SUB_ACCT_NBR, A.ACCT_CLOSED_IND AS ACCT_ACCT_CLOSED_IND, X.ACCT_CLOSED_DT AS ACCTX_ACCT_CLOSED_DT "); sqlBuilder.append("FROM KFS.CA_ACCOUNT_T A "); sqlBuilder.append("LEFT JOIN KFS.CA_ACCOUNT_TX X ON A.FIN_COA_CD = X.FIN_COA_CD AND A.ACCOUNT_NBR = X.ACCOUNT_NBR "); sqlBuilder.append("LEFT JOIN KFS.CA_SUB_ACCT_T S ON A.FIN_COA_CD = S.FIN_COA_CD AND A.ACCOUNT_NBR = S.ACCOUNT_NBR "); sqlBuilder.append("WHERE A.FIN_COA_CD = X.FIN_COA_CD AND A.ACCOUNT_NBR = X.ACCOUNT_NBR AND A.FIN_COA_CD = 'IT' AND A.ACCT_CLOSED_IND = 'Y' "); sqlBuilder.append("AND X.ACCT_CLOSED_DT >= '").append(formatter.format(dateRange.get(CuCoaBatchConstants.ClosedLaborAccountsFileCreationConstants.FROM_DATE))).append("' "); sqlBuilder.append("AND X.ACCT_CLOSED_DT < '").append(formatter.format(dateRange.get(CuCoaBatchConstants.ClosedLaborAccountsFileCreationConstants.TO_DATE))).append("' "); LOG.info("buildClosedLaborAccountsForDateRangeSQL: SQL to be executed = " + sqlBuilder.toString()); return sqlBuilder.toString(); }

Target:
private String buildClosedLaborAccountsForDateRangeSQL(Map<String, Date> dateRange) { SimpleDateFormat formatter = new SimpleDateFormat(CUKFSConstants.DATE_FORMAT_dd_MMM_yy, Locale.US); StringBuilder sqlBuilder = new StringBuilder("SELECT A.FIN_COA_CD AS ACCT_FIN_COA_CD, A.ACCOUNT_NBR AS ACCT_ACCOUNT_NBR, "); sqlBuilder.append("S.SUB_ACCT_NBR AS SUB_SUB_ACCT_NBR, A.ACCT_CLOSED_IND AS ACCT_ACCT_CLOSED_IND, X.ACCT_CLOSED_DT AS ACCTX_ACCT_CLOSED_DT "); sqlBuilder.append("FROM KFS.CA_ACCOUNT_T A "); sqlBuilder.append("LEFT JOIN KFS.CA_ACCOUNT_TX X ON A.FIN_COA_CD = X.FIN_COA_CD AND A.ACCOUNT_NBR = X.ACCOUNT_NBR "); sqlBuilder.append("LEFT JOIN KFS.CA_SUB_ACCT_T S ON A.FIN_COA_CD = S.FIN_COA_CD AND A.ACCOUNT_NBR = S.ACCOUNT_NBR "); sqlBuilder.append("WHERE A.FIN_COA_CD = X.FIN_COA_CD AND A.ACCOUNT_NBR = X.ACCOUNT_NBR AND A.FIN_COA_CD = 'IT' AND A.ACCT_CLOSED_IND = 'Y' "); sqlBuilder.append("AND X.ACCT_CLOSED_DT >= '").append(formatter.format(dateRange.get(CuCoaBatchConstants.ClosedLaborAccountsFileCreationConstants.FROM_DATE))).append("' "); sqlBuilder.append("AND X.ACCT_CLOSED_DT < '").append(formatter.format(dateRange.get(CuCoaBatchConstants.ClosedLaborAccountsFileCreationConstants.TO_DATE))).append("' "); LOG.info("buildClosedLaborAccountsForDateRangeSQL: SQL to be executed = " + sqlBuilder.toString()); return sqlBuilder.toString(); }
Source:
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { cause.printStackTrace(); ctx.channel().close(); }

Target:
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { cause.printStackTrace(); ctx.close(); }
Source:
public CounterChartViewer(Composite parent, String title, String xLabel, String yLabel) { super(parent, title, xLabel, yLabel); Chart chart = getSwtChart(); chart.getTitle().setVisible(true); getSwtChart().getAxisSet().getXAxes()[0].getTitle().setVisible(true); chart.setBackground(new Color(Display.getDefault(), 250, 250, 250)); chart.getLegend().setPosition(SWT.RIGHT); chart.getLegend().setVisible(true); TmfSignalManager.register(this); }

Target:
public CounterChartViewer(Composite parent, String title, String xLabel, String yLabel) { super(parent, title, xLabel, yLabel); Chart chart = getSwtChart(); chart.getTitle().setVisible(true); getSwtChart().getAxisSet().getXAxes()[0].getTitle().setVisible(true); chart.getLegend().setPosition(SWT.RIGHT); chart.getLegend().setVisible(true); Color backgroundColor = new Color(Display.getDefault(), 250, 250, 250); chart.setBackground(backgroundColor); backgroundColor.dispose(); }
Source:
public static void main(String[] args) { TextAnalyticsClient client = new TextAnalyticsClientBuilder() .subscriptionKey(Configuration.getGlobalConfiguration().get("AZURE_TEXT_ANALYTICS_SUBSCRIPTION_KEY")) .endpoint(Configuration.getGlobalConfiguration().get("AZURE_TEXT_ANALYTICS_ENDPOINT")) .buildClient(); String text = "The hotel was dark and unclean."; final TextSentimentResult sentimentResult = client.analyzeSentiment(text); final TextSentiment documentSentiment = sentimentResult.getDocumentSentiment(); System.out.printf( "Recognized TextSentiment: %s, Positive Score: %s, Neutral Score: %s, Negative Score: %s.", documentSentiment.getTextSentimentClass(), documentSentiment.getPositiveScore(), documentSentiment.getNeutralScore(), documentSentiment.getNegativeScore()); final List<TextSentiment> sentiments = sentimentResult.getSentenceSentiments(); sentiments.forEach(textSentiment -> System.out.printf( "Recognized Sentence TextSentiment: %s, Positive Score: %s, Neutral Score: %s, Negative Score: %s.", textSentiment.getTextSentimentClass(), textSentiment.getPositiveScore(), textSentiment.getNeutralScore(), textSentiment.getNegativeScore())); }

Target:
public static void main(String[] args) { TextAnalyticsClient client = new TextAnalyticsClientBuilder() .subscriptionKey("subscription-key") .endpoint("<LINK_0>") .buildClient(); String text = "The hotel was dark and unclean."; final AnalyzeSentimentResult sentimentResult = client.analyzeSentiment(text); final TextSentiment documentSentiment = sentimentResult.getDocumentSentiment(); System.out.printf( "Recognized TextSentiment: %s, Positive Score: %s, Neutral Score: %s, Negative Score: %s.%n", documentSentiment.getTextSentimentClass(), documentSentiment.getPositiveScore(), documentSentiment.getNeutralScore(), documentSentiment.getNegativeScore()); final List<TextSentiment> sentiments = sentimentResult.getSentenceSentiments(); for (TextSentiment textSentiment : sentiments) { System.out.printf( "Recognized Sentence TextSentiment: %s, Positive Score: %s, Neutral Score: %s, Negative Score: %s.%n", textSentiment.getTextSentimentClass(), textSentiment.getPositiveScore(), textSentiment.getNeutralScore(), textSentiment.getNegativeScore()); } }
Source:
public <T extends Entity> EntitySpec<T> resolveSpec(Class<T> type, Class<? extends T> optionalImpl) { if (alreadyBuilt.getAndSet(true)) throw new IllegalStateException("Spec can only be used once: "+this); EntitySpec<T> spec; if (optionalImpl != null) { spec = EntitySpec.create(type).impl(optionalImpl); } else if (type.isInterface()) { spec = EntitySpec.create(type); } else { Class interfaceclazz = (Application.class.isAssignableFrom(type)) ? Application.class : Entity.class; Class<?>[] additionalInterfaceClazzes = type.getInterfaces(); spec = EntitySpec.create(interfaceclazz).impl(type).additionalInterfaces(additionalInterfaceClazzes); } String name, templateId=null, planId=null; if (template.isPresent()) { name = template.get().getName(); templateId = template.get().getId(); } else { name = (String)attrs.getStringKey("name"); } planId = (String)attrs.getStringKey("id"); if (planId==null) planId = (String) attrs.getStringKey(BrooklynCampConstants.PLAN_ID_FLAG); if (!Strings.isBlank(name)) spec.displayName(name); if (templateId != null) spec.configure(BrooklynCampConstants.TEMPLATE_ID, templateId); if (planId != null) spec.configure(BrooklynCampConstants.PLAN_ID, planId); List<Location> childLocations = new BrooklynYamlLocationResolver(mgmt).resolveLocations(attrs.getAllConfig(), true); if (childLocations != null) spec.locations(childLocations); decorateSpec(spec); return spec; }

Target:
public <T extends Entity> EntitySpec<T> resolveSpec(Class<T> type, Class<? extends T> optionalImpl) { if (alreadyBuilt.getAndSet(true)) throw new IllegalStateException("Spec can only be used once: "+this); EntitySpec<T> spec; if (optionalImpl != null) { spec = EntitySpec.create(type).impl(optionalImpl); } else if (type.isInterface()) { spec = EntitySpec.create(type); } else { Class interfaceclazz = (Application.class.isAssignableFrom(type)) ? Application.class : Entity.class; List<Class<?>> additionalInterfaceClazzes = Reflections.getAllInterfaces(type); spec = EntitySpec.create(interfaceclazz).impl(type).additionalInterfaces(additionalInterfaceClazzes); } String name, templateId=null, planId=null; if (template.isPresent()) { name = template.get().getName(); templateId = template.get().getId(); } else { name = (String)attrs.getStringKey("name"); } planId = (String)attrs.getStringKey("id"); if (planId==null) planId = (String) attrs.getStringKey(BrooklynCampConstants.PLAN_ID_FLAG); if (!Strings.isBlank(name)) spec.displayName(name); if (templateId != null) spec.configure(BrooklynCampConstants.TEMPLATE_ID, templateId); if (planId != null) spec.configure(BrooklynCampConstants.PLAN_ID, planId); List<Location> childLocations = new BrooklynYamlLocationResolver(mgmt).resolveLocations(attrs.getAllConfig(), true); if (childLocations != null) spec.locations(childLocations); decorateSpec(spec); return spec; }
Source:
protected int indexOfChild(String localName) { AbstractDataTreeNode[] nodes = this.children; NoDataDeltaNode localNameNode = new NoDataDeltaNode(localName); return Arrays.binarySearch(nodes, localNameNode, (n1, n2) -> n1.name.compareTo(n2.name)); }

Target:
protected int indexOfChild(String localName) { AbstractDataTreeNode[] nodes = this.children; if (nodes.length == 0) { return -1; } else if (nodes.length == 1) { return nodes[0].name.equals(localName) ? 0 : -1; } NoDataDeltaNode localNameNode = new NoDataDeltaNode(localName); return Arrays.binarySearch(nodes, localNameNode, (n1, n2) -> n1.name.compareTo(n2.name)); }
Source:
public PreparedOperationWithReactiveStream<List<T>> prepare() { Checks.checkNotNull(mapFunc, "Please specify map function"); Checks.checkNotNull(query, "Please specify query"); if (getResolver == null) { getResolver = DefaultGetResolver.INSTANCE; } return new PreparedGetListOfObjects<>( storIOContentProvider, getResolver, mapFunc, query ); }

Target:
public PreparedOperationWithReactiveStream<List<T>> prepare() { checkNotNull(mapFunc, "Please specify map function"); checkNotNull(query, "Please specify query"); if (getResolver == null) { getResolver = DefaultGetResolver.INSTANCE; } return new PreparedGetListOfObjects<>( storIOContentProvider, getResolver, mapFunc, query ); }
Source:
public Configuration(SkipFilter dependencyFilter, SkipFilter pluginFilter, boolean verifyPomFiles, boolean verifyPlugins, boolean verifyPluginDependencies, boolean verifyAtypical) { this.dependencyFilter = requireNonNull(dependencyFilter); this.pluginFilter = requireNonNull(pluginFilter); this.verifyPomFiles = verifyPomFiles; if (!verifyPlugins && verifyPluginDependencies) { LOG.warn("Enabling configuration parameter 'verifyPlugins' as 'verifyPluginDependencies' is enabled."); } this.verifyPlugins = verifyPlugins || verifyPluginDependencies; this.verifyPluginDependencies = verifyPluginDependencies; this.verifyAtypical = verifyAtypical; }

Target:
public Configuration(SkipFilter dependencyFilter, SkipFilter pluginFilter, boolean verifyPomFiles, boolean verifyPlugins, boolean verifyPluginDependencies, boolean verifyAtypical) { this.dependencyFilter = requireNonNull(dependencyFilter); this.pluginFilter = requireNonNull(pluginFilter); this.verifyPomFiles = verifyPomFiles; this.verifyPlugins = verifyPlugins || verifyPluginDependencies; this.verifyPluginDependencies = verifyPluginDependencies; this.verifyAtypical = verifyAtypical; }
Source:
public List<Instance> start(String workspaceId, Environment env, boolean recover, MessageConsumer<MachineLogMessage> messageConsumer) throws ServerException, ConflictException { List<MachineConfigImpl> startConfigs = env.getMachineConfigs() .stream() .map(MachineConfigImpl::new) .collect(Collectors.toList()); final MachineConfigImpl devCfg = removeFirstMatching(startConfigs, MachineConfig::isDev); startConfigs.add(0, devCfg); EnvironmentHolder environmentHolder = new EnvironmentHolder(new ArrayDeque<>(startConfigs), new CopyOnWriteArrayList<>(), messageConsumer, EnvStatus.STARTING, env.getName()); EnvironmentHolder returnedEnv; try (StripedLocks.WriteLock lock = stripedLocks.acquireWriteLock(workspaceId)) { returnedEnv = environments.putIfAbsent(workspaceId, environmentHolder); } if (returnedEnv != null) { throw new ConflictException(format("Environment of workspace '%s' already exists", workspaceId)); } startQueue(workspaceId, env.getName(), recover, messageConsumer); List<Instance> machines; try (StripedLocks.WriteLock lock = stripedLocks.acquireWriteLock(workspaceId)) { environmentHolder = environments.get(workspaceId); if (environmentHolder == null) { throw new ServerException("Environment start was interrupted by environment stopping"); } machines = environmentHolder.machines; environmentHolder.status = EnvStatus.RUNNING; } return new ArrayList<>(machines); }

Target:
public List<Instance> start(String workspaceId, Environment env, boolean recover, MessageConsumer<MachineLogMessage> messageConsumer) throws ServerException, ConflictException { List<MachineConfigImpl> startConfigs = env.getMachineConfigs() .stream() .map(MachineConfigImpl::new) .collect(Collectors.toList()); final MachineConfigImpl devCfg = removeFirstMatching(startConfigs, MachineConfig::isDev); startConfigs.add(0, devCfg); EnvironmentHolder environmentHolder = new EnvironmentHolder(new ArrayDeque<>(startConfigs), new CopyOnWriteArrayList<>(), messageConsumer, EnvStatus.STARTING, env.getName()); try (StripedLocks.WriteLock lock = stripedLocks.acquireWriteLock(workspaceId)) { if (environments.putIfAbsent(workspaceId, environmentHolder) != null) { throw new ConflictException(format("Environment of workspace '%s' already exists", workspaceId)); } } startQueue(workspaceId, env.getName(), recover, messageConsumer); try (StripedLocks.WriteLock lock = stripedLocks.acquireWriteLock(workspaceId)) { environmentHolder = environments.get(workspaceId); if (environmentHolder == null) { throw new ServerException("Environment start was interrupted by environment stopping"); } environmentHolder.status = EnvStatus.RUNNING; return new ArrayList<>(environmentHolder.machines); } }
Source:
private void checkCodeAssistant() { String textFromWholeCodeAssistantScope = "AbortController\nAbortSignal\nabstract\nActiveXObject\naddEventListener\nalert"; String textFromGreeterObject = "greet\ngreeting\ntestPrint"; editor.goToPosition(28, 36); editor.launchAutocomplete(); editor.waitTextIntoAutocompleteContainer(textFromWholeCodeAssistantScope); editor.closeAutocomplete(); editor.typeTextIntoEditor(ENTER.toString()); editor.typeTextIntoEditor("greeter."); editor.launchAutocomplete(); editor.waitTextIntoAutocompleteContainer(textFromGreeterObject); editor.selectItemIntoAutocompleteAndPerformDoubleClick("greet"); editor.waitAllMarkersInvisibility(ERROR); }

Target:
private void checkCodeAssistant() { String textFromWholeCodeAssistantScope = "AbortController\nAbortSignal\nabstract\nActiveXObject\naddEventListener\nalert"; String textFromGreeterObject = "greet\ngreeting\ntestPrint"; String nameOfGreeterClassRef = "greeter."; String methodToComplete = "greet"; editor.goToPosition(28, 36); editor.launchAutocomplete(); editor.waitTextIntoAutocompleteContainer(textFromWholeCodeAssistantScope); editor.closeAutocomplete(); editor.typeTextIntoEditor(ENTER.toString()); editor.typeTextIntoEditor(nameOfGreeterClassRef); editor.launchAutocomplete(); editor.waitTextIntoAutocompleteContainer(textFromGreeterObject); editor.selectItemIntoAutocompleteAndPerformDoubleClick(methodToComplete); editor.waitAllMarkersInvisibility(ERROR); }
Source:
public Object[][] getLinearIndexFactoryTypes(){ return new Object[][] { new Object[] { new File(TestUtils.DATA_DIR, "bed/Unigene.sample.bed") }, new Object[] { new File(TestUtils.DATA_DIR, "bed/Unigene.sample.bed.gz") } }; }

Target:
public Object[][] getLinearIndexFactoryTypes() { return new Object[][] { { new File(TestUtils.DATA_DIR, "bed/Unigene.sample.bed") }, { new File(TestUtils.DATA_DIR, "bed/Unigene.sample.bed.gz") } }; }
Source:
public void prepareRun(BatchSinkContext context) throws Exception { Job job = JobUtils.createInstance(); Configuration conf = job.getConfiguration(); if (UserGroupInformation.isSecurityEnabled()) { conf.unset("mapreduce.jobhistory.address"); conf.setBoolean(Job.JOB_AM_ACCESS_DISABLED, false); Credentials credentials = UserGroupInformation.getCurrentUser().getCredentials(); job.getCredentials().addAll(credentials); } HiveSinkOutputFormatProvider sinkOutputFormatProvider = new HiveSinkOutputFormatProvider(job, config); HCatSchema hiveSchema = sinkOutputFormatProvider.getHiveSchema(); HiveSchemaStore.storeHiveSchema(context, config.dbName, config.tableName, hiveSchema); context.addOutput(Output.of(config.referenceName, sinkOutputFormatProvider).alias(config.tableName)); }

Target:
public void prepareRun(BatchSinkContext context) throws Exception { Job job = JobUtils.createInstance(); Configuration conf = job.getConfiguration(); HiveSinkOutputFormatProvider sinkOutputFormatProvider = new HiveSinkOutputFormatProvider(job, config); HCatSchema hiveSchema = sinkOutputFormatProvider.getHiveSchema(); HiveSchemaStore.storeHiveSchema(context, config.dbName, config.tableName, hiveSchema); context.addOutput(Output.of(config.referenceName, sinkOutputFormatProvider).alias(config.tableName)); }
Source:
public void testCorrectMarkerTimestamp() { long startTime = fTrace.getStartTime().toNanos(); long endTime = fTrace.getEndTime().toNanos(); assertTrue(fTraceMarkerScriptingModule.addTraceMarker(startTime, endTime - 1, "", "", "")); assertTrue(fTraceMarkerScriptingModule.addTraceMarker(startTime + 1, endTime, "", "", "")); assertTrue(fTraceMarkerScriptingModule.addTraceMarker(startTime, endTime, "", "", "")); assertTrue(fTraceMarkerScriptingModule.addTraceMarker(startTime + 1, endTime - 1, "", "", "")); }

Target:
public void testCorrectMarkerTimestamp() throws Exception { long startTime = 1; long endTime = 1; fTraceMarkerScriptingModule.addTraceMarker(startTime, endTime, null, null, null); }
Source:
private void sendContinuations(final int packetSize, final long messageBodySize, final byte[] body, final boolean continues) throws Exception { synchronized (largeMessageLock) { if (currentLargeMessage == null) { throw ActiveMQMessageBundle.BUNDLE.largeMessageNotInitialised(); } currentLargeMessage.addBytes(body); if (!continues) { currentLargeMessage.sync(); currentLargeMessage.releaseResources(); if (messageBodySize >= 0) { currentLargeMessage.putLongProperty(Message.HDR_LARGE_BODY_SIZE, messageBodySize); } LargeServerMessage message = currentLargeMessage; currentLargeMessage = null; session.doSend(session.getCurrentTransaction(), message, null, false, false); } } }

Target:
private void sendContinuations(final int packetSize, final long messageBodySize, final byte[] body, final boolean continues) throws Exception { synchronized (largeMessageLock) { if (currentLargeMessage == null) { throw ActiveMQMessageBundle.BUNDLE.largeMessageNotInitialised(); } currentLargeMessage.addBytes(body); if (!continues) { currentLargeMessage.releaseResources(); if (messageBodySize >= 0) { currentLargeMessage.putLongProperty(Message.HDR_LARGE_BODY_SIZE, messageBodySize); } LargeServerMessage message = currentLargeMessage; currentLargeMessage = null; session.doSend(session.getCurrentTransaction(), message, null, false, false); } } }
Source:
private void validateClientAttached(ClientDescriptor clientDescriptor) throws ClusterException { ClientState clientState = this.clientStateMap.get(clientDescriptor); if (clientState == null) { throw new LifecycleException("Client " + clientDescriptor + " is not connected to the Clustered Tier Manager"); } if (!clientState.isAttached()) { throw new LifecycleException("Client " + clientDescriptor + " is not attached to the Clustered Tier Manager"); } }

Target:
private void validateClientAttached(ClientDescriptor clientDescriptor) throws ClusterException { ClientState clientState = this.clientStateMap.get(clientDescriptor); validateClientConnected(clientDescriptor, clientState); if (!clientState.isAttached()) { throw new LifecycleException("Client " + clientDescriptor + " is not attached to the Clustered Tier Manager"); } }
Source:
protected Properties initJobParameters() { Properties jobParameters = new Properties(); if (getBeanDefinitionRegistry().containsBeanDefinition(JOB_PARAMETERS_BEAN_DEFINITION_NAME)) { BeanDefinition beanDefintion = getBeanDefinitionRegistry().getBeanDefinition(JOB_PARAMETERS_BEAN_DEFINITION_NAME); Properties properties = (Properties) beanDefintion.getConstructorArgumentValues() .getGenericArgumentValue(Properties.class) .getValue(); if (properties == null) { return new Properties(); } jobParameters.putAll(properties); } return jobParameters; }

Target:
private Properties initJobParameters() { Properties jobParameters = new Properties(); if (getBeanDefinitionRegistry().containsBeanDefinition(JOB_PARAMETERS_BEAN_DEFINITION_NAME)) { BeanDefinition beanDefintion = getBeanDefinitionRegistry().getBeanDefinition(JOB_PARAMETERS_BEAN_DEFINITION_NAME); Properties properties = (Properties) beanDefintion.getConstructorArgumentValues() .getGenericArgumentValue(Properties.class) .getValue(); if (properties == null) { return new Properties(); } jobParameters.putAll(properties); } return jobParameters; }
Source:
public Object getNextValue() { double value = (double) getValue(); double stepSize = MAX_VALUE; while (stepSize >= MIN_VALUE) { if (value >= stepSize) { break; } else { stepSize = stepSize / 10; } } if( value >= MAX_VALUE) { return 0; } return value + stepSize; }

Target:
public Object getNextValue() { double value = (double) getValue(); double stepSize = MAX_VALUE; while (stepSize >= MIN_VALUE) { if (value >= stepSize) { break; } else { stepSize = stepSize / 10; } } if( value >= MAX_VALUE) { return null; } return value + stepSize; }
Source:
protected void appendDetail(StringBuffer buffer, String fieldName, Object value) { if (value == null) { appendNullText(buffer, fieldName); return; } if (value instanceof Number || value.getClass() == Boolean.class) { buffer.append(value); return; } appendValueAsString(buffer, value.toString()); }

Target:
protected void appendDetail(StringBuffer buffer, String fieldName, Object value) { if (value == null) { appendNullText(buffer, fieldName); return; } if (value instanceof String || value instanceof Character) { appendValueAsString(buffer, value.toString()); return; } if (value instanceof Number || value instanceof Boolean) { buffer.append(value); return; } final String try_value_str = value.toString(); if (try_value_str.startsWith(getContentStart()) && try_value_str.endsWith(getContentEnd()) || try_value_str.startsWith(getArrayStart()) && try_value_str.startsWith(getArrayEnd()) ) { buffer.append(value); return; } appendDetail(buffer, fieldName, try_value_str); }
Source:
private boolean policyUnitEnabled(VM vm) { boolean usesNumaPinning = vmNumaNodeDao.getAllVmNumaNodeByVmId(vm.getId()).stream() .anyMatch(node -> !node.getVdsNumaNodeList().isEmpty()); return vm.getVmType() == VmType.HighPerformance || vm.isUsingCpuPassthrough() || StringUtils.isNotEmpty(vm.getCpuPinning()) || usesNumaPinning; }

Target:
private boolean policyUnitEnabled(VM vm) { if (vm.getVmType() == VmType.HighPerformance || vm.isUsingCpuPassthrough() || StringUtils.isNotEmpty(vm.getCpuPinning())) { return true; } return vmNumaNodeDao.getAllVmNumaNodeByVmId(vm.getId()).stream() .anyMatch(node -> !node.getVdsNumaNodeList().isEmpty()); }
Source:
private static int parseMergeMinRegionSizeMb(final Configuration conf) { final int parsedValue = conf.getInt(MERGE_MIN_REGION_SIZE_MB_KEY, DEFAULT_MERGE_MIN_REGION_SIZE_MB); final int settledValue = Math.max(0, parsedValue); if (parsedValue != settledValue) { warnInvalidValue(MERGE_MIN_REGION_SIZE_MB_KEY, parsedValue, settledValue); } return settledValue; }

Target:
private static long parseMergeMinRegionSizeMb(final Configuration conf) { final long parsedValue = conf.getLong(MERGE_MIN_REGION_SIZE_MB_KEY, DEFAULT_MERGE_MIN_REGION_SIZE_MB); final long settledValue = Math.max(0, parsedValue); if (parsedValue != settledValue) { warnInvalidValue(MERGE_MIN_REGION_SIZE_MB_KEY, parsedValue, settledValue); } return settledValue; }
Source:
private TableStatistics toTableStatistics(TableStatisticsData tableStatisticsData, TpchTableHandle tpchTableHandle, Map<String, ColumnHandle> columnHandles) { TableStatistics.Builder builder = TableStatistics.builder() .setRowCount(new Estimate(tableStatisticsData.getRowCount())); tableStatisticsData.getColumns().forEach((columnName, stats) -> { TpchColumnHandle columnHandle = (TpchColumnHandle) getColumnHandle(tpchTableHandle, columnHandles, columnName); builder.setColumnStatistics(columnHandle, toColumnStatistics(stats, columnHandle.getType())); }); return builder.build(); }

Target:
private TableStatistics toTableStatistics(TableStatisticsData tableStatisticsData, TpchTableHandle tpchTableHandle, Map<String, ColumnHandle> columnHandles) { TableStatistics.Builder builder = TableStatistics.builder() .setRowCount(new Estimate(tableStatisticsData.getRowCount())); tableStatisticsData.getColumns().forEach((columnName, stats) -> { TpchColumnHandle columnHandle = (TpchColumnHandle) getColumnHandle(tpchTableHandle, columnHandles, columnName); builder.setColumnStatistics(columnHandle, toColumnStatistics(stats, columnHandle.getType(), tableStatisticsData.getRowCount())); }); return builder.build(); }
Source:
public void testAddRangeConstraints() { Assert.assertEquals("Should add equality constraints", URI.create("view:file:/datasets/test?color=[green,inf)"), new URIBuilder("dataset:file:/datasets/test") .constraints(empty.from("color", "green")) .build()); Assert.assertEquals("Should add equality constraints", URI.create("view:file:/datasets/test?color=(inf,green]"), new URIBuilder("dataset:file:/datasets/test") .constraints(empty.to("color", "green")) .build()); Assert.assertEquals("Should add equality constraints", URI.create("view:file:/datasets/test?timestamp=[0,1405720705333)&color=(green,red]"), new URIBuilder("dataset:file:/datasets/test") .constraints(empty .from("timestamp", 0l).toBefore("timestamp", 1405720705333l) .fromAfter("color", "green").to("color", "red")) .build()); }

Target:
public void testAddRangeConstraints() { Assert.assertEquals("Should add equality constraints", URI.create("view:file:/datasets/test?color=[green,)"), new URIBuilder("dataset:file:/datasets/test") .constraints(empty.from("color", "green")) .build()); Assert.assertEquals("Should add equality constraints", URI.create("view:file:/datasets/test?color=(,green]"), new URIBuilder("dataset:file:/datasets/test") .constraints(empty.to("color", "green")) .build()); Assert.assertEquals("Should add equality constraints", URI.create("view:file:/datasets/test?timestamp=[0,1405720705333)&color=(green,red]"), new URIBuilder("dataset:file:/datasets/test") .constraints(empty .from("timestamp", 0l).toBefore("timestamp", 1405720705333L) .fromAfter("color", "green").to("color", "red")) .build()); }
Source:
public Integer getSourcePort() { return sourcePort == 0 ? null : this.sourcePort; }

Target:
public Integer getSourcePort() { return (this.sourcePort == null || this.sourcePort == 0) ? null : this.sourcePort; }
Source:
private void checkFormUpdates() { for (DriveListItem item: driveList) { if (item.getType() == DriveListItem.FILE) { if (isNewerFormVersionAvailable(item) || areNewerMediaFilesAvailable(item)) { item.setNewerVersion(true); } } } }

Target:
private void checkFormUpdates() { FormsDao formsDao = new FormsDao(); for (DriveListItem item: driveList) { if (item.getType() == DriveListItem.FILE) { try (Cursor cursor = formsDao.getFormsCursorForFormFilePath(storagePathProvider.getDirPath(StorageSubdirectory.FORMS) + File.separator + item.getName())) { if (cursor != null && cursor.moveToFirst() && (isNewerFormVersionAvailable(item) || areNewerMediaFilesAvailable(item))) { item.setNewerVersion(true); } } } } }
Source:
public static AggregatorFactory[] mergeAggregators(List<AggregatorFactory[]> aggregatorsList) { if (aggregatorsList == null || aggregatorsList.isEmpty()) { return null; } Map<String, AggregatorFactory> mergedAggregators = new LinkedHashMap<>(); for (AggregatorFactory[] aggregators : aggregatorsList) { if (aggregators != null) { for (AggregatorFactory aggregator : aggregators) { String name = aggregator.getName(); if (mergedAggregators.containsKey(name)) { AggregatorFactory other = mergedAggregators.get(name); try { mergedAggregators.put(name, other.getMergingFactory(aggregator)); } catch (AggregatorFactoryNotMergeableException ex) { LOG.warn(ex, "failed to merge aggregator factories"); mergedAggregators = null; break; } } else { mergedAggregators.put(name, aggregator); } } } else { mergedAggregators = null; break; } } return mergedAggregators == null ? null : mergedAggregators.values().toArray(new AggregatorFactory[mergedAggregators.size()]); }

Target:
public static AggregatorFactory[] mergeAggregators(List<AggregatorFactory[]> aggregatorsList) { if (aggregatorsList == null || aggregatorsList.isEmpty()) { return null; } Map<String, AggregatorFactory> mergedAggregators = new LinkedHashMap<>(); for (AggregatorFactory[] aggregators : aggregatorsList) { if (aggregators != null) { for (AggregatorFactory aggregator : aggregators) { String name = aggregator.getName(); if (mergedAggregators.containsKey(name)) { AggregatorFactory other = mergedAggregators.get(name); try { mergedAggregators.put(name, other.getMergingFactory(aggregator)); } catch (AggregatorFactoryNotMergeableException ex) { log.warn(ex, "failed to merge aggregator factories"); mergedAggregators = null; break; } } else { mergedAggregators.put(name, aggregator); } } } else { mergedAggregators = null; break; } } return mergedAggregators == null ? null : mergedAggregators.values().toArray(new AggregatorFactory[mergedAggregators.size()]); }
Source:
public Object saveInstance(EntityRecord entityRecord, Long deleteValueFieldId) { EntityDto entity = getEntity(entityRecord.getEntitySchemaId()); validateCredentials(entity); validateNonEditableProperty(entity); List<FieldDto> entityFields = getEntityFields(entityRecord.getEntitySchemaId()); try { MotechDataService service = getServiceForEntity(entity); Class<?> entityClass = getEntityClass(entity); boolean newObject = entityRecord.getId() == null; Object instance; if (newObject) { instance = entityClass.newInstance(); for (FieldDto entityField : entityFields) { if (entityField.getType().isMap() && entityField.getBasic().getDefaultValue() != null) { setInstanceFieldMap(instance, entityField); } } } else { instance = service.retrieve(ID_FIELD_NAME, entityRecord.getId()); if (instance == null) { throw new ObjectNotFoundException(entity.getName(), entityRecord.getId()); } } updateFields(instance, entityRecord.getFields(), service, deleteValueFieldId, !newObject); if (newObject) { return service.create(instance); } else { return service.update(instance); } } catch (JDODataStoreException e) { throw new DuplicateEntryException(entity.getName(), e); } catch (Exception e) { if (entityRecord.getId() == null) { throw new ObjectCreateException(entity.getName(), e); } else { throw new ObjectUpdateException(entity.getName(), entityRecord.getId(), e); } } }

Target:
public Object saveInstance(EntityRecord entityRecord, Long deleteValueFieldId) { EntityDto entity = getEntity(entityRecord.getEntitySchemaId()); validateCredentials(entity); validateNonEditableProperty(entity); List<FieldDto> entityFields = getEntityFields(entityRecord.getEntitySchemaId()); try { MotechDataService service = getServiceForEntity(entity); Class<?> entityClass = getEntityClass(entity); boolean newObject = entityRecord.getId() == null; Object instance; if (newObject) { instance = entityClass.newInstance(); for (FieldDto entityField : entityFields) { if (entityField.getType().isMap() && entityField.getBasic().getDefaultValue() != null) { setInstanceFieldMap(instance, entityField); } } } else { instance = service.retrieve(ID_FIELD_NAME, entityRecord.getId()); if (instance == null) { throw new ObjectNotFoundException(entity.getName(), entityRecord.getId()); } } updateFields(instance, entityRecord.getFields(), service, deleteValueFieldId, !newObject); if (newObject) { return service.create(instance); } else { return service.update(instance); } } catch (Exception e) { if (entityRecord.getId() == null) { throw new ObjectCreateException(entity.getName(), e); } else { throw new ObjectUpdateException(entity.getName(), entityRecord.getId(), e); } } }
Source:
public File resolveFile(String fileName) { File file = new File(fileName); if (cwd != null && !file.isAbsolute()) { file = new File(cwd, fileName); } if (!fileSystemOptions.isClassPathResolvingEnabled()) { return file; } synchronized (this) { if (!file.exists()) { File cacheFile = new File(cacheDir, fileName); if (fileSystemOptions.isFileResolverCachingEnabled() && cacheFile.exists()) { return cacheFile; } ClassLoader cl = getClassLoader(); if (NON_UNIX_FILE_SEP) { fileName = fileName.replace(FILE_SEP, "/"); } String parentFileName = file.getParent(); if (parentFileName != null) { URL directoryContents = cl.getResource(parentFileName); if (directoryContents != null) { unpackUrlResource(directoryContents, parentFileName, cl, true); } } URL url = cl.getResource(fileName); if (url != null) { return unpackUrlResource(url, fileName, cl, false); } } } return file; }

Target:
public File resolveFile(String fileName) { File file = new File(fileName); if (cwd != null && !file.isAbsolute()) { file = new File(cwd, fileName); } if (!this.enableCpResolving) { return file; } synchronized (this) { if (!file.exists()) { File cacheFile = new File(cacheDir, fileName); if (this.enableCaching && cacheFile.exists()) { return cacheFile; } ClassLoader cl = getClassLoader(); if (NON_UNIX_FILE_SEP) { fileName = fileName.replace(FILE_SEP, "/"); } String parentFileName = file.getParent(); if (parentFileName != null) { URL directoryContents = cl.getResource(parentFileName); if (directoryContents != null) { unpackUrlResource(directoryContents, parentFileName, cl, true); } } URL url = cl.getResource(fileName); if (url != null) { return unpackUrlResource(url, fileName, cl, false); } } } return file; }
Source:
private void createLuceneIndex(JackrabbitSession session, String name, String property) throws Exception { Node n = session.getRootNode().getNode(INDEX_DEFINITIONS_NAME); n = n.addNode(name); n.setPrimaryType(IndexConstants.INDEX_DEFINITIONS_NODE_TYPE); n.setProperty("compatVersion", 2); n.setProperty(TYPE_PROPERTY_NAME, "lucene"); n.setProperty(REINDEX_PROPERTY_NAME, true); n.setProperty(FulltextIndexConstants.FULL_TEXT_ENABLED, false); n.setProperty("includePropertyNames", new String[]{property}); session.save(); }

Target:
private static Node createLuceneIndex(JackrabbitSession session, String name, String property) throws Exception { Node n = session.getRootNode().getNode(INDEX_DEFINITIONS_NAME); n = n.addNode(name); n.setPrimaryType(IndexConstants.INDEX_DEFINITIONS_NODE_TYPE); n.setProperty("compatVersion", 2); n.setProperty(TYPE_PROPERTY_NAME, "lucene"); n.setProperty(REINDEX_PROPERTY_NAME, true); n.setProperty(FulltextIndexConstants.FULL_TEXT_ENABLED, false); n.setProperty("includePropertyNames", new String[]{property}); session.save(); return n; }
Source:
void verifyMetadata(MessageMetadata metadata) throws Exception { if (metadata.getSnapshotTimestamp() != srcGlobalSnapshot) { log.error("snapshot expected != recv snapshot {}, metadata {}", srcGlobalSnapshot, metadata.getSnapshotTimestamp(), metadata); throw new Exception("Message is out of order"); } }

Target:
void verifyMetadata(MessageMetadata metadata) throws Exception { if (metadata.getMessageMetadataType() != MessageType.SNAPSHOT_MESSAGE || metadata.getSnapshotTimestamp() != srcGlobalSnapshot) { log.error("snapshot expected != recv snapshot {}, metadata {}", srcGlobalSnapshot, metadata.getSnapshotTimestamp(), metadata); throw new Exception("Message is out of order"); } }
Source:
public RepositoryFileAttributes getAttributes(String storageId, String repositoryId, String path) throws ArtifactTransportException, ProviderImplementationException, NoSuchAlgorithmException { try { try { return artifactResolutionService.getAttributes(storageId, repositoryId, path); } catch (IOException e) { logger.debug("The REQUESTED path does not exist: - /" + storageId + "/" + repositoryId + "/" + path); } } catch (Exception e) { e.printStackTrace(); } return null; }

Target:
public RepositoryFileAttributes getAttributes(String storageId, String repositoryId, String path) throws ArtifactTransportException, ProviderImplementationException, NoSuchAlgorithmException { try { return artifactResolutionService.getAttributes(storageId, repositoryId, path); } catch (IOException e) { logger.debug("The requested path does not exist: - /" + storageId + "/" + repositoryId + "/" + path); } return null; }
Source:
protected List<Action> createTransientActions() { Vector<Action> ta = new Vector<Action>(); for (JobProperty<? super P> p : Util.fixNull(properties)) ta.addAll(p.getJobActions((P)this)); for (TransientProjectActionFactory tpaf : TransientProjectActionFactory.all()) { try { ta.addAll(Util.fixNull(tpaf.createFor(this))); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Error loading transient project action factory."); } } return ta; }

Target:
protected List<Action> createTransientActions() { Vector<Action> ta = new Vector<Action>(); for (JobProperty<? super P> p : Util.fixNull(properties)) ta.addAll(p.getJobActions((P)this)); for (TransientProjectActionFactory tpaf : TransientProjectActionFactory.all()) { try { ta.addAll(Util.fixNull(tpaf.createFor(this))); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Could not load actions from " + tpaf + " for " + this, e); } } return ta; }