auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private List<FeedbackResponseAttributes> filterResponsesForStatistics(List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question, String studentEmail, FeedbackSessionResultsBundle bundle, String view) { boolean isViewedByStudent = "student".equals(view); if (!isViewedByStudent) { return responses; } FeedbackParticipantType[] typesToSkipFiltering = {FeedbackParticipantType.INSTRUCTORS, FeedbackParticipantType.NONE, FeedbackParticipantType.SELF}; FeedbackParticipantType recipientType = question.getRecipientType(); for (FeedbackParticipantType skipType : typesToSkipFiltering) { if (recipientType.equals(skipType)) { return responses; } } FeedbackParticipantType[] typesToFilterByTeams = {FeedbackParticipantType.OWN_TEAM, FeedbackParticipantType.TEAMS}; boolean toFilterByTeams = false; for (FeedbackParticipantType teamType : typesToFilterByTeams) { if (recipientType.equals(teamType)) { toFilterByTeams = true; } } List<FeedbackResponseAttributes> receivedResponses = new ArrayList<>(); String recipientString = toFilterByTeams ? bundle.getTeamNameForEmail(studentEmail) : studentEmail; for (FeedbackResponseAttributes response : responses) { boolean isReceivedResponse = response.recipient.equals(recipientString); if (isReceivedResponse) { receivedResponses.add(response); } } if (receivedResponses.isEmpty()) { return responses; } return receivedResponses; }

Target:
private List<FeedbackResponseAttributes> filterResponsesForStatistics( List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question, String studentEmail, FeedbackSessionResultsBundle bundle, String view) { boolean isViewedByStudent = "student".equals(view); if (!isViewedByStudent) { return responses; } FeedbackParticipantType recipientType = question.getRecipientType(); boolean isFilteringSkipped = recipientType.equals(FeedbackParticipantType.INSTRUCTORS) || recipientType.equals(FeedbackParticipantType.NONE) || recipientType.equals(FeedbackParticipantType.SELF); if (isFilteringSkipped) { return responses; } boolean isFilteringByTeams = recipientType.equals(FeedbackParticipantType.OWN_TEAM) || recipientType.equals(FeedbackParticipantType.TEAMS); List<FeedbackResponseAttributes> receivedResponses = new ArrayList<>(); String recipientString = isFilteringByTeams ? bundle.getTeamNameForEmail(studentEmail) : studentEmail; for (FeedbackResponseAttributes response : responses) { boolean isReceivedResponse = response.recipient.equals(recipientString); if (isReceivedResponse) { receivedResponses.add(response); } } return receivedResponses; }
Source:
private View makeSpaceView(int width, int height) { View view = new View(getActivity()); view.setLayoutParams(new ListView.LayoutParams(width, height)); view.setClickable(true); view.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_DOWN) { dismiss(); } return false; } }); return view; }

Target:
private View makeSpaceView(int width, int height) { View view = new View(getActivity()); view.setLayoutParams(new ListView.LayoutParams(width, height)); view.setClickable(true); view.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_DOWN) { dismiss(); } return true; } }); return view; }
Source:
public String getContentIdentifier() { return RevUtils.truncatedRevision(revCommit.getName()); }

Target:
public String getContentIdentifier() { return revCommit.abbreviate(7).name() + "..."; }
Source:
public void testCreateTenantSpecificTable() throws Exception { long ts = nextTimestamp(); Properties props = new Properties(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts)); Connection conn = DriverManager.getConnection(getUrl(), props); conn.createStatement().execute("CREATE TABLE PARENT_TABLE ( \n" + " user VARCHAR ,\n" + " id INTEGER not null primary key desc\n" + " ) "); conn.close(); props.setProperty(PhoenixRuntime.TENANT_ID_ATTRIB, tenantId); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 10)); conn = DriverManager.getConnection(getUrl(), props); conn.createStatement().execute("CREATE TABLE TENANT_SPECIFIC_TABLE ( \n" + " tenantCol VARCHAR\n" + " ) BASE_TABLE='PARENT_TABLE'"); conn.close(); HBaseAdmin admin = driver.getConnectionQueryServices(getUrl(), TEST_PROPERTIES).getAdmin(); assertEquals(0, admin.listTables("TENANT_SPECIFIC_TABLE").length); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 20)); conn = DriverManager.getConnection(getUrl(), props); conn.createStatement().execute("DROP TABLE TENANT_SPECIFIC_TABLE"); conn.close(); props.remove(PhoenixRuntime.TENANT_ID_ATTRIB); conn = DriverManager.getConnection(getUrl(), props); conn.createStatement().execute("DROP TABLE PARENT_TABLE"); conn.close(); }

Target:
public void testCreateTenantSpecificTable() throws Exception { long ts = nextTimestamp(); Properties props = new Properties(); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts)); Connection conn = DriverManager.getConnection(getUrl(), props); conn.createStatement().execute("CREATE TABLE PARENT_TABLE ( \n" + " user VARCHAR ,\n" + " tenant_id VARCHAR not null,\n" + " id INTEGER not null\n" + " constraint pk primary key (tenant_id, id)) "); conn.close(); props.setProperty(PhoenixRuntime.TENANT_ID_ATTRIB, tenantId); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 10)); conn = DriverManager.getConnection(getUrl(), props); conn.createStatement().execute("CREATE TABLE TENANT_SPECIFIC_TABLE ( \n" + " tenantCol VARCHAR\n" + " ) BASE_TABLE='PARENT_TABLE'"); conn.close(); HBaseAdmin admin = driver.getConnectionQueryServices(getUrl(), TEST_PROPERTIES).getAdmin(); assertEquals(0, admin.listTables("TENANT_SPECIFIC_TABLE").length); props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts + 20)); conn = DriverManager.getConnection(getUrl(), props); conn.createStatement().execute("DROP TABLE TENANT_SPECIFIC_TABLE"); conn.close(); props.remove(PhoenixRuntime.TENANT_ID_ATTRIB); conn = DriverManager.getConnection(getUrl(), props); conn.createStatement().execute("DROP TABLE PARENT_TABLE"); conn.close(); }
Source:
public <K, V> Table<KV<K, V>> getTable(TableDescriptor<K, V, ?> tableDesc) { TableSpec tableSpec = tableDesc.getTableSpec(); if (tables.containsKey(tableSpec)) { throw new IllegalStateException(String.format( "getTable() invoked multiple times with the same tableId: %s", tableDesc.getTableId())); } tables.put(tableSpec, new TableImpl(tableSpec)); return tables.get(tableSpec); }

Target:
public <K, V> Table<KV<K, V>> getTable(TableDescriptor<K, V, ?> tableDesc) { TableSpec tableSpec = ((BaseTableDescriptor) tableDesc).getTableSpec(); if (tables.containsKey(tableSpec)) { throw new IllegalStateException(String.format( "getTable() invoked multiple times with the same tableId: %s", tableDesc.getTableId())); } tables.put(tableSpec, new TableImpl(tableSpec)); return tables.get(tableSpec); }
Source:
public void createTableAsync(final HTableDescriptor desc, byte[][] splitKeys) throws IOException { LOG.warn("Creating the table synchronously"); CreateTableRequest createTableRequest = CreateTableRequest.of(desc.getTableName().getNameAsString()); for (HColumnDescriptor column : desc.getColumnFamilies()) { String columnName = column.getNameAsString(); createTableRequest.addFamily(columnName, buildGarbageCollectionRule(column)); } if (splitKeys != null) { for (byte[] splitKey : splitKeys) { createTableRequest.addSplit(ByteString.copyFrom(splitKey)); } } createTableAsync(createTableRequest, desc.getTableName()); }

Target:
public void createTableAsync(final HTableDescriptor desc, byte[][] splitKeys) throws IOException { LOG.warn("Creating the table synchronously"); createTableAsync(desc.getTableName(), TableAdapter.adapt(desc, splitKeys)); }
Source:
public IAnalysisModule newModule(ITmfTrace trace) throws TmfAnalysisException { boolean applies = appliesToTraceType(trace.getClass(), false); if (!applies && (trace instanceof TmfExperiment)) { if (appliesToTraceType(trace.getClass(), true)) { boolean expApplies = false; for (ITmfTrace expTrace : TmfTraceManager.getTraceSet(trace)) { if (appliesToTraceType(expTrace.getClass())) { expApplies = true; break; } } applies = expApplies; } } if (!applies) { throw new TmfAnalysisException(NLS.bind(Messages.TmfAnalysisModuleHelper_AnalysisDoesNotApply, getName())); } IAnalysisModule module = createModule(); if (module == null) { return null; } module.setAutomatic(isAutomatic()); final IConfigurationElement[] parametersCE = fCe.getChildren(TmfAnalysisModuleSourceConfigElement.PARAMETER_ELEM); for (IConfigurationElement element : parametersCE) { String paramName = element.getAttribute(TmfAnalysisModuleSourceConfigElement.NAME_ATTR); if (paramName == null) { continue; } module.addParameter(paramName); String defaultValue = element.getAttribute(TmfAnalysisModuleSourceConfigElement.DEFAULT_VALUE_ATTR); if (defaultValue != null) { module.setParameter(paramName, defaultValue); } } module.setTrace(trace); TmfAnalysisManager.analysisModuleCreated(module); return module; }

Target:
public IAnalysisModule newModule(ITmfTrace trace) throws TmfAnalysisException { boolean applies = appliesToTraceType(trace.getClass()); if (!applies && (trace instanceof TmfExperiment) && appliesToExperiment()) { for (ITmfTrace expTrace : TmfTraceManager.getTraceSet(trace)) { if (appliesToTraceType(expTrace.getClass())) { applies = true; break; } } } if (!applies) { throw new TmfAnalysisException(NLS.bind(Messages.TmfAnalysisModuleHelper_AnalysisDoesNotApply, getName())); } IAnalysisModule module = createModule(); if (module == null) { return null; } module.setAutomatic(isAutomatic()); final IConfigurationElement[] parametersCE = fCe.getChildren(TmfAnalysisModuleSourceConfigElement.PARAMETER_ELEM); for (IConfigurationElement element : parametersCE) { String paramName = element.getAttribute(TmfAnalysisModuleSourceConfigElement.NAME_ATTR); if (paramName == null) { continue; } module.addParameter(paramName); String defaultValue = element.getAttribute(TmfAnalysisModuleSourceConfigElement.DEFAULT_VALUE_ATTR); if (defaultValue != null) { module.setParameter(paramName, defaultValue); } } module.setTrace(trace); TmfAnalysisManager.analysisModuleCreated(module); return module; }
Source:
public void testCompare() { Bytes b1 = Bytes.of("a"); Bytes b2 = Bytes.of("b"); Bytes b3 = Bytes.of("a"); Assert.assertEquals(-1, b1.compareTo(b2)); Assert.assertEquals(1, b2.compareTo(b1)); Assert.assertEquals(0, b1.compareTo(b3)); Assert.assertEquals(0, b1.compareTo(b1)); Assert.assertEquals(1, b1.compareTo(Bytes.EMPTY)); byte[] b1Arr = b1.toArray(); byte[] b2Arr = b2.toArray(); byte[] b3Arr = b3.toArray(); Assert.assertEquals(-1, b1.compareTo(b2Arr)); Assert.assertEquals(1, b2.compareTo(b1Arr)); Assert.assertEquals(0, b1.compareTo(b3Arr)); Assert.assertEquals(0, b1.compareTo(b1Arr)); Assert.assertEquals(1, b1.compareTo(Bytes.EMPTY)); }

Target:
public void testCompare() { Bytes b1 = Bytes.of("a"); Bytes b2 = Bytes.of("b"); Bytes b3 = Bytes.of("a"); Assert.assertEquals(-1, b1.compareTo(b2)); Assert.assertEquals(1, b2.compareTo(b1)); Assert.assertEquals(0, b1.compareTo(b3)); Assert.assertEquals(0, b1.compareTo(b1)); Assert.assertEquals(1, b1.compareTo(Bytes.EMPTY)); byte[] b1Arr = b1.toArray(); byte[] b2Arr = b2.toArray(); byte[] b3Arr = b3.toArray(); Assert.assertEquals(-1, b1.compareTo(b2Arr)); Assert.assertEquals(1, b2.compareTo(b1Arr)); Assert.assertEquals(0, b1.compareTo(b3Arr)); Assert.assertEquals(0, b1.compareTo(b1Arr)); Assert.assertEquals(1, b1.compareTo(Bytes.EMPTY)); Bytes b4 = Bytes.of("abc"); byte[] b4Arr = b4.toArray(); Bytes b5 = Bytes.of("baz"); byte[] b5Arr = b5.toArray(); Bytes b6 = Bytes.of("ab"); byte[] b7Arr = Bytes.of("dabc").toArray(); Assert.assertEquals(0, b4.compareTo(b4Arr, 0, 3)); Assert.assertTrue(b4.compareTo(b4Arr, 1, 2) < 0); Assert.assertTrue(b5.compareTo(b4Arr, 1, 2) < 0); Assert.assertTrue(b5.compareTo(b5Arr, 1, 2) > 0); Assert.assertTrue(b4.compareTo(b4Arr, 0, 2) > 0); Assert.assertTrue(b6.compareTo(b7Arr, 1, 3) < 0); Assert.assertTrue(b6.compareTo(b1Arr) > 0); }
Source:
public int hashCode() { return Objects.hash(value); }

Target:
public int hashCode() { return value; }
Source:
protected void configureServlets() { install(new FactoryModule() { @Override protected void configure() { factory(AddBranch.Factory.class); factory(AddRefRight.Factory.class); factory(ChangeProjectSettings.Factory.class); factory(DeleteBranches.Factory.class); factory(DeleteRefRights.Factory.class); factory(ListBranches.Factory.class); factory(VisibleProjects.Factory.class); factory(ProjectDetailFactory.Factory.class); bind(ApprovalCategoryConstraintsConfig.class); } }); rpc(ProjectAdminServiceImpl.class); }

Target:
protected void configureServlets() { install(new FactoryModule() { @Override protected void configure() { factory(AddBranch.Factory.class); factory(ChangeProjectAccess.Factory.class); factory(ChangeProjectSettings.Factory.class); factory(DeleteBranches.Factory.class); factory(ListBranches.Factory.class); factory(VisibleProjects.Factory.class); factory(ProjectAccessFactory.Factory.class); factory(ProjectDetailFactory.Factory.class); bind(RestrictionsConfig.class); } }); rpc(ProjectAdminServiceImpl.class); }
Source:
public void embeddedLdapServerRegistersExpectedAuthenticationProvider() { LdapAuthenticationProvider LdapAuthenticationProvider = (org.springframework.security.ldap.authentication.LdapAuthenticationProvider) appCtx.getBean( "ldapAuthenticationProvider"); Authentication authentication = LdapAuthenticationProvider.authenticate( new UsernamePasswordAuthenticationToken("przemyslaw.fusik", "password")); Assert.assertThat(authentication, CoreMatchers.notNullValue()); Assert.assertThat(authentication, CoreMatchers.instanceOf(UsernamePasswordAuthenticationToken.class)); Assert.assertThat(authentication.getPrincipal(), CoreMatchers.instanceOf(LdapUserDetailsImpl.class)); Assert.assertThat(((LdapUserDetailsImpl) authentication.getPrincipal()).getDn(), CoreMatchers.equalTo("uid=przemyslaw.fusik,ou=Users,dc=carlspring,dc=com")); Assert.assertThat(((LdapUserDetailsImpl) authentication.getPrincipal()).getPassword(), CoreMatchers.equalTo("password")); Assert.assertThat(((LdapUserDetailsImpl) authentication.getPrincipal()).getUsername(), CoreMatchers.equalTo("przemyslaw.fusik")); Assert.assertThat(((LdapUserDetailsImpl) authentication.getPrincipal()).getAuthorities(), CoreMatchers.hasItems( CoreMatchers.equalTo((GrantedAuthority) Privileges.ADMIN_CREATE_REPO), CoreMatchers.equalTo((GrantedAuthority) Privileges.ADMIN_DELETE_REPO), CoreMatchers.equalTo((GrantedAuthority) Privileges.ADMIN_CREATE_REPO), CoreMatchers.equalTo(new SimpleGrantedAuthority("VIEW_USER"))) ); }

Target:
public void embeddedLdapServerRegistersExpectedAuthenticationProvider() { LdapAuthenticationProvider LdapAuthenticationProvider = (org.springframework.security.ldap.authentication.LdapAuthenticationProvider) appCtx.getBean( "ldapAuthenticationProvider"); Authentication authentication = LdapAuthenticationProvider.authenticate( new UsernamePasswordAuthenticationToken("przemyslaw.fusik", "password")); Assert.assertThat(authentication, CoreMatchers.notNullValue()); Assert.assertThat(authentication, CoreMatchers.instanceOf(UsernamePasswordAuthenticationToken.class)); Assert.assertThat(authentication.getPrincipal(), CoreMatchers.instanceOf(LdapUserDetailsImpl.class)); LdapUserDetails ldapUserDetails = (LdapUserDetailsImpl) authentication.getPrincipal(); Assert.assertThat(ldapUserDetails.getDn(), CoreMatchers.equalTo("uid=przemyslaw.fusik,ou=Users,dc=carlspring,dc=com")); Assert.assertThat(ldapUserDetails.getPassword(), CoreMatchers.equalTo("password")); Assert.assertThat(ldapUserDetails.getUsername(), CoreMatchers.equalTo("przemyslaw.fusik")); Assert.assertThat(ldapUserDetails.getAuthorities(), CoreMatchers.hasItems( CoreMatchers.equalTo((GrantedAuthority) Privileges.ADMIN_CREATE_REPO), CoreMatchers.equalTo((GrantedAuthority) Privileges.ADMIN_DELETE_REPO), CoreMatchers.equalTo((GrantedAuthority) Privileges.ADMIN_CREATE_REPO), CoreMatchers.equalTo(new SimpleGrantedAuthority("VIEW_USER"))) ); }
Source:
private static <E extends Enum<E>> Optional<Argument> byName(E value, ConfigRegistry config) { return makeArgument(Types.VARCHAR, String.class, value, e -> { final Field field; try { field = e.getDeclaringClass().getField(e.name()); } catch (final NoSuchFieldException ex) { throw new RuntimeException(ex); } final DatabaseValue databaseValue = field.getAnnotation(DatabaseValue.class); return databaseValue == null ? e.name() : databaseValue.value(); }, config); }

Target:
private static <E extends Enum<E>> Optional<Argument> byName(E value, ConfigRegistry config) { final Function<E, String> transform = e -> { final Field field = Unchecked.function(e.getDeclaringClass()::getField).apply(e.name()); final DatabaseValue databaseValue = field.getAnnotation(DatabaseValue.class); return databaseValue == null ? e.name() : databaseValue.value(); }; return makeArgument(Types.VARCHAR, String.class, value, transform, config); }
Source:
public void run() { android.os.Process.setThreadPriority( android.os.Process.THREAD_PRIORITY_BACKGROUND ); final Thread thread = Thread.currentThread(); TileCanvasViewGroup tileCanvasViewGroup = mTileCanvasViewGroup.get(); Tile tile = mTile.get(); if( tileCanvasViewGroup != null ){ if( thread.isInterrupted() ){ tileCanvasViewGroup.onRenderTaskCancelled(); return; } if( !tileCanvasViewGroup.getRenderIsCancelled() && tile != null ){ tileCanvasViewGroup.generateTileBitmap( tile ); if ( thread.isInterrupted() ){ tileCanvasViewGroup.onRenderTaskCancelled(); return; } tileCanvasViewGroup.addTileToCurrentTileCanvasView( tile ); } } }

Target:
public void run() { Process.setThreadPriority( Process.THREAD_PRIORITY_BACKGROUND ); final Thread thread = Thread.currentThread(); TileCanvasViewGroup tileCanvasViewGroup = mTileCanvasViewGroup.get(); Tile tile = mTile.get(); if( tileCanvasViewGroup != null ){ if( thread.isInterrupted() ){ tileCanvasViewGroup.onRenderTaskCancelled(); return; } if( !tileCanvasViewGroup.getRenderIsCancelled() && tile != null ){ tileCanvasViewGroup.generateTileBitmap( tile ); if ( thread.isInterrupted() ){ tileCanvasViewGroup.onRenderTaskCancelled(); return; } tileCanvasViewGroup.addTileToCurrentTileCanvasView( tile ); } } }
Source:
protected VdcQueryReturnValue getAllDisksByStorageDomain(Guid domainId) { return Backend.getInstance().RunQuery(VdcQueryType.GetAllDisksByStorageDomainId, new StorageDomainQueryParametersBase(domainId)); }

Target:
protected VdcQueryReturnValue getAllDisksByStorageDomain(Guid domainId) { return getBackend().RunQuery(VdcQueryType.GetAllDisksByStorageDomainId, new StorageDomainQueryParametersBase(domainId)); }
Source:
public void createModelThrowsIfModelAlreadyExists(HttpClient httpClient, DigitalTwinsServiceVersion serviceVersion) { DigitalTwinsClient client = getClient(httpClient, serviceVersion); final List<String> modelsToCreate = new ArrayList<>(); final String wardModelId = UniqueIdHelper.getUniqueModelId(TestAssetDefaults.WARD_MODEL_ID, client, randomIntegerStringGenerator); final String wardModelPayload = TestAssetsHelper.getWardModelPayload(wardModelId); modelsToCreate.add(wardModelPayload); List<ModelData> createdModels = client.createModels(modelsToCreate); createdModels.forEach((modelData) -> { assertNotNull(modelData); }); assertRestException( () -> client.createModels(modelsToCreate).forEach((modelData) -> { }), HttpURLConnection.HTTP_CONFLICT); }

Target:
public void createModelThrowsIfModelAlreadyExists(HttpClient httpClient, DigitalTwinsServiceVersion serviceVersion) { DigitalTwinsClient client = getClient(httpClient, serviceVersion); final List<String> modelsToCreate = new ArrayList<>(); final String wardModelId = UniqueIdHelper.getUniqueModelId(TestAssetDefaults.WARD_MODEL_ID, client, randomIntegerStringGenerator); final String wardModelPayload = TestAssetsHelper.getWardModelPayload(wardModelId); modelsToCreate.add(wardModelPayload); List<ModelData> createdModels = client.createModels(modelsToCreate); createdModels.forEach((modelData) -> { assertNotNull(modelData); }); assertRestException( () -> client.createModels(modelsToCreate), HttpURLConnection.HTTP_CONFLICT); }
Source:
private void setAchievements() { if (checkAccount()) { try{ compositeDisposable.add(mediaWikiApi .getAchievements(Objects.requireNonNull(sessionManager.getCurrentAccount()).name) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe( response -> { if (response != null) { setUploadCount(Achievements.from(response)); } else { Timber.d("success"); layoutImageReverts.setVisibility(View.INVISIBLE); imageView.setVisibility(View.INVISIBLE); levelNumber.setText("You haven't qualified any level yet"); } }, t -> { Timber.e(t, "Fetching achievements statistics failed"); onError(); } )); } catch (Exception e){ Timber.d(e+"success"); } } }

Target:
private void setAchievements() { progressBar.setVisibility(View.VISIBLE); if (checkAccount()) { try{ compositeDisposable.add(mediaWikiApi .getAchievements(Objects.requireNonNull(sessionManager.getCurrentAccount()).name) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe( response -> { if (response != null) { setUploadCount(Achievements.from(response)); } else { Timber.d("success"); layoutImageReverts.setVisibility(View.INVISIBLE); imageView.setVisibility(View.INVISIBLE); showSnackBarWithRetry(); } }, t -> { Timber.e(t, "Fetching achievements statistics failed"); showSnackBarWithRetry(); } )); } catch (Exception e){ Timber.d(e+"success"); } } }
Source:
static <T> CheckedFunction0<T> decorateCheckedSupplier(CircuitBreaker circuitBreaker, CheckedFunction0<T> supplier) { return () -> { circuitBreaker.acquirePermission(); Instant start = circuitBreaker.getClock().instant(); try { T returnValue = supplier.apply(); Instant end = circuitBreaker.getClock().instant(); long durationInNanos = Duration.between(start, end).toNanos(); circuitBreaker.onSuccess(durationInNanos, TimeUnit.NANOSECONDS); return returnValue; } catch (Exception exception) { Instant end = circuitBreaker.getClock().instant(); long durationInNanos = Duration.between(start, end).toNanos(); circuitBreaker.onError(durationInNanos, TimeUnit.NANOSECONDS, exception); throw exception; } }; }

Target:
static <T> CheckedFunction0<T> decorateCheckedSupplier(CircuitBreaker circuitBreaker, CheckedFunction0<T> supplier) { return () -> { circuitBreaker.acquirePermission(); final long start = circuitBreaker.getCurrentTimestamp(); try { T returnValue = supplier.apply(); long duration = circuitBreaker.getCurrentTimestamp() - start; circuitBreaker.onSuccess(duration, circuitBreaker.getTimestampUnit()); return returnValue; } catch (Exception exception) { long duration = circuitBreaker.getCurrentTimestamp() - start; circuitBreaker.onError(duration, circuitBreaker.getTimestampUnit(), exception); throw exception; } }; }
Source:
public Integer getPrivatePort() { return privatePort; }

Target:
public int getPrivatePort() { return privatePort; }
Source:
public FunctionSignature[] getFunctionSignatures() { return new FunctionSignature[]{ new BasicFunctionSignature(getType(null), ScalarArgument.GEOMETRY, ScalarArgument.INT), new BasicFunctionSignature(getType(null), ScalarArgument.GEOMETRY, ScalarArgument.STRING)}; }

Target:
public FunctionSignature[] getFunctionSignatures() { return new FunctionSignature[]{ new BasicFunctionSignature(Type.GEOMETRY, ScalarArgument.GEOMETRY, ScalarArgument.INT), new BasicFunctionSignature(Type.GEOMETRY, ScalarArgument.GEOMETRY, ScalarArgument.STRING)}; }
Source:
protected Configuration getRemoteCacheManagerConfig(String login, String password) { ConfigurationBuilder config = getDefaultConfigBuilder(); config.security().authentication().serverName(TEST_SERVER_NAME); config.security().authentication().saslMechanism(getTestedMech()); config.security().authentication().callbackHandler(new LoginHandler(login, password, TEST_REALM)); config.security().authentication().enable(); return config.build(); }

Target:
protected Configuration getRemoteCacheManagerConfig(String login, String password) { ConfigurationBuilder config = getDefaultConfigBuilder(); config.security().authentication() .serverName(TEST_SERVER_NAME) .saslMechanism(getTestedMech()) .callbackHandler(new LoginHandler(login, password, TEST_REALM)) .enable(); return config.build(); }
Source:
public QueryOperation of(T arg) { checkNotNull(arg); return newInstance.apply(arg); }

Target:
public QueryOperation<T> of(T arg) { checkNotNull(arg); return this.newInstance.apply(arg); }
Source:
@Override public Request authenticate(Route route, Response res) throws IOException { List<Challenge> challenges = res.challenges(); for (Challenge challenge : challenges) { if (!"Basic".equalsIgnoreCase(challenge.scheme())) continue; Request req = res.request(); HttpUrl url = req.url(); Proxy proxy = route.proxy(); InetSocketAddress proxyAddr = (InetSocketAddress)proxy.address(); PasswordAuthentication auth = java.net.Authenticator.requestPasswordAuthentication( proxyAddr.getHostName(), proxyAddr.getAddress(), proxyAddr.getPort(), url.scheme(), challenge.realm(), challenge.scheme(), url.url(), java.net.Authenticator.RequestorType.PROXY); if (auth != null) { String cred = Credentials.basic(auth.getUserName(), new String(auth.getPassword()), challenge.charset()); if (latestCredHashCode == cred.hashCode()) { latestCredHashCode = 0; throw new ProxyAuthException("Failed to authenticate with proxy"); } latestCredHashCode = cred.hashCode(); return req.newBuilder() .header("Proxy-Authorization", cred) .build(); } } return null; }

Target:
@Override public Request authenticate(Route route, Response res) throws IOException { List<Challenge> challenges = res.challenges(); for (Challenge challenge : challenges) { if (!"Basic".equalsIgnoreCase(challenge.scheme())) continue; Request req = res.request(); HttpUrl url = req.url(); Proxy proxy = route.proxy(); InetSocketAddress proxyAddr = (InetSocketAddress)proxy.address(); PasswordAuthentication auth = java.net.Authenticator.requestPasswordAuthentication( proxyAddr.getHostName(), proxyAddr.getAddress(), proxyAddr.getPort(), url.scheme(), challenge.realm(), challenge.scheme(), url.url(), PROXY); if (auth != null) { String cred = Credentials.basic(auth.getUserName(), new String(auth.getPassword()), challenge.charset()); if (latestCredHashCode == cred.hashCode()) { latestCredHashCode = 0; throw new ProxyAuthException("Failed to authenticate with proxy"); } latestCredHashCode = cred.hashCode(); return req.newBuilder() .header("Proxy-Authorization", cred) .build(); } } return null; }
Source:
private void createKerberosLdapAAAConfigurations() { List<Properties> results = new ArrayList<>(); for (String domain : Config.<String> getValue(ConfigValues.DomainName).split("[,]", -1)) { Properties authConfig = new Properties(); authConfig.put(ExtensionsManager.CLASS, "org.ovirt.engine.extensions.aaa.builtin.kerberosldap.KerberosLdapAuthenticator"); authConfig.put(ExtensionsManager.PROVIDES, "org.ovirt.engine.core.authentication"); authConfig.put(ExtensionsManager.ENABLED, "true"); authConfig.put(ExtensionsManager.MODULE, "org.ovirt.engine.extensions.builtin"); authConfig.put(ExtensionsManager.NAME, String.format("builtin-authn-%1$s", domain)); authConfig.put("ovirt.engine.aaa.authn.profile.name", domain); authConfig.put("ovirt.engine.aaa.authn.authz.plugin", String.format("builtin-authz-%1$s", domain)); ExtensionsManager.getInstance().load(authConfig); Properties dirConfig = new Properties(); dirConfig.put(ExtensionsManager.CLASS, "org.ovirt.engine.extensions.aaa.builtin.kerberosldap.KerberosLdapDirectory"); dirConfig.put(ExtensionsManager.PROVIDES, "org.ovirt.engine.core.authorization"); dirConfig.put(ExtensionsManager.ENABLED, "true"); dirConfig.put(ExtensionsManager.MODULE, "org.ovirt.engine.extensions.builtin"); dirConfig.put(ExtensionsManager.NAME, String.format("builtin-authz-%1$s", domain)); dirConfig.put("ovirt.engine.aaa.authz.profile.name", domain); ExtensionsManager.getInstance().load(dirConfig); } }

Target:
private void createKerberosLdapAAAConfigurations() { List<Properties> results = new ArrayList<>(); for (String domain : Config.<String> getValue(ConfigValues.DomainName).split("[,]", -1)) { Properties authConfig = new Properties(); authConfig.put(ExtensionsManager.CLASS, "org.ovirt.engine.extensions.aaa.builtin.kerberosldap.KerberosLdapAuthenticator"); authConfig.put(ExtensionsManager.PROVIDES, "org.ovirt.engine.authentication"); authConfig.put(ExtensionsManager.ENABLED, "true"); authConfig.put(ExtensionsManager.MODULE, "org.ovirt.engine.extensions.builtin"); authConfig.put(ExtensionsManager.NAME, String.format("builtin-authn-%1$s", domain)); authConfig.put("ovirt.engine.aaa.authn.profile.name", domain); authConfig.put("ovirt.engine.aaa.authn.authz.plugin", String.format("builtin-authz-%1$s", domain)); ExtensionsManager.getInstance().load(authConfig); Properties dirConfig = new Properties(); dirConfig.put(ExtensionsManager.CLASS, "org.ovirt.engine.extensions.aaa.builtin.kerberosldap.KerberosLdapDirectory"); dirConfig.put(ExtensionsManager.PROVIDES, "org.ovirt.engine.authorization"); dirConfig.put(ExtensionsManager.ENABLED, "true"); dirConfig.put(ExtensionsManager.MODULE, "org.ovirt.engine.extensions.builtin"); dirConfig.put(ExtensionsManager.NAME, String.format("builtin-authz-%1$s", domain)); ExtensionsManager.getInstance().load(dirConfig); } }
Source:
protected void check() { if (enableTimeLimiting()) { double errorMargin = blockingTimeoutErrorMargin(); Preconditions.checkState( errorMargin > 0, "Lock service timeout margin must be strictly positive but found %s", errorMargin); Preconditions.checkState( errorMargin < 1, "Lock service timeout margin must be strictly less than 1 but found %s", errorMargin); } }

Target:
protected void check() { if (enableTimeLimiting()) { double errorMargin = blockingTimeoutErrorMargin(); Preconditions.checkState( errorMargin > 0 && errorMargin < 1, "Lock service timeout margin must be strictly between 0 and 1 but found %s", errorMargin); } }
Source:
public boolean providesLevel(IndexingLevel level) { switch (this) { case NONE: return level == NONE; case FULL: return true; case BOTH: return level == BOTH || level == STATISTICS || level == NOTIFICATIONS || level == NONE; case NOTIFICATIONS: return level == NOTIFICATIONS || level == NONE; case STATISTICS: return level == STATISTICS || level == NONE; default: return false; } }

Target:
public boolean providesLevel(IndexingLevel level) { return this.merge(level) == this; }
Source:
public InspectionReport inspect(@Valid final AgentClientMetadata agentClientMetadata) { final boolean jobSubmissionEnabled = this.environment.getProperty( JobConstants.JOB_SUBMISSION_ENABLED_PROPERTY_KEY, Boolean.class, true ); if (jobSubmissionEnabled) { return new InspectionReport( InspectionReport.Decision.ACCEPT, "Job submission is enabled" ); } else { final String message = environment.getProperty( JobConstants.JOB_SUBMISSION_DISABLED_MESSAGE_KEY, String.class, JobConstants.JOB_SUBMISSION_DISABLED_DEFAULT_MESSAGE ); return new InspectionReport( InspectionReport.Decision.REJECT, message ); } }

Target:
public InspectionReport inspect(@Valid final AgentClientMetadata agentClientMetadata) { final boolean jobSubmissionEnabled = this.environment.getProperty( JobConstants.JOB_SUBMISSION_ENABLED_PROPERTY_KEY, Boolean.class, true ); if (jobSubmissionEnabled) { return new InspectionReport( InspectionReport.Decision.ACCEPT, JOB_SUBMISSION_IS_ENABLED_MESSAGE ); } else { final String message = environment.getProperty( JobConstants.JOB_SUBMISSION_DISABLED_MESSAGE_KEY, String.class, JobConstants.JOB_SUBMISSION_DISABLED_DEFAULT_MESSAGE ); return new InspectionReport( InspectionReport.Decision.REJECT, message ); } }
Source:
public RenderedImage writePNG( RenderedImage image, OutputStream outStream, float quality, WMSMapContent mapContent) { FilterType filterType = getFilterType(mapContent); PNGWriter writer = new PNGWriter(); boolean isScanlineSupported = writer.isScanlineSupported(image); if (!isScanlineSupported) { image = new ImageWorker(image) .rescaleToBytes() .forceComponentColorModel() .getRenderedImage(); } RenderedImage output = null; try { output = writer.writePNG(image, outStream, quality, filterType); } catch (Exception e) { LOGGER.log(Level.FINER, "Failed to encode the PNG", e); throw new ServiceException(e); } return output; }

Target:
public RenderedImage writePNG( RenderedImage image, OutputStream outStream, float quality, WMSMapContent mapContent) { FilterType filterType = getFilterType(mapContent); PNGWriter writer = new PNGWriter(); boolean isScanlineSupported = writer.isScanlineSupported(image); if (!isScanlineSupported) { image = new ImageWorker(image) .rescaleToBytes() .forceComponentColorModel() .getRenderedImage(); } RenderedImage output = null; try { output = writer.writePNG(image, outStream, quality, filterType); } catch (Exception e) { throw new ServiceException("Failed to encode the PNG", e); } return output; }
Source:
private void validateRefs(Item item) { for (Location location : Iterables.concat(Iterables.transform( Iterables.concat(Iterables.transform( item.getVersions(), Version.TO_ENCODINGS) ), Encoding.TO_LOCATIONS))) { Policy policy = location.getPolicy(); if (policy != null) { if (policy.getService() != null) { checkState(serviceResolver.serviceFor(policy.getService()).isPresent(), "Service ID " + policy.getService() + " invalid"); } if (policy.getPlayer() != null) { checkState(playerResolver.playerFor(policy.getPlayer()).isPresent(), "Player ID " + policy.getService() + " invalid"); } } ; } }

Target:
private void validateRefs(Item item) { for (Location location : allLocations(item)) { Policy policy = location.getPolicy(); if (policy != null) { if (policy.getService() != null) { checkState(serviceResolver.serviceFor(policy.getService()).isPresent(), "Service ID " + policy.getService() + " invalid"); } if (policy.getPlayer() != null) { checkState(playerResolver.playerFor(policy.getPlayer()).isPresent(), "Player ID " + policy.getPlayer() + " invalid"); } } ; } }
Source:
public void testRoundTripPOMs() throws Exception { URL resource = PomIOTest.class.getResource( filename ); assertNotNull( resource ); File pom = new File( resource.getFile() ); assertTrue( pom.exists() ); File targetFile = folder.newFile( "target.xml" ); FileUtils.copyFile( pom, targetFile ); List<Project> projects = pomIO.parseProject( targetFile ); FieldUtils.writeDeclaredField( projects.get( 0 ), "executionRoot", false, true); HashSet<Project> changed = new HashSet<>(projects); pomIO.rewritePOMs( changed ); assertTrue( FileUtils.contentEqualsIgnoreEOL( pom, targetFile, StandardCharsets.UTF_8.toString() ) ); assertTrue( FileUtils.contentEquals( targetFile, pom ) ); }

Target:
public void testRoundTripPOMs() throws Exception { URL resource = PomIOTest.class.getResource( filename ); assertNotNull( resource ); File pom = new File( resource.getFile() ); assertTrue( pom.exists() ); File targetFile = folder.newFile( "target.xml" ); FileUtils.copyFile( pom, targetFile ); List<Project> projects = pomIO.parseProject( targetFile ); assertNull( projects.get( 0 ).getModel().getModelEncoding() ); FieldUtils.writeDeclaredField( projects.get( 0 ), "executionRoot", false, true); HashSet<Project> changed = new HashSet<>(projects); pomIO.rewritePOMs( changed ); assertTrue( FileUtils.contentEqualsIgnoreEOL( pom, targetFile, StandardCharsets.UTF_8.toString() ) ); assertTrue( FileUtils.contentEquals( targetFile, pom ) ); }
Source:
public static void deleteDataPolicy( final String dataPolicyName, final Ds3Client client) { if (isEmpty(dataPolicyName)) { LOG.debug("Data policy name is null or empty"); return; } try { final DeleteDataPolicySpectraS3Response deleteDataPolicy = client .deleteDataPolicySpectraS3(new DeleteDataPolicySpectraS3Request(dataPolicyName)); Assert.assertThat(deleteDataPolicy.getStatusCode(), CoreMatchers.is(204)); } catch (final IOException|AssertionError e) { LOG.error("Data policy was not deleted as expected: {}", dataPolicyName); } try { client.getDataPolicySpectraS3(new GetDataPolicySpectraS3Request(dataPolicyName)); LOG.error("Data policy still exists despite deletion attempt: {}", dataPolicyName); } catch (final IOException e) { } }

Target:
public static void deleteDataPolicy( final String dataPolicyName, final Ds3Client client) { if (isEmpty(dataPolicyName)) { LOG.debug("Data policy name is null or empty"); return; } try { final DeleteDataPolicySpectraS3Response deleteDataPolicy = client .deleteDataPolicySpectraS3(new DeleteDataPolicySpectraS3Request(dataPolicyName)); } catch (final IOException|AssertionError e) { LOG.error("Data policy was not deleted as expected: {}", dataPolicyName); } try { client.getDataPolicySpectraS3(new GetDataPolicySpectraS3Request(dataPolicyName)); LOG.error("Data policy still exists despite deletion attempt: {}", dataPolicyName); } catch (final IOException e) { } }
Source:
Consumer<ClientOptionsBuilder> esTracing(Optional<HttpTracing> maybeHttpTracing) { if (!maybeHttpTracing.isPresent()) { return client -> { }; } HttpTracing httpTracing = maybeHttpTracing.get().clientOf("elasticsearch"); SpanCustomizer spanCustomizer = CurrentSpanCustomizer.create(httpTracing.tracing()); return client -> { client.decorator((delegate, ctx, req) -> { RequestLogAccess log = ctx.log(); if (log.isAvailable(RequestLogProperty.NAME)) { String name = log.partial().name(); if (name != null) { spanCustomizer.name(name); } } return delegate.execute(ctx, req); }); client.decorator(BraveClient.newDecorator(httpTracing)); }; }

Target:
Consumer<ClientOptionsBuilder> esTracing(Optional<HttpTracing> maybeHttpTracing) { if (!maybeHttpTracing.isPresent()) { return client -> { }; } HttpTracing httpTracing = maybeHttpTracing.get().clientOf("elasticsearch"); SpanCustomizer spanCustomizer = CurrentSpanCustomizer.create(httpTracing.tracing()); return client -> { client.decorator((delegate, ctx, req) -> { RequestLog log = ctx.log().partial(); if (log.isAvailable(RequestLogProperty.NAME)) { String name = log.name(); if (name != null) { spanCustomizer.name(name); } } return delegate.execute(ctx, req); }); client.decorator(BraveClient.newDecorator(httpTracing)); }; }
Source:
@Test public void setLevelShouldPreventNullValue() { try { applicationInterceptor.setLevel(null); fail(); } catch (NullPointerException expected) { } catch (IllegalArgumentException expected) { } }

Target:
@Test public void setLevelShouldPreventNullValue() { try { applicationInterceptor.setLevel(null); fail(); } catch (NullPointerException expected) { } }
Source:
public boolean onMapClick(@NonNull LatLng mapClickPoint) { mapboxMap.getStyle(new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { double clickLatitude = mapClickPoint.getLatitude(); double clickLongitude = mapClickPoint.getLongitude(); longTextView.setText(String.format(getString(R.string.saved_long_textview), String.valueOf(clickLongitude))); latTextView.setText(String.format(getString(R.string.saved_lat_textview), String.valueOf(clickLatitude))); if (sharedPreferences != null) { putCoordinateToSharedPref(SAVED_LAT_KEY, clickLatitude); putCoordinateToSharedPref(SAVED_LONG_KEY, clickLongitude); } moveMarkerToLngLat(clickLongitude, clickLatitude); } }); return true; }

Target:
public boolean onMapClick(@NonNull LatLng mapClickPoint) { double clickLatitude = mapClickPoint.getLatitude(); double clickLongitude = mapClickPoint.getLongitude(); longTextView.setText(String.format( getString(R.string.saved_long_textview), String.valueOf(clickLongitude))); latTextView.setText(String.format( getString(R.string.saved_lat_textview), String.valueOf(clickLatitude))); if (sharedPreferences != null) { putCoordinateToSharedPref(SAVED_LAT_KEY, clickLatitude); putCoordinateToSharedPref(SAVED_LONG_KEY, clickLongitude); } moveMarkerToLngLat(clickLongitude, clickLatitude); return true; }
Source:
@Override public MortarScope requireChild(Blueprint blueprint) { MortarScope unwrapped = super.requireChild(blueprint); if (unwrapped instanceof RealActivityScope) return unwrapped; RealActivityScope childScope = new RealActivityScope((RealMortarScope) unwrapped, duringOnCreate); replaceChild(blueprint.getMortarScopeName(), childScope); if (loadingState != LoadingState.LOADING) { childScope.onCreate(getChildBundle(childScope, latestSavedInstanceState, false)); } return childScope; }

Target:
@Override public MortarScope requireChild(Blueprint blueprint) { MortarScope unwrapped = super.requireChild(blueprint); if (unwrapped instanceof RealActivityScope) return unwrapped; RealActivityScope childScope = new RealActivityScope((RealMortarScope) unwrapped, loadingFromOnCreate); replaceChild(blueprint.getMortarScopeName(), childScope); if (loadingState != LoadingState.LOADING) { childScope.onCreate(getChildBundle(childScope, latestSavedInstanceState, false)); } return childScope; }
Source:
protected void executeVmCommand() { addCustomValue("InterfaceType", (VmInterfaceType.forValue(getInterface().getType()).getDescription()).toString()); boolean succeeded = false; boolean macAddedToPool = false; try { if (isVnicProfileChanged(oldIface, getInterface())) { Network newNetwork = NetworkHelper.getNetworkByVnicProfileId(getInterface().getVnicProfileId()); Network oldNetwork = NetworkHelper.getNetworkByVnicProfileId(oldIface.getVnicProfileId()); if (ObjectUtils.notEqual(oldNetwork, newNetwork)) { ExternalNetworkManager externalNetworkManager = new ExternalNetworkManager(oldIface); externalNetworkManager.deallocateIfExternal(); } } if (macShouldBeChanged) { macAddedToPool = addMacToPool(getMacAddress()); } getInterface().setSpeed(VmInterfaceType.forValue(getInterface().getType()).getSpeed()); TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { getCompensationContext().snapshotEntity(oldIface); getVmNicDao().update(getInterface()); getCompensationContext().stateChanged(); return null; } }); succeeded = updateHost(); } finally { setSucceeded(succeeded); if (macAddedToPool) { if (succeeded) { MacPoolManager.getInstance().freeMac(oldIface.getMacAddress()); } else { MacPoolManager.getInstance().freeMac(getMacAddress()); } } } }

Target:
protected void executeVmCommand() { addCustomValue("InterfaceType", (VmInterfaceType.forValue(getInterface().getType()).getDescription()).toString()); boolean succeeded = false; boolean macAddedToPool = false; try { if (isVnicProfileChanged(oldIface, getInterface())) { Network newNetwork = NetworkHelper.getNetworkByVnicProfileId(getInterface().getVnicProfileId()); Network oldNetwork = NetworkHelper.getNetworkByVnicProfileId(oldIface.getVnicProfileId()); if (ObjectUtils.notEqual(oldNetwork, newNetwork)) { new ExternalNetworkManager(oldIface).deallocateIfExternal(); } } if (macShouldBeChanged) { macAddedToPool = addMacToPool(getMacAddress()); } getInterface().setSpeed(VmInterfaceType.forValue(getInterface().getType()).getSpeed()); TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { getCompensationContext().snapshotEntity(oldIface); getVmNicDao().update(getInterface()); getCompensationContext().stateChanged(); return null; } }); succeeded = updateHost(); } finally { setSucceeded(succeeded); if (macAddedToPool) { if (succeeded) { MacPoolManager.getInstance().freeMac(oldIface.getMacAddress()); } else { MacPoolManager.getInstance().freeMac(getMacAddress()); } } } }
Source:
public void setOptionMap(OptionMap optionMap) { }

Target:
public void setOptionMap(OptionMap optionMap) { this.optionMap = optionMap; }
Source:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.embed_pcode_layout); embedCodeEditText = (EditText) findViewById(R.id.embed_edit_text); pCodeEditText = (EditText) findViewById(R.id.pcode_edit_text); apiKeyEditText = (EditText) findViewById(R.id.apikey_edit_text); secretEditText = (EditText) findViewById(R.id.secret_edit_text); accountIdEditText = (EditText) findViewById(R.id.accountid_edit_text); autoPlayCheckBox = (CheckBox) findViewById(R.id.auto_play_check_box); initButtonListeners(); }

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.embed_pcode_layout); embedCodeEditText = findViewById(R.id.embed_edit_text); pCodeEditText = findViewById(R.id.pcode_edit_text); apiKeyEditText = findViewById(R.id.apikey_edit_text); secretEditText = findViewById(R.id.secret_edit_text); accountIdEditText = findViewById(R.id.accountid_edit_text); autoPlayCheckBox = findViewById(R.id.auto_play_check_box); initButtonListeners(); }
Source:
private synchronized void markIndexBuilt(Index index, boolean isFullRebuild) { String indexName = index.getIndexMetadata().name; if (isFullRebuild && index.supportsLoad(Index.LoadType.READ)) { queryableIndexes.add(indexName); logger.info("Index [" + indexName + "] became queryable."); } if (isFullRebuild && index.supportsLoad(Index.LoadType.WRITE)) { writableIndexes.add(indexName); logger.info("Index [" + indexName + "] became writable."); } AtomicInteger counter = inProgressBuilds.get(indexName); if (counter != null) { assert counter.get() > 0; if (counter.decrementAndGet() == 0) { inProgressBuilds.remove(indexName); if (!needsFullRebuild.contains(indexName) && DatabaseDescriptor.isDaemonInitialized()) SystemKeyspace.setIndexBuilt(baseCfs.keyspace.getName(), indexName); } } }

Target:
private synchronized void markIndexBuilt(Index index, boolean isFullRebuild) { String indexName = index.getIndexMetadata().name; if (isFullRebuild) { if (queryableIndexes.add(indexName)) logger.info("Index became queryable after successful build.", indexName); if (writableIndexes.put(indexName, index) == null) logger.info("Index became writable after successful build.", indexName); } AtomicInteger counter = inProgressBuilds.get(indexName); if (counter != null) { assert counter.get() > 0; if (counter.decrementAndGet() == 0) { inProgressBuilds.remove(indexName); if (!needsFullRebuild.contains(indexName) && DatabaseDescriptor.isDaemonInitialized()) SystemKeyspace.setIndexBuilt(baseCfs.keyspace.getName(), indexName); } } }
Source:
public void initialize(QueryState queryState, QueryPlan queryPlan, DriverContext ctx, CompilationOpContext opContext) { super.initialize(queryState, queryPlan, ctx, opContext); work.initializeForFetch(opContext); try { JobConf job = new JobConf(conf); Operator<?> source = work.getSource(); if (source instanceof TableScanOperator) { TableScanOperator ts = (TableScanOperator) source; ColumnProjectionUtils.appendReadColumns( job, ts.getNeededColumnIDs(), ts.getNeededColumns(), ts.getNeededGroupPaths()); HiveInputFormat.pushFilters(job, ts); AcidUtils.setTransactionalTableScan(job, ts.getConf().isAcidTable()); AcidUtils.setAcidOperationalProperties(job, ts.getConf().getAcidOperationalProperties()); } sink = work.getSink(); fetch = new FetchOperator(work, job, source, getVirtualColumns(source)); source.initialize(conf, new ObjectInspector[]{fetch.getOutputObjectInspector()}); totalRows = 0; ExecMapper.setDone(false); } catch (Exception e) { LOG.error(StringUtils.stringifyException(e)); throw new RuntimeException(e); } }

Target:
public void initialize(QueryState queryState, QueryPlan queryPlan, DriverContext ctx, CompilationOpContext opContext) { super.initialize(queryState, queryPlan, ctx, opContext); work.initializeForFetch(opContext); try { JobConf job = new JobConf(conf); Operator<?> source = work.getSource(); if (source instanceof TableScanOperator) { TableScanOperator ts = (TableScanOperator) source; ColumnProjectionUtils.appendReadColumns( job, ts.getNeededColumnIDs(), ts.getNeededColumns(), ts.getNeededNestedColumnPaths()); HiveInputFormat.pushFilters(job, ts); AcidUtils.setTransactionalTableScan(job, ts.getConf().isAcidTable()); AcidUtils.setAcidOperationalProperties(job, ts.getConf().getAcidOperationalProperties()); } sink = work.getSink(); fetch = new FetchOperator(work, job, source, getVirtualColumns(source)); source.initialize(conf, new ObjectInspector[]{fetch.getOutputObjectInspector()}); totalRows = 0; ExecMapper.setDone(false); } catch (Exception e) { LOG.error(StringUtils.stringifyException(e)); throw new RuntimeException(e); } }