auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void setEnvironment(Environment environment) { this.propertyValue = environment.getProperty(this.propertyName); Assert.notNull(this.propertyValue, () -> "No property exists with name '" + this.propertyName + "'"); }

Target:
public void setEnvironment(Environment environment) { this.environment = environment; }
Source:
public <E> CacheQuery<E> buildCacheQuery(String queryString, IndexedQueryMode indexedQueryMode, KeyTransformationHandler keyTransformationHandler, TimeoutExceptionFactory timeoutExceptionFactory, ExecutorService asyncExecutor, Class<?>... classes) { if (!isIndexed) { throw log.cannotRunLuceneQueriesIfNotIndexed(cache.getName()); } if (log.isDebugEnabled()) { log.debugf("Building Lucene query for : %s", queryString); } IckleParsingResult<TypeMetadata> parsingResult = parse(queryString); if (parsingResult.hasGroupingOrAggregations()) { throw log.groupAggregationsNotSupported(); } LuceneQueryParsingResult luceneParsingResult = transformParsingResult(parsingResult, EMPTY_MAP); org.apache.lucene.search.Query luceneQuery = makeTypeQuery(luceneParsingResult.getQuery(), luceneParsingResult.getTargetEntityName()); if (indexedQueryMode == IndexedQueryMode.BROADCAST) { return new ClusteredCacheQueryImpl<>(new QueryDefinition(queryString), asyncExecutor, cache, keyTransformationHandler, null); } else { if (log.isDebugEnabled()) { log.debugf("The resulting Lucene query is : %s", luceneQuery.toString()); } CacheQuery cacheQuery = new CacheQueryImpl<>(luceneQuery, searchFactory, cache, keyTransformationHandler, timeoutExceptionFactory, classes); if (luceneParsingResult.getSort() != null) { cacheQuery = cacheQuery.sort(luceneParsingResult.getSort()); } if (luceneParsingResult.getProjections() != null) { cacheQuery = cacheQuery.projection(luceneParsingResult.getProjections()); } return (CacheQuery<E>) cacheQuery; } }

Target:
public <E> CacheQuery<E> buildCacheQuery(String queryString, IndexedQueryMode indexedQueryMode, KeyTransformationHandler keyTransformationHandler, TimeoutExceptionFactory timeoutExceptionFactory, ExecutorService asyncExecutor, Class<?>... classes) { if (!isIndexed) { throw log.cannotRunLuceneQueriesIfNotIndexed(cache.getName()); } if (log.isDebugEnabled()) { log.debugf("Building Lucene query for : %s", queryString); } IckleParsingResult<TypeMetadata> parsingResult = parse(queryString); if (parsingResult.hasGroupingOrAggregations()) { throw log.groupAggregationsNotSupported(); } LuceneQueryParsingResult luceneParsingResult = transformParsingResult(parsingResult, emptyMap()); org.apache.lucene.search.Query luceneQuery = makeTypeQuery(luceneParsingResult.getQuery(), luceneParsingResult.getTargetEntityName()); if (indexedQueryMode == IndexedQueryMode.BROADCAST) { return new ClusteredCacheQueryImpl<>(new QueryDefinition(queryString), asyncExecutor, cache, keyTransformationHandler, null); } else { if (log.isDebugEnabled()) { log.debugf("The resulting Lucene query is : %s", luceneQuery.toString()); } CacheQuery cacheQuery = new CacheQueryImpl<>(luceneQuery, searchFactory, cache, keyTransformationHandler, timeoutExceptionFactory, classes); if (luceneParsingResult.getSort() != null) { cacheQuery = cacheQuery.sort(luceneParsingResult.getSort()); } if (luceneParsingResult.getProjections() != null) { cacheQuery = cacheQuery.projection(luceneParsingResult.getProjections()); } return (CacheQuery<E>) cacheQuery; } }
Source:
public boolean equals(final Object obj) { final boolean baseEquals = super.equals(obj) && Objects.equals(playlistType, ((PlaylistTab) obj).playlistType) && Objects.equals(playlistName, ((PlaylistTab) obj).playlistName); if (!baseEquals) { return false; } final boolean localPlaylistEquals = playlistId == ((PlaylistTab) obj).playlistId; final boolean remotePlaylistEquals = playlistServiceId == ((PlaylistTab) obj).playlistServiceId && Objects.equals(playlistUrl, ((PlaylistTab) obj).playlistUrl); return localPlaylistEquals || remotePlaylistEquals; }

Target:
public boolean equals(final Object obj) { if (!(super.equals(obj) && Objects.equals(playlistType, ((PlaylistTab) obj).playlistType) && Objects.equals(playlistName, ((PlaylistTab) obj).playlistName))) { return false; } return (playlistId == ((PlaylistTab) obj).playlistId) || (playlistServiceId == ((PlaylistTab) obj).playlistServiceId && Objects.equals(playlistUrl, ((PlaylistTab) obj).playlistUrl)); }
Source:
protected GoVisitor buildGoVisitor(@NotNull ProblemsHolder holder, @NotNull LocalInspectionToolSession session) { return new GoVisitor() { @Override public void visitCompositeLit(@NotNull GoCompositeLit compositeLit) { GoLiteralValue literalValue = compositeLit.getLiteralValue(); GoStructType structType = getStructType(literalValue); if (structType == null || !isStructImportedOrLocalAllowed(structType, literalValue)) return; List<String> elementsNames = getNames(literalValue.getElementList()); if (hasNull(elementsNames.toArray()) && areElementsNamesMatchesDefinitions(elementsNames, getFieldDefinitionsNames(structType))) { holder.registerProblem(literalValue, "Unnamed field initializations", ProblemHighlightType.GENERIC_ERROR_OR_WARNING, QUICK_FIX); } } }; }

Target:
protected GoVisitor buildGoVisitor(@NotNull ProblemsHolder holder, @NotNull LocalInspectionToolSession session) { return new GoVisitor() { @Override public void visitLiteralValue(@NotNull GoLiteralValue literalValue) { GoStructType structType = getLiteralStructType(literalValue); if (structType == null || !isStructImportedOrLocalAllowed(structType, literalValue)) return; List<GoElement> elements = literalValue.getElementList(); List<GoNamedElement> definitions = getFieldDefinitions(structType); if (!areElementsKeysMatchesDefinitions(elements, definitions)) return; registerProblemsForElementsWithoutKeys(elements, definitions.size()); } private void registerProblemsForElementsWithoutKeys(@NotNull List<GoElement> elements, int definitionsCount) { for (int i = 0; i < min(elements.size(), definitionsCount); i++) { if (elements.get(i).getKey() != null) continue; holder.registerProblem(elements.get(i), "Unnamed field initialization", ProblemHighlightType.WEAK_WARNING, QUICK_FIX); } } }; }
Source:
private void completeSnapshotApply(LogReplicationEntry inputEntry) { log.debug("Complete of a snapshot apply"); rxState = RxState.LOG_ENTRY_SYNC; logReplicationMetadataManager.setSnapshotApplied(inputEntry); logEntrySinkBufferManager = new LogEntrySinkBufferManager(ackCycleTime, ackCycleCnt, bufferSize, logReplicationMetadataManager.getLastProcessedLogTimestamp(), this); log.info("Sink manager completed SNAPSHOT transfer for and has transit to state.", inputEntry, rxState); }

Target:
private void completeSnapshotApply(LogReplicationEntry inputEntry) { log.debug("Complete of a snapshot apply"); rxState = RxState.LOG_ENTRY_SYNC; logReplicationMetadataManager.setSnapshotApplied(inputEntry); log.info("Sink manager completed SNAPSHOT transfer for and has transit to state.", inputEntry, rxState); }
Source:
public void commit() throws TransactionFailedException { try { super.commit(); } finally { if (log.isInfoEnabled()) { log.info("CachingTransaction cache stats on commit: {}", cellCache.stats()); } } }

Target:
public void commit() throws TransactionFailedException { try { super.commit(); } finally { if (log.isDebugEnabled()) { log.debug("CachingTransaction cache stats on commit: {}", cellCache.stats()); } } }
Source:
public void setMenuItems(@Nullable List<CarMenuItem> items) { mMenuItems = items; mActionItems.forEach(indexedItem -> removeView(indexedItem.mView)); mActionItems.clear(); mOverflowMenuItems.clear(); if (mMenuItems != null) { int alwaysItemCount = 0; for (CarMenuItem item : mMenuItems) { if (item.getDisplayBehavior() == CarMenuItem.DisplayBehavior.ALWAYS) { alwaysItemCount++; } } int ifRoomActionCapacity = ACTION_ITEM_COUNT_LIMIT - alwaysItemCount; for (int i = 0; i < mMenuItems.size(); i++) { CarMenuItem item = mMenuItems.get(i); if (item.getDisplayBehavior() == CarMenuItem.DisplayBehavior.ALWAYS || (item.getDisplayBehavior() == CarMenuItem.DisplayBehavior.IF_ROOM && ifRoomActionCapacity > 0)) { View action = item.isCheckable() ? createCheckableAction(item) : createAction(item); mActionItems.add(new IndexedMenuItem(item, action, i)); addView(action); if (item.getDisplayBehavior() == CarMenuItem.DisplayBehavior.IF_ROOM) { ifRoomActionCapacity--; } } else { mOverflowMenuItems.add(new IndexedMenuItem(item, null, i)); } } } mOverflowButtonView.setVisibility(mOverflowMenuItems.isEmpty() ? GONE : VISIBLE); requestLayout(); }

Target:
public void setMenuItems(@Nullable List<CarMenuItem> items) { mMenuItems = items; mInflatedMenuItems.clear(); if (mMenuItems != null) { for (int i = 0; i < mMenuItems.size(); i++) { CarMenuItem item = mMenuItems.get(i); View action = null; if (item.getDisplayBehavior() != CarMenuItem.DisplayBehavior.NEVER) { action = item.isCheckable() ? createCheckableAction(item) : createAction(item); } mInflatedMenuItems.add(new InflatedMenuItem(item, action)); } } requestLayout(); }
Source:
public void testSupportsBad() { AuthenticationToken authenticationToken = mock(AuthenticationToken.class); boolean supports = pkiRealm.supports(authenticationToken); assertFalse(supports); authenticationToken = mock(BaseAuthenticationToken.class); supports = pkiRealm.supports(authenticationToken); assertFalse(supports); when(authenticationToken.getCredentials()).thenReturn(new Object()); supports = pkiRealm.supports(authenticationToken); assertFalse(supports); }

Target:
public void testSupportsBad() { BaseAuthenticationToken authenticationToken = mock(BaseAuthenticationToken.class); boolean supports = pkiRealm.supports(authenticationToken); assertFalse(supports); when(authenticationToken.getCredentials()).thenReturn(new Object()); when(authenticationToken.getPrincipal()).thenReturn(new Object()); supports = pkiRealm.supports(authenticationToken); assertFalse(supports); when(authenticationToken.getType()).thenReturn(AuthenticationTokenType.SAML); supports = pkiRealm.supports(authenticationToken); assertFalse(supports); when(authenticationToken.getCredentials()).thenReturn(new X509Certificate[1]); when(authenticationToken.getType()).thenReturn(AuthenticationTokenType.PKI); supports = pkiRealm.supports(authenticationToken); assertFalse(supports); when(authenticationToken.getCredentials()).thenReturn(new Object()); when(authenticationToken.getPrincipal()).thenReturn(new X500Principal("cn=test")); supports = pkiRealm.supports(authenticationToken); assertFalse(supports); }
Source:
public static boolean chooseOption(BlobStoreContext context) throws IOException { Scanner scan = new Scanner(System.in); System.out.println(""); System.out.println("Glacier examples"); System.out.println("1. Put and retrieve blob (~4-5 hours)"); System.out.println("2. Multipart upload (~1-5 minutes)"); System.out.println("3. Call interruption (~0-2 minutes)"); System.out.println("4. Provider API (~4-5 hours)"); System.out.println("5. Exit"); System.out.print("Choose an option: "); try{ switch(scan.nextInt()){ case 1: putAndRetrieveBlobExample(context); break; case 2: multipartUploadExample(context); break; case 3: interruptionExample(context); break; case 4: providerExample(context); break; case 5: return false; default: System.out.println("Not a valid option"); break; } } catch(InputMismatchException e){ System.out.println("Not a valid option"); } return true; }

Target:
public static boolean chooseOption(BlobStoreContext context) throws IOException { Scanner scan = new Scanner(System.in); System.out.println(""); System.out.println("Glacier examples"); System.out.println("1. Put and retrieve blob (~4-5 hours)"); System.out.println("2. Multipart upload (~1-5 minutes)"); System.out.println("3. Call interruption (~0-2 minutes)"); System.out.println("4. Provider API (~4-5 hours)"); System.out.println("5. Exit"); System.out.print("Choose an option: "); try{ switch(scan.nextInt()){ case 1: putAndRetrieveBlobExample(context.getBlobStore()); break; case 2: multipartUploadExample(context.getBlobStore()); break; case 3: interruptionExample(context.getBlobStore()); break; case 4: providerExample(context); break; case 5: return false; default: System.out.println("Not a valid option"); break; } } catch(InputMismatchException e) { System.out.println("Not a valid option"); } return true; }
Source:
public void addRuntimeAttributesToProject(ProjectConfigDto projectConfig, FolderEntry projectFolder) throws ProjectTypeConstraintException, ForbiddenException, ValueStorageException, ServerException { addAttributesToProject(projectConfig, projectFolder, RUNTIME); }

Target:
public void addRuntimeAttributesToProject(ProjectConfigDto projectConfig, FolderEntry projectFolder) throws ProjectTypeConstraintException, ForbiddenException, ValueStorageException, ServerException { addAttributesToProject(projectConfig, projectFolder, AttributeType.RUNTIME); }
Source:
public Stream<RecordedMessage<M, R>> getRecordedMessages() { return clientMessageTracker.getTrackedValues().sorted((r1,r2)->(int)(r1.getSequenceId() - r2.getSequenceId())).map(SequencedRecordedMessage::convert); }

Target:
public Stream<RecordedMessage<M, R>> getRecordedMessages() { return clientMessageTracker.getTrackedValues().sorted(comparingLong(SequencedRecordedMessage::getSequenceId)).map(SequencedRecordedMessage::convert); }
Source:
public boolean exists(final String path) { final boolean exists = ocflRepo.containsObject(path); LOGGER.info("Object with path: " + path + ", " + (exists ? "exist" : "does not exist")); return exists; }

Target:
public boolean exists(final String path) { final boolean exists = ocflRepo.containsObject(path); LOGGER.debug("Object with path: {}, exists: {}", path, exists); return exists; }
Source:
private boolean exec() { try { if (!isSkipDecorate()) { for (String tag: getNameAndTag()) { build.setDisplayName(build.getDisplayName() + " " + tag); } } return isSkipBuild() ? maybeTagOnly() : buildAndTag() && isSkipPush() ? true : dockerPushCommand(); } catch (IOException e) { return recordException(e); } catch (InterruptedException e) { return recordException(e); } catch (MacroEvaluationException e) { return recordException(e); } }

Target:
private boolean exec() { try { if (!isSkipDecorate()) { for (String tag: getNameAndTag()) { build.setDisplayName(build.getDisplayName() + " " + tag); } } return (isSkipBuild() ? maybeTagOnly() : buildAndTag()) && (isSkipPush() ? true : dockerPushCommand()); } catch (IOException e) { return recordException(e); } catch (InterruptedException e) { return recordException(e); } catch (MacroEvaluationException e) { return recordException(e); } }
Source:
public View onCreateView(final LayoutInflater inflater, @Nullable final ViewGroup container, @Nullable final Bundle savedInstanceState) { View root = inflater.inflate(R.layout.fragment_for_leads, null); return root; }

Target:
public View onCreateView(final LayoutInflater inflater, @Nullable final ViewGroup container, @Nullable final Bundle savedInstanceState) { View root = inflater.inflate(R.layout.fragment_for_leads, container, false); return root; }
Source:
void startClose() { if (pullRetryTimeoutMs == 0L) { return; } stateMachine.setState(STATE_CLOSING); }

Target:
void startClose() { if (pullRetryTimeoutMs == TIMEOUT_NO_RETRY) { return; } stateMachine.setState(STATE_CLOSING); }
Source:
public static void main(String[] args) throws Exception { if (args.length != 1 || MasterGoalState.valueOf(args[0]) == null) { System.err.println( "Usage: accumulo " + SetGoalState.class.getName() + " [NORMAL|SAFE_MODE|CLEAN_STOP]"); System.exit(-1); } SecurityUtil.serverLogin(SiteConfiguration.getInstance()); ServerInfo info = ServerInfo.getInstance(); Accumulo.waitForZookeeperAndHdfs(info.getVolumeManager()); ZooReaderWriter.getInstance().putPersistentData( info.getZooKeeperRoot() + Constants.ZMASTER_GOAL_STATE, args[0].getBytes(UTF_8), NodeExistsPolicy.OVERWRITE); }

Target:
public static void main(String[] args) throws Exception { if (args.length != 1 || MasterGoalState.valueOf(args[0]) == null) { System.err.println( "Usage: accumulo " + SetGoalState.class.getName() + " [NORMAL|SAFE_MODE|CLEAN_STOP]"); System.exit(-1); } SecurityUtil.serverLogin(SiteConfiguration.getInstance()); ServerContext context = ServerContext.getInstance(); Accumulo.waitForZookeeperAndHdfs(context.getVolumeManager()); ZooReaderWriter.getInstance().putPersistentData( context.getZooKeeperRoot() + Constants.ZMASTER_GOAL_STATE, args[0].getBytes(UTF_8), NodeExistsPolicy.OVERWRITE); }
Source:
public void visitNode(Tree tree) { MethodTree methodTree = (MethodTree) tree; Symbol.MethodSymbol methodSymbol = methodTree.symbol(); if (methodSymbol != null && isClassController(methodSymbol) && isRequestMappingAnnotated(methodSymbol) && !isPublicMethod(methodSymbol)) { reportIssue(methodTree.simpleName(), "Make this method \"public\"."); } }

Target:
public void visitNode(Tree tree) { if (!hasSemantic()) { return; } MethodTree methodTree = (MethodTree) tree; Symbol.MethodSymbol methodSymbol = methodTree.symbol(); if (isClassController(methodSymbol) && isRequestMappingAnnotated(methodSymbol) && !isPublicMethod(methodSymbol)) { reportIssue(methodTree.simpleName(), "Make this method \"public\"."); } }
Source:
static final ImmutableSortedSet<Integer> getApiLevels(Dirents platformsDirectories) { ImmutableSortedSet.Builder<Integer> apiLevels = ImmutableSortedSet.reverseOrder(); for (Dirent platformDirectory : platformsDirectories) { if (platformDirectory.getType() != Dirent.Type.DIRECTORY && platformDirectory.getType() != Dirent.Type.SYMLINK) { continue; } Matcher matcher = PLATFORMS_API_LEVEL_PATTERN.matcher(platformDirectory.getName()); if (matcher.matches()) { apiLevels.add(Integer.parseInt(matcher.group(1))); } } return apiLevels.build(); }

Target:
static final ImmutableSortedSet<Integer> getApiLevels(Dirents platformsDirectories) { ImmutableSortedSet.Builder<Integer> apiLevels = ImmutableSortedSet.reverseOrder(); for (Dirent platformDirectory : platformsDirectories) { if (platformDirectory.getType() == Dirent.Type.DIRECTORY || platformDirectory.getType() == Dirent.Type.SYMLINK) { Matcher matcher = PLATFORMS_API_LEVEL_PATTERN.matcher(platformDirectory.getName()); if (matcher.matches()) { apiLevels.add(Integer.parseInt(matcher.group(1))); } } } return apiLevels.build(); }
Source:
public static EphemeralType get(long ephemeralOwner) { if (ephemeralOwner == CONTAINER_EPHEMERAL_OWNER) { return CONTAINER; } if ((ephemeralOwner & TTL_MASK) == TTL_MASK) { return TTL; } return (ephemeralOwner == 0) ? VOID : NORMAL; }

Target:
public static EphemeralType get(long ephemeralOwner) { if (extendedEphemeralTypesEnabled()) { if (Boolean.getBoolean(TTL_3_5_3_EMULATION_PROPERTY)) { if (OldEphemeralType.get(ephemeralOwner) == OldEphemeralType.TTL) { return TTL; } } if ((ephemeralOwner & EXTENDED_MASK) == EXTENDED_MASK) { long extendedFeatureBit = getExtendedFeatureBit(ephemeralOwner); EphemeralType ephemeralType = extendedFeatureMap.get(extendedFeatureBit); if (ephemeralType == null) { throw new IllegalArgumentException(String.format("Invalid ephemeralOwner. [%s]", Long.toHexString(ephemeralOwner))); } return ephemeralType; } } if (ephemeralOwner == CONTAINER_EPHEMERAL_OWNER) { return CONTAINER; } return (ephemeralOwner == 0) ? VOID : NORMAL; }
Source:
public void testNasdaq() { assert(faker.stock().nsdqSymbol() != ""); }

Target:
public void testNasdaq() { assertThat(faker.stock().nsdqSymbol(), not(isEmptyOrNullString())); }
Source:
private void checkLoadable(DeltaWindowEntry ent, long need) { if (maxMemory == 0) return; DeltaWindowEntry n = res.next; while (maxMemory < loaded + need) { clear(n); if (n == ent) throw new LargeObjectException.ExceedsLimit( maxMemory, loaded + need); n = n.next; } }

Target:
private void checkLoadable(DeltaWindowEntry ent, long need) { if (maxMemory == 0) return; DeltaWindowEntry n = res.next; for (; maxMemory < loaded + need; n = n.next) { clear(n); if (n == ent) throw new LargeObjectException.ExceedsLimit( maxMemory, loaded + need); } }
Source:
private static File getUniqueFilename(File dbDir) { String uniqueSuffix = "_" + (Math.random() * 5); String timeAsString = DateTime.now().toString(DateTimeFormat.forPattern("MM_dd_yyyy_HH_mm_ss")); String filename = timeAsString + uniqueSuffix; File newFile = new File(dbDir, filename); while (newFile.exists()) { newFile = getUniqueFilename(dbDir); } return newFile; }

Target:
private static File getUniqueFilename(File dbDir) { String filename = PropertyUtils.genUUID(); File newFile = new File(dbDir, filename); while (newFile.exists()) { newFile = getUniqueFilename(dbDir); } return newFile; }
Source:
private void handlePreparedStatementClusterError(long sesGeneration, Throwable e) { if (sesGeneration < generation) { log.warning("Prepared statement cluster error detected, another thread already fixed the problem", e); return; } synchronized (generation) { if (sesGeneration < generation) { log.warning("Prepared statement cluster error detected, another thread already fixed the problem", e); return; } log.warning("Prepared statement cluster error detected, refreshing Cassandra session", e); refresh(); log.warning("Cassandra session refreshed"); } }

Target:
private void handlePreparedStatementClusterError(long sesGeneration, Throwable e) { if (sesGeneration < generation) { log.warning("Prepared statement cluster error detected, another thread already fixed the problem", e); return; } refreshLock.lock(); try { if (sesGeneration < generation) { log.warning("Prepared statement cluster error detected, another thread already fixed the problem", e); return; } log.warning("Prepared statement cluster error detected, refreshing Cassandra session", e); refresh(); log.warning("Cassandra session refreshed"); } finally { refreshLock.unlock(); } }
Source:
public final ChannelPipeline addBefore(String baseName, String name, ChannelHandler handler) { final AbstractChannelHandlerContext ctx; checkMultiplicity(handler); if (name == null) { name = generateName(handler); } final AbstractChannelHandlerContext newCtx = newContext(name, handler); synchronized (handlers) { int i = findCtxIdx((context) -> context.name().equals(baseName)); if (i == -1) { throw new NoSuchElementException(baseName); } if (context(name) != null) { throw new IllegalArgumentException("Duplicate handler name: " + name); } ctx = handlers.get(i); handlers.add(i, newCtx); } EventExecutor executor = executor(); if (executor.inEventLoop()) { addBefore0(ctx, newCtx); } else { try { executor.execute(() -> addBefore0(ctx, newCtx)); } catch (Throwable cause) { synchronized (handlers) { handlers.remove(newCtx); } throw cause; } } return this; }

Target:
public final ChannelPipeline addBefore(String baseName, String name, ChannelHandler handler) { final AbstractChannelHandlerContext ctx; checkMultiplicity(handler); if (name == null) { name = generateName(handler); } AbstractChannelHandlerContext newCtx = newContext(name, handler); EventExecutor executor = executor(); boolean inEventLoop = executor.inEventLoop(); synchronized (handlers) { int i = findCtxIdx(context -> context.name().equals(baseName)); if (i == -1) { throw new NoSuchElementException(baseName); } if (context(name) != null) { throw new IllegalArgumentException("Duplicate handler name: " + name); } ctx = handlers.get(i); handlers.add(i, newCtx); if (!inEventLoop) { try { executor.execute(() -> addBefore0(ctx, newCtx)); return this; } catch (Throwable cause) { handlers.remove(i); throw cause; } } } addBefore0(ctx, newCtx); return this; }
Source:
public void hideAll() { Collection<List<Marker>> listMarkers = fMarkerRegistry.values(); List<Marker> markers = Lists.newArrayList(Iterables.concat(listMarkers)); Iterator<Marker> visibleMarkers = Iterators.filter(markers.iterator(), new Predicate<Marker>() { public boolean apply(Marker marker) { return marker.getFigure().getParent() != null; } }); while (visibleMarkers.hasNext()) { Marker marker = (Marker)visibleMarkers.next(); handleDecorator(marker, false, true); } }

Target:
public void hideAll() { Collection<Marker> listMarkers = fMarkerRegistry.values(); Iterable<Marker> visibleMarkers = Iterables.filter(listMarkers, new Predicate<Marker>() { public boolean apply(Marker marker) { return marker.getFigure().getParent() != null; } }); for (Marker marker : visibleMarkers) { handleDecorator(marker, false, true); } }
Source:
protected void checkNotification(ClientNotificationClusterNotification notificationToCheck) { Assert.assertTrue(notificationToCheck.getQueueElement().getNotification() instanceof ResetAccessControlChangedNotification); Assert.assertTrue(notificationToCheck.getQueueElement().getFilter() instanceof SingleUserFilter); Assert.assertNull(((SingleUserFilter) notificationToCheck.getQueueElement().getFilter()).getUserId()); }

Target:
protected void checkNotification(ClientNotificationClusterNotification notificationToCheck) { assertTrue(notificationToCheck.getQueueElement().getNotification() instanceof ResetAccessControlChangedNotification); assertTrue(notificationToCheck.getQueueElement().getFilter() instanceof SingleUserFilter); assertNull(((SingleUserFilter) notificationToCheck.getQueueElement().getFilter()).getUserId()); }
Source:
protected Calendar getRetainUntilDateFrom(LocalDateTime datetime) { LocalDateTime localDateTime = datetime.plusYears(getDurationYears()) .plusMonths(getDurationMonths()) .plusDays(getDurationDays()) .plusNanos(getDurationMillis() * 1000000); return GregorianCalendar.from(localDateTime.atZone(ZoneId.systemDefault())); }

Target:
protected Calendar getRetainUntilDateFrom(LocalDateTime datetime) { LocalDateTime localDateTime = datetime.plusYears(getDurationYears()) .plusMonths(getDurationMonths()) .plusDays(getDurationDays()) .plus(getDurationMillis(), ChronoUnit.MILLIS); return GregorianCalendar.from(localDateTime.atZone(ZoneId.systemDefault())); }
Source:
public AABB transform(Transform transform) { return transform(transform, 0.01f); }

Target:
public AABB transform(Transform transform) { return transform(transform, DEFAULT_MARGIN); }
Source:
List<TopicChanges> sample(final Collection<Document> documents) { final CountDownLatch latch = new CountDownLatch(numTrainerThreads); final BlockingQueue<Document> instances = new ArrayBlockingQueue<>(miniBatchSize); instances.addAll(documents); final List<Future<TopicChanges>> futures = new ArrayList<>(numTrainerThreads); try { for (int threadIdx = 0; threadIdx < numTrainerThreads; threadIdx++) { final Future<TopicChanges> future = executor.submit(() -> { final LDAModel model = modelAccessor.getModel() .orElseThrow(() -> new RuntimeException(MSG_GET_MODEL_FAILED)); int count = 0; while (true) { final int numInstancesPerThread = Math.min(miniBatchSize, documents.size()) / numTrainerThreads + 1; final List<Document> instancesPerThread = new ArrayList<>(numInstancesPerThread); final int numDrained = instances.drainTo(instancesPerThread, numInstancesPerThread); if (numDrained == 0) { break; } instancesPerThread.forEach(instance -> updateModel(instance, model)); count += numDrained; } latch.countDown(); LOG.log(Level.INFO, "{0} has computed {1} instances", new Object[]{Thread.currentThread().getName(), count}); return model.getTopicChanges(); }); futures.add(future); } latch.await(); } catch (final InterruptedException e) { LOG.log(Level.SEVERE, "Exception occurred.", e); throw new RuntimeException(e); } return ThreadUtils.retrieveResults(futures); }

Target:
List<TopicChanges> sample(final Collection<Document> documents) { final CountDownLatch latch = new CountDownLatch(numTrainerThreads); final BlockingQueue<Document> instances = new ArrayBlockingQueue<>(documents.size()); instances.addAll(documents); final List<Future<TopicChanges>> futures = new ArrayList<>(numTrainerThreads); try { for (int threadIdx = 0; threadIdx < numTrainerThreads; threadIdx++) { final Future<TopicChanges> future = executor.submit(() -> { final LDAModel model = modelAccessor.getModel() .orElseThrow(() -> new RuntimeException(MSG_GET_MODEL_FAILED)); final int drainSize = Math.min(documents.size() / numTrainerThreads / numTrainerThreads, 1); final List<Document> drainedInstances = new ArrayList<>(drainSize); int count = 0; while (true) { final int numDrained = instances.drainTo(drainedInstances, drainSize); if (numDrained == 0) { break; } drainedInstances.forEach(instance -> updateModel(instance, model)); drainedInstances.clear(); count += numDrained; } latch.countDown(); LOG.log(Level.INFO, "{0} has computed {1} instances", new Object[]{Thread.currentThread().getName(), count}); return model.getTopicChanges(); }); futures.add(future); } latch.await(); } catch (final InterruptedException e) { LOG.log(Level.SEVERE, "Exception occurred.", e); throw new RuntimeException(e); } return ThreadUtils.retrieveResults(futures); }
Source:
private void updatePose() { if (vrSystem == null || vrCompositor == null) { return; } vrCompositor.WaitGetPoses.apply(hmdTrackedDevicePoseReference, JOpenVRLibrary.k_unMaxTrackedDeviceCount, null, 0); for (int nDevice = 0; nDevice < JOpenVRLibrary.k_unMaxTrackedDeviceCount; ++nDevice) { hmdTrackedDevicePoses[nDevice].read(); } if (hmdTrackedDevicePoses[JOpenVRLibrary.k_unTrackedDeviceIndex_Hmd].bPoseIsValid != 0) { for (int nEye = 0; nEye < 2; nEye++) { HmdMatrix34_t matPose = vrSystem.GetEyeToHeadTransform.apply(nEye); vrState.setEyePoseWRTHead(matPose, nEye); HmdMatrix44_t matProjection = vrSystem.GetProjectionMatrix.apply(nEye, nearClip, farClip, JOpenVRLibrary.EGraphicsAPIConvention.EGraphicsAPIConvention_API_OpenGL); vrState.setProjectionMatrix(matProjection, nEye); } vrState.setHeadPose(hmdTrackedDevicePoses[JOpenVRLibrary.k_unTrackedDeviceIndex_Hmd].mDeviceToAbsoluteTracking); headIsTracking = true; } else { headIsTracking = false; } findControllerDevices(); for (int c = 0; c < 2; c++) { if (controllerDeviceIndex[c] != -1) { controllerTracking[c] = true; vrState.setControllerPose(hmdTrackedDevicePoses[controllerDeviceIndex[c]].mDeviceToAbsoluteTracking, c); } else { controllerTracking[c] = false; } } }

Target:
private void updatePose() { vrCompositor.WaitGetPoses.apply(hmdTrackedDevicePoseReference, JOpenVRLibrary.k_unMaxTrackedDeviceCount, null, 0); for (int nDevice = 0; nDevice < JOpenVRLibrary.k_unMaxTrackedDeviceCount; ++nDevice) { hmdTrackedDevicePoses[nDevice].read(); } if (hmdTrackedDevicePoses[JOpenVRLibrary.k_unTrackedDeviceIndex_Hmd].bPoseIsValid != 0) { for (int nEye = 0; nEye < 2; nEye++) { HmdMatrix34_t matPose = vrSystem.GetEyeToHeadTransform.apply(nEye); vrState.setEyePoseWRTHead(matPose, nEye); HmdMatrix44_t matProjection = vrSystem.GetProjectionMatrix.apply(nEye, nearClip, farClip, JOpenVRLibrary.EGraphicsAPIConvention.EGraphicsAPIConvention_API_OpenGL); vrState.setProjectionMatrix(matProjection, nEye); } vrState.setHeadPose(hmdTrackedDevicePoses[JOpenVRLibrary.k_unTrackedDeviceIndex_Hmd].mDeviceToAbsoluteTracking); headIsTracking = true; } else { headIsTracking = false; } findControllerDevices(); for (int handIndex = 0; handIndex < 2; handIndex++) { if (controllerDeviceIndex[handIndex] != -1) { controllerTracking[handIndex] = true; vrState.setControllerPose(hmdTrackedDevicePoses[controllerDeviceIndex[handIndex]].mDeviceToAbsoluteTracking, handIndex); } else { controllerTracking[handIndex] = false; } } }
Source:
public void testAddRomDriveToServerPayload() { AddRomDriveToServerRequestBinder binder = new AddRomDriveToServerRequestBinder(); Drive.Request.AddRomDriveToServerPayload payload = Drive.Request.AddRomDriveToServerPayload.builder() .serverId("server-id") .storageId("image-id") .deviceNumber("device-number") .build(); String actual = binder.createPayload(payload); assertNotNull(actual, "Binder returned null payload"); assertEquals(expectedPayload, actual); }

Target:
public void testAddRomDriveToServerPayload() { AddRomDriveToServerRequestBinder binder = new AddRomDriveToServerRequestBinder(); Drive.Request.AddRomDriveToServerPayload payload = Drive.Request.AddRomDriveToServerPayload.builder() .serverId("server-id") .storageId("image-id") .deviceNumber("device-number") .build(); String actual = binder.createPayload(payload); assertEquals(expectedPayload, actual); }
Source:
public void createEntityConstraints(GraphDatabaseService neo4jDb, Configuration configuration) { UniqueConstraintSchemaUpdateStrategy constraintMethod = UniqueConstraintSchemaUpdateStrategy.interpret( configuration.getProperties().get( Environment.UNIQUE_CONSTRAINT_SCHEMA_UPDATE_STRATEGY ) ); if ( constraintMethod == UniqueConstraintSchemaUpdateStrategy.SKIP ) { log.tracef( "%1$s property set to %2$s: Skipping generation of unique constraints", Environment.UNIQUE_CONSTRAINT_SCHEMA_UPDATE_STRATEGY, UniqueConstraintSchemaUpdateStrategy.SKIP ); } else { Transaction tx = null; try { tx = neo4jDb.beginTx(); addUniqueConstraints( neo4jDb, configuration ); tx.success(); } finally { tx.close(); } } }

Target:
public void createEntityConstraints(GraphDatabaseService neo4jDb, Configuration configuration) { UniqueConstraintSchemaUpdateStrategy constraintMethod = UniqueConstraintSchemaUpdateStrategy.interpret( configuration.getProperties().get( Environment.UNIQUE_CONSTRAINT_SCHEMA_UPDATE_STRATEGY ) ); log.debugf( "%1$s property set to %2$s" , Environment.UNIQUE_CONSTRAINT_SCHEMA_UPDATE_STRATEGY ); if ( constraintMethod == UniqueConstraintSchemaUpdateStrategy.SKIP ) { log.tracef( "%1$s property set to %2$s: Skipping generation of unique constraints", Environment.UNIQUE_CONSTRAINT_SCHEMA_UPDATE_STRATEGY, UniqueConstraintSchemaUpdateStrategy.SKIP ); } else { log.debug( "Creating missing constraints" ); Transaction tx = null; try { tx = neo4jDb.beginTx(); addUniqueConstraints( neo4jDb, configuration ); tx.success(); } finally { tx.close(); } } }
Source:
public void setPollSleep(long time, TimeUnit unit) { if(unit.toMillis(time)<MIN_POLL_INTERVAL_MS){ pollMs.set(MIN_POLL_INTERVAL_MS); } else{ pollMs.set(unit.toMillis(time)); } }

Target:
public void setPollSleep(long time, TimeUnit unit) { if ( unit.toMillis(time) < MIN_POLL_INTERVAL_MS ) { log.warning(String.format("Poll interval cannot be less than %d seconds. Setting it to %d seconds.", TimeUnit.MILLISECONDS.toSeconds(MIN_POLL_INTERVAL_MS), TimeUnit.MILLISECONDS.toSeconds(MIN_POLL_INTERVAL_MS))); pollMs.set(MIN_POLL_INTERVAL_MS); } else { pollMs.set(unit.toMillis(time)); } }
Source:
protected String getBrokerName() { if (brokerName == null) { EntityLocal parent = (EntityLocal)getParent(); brokerName = parent != null ? parent.getAttribute(ActiveMQBroker.BROKER_NAME) : null; } return brokerName; }

Target:
protected String getBrokerName() { Preconditions.checkNotNull(getParent(), "JMS Destination must have a broker parent"); return getParent().getAttribute(ActiveMQBroker.BROKER_NAME); }
Source:
public void updateKeyWithResponseSnippets() { KeyAsyncClient keyAsyncClient = createAsyncClient(); keyAsyncClient.getKey("keyName") .subscribe(keyResponse -> { keyResponse.getProperties().setNotBefore(OffsetDateTime.now().plusDays(50)); keyAsyncClient.updateKeyPropertiesWithResponse(keyResponse.getProperties(), KeyOperation.ENCRYPT, KeyOperation.DECRYPT) .subscriberContext(Context.of(key1, value1, key2, value2)) .subscribe(updatedKeyResponse -> System.out.printf("Key's getUpdated not before time %s %n", updatedKeyResponse.getValue().getProperties().getNotBefore().toString())); }); END: com.azure.security.keyvault.keys.async.keyclient.updateKeyPropertiesWithResponse#KeyProperties-keyOperations keyAsyncClient.getKey("keyName") .subscribe(keyResponse -> { keyResponse.getProperties().setNotBefore(OffsetDateTime.now().plusDays(50)); keyAsyncClient.updateKeyPropertiesWithResponse(keyResponse.getProperties()) .subscriberContext(Context.of(key1, value1, key2, value2)) .subscribe(updatedKeyResponse -> System.out.printf("Key's getUpdated not before time %s %n", updatedKeyResponse.getValue().getProperties().getNotBefore().toString())); }); END: com.azure.security.keyvault.keys.async.keyclient.updateKeyPropertiesWithResponse#KeyProperties }

Target:
public void updateKeyWithResponseSnippets() { KeyAsyncClient keyAsyncClient = createAsyncClient(); keyAsyncClient.getKey("keyName") .subscribe(keyResponse -> { keyResponse.getProperties().setNotBefore(OffsetDateTime.now().plusDays(50)); keyAsyncClient.updateKeyPropertiesWithResponse(keyResponse.getProperties(), KeyOperation.ENCRYPT, KeyOperation.DECRYPT) .subscriberContext(Context.of(key1, value1, key2, value2)) .subscribe(updatedKeyResponse -> System.out.printf("Key's updated not before time %s %n", updatedKeyResponse.getValue().getProperties().getNotBefore().toString())); }); END: com.azure.security.keyvault.keys.async.keyclient.updateKeyPropertiesWithResponse#KeyProperties-keyOperations }
Source:
public void valid() { BatchDeleteClientsRequest.builder() .clientIdentification(ClientIdentification.builder() .clientId("client-id") .build()) .build(); }

Target:
public void valid() { BatchDeleteClientsRequest.builder() .clientId("test-client-id") .build(); }
Source:
public String getSubtitleText(long currMediaTime, boolean willDisplay) { if (external) currMediaTime += delay; String rv = ""; subtitleLock.readLock().lock(); try { boolean foundValid = false; for (int i = getSubEntryIndex(currMediaTime); i < subEntries.size(); i++) { SubtitleEntry currEntry = subEntries.get(i); SubtitleEntry nextEntry = ((i < subEntries.size() - 1) ? subEntries.get(i + 1) : null); if (currEntry.start <= currMediaTime) { if ((currEntry.duration > 0 && currEntry.start + currEntry.duration > currMediaTime) || (currEntry.duration == 0 && (nextEntry == null || nextEntry.start > currMediaTime))) { foundValid = true; if (rv.length() == 0 && willDisplay) { subEntryPos = i; currBlank = false; } rv = (rv.length() == 0) ? currEntry.text : (rv + "\n" + currEntry.text); } else if (rv.length() == 0 && willDisplay) { subEntryPos = i; currBlank = true; } } else { if (rv.length() == 0 && willDisplay && !foundValid) { subEntryPos = i; currBlank = true; } break; } } } finally { subtitleLock.readLock().unlock(); } System.out.println("Got Subtitle text=" + rv + " subEntryPos=" + subEntryPos); return rv; }

Target:
public String getSubtitleText(long currMediaTime, boolean willDisplay) { if (external) currMediaTime += delay; String rv = ""; subtitleLock.readLock().lock(); try { boolean foundValid = false; for (int i = getSubEntryIndex(currMediaTime); i < subEntries.size(); i++) { SubtitleEntry currEntry = subEntries.get(i); SubtitleEntry nextEntry = ((i < subEntries.size() - 1) ? subEntries.get(i + 1) : null); if (currEntry.start <= currMediaTime) { if ((currEntry.duration > 0 && currEntry.start + currEntry.duration > currMediaTime) || (currEntry.duration == 0 && (nextEntry == null || nextEntry.start > currMediaTime))) { foundValid = true; if (rv.length() == 0 && willDisplay) { subEntryPos = i; currBlank = false; } rv = (rv.length() == 0) ? currEntry.text : (rv + "\n" + currEntry.text); } else if (rv.length() == 0 && willDisplay) { subEntryPos = i; currBlank = true; } } else { if (rv.length() == 0 && willDisplay && !foundValid) { subEntryPos = i; currBlank = true; } break; } } } finally { subtitleLock.readLock().unlock(); } if (SUB_DEBUG) System.out.println("Got Subtitle text=" + rv + " subEntryPos=" + subEntryPos); return rv; }
Source:
private static boolean testCompiler(final Context context, final File path) throws ExitException { if (Utils.isWindows()) { return Utils.testCommand(context, path.getAbsolutePath(), "DSL Platform", Charset.forName("UTF-8")); } else { final Either<String> mono = Mono.findMono(context); if (mono.isSuccess()) { return Utils.testCommand(context, mono.get(), "DSL Platform", Collections.singletonList(path.getAbsolutePath()), Charset.forName("UTF-8")); } else { context.error("Mono is required to run DSL compiler. Mono not detected or specified."); throw new ExitException(); } } }

Target:
private static boolean testCompiler(final Context context, final File path) throws ExitException { if (Utils.isWindows()) { return Utils.testCommand(context, path.getAbsolutePath(), "DSL Platform"); } else { final Either<String> mono = Mono.findMono(context); if (mono.isSuccess()) { return Utils.testCommand(context, mono.get(), "DSL Platform", Collections.singletonList(path.getAbsolutePath())); } else { context.error("Mono is required to run DSL compiler. Mono not detected or specified."); throw new ExitException(); } } }
Source:
public MachineImpl createMachineAsync(MachineConfig machineConfig, final String workspaceId, final String environmentName) throws NotFoundException, SnapshotException, ConflictException, MachineException, BadRequestException { return createMachine(normalizeMachineConfig(machineConfig), workspaceId, environmentName, (instanceProvider, machine, machineLogger) -> executor.execute(ThreadLocalPropagateContext.wrap(() -> { try { createInstance(instanceProvider, machine, machineLogger); } catch (MachineException | NotFoundException e) { if (e.getCause() instanceof InvalidRecipeException) { LOG.warn(e.getLocalizedMessage()); } else { LOG.error(e.getLocalizedMessage(), e); } } })), null); }

Target:
public MachineImpl createMachineAsync(MachineConfig machineConfig, final String workspaceId, final String environmentName) throws NotFoundException, SnapshotException, ConflictException, MachineException, BadRequestException { return createMachine(normalizeMachineConfig(machineConfig), workspaceId, environmentName, (instanceProvider, machine, machineLogger) -> executor.execute(ThreadLocalPropagateContext.wrap(() -> { try { createInstance(instanceProvider, machine, machineLogger); } catch (MachineException | NotFoundException e) { if (!(e.getCause() instanceof InvalidRecipeException)) { LOG.error(e.getLocalizedMessage(), e); } } })), null); }
Source:
public static void setup() throws SQLException { ServerTest.allocServer(); HttpOp.setDefaultHttpClient(null); connection = new RemoteEndpointConnection(ServerTest.serviceQuery, ServerTest.serviceUpdate, JenaConnection.DEFAULT_HOLDABILITY, JdbcCompatibility.DEFAULT); connection.setJdbcCompatibilityLevel(JdbcCompatibility.HIGH); }

Target:
public static void setup() throws SQLException { ServerCtl.ctlBeforeClass(); connection = new RemoteEndpointConnection(ServerTest.serviceQuery, ServerTest.serviceUpdate, JenaConnection.DEFAULT_HOLDABILITY, JdbcCompatibility.DEFAULT); connection.setJdbcCompatibilityLevel(JdbcCompatibility.HIGH); }
Source:
public CapabilityCollection getCapabilityCollection() { final List<AccessSection> allCapabilities = new ArrayList<AccessSection>(); ProjectState s = this; final Set<Project.NameKey> seen = new HashSet<Project.NameKey>(); seen.add(s.getProject().getNameKey()); do { final AccessSection capabilitiesSection = s.getConfig().getAccessSection(AccessSection.GLOBAL_CAPABILITIES); if (capabilitiesSection != null) { allCapabilities.add(capabilitiesSection); } if (s.isAllProjects) { break; } final Project.NameKey parent = s.getProject().getParent(); if (!seen.add(parent)) { break; } s = projectCache.get(parent); } while (s != null); return new CapabilityCollection(allCapabilities); }

Target:
public CapabilityCollection getCapabilityCollection() { final List<AccessSection> allCapabilities = new ArrayList<AccessSection>(); ProjectState s = this; final Set<Project.NameKey> seen = new HashSet<Project.NameKey>(); seen.add(s.getProject().getNameKey()); do { final AccessSection capabilitiesSection = s.getConfig().getAccessSection(AccessSection.CAPABILITIES); if (capabilitiesSection != null) { allCapabilities.add(capabilitiesSection); } if (s.isAllProjects) { break; } final Project.NameKey parent = s.getProject().getParent(); if (!seen.add(parent)) { break; } s = projectCache.get(parent); } while (s != null); return new CapabilityCollection(allCapabilities); }
Source:
public static void main(String[] args) { String connectionString = "Endpoint={endpoint};SharedAccessKeyName={sharedAccessKeyName};SharedAccessKey={sharedAccessKey};EntityPath={eventHubPath}"; EventHubClient client = new EventHubClientBuilder() .connectionString(connectionString) .build(); String firstPartition = client.getPartitionIds().blockFirst(OPERATION_TIMEOUT); EventHubProducerOptions producerOptions = new EventHubProducerOptions().partitionId(firstPartition); EventHubProducer producer = client.createProducer(producerOptions); List<EventData> dataList = new ArrayList<>(); dataList.add(new EventData("EventData Sample 1".getBytes(UTF_8))); dataList.add(new EventData("EventData Sample 2 ".getBytes(UTF_8))); dataList.add(new EventData("EventData Sample 3".getBytes(UTF_8))); producer.send(dataList).subscribe( (ignored) -> System.out.println("A list of Event sent."), error -> { System.err.println("There was an error sending the event: " + error.toString()); if (error instanceof AmqpException) { AmqpException amqpException = (AmqpException) error; System.err.println(String.format("Is send operation retriable? %s. Error condition: %s", amqpException.isTransient(), amqpException.getErrorCondition())); } }, () -> { try { producer.close(); } catch (IOException e) { System.err.println("Error encountered while closing producer: " + e.toString()); } client.close(); }); }

Target:
public static void main(String[] args) { String connectionString = "Endpoint={endpoint};SharedAccessKeyName={sharedAccessKeyName};SharedAccessKey={sharedAccessKey};EntityPath={eventHubPath}"; EventHubClient client = new EventHubClientBuilder() .connectionString(connectionString) .buildAsyncClient(); String firstPartition = client.getPartitionIds().blockFirst(OPERATION_TIMEOUT); EventHubProducerOptions producerOptions = new EventHubProducerOptions().partitionId(firstPartition); EventHubProducer producer = client.createProducer(producerOptions); Flux<EventData> data = Flux.just( new EventData("EventData Sample 1".getBytes(UTF_8)), new EventData("EventData Sample 2".getBytes(UTF_8)), new EventData("EventData Sample 3".getBytes(UTF_8))); producer.send(data).subscribe( (ignored) -> System.out.println("Events sent."), error -> { System.err.println("There was an error sending the event: " + error.toString()); if (error instanceof AmqpException) { AmqpException amqpException = (AmqpException) error; System.err.println(String.format("Is send operation retriable? %s. Error condition: %s", amqpException.isTransient(), amqpException.getErrorCondition())); } }, () -> { try { producer.close(); } catch (IOException e) { System.err.println("Error encountered while closing producer: " + e.toString()); } client.close(); }); }
Source:
public synchronized void refreshCache() { CacheManager manager = CacheManager.getInstance(); prefetchedCaches.loadPreFetchedBasicSearch(); LOGGER.debug("Adding cache generation time to prefetched cache."); CacheReplacer.replaceCache(manager.getCache(CacheNames.COLLECTIONS_LISTINGS), manager.getCache(CacheNames.COLLECTIONS_PREFETCHED_LISTINGS)); }

Target:
public synchronized void refreshCache() { CacheManager manager = CacheManager.getInstance(); prefetchedCaches.loadPreFetchedBasicSearch(); LOGGER.debug("Replacing live listings collection cache with pre-fetched data."); CacheReplacer.replaceCache(manager.getCache(CacheNames.COLLECTIONS_LISTINGS), manager.getCache(CacheNames.COLLECTIONS_PREFETCHED_LISTINGS)); }
Source:
public AttributeComputeTransform(String field, Class type, String cql) throws CQLException { this.field = field; this.type = type; this.cql = cql; this.expression = ECQL.toExpression(cql); }

Target:
public AttributeComputeTransform(String field, Class type, String cql) throws CQLException { this.field = field; this.type = type; setCql(cql); }
Source:
public ConflictGroup(Conflict conflict) { this.conflict = conflict; this.diffs.addAll(computeDiffs()); }

Target:
public ConflictGroup(Conflict conflict) { this.conflict = checkNotNull(conflict); this.diffs.addAll(computeDiffs()); }