auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static List<DataSegment> getPublishedSegments(HadoopDruidIndexerConfig config) { final Configuration conf = new Configuration(); final ObjectMapper jsonMapper = HadoopDruidIndexerConfig.jsonMapper; ImmutableList.Builder<DataSegment> publishedSegmentsBuilder = ImmutableList.builder(); for (String propName : System.getProperties().stringPropertyNames()) { if (propName.startsWith("hadoop.")) { conf.set(propName.substring("hadoop.".length()), System.getProperty(propName)); } } final Path descriptorInfoDir = config.makeDescriptorInfoDir(); try { FileSystem fs = descriptorInfoDir.getFileSystem(conf); for (FileStatus status : fs.listStatus(descriptorInfoDir)) { final DataSegment segment = jsonMapper.readValue(fs.open(status.getPath()), DataSegment.class); publishedSegmentsBuilder.add(segment); log.info("Published %s", segment.getIdentifier()); } } catch (IOException e) { throw Throwables.propagate(e); } List<DataSegment> publishedSegments = publishedSegmentsBuilder.build(); return publishedSegments; }

Target:
public static List<DataSegment> getPublishedSegments(HadoopDruidIndexerConfig config) { final Configuration conf = new Configuration(); final ObjectMapper jsonMapper = HadoopDruidIndexerConfig.jsonMapper; ImmutableList.Builder<DataSegment> publishedSegmentsBuilder = ImmutableList.builder(); for (String propName : System.getProperties().stringPropertyNames()) { if (propName.startsWith("hadoop.")) { conf.set(propName.substring("hadoop.".length()), System.getProperty(propName)); } } final Path descriptorInfoDir = config.makeDescriptorInfoDir(); try { FileSystem fs = descriptorInfoDir.getFileSystem(conf); for (FileStatus status : fs.listStatus(descriptorInfoDir)) { final DataSegment segment = jsonMapper.readValue(fs.open(status.getPath()), DataSegment.class); publishedSegmentsBuilder.add(segment); log.info("Adding segment %s to the list of published segments", segment.getIdentifier()); } } catch (IOException e) { throw Throwables.propagate(e); } List<DataSegment> publishedSegments = publishedSegmentsBuilder.build(); return publishedSegments; }
Source:
public RemoteTableDescriptor<K, V> withReadFunction(TableReadFunction<K, V> readFn) { Preconditions.checkNotNull(readFn, "null read function"); this.readFn = readFn; this.readFn.setTableId(String.format("%s.%s", tableId, READ_FN)); return this; }

Target:
public RemoteTableDescriptor<K, V> withReadFunction(TableReadFunction<K, V> readFn) { Preconditions.checkNotNull(readFn, "null read function"); this.readFn = readFn; return this; }
Source:
public static void main(String[] args) throws IOException { try(AsyncHttpClient asyncHttpClient = new DefaultAsyncHttpClient()) { asyncHttpClient .prepareGet("<LINK_0>") .execute() .toCompletableFuture() .thenApply(Response::getResponseBody) .thenAccept(System.out::println) .join(); } }

Target:
public static void main(String[] args) throws IOException { try(AsyncHttpClient asyncHttpClient = asyncHttpClient()) { asyncHttpClient .prepareGet("<LINK_0>") .execute() .toCompletableFuture() .thenApply(Response::getResponseBody) .thenAccept(System.out::println) .join(); } }
Source:
public void acknowledgeResultsAsync(long nextToken) { executor.execute(() -> { try { thriftClient.acknowledgeResults(taskId, outputBufferId, nextToken); } catch (Exception exception) { log.debug(exception, "Acknowledge request failed: %s/%s/%s", taskId, outputBufferId, nextToken); } }); }

Target:
public void acknowledgeResultsAsync(long nextToken) { thriftClient.acknowledgeResults(taskId, outputBufferId, nextToken); }
Source:
private int getSleepTimeMs() { int backoff = 1 << Math.min(31, retries.get()); int sleepMs = base_sleep_ms * random.nextInt(backoff); if ( sleepMs > max_sleep_ms ) sleepMs = max_sleep_ms; if ( sleepMs < base_sleep_ms ) sleepMs = base_sleep_ms; return sleepMs; }

Target:
private int getSleepTimeMs() { int backoff = 1 << retries.get(); int sleepMs = base_sleep_ms * Math.max(1, random.nextInt(backoff)); if ( sleepMs > max_sleep_ms ) sleepMs = max_sleep_ms; return sleepMs; }
Source:
public static String typeNameToFileName (String typeName, String iconOrThumbnail) { ComponentType type; try { type = Enum.valueOf(ComponentType.class, typeName); } catch (IllegalArgumentException e) { type = Enum.valueOf(ComponentType.class, "UNKNOWN"); } String filename; if (iconOrThumbnail == "icon") { filename = ComponentIcons.iconNameForType(type); } else if (iconOrThumbnail == "thumb" || iconOrThumbnail == "thumbnail"){ filename = ComponentIcons.thumbnailNameForType(type); } else { filename = ""; } return filename; }

Target:
public static String typeNameToFileName (String typeName, String iconOrThumbnail) { ComponentType type; try { type = Enum.valueOf(ComponentType.class, typeName); } catch (IllegalArgumentException e) { type = Enum.valueOf(ComponentType.class, "UNKNOWN"); } String filename; if (iconOrThumbnail == GET_ICON) { filename = ComponentIcons.iconNameForType(type); } else if (iconOrThumbnail == GET_THUMBNAIL){ filename = ComponentIcons.thumbnailNameForType(type); } else { filename = ""; } return filename; }
Source:
private void addToMap(Map<String, Object> map, AMFDataObj o, String key) { AMFData obj = o.get(key); if (obj != null) { map.put(key, obj.getValue()); } else { logger.debug(key + " is not found in AMFDataObj"); } }

Target:
private void addToMap(Map<String, Object> map, AMFDataObj o, String key) { AMFData obj = o.get(key); if (obj != null) { map.put(key, obj.getValue()); } else { throw new NoSuchElementException(key + " is not found in AMFDataObj"); } }
Source:
private static void handlePartialDownloadWithMultipleRanges(InputStream is, List<ByteRange> byteRanges, HttpServletResponse response) throws IOException { ByteRangeInputStream bris = StreamUtils.findSource(ByteRangeInputStream.class, is); long length = StreamUtils.getLength(bris); boolean anyByteRangeNotSatisfiable = byteRanges.stream() .anyMatch(byteRange -> byteRange.getOffset() >= length); if (anyByteRangeNotSatisfiable) { setRangeNotSatisfiable(response, length); } else { final String rangesContentType = response.getContentType(); prepareResponseBuilderForPartialRequestWithMultipleRanges(response); copyPartialMultipleRangeToResponse(is, response, byteRanges, rangesContentType); } }

Target:
private static void handlePartialDownloadWithMultipleRanges(InputStream is, List<ByteRange> byteRanges, HttpServletResponse response) throws IOException { ByteRangeInputStream bris = StreamUtils.findSource(ByteRangeInputStream.class, is); long length = bris != null ? StreamUtils.getLength(bris) : 0; boolean anyByteRangeNotSatisfiable = byteRanges.stream() .anyMatch(byteRange -> byteRange.getOffset() >= length); if (anyByteRangeNotSatisfiable) { setRangeNotSatisfiable(response, length); } else { final String rangesContentType = response.getContentType(); prepareResponseBuilderForPartialRequestWithMultipleRanges(response); copyPartialMultipleRangeToResponse(is, response, byteRanges, rangesContentType); } }
Source:
public static StreamsAddressResponse getLogAddressSpace(RuntimeLayout runtimeLayout) { Set<String> segmentsHeadNodes = getChainHeadFromAllSegments(runtimeLayout.getLayout()); long[] globalTail = {Address.NON_EXIST}; final Map<UUID, StreamAddressSpace> streamsAddressSpace = new HashMap<>(); segmentsHeadNodes.stream() .map(node -> runtimeLayout .getLogUnitClient(node) .getLogAddressSpace()) .map(CFUtils::getUninterruptibly) .forEach(resp -> { globalTail[0] = Long.max(resp.getLogTail(), globalTail[0]); resp.getAddressMap().forEach((k, v) -> streamsAddressSpace .merge(k, v, StreamAddressSpace::merge)); }); log.debug("getLogAddressSpace: nodes selected log tail stream addresses {}", segmentsHeadNodes, globalTail[0], streamsAddressSpace); return new StreamsAddressResponse(globalTail[0], streamsAddressSpace); }

Target:
public static StreamsAddressResponse getLogAddressSpace(RuntimeLayout runtimeLayout) { Set<String> segmentsHeadNodes = getChainHeadFromAllSegments(runtimeLayout.getLayout()); AtomicLong globalTail = new AtomicLong(Address.NON_EXIST); final Map<UUID, StreamAddressSpace> streamsAddressSpace = new HashMap<>(); List<CompletableFuture<StreamsAddressResponse>> cfs = segmentsHeadNodes.stream() .map(node -> runtimeLayout.getLogUnitClient(node).getLogAddressSpace()) .collect(Collectors.toList()); cfs.stream() .map(CFUtils::getUninterruptibly) .forEach( resp -> { epochCheck(resp.getEpoch(), runtimeLayout.getLayout().getEpoch()); globalTail.set(Long.max(resp.getLogTail(), globalTail.get())); resp.getAddressMap() .forEach((k, v) -> streamsAddressSpace.merge(k, v, StreamAddressSpace::merge)); }); log.debug( "getLogAddressSpace: nodes selected log tail stream addresses {}", segmentsHeadNodes, globalTail.get(), streamsAddressSpace); return new StreamsAddressResponse(globalTail.get(), streamsAddressSpace); }
Source:
public TopNResultBuilder addEntry(DimensionAndMetricValueExtractor dimensionAndMetricValueExtractor) { String dimensionValue = dimensionAndMetricValueExtractor.getStringDimensionValue(dimSpec.getOutputName()); if (shouldAdd(dimensionValue)) { pQueue.add( new DimValHolder.Builder().withDimName(dimensionValue) .withMetricValues(dimensionAndMetricValueExtractor.getBaseObject()) .build() ); if (this.pQueue.size() > this.threshold) { pQueue.poll(); } } return this; }

Target:
public TopNResultBuilder addEntry(DimensionAndMetricValueExtractor dimensionAndMetricValueExtractor) { String dimensionValue = dimensionAndMetricValueExtractor.getStringDimensionValue(dimSpec.getOutputName()); if (shouldAdd(dimensionValue)) { pQueue.add( new DimValHolder.Builder().withDimName(dimensionValue) .withMetricValues(dimensionAndMetricValueExtractor.getBaseObject()) .build() ); if (pQueue.size() > threshold) { pQueue.poll(); } } return this; }
Source:
private InputStream open() throws IOException, CoreException, IncorrectObjectTypeException { if (blobId == null) return new ByteArrayInputStream(new byte[0]); try { WorkingTreeOptions workingTreeOptions = db.getConfig().get(WorkingTreeOptions.KEY); ObjectLoader loader = db.open(blobId, Constants.OBJ_BLOB); final InputStream objectInputStream = LfsFactory.getInstance() .applySmudgeFilter(db, loader, null ) .openStream(); switch (workingTreeOptions.getAutoCRLF()) { case INPUT: case FALSE: return objectInputStream; case TRUE: default: return new AutoCRLFInputStream(objectInputStream, true); } } catch (MissingObjectException notFound) { throw new CoreException(Activator.error(NLS.bind( CoreText.BlobStorage_blobNotFound, blobId.name(), path), notFound)); } }

Target:
private InputStream open() throws IOException, CoreException, IncorrectObjectTypeException { if (blobId == null) return new ByteArrayInputStream(new byte[0]); try { WorkingTreeOptions workingTreeOptions = db.getConfig().get(WorkingTreeOptions.KEY); final InputStream objectInputStream = db.open(blobId, Constants.OBJ_BLOB).openStream(); switch (workingTreeOptions.getAutoCRLF()) { case INPUT: case FALSE: return objectInputStream; case TRUE: default: return new AutoCRLFInputStream(objectInputStream, true); } } catch (MissingObjectException notFound) { throw new CoreException(Activator.error(NLS.bind( CoreText.BlobStorage_blobNotFound, blobId.name(), path), notFound)); } }
Source:
static void initializeAcl(final String zooKeeperConnectionString, final String zooKeeperClusterId, final String masterUser, final String masterPassword, final String agentUser, final String agentPassword) throws KeeperException { final ACLProvider aclProvider = heliosAclProvider( masterUser, digest(masterUser, masterPassword), agentUser, digest(agentUser, agentPassword)); final List<AuthInfo> authorization = Lists.newArrayList(new AuthInfo( "digest", String.format("%s:%s", masterUser, masterPassword).getBytes())); final RetryPolicy zooKeeperRetryPolicy = new ExponentialBackoffRetry(1000, 3); final CuratorFramework curator = new CuratorClientFactoryImpl().newClient( zooKeeperConnectionString, (int) TimeUnit.SECONDS.toMillis(60), (int) TimeUnit.SECONDS.toMillis(15), zooKeeperRetryPolicy, aclProvider, authorization); final ZooKeeperClient client = new DefaultZooKeeperClient(curator, zooKeeperClusterId); client.start(); client.initializeAclRecursive("/", aclProvider); }

Target:
static void initializeAcl(final String zooKeeperConnectionString, final String zooKeeperClusterId, final String masterUser, final String masterPassword, final String agentUser, final String agentPassword) throws KeeperException { final ACLProvider aclProvider = heliosAclProvider( masterUser, digest(masterUser, masterPassword), agentUser, digest(agentUser, agentPassword)); final List<AuthInfo> authorization = Lists.newArrayList(new AuthInfo( "digest", String.format("%s:%s", masterUser, masterPassword).getBytes())); final RetryPolicy zooKeeperRetryPolicy = new ExponentialBackoffRetry(1000, 3); final CuratorFramework curator = new CuratorClientFactoryImpl().newClient( zooKeeperConnectionString, (int) TimeUnit.SECONDS.toMillis(60), (int) TimeUnit.SECONDS.toMillis(15), zooKeeperRetryPolicy, aclProvider, authorization); final ZooKeeperClient client = new DefaultZooKeeperClient(curator, zooKeeperClusterId); try { client.start(); initializeAclRecursive(client, "/", aclProvider); } finally { client.close(); } }
Source:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { try { chain.doFilter(request, response); HttpServletRequest req = (HttpServletRequest)request; if (Collections.list(req.getHeaders("Prefer")).contains("persistent-auth")) { HttpSession session = req.getSession(); try { int ttlValue = Integer.parseInt(req.getHeader("Session-TTL")) * SECONDS_IN_MINUTE; if (ttlValue >= MINIMAL_SESSION_TTL) { session = req.getSession(true); session.setMaxInactiveInterval(ttlValue); } } catch (NumberFormatException ex) { log.error("Session-TTL header was not passed. Not setting TTL value"); } } else if (FiltersHelper.isAuthenticated(req)) { InitialContext ctx = new InitialContext(); try { FiltersHelper.getBackend(ctx).runAction( VdcActionType.LogoutBySession, new VdcActionParametersBase( (String) req.getSession() .getAttribute(SessionConstants.HTTP_SESSION_ENGINE_SESSION_ID_KEY) ) ); req.getSession().invalidate(); } finally { ctx.close(); } } } catch (Exception ex) { log.error(String.format("Error in REST-API session management. Message is: %1$s", ex.getMessage())); if (log.isDebugEnabled()) { log.debug("", ex); } } }

Target:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { try { HttpServletRequest req = (HttpServletRequest)request; HttpSession session = req.getSession(); boolean persistentAuth = Collections.list(req.getHeaders(FiltersHelper.Constants.HEADER_PREFER)).contains("persistent-auth"); if (persistentAuth) { try { int ttlValue = Integer.parseInt(req.getHeader("Session-TTL")) * SECONDS_IN_MINUTE; if (ttlValue >= MINIMAL_SESSION_TTL) { session.setMaxInactiveInterval(ttlValue); } session.setAttribute( SessionConstants.HTTP_SESSION_ENGINE_SESSION_ID_KEY, req.getAttribute(SessionConstants.HTTP_SESSION_ENGINE_SESSION_ID_KEY ) ); } catch (NumberFormatException ex) { log.error("Session-TTL header was not passed. Not setting TTL value"); } } chain.doFilter(request, response); if (!persistentAuth && FiltersHelper.isAuthenticated(req)) { InitialContext ctx = new InitialContext(); try { FiltersHelper.getBackend(ctx).runAction( VdcActionType.LogoutBySession, new VdcActionParametersBase( (String) req.getAttribute(SessionConstants.HTTP_SESSION_ENGINE_SESSION_ID_KEY) ) ); req.getSession().invalidate(); } finally { ctx.close(); } } } catch (Exception ex) { log.error("Error in REST-API session management. ", ex); } }
Source:
public List<VelocitySourceWriter> generateWriters(AnnotationExtractionRequest request) throws IOException { AnnotationExtractionResponse response = annotationExtractionService.extract(request); return writerGenerator.generateWriters(request.getElement(), response); }

Target:
public List<VelocitySourceWriter> generateWriters(AnnotationExtractionRequest request) throws IOException { AnnotationExtractionResponse response = annotationExtractionService.extract(request); List<VelocitySourceWriter> writerList = writerGenerator.generateWriters(request.getElement(),response); return writerList; }
Source:
boolean hasPermission(@NonNull final PackageInfo app, @NonNull final String permission) { if (app.requestedPermissions == null || app.requestedPermissionsFlags == null) { return false; } final int index = ArrayUtils.indexOf(app.requestedPermissions, permission); if (index < 0 || index > app.requestedPermissionsFlags.length) return false; return (app.requestedPermissionsFlags[index] & REQUESTED_PERMISSION_GRANTED) != 0; }

Target:
boolean hasPermission(@NonNull final PackageInfo app, @NonNull final String permission) { if (app.requestedPermissions == null || app.requestedPermissionsFlags == null) { return false; } final int index = ArrayUtils.indexOf(app.requestedPermissions, permission); if (index < 0 || index >= app.requestedPermissionsFlags.length) return false; return (app.requestedPermissionsFlags[index] & REQUESTED_PERMISSION_GRANTED) != 0; }
Source:
public SWTBotTreeItem expand() { waitForEnabled(); if (isExpanded()) { log.warn(MessageFormat.format("Tree item {0} is already expanded. Won''t expand it again.", this)); return this; } asyncExec(new VoidResult() { @Override public void run() { widget.setExpanded(true); } }); postExpandNotify(); return this; }

Target:
public SWTBotTreeItem expand() { waitForEnabled(); if (isExpanded()) { log.warn(MessageFormat.format("Tree item {0} is already expanded. Won''t expand it again.", this)); return this; } preExpandNotify(); syncExec(new VoidResult() { @Override public void run() { widget.setExpanded(true); } }); postExpandNotify(); return this; }
Source:
private static void checkTree(final String filename, final DetailAST root) { DetailAST curNode = root; while (curNode != null) { checkNode(curNode, curNode.getParent(), curNode.getPreviousSibling(), filename, root); DetailAST toVisit = curNode.getFirstChild(); while (curNode != null && toVisit == null) { toVisit = curNode.getNextSibling(); if (toVisit == null) { curNode = curNode.getParent(); } } curNode = toVisit; } }

Target:
private static void checkTree(final String filename, final DetailAST root) { DetailAST curNode = root; DetailAST parent = null; DetailAST prev = null; while (curNode != null) { checkNode(curNode, parent, prev, filename, root); DetailAST toVisit = curNode.getFirstChild(); if (toVisit != null) { parent = curNode; curNode = toVisit; prev = null; } else { while (curNode != null && toVisit == null) { toVisit = curNode.getNextSibling(); if (toVisit != null) { prev = curNode; curNode = toVisit; } else { curNode = curNode.getParent(); if (curNode != null) { parent = curNode.getParent(); } } } } } }
Source:
private void validateSchema(final EventType eventType) throws InvalidEventTypeException { if (eventType.getSchema() != null) { try { final JSONObject schemaAsJson = new JSONObject(eventType.getSchema().getSchema()); if (hasReservedField(eventType, schemaAsJson, "metadata")) { throw new InvalidEventTypeException("\"metadata\" property is reserved"); } else { SchemaLoader.load(schemaAsJson); } } catch (JSONException e) { throw new InvalidEventTypeException("schema must be a valid json"); } catch (SchemaException e) { throw new InvalidEventTypeException("schema must be a valid json-schema"); } } }

Target:
private void validateSchema(final EventType eventType) throws InvalidEventTypeException { if (eventType.getSchema() != null) { try { final JSONObject schemaAsJson = new JSONObject(eventType.getSchema().getSchema()); if (hasReservedField(eventType, schemaAsJson, "metadata")) { throw new InvalidEventTypeException("\"metadata\" property is reserved"); } SchemaLoader.load(schemaAsJson); } catch (JSONException e) { throw new InvalidEventTypeException("schema must be a valid json"); } catch (SchemaException e) { throw new InvalidEventTypeException("schema must be a valid json-schema"); } } }
Source:
public AbstractApplicationSentListingMessage(String rawMessage) throws Exception { super(rawMessage); pages = new ArrayList<>(); populatePages(); populateApplicationIdentifierKey(); if (LOG.isLoggable(Level.FINE)) LOG.fine("got: " + this); }

Target:
public AbstractApplicationSentListingMessage(String rawMessage) throws Exception { super(rawMessage); pages = new ArrayList<>(); populatePages(); populateApplicationIdentifierKey(); if (log.isLoggable(Level.FINE)) { log.fine("ApplicationSentListingMessage received: " + this); } }
Source:
private static boolean checkSmartCardCompatibility(PGPSecretKey key, OperationLog log, int indent) { PGPPublicKey publicKey = key.getPublicKey(); int algorithm = publicKey.getAlgorithm(); if (algorithm != PublicKeyAlgorithmTags.RSA_ENCRYPT && algorithm != PublicKeyAlgorithmTags.RSA_SIGN && algorithm != PublicKeyAlgorithmTags.RSA_GENERAL) { log.add(OperationResult.LogType.MSG_K2C_ERROR_BAD_ALGO, indent + 1); return true; } int keySize = publicKey.getBitStrength(); if (keySize != 2048) { log.add(OperationResult.LogType.MSG_K2C_ERROR_BAD_SIZE, indent + 1); return false; } if (isDivertToCard(key) || isDummy(key)) { log.add(OperationResult.LogType.MSG_K2C_ERROR_BAD_STRIPPED, indent + 1); return false; } return true; }

Target:
private static boolean checkSmartCardCompatibility(PGPSecretKey key, OperationLog log, int indent) { PGPPublicKey publicKey = key.getPublicKey(); int algorithm = publicKey.getAlgorithm(); if (algorithm != PublicKeyAlgorithmTags.RSA_ENCRYPT && algorithm != PublicKeyAlgorithmTags.RSA_SIGN && algorithm != PublicKeyAlgorithmTags.RSA_GENERAL) { log.add(LogType.MSG_MF_ERROR_BAD_NFC_ALGO, indent + 1); return false; } int keySize = publicKey.getBitStrength(); if (keySize != 2048) { log.add(LogType.MSG_MF_ERROR_BAD_NFC_SIZE, indent + 1); return false; } if (isDivertToCard(key) || isDummy(key)) { log.add(LogType.MSG_MF_ERROR_BAD_NFC_STRIPPED, indent + 1); return false; } return true; }
Source:
private Date getPatientBirthdateAdjustedIfEstimated(Patient patient) { Date birthday = patient.getBirthdate(); if (patient.getBirthdateEstimated()) { Calendar cal = Calendar.getInstance(); cal.setTime(birthday); cal.add(Calendar.YEAR, new Double(Math.ceil(patient.getAge() * ESTIMATED_BIRTHDATE_ERROR_MARGIN)).intValue()); birthday = cal.getTime(); } return birthday; }

Target:
private Date getPatientBirthdateAdjustedIfEstimated(Patient patient) { Date birthday = patient.getBirthdate(); if (patient.getBirthdateEstimated()) { Calendar cal = Calendar.getInstance(); cal.setTime(birthday); cal.add(Calendar.YEAR, calculateGracePeriodInYears(patient.getAge())); birthday = cal.getTime(); } return birthday; }
Source:
public void bundleChanged(BundleEvent bundleEvent) { final String symbolicName = bundleEvent.getBundle().getSymbolicName(); if (bundleEvent.getType() == BundleEvent.STARTED) { LOGGER.debug("Bundle started", symbolicName); platformStatus.addOSGiStartedBundle(symbolicName); checkOsgiBundle(bundleEvent.getBundle()); } else if (bundleEvent.getType() == BundleEvent.STOPPED) { LOGGER.trace("Bundle stopped", symbolicName); platformStatus.removeOSGiStartedBundle(symbolicName); } }

Target:
public void bundleChanged(BundleEvent bundleEvent) { final String symbolicName = bundleEvent.getBundle().getSymbolicName(); if (bundleEvent.getType() == BundleEvent.STARTED) { LOGGER.debug("Bundle started", symbolicName); platformStatus.addOSGiStartedBundle(symbolicName); checkBundleOsgiStarted(bundleEvent.getBundle()); } else if (bundleEvent.getType() == BundleEvent.STOPPED) { LOGGER.trace("Bundle stopped", symbolicName); platformStatus.removeOSGiStartedBundle(symbolicName); checkBundleOsgiStarted(bundleEvent.getBundle()); checkBundleBlueprintStarted(bundleEvent.getBundle()); } }
Source:
private void validateTargetedSequencing(LibraryDesignCode libraryDesignCode, Collection<LibraryDilution> libraryDilutions, List<ValidationError> errors) throws IOException { libraryDesignCode = libraryDesignCodeService.get(libraryDesignCode.getId()); if (libraryDesignCode.isTargetedSequencingRequired()) { List<String> badDilutions = libraryDilutions.stream().filter(dilution -> dilution.getTargetedSequencing() == null) .map(LibraryDilution::getName).collect(Collectors.toList()); if (!badDilutions.isEmpty()) { errors.add(new ValidationError("libraryDesignCodeId", String.format("Library design code %s requires targeted sequencing, but the following dilutions have none: %s", libraryDesignCode.getCode(), String.join(", ", badDilutions)))); } } }

Target:
private void validateTargetedSequencing(LibraryDesignCode libraryDesignCode, Collection<LibraryDilution> libraryDilutions, List<ValidationError> errors) throws IOException { if (libraryDilutions == null || libraryDilutions.isEmpty()) { return; } libraryDesignCode = libraryDesignCodeService.get(libraryDesignCode.getId()); if (libraryDesignCode.isTargetedSequencingRequired()) { List<String> badDilutions = libraryDilutions.stream().filter(dilution -> dilution.getTargetedSequencing() == null) .map(LibraryDilution::getName).collect(Collectors.toList()); if (!badDilutions.isEmpty()) { errors.add(new ValidationError("libraryDesignCode", String.format("Targeted sequencing must be assigned to the affected dilutions (%s) to use this library design code: %s", String.join(", ", badDilutions), libraryDesignCode.getCode()))); } } }
Source:
private ExecutionResult(List<HystrixEventType> events, int executionTime, Exception e) { this.events = events; this.executionTime = executionTime; if (executionTime >= 0 ) { this.commandRunStartTime = System.currentTimeMillis() - this.executionTime; } else { this.commandRunStartTime = -1; } this.exception = e; }

Target:
private ExecutionResult(List<HystrixEventType> events, int executionTime, Exception e) { this.events = events; this.executionTime = executionTime; if (executionTime >= 0 ) { this.commandRunStartTimeNano = System.nanoTime() - this.executionTime*1000*1000; } else { this.commandRunStartTimeNano = -1; } this.exception = e; }
Source:
public void removeProjectile(Projectile projectile) { if (projectile.getShooter() instanceof Player) { Player player = (Player) projectile.getShooter(); if (projectiles.containsKey(player)) { projectiles.get(player).remove(projectile); } } }

Target:
public void removeProjectile(Projectile projectile) { if (projectile.getShooter() instanceof Player) { Player player = (Player) projectile.getShooter(); Set<Projectile> launched = projectiles.get(player); if(launched == null) return; launched.remove(projectile); } }
Source:
public ActionResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String studentEmail = getNonNullRequestParamValue(Const.ParamsNames.STUDENT_EMAIL); StudentAttributes student = logic.getStudentForEmail(courseId, studentEmail); if (student == null) { return new JsonResult("No student with given email in given course.", HttpStatus.SC_NOT_FOUND); } InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, userInfo.id); gateKeeper.verifyAccessible(instructor, logic.getCourse(courseId), student.section, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_STUDENT_IN_SECTIONS); boolean hasSection = false; try { hasSection = logic.hasIndicatedSections(courseId); } catch (EntityDoesNotExistException e) { return new JsonResult("No course with given id.", HttpStatus.SC_NOT_FOUND); } StudentProfileAttributes studentProfile = logic.getStudentProfile(student.googleId); student.googleId = null; student.key = null; studentProfile.googleId = null; studentProfile.modifiedDate = null; StudentInfo output = new StudentInfo(student, studentProfile, hasSection); return new JsonResult(output); }

Target:
public ActionResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String studentEmail = getNonNullRequestParamValue(Const.ParamsNames.STUDENT_EMAIL); StudentAttributes student = logic.getStudentForEmail(courseId, studentEmail); if (student == null) { return new JsonResult("No student with given email in given course.", HttpStatus.SC_NOT_FOUND); } InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, userInfo.id); gateKeeper.verifyAccessible(instructor, logic.getCourse(courseId), student.section, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_STUDENT_IN_SECTIONS); boolean hasSection = false; try { hasSection = logic.hasIndicatedSections(courseId); } catch (EntityDoesNotExistException e) { return new JsonResult("No course with given id.", HttpStatus.SC_NOT_FOUND); } StudentProfileAttributes studentProfile = logic.getStudentProfile(student.googleId); student.googleId = null; student.key = null; if (studentProfile != null) { studentProfile.googleId = null; studentProfile.modifiedDate = null; } StudentInfo output = new StudentInfo(student, studentProfile, hasSection); return new JsonResult(output); }
Source:
protected ISourceContainer[] createSourceContainers() throws CoreException { List<ISourceContainer> result = new LinkedList<ISourceContainer>(); ILaunchConfiguration config = getLaunchConfiguration(); try { Project project = LaunchUtils.getBndProject(config); if (project != null) { Collection<Container> runbundles = project.getRunbundles(); for (Container runbundle : runbundles) { if (runbundle.getType() == TYPE.PROJECT) { String targetProjName = runbundle.getProject().getName(); IProject targetProj = ResourcesPlugin.getWorkspace().getRoot().getProject(targetProjName); if (targetProj != null) { IJavaProject targetJavaProj = JavaCore.create(targetProj); result.add(new JavaProjectSourceContainer(targetJavaProj)); } } else if (runbundle.getType() == TYPE.REPO) { ExternalArchiveSourceContainer container = new ExternalArchiveSourceContainer(runbundle.getFile().toString(), false); result.add(container); } } } } catch (Exception e) { logger.logError("Error querying bnd dependency source containers.", e); } return result.toArray(new ISourceContainer[0]); }

Target:
protected ISourceContainer[] createSourceContainers() throws CoreException { List<ISourceContainer> result = new LinkedList<ISourceContainer>(); ILaunchConfiguration config = getLaunchConfiguration(); try { Project project = LaunchUtils.getBndProject(config); if (project != null) { Collection<Container> runbundles = project.getRunbundles(); for (Container runbundle : runbundles) { if (runbundle.getType() == TYPE.PROJECT) { String targetProjName = runbundle.getProject().getName(); IProject targetProj = ResourcesPlugin.getWorkspace().getRoot().getProject(targetProjName); if (targetProj != null) { IJavaProject targetJavaProj = JavaCore.create(targetProj); result.add(new JavaProjectSourceContainer(targetJavaProj)); } } else if (runbundle.getType() == TYPE.REPO) { IPath bundlePath = Central.toPath(runbundle.getFile()); IFile bundleFile = null; if (bundlePath != null) { bundleFile = ResourcesPlugin.getWorkspace().getRoot().getFile(bundlePath); } if (bundleFile != null) { ArchiveSourceContainer tempArchiveCont = new ArchiveSourceContainer(bundleFile, false); result.add(tempArchiveCont); } else { ExternalArchiveSourceContainer container = new ExternalArchiveSourceContainer(runbundle.getFile().toString(), false); result.add(container); } } } } } catch (Exception e) { logger.logError("Error querying bnd dependency source containers.", e); } return result.toArray(new ISourceContainer[0]); }
Source:
public void goToDroneLocation() { super.goToDroneLocation(); Drone drone = ((DroidPlannerApp) getActivity().getApplication()).getDrone(); if(!drone.getGps().isPositionValid()) return; final int pressCount = mAppPrefs.prefs.getInt(PREF_DRONE_LOCATION_FIRST_PRESS, DEFAULT_DRONE_LOCATION_FIRST_PRESS); if (pressCount < MAX_TOASTS_FOR_LOCATION_PRESS) { Toast.makeText(context, R.string.drone_autopan_long_press, Toast.LENGTH_LONG) .show(); mAppPrefs.prefs.edit().putInt(PREF_DRONE_LOCATION_FIRST_PRESS, pressCount + 1).apply(); } }

Target:
public void goToDroneLocation() { super.goToDroneLocation(); if(!this.drone.getGps().isPositionValid()) return; final int pressCount = mAppPrefs.prefs.getInt(PREF_DRONE_LOCATION_FIRST_PRESS, DEFAULT_DRONE_LOCATION_FIRST_PRESS); if (pressCount < MAX_TOASTS_FOR_LOCATION_PRESS) { Toast.makeText(context, R.string.drone_autopan_long_press, Toast.LENGTH_LONG) .show(); mAppPrefs.prefs.edit().putInt(PREF_DRONE_LOCATION_FIRST_PRESS, pressCount + 1).apply(); } }
Source:
public static String getJsonStringforMap(Map<String, String> map) { if (map == null) { map = new HashMap(); } JSONObject pathPartMap = new JSONObject(map); return pathPartMap.toString(); }

Target:
public static String getJsonStringforMap(Map<String, String> map) { Map<String, String> mapToUse = (map == null) ? Collections.emptyMap() : map; JSONObject pathPartMap = new JSONObject(mapToUse); return pathPartMap.toString(); }
Source:
public static ErraiService getService() { return service != null ? service : initProxy; }

Target:
public static ErraiService getService() { return isActive() ? service : proxy; }
Source:
protected Object doWork() { Utils.regularReadableUserFile(ponFile); try (final HDF5File ponReader = new HDF5File(ponFile)) { final PoN pon = new HDF5PoN(ponReader); if (pon.getVersion() < HDF5PoNCreator.CURRENT_PON_VERSION) { logger.warn("The version of the specified PoN (" + pon.getVersion() + ") is older than the latest version " + "(" + HDF5PoNCreator.CURRENT_PON_VERSION + ")."); } final TargetCollection<Target> exonCollection = readTargetCollection(targetFile); final ReadCountCollection readCountCollection = readInputReadCounts(readCountsFile, exonCollection); final TangentNormalizationResult tangentNormalizationResult = TangentNormalizer.tangentNormalizePcov(pon, readCountCollection); outputTangentNormalizationResult(tangentNormalizationResult); return "SUCCESS"; } }

Target:
protected Object doWork() { Utils.regularReadableUserFile(ponFile); try (final HDF5File ponReader = new HDF5File(ponFile)) { final PoN pon = new HDF5PoN(ponReader); if (pon.getVersion() < HDF5PoNCreator.CURRENT_PON_VERSION) { logger.warn("The version of the specified PoN (" + pon.getVersion() + ") is older than the latest version " + "(" + HDF5PoNCreator.CURRENT_PON_VERSION + ")."); } final TargetCollection<Target> targetCollection = readTargetCollection(targetFile); final ReadCountCollection readCountCollection = readInputReadCounts(readCountsFile, targetCollection); final TangentNormalizationResult tangentNormalizationResult = TangentNormalizer.tangentNormalizePcov(pon, readCountCollection); outputTangentNormalizationResult(tangentNormalizationResult); return "SUCCESS"; } }
Source:
public FilterBuilder withAlternates(String alternate) { if (alternate != null) { filters.add(new VariantRepositoryAlternateFilter(new ArrayList<>(Arrays.asList(alternate)))); } return this; }

Target:
public FilterBuilder withAlternates(String alternate) { if (alternate != null) { filters.add(new VariantRepositoryAlternateFilter(Collections.singletonList(alternate))); } return this; }
Source:
void afterNamesPerGroupChanged() { namesPerGroupInput = namesPerGroup.getText().toString().trim(); boolean isInputValid = isInputValid(); if (namesPerGroup.isFocused() && isInputValid && autocomplete.isChecked()) { numGroups.setText(getMatchingNumber(namesPerGroupInput)); } dialog.getActionButton(DialogAction.POSITIVE).setEnabled(isInputValid); maybeShowUnevenGroupsWarning(); }

Target:
void afterNamesPerGroupChanged() { String namesPerGroupInput = namesPerGroup.getText().toString().trim(); boolean isInputValid = isInputValid(namesPerGroupInput); if (namesPerGroup.isFocused() && isInputValid && autocomplete.isChecked()) { numGroups.setText(getMatchingNumber(namesPerGroupInput)); } dialog.getActionButton(DialogAction.POSITIVE).setEnabled(isInputValid); maybeShowUnevenGroupsWarning(); }
Source:
public void testIllegalState() { String originalId = "064c292e02db027c22g"; Span span = new Span(); span.setAnnotations(Arrays.asList()); span.setId(originalId); span.setAnnotations(annotations()); String uniqueID = SpanUniqueIdGenerator.toUnique(span); span.setId(uniqueID); try { SpanUniqueIdGenerator.toUnique(span); Assert.fail(); } catch (IllegalStateException ex) { } }

Target:
public void testIllegalState() { String originalId = "064c292e02db027c22g"; Span span = new Span(); span.setAnnotations(Arrays.asList()); span.setId(originalId); span.setAnnotations(annotations()); String uniqueID = SpanUniqueIdGenerator.toUnique(span); span.setId(uniqueID); SpanUniqueIdGenerator.toUnique(span); }
Source:
public static SingleThreadEventLoop.IoHandlerFactory newFactory(final int maxEvents, final SelectStrategyFactory selectStrategyFactory) { ObjectUtil.checkPositiveOrZero(maxEvents, "maxEvents"); ObjectUtil.checkNotNull(selectStrategyFactory, "selectStrategyFactory"); return new SingleThreadEventLoop.IoHandlerFactory() { @Override public SingleThreadEventLoop.IoHandler newHandler() { return new EpollHandler(maxEvents, selectStrategyFactory.newSelectStrategy()); } }; }

Target:
public static IoHandlerFactory newFactory(final int maxEvents, final SelectStrategyFactory selectStrategyFactory) { ObjectUtil.checkPositiveOrZero(maxEvents, "maxEvents"); ObjectUtil.checkNotNull(selectStrategyFactory, "selectStrategyFactory"); return new IoHandlerFactory() { @Override public IoHandler newHandler() { return new EpollHandler(maxEvents, selectStrategyFactory.newSelectStrategy()); } }; }
Source:
public static void main(final String[] args) throws Exception { String queryClassname = args[0]; String startWorkersScript = args[1]; System.out.println("Begin start master"); Server server = startMaster(); System.out.println("End start master"); System.out.println("Begin start workers"); startWorkers(startWorkersScript); System.out.println("End start workers"); MyriaConfiguration config = MyriaConfiguration.loadWithDefaultValues(FilenameUtils.concat(masterHome, MyriaConstants.DEPLOYMENT_CONF_FILE)); int[] allWorkers = new int[config.getWorkerIds().size()]; int idx = 0; for (String id : config.getWorkerIds()) { allWorkers[idx++] = Integer.parseInt(id); } QueryPlanGenerator qpg = (QueryPlanGenerator) (Class.forName(queryClassname).newInstance()); final Map<Integer, RootOperator[]> workerPlans = qpg.getWorkerPlan(allWorkers); final LinkedBlockingQueue<TupleBatch> resultStore = new LinkedBlockingQueue<TupleBatch>(); final RootOperator masterPlan = qpg.getMasterPlan(allWorkers, resultStore); long start = System.nanoTime(); QueryFuture qf = server.submitQueryPlan(masterPlan, workerPlans); TupleBatch tb = null; int numResult = 0; while (!qf.isDone() || !resultStore.isEmpty()) { tb = resultStore.poll(100, TimeUnit.MILLISECONDS); System.out.print(tb); numResult += tb.numTuples(); } System.out.println("Time spent: " + DateTimeUtils.nanoElapseToHumanReadable(System.nanoTime() - start)); System.out.println("Total " + numResult + " tuples."); qf.get(); server.shutdown(); }

Target:
public static void main(final String[] args) throws Exception { String queryClassname = args[0]; String startWorkersScript = args[1]; System.out.println("Begin start master"); Server server = startMaster(); System.out.println("End start master"); System.out.println("Begin start workers"); startWorkers(startWorkersScript); System.out.println("End start workers"); MyriaConfiguration config = MyriaConfiguration.loadWithDefaultValues(FilenameUtils.concat(workingDir, MyriaConstants.DEPLOYMENT_CONF_FILE)); int[] allWorkers = Ints.toArray(config.getWorkerIds()); QueryPlanGenerator qpg = (QueryPlanGenerator) (Class.forName(queryClassname).newInstance()); final Map<Integer, RootOperator[]> workerPlans = qpg.getWorkerPlan(allWorkers); final LinkedBlockingQueue<TupleBatch> resultStore = new LinkedBlockingQueue<TupleBatch>(); final RootOperator masterPlan = qpg.getMasterPlan(allWorkers, resultStore); long start = System.nanoTime(); QueryFuture qf = server.submitQueryPlan(masterPlan, workerPlans); TupleBatch tb = null; int numResult = 0; while (!qf.isDone() || !resultStore.isEmpty()) { tb = resultStore.poll(100, TimeUnit.MILLISECONDS); System.out.print(tb); numResult += tb.numTuples(); } System.out.println("Time spent: " + DateTimeUtils.nanoElapseToHumanReadable(System.nanoTime() - start)); System.out.println("Total " + numResult + " tuples."); qf.get(); server.shutdown(); }
Source:
public static Guid SelectStorageDomain(VmTemplate vmTemplate) { Guid selectedDomainId = Guid.Empty; if (vmTemplate != null && vmTemplate.getDiskMap().size() > 0) { int size = -1; DiskImage disk = DbFacade.getInstance().getDiskImageDAO().getSnapshotById( LinqUtils.firstOrNull(vmTemplate.getDiskMap().values(), new All<DiskImageTemplate>()) .getId()); List<Guid> domainsList = (List<Guid>) Backend .getInstance() .getResourceManager() .RunVdsCommand( VDSCommandType.GetImageDomainsList, new GetImageDomainsListVDSCommandParameters(vmTemplate.getstorage_pool_id().getValue(), disk.getimage_group_id().getValue())).getReturnValue(); for (Guid domainId : domainsList) { storage_domains domain = DbFacade.getInstance().getStorageDomainDAO().getForStoragePool(domainId, vmTemplate.getstorage_pool_id()); if (domain != null && domain.getstorage_domain_type() != StorageDomainType.ImportExport && domain.getstatus() == StorageDomainStatus.Active && StorageDomainSpaceChecker.isBelowThresholds(domain)) { if (domain.getavailable_disk_size() != null && domain.getavailable_disk_size() > size) { selectedDomainId = domainId; size = domain.getavailable_disk_size(); } } } } return selectedDomainId; }

Target:
public static Guid SelectStorageDomain(VmTemplate vmTemplate) { Guid selectedDomainId = Guid.Empty; if (vmTemplate != null && vmTemplate.getDiskMap().size() > 0) { int size = -1; DiskImage disk = DbFacade.getInstance().getDiskImageDAO().getSnapshotById( LinqUtils.firstOrNull(vmTemplate.getDiskMap().values(), new All<DiskImage>()) .getId()); List<Guid> domainsList = (List<Guid>) Backend .getInstance() .getResourceManager() .RunVdsCommand( VDSCommandType.GetImageDomainsList, new GetImageDomainsListVDSCommandParameters(vmTemplate.getstorage_pool_id().getValue(), disk.getimage_group_id().getValue())).getReturnValue(); for (Guid domainId : domainsList) { storage_domains domain = DbFacade.getInstance().getStorageDomainDAO().getForStoragePool(domainId, vmTemplate.getstorage_pool_id()); if (domain != null && domain.getstorage_domain_type() != StorageDomainType.ImportExport && domain.getstatus() == StorageDomainStatus.Active && StorageDomainSpaceChecker.isBelowThresholds(domain)) { if (domain.getavailable_disk_size() != null && domain.getavailable_disk_size() > size) { selectedDomainId = domainId; size = domain.getavailable_disk_size(); } } } } return selectedDomainId; }
Source:
protected final void withTopologyService(String host, int port, Consumer<TopologyService> consumer) throws Exception { try (DiagnosticService diagnosticService = DiagnosticServiceFactory.fetch( InetSocketAddress.createUnresolved(host, port), getClass().getSimpleName(), OP_TIMEOUT, OP_TIMEOUT, null)) { consumer.accept(diagnosticService.getProxy(TopologyService.class)); } }

Target:
protected final void withTopologyService(String host, int port, Consumer<TopologyService> consumer) throws Exception { try (DiagnosticService diagnosticService = DiagnosticServiceFactory.fetch( InetSocketAddress.createUnresolved(host, port), getClass().getSimpleName(), getConnectionTimeout(), getConnectionTimeout(), null)) { consumer.accept(diagnosticService.getProxy(TopologyService.class)); } }
Source:
public static <T> Call<T> response(T successValue) { return response(Response.fakeSuccess(successValue)); }

Target:
public static <T> Call<T> response(T successValue) { return response(Response.success(successValue)); }
Source:
static void deleteTableUsageSnapshotsForNamespace(Connection connection, String namespace) throws IOException { Scan s = new Scan(); s.setRowPrefixFilter(Bytes.toBytes("t." + namespace)); s.addColumn(QUOTA_FAMILY_USAGE,QUOTA_QUALIFIER_POLICY); s.addColumn(QUOTA_FAMILY_INFO,QUOTA_QUALIFIER_SETTINGS); try (Table quotaTable = connection.getTable(QUOTA_TABLE_NAME); ResultScanner rs = quotaTable.getScanner(s)) { for (Result r : rs) { byte[] data = r.getValue(QUOTA_FAMILY_INFO, QUOTA_QUALIFIER_SETTINGS); if (data == null) { Delete delete = new Delete(r.getRow()); delete.addColumns(QUOTA_FAMILY_USAGE,QUOTA_QUALIFIER_POLICY); quotaTable.delete(delete); } } } }

Target:
static void deleteTableUsageSnapshotsForNamespace(Connection connection, String namespace) throws IOException { Scan s = new Scan(); s.setRowPrefixFilter(Bytes.add(QUOTA_TABLE_ROW_KEY_PREFIX, Bytes.toBytes(namespace + TableName.NAMESPACE_DELIM))); s.addColumn(QUOTA_FAMILY_USAGE,QUOTA_QUALIFIER_POLICY); s.addColumn(QUOTA_FAMILY_INFO,QUOTA_QUALIFIER_SETTINGS); try (Table quotaTable = connection.getTable(QUOTA_TABLE_NAME); ResultScanner rs = quotaTable.getScanner(s)) { for (Result r : rs) { byte[] data = r.getValue(QUOTA_FAMILY_INFO, QUOTA_QUALIFIER_SETTINGS); if (data == null) { Delete delete = new Delete(r.getRow()); delete.addColumns(QUOTA_FAMILY_USAGE,QUOTA_QUALIFIER_POLICY); quotaTable.delete(delete); } } } }
Source:
private JobPriority getJobPriority(CommandLine cmdLine) { String jobPriorityOption = cmdLine.getOptionValue(JOB_PRIORITY_OPTION.getOpt()); if (jobPriorityOption == null) { return JobPriority.DEFAULT; } switch (jobPriorityOption) { case "0" : return JobPriority.VERY_HIGH; case "1" : return JobPriority.HIGH; case "2" : return JobPriority.NORMAL; case "3" : return JobPriority.LOW; case "4" : return JobPriority.VERY_LOW; case "5" : return JobPriority.DEFAULT; default: return JobPriority.UNDEFINED_PRIORITY; } }

Target:
private JobPriority getJobPriority(CommandLine cmdLine) { String jobPriorityOption = cmdLine.getOptionValue(JOB_PRIORITY_OPTION.getOpt()); if (jobPriorityOption == null) { return JobPriority.NORMAL; } switch (jobPriorityOption) { case "0" : return JobPriority.VERY_HIGH; case "1" : return JobPriority.HIGH; case "2" : return JobPriority.NORMAL; case "3" : return JobPriority.LOW; case "4" : return JobPriority.VERY_LOW; default: return JobPriority.NORMAL; } }
Source:
protected Locale getLocale() { return Locale.US; }

Target:
protected Locale getLocale() { return Locale.ROOT; }
Source:
public DefaultCacheManager(GlobalConfiguration globalConfiguration, Configuration defaultConfiguration, boolean start) { globalConfiguration = globalConfiguration == null ? new GlobalConfigurationBuilder().build() : globalConfiguration; defaultConfiguration = defaultConfiguration == null ? new ConfigurationBuilder().build() : defaultConfiguration; this.configurationManager = new ConfigurationManager(globalConfiguration, defaultConfiguration); this.authzHelper = new AuthorizationHelper(globalConfiguration.security(), AuditContext.CACHEMANAGER, globalConfiguration.globalJmxStatistics().cacheManagerName()); this.globalComponentRegistry = new GlobalComponentRegistry(globalConfiguration, this, caches.keySet()); this.globalComponentRegistry.registerComponent(configurationManager, ConfigurationManager.class); this.globalComponentRegistry.registerComponent(cacheDependencyGraph, CACHE_DEPENDENCY_GRAPH, false); this.globalComponentRegistry.registerComponent(authzHelper, AuthorizationHelper.class); this.stats = new CacheContainerStatsImpl(this); this.health = HealthFactory.create(this); if (start) start(); }

Target:
public DefaultCacheManager(GlobalConfiguration globalConfiguration, Configuration defaultConfiguration, boolean start) { globalConfiguration = globalConfiguration == null ? new GlobalConfigurationBuilder().build() : globalConfiguration; defaultConfiguration = defaultConfiguration == null ? new ConfigurationBuilder().build() : defaultConfiguration; this.configurationManager = new ConfigurationManager(globalConfiguration, defaultConfiguration); this.authzHelper = new AuthorizationHelper(globalConfiguration.security(), AuditContext.CACHEMANAGER, globalConfiguration.globalJmxStatistics().cacheManagerName()); this.globalComponentRegistry = new GlobalComponentRegistry(globalConfiguration, this, caches.keySet()); this.globalComponentRegistry.registerComponent(configurationManager, ConfigurationManager.class); this.globalComponentRegistry.registerComponent(cacheDependencyGraph, CACHE_DEPENDENCY_GRAPH, false); this.globalComponentRegistry.registerComponent(authzHelper, AuthorizationHelper.class); this.stats = new CacheContainerStatsImpl(this); health = new HealthImpl(this); globalComponentRegistry.registerComponent(new HealthJMXExposerImpl(health), HealthJMXExposer.class); if (start) start(); }