auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testFeedListDownloadUrls() { List<Feed> feeds = saveFeedlist(10, 0, false); List<String> urls = DBReader.getFeedListDownloadUrls(); assertNotNull(urls); assertEquals(urls.size(), feeds.size()); for (int i = 0; i < urls.size(); i++) { assertEquals(urls.get(i), feeds.get(i).getDownload_url()); } }

Target:
public void testFeedListDownloadUrls() { List<Feed> feeds = saveFeedlist(10, 0, false); List<String> urls = DBReader.getFeedListDownloadUrls(); assertNotNull(urls); assertEquals(feeds.size(), urls.size()); for (int i = 0; i < urls.size(); i++) { assertEquals(urls.get(i), feeds.get(i).getDownload_url()); } }
Source:
protected void setActionMessageParameters() { addCanDoActionMessage(VdcBllMessages.VAR__ACTION__DISABLE_GLUSTER_HOOK); addCanDoActionMessage(VdcBllMessages.VAR__TYPE__GLUSTER_HOOK); }

Target:
protected void setActionMessageParameters() { addCanDoActionMessage(VdcBllMessages.VAR__ACTION__DISABLE); addCanDoActionMessage(VdcBllMessages.VAR__TYPE__GLUSTER_HOOK); }
Source:
private SweepResults runInternal( TableReference tableRef, SweepBatchConfig batchConfig, byte[] startRow, RunType runType) { Preconditions.checkNotNull(tableRef, "tableRef cannot be null"); Preconditions.checkState(!AtlasDbConstants.hiddenTables.contains(tableRef)); if (tableRef.getQualifiedName().startsWith(AtlasDbConstants.NAMESPACE_PREFIX)) { log.warn("The sweeper should not be run on tables passed through namespace mapping."); return SweepResults.createEmptySweepResult(); } if (keyValueService.getMetadataForTable(tableRef).length == 0) { log.warn("The sweeper tried to sweep table '{}', but the table does not exist. Skipping table.", UnsafeArg.of("table name", tableRef)); return SweepResults.createEmptySweepResult(); } SweepStrategy sweepStrategy = SweepStrategy.THOROUGH; Optional<Sweeper> sweeper = Sweeper.of(sweepStrategy); if (!sweeper.isPresent()) { return SweepResults.createEmptySweepResult(); } return doRun(tableRef, batchConfig, startRow, runType, sweeper.get()); }

Target:
private SweepResults runInternal( TableReference tableRef, SweepBatchConfig batchConfig, byte[] startRow, RunType runType) { Preconditions.checkNotNull(tableRef, "tableRef cannot be null"); Preconditions.checkState(!AtlasDbConstants.hiddenTables.contains(tableRef)); if (tableRef.getQualifiedName().startsWith(AtlasDbConstants.NAMESPACE_PREFIX)) { log.warn("The sweeper should not be run on tables passed through namespace mapping."); return SweepResults.createEmptySweepResult(); } if (keyValueService.getMetadataForTable(tableRef).length == 0) { log.warn("The sweeper tried to sweep table '{}', but the table does not exist. Skipping table.", UnsafeArg.of("table name", tableRef)); return SweepResults.createEmptySweepResult(); } SweepStrategy sweepStrategy = sweepStrategyManager.get().getOrDefault(tableRef, SweepStrategy.CONSERVATIVE); Optional<Sweeper> sweeper = Sweeper.of(sweepStrategy); if (!sweeper.isPresent()) { return SweepResults.createEmptySweepResult(); } return doRun(tableRef, batchConfig, startRow, runType, sweeper.get()); }
Source:
VersionKey guess() { IService service = OpenShiftServerUtils.getService(server); if (service != null) { IProject project = service.getProject(); if (project != null) { List<IBuildConfig> buildConfigs = project.getResources(ResourceKind.BUILD_CONFIG); if (buildConfigs != null) { IBuildConfig buildConfig = ResourceUtils.getBuildConfigForService(service, buildConfigs); DockerImageURI imageUri = OpenShiftServerUtils.getImageUri(buildConfig); return knowImages.get(imageUri.getName()); } } } return null; }

Target:
VersionKey guess() { IService service = OpenShiftServerUtils.getService(server); if (service != null) { IProject project = service.getProject(); if (project != null) { List<IBuildConfig> buildConfigs = project.getResources(ResourceKind.BUILD_CONFIG); if (buildConfigs != null) { IBuildConfig buildConfig = ResourceUtils.getBuildConfigForService(service, buildConfigs); if (buildConfig != null) { DockerImageURI imageUri = ResourceUtils.getImageUri(buildConfig); if (imageUri != null) { return knowImages.get(imageUri.getName()); } } } } } return null; }
Source:
private void addTags(Class<?> clazz, CucumberOptions options, RuntimeOptionsBuilder args) { String tagExpression = options.tags(); if (!tagExpression.isEmpty()) { try { args.addTagFilter(TagExpressionParser.parse(tagExpression)); } catch (TagExpressionException tee) { throw new IllegalArgumentException(String.format("%s at '%s'", tee.getMessage(), clazz.getName()), tee); } } }

Target:
private void addTags(Class<?> clazz, CucumberOptions options, RuntimeOptionsBuilder args) { String tagExpression = options.tags(); if (!tagExpression.isEmpty()) { try { args.addTagFilter(TagExpressionParser.parse(tagExpression)); } catch (TagExpressionException tee) { throw new IllegalArgumentException(String.format("Invalid tag expression at '%s'", clazz.getName()), tee); } } }
Source:
public void testSTRs() { assertEquals(VariantType.TANDEM_REPEAT, VariantClassifier.getVariantClassification("(A)5", "(A)7", 4)); }

Target:
public void testSTRs() { assertEquals(VariantType.TANDEM_REPEAT, VariantClassifier.getVariantClassification("(A)5", "(A)7", 4)); assertEquals(VariantType.TANDEM_REPEAT, VariantClassifier.getVariantClassification("AAAAA", "AAAAAAA", 4)); }
Source:
void ensureOpen(final AsyncCompletionHandler<Void> handler) { try { if (channel != null) { handler.completed(null); } else { channel = AsynchronousSocketChannel.open(); channel.setOption(StandardSocketOptions.TCP_NODELAY, true); channel.connect(serverAddress.getSocketAddress(), null, new CompletionHandler<Void, Object>() { @Override public void completed(final Void result, final Object attachment) { handler.completed(null); } @Override public void failed(final Throwable exc, final Object attachment) { if (exc instanceof ConnectException) { handler.failed(new MongoSocketOpenException("Exception opening socket", serverAddress, exc)); } else { handler.failed(exc); } } }); } } catch (IOException e) { throw new MongoSocketOpenException("Exception opening socket", serverAddress, e); } }

Target:
void ensureOpen(final AsyncCompletionHandler<Void> handler) { try { if (channel != null) { handler.completed(null); } else { channel = AsynchronousSocketChannel.open(); channel.setOption(StandardSocketOptions.TCP_NODELAY, true); channel.setOption(StandardSocketOptions.SO_KEEPALIVE, settings.isKeepAlive()); if (settings.getSendBufferSize() > 0) { channel.setOption(StandardSocketOptions.SO_RCVBUF, settings.getReceiveBufferSize()); } if (settings.getSendBufferSize() > 0) { channel.setOption(StandardSocketOptions.SO_SNDBUF, settings.getReceiveBufferSize()); } channel.connect(serverAddress.getSocketAddress(), null, new CompletionHandler<Void, Object>() { @Override public void completed(final Void result, final Object attachment) { handler.completed(null); } @Override public void failed(final Throwable exc, final Object attachment) { if (exc instanceof ConnectException) { handler.failed(new MongoSocketOpenException("Exception opening socket", getAddress(), exc)); } else { handler.failed(exc); } } }); } } catch (IOException e) { throw new MongoSocketOpenException("Exception opening socket", serverAddress, e); } }
Source:
public static Map<Character, Integer> getPileupBaseCounts(final SamLocusIterator.LocusInfo locus) { int aCount = 0, cCount = 0, gCount = 0, tCount = 0; for (final SamLocusIterator.RecordAndOffset rec : locus.getRecordAndPositions()) { switch (Character.toUpperCase(rec.getReadBase())) { case 'A': ++aCount; break; case 'C': ++cCount; break; case 'G': ++gCount; break; case 'T': ++tCount; break; default: break; } } final Map<Character, Integer> baseCounts = new HashMap<>(); baseCounts.put('A', aCount); baseCounts.put('C', cCount); baseCounts.put('G', gCount); baseCounts.put('T', tCount); return baseCounts; }

Target:
static Nucleotide.Counter getPileupBaseCounts(final SamLocusIterator.LocusInfo locus) { final Nucleotide.Counter result = new Nucleotide.Counter(); for (final SamLocusIterator.RecordAndOffset rec : locus.getRecordAndPositions()) { result.add(rec.getReadBase()); } return result; }
Source:
@Override public void remove() { try { QueueFile.this.remove(); } catch (IOException e) { throw new RuntimeException(e); } size = elementCount; cursor--; }

Target:
@Override public void remove() { lastElementIndex--; if (lastElementIndex != 0) { throw new UnsupportedOperationException("This iterator can only remove " + "elements at the head of the QueueFile."); } try { QueueFile.this.remove(); } catch (IOException e) { throw new RuntimeException(e); } size = elementCount; cursor--; }
Source:
private void checkAlgorithm(String algorithm) { if (isAsymmetricEncryption(algorithm) && !IS_ALGORITHM_AVAILABLE) { log.warn("Non-symmetric encryption '{}' has been configured," + "but the version of aws-java-sdk you are using is outdated and does not support it. " + "Please upgrade to a more recent version.", algorithm); } }

Target:
private void checkAlgorithm(String algorithm) { if (isAsymmetricEncryption(algorithm) && !IS_ALGORITHM_AVAILABLE) { log.warn("Asymmetric encryption '{}' has been configured," + "but the version of aws-java-sdk you are using is outdated and does not support it. " + "Please upgrade to a more recent version.", algorithm); } }
Source:
protected void updateUI(int orientation) { if (orientation == Configuration.ORIENTATION_LANDSCAPE) { messageContainer.setVisibility(View.GONE); transcriptListView.setVisibility(View.GONE); } else { if (transcriptAdapter == null) { messageContainer.setVisibility(View.VISIBLE); transcriptListView.setVisibility(View.GONE); initTranscriptListView(); } else { messageContainer.setVisibility(View.GONE); transcriptListView.setVisibility(View.VISIBLE); transcriptListLayoutListener = new ViewTreeObserver.OnGlobalLayoutListener() { public void onGlobalLayout() { transcriptListView.getViewTreeObserver().removeOnGlobalLayoutListener(this); final float transcriptRowHeight = getResources().getDimension(R.dimen.transcript_row_height); final float listviewHeight = transcriptListView.getHeight(); topOffset = (listviewHeight / 2) - (transcriptRowHeight / 2); } }; transcriptListView.getViewTreeObserver().addOnGlobalLayoutListener(transcriptListLayoutListener); } } if(getActivity() instanceof VideoPlayerFullScreenListener) ((VideoPlayerFullScreenListener) getActivity()).isVideoPlayerFullScreen(orientation == Configuration.ORIENTATION_LANDSCAPE); }

Target:
protected void updateUI(int orientation) { if (orientation == Configuration.ORIENTATION_LANDSCAPE) { messageContainer.setVisibility(View.GONE); transcriptListView.setVisibility(View.GONE); } else { if (transcriptAdapter == null) { messageContainer.setVisibility(View.VISIBLE); transcriptListView.setVisibility(View.GONE); initTranscriptListView(); } else { messageContainer.setVisibility(View.GONE); transcriptListView.setVisibility(View.VISIBLE); transcriptListLayoutListener = new ViewTreeObserver.OnGlobalLayoutListener() { public void onGlobalLayout() { transcriptListView.getViewTreeObserver().removeOnGlobalLayoutListener(this); final float transcriptRowHeight = getResources().getDimension(R.dimen.transcript_row_height); final float listviewHeight = transcriptListView.getHeight(); topOffset = (listviewHeight / 2) - (transcriptRowHeight / 2); } }; transcriptListView.getViewTreeObserver().addOnGlobalLayoutListener(transcriptListLayoutListener); } } }
Source:
public void test_sendfile_null() throws Exception { try { Libcore.os.sendfile(FileDescriptor.out, FileDescriptor.in, null, 0); fail(); } catch (NullPointerException expected) { } }

Target:
public void test_sendfile_null() throws Exception { File in = createTempFile("test_sendfile_null", "Hello, world!"); try { assertEquals("Hello", checkSendfile(true, in, null, "Hello".length())); assertEquals("Hello", checkSendfile(false, in, null, "Hello".length())); } finally { in.delete(); } }
Source:
public static long[] encodePoint( int keyId, CoordinateReferenceSystem crs, double[] coordinate ) throws IllegalArgumentException { if ( coordinate.length > 3 ) { throw new UnsupportedOperationException( "Points with more than 3 dimensions are not supported in the PropertyStore" ); } long keyAndType = keyId | (((long) (PropertyType.GEOMETRY.intValue()) << StandardFormatSettings.PROPERTY_TOKEN_MAXIMUM_ID_BITS)); long gtype_bits = GeometryType.GEOMETRY_POINT.gtype << (StandardFormatSettings.PROPERTY_TOKEN_MAXIMUM_ID_BITS + 4); long dimension_bits = ((long) coordinate.length) << (StandardFormatSettings.PROPERTY_TOKEN_MAXIMUM_ID_BITS + 8); long crsTableId_bits = ((long) crs.table.tableId) << (StandardFormatSettings.PROPERTY_TOKEN_MAXIMUM_ID_BITS + 12); long crsCode_bits = ((long) crs.code) << (StandardFormatSettings.PROPERTY_TOKEN_MAXIMUM_ID_BITS + 16); long[] data = new long[1 + coordinate.length]; data[0] = keyAndType | gtype_bits | dimension_bits | crsTableId_bits | crsCode_bits; for ( int i = 0; i < coordinate.length; i++ ) { data[1 + i] = Double.doubleToLongBits( coordinate[i] ); } return data; }

Target:
public static long[] encodePoint( int keyId, CoordinateReferenceSystem crs, double[] coordinate ) { if ( coordinate.length > GeometryType.getMaxSupportedDimensions() ) { throw new UnsupportedOperationException( "Points with more than " + GeometryType.getMaxSupportedDimensions() + " dimensions are not supported" ); } int idBits = StandardFormatSettings.PROPERTY_TOKEN_MAXIMUM_ID_BITS; long keyAndType = keyId | (((long) (PropertyType.GEOMETRY.intValue()) << idBits)); long gtype_bits = GeometryType.GEOMETRY_POINT.gtype << (idBits + 4); long dimension_bits = ((long) coordinate.length) << (idBits + 8); long crsTableId_bits = ((long) crs.getTable().getTableId()) << (idBits + 12); long crsCode_bits = ((long) crs.getCode()) << (idBits + 16); long[] data = new long[1 + coordinate.length]; data[0] = keyAndType | gtype_bits | dimension_bits | crsTableId_bits | crsCode_bits; for ( int i = 0; i < coordinate.length; i++ ) { data[1 + i] = Double.doubleToLongBits( coordinate[i] ); } return data; }
Source:
private void persistThingEnableStatus(ThingUID thingUID, boolean enabled) { if (storage != null) { logger.debug("Cannot persist thing enable status. Storage unavailable."); } logger.debug("Thing with UID will be persisted as {}.", thingUID, enabled?"enabled.":"disabled."); if (enabled) { storage.remove(thingUID.getAsString()); } else { storage.put(thingUID.getAsString(), enabled); } }

Target:
private void persistThingEnableStatus(ThingUID thingUID, boolean enabled) { if (storage == null) { logger.debug("Cannot persist enable status of thing with UID {}. Persistent storage unavailable.", thingUID); return; } logger.debug("Thing with UID will be persisted as {}.", thingUID, enabled ? "enabled." : "disabled."); if (enabled) { storage.remove(thingUID.getAsString()); } else { storage.put(thingUID.getAsString(), ""); } }
Source:
public void uninstallFeatures( long maxWaitTime, EnumSet<FeaturesService.Option> options, String feature, String... additionalFeatures) throws InterruptedException { Set<String> featuresToUninstall = featuresFromNames(feature, additionalFeatures) .filter(featuresService::isInstalled) .map(Feature::getName) .collect(Collectors.toSet()); String featureNames = String.join(", ", featuresToUninstall); LOGGER.info("Uninstalling the following features: [{}]", featureNames); long startTime = System.currentTimeMillis(); try { featuresService.uninstallFeatures(featuresToUninstall, options); } catch (Exception e) { throw new SynchronizedInstallerException( "Failed to uninstall features [" + String.join(",", featuresToUninstall) + "]", e); } waitForBundles(getRemainingTime(startTime, maxWaitTime)); LOGGER.info( "Finished uninstalling features in ms", featureNames, (System.currentTimeMillis() - startTime)); }

Target:
public void uninstallFeatures( long maxWaitTime, EnumSet<FeaturesService.Option> options, String feature, String... additionalFeatures) throws InterruptedException { Set<String> featuresToUninstall = featuresFromNames(feature, additionalFeatures) .filter(featuresService::isInstalled) .map(Feature::getName) .collect(Collectors.toSet()); if (featuresToUninstall.isEmpty()) { return; } String featureNames = String.join(", ", featuresToUninstall); LOGGER.info("Uninstalling the following features: [{}]", featureNames); long startTime = System.currentTimeMillis(); try { featuresService.uninstallFeatures(featuresToUninstall, options); } catch (Exception e) { throw new SynchronizedInstallerException( "Failed to uninstall features [" + String.join(", ", featuresToUninstall) + "]", e); } waitForBundles(getRemainingTime(startTime, maxWaitTime)); LOGGER.info( "Finished uninstalling features in ms", featureNames, (System.currentTimeMillis() - startTime)); }
Source:
public void testExecuteQueryWithEmptyOption() throws Exception { String query = "status:open"; String option = ""; List<GerritQueryResult> results = null; try { results = executeQuery(query, option); } catch (GerritException e) { exception.expect(GerritHttpException.class); exception.expectMessage(HTTP_ERROR_400); return; } assertNotNull(results); }

Target:
public void testExecuteQueryWithEmptyOption() throws Exception { String query = "status:open"; String option = ""; List<GerritQueryResult> results = null; results = executeQuery(query, option); assertNotNull(results); }
Source:
private void setFinalResult( SpeculativeExecution execution, Connection connection, Message.Response response) { if (!isDone.compareAndSet(false, true)) { if (logger.isTraceEnabled()) logger.trace("[{}] Got beaten to setting the result", execution.id); return; } if (logger.isTraceEnabled()) logger.trace("[{}] Setting final result", execution.id); cancelPendingExecutions(execution); try { if (timerContext != null) timerContext.stop(); ExecutionInfo info; int speculativeExecutions = executionIndex.get() - 1; if (execution.position == 0 && speculativeExecutions == 0 && triedHosts == null && execution.retryConsistencyLevel == null && response.getCustomPayload() == null) { info = execution.current.defaultExecutionInfo; } else { List<Host> hosts; if (triedHosts == null) { hosts = ImmutableList.of(execution.current); } else { hosts = triedHosts; hosts.add(execution.current); } info = new ExecutionInfo( speculativeExecutions, execution.position, hosts, execution.retryConsistencyLevel, response.getCustomPayload()); } callback.onSet(connection, response, info, statement, System.nanoTime() - startTime); if (logger.isWarnEnabled() && response.warnings != null && !response.warnings.isEmpty() && Boolean.getBoolean(RequestHandler.LOG_REQUEST_WARNINGS_PROPERTY)) { for (String warning : response.warnings) { logger.warn(warning); } } } catch (Exception e) { callback.onException( connection, new DriverInternalError( "Unexpected exception while setting final result from " + response, e), System.nanoTime() - startTime, 0); } }

Target:
private void setFinalResult( SpeculativeExecution execution, Connection connection, Message.Response response) { if (!isDone.compareAndSet(false, true)) { if (logger.isTraceEnabled()) logger.trace("[{}] Got beaten to setting the result", execution.id); return; } if (logger.isTraceEnabled()) logger.trace("[{}] Setting final result", execution.id); cancelPendingExecutions(execution); try { if (timerContext != null) timerContext.stop(); ExecutionInfo info; int speculativeExecutions = executionIndex.get() - 1; if (execution.position == 0 && speculativeExecutions == 0 && triedHosts == null && execution.retryConsistencyLevel == null && response.getCustomPayload() == null) { info = execution.current.defaultExecutionInfo; } else { List<Host> hosts; if (triedHosts == null) { hosts = ImmutableList.of(execution.current); } else { hosts = triedHosts; hosts.add(execution.current); } info = new ExecutionInfo( speculativeExecutions, execution.position, hosts, execution.retryConsistencyLevel, response.getCustomPayload()); } callback.onSet(connection, response, info, statement, System.nanoTime() - startTime); if (response.warnings != null && !response.warnings.isEmpty() && !Boolean.getBoolean(RequestHandler.DISABLE_QUERY_WARNING_LOGS) && logger.isWarnEnabled()) { logServerWarnings(response.warnings); } } catch (Exception e) { callback.onException( connection, new DriverInternalError( "Unexpected exception while setting final result from " + response, e), System.nanoTime() - startTime, 0); } }
Source:
T select( int slot ) { if ( instances[slot] == null ) { assertOpen(); instances[slot] = factory.apply( slot ); } return instances[slot]; }

Target:
T select( int slot ) { if ( instances[slot] == null ) { throw new IllegalStateException( "Instance is not instantiated" ); } return instances[slot]; }
Source:
public static DateJsonUnmarshaller getInstance(TimestampFormat format) { if (instance == null || !instance.format.equals(format)) instance = new DateJsonUnmarshaller(format); return instance; }

Target:
public static DateJsonUnmarshaller getInstance(TimestampFormat format) { if (instance == null || !instance.format.equals(format)) { instance = new DateJsonUnmarshaller(format); } return instance; }
Source:
public void testBroadcastwithInitialEvals() throws InterruptedException { final ExecutorService executor = Executors.newFixedThreadPool(NUM_THREAD); final AtomicInteger operationIdCounter = new AtomicInteger(0); final int numMoves = 5; final int numActiveEvals = NUM_INIT_EVALS; final int numOtherEvals = numActiveEvals - 2; final CountDownLatch movedLatch = new CountDownLatch(numMoves); final FinishedCallback finishedCallback = new FinishedCallback(movedLatch); runRandomMove(executor, operationIdCounter, numMoves, numActiveEvals, finishedCallback); movedLatch.await(20000, TimeUnit.MILLISECONDS); final int numBroadcasts = numOtherEvals * (numMoves - finishedCallback.getNumFailedMoves()); while (messageSender.getBroadcastCount() < numBroadcasts) { Thread.sleep(1000); } Thread.sleep(2000); assertEquals(numBroadcasts, messageSender.getBroadcastCount()); }

Target:
public void testBroadcastwithInitialEvals() throws InterruptedException { final ExecutorService executor = Executors.newFixedThreadPool(NUM_THREAD); final AtomicInteger operationIdCounter = new AtomicInteger(0); final int numMoves = 5; final int numActiveEvals = NUM_INIT_EVALS; final int numOtherEvals = numActiveEvals - 2; final CountDownLatch movedLatch = new CountDownLatch(numMoves); final FinishedCallback finishedCallback = new FinishedCallback(movedLatch); runRandomMove(executor, operationIdCounter, numMoves, numActiveEvals, finishedCallback); assertTrue("Move does not finish within time", movedLatch.await(20000, TimeUnit.MILLISECONDS)); int loop = 0; final int numBroadcasts = numOtherEvals * (numMoves - finishedCallback.getNumFailedMoves()); while (messageSender.getBroadcastCount() < numBroadcasts) { loop++; Thread.sleep(WAIT_INTERVAL_MS); } Thread.sleep(WAIT_INTERVAL_MS * (loop + 1)); assertEquals("There are more broadcasts above expectation", numBroadcasts, messageSender.getBroadcastCount()); }
Source:
void writeRename(ReftableWriter w) throws IOException { long idx = reftableDatabase.nextUpdateIndex(); w.setMinUpdateIndex(idx).setMaxUpdateIndex(idx).begin(); List<Ref> refs = new ArrayList<>(3); Ref dest = destination.getRef(); Ref head = exactRef("HEAD"); if (head != null && head.isSymbolic() && head.getLeaf().getName().equals(source.getName())) { head = new SymbolicRef("HEAD", dest, idx); refs.add(head); } ObjectId objId = source.getRef().getObjectId(); refs.add(new ObjectIdRef.PeeledNonTag(Ref.Storage.NEW, destination.getName(), objId)); refs.add(new ObjectIdRef.Unpeeled(Ref.Storage.NEW, source.getName(), null)); w.sortAndWriteRefs(refs); PersonIdent who = destination.getRefLogIdent(); if (who == null) { who = new PersonIdent(fileRepository); } if (!destination.getRefLogMessage().isEmpty()) { List<String> refnames = refs.stream().map(r -> r.getName()) .collect(Collectors.toList()); Collections.sort(refnames); for (String s : refnames) { ObjectId old = ("HEAD".equals(s) || s.equals(source.getName())) ? objId : ObjectId.zeroId(); ObjectId newId = ("HEAD".equals(s) || s.equals(destination.getName())) ? objId : ObjectId.zeroId(); w.writeLog(s, idx, who, old, newId, destination.getRefLogMessage()); } } }

Target:
void writeRename(ReftableWriter w) throws IOException { long idx = reftableDatabase.nextUpdateIndex(); w.setMinUpdateIndex(idx).setMaxUpdateIndex(idx).begin(); List<Ref> refs = new ArrayList<>(3); Ref dest = destination.getRef(); Ref head = exactRef(Constants.HEAD); if (head != null && head.isSymbolic() && head.getLeaf().getName().equals(source.getName())) { head = new SymbolicRef(Constants.HEAD, dest, idx); refs.add(head); } ObjectId objId = source.getRef().getObjectId(); refs.add(new ObjectIdRef.PeeledNonTag(Ref.Storage.NEW, destination.getName(), objId)); refs.add(new ObjectIdRef.Unpeeled(Ref.Storage.NEW, source.getName(), null)); w.sortAndWriteRefs(refs); PersonIdent who = destination.getRefLogIdent(); if (who == null) { who = new PersonIdent(fileRepository); } if (!destination.getRefLogMessage().isEmpty()) { List<String> refnames = refs.stream().map(r -> r.getName()) .collect(Collectors.toList()); Collections.sort(refnames); for (String s : refnames) { ObjectId old = (Constants.HEAD.equals(s) || s.equals(source.getName())) ? objId : ObjectId.zeroId(); ObjectId newId = (Constants.HEAD.equals(s) || s.equals(destination.getName())) ? objId : ObjectId.zeroId(); w.writeLog(s, idx, who, old, newId, destination.getRefLogMessage()); } } }
Source:
public StringBuilder GetTagIdAndChildrenIds() { StringBuilder builder = new StringBuilder(); builder.append(StringFormat.format("'%1$s'", gettag_id())); for (tags tag : _children) { builder.append("," + tag.GetTagIdAndChildrenIds()); } return builder; }

Target:
public StringBuilder GetTagIdAndChildrenIds() { StringBuilder builder = new StringBuilder(); builder.append("'").append(gettag_id()).append("'"); for (tags tag : _children) { builder.append(",").append(tag.GetTagIdAndChildrenIds()); } return builder; }
Source:
public Page<DiscussionComment> call() throws Exception { List<String> requestedFields = Collections.singletonList("profile_image"); return environment.getDiscussionAPI().getCommentsList(responseId, PAGE_SIZE, page, requestedFields); }

Target:
public Page<DiscussionComment> call() throws Exception { List<String> requestedFields = Collections.singletonList( DiscussionRequestFields.PROFILE_IMAGE.getQueryParamValue()); return environment.getDiscussionAPI().getCommentsList(responseId, PAGE_SIZE, page, requestedFields); }
Source:
public void testUninstanciableLocalClass001() throws Exception { File outDir = AbstractTestTools.createTempDir(); List<Class<? extends IToolchain>> excludeList = new ArrayList<Class<? extends IToolchain>>(1); excludeList.add(JillBasedToolchain.class); excludeList.add(IncrementalToolchain.class); JackBasedToolchain toolchain = AbstractTestTools.getCandidateToolchain(JackBasedToolchain.class, excludeList); File testOut = AbstractTestTools.createTempFile("FrontendTests-", "-testUninstanciableLocalClass001"); toolchain.setReporter(ReporterKind.DEFAULT, testOut); toolchain.addToClasspath(toolchain.getDefaultBootClasspath()) .srcToLib( outDir, false, AbstractTestTools.getTestRootDir("com.android.jack.frontend.test004.jack")); String errString = AbstractTestTools.getFileContent(testOut); int warnIndex = errString.indexOf("WARNING:"); Assert.assertTrue(warnIndex != -1); warnIndex = errString.indexOf("WARNING:", warnIndex + 1); Assert.assertTrue(warnIndex != -1); Assert.assertTrue(errString.indexOf("WARNING:", warnIndex + 1) == -1); }

Target:
public void testUninstanciableLocalClass001() throws Exception { File outDir = AbstractTestTools.createTempDir(); List<Class<? extends IToolchain>> excludeList = new ArrayList<Class<? extends IToolchain>>(1); excludeList.add(JillBasedToolchain.class); excludeList.add(IncrementalToolchain.class); JackBasedToolchain toolchain = AbstractTestTools.getCandidateToolchain(JackBasedToolchain.class, excludeList); ByteArrayOutputStream errOut = new ByteArrayOutputStream(); toolchain.setReporter(ReporterKind.DEFAULT, errOut); toolchain.addToClasspath(toolchain.getDefaultBootClasspath()) .srcToLib( outDir, false, AbstractTestTools.getTestRootDir("com.android.jack.frontend.test004.jack")); String errString = errOut.toString(); int warnIndex = errString.indexOf("WARNING:"); Assert.assertTrue(warnIndex != -1); warnIndex = errString.indexOf("WARNING:", warnIndex + 1); Assert.assertTrue(warnIndex != -1); Assert.assertTrue(errString.indexOf("WARNING:", warnIndex + 1) == -1); }
Source:
protected synchronized void close(Exception cause) { if (isCleanClose(cause) && !isOpen()) { return; } super.close(cause); readExecutor.shutdownNow(); framedTransport.close(); if (isCleanClose(cause)) { LOGGER.info("transport closed"); } else { LOGGER.info("transport closed with cause: " + cause.getMessage()); } signalClose(cause); }

Target:
protected synchronized void close(Exception cause) { if (isCleanClose(cause) && !isOpen()) { return; } super.close(cause); readExecutor.shutdownNow(); framedTransport.close(); if (isCleanClose(cause)) { LOGGER.info("transport closed"); } else { LOGGER.info("transport closed with cause: " + cause.getMessage()); } }
Source:
public void testEmptyState() throws IOException { try (TmpPath tmp_dir = new TmpPath()) { GlobalStreamId globalStreamId_a = new GlobalStreamId("a", "a"); String dir = tmp_dir.getPath(); LocalState ls = new LocalState(dir, true); FileOutputStream data = FileUtils.openOutputStream(new File(dir, "12345")); FileOutputStream version = FileUtils.openOutputStream(new File(dir, "12345.version")); Assert.assertNull(ls.get("c")); ls.put("a", globalStreamId_a); Assert.assertEquals(globalStreamId_a, ls.get("a")); } }

Target:
public void testEmptyState() throws IOException { try (TmpPath tmp_dir = new TmpPath()) { GlobalStreamId globalStreamId_a = new GlobalStreamId("a", "a"); String dir = tmp_dir.getPath(); LocalState ls = new LocalState(dir, true); FileUtils.touch(new File(dir, "12345")); FileUtils.touch(new File(dir, "12345.version")); Assert.assertNull(ls.get("c")); ls.put("a", globalStreamId_a); Assert.assertEquals(globalStreamId_a, ls.get("a")); } }
Source:
public static String toLowerHyphen(String name) { StringBuilder result = new StringBuilder(); for (int i = 0; i < name.length(); i++) { char c = name.charAt(i); if (i > 0 && isUpercase(c)) { result.append('-').append(toLowerCase(c)); } else if (isUpercase(c)) { result.append(toLowerCase(c)); } else { result.append(c); } } return result.toString(); }

Target:
public static String toLowerHyphen(String name) { StringBuilder result = new StringBuilder(); for (int i = 0; i < name.length(); i++) { char c = name.charAt(i); if (Character.isUpperCase(c)) { if (i != 0) result.append('-'); result.append(Character.toLowerCase(c)); } else { result.append(c); } } return result.toString(); }
Source:
public String toString() { return "IncomingMessageEnvelope [systemStreamPartition=" + systemStreamPartition + ", offset=" + offset + ", key=" + key + ", message=" + message + ", eventTime=" + eventTimeInstant.toEpochMilli() + ", arrivalSystemNanoTime=" + arrivalSystemNanoTime + "]"; }

Target:
public String toString() { return "IncomingMessageEnvelope [systemStreamPartition=" + systemStreamPartition + ", offset=" + offset + ", key=" + key + ", message=" + message + ", eventTime=" + eventTime + ", arrivalTime=" + arrivalTime + "]"; }
Source:
private static Map<String, String> serializeContainerModelMap(Map<String, ContainerModel> containerModelMap) { Map<String, String> serializedContainerModelMap = new HashMap<>(); ObjectMapper samzaObjectMapper = SamzaObjectMapper.getObjectMapper(); String serializedContainerModel; for (Map.Entry<String, ContainerModel> containerModelEntry : containerModelMap.entrySet()) { serializedContainerModel = ""; try { serializedContainerModel = samzaObjectMapper.writeValueAsString(containerModelEntry.getValue()); } catch (IOException e) { LOG.error("Exception in serializing container model ", e); } finally { serializedContainerModelMap.put(containerModelEntry.getKey(), serializedContainerModel); } } return serializedContainerModelMap; }

Target:
private static String serializeContainerModelMap(Map<String, ContainerModel> containerModelMap) { ObjectMapper samzaObjectMapper = SamzaObjectMapper.getObjectMapper(); try { return samzaObjectMapper.writeValueAsString(containerModelMap); } catch (IOException e) { LOG.error("Exception in serializing container model ", e); } return null; }
Source:
public static EntityData.Prefab readPrefab(BufferedReader reader) throws IOException { try { return newGson().fromJson(reader, EntityData.Prefab.class); } catch (JsonSyntaxException e) { return null; } }

Target:
public static EntityData.Prefab readPrefab(BufferedReader reader) throws IOException { try { return newGson().fromJson(reader, EntityData.Prefab.class); } catch (JsonSyntaxException e) { throw new IOException("Failed to load prefab", e); } }
Source:
public void editBufferSize() throws Exception { final int value = 1024; ModelNodeResult modelNodeResult = operations.readAttribute(BUFFER_POOL_ADDRESS, BUFFER_SIZE); modelNodeResult.assertSuccess(); try { new ConfigChecker.Builder(client, BUFFER_POOL_ADDRESS) .configFragment(page.getConfigFragment()) .editAndSave(ConfigChecker.InputType.TEXT, BUFFER_SIZE, String.valueOf(value)) .verifyFormSaved() .verifyAttribute(BUFFER_SIZE, value); } finally { operations.writeAttribute(BUFFER_POOL_ADDRESS, BUFFER_SIZE, modelNodeResult.value()); } }

Target:
public void editBufferSize() throws Exception { final int value = 1024; final ModelNodeResult originalNodeResult = operations.readAttribute(BUFFER_POOL_ADDRESS, BUFFER_SIZE); originalNodeResult.assertSuccess(); try { new ConfigChecker.Builder(client, BUFFER_POOL_ADDRESS) .configFragment(page.getConfigFragment()) .editAndSave(ConfigChecker.InputType.TEXT, BUFFER_SIZE, String.valueOf(value)) .verifyFormSaved() .verifyAttribute(BUFFER_SIZE, value); } finally { operations.writeAttribute(BUFFER_POOL_ADDRESS, BUFFER_SIZE, originalNodeResult.value()); } }
Source:
public TupleConverter(GroupType parquetSchema, Schema pigSchema, boolean elephantBirdCompatible, boolean columnIndexAccess) { this.parquetSchema = parquetSchema; this.elephantBirdCompatible = elephantBirdCompatible; try { this.schemaSize = max(parquetSchema.getFieldCount(), pigSchema.getFields().size()); this.converters = new Converter[this.schemaSize]; for (int i = 0, c = 0; i < schemaSize; i++) { FieldSchema field = pigSchema.getField(i); Type type = null; if(parquetSchema.containsField(field.alias) || columnIndexAccess) { if(columnIndexAccess) { if(i >= parquetSchema.getFieldCount()) continue; type = parquetSchema.getType(i); }else { type = parquetSchema.getType(parquetSchema.getFieldIndex(field.alias)); } final int index = i; converters[c++] = newConverter(field, type, new ParentValueContainer() { @Override void add(Object value) { TupleConverter.this.set(index, value); } }, elephantBirdCompatible, columnIndexAccess); } } } catch (FrontendException e) { throw new ParquetDecodingException("can not initialize pig converter from:\n" + parquetSchema + "\n" + pigSchema, e); } }

Target:
public TupleConverter(GroupType parquetSchema, Schema pigSchema, boolean elephantBirdCompatible, boolean columnIndexAccess) { this.parquetSchema = parquetSchema; this.elephantBirdCompatible = elephantBirdCompatible; try { this.schemaSize = max(parquetSchema.getFieldCount(), pigSchema.getFields().size()); this.converters = new Converter[this.schemaSize]; for (int i = 0, c = 0; i < schemaSize; i++) { FieldSchema field = pigSchema.getField(i); if(parquetSchema.containsField(field.alias) || columnIndexAccess) { Type type = getType(columnIndexAccess, field.alias, i); if(type != null) { final int index = i; converters[c++] = newConverter(field, type, new ParentValueContainer() { @Override void add(Object value) { TupleConverter.this.set(index, value); } }, elephantBirdCompatible, columnIndexAccess); } } } } catch (FrontendException e) { throw new ParquetDecodingException("can not initialize pig converter from:\n" + parquetSchema + "\n" + pigSchema, e); } }
Source:
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Credentials credentials = getUserCredentials(request); if (credentials == null) { response.setHeader("WWW-Authenticate", "Basic realm=\"" + realm + "\""); response.sendError(HttpServletResponse.SC_UNAUTHORIZED); } else { request.getSession(true).setAttribute(SSOUtils.USER_CREDENTIALS, credentials); response.sendRedirect(request.getContextPath() + SSOUtils.LOGIN_PHASE2_URI); } }

Target:
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { boolean acceptBasicAuthHeaders = (boolean) request.getSession().getServletContext().getAttribute(SSOUtils.ACCEPT_BASIC_AUTH_HEADERS); boolean enableBasicAuth = (boolean) request.getSession().getServletContext().getAttribute(SSOUtils.ENABLE_BASIC_AUTH); Credentials credentials = null; if (acceptBasicAuthHeaders) { credentials = getUserCredentials(request); } if (credentials != null) { request.getSession(true).setAttribute(SSOUtils.USER_CREDENTIALS, credentials); response.sendRedirect(request.getContextPath() + SSOUtils.LOGIN_PHASE2_URI); } else if (enableBasicAuth) { response.setHeader("WWW-Authenticate", "Basic realm=\"" + realm + "\""); response.sendError(HttpServletResponse.SC_UNAUTHORIZED); } else { response.sendRedirect(request.getContextPath() + SSOUtils.LOGIN_PHASE2_URI); } }
Source:
public PostgreSQLConnector(Supplier<MetadataStorageConnectorConfig> config, Supplier<MetadataStorageTablesConfig> dbTables) { super(config, dbTables); final BasicDataSource datasource = getDatasource(); datasource.setDriverClassLoader(getClass().getClassLoader()); datasource.setDriverClassName("org.postgresql.Driver"); this.dbi = new DBI(datasource); log.info("Configured PostgreSQL as the metadata storage"); }

Target:
public PostgreSQLConnector(Supplier<MetadataStorageConnectorConfig> config, Supplier<MetadataStorageTablesConfig> dbTables) { super(config, dbTables); final BasicDataSource datasource = getDatasource(); datasource.setDriverClassLoader(getClass().getClassLoader()); datasource.setDriverClassName("org.postgresql.Driver"); this.dbi = new DBI(datasource); log.info("Configured PostgreSQL as metadata storage"); }
Source:
public void restoreEquivalences(Publisher publisher) { Iterator<Content> content = contentLister.listContent(new ContentListingCriteria.Builder().forPublisher(publisher).build()); while (content.hasNext()) { Content c = (Content) content.next(); for (Alias alias : Iterables.filter(c.getAliases(), IS_EQUIVALENCE_ALIAS)) { Maybe<Identified> only = contentResolver.findByCanonicalUris(ImmutableSet.of(alias.getValue())).getFirstValue(); if (only.hasValue()) { c.addEquivalentTo((Described) only.requireValue()); c.setAliases(Iterables.filter(c.getAliases(), Predicates.not(IS_EQUIVALENCE_ALIAS))); write(c); } else { log.warn("Could not find equivalent content of for so not writing equivalence", alias.getValue(), c.getCanonicalUri()); } } } }

Target:
public void restoreEquivalences(Publisher publisher) { Iterator<Content> contentIterator = contentLister.listContent( new ContentListingCriteria.Builder() .forPublisher(publisher) .build() ); while (contentIterator.hasNext()) { Content content = contentIterator.next(); for (Alias alias : Iterables.filter(content.getAliases(), IS_EQUIVALENCE_ALIAS)) { Maybe<Identified> contentFromPurgedPublisher = contentResolver.findByCanonicalUris(ImmutableSet.of(alias.getValue())).getFirstValue(); if (contentFromPurgedPublisher.hasValue()) { content.addEquivalentTo((Described) contentFromPurgedPublisher.requireValue()); HashSet<Alias> aliases = Sets.newHashSet(content.getAliases()); aliases.remove(alias); content.setAliases(aliases); write(content); } else { log.warn("Could not find equivalent content of for so not writing equivalence", alias.getValue(), content.getCanonicalUri()); } } } }
Source:
private Schema addForkliftPropertiesToSchema(Schema schema) throws IOException { String originalJson = schema.toString(false); JsonNode propertiesField = mapper.readTree("{\"name\":\"forkliftProperties\",\"type\":\"string\",\"default\":\"\"," + "\"doc\":\"Properties added to support forklift interfaces. Format is key,value entries delimited with new lines\"}"); ObjectNode schemaNode = (ObjectNode)mapper.readTree(originalJson); ArrayNode fieldsNode = (ArrayNode)schemaNode.get("fields"); fieldsNode.add(propertiesField); schemaNode.set("fields", fieldsNode); Schema.Parser parser = new Schema.Parser(); return parser.parse(mapper.writeValueAsString(schemaNode)); }

Target:
private Schema addForkliftPropertiesToSchema(Schema schema) throws IOException { String originalJson = schema.toString(false); JsonNode propertiesField = mapper.readTree(SCHEMA_FIELD_VALUE_PROPERTIES); ObjectNode schemaNode = (ObjectNode)mapper.readTree(originalJson); ArrayNode fieldsNode = (ArrayNode)schemaNode.get("fields"); fieldsNode.add(propertiesField); schemaNode.set("fields", fieldsNode); Schema.Parser parser = new Schema.Parser(); return parser.parse(mapper.writeValueAsString(schemaNode)); }
Source:
public PaymentSearchResponse<TransactionResponse> searchPayments(Account account, Map<String, String> paramsAsMap) { paramsAsMap.put(PARAM_ACCOUNT_ID, account.getAccountId()); paramsAsMap.put(PARAM_TRANSACTION_TYPE, PAYMENT_TRANSACTION_TYPE); Response response = client .target(ledgerUriGenerator.transactionsURIWithParams(paramsAsMap)) .request() .accept(MediaType.APPLICATION_JSON_TYPE) .get(); if (response.getStatus() == SC_OK) { try { return response.readEntity(new GenericType<PaymentSearchResponse<TransactionResponse>>() { }); } catch (ProcessingException ex) { throw new SearchPaymentsException(ex); } } throw new SearchRefundsException(response); }

Target:
public PaymentSearchResponse<TransactionResponse> searchPayments(Account account, Map<String, String> paramsAsMap) { paramsAsMap.put(PARAM_ACCOUNT_ID, account.getAccountId()); paramsAsMap.put(PARAM_TRANSACTION_TYPE, PAYMENT_TRANSACTION_TYPE); Response response = client .target(ledgerUriGenerator.transactionsURIWithParams(paramsAsMap)) .request() .accept(MediaType.APPLICATION_JSON_TYPE) .get(); if (response.getStatus() == SC_OK) { try { return response.readEntity(new GenericType<PaymentSearchResponse<TransactionResponse>>() { }); } catch (ProcessingException ex) { throw new SearchPaymentsException(ex); } } throw new SearchPaymentsException(response); }
Source:
public Set<SSTableReader> snapshotWithoutFlush(String snapshotName, Predicate<SSTableReader> predicate, boolean ephemeral, RateLimiter rateLimiter) { if (rateLimiter == null) rateLimiter = RateLimiter.create(DatabaseDescriptor.getSnapshotLinksPerSecond() == 0 ? Double.MAX_VALUE : DatabaseDescriptor.getSnapshotLinksPerSecond()); Set<SSTableReader> snapshottedSSTables = new HashSet<>(); for (ColumnFamilyStore cfs : concatWithIndexes()) { final JSONArray filesJSONArr = new JSONArray(); try (RefViewFragment currentView = cfs.selectAndReference(View.select(SSTableSet.CANONICAL, (x) -> predicate == null || predicate.apply(x)))) { for (SSTableReader ssTable : currentView.sstables) { File snapshotDirectory = Directories.getSnapshotDirectory(ssTable.descriptor, snapshotName); rateLimiter.acquire(SSTableReader.componentsFor(ssTable.descriptor).size()); ssTable.createLinks(snapshotDirectory.getPath()); filesJSONArr.add(ssTable.descriptor.relativeFilenameFor(Component.DATA)); if (logger.isTraceEnabled()) logger.trace("Snapshot for keyspace data file created in {}", keyspace, ssTable.getFilename(), snapshotDirectory); snapshottedSSTables.add(ssTable); } writeSnapshotManifest(filesJSONArr, snapshotName); if (!SchemaConstants.isLocalSystemKeyspace(metadata.keyspace) && !SchemaConstants.isReplicatedSystemKeyspace(metadata.keyspace)) writeSnapshotSchema(snapshotName); } } if (ephemeral) createEphemeralSnapshotMarkerFile(snapshotName); return snapshottedSSTables; }

Target:
public Set<SSTableReader> snapshotWithoutFlush(String snapshotName, Predicate<SSTableReader> predicate, boolean ephemeral, RateLimiter rateLimiter) { if (rateLimiter == null) rateLimiter = DatabaseDescriptor.getSnapshotRateLimiter(); Set<SSTableReader> snapshottedSSTables = new HashSet<>(); for (ColumnFamilyStore cfs : concatWithIndexes()) { final JSONArray filesJSONArr = new JSONArray(); try (RefViewFragment currentView = cfs.selectAndReference(View.select(SSTableSet.CANONICAL, (x) -> predicate == null || predicate.apply(x)))) { for (SSTableReader ssTable : currentView.sstables) { File snapshotDirectory = Directories.getSnapshotDirectory(ssTable.descriptor, snapshotName); rateLimiter.acquire(SSTableReader.componentsFor(ssTable.descriptor).size()); ssTable.createLinks(snapshotDirectory.getPath()); filesJSONArr.add(ssTable.descriptor.relativeFilenameFor(Component.DATA)); if (logger.isTraceEnabled()) logger.trace("Snapshot for keyspace data file created in {}", keyspace, ssTable.getFilename(), snapshotDirectory); snapshottedSSTables.add(ssTable); } writeSnapshotManifest(filesJSONArr, snapshotName); if (!SchemaConstants.isLocalSystemKeyspace(metadata.keyspace) && !SchemaConstants.isReplicatedSystemKeyspace(metadata.keyspace)) writeSnapshotSchema(snapshotName); } } if (ephemeral) createEphemeralSnapshotMarkerFile(snapshotName); return snapshottedSSTables; }
Source:
public void init(Database database) throws AuthConfigException { if (skipDefaultInitialization) { return; } if (initialized) { return; } synchronized (this) { if (initialized) { return; } Trace trace=database.getTrace(Trace.DATABASE); URL h2AuthenticatorConfigurationUrl = null; try { String configFile = System.getProperty("h2auth.configurationFile", null); if (configFile != null) { if (trace.isDebugEnabled()) { trace.debug("DefaultAuthenticator.config: configuration read from system property h2auth.configurationfile={0}", configFile); } h2AuthenticatorConfigurationUrl = new URL(configFile); } if (h2AuthenticatorConfigurationUrl == null) { h2AuthenticatorConfigurationUrl = Thread.currentThread().getContextClassLoader() .getResource("h2auth.xml"); if (h2AuthenticatorConfigurationUrl!=null) { if (trace.isDebugEnabled()) { trace.debug("DefaultAuthenticator.config: configuration read from classpath {0}", h2AuthenticatorConfigurationUrl); } } } if (h2AuthenticatorConfigurationUrl == null) { if (trace.isDebugEnabled()) { trace.debug("DefaultAuthenticator.config: default configuration"); } defaultConfiguration(); } else { configureFromUrl(h2AuthenticatorConfigurationUrl); } } catch (Exception e) { trace.error(e, "DefaultAuthenticator.config: an error occurred during configuration from {0} ", h2AuthenticatorConfigurationUrl); throw new AuthConfigException("Failed to configure authentication from " + h2AuthenticatorConfigurationUrl, e); } initialized=true; } }

Target:
public void init(Database database) throws AuthConfigException { if (skipDefaultInitialization) { return; } if (initialized) { return; } synchronized (this) { if (initialized) { return; } Trace trace=database.getTrace(Trace.DATABASE); URL h2AuthenticatorConfigurationUrl = null; try { String configFile = SysProperties.AUTH_CONFIG_FILE; if (configFile != null) { if (trace.isDebugEnabled()) { trace.debug("DefaultAuthenticator.config: configuration read from system property h2auth.configurationfile={0}", configFile); } h2AuthenticatorConfigurationUrl = new URL(configFile); } if (h2AuthenticatorConfigurationUrl == null) { if (trace.isDebugEnabled()) { trace.debug("DefaultAuthenticator.config: default configuration"); } defaultConfiguration(); } else { configureFromUrl(h2AuthenticatorConfigurationUrl); } } catch (Exception e) { trace.error(e, "DefaultAuthenticator.config: an error occurred during configuration from {0} ", h2AuthenticatorConfigurationUrl); throw new AuthConfigException("Failed to configure authentication from " + h2AuthenticatorConfigurationUrl, e); } initialized=true; } }
Source:
public ImmutableSet<Channel> fetchServices() throws GlycerinException { ServicesQuery servicesQuery = ServicesQuery.builder() .withPageSize(MAXIMUM_PAGE_SIZE) .withServiceType(ServiceTypeOption.LOCAL_RADIO, ServiceTypeOption.NATIONAL_RADIO, ServiceTypeOption.REGIONAL_RADIO, ServiceTypeOption.TV) .build(); GlycerinResponse<Service> response = glycerin.execute(servicesQuery); ImmutableList<Service> results = response.getResults(); ImmutableSet.Builder<Channel> channels = ImmutableSet.builder(); for (Service result : results) { Channel channel = getChannel(result); channels.add(channel); } return channels.build(); }

Target:
public ImmutableSet<Channel> fetchServices() throws GlycerinException { return fetchServices(ImmutableMap.<String, Channel>of()); }