auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public CacheConfig(CompleteConfiguration<K, V> configuration) { super(configuration); if (configuration instanceof CacheConfig) { final CacheConfig config = (CacheConfig) configuration; this.name = config.name; this.managerPrefix = config.managerPrefix; this.uriString = config.uriString; this.asyncBackupCount = config.asyncBackupCount; this.backupCount = config.backupCount; this.inMemoryFormat = config.inMemoryFormat; this.hotRestartConfig = new HotRestartConfig(config.hotRestartConfig); this.eventJournalConfig = new EventJournalConfig(config.eventJournalConfig); if (config.evictionConfig != null) { this.evictionConfig = new EvictionConfig(config.evictionConfig); } if (config.wanReplicationRef != null) { this.wanReplicationRef = new WanReplicationRef(config.wanReplicationRef); } if (config.partitionLostListenerConfigs != null) { this.partitionLostListenerConfigs = new ArrayList<CachePartitionLostListenerConfig>( config.partitionLostListenerConfigs); } this.quorumName = config.quorumName; this.mergePolicyConfig = config.mergePolicyConfig; this.disablePerEntryInvalidationEvents = config.disablePerEntryInvalidationEvents; this.serializationService = config.serializationService; this.classLoader = config.classLoader; } }

Target:
public CacheConfig(CompleteConfiguration<K, V> configuration) { super(configuration); if (configuration instanceof CacheConfig) { final CacheConfig config = (CacheConfig) configuration; this.name = config.name; this.managerPrefix = config.managerPrefix; this.uriString = config.uriString; this.asyncBackupCount = config.asyncBackupCount; this.backupCount = config.backupCount; this.inMemoryFormat = config.inMemoryFormat; this.hotRestartConfig = new HotRestartConfig(config.hotRestartConfig); this.eventJournalConfig = new EventJournalConfig(config.eventJournalConfig); if (config.evictionConfig != null) { this.evictionConfig = new EvictionConfig(config.evictionConfig); } if (config.wanReplicationRef != null) { this.wanReplicationRef = new WanReplicationRef(config.wanReplicationRef); } if (config.partitionLostListenerConfigs != null) { this.partitionLostListenerConfigs = new ArrayList<CachePartitionLostListenerConfig>( config.partitionLostListenerConfigs); } this.quorumName = config.quorumName; this.mergePolicyConfig = new MergePolicyConfig(config.mergePolicyConfig); this.disablePerEntryInvalidationEvents = config.disablePerEntryInvalidationEvents; this.serializationService = config.serializationService; this.classLoader = config.classLoader; } }
Source:
protected Injector setupInjector() { return Initialization.makeInjectorWithModules( GuiceInjectors.makeStartupInjector(), ImmutableList.<Module>of( new Module() { @Override public void configure(Binder binder) { JsonConfigProvider.bindInstance( binder, Key.get(DruidNode.class, Self.class), new DruidNode("test", "localhost", null, null, new ServerConfig()) ); binder.bind(JettyServerInitializer.class).to(JettyServerInit.class).in(LazySingleton.class); Jerseys.addResource(binder, SlowResource.class); Jerseys.addResource(binder, ExceptionResource.class); Jerseys.addResource(binder, DefaultResource.class); binder.bind(AuthorizationManager.class).toInstance(new AuthorizationManager() { @Override public Access authorize( String identity, Resource resource, Action action ) { return new Access(true); } }); JettyBindings.addQosFilter(binder, "/slow/*", 2); final ServerConfig serverConfig = new ObjectMapper().convertValue( ImmutableMap.of("numThreads", "10"), ServerConfig.class ); binder.bind(ServerConfig.class).toInstance(serverConfig); LifecycleModule.register(binder, Server.class); } } ) ); }

Target:
protected Injector setupInjector() { return Initialization.makeInjectorWithModules( GuiceInjectors.makeStartupInjector(), ImmutableList.<Module>of( new Module() { @Override public void configure(Binder binder) { JsonConfigProvider.bindInstance( binder, Key.get(DruidNode.class, Self.class), new DruidNode("test", "localhost", null, null, new ServerConfig()) ); binder.bind(JettyServerInitializer.class).to(JettyServerInit.class).in(LazySingleton.class); Jerseys.addResource(binder, SlowResource.class); Jerseys.addResource(binder, ExceptionResource.class); Jerseys.addResource(binder, DefaultResource.class); binder.bind(AuthorizerMapper.class).toInstance(AuthTestUtils.TEST_AUTHORIZER_MAPPER); JettyBindings.addQosFilter(binder, "/slow/*", 2); final ServerConfig serverConfig = new ObjectMapper().convertValue( ImmutableMap.of("numThreads", "10"), ServerConfig.class ); binder.bind(ServerConfig.class).toInstance(serverConfig); LifecycleModule.register(binder, Server.class); } } ) ); }
Source:
public T valueForInsert(Object value) { return implicitCast(value); }

Target:
public T valueForInsert(Object value) { return (T) value; }
Source:
private void resetOffsets() throws ConnectException { if (!recovered) { readOffset(); if (offset > 0) { long seekOffset = offset; log.debug("Resetting offset for to {}", tp, seekOffset); context.offset(tp, seekOffset); } else { log.debug("Resetting offset for based upon consumer's 'auto.offset.reset'", tp); } recovered = true; } }

Target:
private void resetOffsets() throws ConnectException { if (!recovered) { readOffset(); if (offset > 0) { log.debug("Resetting offset for to {}", tp, offset); context.offset(tp, offset); } else { log.debug("Resetting offset for based upon existing consumer group offsets or, if " + "there are none, the consumer's 'auto.offset.reset' value.", tp); } recovered = true; } }
Source:
void onClose(ClickEvent e) { onCancel(null); }

Target:
void onClose(ClickEvent e) { onCancel(e); }
Source:
public static TagObject from(TagModel model) { if (model != null) { TagObject result = JavaScriptObject.createObject().cast(); JsArray<TagObject> children = JavaScriptObject.createArray().cast(); result.setValueAsString("description", model.getDescription().getEntity()); result.setValueAsString("name", model.getName().getEntity()); result.setValueAsBoolean("selected", model.getSelection()); if (model.getParent() == null) { result.setValueAsDouble("selectedTagCount", calculateSelectedTagCount(model)); } for(TagModel child: model.getChildren()) { children.push(TagObject.from(child)); } result.setValueAsJavaScriptObject("children", children); return result; } else { return null; } }

Target:
public static TagObject from(TagModel model) { return from(model, true); }
Source:
public void testIgnoreLinesSorted() throws Exception { final HeaderCheck check = new HeaderCheck(); check.setIgnoreLines(5, 9, 9, 11, 2); int[] ignoreLines = (int[]) Whitebox.getInternalState(check, "ignoreLines"); assertArrayEquals(new int[]{2, 5, 9, 9, 11}, ignoreLines); }

Target:
public void testIgnoreLinesSorted() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(HeaderCheck.class); checkConfig.addAttribute("headerFile", getConfigPath("java.header")); checkConfig.addAttribute("ignoreLines", "4,2,3"); final String[] expected = CommonUtils.EMPTY_STRING_ARRAY; verify(checkConfig, getConfigPath("java3.header"), expected); }
Source:
private void testBoth(String origin, List<Object> headerValue) { CorsFilter filter = new CorsFilter(); ContainerRequestContext request = mock(ContainerRequestContext.class); when(request.getHeaderString("Origin")).thenReturn(origin); ContainerResponseContext response = mock(ContainerResponseContext.class); MultivaluedMap<String, Object> headers = new MultivaluedHashMap<>(); when(response.getHeaders()).thenReturn(headers); filter.filter(request, response); assertEquals(headerValue, headers.get(ALLOW_CORS_HEADER)); }

Target:
private void testBoth(String origin, List<Object> headerValue) { CorsFilter filter = new CorsFilter(); ContainerRequestContext request = mock(ContainerRequestContext.class); when(request.getHeaderString(CORS_REQUEST_HEADER)).thenReturn(origin); ContainerResponseContext response = mock(ContainerResponseContext.class); MultivaluedMap<String, Object> headers = new MultivaluedHashMap<>(); when(response.getHeaders()).thenReturn(headers); filter.filter(request, response); assertEquals(headerValue, headers.get(ALLOW_CORS_HEADER)); }
Source:
public void writeClasses(ReplCompileResult.CompiledClasses classes) { if (outputDir == null) { return; } for (CompiledClassData compiledClass: classes.getClasses()) { String filePath = compiledClass.getPath(); if (filePath.contains("/")) { continue; } String classWritePath = outputDir + File.separator + filePath; writeClass(compiledClass.getBytes(), classWritePath); } writeModuleInMemory(classes); }

Target:
public void writeClasses(ReplCompileResult.CompiledClasses classes) { if (outputDir == null) { return; } for (CompiledClassData compiledClass: classes.getClasses()) { String filePath = compiledClass.getPath(); if (!filePath.contains(File.separator)) { String classWritePath = outputDir + File.separator + filePath; writeClass(compiledClass.getBytes(), classWritePath); } } writeModuleInMemory(classes); }
Source:
public void testSameRevisionForAggregateAndPayload() { assertTrue(testSubject.decide(createEntry(WithAnnotation.class.getName(), "2.3-TEST"))); }

Target:
public void testSameRevisionForAggregateAndPayload() { assertTrue(testSubject.decide(createEntry(WithAnnotationAggregate.class.getName(), "2.3-TEST"))); }
Source:
public void runActionOnPoll() { LOG.info("Checking upstreams"); upstreamChecker.syncUpstreams(); }

Target:
public void runActionOnPoll() { if (!disasterManager.isDisabled(SingularityAction.RUN_UPSTREAM_POLLER)) { LOG.info("Running SingularityUpstreamPoller"); upstreamChecker.syncUpstreams(); } else { LOG.warn("SingularityUpstreamPoller is currently disabled"); } }
Source:
public void testList() { servers = serverApi().getList(); assertNotNull(servers); assertFalse(servers.isEmpty()); Assert.assertTrue(servers.size() > 0); }

Target:
public void testList() { servers = serverApi().list(); assertNotNull(servers); Assert.assertTrue(servers.size() > 0); }
Source:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_playbar, container, false); final ImageButton playPause = ((ImageButton) view.findViewById(R.id.btn_play_pause)); playPause.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { try { PlaylistService service = playlistServiceLocator.getService(); if (service.isPlaying()) { service.pause(); setPlayImage(playPause); Log.w(TAG, "pause called"); } else { service.play(); playPause.setImageDrawable( getResources().getDrawable(R.drawable.av_pause)); Log.w(TAG, "play called"); } }catch (ServiceNotBoundException e) { Log.wtf(TAG, e); } } }); ((ImageButton) view.findViewById(R.id.btn_skip)) .setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { try { PlaylistService service = playlistServiceLocator.getService(); service.skip(); } catch (ServiceNotBoundException e) { Log.wtf(TAG, e); } } }); return view; }

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.fragment_playbar, container, false); playPause = ((ImageButton) view.findViewById(R.id.btn_play_pause)); playPause.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { try { PlaylistService service = playlistServiceLocator.getService(); if (service.isPlaying()) { service.pause(); } else { service.play(); } smartSetPlayPauseImage(service); }catch (ServiceNotBoundException e) { Log.wtf(TAG, e); } } }); ((ImageButton) view.findViewById(R.id.btn_skip)) .setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { try { PlaylistService service = playlistServiceLocator.getService(); service.skip(); } catch (ServiceNotBoundException e) { Log.wtf(TAG, e); } } }); return view; }
Source:
public URI getUri() { try { return new URI("level://" + URLEncoder.encode(path, "UTF-8")); } catch (URISyntaxException e) { throw new AssertionError(e); } catch (UnsupportedEncodingException e) { throw new AssertionError(e); } }

Target:
public URI getUri() { return this.uri; }
Source:
public ProtocolResponse getProtocolOutput(String url, Metadata md) throws Exception { HttpClientBuilder builder = HttpClients.custom() .setUserAgent(userAgent) .setConnectionManager(CONNECTION_MANAGER); if (useProxy) { HttpHost proxy = new HttpHost(proxyHost, proxyPort); DefaultProxyRoutePlanner routePlanner = new DefaultProxyRoutePlanner( proxy); builder.setRoutePlanner(routePlanner); } LOG.debug("HTTP connection manager stats " + CONNECTION_MANAGER.getTotalStats().toString()); CloseableHttpClient httpclient = builder.build(); RequestConfig requestConfig = RequestConfig.custom() .setSocketTimeout(timeout).setConnectTimeout(timeout).build(); HttpGet httpget = new HttpGet(url); if (md != null) { String ifModifiedSince = md.getFirstValue("cachedLastModified"); if (StringUtils.isNotBlank(ifModifiedSince)) { httpget.addHeader("If-Modified-Since", ifModifiedSince); } String ifNoneMatch = md.getFirstValue("cachedEtag"); if (StringUtils.isNotBlank(ifNoneMatch)) { httpget.addHeader("If-None-Match", ifNoneMatch); } } httpget.setConfig(requestConfig); return httpclient.execute(httpget, this); }

Target:
public ProtocolResponse getProtocolOutput(String url, Metadata md) throws Exception { LOG.debug("HTTP connection manager stats {}", CONNECTION_MANAGER.getTotalStats()); HttpGet httpget = new HttpGet(url); httpget.setConfig(requestConfig); if (md != null) { String ifModifiedSince = md.getFirstValue("cachedLastModified"); if (StringUtils.isNotBlank(ifModifiedSince)) { httpget.addHeader("If-Modified-Since", ifModifiedSince); } String ifNoneMatch = md.getFirstValue("cachedEtag"); if (StringUtils.isNotBlank(ifNoneMatch)) { httpget.addHeader("If-None-Match", ifNoneMatch); } } try (CloseableHttpClient httpclient = builder.build()) { return httpclient.execute(httpget, this); } }
Source:
public Pagination<Payment> getPayments(final Long offset, final Long limit, final String pluginName, final boolean withPluginInfo, final boolean withAttempts, final Iterable<PluginProperty> properties, final TenantContext tenantContext) throws PaymentApiException { return paymentProcessor.getPayments(offset, limit, pluginName, withPluginInfo, properties, tenantContext, internalCallContextFactory.createInternalTenantContext(tenantContext)); }

Target:
public Pagination<Payment> getPayments(final Long offset, final Long limit, final String pluginName, final boolean withPluginInfo, final boolean withAttempts, final Iterable<PluginProperty> properties, final TenantContext tenantContext) throws PaymentApiException { return paymentProcessor.getPayments(offset, limit, pluginName, withPluginInfo, withAttempts, properties, tenantContext, internalCallContextFactory.createInternalTenantContext(tenantContext)); }
Source:
public void leaseExpiry() throws Exception { URI connectionURI = TCPProxyUtil.getProxyURI(CLUSTER.getConnectionURI(), proxies); CacheManagerBuilder<PersistentCacheManager> clusteredCacheManagerBuilder = CacheManagerBuilder.newCacheManagerBuilder() .with(ClusteringServiceConfigurationBuilder.cluster(connectionURI.resolve("/crud-cm")) .timeouts(TimeoutsBuilder.timeouts() .connection(Duration.ofSeconds(20))) .autoCreate() .defaultServerResource("primary-server-resource")); PersistentCacheManager cacheManager = clusteredCacheManagerBuilder.build(false); cacheManager.init(); CacheConfiguration<Long, String> config = CacheConfigurationBuilder.newCacheConfigurationBuilder(Long.class, String.class, resourcePoolsBuilder).build(); Cache<Long, String> cache = cacheManager.createCache("clustered-cache", config); cache.put(1L, "The one"); cache.put(2L, "The two"); cache.put(3L, "The three"); assertThat(cache.get(1L), equalTo("The one")); assertThat(cache.get(2L), equalTo("The two")); assertThat(cache.get(3L), equalTo("The three")); setDelay(6000, proxies); Thread.sleep(6000); setDelay(0L, proxies); CompletableFuture<String> future = CompletableFuture.supplyAsync(() -> { while (true) { try { Thread.sleep(200); } catch (InterruptedException e) { } String result = cache.get(1L); if (result != null) { return result; } } }); assertThat(future.get(50, TimeUnit.SECONDS), is("The one")); assertThat(cache.get(2L), equalTo("The two")); assertThat(cache.get(3L), equalTo("The three")); }

Target:
public void leaseExpiry() throws Exception { URI connectionURI = TCPProxyUtil.getProxyURI(CLUSTER.getConnectionURI(), proxies); CacheManagerBuilder<PersistentCacheManager> clusteredCacheManagerBuilder = CacheManagerBuilder.newCacheManagerBuilder() .with(ClusteringServiceConfigurationBuilder.cluster(connectionURI.resolve("/crud-cm")) .timeouts(TimeoutsBuilder.timeouts() .connection(Duration.ofSeconds(20))) .autoCreate() .defaultServerResource("primary-server-resource")); PersistentCacheManager cacheManager = clusteredCacheManagerBuilder.build(false); cacheManager.init(); CacheConfiguration<Long, String> config = CacheConfigurationBuilder.newCacheConfigurationBuilder(Long.class, String.class, resourcePoolsBuilder).build(); Cache<Long, String> cache = cacheManager.createCache("clustered-cache", config); cache.put(1L, "The one"); cache.put(2L, "The two"); cache.put(3L, "The three"); assertThat(cache.get(1L), equalTo("The one")); assertThat(cache.get(2L), equalTo("The two")); assertThat(cache.get(3L), equalTo("The three")); setDelay(6000, proxies); Thread.sleep(6000); setDelay(0L, proxies); AtomicBoolean timedout = new AtomicBoolean(false); CompletableFuture<String> future = CompletableFuture.supplyAsync(() -> { while (!timedout.get()) { try { Thread.sleep(200); } catch (InterruptedException e) { throw new AssertionError(e); } String result = cache.get(1L); if (result != null) { return result; } } return null; }); assertThat(future.get(5, TimeUnit.SECONDS), is("The one")); timedout.set(true); assertThat(cache.get(2L), equalTo("The two")); assertThat(cache.get(3L), equalTo("The three")); }
Source:
public Iterator<T> iterator() { if ( count == -1 ) { throw new IllegalStateException( "sort() needs to be called before requesting an iterator" ); } return new Iterator<T>() { private int cursor = count; @Override public boolean hasNext() { return cursor > 0; } @Override @SuppressWarnings( "unchecked" ) public T next() { if ( !hasNext() ) { throw new NoSuchElementException(); } --cursor; return (T) array[cursor]; } }; }

Target:
public Iterator<T> iterator() { if ( count == -1 ) { throw new IllegalStateException( "sort() needs to be called before requesting an iterator" ); } return new Iterator<T>() { private int cursor = count; @Override public boolean hasNext() { return cursor > 0; } @Override @SuppressWarnings( "unchecked" ) public T next() { if ( !hasNext() ) { throw new NoSuchElementException(); } int offset = --cursor; return (T) array[offset]; } }; }
Source:
public void updatePatientIdentifiers(String configName, String patientUuid, Map<String, String> identifiers) { Patient patient = new Patient(); List<Identifier> identifierList = convertIdentifierMapToList(configName, identifiers); patient.setIdentifiers(identifierList); patient.setUuid(patientUuid); patientService.updatePatientIdentifiers(null, patient); }

Target:
public void updatePatientIdentifiers(String configName, String patientUuid, Map<String, String> identifiers) { Patient patient = new Patient(); List<Identifier> identifierList = convertIdentifierMapToList(identifiers); patient.setIdentifiers(identifierList); patient.setUuid(patientUuid); patientService.updatePatientIdentifiers(configName, patient); }
Source:
public void lifecycleEvent(LifecycleEvent event) { if (!Lifecycle.AFTER_START_EVENT.equals(event.getType())) { return; } wizard.showMessage("OpenMRS is ready for you at http://localhost:8080/openmrs/"); }

Target:
public void lifecycleEvent(LifecycleEvent event) { if (!Lifecycle.AFTER_START_EVENT.equals(event.getType())) { return; } wizard.showMessage(String.format("OpenMRS is ready for you at http://localhost:%s/openmrs/", port == 80 ? "" : ":" + port)); }
Source:
public static Optional<Set<VariableReferenceExpression>> pruneInputs( Collection<VariableReferenceExpression> availableInputs, Collection<RowExpression> expressions, TypeProvider types) { Set<VariableReferenceExpression> availableInputsSet = ImmutableSet.copyOf(availableInputs); Set<VariableReferenceExpression> referencedInputs; if (expressions.stream().anyMatch(OriginalExpressionUtils::isExpression)) { referencedInputs = SymbolsExtractor.extractUniqueVariable( expressions.stream().map(OriginalExpressionUtils::castToExpression).collect(toImmutableList()), types); } else { referencedInputs = SymbolsExtractor.extractUniqueVariable(expressions); } Set<VariableReferenceExpression> prunedInputs; prunedInputs = Sets.filter(availableInputsSet, referencedInputs::contains); if (prunedInputs.size() == availableInputsSet.size()) { return Optional.empty(); } return Optional.of(prunedInputs); }

Target:
public static Optional<Set<VariableReferenceExpression>> pruneInputs( Collection<VariableReferenceExpression> availableInputs, Collection<RowExpression> expressions, TypeProvider types) { Set<VariableReferenceExpression> availableInputsSet = ImmutableSet.copyOf(availableInputs); Set<VariableReferenceExpression> referencedInputs; if (expressions.stream().allMatch(OriginalExpressionUtils::isExpression)) { referencedInputs = VariablesExtractor.extractUnique( expressions.stream().map(OriginalExpressionUtils::castToExpression).collect(toImmutableList()), types); } else if (expressions.stream().noneMatch(OriginalExpressionUtils::isExpression)) { referencedInputs = VariablesExtractor.extractUnique(expressions); } else { throw new IllegalStateException(format("Expressions %s contains mixed Expression and RowExpression", expressions)); } Set<VariableReferenceExpression> prunedInputs; prunedInputs = Sets.filter(availableInputsSet, referencedInputs::contains); if (prunedInputs.size() == availableInputsSet.size()) { return Optional.empty(); } return Optional.of(prunedInputs); }
Source:
private WritableComparable convertToWritable(Schema.Field field, StructuredRecord input) throws UnsupportedTypeException { WritableComparable writable = null; Object fieldVal = input.get(field.getName()); switch (field.getSchema().getType()) { case NULL: break; case STRING: case ENUM: writable = new Text((String) fieldVal); break; case BOOLEAN: writable = new BooleanWritable((Boolean) fieldVal); break; case INT: writable = new IntWritable(Integer.valueOf((Integer) fieldVal)); break; case LONG: writable = new LongWritable(Long.valueOf((Long) fieldVal)); break; case FLOAT: writable = new FloatWritable((Float) fieldVal); break; case DOUBLE: writable = new DoubleWritable(Double.valueOf((Double) fieldVal)); break; case BYTES: writable = new BytesWritable(((String) fieldVal).getBytes()); break; default: throw new UnsupportedTypeException(field.getSchema().getType().name() + "type is currently not supported in ORC"); } return writable; }

Target:
private WritableComparable convertToWritable(Schema.Field field, StructuredRecord input) throws UnsupportedTypeException { Object fieldVal = input.get(field.getName()); Schema fieldSchema = field.getSchema(); Schema.Type fieldType = fieldSchema.getType(); if (fieldSchema.isNullable()) { if (fieldVal == null) { return null; } fieldType = fieldSchema.getNonNullable().getType(); } switch (fieldType) { case NULL: return null; case STRING: return new Text((String) fieldVal); case ENUM: return new Text(fieldVal.toString()); case BOOLEAN: return new BooleanWritable((Boolean) fieldVal); case INT: return new IntWritable((Integer) fieldVal); case LONG: return new LongWritable((Long) fieldVal); case FLOAT: return new FloatWritable((Float) fieldVal); case DOUBLE: return new DoubleWritable((Double) fieldVal); case BYTES: if (fieldVal instanceof byte[]) { return new BytesWritable((byte[]) fieldVal); } else { return new BytesWritable(Bytes.getBytes((ByteBuffer) fieldVal)); } default: throw new UnsupportedTypeException(String.format("{} type is currently not supported in ORC", field.getSchema().getType().name())); } }
Source:
private void display(String message, int lengthMillis) { if (contextIsStillAlive()) { Toast toast = Toast.makeText(context, message, lengthMillis); toast.show(); toasts.add(toast); } else { Log.e("Couldn't toast, context has become null. Attempted message: " + message); } }

Target:
private void display(String message, int lengthMillis) { Toast toast = Toast.makeText(context, message, lengthMillis); display(toast); }
Source:
private String getJsonDiskDescription() { Map<String, Object> description = new HashMap<>(); description.put(ImagesHandler.DISK_ALIAS, getDiskAlias()); description.put(ImagesHandler.DISK_DESCRIPTION, disk.getDiskDescription()); try { return JsonHelper.mapToJson(description, false); } catch (IOException e) { throw new RuntimeException("Exception while generating json for disk", e); } }

Target:
private String getJsonDiskDescription() { try { return ImagesHandler.getJsonDiskDescription(getParameters().getDiskInfo().getDiskAlias(), getParameters().getDiskInfo().getDiskDescription()); } catch (IOException e) { throw new RuntimeException("Exception while generating json for disk", e); } }
Source:
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event); if (window != null) { ISelection currentSelection = HandlerUtil.getCurrentStructuredSelection(event); runBuildAction(window, currentSelection); } return null; }

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event); if (window != null) { ISelection currentSelection = HandlerUtil .getCurrentSelection(event); if (currentSelection instanceof IStructuredSelection) { runBuildAction(window, currentSelection); } else { currentSelection = extractSelectionFromEditorInput(HandlerUtil .getActiveEditorInput(event)); runBuildAction(window, currentSelection); } } return null; }
Source:
static Event validEvent() { return Event.newBuilder() .setMessage(AnyPacker.pack(ProjectCreated.newBuilder() .setProjectId(ProjectId.newBuilder().setId("12345AD0")) .build()) .toBuilder() .setTypeUrl(TypeUrl.SPINE_TYPE_URL_PREFIX + "/" + ProjectCreated.getDescriptor().getFullName()) .build()) .setContext(EventContext.newBuilder() .setDoNotEnrich(true) .setCommandContext(CommandContext.getDefaultInstance()) .setEventId(EventId.newBuilder() .setUuid(PROJECT_UUID) .build())) .build(); }

Target:
static Event validEvent() { return Event.newBuilder() .setMessage(AnyPacker.pack(ProjectCreated.newBuilder() .setProjectId(ProjectId.newBuilder().setId("12345AD0")) .build()) .toBuilder() .setTypeUrl(TypeUrl.SPINE_TYPE_URL_PREFIX + "/" + ProjectCreated.getDescriptor().getFullName()) .build()) .setContext(EventContext.newBuilder() .setDoNotEnrich(true) .setCommandContext(CommandContext.getDefaultInstance()) .setEventId(EventId.newBuilder() .setUuid(Identifiers.newUuid()) .build())) .build(); }
Source:
public void afterBulk(long executionId, BulkRequest request, BulkResponse response) { if (log.isDebugEnabled()) { log.debug(String.format("After bulk: %s, actions: %d, status: %s", executionId, request.numberOfActions(), response.status())); } if (!response.hasFailures()) { return; } AtomicBoolean inError = new AtomicBoolean(false); Arrays.stream(response.getItems()).filter(BulkItemResponse::isFailed).forEach(item -> { if (item.getFailure().getStatus() != RestStatus.CONFLICT) { log.warn("Failure in bulk indexing: " + item.getFailureMessage()); inError.set(true); } else if (log.isDebugEnabled()) { log.debug("Skipping version conflict: " + item.getFailureMessage()); } }); if (inError.get()) { log.error(String.format("Elasticsearch bulk %s returns with failures: %s", executionId, response.buildFailureMessage())); if (!continueOnFailure) { abort = true; } } }

Target:
public void afterBulk(long executionId, BulkRequest request, BulkResponse response) { if (log.isDebugEnabled()) { log.debug(String.format("After bulk: %s, actions: %d, status: %s", executionId, request.numberOfActions(), response.status())); } if (!response.hasFailures()) { return; } MutableBoolean inError = new MutableBoolean(false); Arrays.stream(response.getItems()).filter(BulkItemResponse::isFailed).forEach(item -> { if (item.getFailure().getStatus() != RestStatus.CONFLICT) { log.warn("Failure in bulk indexing: " + item.getFailureMessage()); inError.setTrue(); } else if (log.isDebugEnabled()) { log.debug("Skipping version conflict: " + item.getFailureMessage()); } }); if (inError.isTrue()) { log.error(String.format("Elasticsearch bulk %s returns with failures: %s", executionId, response.buildFailureMessage())); if (!continueOnFailure) { abort = true; } } }
Source:
protected Bitmap doInBackground(Object... params) { Bitmap thumbnail = null; try { if (mAccount != null) { OwnCloudAccount ocAccount = new OwnCloudAccount(mAccount, MainApp.getAppContext()); mClient = OwnCloudClientManagerFactory.getDefaultSingleton(). getClientFor(ocAccount, MainApp.getAppContext()); } mFile = params[0]; if (mFile instanceof OCFile) { thumbnail = doOCFileInBackground(); if (((OCFile) mFile).isVideo()){ thumbnail = addVideoOverlay(thumbnail); } } else if (mFile instanceof File) { thumbnail = doFileInBackground(); String url = ((File) mFile).getAbsolutePath(); FileNameMap fileNameMap = URLConnection.getFileNameMap(); String mMimeType = fileNameMap.getContentTypeFor("file://" + url); if (mMimeType != null && mMimeType.startsWith("video/")){ thumbnail = addVideoOverlay(thumbnail); } } }catch(Throwable t){ Log_OC.e(TAG, "Generation of thumbnail for " + mFile + " failed", t); if (t instanceof OutOfMemoryError) { System.gc(); } } return thumbnail; }

Target:
protected Bitmap doInBackground(Object... params) { Bitmap thumbnail = null; try { if (mAccount != null) { OwnCloudAccount ocAccount = new OwnCloudAccount( mAccount, MainApp.getAppContext() ); mClient = OwnCloudClientManagerFactory.getDefaultSingleton(). getClientFor(ocAccount, MainApp.getAppContext()); } mFile = params[0]; if (mFile instanceof OCFile) { thumbnail = doOCFileInBackground(); if (((OCFile) mFile).isVideo() && thumbnail != null){ thumbnail = addVideoOverlay(thumbnail); } } else if (mFile instanceof File) { thumbnail = doFileInBackground(); String url = ((File) mFile).getAbsolutePath(); FileNameMap fileNameMap = URLConnection.getFileNameMap(); String mMimeType = fileNameMap.getContentTypeFor("file://" + url); if (mMimeType != null && mMimeType.startsWith("video/") && thumbnail != null){ thumbnail = addVideoOverlay(thumbnail); } } }catch(Throwable t){ Log_OC.e(TAG, "Generation of thumbnail for " + mFile + " failed", t); if (t instanceof OutOfMemoryError) { System.gc(); } } return thumbnail; }
Source:
public DefaultQdsConfiguration(String apiEndpoint, String apiVersion, String apiToken, ClientConfig jerseyConfiguration, final Retry retry, final RetryConnectorAllocator retryConnectorAllocator) { this.apiEndpoint = Preconditions.checkNotNull(apiEndpoint, "apiEndpoint cannot be null"); this.apiVersion = Preconditions.checkNotNull(apiVersion, "apiVersion cannot be null"); this.apiToken = Preconditions.checkNotNull(apiToken, "apiToken cannot be null"); if ( jerseyConfiguration == null ) { jerseyConfiguration = new ClientConfig(); jerseyConfiguration.property(ClientProperties.CONNECT_TIMEOUT, DEFAULT_CONNECTION_TIMEOUT); jerseyConfiguration.property(ClientProperties.READ_TIMEOUT, DEFAULT_READ_TIMEOUT); } ConnectorProvider connectorProvider = new HttpUrlConnectorProvider() { @Override public Connector getConnector(Client client, Configuration config) { return retryConnectorAllocator.newRetryConnector(super.getConnector(client, config), retry); } }; jerseyConfiguration.connectorProvider(connectorProvider); this.jerseyConfiguration = jerseyConfiguration; }

Target:
public DefaultQdsConfiguration(String apiEndpoint, String apiVersion, String apiToken, ClientConfig jerseyConfiguration, final Retry retry, final RetryConnectorAllocator retryConnectorAllocator) { this.apiEndpoint = Preconditions.checkNotNull(apiEndpoint, "apiEndpoint cannot be null"); this.apiToken = Preconditions.checkNotNull(apiToken, "apiToken cannot be null"); if (apiVersion == null) { this.apiVersion = API_VERSION; } else { this.apiVersion = apiVersion; } if ( jerseyConfiguration == null ) { jerseyConfiguration = new ClientConfig(); jerseyConfiguration.property(ClientProperties.CONNECT_TIMEOUT, DEFAULT_CONNECTION_TIMEOUT); jerseyConfiguration.property(ClientProperties.READ_TIMEOUT, DEFAULT_READ_TIMEOUT); } ConnectorProvider connectorProvider = new HttpUrlConnectorProvider() { @Override public Connector getConnector(Client client, Configuration config) { return retryConnectorAllocator.newRetryConnector(super.getConnector(client, config), retry); } }; jerseyConfiguration.connectorProvider(connectorProvider); this.jerseyConfiguration = jerseyConfiguration; }
Source:
public <K> MessageStream<M> partitionBy(Function<M, K> parKeyExtractor) { int opId = graph.getNextOpId(); String streamId = String.format("%s-%s", OperatorSpec.OpCode.PARTITION_BY.name().toLowerCase(), opId); MessageStreamImpl<M> intStream = this.graph.createIntStream(streamId, parKeyExtractor); OutputStream<M> outputStream = this.graph.getOutputStream(intStream); this.registeredOperatorSpecs.add(OperatorSpecs.createPartitionOperatorSpec(outputStream.getSinkFunction(), this.graph, outputStream, opId)); return intStream; }

Target:
public <K> MessageStream<M> partitionBy(Function<M, K> parKeyExtractor) { int opId = graph.getNextOpId(); MessageStreamImpl<M> intStream = this.graph.generateIntStreamFromOpId(opId, parKeyExtractor); OutputStream<M> outputStream = this.graph.getOutputStream(intStream); this.registeredOperatorSpecs.add(OperatorSpecs.createPartitionOperatorSpec(outputStream.getSinkFunction(), outputStream, opId)); return intStream; }
Source:
@Inject public AutomationClientAuthFactory(ClientDAOFactory clientDAOFactory) { this.authenticator = new MyAuthenticator(clientDAOFactory.readwrite()); }

Target:
@Inject public AutomationClientAuthFactory(ClientDAOFactory clientDAOFactory) { this.authenticator = new MyAuthenticator(clientDAOFactory.readonly()); }
Source:
protected boolean canDoAction() { boolean canDo = true; setVmId((Guid) (getParameters().getSlaParameter(VmSlaPolicyParameters.Params.VM_ID))); setVdsId((Guid) getParameters().getSlaParameter(VmSlaPolicyParameters.Params.VDS_ID)); setVdsGroupId(getVds().getVdsGroupId()); if (!FeatureSupported.vmSlaPolicy(getVdsGroup().getcompatibility_version())) { addCanDoActionMessage(VdcBllMessages.VM_SLA_POLICY_NOT_SUPPORTED); return false; } if (getVm() == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_EXIST); } if (getVm() == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_EXIST); } if (getVm().getStatus() != VMStatus.Up) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL, LocalizedVmStatus.from(getVm().getStatus())); } return canDo; }

Target:
protected boolean canDoAction() { setVmId((Guid) (getParameters().getSlaParameter(VmSlaPolicyParameters.Params.VM_ID))); setVdsId((Guid) getParameters().getSlaParameter(VmSlaPolicyParameters.Params.VDS_ID)); setVdsGroupId(getVds().getVdsGroupId()); if (!FeatureSupported.vmSlaPolicy(getVdsGroup().getcompatibility_version())) { return failCanDoAction(VdcBllMessages.VM_SLA_POLICY_NOT_SUPPORTED); } if (getVm() == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_EXIST); } if (getVm() == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_EXIST); } if (getVm().getStatus() != VMStatus.Up) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL, LocalizedVmStatus.from(getVm().getStatus())); } return true; }
Source:
private void doLookUpGetChildrenMethod() { if (!GETCHILDREN_PAGINATION_DISABLED) { try { _getChildrenMethod = ZooKeeper.class.getMethod("getAllChildrenPaginated", String.class, boolean.class); return; } catch (NoSuchMethodException e) { LOG.info("Paginated getChildren is not supported, fall back to non-paginated getChildren"); } } lookupNonPaginatedGetChildren(); }

Target:
private Method doLookUpGetChildrenMethod() { if (!GETCHILDREN_PAGINATION_DISABLED) { try { return ZooKeeper.class.getMethod("getAllChildrenPaginated", String.class, boolean.class); } catch (NoSuchMethodException e) { LOG.info("Paginated getChildren is not supported, fall back to non-paginated getChildren"); } } return lookupNonPaginatedGetChildren(); }
Source:
List<ICompletionProposal> computeProposals(int offset) { fProposalShell.dispose(); showProposals(true); List<ICompletionProposal> loadingList = new ArrayList<>(); loadingList.add(new ComputingProposal(fInvocationOffset, fFutures.size())); return loadingList; }

Target:
List<ICompletionProposal> computeProposals(int offset) { fProposalShell.dispose(); showProposals(true); return fComputedProposals; }
Source:
public ToolItem getWorkbenchToolItem(Matcher<String> matcher) { ToolBarLookup tl = ToolBarLookup.getInstance(); List<ToolBar> workbenchToolBars = tl.getWorkbenchToolBars(); Shell swtShell = ShellLookup.getInstance().getWorkbenchShell(); String text = WidgetHandler.getInstance().getText(swtShell); WidgetHandler.getInstance().setFocus(swtShell); new WaitUntil(new ShellWithTextIsAvailable(text)); final ToolItem ti = getToolItem(new DefaultReferencedComposite((Control) swtShell), 0, matcher); ToolBar tb = Display.syncExec(new ResultRunnable<ToolBar>() { @Override public ToolBar run() { return ti.getParent(); } }); if (workbenchToolBars.contains(tb)) { return ti; } else { Thrower.objectIsNull(ti, "ToolItem matching " + matcher.toString() + " cannot be found in any workbench toolbar"); } return null; }

Target:
public ToolItem getWorkbenchToolItem(Matcher<String> matcher) { ToolBarLookup tl = ToolBarLookup.getInstance(); List<ToolBar> workbenchToolBars = tl.getWorkbenchToolBars(); Shell swtShell = ShellLookup.getInstance().getWorkbenchShell(); if(swtShell == null){ Thrower.objectIsNull(swtShell, "There is no active workbench shell"); } final ToolItem ti = getToolItem(new DefaultReferencedComposite((Control) swtShell), 0, matcher); ToolBar tb = Display.syncExec(new ResultRunnable<ToolBar>() { @Override public ToolBar run() { return ti.getParent(); } }); if (workbenchToolBars.contains(tb)) { return ti; } else { Thrower.objectIsNull(ti, "ToolItem matching " + matcher.toString() + " cannot be found in any workbench toolbar"); } return null; }
Source:
public void shouldDecorateFutureAndThrowTimeoutException() throws Exception { CircuitBreaker circuitBreaker = CircuitBreaker.ofDefaults("testName"); final Future<String> future = executor.submit(() -> { Thread.currentThread().sleep(10000); return null; }); CircuitBreakerFuture<String> decoratedFuture = new CircuitBreakerFuture<>(circuitBreaker, future); Throwable thrown = catchThrowable(() -> decoratedFuture.get(5, TimeUnit.SECONDS)); assertThat(thrown).isInstanceOf(TimeoutException.class); assertThat(circuitBreaker.getMetrics().getNumberOfBufferedCalls()).isEqualTo(1); assertThat(circuitBreaker.getMetrics().getNumberOfFailedCalls()).isEqualTo(1); assertThat(circuitBreaker.getMetrics().getNumberOfSuccessfulCalls()).isEqualTo(0); assertThat(circuitBreaker.getMetrics().getNumberOfNotPermittedCalls()).isEqualTo(0); assertThat(circuitBreaker.getState()).isEqualTo(CircuitBreaker.State.CLOSED); }

Target:
public void shouldDecorateFutureAndThrowTimeoutException() throws Exception { CircuitBreaker circuitBreaker = CircuitBreaker.ofDefaults("testName"); final Future<String> future = mock(Future.class); when(future.get(anyLong(), any(TimeUnit.class))).thenThrow(new TimeoutException()); CircuitBreakerFuture<String> decoratedFuture = new CircuitBreakerFuture<>(circuitBreaker, future); Throwable thrown = catchThrowable(() -> decoratedFuture.get(5, TimeUnit.SECONDS)); assertThat(thrown).isInstanceOf(TimeoutException.class); assertThat(circuitBreaker.getMetrics().getNumberOfBufferedCalls()).isEqualTo(1); assertThat(circuitBreaker.getMetrics().getNumberOfFailedCalls()).isEqualTo(1); assertThat(circuitBreaker.getMetrics().getNumberOfSuccessfulCalls()).isEqualTo(0); assertThat(circuitBreaker.getMetrics().getNumberOfNotPermittedCalls()).isEqualTo(0); assertThat(circuitBreaker.getState()).isEqualTo(CircuitBreaker.State.CLOSED); then(future).should().get(anyLong(), any(TimeUnit.class)); }
Source:
private File writeFile( AttachmentModel attachment, MediaType mediaType ) { String extension = getExtension( mediaType ); File targetFile = getTargetFile( attachment.getFileName(), extension ); try { if( attachment.isBinary() ) { File thumbFile = getTargetFile( "attachment-thumb", extension ); String thumbnail = compressToThumbnail( attachment.getValue(), extension ); Files.write( parseBase64Binary( thumbnail ), thumbFile ); Files.write( parseBase64Binary( attachment.getValue() ), targetFile ); } else { Files.write( attachment.getValue(), targetFile, Charsets.UTF_8 ); } } catch( IOException e ) { log.error( "Error while trying to write attachment to file " + targetFile, e ); } return targetFile; }

Target:
private File writeFile( AttachmentModel attachment, MediaType mediaType ) { String extension = getExtension( mediaType ); File targetFile = getTargetFile( attachment.getFileName(), extension ); try { if( attachment.isBinary() ) { if( mediaType.is( MediaType.ANY_IMAGE_TYPE ) ) { File thumbFile = getThumbnailFileFor( targetFile ); byte[] thumbnail = compressToThumbnail( attachment.getValue(), extension ); Files.write( thumbnail, thumbFile ); } Files.write( parseBase64Binary( attachment.getValue() ), targetFile ); } else { Files.write( attachment.getValue(), targetFile, Charsets.UTF_8 ); } } catch( IOException e ) { log.error( "Error while trying to write attachment to file " + targetFile, e ); } return targetFile; }
Source:
void addDiff(int endA, int endB, List<Edit> internalEdit) { int lenA = endA - nextA; int lenB = endB - nextB; checkState(lenA > 0 || lenB > 0); ContentEntry e = entry(); if (lenA > 0) { e.a = Lists.newArrayListWithCapacity(lenA); for (; nextA < endA; nextA++) { e.a.add(fileA.get(nextA)); } } if (lenB > 0) { e.b = Lists.newArrayListWithCapacity(lenB); for (; nextB < endB; nextB++) { e.b.add(fileB.get(nextB)); } } if (internalEdit != null && !internalEdit.isEmpty()) { e.editA = Lists.newArrayListWithCapacity(internalEdit.size() * 2); e.editB = Lists.newArrayListWithCapacity(internalEdit.size() * 2); int lastA = 0; int lastB = 0; for (Edit edit : internalEdit) { if (edit.getBeginA() != edit.getEndA()) { e.editA.add(ImmutableList.of(edit.getBeginA() - lastA, edit.getEndA() - edit.getBeginA())); lastA = edit.getBeginA() + edit.getEndA(); } if (edit.getBeginB() != edit.getEndB()) { e.editB.add(ImmutableList.of(edit.getBeginB() - lastB, edit.getEndB() - edit.getBeginB())); lastB = edit.getBeginB() + edit.getEndB(); } } } }

Target:
void addDiff(int endA, int endB, List<Edit> internalEdit) { int lenA = endA - nextA; int lenB = endB - nextB; checkState(lenA > 0 || lenB > 0); ContentEntry e = entry(); if (lenA > 0) { e.a = Lists.newArrayListWithCapacity(lenA); for (; nextA < endA; nextA++) { e.a.add(fileA.get(nextA)); } } if (lenB > 0) { e.b = Lists.newArrayListWithCapacity(lenB); for (; nextB < endB; nextB++) { e.b.add(fileB.get(nextB)); } } if (internalEdit != null && !internalEdit.isEmpty()) { e.editA = Lists.newArrayListWithCapacity(internalEdit.size() * 2); e.editB = Lists.newArrayListWithCapacity(internalEdit.size() * 2); int lastA = 0; int lastB = 0; for (Edit edit : internalEdit) { if (edit.getBeginA() != edit.getEndA()) { e.editA.add(ImmutableList.of(edit.getBeginA() - lastA, edit.getEndA() - edit.getBeginA())); lastA = edit.getEndA(); } if (edit.getBeginB() != edit.getEndB()) { e.editB.add(ImmutableList.of(edit.getBeginB() - lastB, edit.getEndB() - edit.getBeginB())); lastB = edit.getEndB(); } } } }
Source:
public CompositeModuleDeploymentRequest() { }

Target:
private CompositeModuleDeploymentRequest() { }
Source:
private int findNext(String findString, int startIndex, BiMap<ITimeGraphEntry, Integer> items, boolean forwardSearch, boolean caseSensitive, boolean wrapSearch, boolean wholeWord, boolean regExSearch, boolean beep) { if (forwardSearch) { int index = startIndex == items.size() - 1 ? -1 : findNext(startIndex + 1, findString, items, true, caseSensitive, wholeWord, regExSearch); if (index == -1) { if (beep && okToUse(getShell())) { getShell().getDisplay().beep(); } if (wrapSearch) { statusMessage("Wrapped search"); index = findNext(-1, findString, items, true, caseSensitive, wholeWord, regExSearch); } } return index; } int index = startIndex == 0 ? -1 : findNext(startIndex - 1, findString, items, false, caseSensitive, wholeWord, regExSearch); if (index == -1) { if (beep && okToUse(getShell())) { getShell().getDisplay().beep(); } if (wrapSearch) { statusMessage("Wrapped search"); index = findNext(-1, findString, items, false, caseSensitive, wholeWord, regExSearch); } } return index; }

Target:
private int findNext(String findString, int startIndex, BiMap<ITimeGraphEntry, Integer> items, boolean forwardSearch, boolean caseSensitive, boolean wrapSearch, boolean wholeWord, boolean regExSearch, boolean beep) { if (forwardSearch) { int index = startIndex == items.size() - 1 ? -1 : findNext(startIndex + 1, findString, items, true, caseSensitive, wholeWord, regExSearch); if (index == -1) { if (beep && okToUse(getShell())) { getShell().getDisplay().beep(); } if (wrapSearch) { statusMessage(Messages.TimeGraphFindDialog_Status_wrapped_label); index = findNext(-1, findString, items, true, caseSensitive, wholeWord, regExSearch); } } return index; } int index = startIndex == 0 ? -1 : findNext(startIndex - 1, findString, items, false, caseSensitive, wholeWord, regExSearch); if (index == -1) { if (beep && okToUse(getShell())) { getShell().getDisplay().beep(); } if (wrapSearch) { statusMessage("Wrapped search"); index = findNext(-1, findString, items, false, caseSensitive, wholeWord, regExSearch); } } return index; }
Source:
public static DnsServerAddressStreamProvider unixDefault() { return DEFAULT_DNS_SERVER_ADDRESS_STREAM_PROVIDER; }

Target:
public static DnsServerAddressStreamProvider unixDefault() { return DefaultProviderHolder.DEFAULT_DNS_SERVER_ADDRESS_STREAM_PROVIDER; }
Source:
public AbstractPlanNode toPlanNode() { final MergeJoinPlanNode mjpn = new MergeJoinPlanNode(); if (joinType != JoinRelType.INNER) { throw new PlannerFallbackException("Join type not supported: " + joinType.name()); } mjpn.setJoinType(JoinType.INNER); mjpn.addAndLinkChild(inputRelNodeToPlanNode(this, 0)); mjpn.addAndLinkChild(inputRelNodeToPlanNode(this, 1)); mjpn.setJoinPredicate(RexConverter.convertJoinPred(getInput(0).getRowType().getFieldCount(), getCondition())); addLimitOffset(mjpn); return setOutputSchema(mjpn); }

Target:
public AbstractPlanNode toPlanNode() { if (joinType != JoinRelType.INNER) { throw new PlannerFallbackException("Join type not supported: " + joinType.name()); } final MergeJoinPlanNode mjpn = new MergeJoinPlanNode(); mjpn.setJoinType(JoinType.INNER); mjpn.addAndLinkChild(inputRelNodeToPlanNode(this, 0)); mjpn.addAndLinkChild(inputRelNodeToPlanNode(this, 1)); mjpn.setJoinPredicate(RexConverter.convertJoinPred(getInput(0).getRowType().getFieldCount(), getCondition())); addLimitOffset(mjpn); return setOutputSchema(mjpn); }
Source:
public synchronized void authorize(UserGroupInformation user, ConnectionHeader connection, InetAddress addr) throws AuthorizationException { if (authorize) { Class<?> c = getServiceInterface(services, connection.getServiceName()); synchronized (authManager) { authManager.authorize(user, c, getConf(), addr); } } }

Target:
public synchronized void authorize(UserGroupInformation user, ConnectionHeader connection, InetAddress addr) throws AuthorizationException { if (authorize) { Class<?> c = getServiceInterface(services, connection.getServiceName()); authManager.authorize(user, c, getConf(), addr); } }
Source:
public FluoQuery createPcj(String sparql, FluoClient fluo) throws MalformedQueryException, UnsupportedQueryException { Preconditions.checkNotNull(sparql); Preconditions.checkNotNull(fluo); String pcjId = FluoQueryUtils.createNewPcjId(); return createPcj(pcjId, sparql, Sets.newHashSet(ExportStrategy.Kafka), fluo); }

Target:
public FluoQuery createPcj(String sparql, FluoClient fluo) throws MalformedQueryException, UnsupportedQueryException { Preconditions.checkNotNull(sparql); Preconditions.checkNotNull(fluo); String pcjId = FluoQueryUtils.createNewPcjId(); return createPcj(pcjId, sparql, Sets.newHashSet(ExportStrategy.KAFKA), fluo); }