auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
@Override public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) { double rowCount = mq.getRowCount(this); if (!isNonCorrelatedSemiJoin()) { switch (joinType) { case RIGHT: rowCount = RelMdUtil.addEpsilon(rowCount); break; default: if (RelNodes.COMPARATOR.compare(left, right) > 0) { rowCount = RelMdUtil.addEpsilon(rowCount); } } } final double rightRowCount = right.estimateRowCount(mq); final double leftRowCount = left.estimateRowCount(mq); if (Double.isInfinite(leftRowCount)) { rowCount = leftRowCount; } else { rowCount += Util.nLogN(leftRowCount); } if (Double.isInfinite(rightRowCount)) { rowCount = rightRowCount; } else { rowCount += rightRowCount; } if (isNonCorrelatedSemiJoin()) { return planner.getCostFactory().makeCost(rowCount, 0, 0).multiplyBy(.01d); } else { return planner.getCostFactory().makeCost(rowCount, 0, 0); } }

Target:
@Override public RelOptCost computeSelfCost(RelOptPlanner planner, RelMetadataQuery mq) { double rowCount = mq.getRowCount(this); if (!isSemiJoin()) { switch (joinType) { case RIGHT: rowCount = RelMdUtil.addEpsilon(rowCount); break; default: if (RelNodes.COMPARATOR.compare(left, right) > 0) { rowCount = RelMdUtil.addEpsilon(rowCount); } } } final double rightRowCount = right.estimateRowCount(mq); final double leftRowCount = left.estimateRowCount(mq); if (Double.isInfinite(leftRowCount)) { rowCount = leftRowCount; } else { rowCount += Util.nLogN(leftRowCount); } if (Double.isInfinite(rightRowCount)) { rowCount = rightRowCount; } else { rowCount += rightRowCount; } if (isSemiJoin()) { return planner.getCostFactory().makeCost(rowCount, 0, 0).multiplyBy(.01d); } else { return planner.getCostFactory().makeCost(rowCount, 0, 0); } }
Source:
public static String getHasConditionsFromRequest(HttpServletRequest request) throws IOException { String ret = null; if (request.getParameter(FEATUREMAPHASH_REQPARAM) != null) { Cookie[] cookies = request.getCookies(); if (cookies != null) { for (int i = 0; ret == null && i < cookies.length; i++) { Cookie cookie = cookies[i]; if (cookie.getName().equals(FEATUREMAP_REQPARAM) && cookie.getValue() != null) { ret = URLDecoder.decode(cookie.getValue(), "US-ASCII"); break; } } } if (ret == null) { if (log.isLoggable(Level.WARNING)) { StringBuffer url = request.getRequestURL(); if (url != null) { url.append("?").append(request.getQueryString()).toString(); log.warning(MessageFormat.format( Messages.AbstractHttpTransport_0, new Object[]{url, request.getHeader("User-Agent")})); } } } } else ret = request.getParameter(FEATUREMAP_REQPARAM); return ret; }

Target:
protected static String getHasConditionsFromRequest(HttpServletRequest request) throws IOException { String ret = null; if (request.getParameter(FEATUREMAPHASH_REQPARAM) != null) { Cookie[] cookies = request.getCookies(); if (cookies != null) { for (int i = 0; ret == null && i < cookies.length; i++) { Cookie cookie = cookies[i]; if (cookie.getName().equals(FEATUREMAP_REQPARAM) && cookie.getValue() != null) { ret = URLDecoder.decode(cookie.getValue(), "US-ASCII"); break; } } } if (ret == null) { if (log.isLoggable(Level.WARNING)) { StringBuffer url = request.getRequestURL(); if (url != null) { url.append("?").append(request.getQueryString()).toString(); log.warning(MessageFormat.format( Messages.AbstractHttpTransport_0, new Object[]{url, request.getHeader("User-Agent")})); } } } } else ret = request.getParameter(FEATUREMAP_REQPARAM); return ret; }
Source:
public SavedHttpAttachment(String name, Map<String,Object> attachmentData, URI attachmentURI) throws IOException { super(name, (String)attachmentData.get("content_type"), Attachment.getEncodingFromString((String)attachmentData.get("encoding"))); Number length; String data = (String)attachmentData.get("data"); if(data != null){ byte[] dataArray = data.getBytes(); InputStream is = Base64InputStreamFactory.get(new ByteArrayInputStream(dataArray)); this.data = IOUtils.toByteArray(is); length = this.data.length; } else { length = (Number)attachmentData.get("length"); } this.attachmentURI = attachmentURI; this.size = length.intValue(); }

Target:
public SavedHttpAttachment(String name, Map<String,Object> attachmentData, URI attachmentURI) throws IOException { super(name, (String)attachmentData.get("content_type"), Attachment.getEncodingFromString((String)attachmentData.get("encoding"))); Number length; String data = (String)attachmentData.get("data"); if(data != null){ byte[] dataArray = data.getBytes(); InputStream is = Base64InputStreamFactory.get(new ByteArrayInputStream(dataArray)); this.data = IOUtils.toByteArray(is); length = this.data.length; } else { length = (Number)attachmentData.get("length"); } this.attachmentURI = attachmentURI; this.size = length.longValue(); }
Source:
public void deregisterStatsSourcesFor(StatsSelector selector, long siteId) { assert selector != null; final NonBlockingHashMap<Long, NonBlockingHashSet<StatsSource>> siteIdToStatsSources = registeredStatsSources.get(selector); assert siteIdToStatsSources != null; NonBlockingHashSet<StatsSource> statsSources = siteIdToStatsSources.get(siteId); if (statsSources != null) { siteIdToStatsSources.remove(siteId); } }

Target:
public void deregisterStatsSourcesFor(StatsSelector selector, long siteId) { assert selector != null; final NonBlockingHashMap<Long, NonBlockingHashSet<StatsSource>> siteIdToStatsSources = registeredStatsSources.get(selector); if (siteIdToStatsSources != null) { siteIdToStatsSources.remove(siteId); } }
Source:
public long getTimeoutMonitorIntervalSec() { return getLong(TIMEOUT_MONITOR_INTERVAL_SEC, Math.max(Math.min(getAddEntryTimeout(), getReadEntryTimeout()) / 2, 1)); }

Target:
public long getTimeoutMonitorIntervalSec() { int minTimeout = Math.min(Math.min(getAddEntryQuorumTimeout(), getAddEntryTimeout()), getReadEntryTimeout()); return getLong(TIMEOUT_MONITOR_INTERVAL_SEC, Math.max(minTimeout / 2, 1)); }
Source:
public ParquetMetadataConverter(Configuration conf) { this.useSignedStringMinMax = conf.getBoolean("parquet.strings.use-signed-order", false); }

Target:
public ParquetMetadataConverter(Configuration conf) { this(conf.getBoolean("parquet.strings.signed-min-max.enabled", false)); }
Source:
public AudioPlayerWithEvents(IPlayer player, Context context) { this.player = player; this.duckable = ClassUtils.getIfAvailable(player, IDuckable.class); this.context = context; this.externalControlClient = new SoundStreamExternalControlClient(this.context); hasFocus = false; }

Target:
public AudioPlayerWithEvents(IPlayer player, Context context) { this.player = player; this.duckable = ClassUtils.getIfAvailable(player, IDuckable.class); this.context = context; this.externalControlClient = new SoundStreamExternalControlClient(this.context); this.registered = false; hasFocus = false; }
Source:
private void changeType(int type) { mMppe.setVisibility(View.GONE); mView.findViewById(R.id.l2tp).setVisibility(View.GONE); mView.findViewById(R.id.ipsec_psk).setVisibility(View.GONE); mView.findViewById(R.id.ipsec_user).setVisibility(View.GONE); mView.findViewById(R.id.ipsec_peer).setVisibility(View.GONE); mView.findViewById(R.id.identifier).setVisibility(View.GONE); setUsernamePasswordVisibility(type); if (!isLegacyType(type)) { mView.findViewById(R.id.identifier).setVisibility(View.VISIBLE); } switch (type) { case VpnProfile.TYPE_PPTP: mMppe.setVisibility(View.VISIBLE); break; case VpnProfile.TYPE_L2TP_IPSEC_PSK: mView.findViewById(R.id.l2tp).setVisibility(View.VISIBLE); case VpnProfile.TYPE_IKEV2_IPSEC_PSK: case VpnProfile.TYPE_IPSEC_XAUTH_PSK: mView.findViewById(R.id.ipsec_psk).setVisibility(View.VISIBLE); mView.findViewById(R.id.identifier).setVisibility(View.VISIBLE); break; case VpnProfile.TYPE_L2TP_IPSEC_RSA: mView.findViewById(R.id.l2tp).setVisibility(View.VISIBLE); case VpnProfile.TYPE_IKEV2_IPSEC_RSA: case VpnProfile.TYPE_IPSEC_XAUTH_RSA: mView.findViewById(R.id.ipsec_user).setVisibility(View.VISIBLE); case VpnProfile.TYPE_IKEV2_IPSEC_USER_PASS: case VpnProfile.TYPE_IPSEC_HYBRID_RSA: mView.findViewById(R.id.ipsec_peer).setVisibility(View.VISIBLE); break; } configureAdvancedOptionsVisibility(); }

Target:
private void changeType(int type) { mMppe.setVisibility(View.GONE); mView.findViewById(R.id.l2tp).setVisibility(View.GONE); mView.findViewById(R.id.ipsec_psk).setVisibility(View.GONE); mView.findViewById(R.id.ipsec_user).setVisibility(View.GONE); mView.findViewById(R.id.ipsec_peer).setVisibility(View.GONE); mView.findViewById(R.id.options_ipsec_identity).setVisibility(View.GONE); setUsernamePasswordVisibility(type); if (!isLegacyType(type)) { mView.findViewById(R.id.options_ipsec_identity).setVisibility(View.VISIBLE); } switch (type) { case VpnProfile.TYPE_PPTP: mMppe.setVisibility(View.VISIBLE); break; case VpnProfile.TYPE_L2TP_IPSEC_PSK: mView.findViewById(R.id.l2tp).setVisibility(View.VISIBLE); case VpnProfile.TYPE_IKEV2_IPSEC_PSK: case VpnProfile.TYPE_IPSEC_XAUTH_PSK: mView.findViewById(R.id.ipsec_psk).setVisibility(View.VISIBLE); mView.findViewById(R.id.options_ipsec_identity).setVisibility(View.VISIBLE); break; case VpnProfile.TYPE_L2TP_IPSEC_RSA: mView.findViewById(R.id.l2tp).setVisibility(View.VISIBLE); case VpnProfile.TYPE_IKEV2_IPSEC_RSA: case VpnProfile.TYPE_IPSEC_XAUTH_RSA: mView.findViewById(R.id.ipsec_user).setVisibility(View.VISIBLE); case VpnProfile.TYPE_IKEV2_IPSEC_USER_PASS: case VpnProfile.TYPE_IPSEC_HYBRID_RSA: mView.findViewById(R.id.ipsec_peer).setVisibility(View.VISIBLE); break; } configureAdvancedOptionsVisibility(); }
Source:
public void added(Entity member) { synchronized (mutex) { Optional<Location> location = Iterables.tryFind(member.getLocations(), Predicates.instanceOf(SshMachineLocation.class)); String hostname = member.getAttribute(getConfig(HOSTNAME_SENSOR)); if (location.isPresent() && Strings.isNonBlank(hostname)) { SshMachineLocation machine = (SshMachineLocation) location.get(); String address = machine.getAddress().getHostAddress(); if (!entityLocations.containsKey(machine)) { entityLocations.put(machine, member); addressMappings.putIfAbsent(address, hostname); if (getAttribute(Startable.SERVICE_UP)) { update(); } configure(machine); LOG.info("{} added at location with name {}", new Object[] { member, machine, hostname }); } } else { LOG.warn("added({}) called but entity not ready", member); } } }

Target:
public void added(Entity member) { synchronized (mutex) { Optional<Location> location = Iterables.tryFind(member.getLocations(), Predicates.instanceOf(SshMachineLocation.class)); String hostname = member.getAttribute(getConfig(HOSTNAME_SENSOR)); if (location.isPresent() && Strings.isNonBlank(hostname)) { SshMachineLocation machine = (SshMachineLocation) location.get(); String address = machine.getAddress().getHostAddress(); if (!entityLocations.containsKey(machine)) { entityLocations.put(machine, member); addressMappings.putIfAbsent(address, hostname); if (getReverseLookupNetwork().contains(new Cidr(address + "/32"))) { String octet = Iterables.get(Splitter.on('.').split(address), 3); reverseMappings.putIfAbsent(hostname, octet); } if (getAttribute(Startable.SERVICE_UP)) { update(); } configure(machine); LOG.info("{} added at location with name {}", new Object[] { member, machine, hostname }); } } } }
Source:
public void testGetResourceBundleNotFound() { when( this.localizationService.getResourceBundle( anyString(), anyString() ) ).thenReturn( null ); Response response = this.endpoint.getResourceBundle( "", "" ); assertNotNull( response ); Status actualStatus = Status.fromStatusCode( response.getStatus() ); assertEquals( Status.NOT_FOUND, actualStatus ); }

Target:
public void testGetResourceBundleNotFound() { when( this.localizationService.getResourceBundle( anyString(), anyString() ) ).thenReturn( null ); Response response = this.endpoint.getResourceBundle( "", "" ); Status actualStatus = Status.fromStatusCode( response.getStatus() ); assertEquals( Status.NOT_FOUND, actualStatus ); }
Source:
public RoleBasedProjectNamingStrategy(boolean forceExistingJobs) { this.forceExistingJobs = forceExistingJobs; Jenkins.getInstance().setProjectNamingStrategy(this); }

Target:
public RoleBasedProjectNamingStrategy(boolean forceExistingJobs) { this.forceExistingJobs = forceExistingJobs; }
Source:
public GetConfigurationObjectResponse(final ConfigurationObject configurationObject) { super(); this.configurationObject = configurationObject; }

Target:
public GetConfigurationObjectResponse(final ConfigurationObject configurationObject) { this.configurationObject = configurationObject; }
Source:
public void halt() throws InterruptedException { for (;;) { join(250 ); if (isAlive()) { done = true; interrupt(); process.destroy(); } else break; } }

Target:
public void halt() throws InterruptedException { for (;;) { join(250 ); if (isAlive()) { done = true; interrupt(); if (process != null) { process.destroy(); } } else break; } }
Source:
public Set<Map.Entry<String, JsonNode>> fields() { return Collections.emptySet(); }

Target:
public Iterator<Map.Entry<String, JsonNode>> fields() { return ClassUtil.emptyIterator(); }
Source:
protected IStructuredSelection getSelection(ReflogView view) { ISelection pageSelection = view.getSelectionProvider().getSelection(); if (pageSelection instanceof IStructuredSelection) { return (IStructuredSelection) pageSelection; } else return new StructuredSelection(); }

Target:
protected IStructuredSelection getSelection(ReflogView view) { ISelection pageSelection = view.getSelectionProvider().getSelection(); if (pageSelection instanceof IStructuredSelection) return (IStructuredSelection) pageSelection; else return new StructuredSelection(); }
Source:
public String getLevel(String loggerName) { java.util.logging.Logger logger = getLogger(loggerName); return getEffectiveLevel(logger).toString(); }

Target:
public String getLevel(String loggerName) { return logging.getLevel(loggerName).toString(); }
Source:
public void return_minimal_user_info() { db.users().insertUser(user -> user .setLogin("obiwan.kenobi") .setName("Obiwan Kenobi") .setEmail(null) .setLocal(true) .setExternalIdentity("obiwan") .setExternalIdentityProvider("sonarqube") .setScmAccounts((String) null)); userSessionRule.logIn("obiwan.kenobi"); CurrentWsResponse response = call(); assertThat(response) .extracting(CurrentWsResponse::getIsLoggedIn, CurrentWsResponse::getLogin, CurrentWsResponse::getName, CurrentWsResponse::getAvatar, CurrentWsResponse::getLocal, CurrentWsResponse::getExternalIdentity, CurrentWsResponse::getExternalProvider) .containsExactly(true, "obiwan.kenobi", "Obiwan Kenobi", "", true, "obiwan", "sonarqube"); assertThat(response.hasEmail()).isFalse(); assertThat(response.getScmAccountsList()).isEmpty(); assertThat(response.getGroupsList()).isEmpty(); assertThat(response.getPermissions().getGlobalList()).isEmpty(); }

Target:
public void return_minimal_user_info() { db.users().insertUser(user -> user .setLogin("obiwan.kenobi") .setName("Obiwan Kenobi") .setEmail(null) .setLocal(true) .setExternalIdentity("obiwan") .setExternalIdentityProvider("sonarqube") .setScmAccounts((String) null)); userSessionRule.logIn("obiwan.kenobi"); CurrentWsResponse response = call(); assertThat(response) .extracting(CurrentWsResponse::getIsLoggedIn, CurrentWsResponse::getLogin, CurrentWsResponse::getName, CurrentWsResponse::hasAvatar, CurrentWsResponse::getLocal, CurrentWsResponse::getExternalIdentity, CurrentWsResponse::getExternalProvider) .containsExactly(true, "obiwan.kenobi", "Obiwan Kenobi", false, true, "obiwan", "sonarqube"); assertThat(response.hasEmail()).isFalse(); assertThat(response.getScmAccountsList()).isEmpty(); assertThat(response.getGroupsList()).isEmpty(); assertThat(response.getPermissions().getGlobalList()).isEmpty(); }
Source:
public byte[] toBytes(Object object) { if (object == null) { return ByteUtil.EMPTY_BYTE_ARRAY; } PhoenixJson phoenixJson = (PhoenixJson) object; return PVarchar.INSTANCE.toBytes(phoenixJson.toString()); }

Target:
public byte[] toBytes(Object object) { if (object == null) { return ByteUtil.EMPTY_BYTE_ARRAY; } PhoenixJson phoenixJson = (PhoenixJson) object; return phoenixJson.toBytes(); }
Source:
private synchronized void enqueueMissingShards() { try { for (ShardMetadata shard : getMissingShards()) { stats.incrementBackgroundShardRecovery(); Futures.addCallback( shardQueue.submit(new MissingShard(shard.getShardUuid(), shard.getCompressedSize(), shard.getXxhash64(), false)), failureCallback(t -> log.warn(t, "Error recovering shard: %s", shard.getShardUuid())), directExecutor()); } } catch (Throwable t) { log.error(t, "Error creating shard recovery tasks"); } }

Target:
private synchronized void enqueueMissingShards() { try { for (ShardMetadata shard : getMissingShards()) { stats.incrementBackgroundShardRecovery(); ListenableFuture<?> future = shardQueue.submit(new MissingShard(shard.getShardUuid(), shard.getCompressedSize(), shard.getXxhash64(), false)); addExceptionCallback(future, t -> log.warn(t, "Error recovering shard: %s", shard.getShardUuid())); } } catch (Throwable t) { log.error(t, "Error creating shard recovery tasks"); } }
Source:
public Observable<DeleteResult> createObservable() { try { throwExceptionIfRxJavaIsNotAvailable("createObservable()"); return Observable .create(OnSubscribeExecuteAsBlocking.newInstance(this)) .subscribeOn(Schedulers.io()); } catch (Throwable throwable) { throw new StorIOException(throwable); } }

Target:
public Observable<DeleteResult> createObservable() { throwExceptionIfRxJavaIsNotAvailable("createObservable()"); return Observable .create(OnSubscribeExecuteAsBlocking.newInstance(this)) .subscribeOn(Schedulers.io()); }
Source:
public void clusteredCacheManagerExample() throws Exception { final CacheManagerBuilder<PersistentCacheManager> clusteredCacheManagerBuilder = CacheManagerBuilder.newCacheManagerBuilder() .with(ClusteringServiceConfigurationBuilder.cluster(URI.create("<LINK_0>")).build()) .withCache("simple-cache", CacheConfigurationBuilder.newCacheConfigurationBuilder(Long.class, String.class) .withResourcePools(ResourcePoolsBuilder.newResourcePoolsBuilder() .heap(10, EntryUnit.ENTRIES)) .build()); final PersistentCacheManager cacheManager = clusteredCacheManagerBuilder.build(true); cacheManager.close(); }

Target:
public void clusteredCacheManagerExample() throws Exception { final CacheManagerBuilder<PersistentCacheManager> clusteredCacheManagerBuilder = CacheManagerBuilder.newCacheManagerBuilder() .with(ClusteringServiceConfigurationBuilder.cluster(URI.create("<LINK_0>"))) .withCache("simple-cache", CacheConfigurationBuilder.newCacheConfigurationBuilder(Long.class, String.class) .withResourcePools(ResourcePoolsBuilder.newResourcePoolsBuilder() .heap(10, EntryUnit.ENTRIES))); final PersistentCacheManager cacheManager = clusteredCacheManagerBuilder.build(true); cacheManager.close(); }
Source:
public void doGet(final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException { String resourceName = request.getPathInfo().replaceFirst("^\\/", ""); String resourceFilePath = brandingManager.getCascadedResource(resourceName); ServletUtils.sendFile(request, response, BrandingUtils.getFile(brandingManager.getBrandingRootPath(), resourceFilePath), null); }

Target:
public void doGet(final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException { String resourceName = request.getPathInfo().replaceFirst("^\\/", ""); CascadingResource resource = brandingManager.getCascadingResource(resourceName); if (resource == null) { response.sendError(HttpServletResponse.SC_NOT_FOUND); } else { ServletUtils.sendFile(request, response, resource.getFile(), resource.getContentType()); } }
Source:
private static String indent(final int depth) { String curIndent = new String(); if (depth <= 0) { return null; } for (int i = 0; i < depth; i++) { curIndent += indent; } return curIndent; }

Target:
private static String indent(final int depth) { StringBuilder stringBuilder = new StringBuilder(); if (depth <= 0) { return null; } for (int i = 0; i < depth; i++) { stringBuilder.append(indent); } return stringBuilder.toString(); }
Source:
public BuildPlan getPlanById(List<IBuildPlan> plans, String id) { if (plans != null && id != null) { for (IBuildPlan plan : plans) { if (id.equals(plan.getId())) { return (BuildPlan) plan; } BuildPlan maybePlan = getPlanById(plan.getChildren(), id); if (maybePlan != null) { return maybePlan; } } } return null; }

Target:
public BuildPlan getPlanById(List<IBuildPlan> plans, String id) { if (plans != null && id != null) { for (IBuildPlan plan : plans) { for (IBuildPlan planOrChild : plan.getPlanAndAllChildren()) { if (id.equals(planOrChild.getId())) { return (BuildPlan) planOrChild; } } } } return null; }
Source:
public boolean applyEffectBlock(ItemStack stack, World world, BlockPos pos, EnumFacing facing, double impactX, double impactY, double impactZ, EntityLivingBase caster) { switch (facing){ case EAST: pos = pos.east(); break; case NORTH: pos = pos.north(); break; case SOUTH: pos = pos.south(); break; case WEST: pos = pos.west(); break; } Block block = world.getBlockState(pos).getBlock(); if (world.isAirBlock(pos) || block == Blocks.snow || block instanceof BlockFlower){ if (!world.isRemote) world.setBlockState(pos, Blocks.fire.getDefaultState()); return true; }else{ pos = pos.up(); block = world.getBlockState(pos).getBlock(); if (world.isAirBlock(pos) || block == Blocks.snow || block instanceof BlockFlower){ if (!world.isRemote) world.setBlockState(pos, Blocks.fire.getDefaultState()); return true; } } return false; }

Target:
public boolean applyEffectBlock(ItemStack stack, World world, BlockPos pos, EnumFacing facing, double impactX, double impactY, double impactZ, EntityLivingBase caster) { pos = pos.offset(facing); Block block = world.getBlockState(pos).getBlock(); if (world.isAirBlock(pos) || block == Blocks.snow || block instanceof BlockFlower){ if (!world.isRemote) world.setBlockState(pos, Blocks.fire.getDefaultState()); return true; }else{ pos = pos.up(); block = world.getBlockState(pos).getBlock(); if (world.isAirBlock(pos) || block == Blocks.snow || block instanceof BlockFlower){ if (!world.isRemote) world.setBlockState(pos, Blocks.fire.getDefaultState()); return true; } } return false; }
Source:
boolean exists(String name) { for (V data : getDataList()) { if (getDataName(data).equals(name)) { return true; } } return false; }

Target:
boolean exists(String name) { return find(name) != null; }
Source:
private void prepareAuthForBrokerCall() throws NoSuchAlgorithmException { AuthenticationSettings.INSTANCE.setUseBroker(true); }

Target:
private void prepareAuthForBrokerCall() { AuthenticationSettings.INSTANCE.setUseBroker(true); }
Source:
public VSizeIndexedIntsWriter( final IOPeon ioPeon, final String filenameBase, final int maxValue ) { this.ioPeon = ioPeon; this.filenameBase = filenameBase; this.numBytes = VSizeIndexedInts.getNumBytesForMax(maxValue); }

Target:
public VSizeIndexedIntsWriter( final IOPeon ioPeon, final String filenameBase, final int maxValue ) { this.ioPeon = ioPeon; this.valueFileName = String.format("%s.values", filenameBase); this.numBytes = VSizeIndexedInts.getNumBytesForMax(maxValue); }
Source:
public void testSetHeader() throws Exception { int port = AvailablePortFinder.getNextAvailable(1025); HttpHeaderServer server = new HttpHeaderServer(port); server.start(); RuntimeEngine runtimeEngine = RemoteRuntimeEngineFactory.newRestBuilder() .addPassword("user").addUserName("pass") .addDeploymentId("deploymentId") .addUrl(new URL("http://localhost:" + port + "/" )) .build(); ProcessInstance procInst = runtimeEngine.getKieSession().startProcess("test"); assertNotNull( "Test server is not working..", procInst ); assertTrue( "No header, so no event types should be in the returned process instance!", procInst.getEventTypes() == null || procInst.getEventTypes().length == 0 ); String headerValueOne = String.valueOf(random.nextLong()); String headerValueTwo = String.valueOf(random.nextLong()); runtimeEngine = RemoteRuntimeEngineFactory.newRestBuilder() .addPassword("user").addUserName("pass") .addDeploymentId("deploymentId") .addUrl(new URL("http://localhost:" + port + "/" )) .addHeader(NOT_SENT_HEADER_NAME, String.valueOf(random.nextLong())) .clearHeaderFields() .addHeader(TEST_HEADER_NAME, headerValueOne) .addHeader(ANOTHER_TEST_HEADER_NAME, headerValueTwo) .build(); procInst = runtimeEngine.getKieSession().startProcess("test"); assertNotNull( "Test server is not working..", procInst ); assertEquals( "Number of event types (corresponds to test headers in request)", 2, procInst.getEventTypes().length ); for( String headerValue : procInst.getEventTypes() ) { assertTrue( "Unexpected header value: " + headerValue, headerValue.equals(headerValueOne) || headerValue.equals(headerValueTwo)); } }

Target:
public void testSetHeader() throws Exception { RuntimeEngine runtimeEngine = RemoteRuntimeEngineFactory.newRestBuilder() .addPassword("user").addUserName("pass") .addDeploymentId("deploymentId") .addUrl(new URL("http://localhost:" + port + "/" )) .build(); ProcessInstance procInst = runtimeEngine.getKieSession().startProcess("test"); assertNotNull( "Test server is not working..", procInst ); assertTrue( "No header, so no event types should be in the returned process instance!", procInst.getEventTypes() == null || procInst.getEventTypes().length == 0 ); String headerValueOne = String.valueOf(random.nextLong()); String headerValueTwo = String.valueOf(random.nextLong()); runtimeEngine = RemoteRuntimeEngineFactory.newRestBuilder() .addPassword("user").addUserName("pass") .addDeploymentId("deploymentId") .addUrl(new URL("http://localhost:" + port + "/" )) .addHeader(NOT_SENT_HEADER_NAME, String.valueOf(random.nextLong())) .clearHeaderFields() .addHeader(TEST_HEADER_NAME, headerValueOne) .addHeader(ANOTHER_TEST_HEADER_NAME, headerValueTwo) .build(); procInst = runtimeEngine.getKieSession().startProcess("test"); assertNotNull( "Test server is not working..", procInst ); assertEquals( "Number of event types (corresponds to test headers in request)", 2, procInst.getEventTypes().length ); for( String headerValue : procInst.getEventTypes() ) { assertTrue( "Unexpected header value: " + headerValue, headerValue.equals(headerValueOne) || headerValue.equals(headerValueTwo)); } }
Source:
boolean taskIsCaughtUpOnClient(final TaskId task, final ID client) { boolean hasNoCaughtUpClients = true; final SortedSet<RankedClient<ID>> rankedClients = statefulTasksToRankedCandidates.get(task); if (rankedClients == null) { return true; } for (final RankedClient rankedClient : rankedClients) { if (rankedClient.rank() <= 0L) { if (rankedClient.clientId().equals(client)) { return true; } else { hasNoCaughtUpClients = false; } } if (rankedClient.rank() > 0L) { break; } } return hasNoCaughtUpClients; }

Target:
boolean taskIsCaughtUpOnClient(final TaskId task, final ID client) { boolean hasNoCaughtUpClients = true; final SortedSet<RankedClient<ID>> rankedClients = statefulTasksToRankedCandidates.get(task); if (rankedClients == null) { return true; } for (final RankedClient<ID> rankedClient : rankedClients) { if (rankedClient.rank() <= 0L) { if (rankedClient.clientId().equals(client)) { return true; } else { hasNoCaughtUpClients = false; } } if (rankedClient.rank() > 0L) { break; } } return hasNoCaughtUpClients; }
Source:
public void Union() throws SQLException { SubQueryExpression<Integer> sq1 = query().from(employee).select(employee.id.max()); SubQueryExpression<Integer> sq2 = query().from(employee).select(employee.id.min()); List<Integer> list = query().union(sq1, sq2).fetch(); assertFalse(list.isEmpty()); }

Target:
public void Union() throws SQLException { SubQueryExpression<Integer> sq1 = query().from(employee).select(employee.id.max().as("ID")); SubQueryExpression<Integer> sq2 = query().from(employee).select(employee.id.min().as("ID")); assertEquals( ImmutableList.of(query().select(employee.id.min()).from(employee).fetchFirst(), query().select(employee.id.max()).from(employee).fetchFirst()), query().union(sq1, sq2).orderBy(employee.id.asc()).fetch()); }
Source:
public void setImageServerContent(Map<String, String> imageServerContent) { this.imageServerContent = imageServerContent; }

Target:
public void setImageServerContent(Map<String, String> imageServerContent) { this.imageServerContent = ImmutableMap.copyOf(imageServerContent); }
Source:
public void channelUnlinked(ChannelUID channelUID) { switch (channelUID.getId()) { case CHANNEL_SWITCH: for (Channel channel : channels) { channel.removeListener(channelUID); } break; default: logger.warn("channel not supported in thing {}", channelUID.getId(), this.thing.getUID()); } }

Target:
public void channelUnlinked(ChannelUID channelUID) { switch (channelUID.getId()) { case CHANNEL_SWITCH: for (Channel channel : channels) { channel.removeListener(channelUID); } break; case CHANNEL_CONTROL: break; default: logger.debug("channel not supported in thing {}", channelUID.getId(), this.thing.getUID()); } }
Source:
public Role build() { ImmutableMap.Builder<String, List<String>> immutableEnvRunList = ImmutableMap.builder(); for (Entry<String, List<String>> e : envRunList.entrySet()) { ImmutableList.Builder<String> value = ImmutableList.builder(); value.addAll(e.getValue()); immutableEnvRunList.put(e.getKey(), value.build()); } return new Role(name, description, defaultAttributes.build(), runList.build(), overrideAttributes.build(), immutableEnvRunList.build()); }

Target:
public Role build() { Map<String, List<String>> immutableEnvRunList = Maps.transformValues(envRunList, new Function<List<String>, List<String>>() { @Override public List<String> apply(List<String> input) { return ImmutableList.copyOf(input); } }); return new Role(name, description, defaultAttributes.build(), runList.build(), overrideAttributes.build(), immutableEnvRunList); }
Source:
private void startStatusReader() { final BufferedReader errorReader = new BufferedReader(new InputStreamReader(this.process.getErrorStream())); this.getTaskExecutor().execute(new Runnable() { @Override public void run() { String statusMessage; try { while ((statusMessage = errorReader.readLine()) != null) { publish(statusMessage); if (logger.isTraceEnabled()) { logger.trace(statusMessage); } } } catch (IOException e) { logger.error("Exception on tail error reader", e); } finally { try { errorReader.close(); } catch (IOException e) { e.printStackTrace(); } } } }); }

Target:
private void startStatusReader() { Process process = this.process; if (process == null) { if (logger.isDebugEnabled()) { logger.debug("Process destroyed before starting stderr reader"); } return; } final BufferedReader errorReader = new BufferedReader(new InputStreamReader(process.getErrorStream())); this.getTaskExecutor().execute(new Runnable() { @Override public void run() { String statusMessage; if (logger.isDebugEnabled()) { logger.debug("Reading stderr"); } try { while ((statusMessage = errorReader.readLine()) != null) { publish(statusMessage); if (logger.isTraceEnabled()) { logger.trace(statusMessage); } } } catch (IOException e) { logger.error("Exception on tail error reader", e); } finally { try { errorReader.close(); } catch (IOException e) { logger.error("Exception while closing stderr", e); } } } }); }
Source:
public void killBubble() { timeEmpty++; if(timeEmpty >= TIME_KILL) { this.kill(); addToLog("[BUBBLE]\t was empty and popped"); } }

Target:
public void killBubble() { if(timeEmpty >= TIME_KILL) { this.kill(); addToLog("[BUBBLE]\t was empty and popped"); } }
Source:
public Object evaluate(DeferredObject[] arguments) throws HiveException { result.clear(); try { if (arguments.length == 1 && argumentOI != null && arguments[0] != null) { String ip = ((StringObjectInspector) argumentOI).getPrimitiveJavaObject(arguments[0].get()); Map<String, Object> geoDataResult = geocode.getGeocodedData(ip); if (geoDataResult != null) { Object[] values = new Object[geoDataResult.keySet().size()]; int ct = 0; for (String field : geoDataResult.keySet()) { result.put(field, geoDataResult.get(field).toString()); } } } } catch (Exception ex) { LOG.error(ex); } return result; }

Target:
public Object evaluate(DeferredObject[] arguments) throws HiveException { result.clear(); try { if (arguments.length == 1 && argumentOI != null && arguments[0] != null) { String ip = ((StringObjectInspector) argumentOI).getPrimitiveJavaObject(arguments[0].get()); Map<String, Object> geoDataResult = geocode.getGeocodedData(ip); if (geoDataResult != null) { for (String field : geoDataResult.keySet()) { result.put(field, geoDataResult.get(field).toString()); } } } } catch (Exception ex) { LOG.error(ex); } return result; }
Source:
private FilterIndexingServiceProvider findIndexingServiceProvider(IndexedFilter indexedFilter) { for (FilterIndexingServiceProvider provider : filterIndexingServiceProviders) { if (provider.supportsFilter(indexedFilter)) { return provider; } } log.warnf("No indexing service provider found for indexed filter of type %s", indexedFilter.getClass().getName()); return null; }

Target:
private FilterIndexingServiceProvider findIndexingServiceProvider(IndexedFilter indexedFilter) { for (FilterIndexingServiceProvider provider : filterIndexingServiceProviders) { if (provider.supportsFilter(indexedFilter)) { return provider; } } log.noFilterIndexingServiceProviderFound(indexedFilter.getClass().getName()); return null; }
Source:
private void checkSequenceOfJavaInfo(Sequence<?> seq, String field) throws EvalException { if (seq.stream().anyMatch(v -> !(v instanceof JavaInfo))) { throw Starlark.errorf("Expected 'sequence of JavaInfo' for '%s'", field); } }

Target:
private void checkSequenceOfJavaInfo(Sequence<?> seq, String field) throws EvalException { for (Object v : seq) { if (!(v instanceof JavaInfo)) { throw Starlark.errorf("Expected 'sequence of JavaInfo' for '%s'", field); } } }
Source:
protected boolean canDoAction() { StorageServerConnectionExtension conn = getParameters().getStorageServerConnectionExtension(); return validate(getConnectionExtensionValidator().isConnectionExtensionExists(conn.getId())) && validate(getConnectionExtensionValidator().isConnectionDoesNotExistForHostAndTarget(conn.getHostId(), conn.getIqn())); }

Target:
protected boolean canDoAction() { StorageServerConnectionExtension conn = getParameters().getStorageServerConnectionExtension(); return validate(getConnectionExtensionValidator().isConnectionExtensionExists(conn.getId())) && validate(getConnectionExtensionValidator().isConnectionDoesNotExistForHostAndTarget(conn)); }
Source:
public Boolean call() { try { String expectedValue = generateDataString(ledgerId, entryId); ByteBuf byteBuf = ledgerStorage.getEntry(ledgerId, entryId); long actualLedgerId = byteBuf.readLong(); long actualEntryId = byteBuf.readLong(); byte[] data = new byte[byteBuf.readableBytes()]; byteBuf.readBytes(data); if (ledgerId != actualLedgerId) { LOG.error("For ledgerId: entryId: readRequest, actual ledgerId: {}", ledgerId, entryId, actualLedgerId); return false; } if (entryId != actualEntryId) { LOG.error("For ledgerId: entryId: readRequest, actual entryId: {}", ledgerId, entryId, actualEntryId); return false; } if (!expectedValue.equals(new String(data))) { LOG.error("For ledgerId: entryId: readRequest, actual Data: {}", ledgerId, entryId, new String(data)); return false; } } catch (IOException e) { LOG.error("Got Exception for GetEntry call. LedgerId: " + ledgerId + " entryId: " + entryId, e); return false; } return true; }

Target:
public Boolean call() throws IOException { try { ByteBuf expectedByteBuf = generateEntry(ledgerId, entryId); ByteBuf actualByteBuf = ledgerStorage.getEntry(ledgerId, entryId); if (!expectedByteBuf.equals(actualByteBuf)) { LOG.error("Expected Entry: Actual Entry: {}", expectedByteBuf.toString(Charset.defaultCharset()), actualByteBuf.toString(Charset.defaultCharset())); throw new IOException("Expected Entry: " + expectedByteBuf.toString(Charset.defaultCharset()) + " Actual Entry: " + actualByteBuf.toString(Charset.defaultCharset())); } } catch (IOException e) { LOG.error("Got Exception for GetEntry call. LedgerId: " + ledgerId + " entryId: " + entryId, e); throw new IOException("Got Exception for GetEntry call. LedgerId: " + ledgerId + " entryId: " + entryId, e); } return true; }
Source:
public void addContents(@NonNull Container container) { container.add(new PrintedContent("loggers.md") { @Override protected void printTo(PrintWriter out) throws IOException { out.println("Loggers currently enabled"); out.println("========================="); LogManager logManager = LogManager.getLogManager(); Enumeration<String> loggerNames = logManager.getLoggerNames(); while (loggerNames.hasMoreElements()) { String loggerName = loggerNames.nextElement(); if (logManager.getLogger(loggerName) != null) { Level level = logManager.getLogger(loggerName).getLevel(); if (level != null) { out.println(loggerName + " - " + level); } } } } }); }

Target:
public void addContents(@NonNull Container container) { container.add(new PrintedContent("loggers.md") { @Override protected void printTo(PrintWriter out) throws IOException { out.println("Loggers currently enabled"); out.println("========================="); LogManager logManager = LogManager.getLogManager(); Enumeration<String> loggerNames = logManager.getLoggerNames(); while (loggerNames.hasMoreElements()) { String loggerName = loggerNames.nextElement(); Logger loggerByName = logManager.getLogger(loggerName); if (loggerByName != null) { Level level = loggerByName.getLevel(); if (level != null) { out.println(loggerName + " - " + level); } } } } }); }
Source:
public void run() { while (!Thread.currentThread().isInterrupted()) { try { TellstickSendEvent sendEvent; END synchronized (messageQue) { while (messageQue.isEmpty()) { messageQue.wait(); } sendEvent = messageQue.remove(messageQue.firstKey()); } END EVENT try { handleSendEvent(sendEvent.getConfig(), sendEvent.getDev(), sendEvent.getCommand()); } catch (TellstickException e) { logger.error("Failed to send msg to " + sendEvent.getConfig(), e); } } catch (InterruptedException ie) { break; } } }

Target:
public void run() { while (!Thread.currentThread().isInterrupted()) { try { TellstickSendEvent sendEvent; END synchronized (messageQue) { while (messageQue.isEmpty()) { messageQue.wait(); } sendEvent = messageQue.remove(messageQue.firstKey()); } END EVENT try { handleSendEvent(sendEvent.getConfig(), sendEvent.getDev(), sendEvent.getCommand()); } catch (TellstickException e) { logger.error("Failed to send msg to {}, error: {}", sendEvent.getConfig(), e); } } catch (InterruptedException ie) { break; } } }
Source:
protected FeatureWriter<SimpleFeatureType, SimpleFeature> getWriterInternal( Query query, int flags) throws IOException { if (flags == 0) { throw new IllegalArgumentException("no write flags set"); } ShapefileFeatureReader reader = (ShapefileFeatureReader) delegate.getReaderInternal(Query.ALL); ShapefileFeatureWriter writer; ShapefileDataStore ds = getDataStore(); if (ds.indexManager.hasFidIndex(false) || ds.isFidIndexed() && ds.indexManager.hasFidIndex(true)) { writer = new IndexedShapefileFeatureWriter( ds.indexManager, reader, ds.getCharset(), ds.getTimeZone()); } else { if (ds.indexManager.isIndexStale(ShpFileType.FIX)) { ds.indexManager.createFidIndex(); } writer = new ShapefileFeatureWriter( delegate.shpFiles, reader, ds.getCharset(), ds.getTimeZone()); } writer.setMaxShpSize(getDataStore().getMaxShpSize()); writer.setMaxDbfSize(getDataStore().getMaxDbfSize()); if ((flags | WRITER_ADD) == WRITER_ADD) { while (writer.hasNext()) { writer.next(); } } Filter filter = query.getFilter(); if (filter != null && !Filter.INCLUDE.equals(filter)) { return new FilteringFeatureWriter(writer, filter); } else { return writer; } }

Target:
protected FeatureWriter<SimpleFeatureType, SimpleFeature> getWriterInternal( Query query, int flags) throws IOException { if (flags == 0) { throw new IllegalArgumentException("no write flags set"); } ShapefileFeatureReader reader = (ShapefileFeatureReader) delegate.getReaderInternal(Query.ALL); ShapefileFeatureWriter writer; ShapefileDataStore ds = getDataStore(); if (ds.indexManager.hasFidIndex(false) || ds.isFidIndexed() && ds.indexManager.hasFidIndex(true)) { writer = new IndexedShapefileFeatureWriter( ds.indexManager, reader, ds.getCharset(), ds.getTimeZone()); } else { writer = new ShapefileFeatureWriter( delegate.shpFiles, reader, ds.getCharset(), ds.getTimeZone()); } writer.setMaxShpSize(getDataStore().getMaxShpSize()); writer.setMaxDbfSize(getDataStore().getMaxDbfSize()); if ((flags | WRITER_ADD) == WRITER_ADD) { while (writer.hasNext()) { writer.next(); } } Filter filter = query.getFilter(); if (filter != null && !Filter.INCLUDE.equals(filter)) { return new FilteringFeatureWriter(writer, filter); } else { return writer; } }
Source:
public void testQueryDirectSqlQuery() { final ContentResolver cr = getContext().getContentResolver(); Cursor cursor = cr.query(FlashCardsContract.Note.SQL_QUERY_URI, null, String.format("mid=%d", mModelId), null, null); assertNotNull(cursor); try { assertEquals("Check number of results", mCreatedNotes.size(), cursor.getCount()); } finally { cursor.close(); } cursor = cr.query(FlashCardsContract.Note.SQL_QUERY_URI, null, "mid=0", null, null); assertNotNull(cursor); try { assertEquals("Check number of results", 0, cursor.getCount()); } finally { cursor.close(); } }

Target:
public void testQueryDirectSqlQuery() { final ContentResolver cr = getContext().getContentResolver(); Cursor cursor = cr.query(FlashCardsContract.Note.CONTENT_URI_V2, null, String.format("mid=%d", mModelId), null, null); assertNotNull(cursor); try { assertEquals("Check number of results", mCreatedNotes.size(), cursor.getCount()); } finally { cursor.close(); } cursor = cr.query(FlashCardsContract.Note.CONTENT_URI_V2, null, "mid=0", null, null); assertNotNull(cursor); try { assertEquals("Check number of results", 0, cursor.getCount()); } finally { cursor.close(); } cursor = cr.query(FlashCardsContract.Note.CONTENT_URI_V2, null, "mid=?", new String[]{"0"}, null); assertNotNull(cursor); }
Source:
public void testStaticWebsiteListingsCSS() { Multimap<String, String> headers = ImmutableMultimap.of(STATIC_WEB_LISTINGS_CSS, "listings.css"); UpdateContainerOptions options = new UpdateContainerOptions().headers(headers); assertEquals(ImmutableList.of("listings.css"), options.buildRequestHeaders().get(STATIC_WEB_LISTINGS_CSS)); }

Target:
public void testStaticWebsiteListingsCSS() { Multimap<String, String> headers = ImmutableMultimap.of(STATIC_WEB_LISTINGS_CSS, "listings.css"); UpdateContainerOptions options = new UpdateContainerOptions().headers(headers); assertEquals(options.buildRequestHeaders().get(STATIC_WEB_LISTINGS_CSS), ImmutableList.of("listings.css")); }
Source:
public void sendRequest(Exchange exchange, Request request){ Request req = request; if(shouldProtectRequest(request)){ try { String uri = request.getURI(); OSCoreCtxDB db = HashMapCtxDB.getInstance(); if(uri == null){ LOGGER.severe(OSExceptionHandler.URI_NULL); throw new IllegalArgumentException(OSExceptionHandler.URI_NULL); } if(db == null){ LOGGER.severe(OSExceptionHandler.DB_NULL); throw new IllegalArgumentException(OSExceptionHandler.DB_NULL); } OSCoreCtx ctx = db.getContext(uri); if( ctx == null){ LOGGER.severe(OSExceptionHandler.CTX_NULL); throw new IllegalArgumentException(OSExceptionHandler.CTX_NULL); } exchange.setCryptographicContextID(ctx.getRecipientId()); int seqByToken = ctx.getSenderSeq(); int realCode = request.getCode().value; request = OptionJuggle.setFakeCodeRequest(request); req = prepareSend(request, ctx, realCode); if (req.getToken() != null) { db.addContext(request.getToken(), ctx); db.addSeqByToken(request.getToken(), seqByToken); } else { Token token = db.generateToken(); req.setToken(token); db.addContext(req.getToken(), ctx); db.addSeqByToken(token, seqByToken); } } catch (OSException e) { LOGGER.severe("Error sending request: " + e.getMessage()); return; } catch (IllegalArgumentException e){ LOGGER.severe("Unable to send request because of illegal argument: " + e.getMessage()); return; } } LOGGER.finest("Request: " + exchange.getRequest().toString()); super.sendRequest(exchange, req); }

Target:
public void sendRequest(Exchange exchange, Request request) { Request req = request; if (shouldProtectRequest(request)) { try { String uri = request.getURI(); final OSCoreCtxDB db = HashMapCtxDB.getInstance(); if (uri == null) { LOGGER.error(Error.URI_NULL); throw new OSException(Error.URI_NULL); } if (db == null) { LOGGER.error(Error.DB_NULL); throw new OSException(Error.DB_NULL); } final OSCoreCtx ctx = db.getContext(uri); if (ctx == null) { LOGGER.error(Error.CTX_NULL); throw new OSException(Error.CTX_NULL); } exchange.setCryptographicContextID(ctx.getRecipientId()); final int seqByToken = ctx.getSenderSeq(); final Request preparedRequest = prepareSend(request, ctx); preparedRequest.addMessageObserver(new MessageObserverAdapter() { @Override public void onReadyToSend() { Token token = preparedRequest.getToken(); db.addContext(token, ctx); db.addSeqByToken(token, seqByToken); } }); req = preparedRequest; if (req.getToken() != null) { db.addContext(request.getToken(), ctx); db.addSeqByToken(request.getToken(), seqByToken); } } catch (OSException e) { LOGGER.error("Error sending request: " + e.getMessage()); return; } catch (IllegalArgumentException e) { LOGGER.error("Unable to send request because of illegal argument: " + e.getMessage()); return; } } LOGGER.info("Request: " + exchange.getRequest().toString()); super.sendRequest(exchange, req); }
Source:
private void showNewPostsBar() { if (!isAdded() || isNewPostsBarShowing()) { return; } AniUtils.startAnimation(mNewPostsBar, R.anim.reader_top_bar_in); mNewPostsBar.setVisibility(View.VISIBLE); mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() { @Override public void onScrolled(RecyclerView recyclerView, int dx, int dy) { super.onScrolled(recyclerView, dx, dy); if (dy >= mHideNewPostsBarOnScrollOffset) { hideNewPostsBar(); } } }); getPostAdapter().removeGapMarker(); }

Target:
private void showNewPostsBar() { if (!isAdded() || isNewPostsBarShowing()) { return; } AniUtils.startAnimation(mNewPostsBar, R.anim.reader_top_bar_in); mNewPostsBar.setVisibility(View.VISIBLE); mRecyclerView.postDelayed(new Runnable() { @Override public void run() { if (isAdded() && isNewPostsBarShowing()) { mRecyclerView.addOnScrollListener(mOnScrollListener); } } }, 1000L); getPostAdapter().removeGapMarker(); }
Source:
public void setComparator(Comparator<Format> comparator) { if(this.comparator != comparator) { this.comparator = comparator; } }

Target:
public void setComparator(Comparator<Format> comparator) { this.comparator = comparator; }
Source:
private void addRemoveRowColumn() { ButtonCell buttonCell = new ButtonCell(IconType.TRASH, ButtonType.DANGER, ButtonSize.SMALL); Column<ObjectProperty, String> column = new Column<ObjectProperty, String>(buttonCell) { @Override public String getValue(ObjectProperty objectProperty) { return Constants.INSTANCE.objectBrowser_action_delete(); } }; column.setFieldUpdater(new FieldUpdater<ObjectProperty, String>() { @Override public void update(int index, ObjectProperty objectProperty, String value) { if (!readonly) { safeObjectPropertyDelete(objectProperty, index); } } }); propertiesTable.addColumn(column, ""); propertiesTable.setColumnWidth(column, calculateButtonSize(Constants.INSTANCE.objectBrowser_action_delete()), Style.Unit.PX); }

Target:
private void addRemoveRowColumn() { ButtonCell buttonCell = new ButtonCell(IconType.TRASH, ButtonType.DANGER, ButtonSize.SMALL); Column<ObjectProperty, String> column = new Column<ObjectProperty, String>(buttonCell) { @Override public String getValue(ObjectProperty objectProperty) { return Constants.INSTANCE.objectBrowser_action_delete(); } }; column.setFieldUpdater(new FieldUpdater<ObjectProperty, String>() { @Override public void update(int index, ObjectProperty objectProperty, String value) { if (!readonly) { presenter.onDeleteProperty(objectProperty, index); } } }); propertiesTable.addColumn(column, ""); propertiesTable.setColumnWidth(column, calculateButtonSize(Constants.INSTANCE.objectBrowser_action_delete()), Style.Unit.PX); }
Source:
public String canonicalID() { return canonical; }

Target:
public final String canonicalID() { return canonical; }