auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private String getAction(ServiceTreeNode node, String path) { for (String action : node.getActions()) { if (action.toLowerCase().equals(path)) { return action; } } return null; }

Target:
private String getAction(ServiceTreeNode node, String path) { return node.getActions().stream() .filter(action -> action.toLowerCase().equals(path)) .findFirst() .orElse(null); }
Source:
public void channelRead0(ChannelHandlerContext ctx, Batch batch) throws Exception { if(logger.isDebugEnabled()) { logger.debug(format("Received a new payload")); } ctx.channel().attr(BeatsHandler.PROCESSING_BATCH).set(true); try { for (Message message : batch) { if (logger.isDebugEnabled()) { logger.debug(format("Sending a new message for the listener, sequence: " + message.getSequence())); } messageListener.onNewMessage(ctx, message); if (needAck(message)) { ack(ctx, message); } } }finally{ ctx.channel().attr(ConnectionHandler.CHANNEL_PENDING_COUNTER).get().getAndDecrement(); if (logger.isDebugEnabled()) { logger.debug("{}: batches pending: {}", ctx.channel().id().asShortText(),ctx.channel().attr(ConnectionHandler.CHANNEL_PENDING_COUNTER).get().get()); } batch.release(); ctx.flush(); ctx.channel().attr(PROCESSING_BATCH).set(false); } }

Target:
public void channelRead0(ChannelHandlerContext ctx, Batch batch) throws Exception { if(logger.isDebugEnabled()) { logger.debug(format("Received a new payload")); } try { for (Message message : batch) { if (logger.isDebugEnabled()) { logger.debug(format("Sending a new message for the listener, sequence: " + message.getSequence())); } messageListener.onNewMessage(ctx, message); if (needAck(message)) { ack(ctx, message); } } }finally{ ctx.channel().attr(ConnectionHandler.CHANNEL_SEND_KEEP_ALIVE).get().set(false); if (logger.isDebugEnabled()) { logger.debug("{}: batches pending: {}", ctx.channel().id().asShortText(),ctx.channel().attr(ConnectionHandler.CHANNEL_SEND_KEEP_ALIVE).get().get()); } batch.release(); ctx.flush(); } }
Source:
public void updateValidationStatuses(final Map<Dependency, FileValidationStatus> depValidationStatuses, final String validationKey) throws SQLException { if (depValidationStatuses.size() == 0) { return; } Object[][] rowsToInsert = depValidationStatuses .keySet() .stream() .map(d -> new Object[]{d.getFileName(), d.getSHA1(), validationKey, depValidationStatuses.get(d).getValue()}) .toArray(Object[][]::new); this.dbOperator.batch("insert ignore into validated_dependencies " + "(file_name, file_sha1, validation_key, validation_status) values (?, ?, ?, ?)", rowsToInsert); }

Target:
public void updateValidationStatuses(final Map<Dependency, FileValidationStatus> depValidationStatuses, final String validationKey) throws SQLException { if (depValidationStatuses.isEmpty()) { return; } Object[][] rowsToInsert = depValidationStatuses .keySet() .stream() .map(d -> new Object[]{d.getFileName(), d.getSHA1(), validationKey, depValidationStatuses.get(d).getValue()}) .toArray(Object[][]::new); this.dbOperator.batch("INSERT IGNORE INTO validated_dependencies " + "(file_name, file_sha1, validation_key, validation_status) VALUES (?, ?, ?, ?)", rowsToInsert); }
Source:
public TempDirectory(String name) { try { basePath = Files.createTempDirectory("robolectric-" + name); } catch (IOException e) { throw new RuntimeException(e); } synchronized (TempDirectory.class) { if (tempDirectoriesToDelete == null) { tempDirectoriesToDelete = Collections.synchronizedSet(new HashSet<>()); Runtime.getRuntime().addShutdownHook(new Thread(TempDirectory::clearAllDirectories)); } } tempDirectoriesToDelete.add(this); }

Target:
public TempDirectory(String name) { try { basePath = Files.createTempDirectory("robolectric-" + name); } catch (IOException e) { throw new RuntimeException(e); } synchronized (tempDirectoriesToDelete) { if (tempDirectoriesToDelete.size() == 0) { Runtime.getRuntime().addShutdownHook(new Thread(TempDirectory::clearAllDirectories)); } tempDirectoriesToDelete.add(this); } }
Source:
private static @NonNull Set<@NonNull Entry<String, Set<String>>> getSsNames(SWTBotView bot) { SWTBotTimeGraph timeGraph = new SWTBotTimeGraph(bot.bot()); SWTBotTimeGraphEntry[] traceEntries = timeGraph.getEntries(); assertEquals("State system explorer should have a single trace entry: " + Arrays.toString(traceEntries), 1, traceEntries.length); SWTBotTimeGraphEntry trace = timeGraph.getEntry("synthetic-trace"); SWTBotTimeGraphEntry[] modules = trace.getEntries(); Map<String, Set<String>> modulesToStateSystems = new HashMap<>(); for (SWTBotTimeGraphEntry module : modules) { Set<String> stateSystems = new HashSet<>(); for (SWTBotTimeGraphEntry stateSystem : module.getEntries()) { stateSystems.add(stateSystem.getText()); } modulesToStateSystems.put(module.getText(), stateSystems); } return modulesToStateSystems.entrySet(); }

Target:
private static @NonNull Set<@NonNull Entry<String, Set<String>>> getSsNames(SWTBotView bot) { SWTBotTimeGraph timeGraph = new SWTBotTimeGraph(bot.bot()); SWTBotTimeGraphEntry[] traceEntries = timeGraph.getEntries(); SWTBotTimeGraphEntry trace = timeGraph.getEntry("synthetic-trace"); assertEquals("State system explorer should have a single trace entry: " + Arrays.toString(traceEntries), 1, traceEntries.length); SWTBotTimeGraphEntry[] modules = trace.getEntries(); Map<String, Set<String>> modulesToStateSystems = new HashMap<>(); for (SWTBotTimeGraphEntry module : modules) { Set<String> stateSystems = new HashSet<>(); for (SWTBotTimeGraphEntry stateSystem : module.getEntries()) { stateSystems.add(stateSystem.getText()); } modulesToStateSystems.put(module.getText(), stateSystems); } return modulesToStateSystems.entrySet(); }
Source:
public void testMultipleTokens() { ginjector.getPlaceManager().revealDefaultPlace(); Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { assertTrue(ginjector.getMainPresenter().get().isVisible()); ginjector.getPlaceManager().revealPlace(new PlaceRequest.Builder().nameToken("admin").build()); Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { assertFalse(ginjector.getMainPresenter().get().isVisible()); assertTrue(ginjector.getAdminPresenter().get().isVisible()); ginjector.getPlaceManager().revealDefaultPlace(); Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { assertTrue(ginjector.getMainPresenter().get().isVisible()); assertFalse(ginjector.getAdminPresenter().get().isVisible()); ginjector.getPlaceManager().revealPlace( new PlaceRequest.Builder().nameToken("selfService").build()); Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { assertFalse(ginjector.getMainPresenter().get().isVisible()); assertTrue(ginjector.getAdminPresenter().get().isVisible()); finishTest(); } }); } }); } }); } }); delayTestFinish(1000); }

Target:
public void testMultipleTokens() { ginjector.getPlaceManager().revealDefaultPlace(); Scheduler.get().scheduleDeferred(new ScheduledCommand() { @Override public void execute() { assertTrue(ginjector.getMainPresenter().get().isVisible()); assertFalse(ginjector.getAdminPresenter().get().isVisible()); revealAdmin(); } }); delayTestFinish(1000); }
Source:
public boolean isValid(CruiseConfig preprocessedConfig) { EnvironmentConfig config = preprocessedConfig.getEnvironments().find(this.config.name()); boolean isValid = config.validateTree(ConfigSaveValidationContext.forChain(preprocessedConfig), preprocessedConfig); if (!isValid) { List<ConfigErrors> allErrors = preprocessedConfig.getAllErrors(); result.badRequest(actionFailed.addParam(allErrors.get(0).firstError())); } return isValid; }

Target:
public boolean isValid(CruiseConfig preprocessedConfig) { EnvironmentConfig config = preprocessedConfig.getEnvironments().find(this.config.name()); boolean isValid = config.validateTree(ConfigSaveValidationContext.forChain(preprocessedConfig), preprocessedConfig); if (!isValid) { String allErrors = new AllConfigErrors(preprocessedConfig.getAllErrors()).asString(); result.badRequest(actionFailed.addParam(allErrors)); } return isValid; }
Source:
private Integer getHash(byte[] hash) { return (hash[3] << 0) + (hash[2] << 8) + (hash[1] << 16) + (hash[0] << 24); }

Target:
private Integer getHash(byte[] hash) { return (hash[3]) + (hash[2] << 8) + (hash[1] << 16) + (hash[0] << 24); }
Source:
protected void migrateData(ReviewDb db, UpdateUI ui) throws OrmException { List<AccountGroup> all = db.accountGroups().all().toList(); if (all.contains(AccountGroup.CHANGE_OWNER)) { return; } AccountGroup changeOwners = newGroup(db, "Change Owner", AccountGroup.CHANGE_OWNER); changeOwners.setDescription("The owner of a change"); changeOwners.setOwnerGroupUUID(adminGroup(all)); changeOwners.setType(AccountGroup.Type.SYSTEM); db.accountGroups().insert( Collections.<AccountGroup> singletonList(changeOwners)); }

Target:
protected void migrateData( ReviewDb db, UpdateUI ui) throws OrmException { Repository git; try { git = mgr.openRepository(allProjects); } catch (IOException e) { throw new OrmException(e); } try { MetaDataUpdate md = new MetaDataUpdate(GitReferenceUpdated.DISABLED, allProjects, git); ProjectConfig config = ProjectConfig.read(md); List<AccountGroup.UUID> adminGroupUUIDs = getAdministrateServerGroups(db, config); if (!adminGroupUUIDs.isEmpty()) { createGroup(db, "Change Owner", adminGroupUUIDs.get(0), "The owner of a change"); } } catch (IOException e) { throw new OrmException(e); } catch (ConfigInvalidException e) { throw new OrmException(e); } finally { git.close(); } }
Source:
private static boolean invalidMethodAndVariable(Symbol currentMember, Symbol knownMember) { Symbol methodSymbol = currentMember.isMethodSymbol() ? currentMember : knownMember; Symbol variableSymbol = methodSymbol == currentMember ? knownMember : currentMember; return sameVisibilityNotPrivate(currentMember, knownMember) && !methodReturningVariableWithSameName(methodSymbol, variableSymbol) && !isBuilderPattern(methodSymbol, variableSymbol); }

Target:
private static boolean invalidMethodAndVariable(Symbol currentMember, Symbol knownMember) { if (!sameVisibilityNotPrivate(currentMember, knownMember)) { return false; } Symbol methodSymbol = currentMember.isMethodSymbol() ? currentMember : knownMember; Symbol variableSymbol = methodSymbol == currentMember ? knownMember : currentMember; return !methodReturningVariableWithSameName(methodSymbol, variableSymbol) && !isBuilderPattern(methodSymbol, variableSymbol); }
Source:
private boolean hasSuspendedVms() { List<VM> vmList = vmDao.getAllForStoragePool(getOldStoragePool().getId()); String suspendedVms = vmList.stream() .filter(vm -> vm.getStatus().isSuspended() && getStoragePool().getCompatibilityVersion().greater(vm.getCustomCompatibilityVersion())) .map(VM::getName) .collect(Collectors.joining(", ")); if (!suspendedVms.isEmpty()) { addValidationMessage(EngineMessage.ERROR_CANNOT_UPDATE_STORAGE_POOL_SUSPENDED_VM_COMPATIBILITY_VERSION_NOT_SUPPORTED); addValidationMessageVariable("VmsList", suspendedVms); return true; } return false; }

Target:
private boolean hasSuspendedVms() { List<VM> vmList = vmDao.getAllForStoragePool(getOldStoragePool().getId()); String suspendedVms = vmList.stream() .filter(vm -> vm.getStatus().isSuspended() && getStoragePool().getCompatibilityVersion().greater(vm.getCustomCompatibilityVersion())) .map(VM::getName) .collect(Collectors.joining("\n")); if (!suspendedVms.isEmpty()) { addValidationMessage(EngineMessage.ERROR_CANNOT_UPDATE_STORAGE_POOL_SUSPENDED_VM_COMPATIBILITY_VERSION_NOT_SUPPORTED); addValidationMessageVariable("VmsList", suspendedVms); return true; } return false; }
Source:
public static void prepare() throws FileNotFoundException { fileLoggerModule = FileLoggerModule.getSingleton(); consoleLoggerModule = ConsoleLoggerModule.getSingleton(); fileLoggerModule.prepare(); consoleLoggerModule.prepare(); }

Target:
public static void prepare() throws FileNotFoundException { fileLoggerModule = FileLoggerModule.getSingleton().prepare(); consoleLoggerModule = ConsoleLoggerModule.getSingleton().prepare(); }
Source:
public void testCompactFormatProperty() throws IOException { Configuration conf = new Configuration(false); assertEquals(conf.size(), 0); StringWriter writer = new StringWriter(); BufferedWriter out = new BufferedWriter(writer); out.write("<?xml version=\"1.0\"?>\n"); out.write("<configuration>\n"); out.write("<property name=\"key1\" value=\"val1\"/>"); out.write("</configuration>\n"); out.flush(); out.close(); InputStream is = new ByteArrayInputStream(writer.toString().getBytes()); conf = new Configuration(false); ConfigurationUtils.load(conf, is); assertEquals(conf.size(), 1); assertEquals(conf.get("key1"), "val1"); }

Target:
public void testCompactFormatProperty() throws IOException { final String testfile = "test-compact-format-property.xml"; Configuration conf = new Configuration(false); assertEquals(0, conf.size()); ConfigurationUtils.load(conf, Thread.currentThread() .getContextClassLoader().getResource(testfile).openStream()); assertEquals(2, conf.size()); assertEquals("val1", conf.get("key.1")); assertEquals("val2", conf.get("key.2")); }
Source:
public void updateMapMarkersToController(List<NearbyBaseMarker> nearbyBaseMarkers) { NearbyController.markerExistsMap = new HashMap<>(); NearbyController.markerNeedPicMap = new HashMap<>(); NearbyController.markerLabelList.clear(); for (int i = 0; i < nearbyBaseMarkers.size(); i++) { NearbyBaseMarker nearbyBaseMarker = nearbyBaseMarkers.get(i); NearbyController.markerLabelList.add( new MarkerPlaceGroup(nearbyBaseMarker.getMarker(), bookmarkLocationDao.findBookmarkLocation(nearbyBaseMarker.getPlace()), nearbyBaseMarker.getPlace())); NearbyController.markerExistsMap.put((nearbyBaseMarkers.get(i).getPlace().hasWikidataLink()), nearbyBaseMarkers.get(i).getMarker()); NearbyController.markerNeedPicMap.put(((nearbyBaseMarkers.get(i).getPlace().pic == null) ? true : false), nearbyBaseMarkers.get(i).getMarker()); Log.d("deneme5","pics:"+nearbyBaseMarkers.get(i).getPlace().pic); if (!nearbyBaseMarkers.get(i).getPlace().pic.trim().isEmpty() && bookmarkLocationDao.findBookmarkLocation(nearbyBaseMarker.getPlace())) { Log.d("deneme5","pic not empty and bookmarked:"+nearbyBaseMarkers.get(i).getPlace().name); } } }

Target:
public void updateMapMarkersToController(List<NearbyBaseMarker> nearbyBaseMarkers) { NearbyController.markerExistsMap = new HashMap<>(); NearbyController.markerNeedPicMap = new HashMap<>(); NearbyController.markerLabelList.clear(); for (int i = 0; i < nearbyBaseMarkers.size(); i++) { NearbyBaseMarker nearbyBaseMarker = nearbyBaseMarkers.get(i); NearbyController.markerLabelList.add( new MarkerPlaceGroup(nearbyBaseMarker.getMarker(), bookmarkLocationDao.findBookmarkLocation(nearbyBaseMarker.getPlace()), nearbyBaseMarker.getPlace())); NearbyController.markerExistsMap.put((nearbyBaseMarkers.get(i).getPlace().hasWikidataLink()), nearbyBaseMarkers.get(i).getMarker()); NearbyController.markerNeedPicMap.put(((nearbyBaseMarkers.get(i).getPlace().pic == null) ? true : false), nearbyBaseMarkers.get(i).getMarker()); } }
Source:
private double estimateOutlierProbability(final AlleleFractionData data) { final Function<Double, Double> objective = outlierProbability -> AlleleFractionLikelihoods.logLikelihood(parameters.copyWithNewOutlierProbability(outlierProbability), minorFractions, data); return OptimizationUtils.argmax(objective, 0.0, MAX_REASONABLE_OUTLIER_PROBABILITY, parameters.getOutlierProbability()); }

Target:
private double estimateOutlierProbability(final AlleleFractionData data) { final Function<Double, Double> objective = outlierProbability -> AlleleFractionLikelihoods.logLikelihood(globalParameters.copyWithNewOutlierProbability(outlierProbability), minorFractions, data); return OptimizationUtils.argmax(objective, 0.0, MAX_REASONABLE_OUTLIER_PROBABILITY, globalParameters.getOutlierProbability()); }
Source:
void completePlayerSetup(boolean asked) { if (asked) { skinLayout = (OoyalaSkinLayout) findViewById(R.id.ooyalaSkin); PlayerDomain domain1 = new PlayerDomain(domain); Options options = new Options.Builder().setShowNativeLearnMoreButton(false).setShowPromoImage(false).setUseExoPlayer(true).build(); player = new OoyalaPlayer(pcode, domain1, options); JSONObject overrides = createSkinOverrides(); SkinOptions skinOptions = new SkinOptions.Builder().setSkinOverrides(overrides).build(); playerLayoutController = new OoyalaSkinLayoutController(getApplication(), skinLayout, player, skinOptions); playerLayoutController.addObserver(this); player.addObserver(this); if (player.setEmbedCode(embedCode)) { } else { Log.e(TAG, "Asset Failure"); } } }

Target:
void completePlayerSetup(boolean asked) { if (asked) { skinLayout = (OoyalaSkinLayout) findViewById(R.id.ooyalaSkin); PlayerDomain playerDomain = new PlayerDomain(domain); Options options = new Options.Builder().setShowNativeLearnMoreButton(false).setShowPromoImage(false).setUseExoPlayer(true).build(); player = new OoyalaPlayer(pcode, playerDomain, options); JSONObject overrides = createSkinOverrides(); SkinOptions skinOptions = new SkinOptions.Builder().setSkinOverrides(overrides).build(); playerLayoutController = new OoyalaSkinLayoutController(getApplication(), skinLayout, player, skinOptions); playerLayoutController.addObserver(this); player.addObserver(this); if (player.setEmbedCode(embedCode)) { } else { Log.e(TAG, "Asset Failure"); } } }
Source:
default void compute(final ImmutableList.Builder<ShardedResultGroup> groups, final AggregationOutput out, final long cadence) { final List<TdigestPoint> metrics = out.getMetrics().getDataAs(TdigestPoint.class); final Map<ComputeDistributionStat.Percentile, List<Point>> resMap = new HashMap<>(); for (TdigestPoint tigestPoint : metrics) { ComputeDistributionStat .Percentile .DEFAULT .forEach(p -> compute(tigestPoint, resMap, p)); } for (Map.Entry<ComputeDistributionStat.Percentile, List<Point>> entry : resMap.entrySet()) { Set<Series> newSet = new HashSet<>(); out.getSeries().forEach(s -> updateMetadata(s, entry.getKey(), newSet)); groups.add(new ShardedResultGroup(ImmutableMap.of(), out.getKey(), newSet, MetricCollection.points(entry.getValue()), cadence)); } }

Target:
default void compute(final ImmutableList.Builder<ShardedResultGroup> groups, final AggregationOutput out, final long cadence) { final List<TdigestPoint> metrics = out.getMetrics().getDataAs(TdigestPoint.class); final Map<ComputeDistributionStat.Percentile, List<Point>> resMap = new HashMap<>(); for (TdigestPoint tdigestPoint : metrics) { ComputeDistributionStat .Percentile .DEFAULT .forEach(p -> compute(tdigestPoint, resMap, p)); } for (Map.Entry<ComputeDistributionStat.Percentile, List<Point>> entry : resMap.entrySet()) { Set<Series> newSet = new HashSet<>(); out.getSeries().forEach(s -> updateMetadata(s, entry.getKey(), newSet)); groups.add(new ShardedResultGroup(ImmutableMap.of(), out.getKey(), newSet, MetricCollection.points(entry.getValue()), cadence)); } }
Source:
public JavaSymbol resolveAs(Tree tree, int kind, Resolve.Env resolveEnv, boolean associateReference) { if (tree.is(Tree.Kind.IDENTIFIER, Tree.Kind.MEMBER_SELECT)) { JavaSymbol resolvedSymbol; IdentifierTree identifierTree; if (tree.is(Tree.Kind.MEMBER_SELECT)) { MemberSelectExpressionTree mse = (MemberSelectExpressionTree) tree; if (JavaKeyword.CLASS.getValue().equals(mse.identifier().name())) { return resolveClassType(tree, resolveEnv, mse); } identifierTree = mse.identifier(); Resolve.Resolution res = getSymbolOfMemberSelectExpression(mse, kind, resolveEnv); resolvedSymbol = res.symbol(); JavaType resolvedType = typeSubstitutionSolver.applySiteSubstitution(res.type(), getType(mse.expression())); registerType(identifierTree, resolvedType); registerType(tree, resolvedType); } else { identifierTree = (IdentifierTree) tree; Resolve.Resolution resolution = resolve.findIdent(resolveEnv, identifierTree.name(), kind); resolvedSymbol = resolution.symbol(); registerType(tree, resolution.type()); } if(associateReference) { associateReference(identifierTree, resolvedSymbol); } return resolvedSymbol; } tree.accept(this); JavaType type = getType(tree); if (tree.is(Tree.Kind.INFERED_TYPE)) { type = Symbols.unknownType; registerType(tree, type); } if (type == null) { throw new IllegalStateException("Type not resolved " + tree); } return type.symbol; }

Target:
public JavaSymbol resolveAs(Tree tree, int kind, Resolve.Env resolveEnv, boolean associateReference) { if (tree.is(Tree.Kind.IDENTIFIER, Tree.Kind.MEMBER_SELECT)) { JavaSymbol resolvedSymbol; IdentifierTree identifierTree; if (tree.is(Tree.Kind.MEMBER_SELECT)) { MemberSelectExpressionTree mse = (MemberSelectExpressionTree) tree; if (JavaKeyword.CLASS.getValue().equals(mse.identifier().name())) { return resolveClassType(tree, resolveEnv, mse); } identifierTree = mse.identifier(); Resolve.Resolution res = getSymbolOfMemberSelectExpression(mse, kind, resolveEnv); resolvedSymbol = res.symbol(); JavaType resolvedType = resolve.resolveTypeSubstitution(res.type(), getType(mse.expression())); registerType(identifierTree, resolvedType); registerType(tree, resolvedType); } else { identifierTree = (IdentifierTree) tree; Resolve.Resolution resolution = resolve.findIdent(resolveEnv, identifierTree.name(), kind); resolvedSymbol = resolution.symbol(); registerType(tree, resolution.type()); } if(associateReference) { associateReference(identifierTree, resolvedSymbol); } return resolvedSymbol; } tree.accept(this); JavaType type = getType(tree); if (tree.is(Tree.Kind.INFERED_TYPE)) { type = Symbols.unknownType; registerType(tree, type); } if (type == null) { throw new IllegalStateException("Type not resolved " + tree); } return type.symbol; }
Source:
public void setValue(List<T> value, boolean fireEvents) { List<T> selectedItems = getValue(); if (value == selectedItems || (selectedItems != null && selectedItems.equals(value))) { return; } clearAllSelections(); if(value == null){ return; } for (T currentvalue : value) { if (checkBoxes.containsKey(currentvalue)) { checkBoxes.get(currentvalue).setValue(true); } } if (fireEvents) { ValueChangeEvent.fire(this, value); } }

Target:
public void setValue(List<T> value, boolean fireEvents) { List<T> selectedItems = getValue(); if (value == selectedItems || (selectedItems != null && value != null && ListUtils.listsEqual(selectedItems, value))) { return; } clearAllSelections(); if(value == null){ return; } for (T currentvalue : value) { if (checkBoxes.containsKey(currentvalue)) { checkBoxes.get(currentvalue).setValue(true); } } if (fireEvents) { ValueChangeEvent.fire(this, value); } }
Source:
public void testProjectUnresolvedAliasInFilter() { assertEquals("1:8: Unknown column [tni]", error("SELECT tni AS i FROM test WHERE i > 10 GROUP BY i")); assertEquals("1:31: Unknown column [i]", error("SELECT i AS i FROM test WHERE i > 10 GROUP BY i")); }

Target:
public void testProjectUnresolvedAliasInFilter() { assertEquals("1:8: Unknown column [tni]", error("SELECT tni AS i FROM test WHERE i > 10 GROUP BY i")); }
Source:
public <T> Maybe<Class<T>> tryResolveClass(String type, Iterable<String> bundleUrlsOrNameVersionString) { Map<String,Throwable> bundleProblems = MutableMap.of(); for (String bundleUrlOrNameVersionString: bundleUrlsOrNameVersionString) { try { String bundleNameVersion = bundleUrlToNameVersionString.get(bundleUrlOrNameVersionString); if (bundleNameVersion==null) { bundleNameVersion = bundleUrlOrNameVersionString; } Maybe<Bundle> bundle = Osgis.getBundle(framework, bundleNameVersion); if (bundle.isPresent()) { Bundle b = bundle.get(); Class<T> clazz; if (Osgis.isExtensionBundle(b)) { @SuppressWarnings("unchecked") Class<T> c = (Class<T>)Class.forName(type); clazz = c; } else { @SuppressWarnings("unchecked") Class<T> c = (Class<T>)b.loadClass(type); clazz = c; } return Maybe.of(clazz); } else { bundleProblems.put(bundleUrlOrNameVersionString, new IllegalStateException("Unable to find bundle "+bundleUrlOrNameVersionString)); } } catch (Exception e) { Exceptions.propagateIfFatal(e); bundleProblems.put(bundleUrlOrNameVersionString, e); Throwable cause = e.getCause(); if (cause != null && cause.getMessage().contains("Unresolved constraint in bundle")) { log.warn("Unresolved constraint.", e); } } } return Maybe.absent("Unable to resolve class "+type+": "+bundleProblems); }

Target:
public <T> Maybe<Class<T>> tryResolveClass(String type, Iterable<String> bundleUrlsOrNameVersionString) { Map<String,Throwable> bundleProblems = MutableMap.of(); for (String bundleUrlOrNameVersionString: bundleUrlsOrNameVersionString) { try { String bundleNameVersion = bundleUrlToNameVersionString.get(bundleUrlOrNameVersionString); if (bundleNameVersion==null) { bundleNameVersion = bundleUrlOrNameVersionString; } Maybe<Bundle> bundle = Osgis.getBundle(framework, bundleNameVersion); if (bundle.isPresent()) { Bundle b = bundle.get(); Class<T> clazz; if (Osgis.isExtensionBundle(b)) { @SuppressWarnings("unchecked") Class<T> c = (Class<T>)Class.forName(type); clazz = c; } else { @SuppressWarnings("unchecked") Class<T> c = (Class<T>)b.loadClass(type); clazz = c; } return Maybe.of(clazz); } else { bundleProblems.put(bundleUrlOrNameVersionString, new IllegalStateException("Unable to find bundle "+bundleUrlOrNameVersionString)); } } catch (Exception e) { Exceptions.propagateIfFatal(e); bundleProblems.put(bundleUrlOrNameVersionString, e); Throwable cause = e.getCause(); if (cause != null && cause.getMessage().contains("Unresolved constraint in bundle")) { log.warn("Unresolved constraint resolving OSGi bundle "+bundleUrlOrNameVersionString+" to load "+type+": "+cause.getMessage()); if (log.isDebugEnabled()) log.debug("Trace for OSGi resolution failure", e); } } } return Maybe.absent("Unable to resolve class "+type+": "+bundleProblems); }
Source:
public void transferDirectMessagesToAnonymousDestination(UUID userID) { UserDTO user = userService.getPrivateValidatedUser(userID); try { tryTransferDirectMessagesToAnonymousDestination(user); } catch (DataIntegrityViolationException e) { if (e.getCause() instanceof ConstraintViolationException) { logger.info( "The direct log messages of user with mobile number '" + user.getMobileNumber() + "' and ID '" + user.getID() + "' were apparently concurrently moved to the anonymous messages while handling another request.", e); } else { throw e; } } }

Target:
public void transferDirectMessagesToAnonymousDestination(UUID userID) { UserDTO user = userService.getPrivateValidatedUser(userID); try { tryTransferDirectMessagesToAnonymousDestination(user); } catch (DataIntegrityViolationException e) { if (e.getCause() instanceof ConstraintViolationException) { logger.info( "The direct messages of user with mobile number '" + user.getMobileNumber() + "' and ID '" + user.getID() + "' were apparently concurrently moved to the anonymous messages while handling another request.", e); } else { throw e; } } }
Source:
public static <T> Value pick(Values values, String qualifiers) { final int count = values.size(); if (count == 0) return null; BigInteger possibles = BigInteger.ZERO; for (int i = 0; i < count; i++) possibles = possibles.setBit(i); StringTokenizer st = new StringTokenizer(qualifiers, "-"); while (st.hasMoreTokens()) { String qualifier = st.nextToken(); String paddedQualifier = "-" + qualifier + "-"; BigInteger matches = BigInteger.ZERO; for (int i = 0; i < count; i++) { if (!possibles.testBit(i)) continue; if (values.get(i).qualifiers.contains(paddedQualifier)) { matches = matches.setBit(i); } } if (!matches.equals(BigInteger.ZERO)) { possibles = possibles.and(matches); } if (matches.bitCount() == 1) break; } int targetApiLevel = getVersionQualifierApiLevel(qualifiers); if (qualifiers.length() > 0 && targetApiLevel != -1) { Value bestMatch = null; int bestMatchDistance = Integer.MAX_VALUE; for (int i = 0; i < count; i++) { if (!possibles.testBit(i)) { continue; } Value value = values.get(i); int distance = getDistance(value, targetApiLevel); if (distance < bestMatchDistance && distance >= 0) { bestMatch = value; bestMatchDistance = distance; } } if (bestMatch != null) { return bestMatch; } } for (int i = 0; i < count; i++) { if (possibles.testBit(i)) return values.get(i); } throw new IllegalStateException("couldn't handle qualifiers \"" + qualifiers + "\""); }

Target:
public static <T> Value pick(Values values, String qualifiers) { final int count = values.size(); if (count == 0) return null; BigInteger possibles = BigInteger.ZERO; for (int i = 0; i < count; i++) possibles = possibles.setBit(i); StringTokenizer st = new StringTokenizer(qualifiers, "-"); while (st.hasMoreTokens()) { String qualifier = st.nextToken(); String paddedQualifier = "-" + qualifier + "-"; BigInteger matches = BigInteger.ZERO; for (int i = 0; i < count; i++) { if (!possibles.testBit(i)) continue; if (values.get(i).qualifiers.contains(paddedQualifier)) { matches = matches.setBit(i); } } if (!matches.equals(BigInteger.ZERO)) { possibles = possibles.and(matches); } if (matches.bitCount() == 1) break; } int targetApiLevel = getVersionQualifierApiLevel(qualifiers); if (qualifiers.length() > 0 && targetApiLevel != -1) { Value bestMatch = null; int bestMatchDistance = Integer.MAX_VALUE; for (int i = 0; i < count; i++) { if (!possibles.testBit(i)) { continue; } Value value = values.get(i); int distance = getDistance(value, targetApiLevel); if (distance >= 0 && distance < bestMatchDistance) { bestMatch = value; bestMatchDistance = distance; } } if (bestMatch != null) { return bestMatch; } } for (int i = 0; i < count; i++) { if (possibles.testBit(i)) return values.get(i); } throw new IllegalStateException("couldn't handle qualifiers \"" + qualifiers + "\""); }
Source:
public void setBiome(Vector3i position, BiomeType biome) { net.minecraft.world.chunk.Chunk chunk = this.getChunkFromBlockCoords(VecHelper.toBlockPos(position)); byte[] biomeArray = chunk.getBiomeArray(); int i = position.getX() & 15; int j = position.getZ() & 15; biomeArray[j << 4 | i] = (byte) (((BiomeGenBase) biome).biomeID & 255); chunk.setBiomeArray(biomeArray); }

Target:
public void setBiome(Vector3i position, BiomeType biome) { int x = position.getX() >> 4; int z = position.getZ() >> 4; IChunkProvider chunkProvider = this.getChunkProvider(); if (!chunkProvider.chunkExists(x, z)) { return; } net.minecraft.world.chunk.Chunk chunk = chunkProvider.provideChunk(x, z); byte[] biomeArray = chunk.getBiomeArray(); int i = position.getX() & 15; int j = position.getZ() & 15; biomeArray[j << 4 | i] = (byte) (((BiomeGenBase) biome).biomeID & 255); chunk.setBiomeArray(biomeArray); }
Source:
public void registerJob(final String cronExpression, final QuartzJobDescription jobDescription) throws SchedulerException { requireNonNull(jobDescription, "jobDescription is null"); if(ifJobExist(jobDescription.getGroupName())) { throw new SchedulerException("can not register existing job " + jobDescription.getGroupName()); } if (!CronExpression.isValidExpression(cronExpression)) { throw new SchedulerException("The cron expression string <" + cronExpression + "> is not valid."); } final JobDetail job = JobBuilder.newJob(jobDescription.getJobClass()) .withIdentity("job1", jobDescription.getGroupName()).build(); job.getJobDataMap().putAll(jobDescription.getContextMap()); final Trigger trigger = TriggerBuilder .newTrigger() .withSchedule( CronScheduleBuilder.cronSchedule(cronExpression) .withMisfireHandlingInstructionFireAndProceed() ) .build(); this.scheduler.scheduleJob(job, trigger); logger.info("Quartz Schedule with jobDetail " + job.getDescription() + " is registered."); }

Target:
public void registerJob(final String cronExpression, final QuartzJobDescription jobDescription) throws SchedulerException { requireNonNull(jobDescription, "jobDescription is null"); if(ifJobExist(jobDescription.getGroupName())) { throw new SchedulerException("can not register existing job " + jobDescription.getGroupName()); } if (!CronExpression.isValidExpression(cronExpression)) { throw new SchedulerException("The cron expression string <" + cronExpression + "> is not valid."); } final JobDetail job = JobBuilder.newJob(jobDescription.getJobClass()) .withIdentity(DEFAULT_JOB_NAME, jobDescription.getGroupName()).build(); job.getJobDataMap().putAll(jobDescription.getContextMap()); final Trigger trigger = TriggerBuilder .newTrigger() .withSchedule( CronScheduleBuilder.cronSchedule(cronExpression) .withMisfireHandlingInstructionFireAndProceed() ) .build(); this.scheduler.scheduleJob(job, trigger); logger.info("Quartz Schedule with jobDetail " + job.getDescription() + " is registered."); }
Source:
private void updateManagementServerHostUuid(Connection conn) { try (final PreparedStatement updateStatement = conn.prepareStatement("UPDATE cloud.mshost SET uuid=UUID()")) { updateStatement.executeUpdate(); } catch (SQLException e) { LOG.error("Failed to set dynamic.apichecker.enabled to true, please run migrate-dynamicroles.py script to manually migrate to dynamic roles.", e); } }

Target:
private void updateManagementServerHostUuid(Connection conn) { try (final PreparedStatement updateStatement = conn.prepareStatement("UPDATE cloud.mshost SET uuid=UUID()")) { updateStatement.executeUpdate(); } catch (SQLException e) { LOG.error("Failed to add an UUID to each management server.", e); } }
Source:
public boolean matches(String prefix, Object actual, Object expected, JSONCompareResult result) { if (comparator instanceof LocationAwareValueMatcher) { return ((LocationAwareValueMatcher<Object>)comparator).equal(prefix, actual, expected, result); } return comparator.equal(actual, expected); }

Target:
public boolean matches(String prefix, Object actual, Object expected, JSONCompareResult result) throws ValueMatcherException { if (comparator instanceof LocationAwareValueMatcher) { return ((LocationAwareValueMatcher<Object>)comparator).equal(prefix, actual, expected, result); } return comparator.equal(actual, expected); }
Source:
public ActiveReviewManager() { PlatformUI.getWorkbench().getActiveWorkbenchWindow().addPageListener(pageListener); IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); if (activePage != null) { IWorkbenchPart activePart = activePage.getActivePart(); if (activePart != null) { editorPartListener.partActivated(activePart); } } }

Target:
public ActiveReviewManager() { PlatformUI.getWorkbench().getActiveWorkbenchWindow().addPageListener(pageListener); PlatformUI.getWorkbench().addWindowListener(windowListener); windowListener.windowActivated(PlatformUI.getWorkbench().getActiveWorkbenchWindow()); }
Source:
private void notifyUI() { if (!fUIControl.isDisposed()) fUIControl.getDisplay().asyncExec(new Runnable() { @Override public void run() { if (!fUIControl.isDisposed()) fUIListener.update(); } }); }

Target:
private void notifyUI() { final Control c = fUIControl; if (c != null && !c.isDisposed()) c.getDisplay().asyncExec(new Runnable() { @Override public void run() { if (!c.isDisposed()) fUIListener.update(); } }); }
Source:
private void updateState() { if (world.isSkyVisible(pos.up())) { this.setSunState(NIGHTGEN); if (!world.isRaining() && !world.isThundering() && world.isDay()) { this.setSunState(DAYGEN); } } else { this.setSunState(ZEROGEN); } if (prevState != this.getSunState()) { boolean isGenerating = false; isGenerating = getSunState() == DAYGEN; world.setBlockState(pos, world.getBlockState(pos).with(BlockMachineBase.ACTIVE, isGenerating)); prevState = this.getSunState(); } }

Target:
private void updateState() { if (world.isSkyVisible(pos.up())) { this.setSunState(NIGHTGEN); if (!world.isRaining() && !world.isThundering() && world.isDay()) { this.setSunState(DAYGEN); } } else { this.setSunState(ZEROGEN); } if (prevState != this.getSunState()) { boolean isGenerating = getSunState() == DAYGEN; world.setBlockState(pos, world.getBlockState(pos).with(BlockMachineBase.ACTIVE, isGenerating)); prevState = this.getSunState(); } }
Source:
public String toString() { return "CacheRefreshedEvent[]"; }

Target:
public String toString() { return "CacheRefreshedEvent[timestamp=" + getTimestamp() + "]"; }
Source:
public String getLabel() { return "Drop Association as CreateLinkAction"; }

Target:
public String getLabel() { return Messages.AssociationToCreateLinkActionDropStrategy_Label; }
Source:
public void release() { isInUse.set(false); int anyVersion = -1; try { zk.delete(absoluteLockPath, anyVersion); log.log( java.util.logging.Level.INFO, "Released lock " + absoluteLockPath); } catch (InterruptedException e) { log.log( java.util.logging.Level.INFO, "InterruptedException while trying to release lock " + absoluteLockPath, e); } catch (KeeperException e) { log.log( java.util.logging.Level.INFO, "KeeperException while trying to release lock " + absoluteLockPath, e); } }

Target:
public void release() { isInUse.set(false); try { final int anyVersion = -1; zk.delete(absoluteLockPath, anyVersion); log.log( java.util.logging.Level.INFO, "Released lock " + absoluteLockPath); } catch (InterruptedException e) { log.log( java.util.logging.Level.INFO, "InterruptedException while trying to release lock " + absoluteLockPath, e); } catch (KeeperException e) { log.log( java.util.logging.Level.INFO, "KeeperException while trying to release lock " + absoluteLockPath, e); } }
Source:
private void addDefaultConfig(String clientNameParameter, Map<String, String> properties) { if (clientNameParameter.contains("SAML2Client")) { properties.put(PropertiesConfigFactory.SAML_KEYSTORE_PATH, keystoreService.getKeystorePath()); char[] giksp = null; try { giksp = aliasService.getGatewayIdentityKeystorePassword(); } catch (AliasServiceException e) { log.noKeystorePasswordProvisioned(e); } if (giksp == null) { giksp = masterService.getMasterSecret(); } properties.put(PropertiesConfigFactory.SAML_KEYSTORE_PASSWORD, new String(giksp)); char[] gip = null; try { gip = aliasService.getGatewayIdentityPassphrase(); } catch(AliasServiceException ase) { log.noPrivateKeyPasshraseProvisioned(ase); } if (gip == null) { gip = masterService.getMasterSecret(); } properties.put(PropertiesConfigFactory.SAML_PRIVATE_KEY_PASSWORD, new String(gip)); } }

Target:
private void addDefaultConfig(String clientNameParameter, Map<String, String> properties) { if (clientNameParameter.contains(SAML2Client.class.getSimpleName())) { properties.put(PropertiesConfigFactory.SAML_KEYSTORE_PATH, keystoreService.getKeystorePath()); char[] giksp = null; try { giksp = aliasService.getGatewayIdentityKeystorePassword(); } catch (AliasServiceException e) { log.noKeystorePasswordProvisioned(e); } if (giksp == null) { giksp = masterService.getMasterSecret(); } properties.put(PropertiesConfigFactory.SAML_KEYSTORE_PASSWORD, new String(giksp)); char[] gip = null; try { gip = aliasService.getGatewayIdentityPassphrase(); } catch(AliasServiceException ase) { log.noPrivateKeyPasshraseProvisioned(ase); } if (gip == null) { gip = masterService.getMasterSecret(); } properties.put(PropertiesConfigFactory.SAML_PRIVATE_KEY_PASSWORD, new String(gip)); } }
Source:
public PythonApp createApp(String name) { if (streamApp == null) { streamApp = new PythonApp(name); } return streamApp; }

Target:
public PythonApp createApp(String name) { if (streamApp == null) { streamApp = new PythonApp(name); if (this.mode != null) { streamApp.setMode(this.mode); } } return streamApp; }
Source:
public void testIPV4EncodeProxyV1() { HAProxyMessageEncoder encoder = new HAProxyMessageEncoder(); EmbeddedChannel ch = new EmbeddedChannel(encoder); HAProxyMessage message = new HAProxyMessage( HAProxyProtocolVersion.V1, HAProxyCommand.PROXY, HAProxyProxiedProtocol.TCP4, "192.168.0.1", "192.168.0.11", 56324, 443); assertTrue(ch.writeOutbound(message)); ByteBuf byteBuf = ch.readOutbound(); assertEquals("PROXY TCP4 192.168.0.1 192.168.0.11 56324 443\r\n", byteBuf.toString(CharsetUtil.US_ASCII)); }

Target:
public void testIPV4EncodeProxyV1() { EmbeddedChannel ch = new EmbeddedChannel(INSTANCE); HAProxyMessage message = new HAProxyMessage( HAProxyProtocolVersion.V1, HAProxyCommand.PROXY, HAProxyProxiedProtocol.TCP4, "192.168.0.1", "192.168.0.11", 56324, 443); assertTrue(ch.writeOutbound(message)); ByteBuf byteBuf = ch.readOutbound(); assertEquals("PROXY TCP4 192.168.0.1 192.168.0.11 56324 443\r\n", byteBuf.toString(CharsetUtil.US_ASCII)); byteBuf.release(); assertFalse(ch.finish()); }
Source:
public Configuration(SQLTemplates templates) { this.templates = templates; for (Type<?> customType : templates.getCustomTypes()) { javaTypeMapping.register(customType); } for (Map.Entry<SchemaAndTable, SchemaAndTable> entry : templates.getTableOverrides().entrySet()) { nameMapping.registerTableOverride(entry.getKey(), entry.getValue()); } if (templates.isArraysSupported()) { List<Class<?>> classes = ImmutableList.<Class<?>>of(String.class, Long.class, Integer.class, Short.class, Byte.class, Boolean.class, java.sql.Date.class, java.sql.Timestamp.class, java.sql.Time.class, Double.class, Float.class); for (Class<?> cl : classes) { int code = jdbcTypeMapping.get(cl); String name = templates.getTypeNameForCode(code); Class<?> arrType = Array.newInstance(cl, 0).getClass(); javaTypeMapping.register(new ArrayType(arrType, name)); if (Primitives.isWrapperType(cl) && !cl.equals(Byte.class)) { cl = Primitives.unwrap(cl); arrType = Array.newInstance(cl, 0).getClass(); javaTypeMapping.register(new ArrayType(arrType, name)); } } } }

Target:
public Configuration(SQLTemplates templates) { this.templates = templates; for (Type<?> customType : templates.getCustomTypes()) { javaTypeMapping.register(customType); } for (Map.Entry<SchemaAndTable, SchemaAndTable> entry : templates.getTableOverrides().entrySet()) { registerTableOverride(entry.getKey(), entry.getValue()); } if (templates.isArraysSupported()) { List<Class<?>> classes = ImmutableList.<Class<?>>of(String.class, Long.class, Integer.class, Short.class, Byte.class, Boolean.class, java.sql.Date.class, java.sql.Timestamp.class, java.sql.Time.class, Double.class, Float.class); for (Class<?> cl : classes) { int code = jdbcTypeMapping.get(cl); String name = templates.getTypeNameForCode(code); Class<?> arrType = Array.newInstance(cl, 0).getClass(); javaTypeMapping.register(new ArrayType(arrType, name)); if (Primitives.isWrapperType(cl) && !cl.equals(Byte.class)) { cl = Primitives.unwrap(cl); arrType = Array.newInstance(cl, 0).getClass(); javaTypeMapping.register(new ArrayType(arrType, name)); } } } }
Source:
private static Container getContainerFields(Map<String, String> map) throws ParseException { Container container; container = new Container(); container.setInode(map.get(INODE)); container.setOwner(map.get(OWNER)); container.setCode(map.get("code")); container.setPreLoop(map.get("pre_loop")); container.setPostLoop(map.get("post_loop")); if (map.get(SHOW_ON_MENU) != null && !map.get(SHOW_ON_MENU).isEmpty()) { container.setShowOnMenu(Boolean.parseBoolean(map.get(SHOW_ON_MENU))); } container.setTitle(map.get(TITLE)); if (map.get(MOD_DATE) != null && !map.get(MOD_DATE).isEmpty()){ container.setModDate(df.parse(map.get(MOD_DATE))); } container.setModUser(map.get(MOD_USER)); if (map.get(SORT_ORDER) != null && !map.get(SORT_ORDER).isEmpty()){ container.setSortOrder(Integer.parseInt(map.get(SORT_ORDER))); } container.setFriendlyName(map.get(FRIENDLY_NAME)); if (map.get(MAX_CONTENTLETS) != null && !map.get(MAX_CONTENTLETS).isEmpty()){ container.setMaxContentlets(Integer.parseInt(map.get(MAX_CONTENTLETS))); } if (map.get(USE_DIV) != null && !map.get(USE_DIV).isEmpty()) { container.setUseDiv(Boolean.parseBoolean(map.get(USE_DIV))); } if (map.get(STATICIFY) != null && !map.get(STATICIFY).isEmpty()) { container.setStaticify(Boolean.parseBoolean(map.get(STATICIFY))); } container.setSortContentletsBy(map.get("sort_contentlets_by")); container.setLuceneQuery(map.get("lucene_query")); container.setNotes(map.get("notes")); container.setIdentifier(map.get(IDENTIFIER)); return container; }

Target:
private static Container getContainerFields(Map<String, String> map) throws ParseException { Container container; container = new Container(); container.setInode(map.get(INODE)); container.setOwner(map.get(OWNER)); if (map.get(IDATE) != null && !map.get(IDATE).isEmpty()) { container.setIDate(map.get(IDATE)); } container.setCode(map.get("code")); container.setPreLoop(map.get("pre_loop")); container.setPostLoop(map.get("post_loop")); if (map.get(SHOW_ON_MENU) != null && !map.get(SHOW_ON_MENU).isEmpty()) { container.setShowOnMenu(Boolean.parseBoolean(map.get(SHOW_ON_MENU))); } container.setTitle(map.get(TITLE)); if (map.get(MOD_DATE) != null && !map.get(MOD_DATE).isEmpty()){ container.setModDate(df.parse(map.get(MOD_DATE))); } container.setModUser(map.get(MOD_USER)); if (map.get(SORT_ORDER) != null && !map.get(SORT_ORDER).isEmpty()){ container.setSortOrder(Integer.parseInt(map.get(SORT_ORDER))); } container.setFriendlyName(map.get(FRIENDLY_NAME)); if (map.get(MAX_CONTENTLETS) != null && !map.get(MAX_CONTENTLETS).isEmpty()){ container.setMaxContentlets(Integer.parseInt(map.get(MAX_CONTENTLETS))); } if (map.get(USE_DIV) != null && !map.get(USE_DIV).isEmpty()) { container.setUseDiv(Boolean.parseBoolean(map.get(USE_DIV))); } if (map.get(STATICIFY) != null && !map.get(STATICIFY).isEmpty()) { container.setStaticify(Boolean.parseBoolean(map.get(STATICIFY))); } container.setSortContentletsBy(map.get("sort_contentlets_by")); container.setLuceneQuery(map.get("lucene_query")); container.setNotes(map.get("notes")); container.setIdentifier(map.get(IDENTIFIER)); return container; }
Source:
public static MultipartAttachmentWriter createMultipartWriter(BasicDocumentRevision revision, List<? extends Attachment> attachments, PushAttachmentsInline inlinePreference, int minRevPos) { MultipartAttachmentWriter mpw = null; for (Attachment att : attachments) { SavedAttachment savedAtt = (SavedAttachment) att; try { if (savedAtt.revpos > minRevPos && !savedAtt.shouldInline(inlinePreference)) { if (mpw == null) { mpw = new MultipartAttachmentWriter(); mpw.setBody(revision); } mpw.addAttachment(savedAtt, savedAtt.encoding == Attachment.Encoding.Plain ? savedAtt.length : savedAtt.encodedLength); } } catch (IOException ioe) { logger.log(Level.WARNING,"IOException caught when adding multiparts",ioe); } } if (mpw != null) { mpw.close(); } return mpw; }

Target:
public static MultipartAttachmentWriter createMultipartWriter(BasicDocumentRevision revision, List<? extends Attachment> attachments, PushAttachmentsInline inlinePreference, int minRevPos) { MultipartAttachmentWriter mpw = null; for (Attachment att : attachments) { SavedAttachment savedAtt = (SavedAttachment) att; try { if (savedAtt.revpos > minRevPos && !savedAtt.shouldInline(inlinePreference)) { if (mpw == null) { mpw = new MultipartAttachmentWriter(); mpw.setBody(revision); } mpw.addAttachment(savedAtt, savedAtt.onDiskLength()); } } catch (IOException ioe) { logger.log(Level.WARNING,"IOException caught when adding multiparts",ioe); } } if (mpw != null) { mpw.close(); } return mpw; }
Source:
public static Checksum newCrc32C() { try { return Shell.isJava9OrAbove() ? (Checksum) NEW_CRC32C_MH.invoke() : new PureJavaCrc32C(); } catch (Throwable e) { throw new RuntimeException(e); } }

Target:
static Checksum newCrc32C() { try { return useJava9Crc32C ? Java9Crc32CFactory.createChecksum() : new PureJavaCrc32C(); } catch (ExceptionInInitializerError | RuntimeException e) { LOG.error("CRC32C creation failed, switching to PureJavaCrc32C", e); useJava9Crc32C = false; return new PureJavaCrc32C(); } }