auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
DiscoveryDataPacket collectExchangeData(DiscoveryDataPacket dataPacket) { if (locNode.isDaemon()) return dataPacket; assert dataPacket != null; assert dataPacket.joiningNodeId() != null; DiscoveryDataBag dataBag = dataPacket.bagForDataCollection(); exchange.collect(dataBag); if (dataPacket.joiningNodeId().equals(locNode.id())) dataPacket.marshalJoiningNodeData( dataBag, marshaller(), log, allNodesSupport(IgniteFeatures.DATA_PAKET_COMPRESSION)); else dataPacket.marshalGridNodeData( dataBag, locNode.id(), marshaller(), log, allNodesSupport(IgniteFeatures.DATA_PAKET_COMPRESSION)); return dataPacket; }

Target:
DiscoveryDataPacket collectExchangeData(DiscoveryDataPacket dataPacket) { if (locNode.isDaemon()) return dataPacket; assert dataPacket != null; assert dataPacket.joiningNodeId() != null; DiscoveryDataBag dataBag = dataPacket.bagForDataCollection(); exchange.collect(dataBag); if (dataPacket.joiningNodeId().equals(locNode.id())) dataPacket.marshalJoiningNodeData( dataBag, marshaller(), allNodesSupport(IgniteFeatures.DATA_PACKET_COMPRESSION), ignite.configuration().getNetworkCompressionLevel(), log); else dataPacket.marshalGridNodeData( dataBag, locNode.id(), marshaller(), allNodesSupport(IgniteFeatures.DATA_PACKET_COMPRESSION), ignite.configuration().getNetworkCompressionLevel(), log); return dataPacket; }
Source:
private Boolean check() { if (mJobId == null) { return false; } JobInfo jobInfo; try { jobInfo = mClient.getJobStatus(mJobId); } catch (IOException e) { LOG.warn("Failed to get status for job (jobId={})", mJobId, e); return false; } switch (jobInfo.getStatus()) { case CREATED: case RUNNING: return null; case CANCELED: case COMPLETED: return true; case FAILED: return false; default: throw new IllegalStateException(String.format("Unexpected Status: %s", jobInfo.getStatus())); } }

Target:
private Status check() { if (mJobId == null) { return Status.FAILED; } JobInfo jobInfo; try { jobInfo = mClient.getJobStatus(mJobId); } catch (IOException e) { LOG.warn("Failed to get status for job (jobId={})", mJobId, e); return Status.FAILED; } return jobInfo.getStatus(); }
Source:
public Long getBytes(String path) { return getMemorySize(path).toBytes(); }

Target:
public Long getBytes(String path) { BigInteger bytes = getBytesBigInteger(path); ConfigValue v = find(path, ConfigValueType.STRING); return toLong(bytes, v.origin(), path); }
Source:
public void getGroupMembers_shouldReturnAllGroupMembers() throws Exception { executeDataSet("ObsWithGroupMembers.xml"); assertEquals(1, getResource().getByUniqueId("47f18998-96cc-11e0-8d6b-9b9415a91423").getGroupMembers().size()); assertEquals(2, getResource().getByUniqueId("5117f5d4-96cc-11e0-8d6b-9b9415a91433").getGroupMembers().size()); }

Target:
public void getGroupMembers_shouldReturnAllGroupMembers() throws Exception { executeDataSet("ObsWithGroupMembers.xml"); ObsResource1_8 resource = getResource(); Set<Obs> groupMembers1 = (Set<Obs>) ObsResource1_8.getGroupMembers(resource.getByUniqueId("47f18998-96cc-11e0-8d6b-9b9415a91423")); assertEquals(1, groupMembers1.size()); Set<Obs> groupMembers2 = (Set<Obs>) ObsResource1_8.getGroupMembers(resource.getByUniqueId("5117f5d4-96cc-11e0-8d6b-9b9415a91433")); assertEquals(2, groupMembers2.size()); }
Source:
public void testApplicationKeepAlive() throws Exception { MyNodeManager nm = new MyNodeManager(); try { YarnConfiguration conf = createNMConfig(); conf.setBoolean(YarnConfiguration.LOG_AGGREGATION_ENABLED, true); conf.setLong(YarnConfiguration.RM_NM_EXPIRY_INTERVAL_MS, 4000l); nm.init(conf); nm.start(); GenericTestUtils.waitFor(() -> nm.getServiceState() == STATE.STARTED, 20, 10000); int waitCount = 0; while (nm.getServiceState() == STATE.STARTED && heartBeatID < 12 && waitCount++ < 60000000) { Thread.sleep(100l); } Assert.assertTrue(heartBeatID >= 12); MyResourceTracker3 rt = (MyResourceTracker3) nm.getNodeStatusUpdater().getRMClient(); rt.context.getApplications().remove(rt.appId); Assert.assertEquals(1, rt.keepAliveRequests.size()); int numKeepAliveRequests = rt.keepAliveRequests.get(rt.appId).size(); LOG.info("Number of Keep Alive Requests: [" + numKeepAliveRequests + "]"); Assert.assertTrue(numKeepAliveRequests == 2 || numKeepAliveRequests == 3); waitCount = 0; while (nm.getServiceState() == STATE.STARTED && heartBeatID < 20 && waitCount++ < 60000000) { Thread.sleep(100l); } Assert.assertTrue(heartBeatID >= 20); int numKeepAliveRequests2 = rt.keepAliveRequests.get(rt.appId).size(); Assert.assertEquals(numKeepAliveRequests, numKeepAliveRequests2); } finally { if (nm.getServiceState() == STATE.STARTED) nm.stop(); } }

Target:
public void testApplicationKeepAlive() throws Exception { MyNodeManager nm = new MyNodeManager(); try { YarnConfiguration conf = createNMConfig(); conf.setBoolean(YarnConfiguration.LOG_AGGREGATION_ENABLED, true); conf.setLong(YarnConfiguration.RM_NM_EXPIRY_INTERVAL_MS, 4000l); nm.init(conf); nm.start(); GenericTestUtils.waitFor(() -> nm.getServiceState() == STATE.STARTED, 20, 10000); GenericTestUtils.waitFor( () -> nm.getServiceState() != STATE.STARTED || heartBeatID.get() >= 12, 100L, 60000000); Assert.assertTrue(heartBeatID.get() >= 12); MyResourceTracker3 rt = (MyResourceTracker3) nm.getNodeStatusUpdater().getRMClient(); rt.context.getApplications().remove(rt.appId); Assert.assertEquals(1, rt.keepAliveRequests.size()); int numKeepAliveRequests = rt.keepAliveRequests.get(rt.appId).size(); LOG.info("Number of Keep Alive Requests: [" + numKeepAliveRequests + "]"); Assert.assertTrue(numKeepAliveRequests == 2 || numKeepAliveRequests == 3); GenericTestUtils.waitFor( () -> nm.getServiceState() != STATE.STARTED || heartBeatID.get() >= 20, 100L, 60000000); Assert.assertTrue(heartBeatID.get() >= 20); int numKeepAliveRequests2 = rt.keepAliveRequests.get(rt.appId).size(); Assert.assertEquals(numKeepAliveRequests, numKeepAliveRequests2); } finally { if (nm != null) { nm.stop(); nm.waitForServiceToStop(10000); } } }
Source:
public MachinePublicKeyProvider( @Named("env.CHE_MACHINE_AUTH_SIGNATURE__ALGORITHM") String alg, @Named("env.CHE_MACHINE_AUTH_SIGNATURE__PUBLIC__KEY") String key) { checkArgument(key != null && !key.isEmpty(), "Signature key for token validation is not found"); checkArgument(alg != null && !alg.isEmpty(), "Algorithm for signature key is not defined"); this.publicKey = key; this.algorithm = alg; }

Target:
public MachinePublicKeyProvider( @Named("env.CHE_MACHINE_AUTH_SIGNATURE__ALGORITHM") String alg, @Named("env.CHE_MACHINE_AUTH_SIGNATURE__PUBLIC__KEY") String key) { this.publicKey = key; this.algorithm = alg; }
Source:
public void handleCheckStateChangedEvent(Collection<ITmfTreeViewerEntry> entries) { cancelUpdate(); Iterable<TmfGenericTreeEntry> counterEntries = Iterables.filter(entries, TmfGenericTreeEntry.class); Collection<@NonNull Long> selectedIds = Lists.newArrayList(Iterables.transform(counterEntries, e -> e.getModel().getId())); if (!selectedIds.equals(fSelectedIds)) { clearContent(); fSelectedIds = selectedIds; } updateContent(); }

Target:
public void handleCheckStateChangedEvent(Collection<ITmfTreeViewerEntry> entries) { cancelUpdate(); Iterable<TmfGenericTreeEntry> counterEntries = Iterables.filter(entries, TmfGenericTreeEntry.class); Collection<@NonNull Long> selectedIds = Lists.newArrayList(Iterables.transform(counterEntries, e -> e.getModel().getId())); if (!selectedIds.containsAll(fSelectedIds)) { clearContent(); } fSelectedIds = selectedIds; updateContent(); }
Source:
void dispatch(DebugEvent[] events) { fEvents = events; if (!fEventFilters.isEmpty()) { fMode = NOTIFY_FILTERS; for (IDebugEventFilter iDebugEventFilter : fEventFilters) { fFilter = iDebugEventFilter; SafeRunner.run(this); if (fEvents == null || fEvents.length == 0) { return; } } } fMode = NOTIFY_EVENTS; if (DebugOptions.DEBUG_EVENTS) { for (DebugEvent fEvent : fEvents) { DebugOptions.trace(fEvent.toString()); } } for (IDebugEventSetListener iDebugEventSetListener : fEventListeners) { fListener = iDebugEventSetListener; SafeRunner.run(this); } fEvents = null; fFilter = null; fListener = null; }

Target:
void dispatch(DebugEvent[] events) { fEvents = events; if (!fEventFilters.isEmpty()) { fMode = NOTIFY_FILTERS; for (IDebugEventFilter iDebugEventFilter : fEventFilters) { fFilter = iDebugEventFilter; SafeRunner.run(this); if (fEvents == null || fEvents.length == 0) { return; } } } fMode = NOTIFY_EVENTS; if (DebugOptions.DEBUG_EVENTS) { for (DebugEvent event : fEvents) { DebugOptions.trace(event.toString()); } } for (IDebugEventSetListener iDebugEventSetListener : fEventListeners) { fListener = iDebugEventSetListener; SafeRunner.run(this); } fEvents = null; fFilter = null; fListener = null; }
Source:
public long getOldestWriteTimstamp() { if(writes.size() == 0) { return Long.MAX_VALUE; } Write oldestWrite = writes.get(0); return oldestWrite.getVersion(); }

Target:
public long getOldestWriteTimstamp() { if(writes.size() == 0) { return Long.MAX_VALUE; } else { Write oldestWrite = writes.get(0); return oldestWrite.getVersion(); } }
Source:
protected WgsMetricsCollector getCollector(final int coverageCap, final IntervalList intervals) { if (collector != null) throw new PicardException("A WGSMetricsCollector already exists"); collector = new WgsMetricsWithNonZeroCoverageCollector(COVERAGE_CAP, intervals); return collector; }

Target:
protected WgsMetricsCollector getCollector(final int coverageCap, final IntervalList intervals) { assert(coverageCap == this.collector.coverageCap); return this.collector; }
Source:
public boolean updateSMSAlertWithUpdatedCourtDate(SMSAlert dailyAlert){ String sql = "UPDATE sms_alerts SET court_date = :courtDate WHERE id = :smsAlertId"; Map<String, Object> parameterMap = new HashMap<String, Object>(); parameterMap.put("courtDate", DatabaseUtilities.convertLocalDateTimeToDatabaseDate(dailyAlert.courtDate)); parameterMap.put("smsAlertId", dailyAlert.id); try{ jdbcTemplate.update(sql, parameterMap); }catch(Exception e){ LogSystem.LogDBException(e); return false; } return true; }

Target:
public boolean updateSMSAlertWithUpdatedCourtDate(SMSAlert dailyAlert){ Map<String, Object> parameterMap = new HashMap<String, Object>(); parameterMap.put("courtDate", DatabaseUtilities.convertLocalDateTimeToDatabaseDate(dailyAlert.courtDate)); parameterMap.put("smsAlertId", dailyAlert.id); try{ jdbcTemplate.update(getSql("SMSAlert/update-SMSAlert-courtDate.sql"), parameterMap); }catch(Exception e){ LogSystem.LogDBException(e); return false; } return true; }
Source:
private OpenShiftEnvironment asOpenShiftEnv(InternalEnvironment source) throws ValidationException, InfrastructureException { if (source instanceof OpenShiftEnvironment) { return (OpenShiftEnvironment) source; } if (source instanceof DockerImageEnvironment) { return dockerImageEnvConverter.convert((DockerImageEnvironment) source); } throw new ValidationException( format( "Environment type '%s' is not supported. Supported environment types: %s", source.getRecipe().getType(), OpenShiftEnvironment.TYPE)); }

Target:
private OpenShiftEnvironment asOpenShiftEnv(InternalEnvironment source) throws ValidationException, InfrastructureException { if (source instanceof OpenShiftEnvironment) { return (OpenShiftEnvironment) source; } if (source instanceof DockerImageEnvironment) { return dockerImageEnvConverter.convert((DockerImageEnvironment) source); } throw new InternalInfrastructureException( format( "Environment type '%s' is not supported. Supported environment types: %s", source.getRecipe().getType(), OpenShiftEnvironment.TYPE)); }
Source:
public boolean validate() { StringTokenizer tokenizer = new StringTokenizer(inputString, "\n"); if (tokenizer.countTokens() != 2) { log.trace("putTaskStatus() - input error"); validationResponse = Response.status(400).build(); return false; } String requestTokenInput = tokenizer.nextToken(); String surlInput = tokenizer.nextToken(); if ((!requestTokenInput.startsWith("requestToken=")) || (!surlInput.startsWith("surl="))) { log.trace("putTaskStatus() - input error"); validationResponse = Response.status(400).build(); return false; } requestToken = requestTokenInput .substring(requestTokenInput.indexOf('=') + 1); String surlString = surlInput.substring(surlInput.indexOf('=') + 1); if ((requestToken.length() == 0) || (surlString.length() == 0)) { log.trace("putTaskStatus() - input error"); validationResponse = Response.status(400).build(); return false; } if(!TokenValidator.valid(requestToken)){ validationResponse = Response.status(400).entity("Invalid token\n\n").build(); return false; } if (!validateSurl(surlString)) { return false; } return true; }

Target:
public boolean validate() { StringTokenizer tokenizer = new StringTokenizer(inputString, "\n"); if (tokenizer.countTokens() != 2) { log.trace("putTaskStatus() - input error"); validationResponse = Response.status(400).build(); return false; } String requestTokenInput = tokenizer.nextToken(); String surlInput = tokenizer.nextToken(); if ((!requestTokenInput.startsWith("requestToken=")) || (!surlInput.startsWith("surl="))) { log.trace("putTaskStatus() - input error"); validationResponse = Response.status(400).build(); return false; } requestToken = requestTokenInput .substring(requestTokenInput.indexOf('=') + 1); String surlString = surlInput.substring(surlInput.indexOf('=') + 1); if ((requestToken.length() == 0) || (surlString.length() == 0)) { log.trace("putTaskStatus() - input error"); validationResponse = Response.status(400).build(); return false; } if(!TokenValidator.valid(requestToken)){ validationResponse = Response.status(400).entity("Invalid token: " + requestToken +" \n\n").build(); return false; } if (!validateSurl(surlString)) { return false; } return true; }
Source:
public boolean hasPermission(Authentication authentication, Serializable targetId, String targetType, Object permission) { Request request = requestService.getCurrentRequest(); Context context = ContextUtil.obtainContext(request.getServletRequest()); EPerson ePerson = null; try { ePerson = ePersonService.findByEmail(context, (String) authentication.getPrincipal()); UUID dsoId = UUID.fromString(targetId.toString()); DSpaceObjectService<DSpaceObject> dSpaceObjectService = ContentServiceFactory.getInstance() .getDSpaceObjectService( Constants.getTypeID( targetType)); DSpaceObject dSpaceObject = dSpaceObjectService.find(context, dsoId); return authorizeService.isAdmin(context, ePerson, dSpaceObject); } catch (SQLException e) { log.error(e.getMessage(),e); } return false; }

Target:
public boolean hasPermission(Authentication authentication, Serializable targetId, String targetType, Object permission) { Request request = requestService.getCurrentRequest(); Context context = ContextUtil.obtainContext(request.getServletRequest()); EPerson ePerson = null; try { ePerson = ePersonService.findByEmail(context, (String) authentication.getPrincipal()); if (ePerson != null) { if (authorizeService.isAdmin(context, ePerson)) { return true; } } } catch (SQLException e) { log.error(e.getMessage(), e); } return false; }
Source:
public void addRecipient(String channelName, String selectorExpression) { Assert.notNull(channelName, "channelName can't be null."); MessageChannel channel = this.getBeanFactory().getBean(channelName, MessageChannel.class); ExpressionEvaluatingSelector expressionEvaluatingSelector = new ExpressionEvaluatingSelector(selectorExpression); expressionEvaluatingSelector.setBeanFactory(this.getBeanFactory()); this.recipients.add(new Recipient(channel, expressionEvaluatingSelector)); }

Target:
public void addRecipient(String channelName, String selectorExpression) { Assert.notNull(channelName, "channelName can't be null."); Assert.hasText(channelName, "channelName can't be empty."); Assert.notNull(selectorExpression, "selectorExpression can't be null."); Assert.hasText(selectorExpression, "selectorExpression can't be empty."); MessageChannel channel = this.getBeanFactory().getBean(channelName, MessageChannel.class); ExpressionEvaluatingSelector expressionEvaluatingSelector = new ExpressionEvaluatingSelector(selectorExpression); expressionEvaluatingSelector.setBeanFactory(this.getBeanFactory()); this.recipients.add(new Recipient(channel, expressionEvaluatingSelector)); }
Source:
public void save(Iterable<? extends T> items) { checkNotNull(items); Value value = new Value(); Text forwardCF = new Text(); Text forwardCQ = new Text(); Text invertedCF = new Text(); Text invertedCQ = new Text(); try { for (T item : items) { if (item.size() > 0) { List<Key> docKeys = new ArrayList<Key>(); List<Value> docValues = new ArrayList<Value>(); String id = buildId(item); String shardId = shardBuilder.buildShard(item); Mutation shardMutation = new Mutation(shardId); for (Tuple tuple : item.getTuples()) { String visibility = getVisibility(tuple.getMetadata(), ""); String aliasValue = typeRegistry.getAlias(tuple.getValue()) + ONE_BYTE + typeRegistry.encode(tuple.getValue()); ColumnVisibility columnVisibility = new ColumnVisibility(visibility); Map<String,Object> meta = tuple.getMetadata(); value.set(metadataSerDe.serialize(meta)); forwardCF.set(id); forwardCQ.set(tuple.getKey() + NULL_BYTE + aliasValue); invertedCF.set(PREFIX_FI + NULL_BYTE + tuple.getKey()); invertedCQ.set(aliasValue + NULL_BYTE + id); docKeys.add(new Key(new Text(shardId), forwardCF, forwardCQ, columnVisibility, 0)); docValues.add(new Value(value)); shardMutation.put(invertedCF, invertedCQ, columnVisibility, value); } Value row = encodeRow(docKeys, docValues); shardMutation.put(new Text(id), new Text(), row); shardWriter.addMutation(shardMutation); } } keyValueIndex.indexKeyValues(items); } catch (RuntimeException re) { throw re; } catch (Exception e) { throw new RuntimeException(e); } }

Target:
public void save(Iterable<? extends T> items) { checkNotNull(items); Value value = new Value(); Text forwardCF = new Text(); Text forwardCQ = new Text(); Text invertedCF = new Text(); Text invertedCQ = new Text(); try { for (T item : items) { if (item.size() > 0) { String id = buildId(item); String shardId = shardBuilder.buildShard(item); Multimap<ColumnVisibility,Map.Entry<Key,Value>> visToKeyCache = ArrayListMultimap.create(); Mutation shardMutation = new Mutation(shardId); for (Tuple tuple : item.getTuples()) { String visibility = getVisibility(tuple.getMetadata(), ""); String aliasValue = typeRegistry.getAlias(tuple.getValue()) + ONE_BYTE + typeRegistry.encode(tuple.getValue()); ColumnVisibility columnVisibility = new ColumnVisibility(visibility); Map<String,Object> meta = tuple.getMetadata(); value.set(metadataSerDe.serialize(meta)); forwardCF.set(id); forwardCQ.set(tuple.getKey() + NULL_BYTE + aliasValue); invertedCF.set(PREFIX_FI + NULL_BYTE + tuple.getKey()); invertedCQ.set(aliasValue + NULL_BYTE + id); Key key = new Key(new Text(shardId), forwardCF, forwardCQ, columnVisibility, 0); Value valuePart = new Value(value); visToKeyCache.put(columnVisibility, Maps.immutableEntry(key, valuePart)); shardMutation.put(invertedCF, invertedCQ, columnVisibility, value); } for(ColumnVisibility colVis : visToKeyCache.keySet()) { Value row = encodeRow(visToKeyCache.get(colVis)); shardMutation.put(new Text(id), new Text(), colVis, row); } shardWriter.addMutation(shardMutation); } } keyValueIndex.indexKeyValues(items); } catch (RuntimeException re) { throw re; } catch (Exception e) { throw new RuntimeException(e); } }
Source:
public void emptyErrorLog() { LogView elv = new LogView(); elv.open(); elv.clearLog(); new WaitWhile(new JobIsRunning()); }

Target:
public void emptyErrorLog() { LogView elv = new LogView(); elv.open(); elv.deleteLog(); new WaitWhile(new JobIsRunning()); }
Source:
public void onDataChanged() { if (mHasQueuedInstantOps) { notifyListenersOnDataChanged(); mHasQueuedInstantOps = false; } }

Target:
public void onDataChanged() { if (mHasPendingMoveOrDelete) { notifyListenersOnDataChanged(); mHasPendingMoveOrDelete = false; } }
Source:
protected void handleLabelProviderChanged(LabelProviderChangedEvent event) { Object[] changed = event.getElements(); if (changed != null) { List<Object> others = new ArrayList<Object>(); for (Object element : changed) { if (element == null) continue; if (_mapper != null) { if (_mapper.handlesObject(element)) { _mapper.objectChanged(element); continue; } } others.add(element); } if (others.isEmpty()) { return; } event = new LabelProviderChangedEvent((IBaseLabelProvider) event .getSource(), others.toArray()); } super.handleLabelProviderChanged(event); }

Target:
protected void handleLabelProviderChanged(LabelProviderChangedEvent event) { Object[] changed = event.getElements(); if (changed != null) { List<Object> others = new ArrayList<Object>(); for (Object changedElement : changed) { if (changedElement == null) continue; if (_mapper != null) { if (_mapper.handlesObject(changedElement)) { _mapper.objectChanged(changedElement); continue; } } others.add(changedElement); } if (others.isEmpty()) { return; } event = new LabelProviderChangedEvent((IBaseLabelProvider) event .getSource(), others.toArray()); } super.handleLabelProviderChanged(event); }
Source:
void collectIncludesRecursively( TypeElement module, Map<String, TypeElement> result, Deque<String> path) { Map<String, Object> annotation = CodeGen.getAnnotation(Module.class, module); if (annotation == null) { throw new ModuleValidationException("No @Module on " + module, module); } String name = module.getQualifiedName().toString(); if (path.contains(name)) { StringBuilder message = new StringBuilder("Cycle: ") .append(name) .append(" includes itself"); if (path.size() == 1) { message.append(" directly."); } else { message.append(" by way of:"); Iterator<String> pathIterator = path.descendingIterator(); while (pathIterator.hasNext()) { String pathElement = pathIterator.next(); message.append("\n->").append(pathElement).append(" includes"); } message.append("\n====>").append(name); } throw new ModuleValidationException(message.toString(), module); } else { path.push(name); } result.put(name, module); Types typeUtils = processingEnv.getTypeUtils(); List<Object> seedModules = new ArrayList<Object>(); seedModules.addAll(Arrays.asList((Object[]) annotation.get("includes"))); if (!annotation.get("addsTo").equals(Void.class)) seedModules.add(annotation.get("addsTo")); for (Object include : seedModules) { if (!(include instanceof TypeMirror)) { processingEnv.getMessager().printMessage(Diagnostic.Kind.WARNING, "Unexpected value for include: " + include + " in " + module, module); continue; } TypeElement includedModule = (TypeElement) typeUtils.asElement((TypeMirror) include); collectIncludesRecursively(includedModule, result, path); } }

Target:
void collectIncludesRecursively( TypeElement module, Map<String, TypeElement> result, Deque<String> path) { Map<String, Object> annotation = CodeGen.getAnnotation(Module.class, module); if (annotation == null) { throw new ModuleValidationException("No @Module on " + module, module); } String name = module.getQualifiedName().toString(); if (path.contains(name)) { StringBuilder message = new StringBuilder("Module Inclusion Cycle: "); if (path.size() == 1) { message.append(name).append(" includes itself directly."); } else { String current = null; String includer = name; for (int i = 0; path.size() > 0; i++) { current = includer; includer = path.pop(); message.append("\n").append(i).append(". ") .append(current).append(" included by ").append(includer); } message.append("\n0. ").append(name); } throw new ModuleValidationException(message.toString(), module); } result.put(name, module); Types typeUtils = processingEnv.getTypeUtils(); List<Object> seedModules = new ArrayList<Object>(); seedModules.addAll(Arrays.asList((Object[]) annotation.get("includes"))); if (!annotation.get("addsTo").equals(Void.class)) seedModules.add(annotation.get("addsTo")); for (Object include : seedModules) { if (!(include instanceof TypeMirror)) { processingEnv.getMessager().printMessage(Diagnostic.Kind.WARNING, "Unexpected value for include: " + include + " in " + module, module); continue; } TypeElement includedModule = (TypeElement) typeUtils.asElement((TypeMirror) include); path.push(name); collectIncludesRecursively(includedModule, result, path); path.pop(); } }
Source:
private ApplicationReport findApplicationReportFromAppNameOrId(String appNameOrId) { ApplicationReport app = null; if (getApplication(appNameOrId) != null) { app = getApplication(appNameOrId); } else if (getApplicationByName(appNameOrId) != null) { app = getApplicationByName(appNameOrId); } return app; }

Target:
private ApplicationReport findApplicationReportFromAppNameOrId(String appNameOrId) { ApplicationReport app = getApplication(appNameOrId); if (app == null) { app = getApplicationByName(appNameOrId); } return app; }
Source:
private synchronized void handshake() throws TTransportException { Message message; try { message = conn.request(this.connectionSubject, null, this.connectionTimeout); } catch (IOException e) { throw new TTransportException(e); } catch (TimeoutException e) { throw new TTransportException(TTransportException.UNKNOWN, "Handshake timed out", e); } String reply = message.getReplyTo(); if (reply == null || reply.isEmpty() ) { throw new TTransportException("No reply subject on connect."); } String[] subjects = new String(message.getData()).split(" "); if (subjects.length != 3 ) { throw new TTransportException("Invalid connect message."); } String heartbeatListen = subjects[0]; String heartbeatReply = subjects[1]; int deadline; try { deadline = Integer.parseInt(subjects[2]); } catch (NumberFormatException e) { throw new TTransportException("Connection deadline not an integer.", e); } long heartbeatInterval = 0; if (deadline > 0) { heartbeatInterval = deadline; } this.heartbeatListen = heartbeatListen; this.heartbeatReply = heartbeatReply; this.heartbeatInterval = heartbeatInterval; this.listenTo = message.getSubject(); this.writeTo = reply; }

Target:
private void handshake() throws TTransportException { Message message; try { message = conn.request(this.connectionSubject, null, this.connectionTimeout); } catch (IOException e) { throw new TTransportException(e); } catch (TimeoutException e) { throw new TTransportException(TTransportException.TIMED_OUT, "Handshake timed out", e); } String reply = message.getReplyTo(); if (reply == null || reply.isEmpty() ) { throw new TTransportException("No reply subject on connect."); } String[] subjects = new String(message.getData()).split(" "); if (subjects.length != 3 ) { throw new TTransportException("Invalid connect message."); } String heartbeatListen = subjects[0]; String heartbeatReply = subjects[1]; int deadline; try { deadline = Integer.parseInt(subjects[2]); } catch (NumberFormatException e) { throw new TTransportException("Connection deadline not an integer.", e); } long heartbeatInterval = 0; if (deadline > 0) { heartbeatInterval = deadline; } this.heartbeatListen = heartbeatListen; this.heartbeatReply = heartbeatReply; this.heartbeatInterval = heartbeatInterval; this.listenTo = message.getSubject(); this.writeTo = reply; }
Source:
protected FilterCapabilities createFilterCapabilities() { FilterCapabilities caps = new FilterCapabilities(); caps.addAll(SQLDialect.BASE_DBMS_CAPABILITIES); caps.addType(BBOX.class); caps.addType(Contains.class); caps.addType(Crosses.class); caps.addType(Disjoint.class); caps.addType(Equals.class); caps.addType(Intersects.class); caps.addType(Overlaps.class); caps.addType(Touches.class); caps.addType(Within.class); caps.addType(DWithin.class); caps.addType(Beyond.class); caps.addType(FilterFunction_sdonn.class); caps.addType(FilterFunction_area.class); caps.addType(After.class); caps.addType(Before.class); caps.addType(Begins.class); caps.addType(BegunBy.class); caps.addType(During.class); caps.addType(TOverlaps.class); caps.addType(Ends.class); caps.addType(EndedBy.class); caps.addType(TEquals.class); caps.addType(NativeFilter.class); return caps; }

Target:
protected FilterCapabilities createFilterCapabilities() { FilterCapabilities caps = new FilterCapabilities(); caps.addAll(SQLDialect.BASE_DBMS_CAPABILITIES); caps.addType(BBOX.class); caps.addType(Contains.class); caps.addType(Crosses.class); caps.addType(Disjoint.class); caps.addType(Equals.class); caps.addType(Intersects.class); caps.addType(Overlaps.class); caps.addType(Touches.class); caps.addType(Within.class); caps.addType(DWithin.class); caps.addType(Beyond.class); caps.addType(FilterFunction_sdonn.class); caps.addType(FilterFunction_area.class); caps.addType(After.class); caps.addType(Before.class); caps.addType(Begins.class); caps.addType(BegunBy.class); caps.addType(During.class); caps.addType(TOverlaps.class); caps.addType(Ends.class); caps.addType(EndedBy.class); caps.addType(TEquals.class); return caps; }
Source:
public Response getItemData(@HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) @ApiParam(value = "language") String language, @QueryParam("metadata") @ApiParam(value = "metadata selector", required = false) @Nullable String namespaceSelector, @PathParam("itemname") @ApiParam(value = "item name", required = true) String itemname) { final Locale locale = LocaleUtil.getLocale(language); final Set<String> namespaces = namespaceSelector == null ? Collections.emptySet() : Arrays.stream(namespaceSelector.split(",")) .filter(n -> !n.startsWith(MetadataRegistry.INTERNAL_NAMESPACE_PREFIX)) .collect(Collectors.toSet()); logger.debug("Received HTTP GET request at '{}'", uriInfo.getPath()); Item item = getItem(itemname); if (item != null) { logger.debug("Received HTTP GET request at '{}'.", uriInfo.getPath()); EnrichedItemDTO dto = EnrichedItemDTOMapper.map(item, true, null, uriInfo.getBaseUri(), locale); addMetadata(dto, namespaces, null); return JSONResponse.createResponse(Status.OK, dto, null); } else { logger.info("Received HTTP GET request at '{}' for the unknown item '{}'.", uriInfo.getPath(), itemname); return getItemNotFoundResponse(itemname); } }

Target:
public Response getItemData(@HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) @ApiParam(value = "language") String language, @QueryParam("metadata") @ApiParam(value = "metadata selector", required = false) @Nullable String namespaceSelector, @PathParam("itemname") @ApiParam(value = "item name", required = true) String itemname) { final Locale locale = LocaleUtil.getLocale(language); final Set<String> namespaces = splitAndFilterNamespaces(namespaceSelector); logger.debug("Received HTTP GET request at '{}'", uriInfo.getPath()); Item item = getItem(itemname); if (item != null) { logger.debug("Received HTTP GET request at '{}'.", uriInfo.getPath()); EnrichedItemDTO dto = EnrichedItemDTOMapper.map(item, true, null, uriInfo.getBaseUri(), locale); addMetadata(dto, namespaces, null); return JSONResponse.createResponse(Status.OK, dto, null); } else { logger.info("Received HTTP GET request at '{}' for the unknown item '{}'.", uriInfo.getPath(), itemname); return getItemNotFoundResponse(itemname); } }
Source:
protected int poll() throws Exception { final Map<String, Object> args = new HashMap<>(); args.putAll(endpoint.getEndpointProperties()); endpoint.interceptProperties(args); interceptProperties(args); try { final CountDownLatch latch = new CountDownLatch(1); final Object[] result = new Object[1]; final Exception[] error = new Exception[1]; args.put(Olingo4Endpoint.RESPONSE_HANDLER_PROPERTY, new Olingo4ResponseHandler<Object>() { @Override public void onResponse(Object response, Map<String, String> responseHeaders) { result[0] = response; latch.countDown(); } @Override public void onException(Exception ex) { error[0] = ex; latch.countDown(); } @Override public void onCanceled() { error[0] = new RuntimeCamelException("OData HTTP Request cancelled"); latch.countDown(); } }); doInvokeMethod(args); latch.await(); if (error[0] != null) { throw error[0]; } int processed = ApiConsumerHelper.getResultsProcessed(this, result[0], isSplitResult()); if (result[0] instanceof ClientEntitySet && (((ClientEntitySet) result[0]).getEntities().isEmpty())) { return 0; } else { return processed; } } catch (Throwable t) { throw RuntimeCamelException.wrapRuntimeCamelException(t); } }

Target:
protected int poll() throws Exception { final Map<String, Object> args = new HashMap<>(); args.putAll(endpoint.getEndpointProperties()); endpoint.interceptProperties(args); interceptProperties(args); try { final CountDownLatch latch = new CountDownLatch(1); final Object[] result = new Object[1]; final Exception[] error = new Exception[1]; args.put(Olingo4Endpoint.RESPONSE_HANDLER_PROPERTY, new Olingo4ResponseHandler<Object>() { @Override public void onResponse(Object response, Map<String, String> responseHeaders) { result[0] = response; latch.countDown(); } @Override public void onException(Exception ex) { error[0] = ex; latch.countDown(); } @Override public void onCanceled() { error[0] = new RuntimeCamelException("OData HTTP Request cancelled"); latch.countDown(); } }); doInvokeMethod(args); latch.await(); if (error[0] != null) { throw error[0]; } if (result[0] instanceof ClientEntitySet && (((ClientEntitySet) result[0]).getEntities().isEmpty())) { return 0; } else { int processed = ApiConsumerHelper.getResultsProcessed(this, result[0], isSplitResult()); return processed; } } catch (Throwable t) { throw RuntimeCamelException.wrapRuntimeCamelException(t); } }
Source:
public static void showSitePickerForResult(Activity activity, SiteModel site) { Intent intent = createSitePickerIntent(activity, site, false); activity.startActivityForResult(intent, RequestCodes.SITE_PICKER); }

Target:
public static void showSitePickerForResult(Activity activity, SiteModel site) { Intent intent = createSitePickerIntent(activity, site, SitePickerMode.NORMAL); activity.startActivityForResult(intent, RequestCodes.SITE_PICKER); }
Source:
public ElevationModule(ElevationGridCoverageFactory factory) { gridCoverageFactory = factory; cachedElevationsFile = null; readCachedElevations = false; writeCachedElevations = false; elevationUnitMultiplier = 1; }

Target:
public ElevationModule(ElevationGridCoverageFactory factory) { this( factory, null, false, false, 1, true, false ); }
Source:
protected OCFile getCurrentDir() { OCFile file = getFile(); if (file != null) { if (file.isFolder()) { return file; } else if (getStorageManager() != null) { String parentPath = file.getRemotePath().substring(0, file.getRemotePath().lastIndexOf(file.getFileName())); return getStorageManager().getFileByPath(parentPath); } } return null; }

Target:
protected OCFile getCurrentDir() { OCFile file = getFile(); if (file != null) { if (file.isFolder()) { return file; } else if (getStorageManager() != null) { String parentPath = file.getParentRemotePath(); return getStorageManager().getFileByPath(parentPath); } } return null; }
Source:
private int determineDay(long rangeStart, long rangeEnd) { int startDay = toIntExact(Duration.ofMillis(rangeStart).toDays()); int endDay = toIntExact(Duration.ofMillis(rangeEnd).toDays()); if (startDay == endDay) { return toIntExact(startDay); } if ((endDay - startDay) > 1) { return startDay + 1; } long millisInStartDay = Duration.ofDays(endDay).toMillis() - rangeStart; long millisInEndDay = rangeEnd - Duration.ofDays(endDay).toMillis(); return (millisInStartDay >= millisInEndDay) ? startDay : endDay; }

Target:
private static int determineDay(long rangeStart, long rangeEnd) { int startDay = toIntExact(Duration.ofMillis(rangeStart).toDays()); int endDay = toIntExact(Duration.ofMillis(rangeEnd).toDays()); if (startDay == endDay) { return toIntExact(startDay); } if ((endDay - startDay) > 1) { return startDay + 1; } long millisInStartDay = Duration.ofDays(endDay).toMillis() - rangeStart; long millisInEndDay = rangeEnd - Duration.ofDays(endDay).toMillis(); return (millisInStartDay >= millisInEndDay) ? startDay : endDay; }
Source:
public void setUp() { try { GoogleCredential credential = GoogleCredential.getApplicationDefault() .createScoped(Collections.singleton(IamScopes.CLOUD_PLATFORM)); iamService = new Iam.Builder( GoogleNetHttpTransport.newTrustedTransport(), JacksonFactory.getDefaultInstance(), credential) .setApplicationName("service-accounts") .build(); } catch (IOException | GeneralSecurityException e) { System.out.println("Unable to initialize service: \n" + e.toString()); return; } try { serviceAccount = new ServiceAccount(); serviceAccount.setDisplayName("iam-test-account" + new Date().hashCode()); CreateServiceAccountRequest request = new CreateServiceAccountRequest(); request.setAccountId("iam-test-account" + new Date().hashCode()); request.setServiceAccount(serviceAccount); serviceAccount = iamService .projects() .serviceAccounts() .create("projects/" + PROJECT_ID, request) .execute(); } catch (IOException e) { System.out.println("Unable to create service account: \n" + e.toString()); } }

Target:
public void setUp() { try { GoogleCredential credential = GoogleCredential.getApplicationDefault() .createScoped(Collections.singleton(IamScopes.CLOUD_PLATFORM)); iamService = new Iam.Builder( GoogleNetHttpTransport.newTrustedTransport(), JacksonFactory.getDefaultInstance(), credential) .setApplicationName("service-accounts") .build(); } catch (IOException | GeneralSecurityException e) { System.out.println("Unable to initialize service: \n" + e.toString()); return; } try { serviceAccount = new ServiceAccount(); String serviceAccountUuid = UUID.randomUUID().toString().split("-")[0]; serviceAccount.setDisplayName("iam-test-account" + serviceAccountUuid); CreateServiceAccountRequest request = new CreateServiceAccountRequest(); request.setAccountId("iam-test-account" + serviceAccountUuid); request.setServiceAccount(serviceAccount); serviceAccount = iamService .projects() .serviceAccounts() .create("projects/" + PROJECT_ID, request) .execute(); } catch (IOException e) { System.out.println("Unable to create service account: \n" + e.toString()); } }
Source:
public void register(SystemStreamPartition systemStreamPartition, String offset) { if (started.get()) { String exceptionMessage = String.format("KafkaSystemConsumer: %s had started. Registration of ssp: %s, offset: %s failed.", this, systemStreamPartition, offset); throw new SamzaException(exceptionMessage); } if (!Objects.equals(systemStreamPartition.getSystem(), systemName)) { LOG.warn("{}: ignoring SSP {}, because this consumer's system doesn't match.", this, systemStreamPartition); return; } LOG.info("{}: Registering ssp = with offset {}", this, systemStreamPartition, offset); super.register(systemStreamPartition, offset); TopicPartition tp = toTopicPartition(systemStreamPartition); topicPartitionsToSSP.put(tp, systemStreamPartition); String existingOffset = topicPartitionsToOffset.get(tp); if (existingOffset == null || compareOffsets(existingOffset, offset) > 0) { topicPartitionsToOffset.put(tp, offset); } metrics.registerTopicAndPartition(toTopicAndPartition(tp)); }

Target:
public void register(SystemStreamPartition systemStreamPartition, String offset) { if (started.get()) { String exceptionMessage = String.format("KafkaSystemConsumer: %s had started. Registration of ssp: %s, offset: %s failed.", this, systemStreamPartition, offset); throw new SamzaException(exceptionMessage); } if (!Objects.equals(systemStreamPartition.getSystem(), systemName)) { LOG.warn("{}: ignoring SSP {}, because this consumer's system doesn't match.", this, systemStreamPartition); return; } LOG.info("{}: Registering ssp: with offset: {}", this, systemStreamPartition, offset); super.register(systemStreamPartition, offset); TopicPartition topicPartition = toTopicPartition(systemStreamPartition); String existingOffset = topicPartitionsToOffset.get(topicPartition); if (existingOffset == null || compareOffsets(existingOffset, offset) > 0) { topicPartitionsToOffset.put(topicPartition, offset); } metrics.registerTopicAndPartition(toTopicAndPartition(topicPartition)); }
Source:
private TestRunner() { this.configs = new HashMap<>(); this.inMemoryScope = RandomStringUtils.random(10, true, true); configs.put(JobConfig.JOB_NAME(), JOB_NAME); configs.put(JobConfig.PROCESSOR_ID(), "1"); configs.put(JobCoordinatorConfig.JOB_COORDINATOR_FACTORY, PassthroughJobCoordinatorFactory.class.getName()); configs.put(TaskConfig.GROUPER_FACTORY(), SingleContainerGrouperFactory.class.getName()); configs.put(JobConfig.JOB_NON_LOGGED_STORE_BASE_DIR(), FileSystems.getDefault().getPath("/tmp/" + this.inMemoryScope).toAbsolutePath().toString() + File.separator); configs.put(JobConfig.JOB_LOGGED_STORE_BASE_DIR(), FileSystems.getDefault().getPath("/tmp/" + this.inMemoryScope).toAbsolutePath().toString() + File.separator); addConfig(JobConfig.JOB_DEFAULT_SYSTEM(), JOB_DEFAULT_SYSTEM); addConfig(ClusterManagerConfig.CLUSTER_MANAGER_HOST_AFFINITY_ENABLED, Boolean.FALSE.toString()); addConfig(InMemorySystemConfig.INMEMORY_SCOPE, inMemoryScope); addConfig(new InMemorySystemDescriptor(JOB_DEFAULT_SYSTEM).withInMemoryScope(inMemoryScope).toConfig()); }

Target:
private TestRunner() { this.configs = new HashMap<>(); this.inMemoryScope = RandomStringUtils.random(10, true, true); configs.put(JobConfig.JOB_NAME(), JOB_NAME); configs.put(JobConfig.PROCESSOR_ID(), "1"); configs.put(JobCoordinatorConfig.JOB_COORDINATOR_FACTORY, PassthroughJobCoordinatorFactory.class.getName()); configs.put(TaskConfig.GROUPER_FACTORY(), SingleContainerGrouperFactory.class.getName()); configs.put(JobConfig.JOB_NON_LOGGED_STORE_BASE_DIR(), new File(System.getProperty("java.io.tmpdir"), this.inMemoryScope).getAbsolutePath()); configs.put(JobConfig.JOB_LOGGED_STORE_BASE_DIR(), new File(System.getProperty("java.io.tmpdir"), this.inMemoryScope).getAbsolutePath()); addConfig(JobConfig.JOB_DEFAULT_SYSTEM(), JOB_DEFAULT_SYSTEM); addConfig(ClusterManagerConfig.CLUSTER_MANAGER_HOST_AFFINITY_ENABLED, Boolean.FALSE.toString()); addConfig(InMemorySystemConfig.INMEMORY_SCOPE, inMemoryScope); addConfig(new InMemorySystemDescriptor(JOB_DEFAULT_SYSTEM).withInMemoryScope(inMemoryScope).toConfig()); }
Source:
protected boolean canDoAction() { boolean isInstanceType = getParameters().getTemplateType() == VmEntityType.INSTANCE_TYPE; if (getVdsGroup() == null && !isInstanceType) { return failCanDoAction(VdcBllMessages.VDS_CLUSTER_IS_NOT_VALID); } if (!isVmPriorityValueLegal(getParameters().getMasterVm().getPriority(), getReturnValue() .getCanDoActionMessages())) { return false; } if (isVmInDb && getVm().getStatus() != VMStatus.Down) { return failCanDoAction(VdcBllMessages.VMT_CANNOT_CREATE_TEMPLATE_FROM_DOWN_VM); } if (!isTemplateVersion() && isVmTemlateWithSameNameExist(getVmTemplateName())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_NAME_ALREADY_USED); } if (isTemplateVersion()) { VmTemplate userSelectedBaseTemplate = getBaseTemplate(); if (userSelectedBaseTemplate == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_DOES_NOT_EXIST); } else if (!userSelectedBaseTemplate.isBaseTemplate()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_VERSION_CANNOT_BE_BASE_TEMPLATE); } } if (!setAndValidateDiskProfiles()) { return false; } if(!setAndValidateCpuProfile()) { return false; } Iterator<DiskImage> it = diskInfoDestinationMap.values().iterator(); while (it.hasNext()) { if (it.next().getDiskAlias().isEmpty()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_CANNOT_BE_CREATED_WITH_EMPTY_DISK_ALIAS); } } if (isInstanceType) { return true; } else { return doClusterRelatedChecks(); } }

Target:
protected boolean canDoAction() { boolean isInstanceType = getParameters().getTemplateType() == VmEntityType.INSTANCE_TYPE; if (getVdsGroup() == null && !isInstanceType) { return failCanDoAction(VdcBllMessages.VDS_CLUSTER_IS_NOT_VALID); } if (!isVmPriorityValueLegal(getParameters().getMasterVm().getPriority(), getReturnValue() .getCanDoActionMessages())) { return false; } if (isVmInDb && getVm().getStatus() != VMStatus.Down) { return failCanDoAction(VdcBllMessages.VMT_CANNOT_CREATE_TEMPLATE_FROM_DOWN_VM); } if (!isTemplateVersion() && isVmTemlateWithSameNameExist(getVmTemplateName())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_NAME_ALREADY_USED); } if (isTemplateVersion()) { VmTemplate userSelectedBaseTemplate = getBaseTemplate(); if (userSelectedBaseTemplate == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_DOES_NOT_EXIST); } else if (!userSelectedBaseTemplate.isBaseTemplate()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_VERSION_CANNOT_BE_BASE_TEMPLATE); } } if (!setAndValidateDiskProfiles()) { return false; } if(!setAndValidateCpuProfile()) { return false; } for (DiskImage diskImage : diskInfoDestinationMap.values()) { if ( StringUtils.isEmpty(diskImage.getDiskAlias()) ) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_CANNOT_BE_CREATED_WITH_EMPTY_DISK_ALIAS); } } if (isInstanceType) { return true; } else { return doClusterRelatedChecks(); } }
Source:
private void setupJackson(Injector injector, final ObjectMapper mapper) { final GuiceAnnotationIntrospector guiceIntrospector = new GuiceAnnotationIntrospector(); mapper.setInjectableValues(injector.getInstance(InjectableValues.class)); mapper.setAnnotationIntrospectors( new AnnotationIntrospectorPair( guiceIntrospector, mapper.getSerializationConfig().getAnnotationIntrospector() ), new AnnotationIntrospectorPair( guiceIntrospector, mapper.getDeserializationConfig().getAnnotationIntrospector() ) ); }

Target:
private void setupJackson(Injector injector, final ObjectMapper mapper) { final GuiceAnnotationIntrospector guiceIntrospector = new GuiceAnnotationIntrospector(); mapper.setInjectableValues(new GuiceInjectableValues(injector)); mapper.setAnnotationIntrospectors( new AnnotationIntrospectorPair( guiceIntrospector, mapper.getSerializationConfig().getAnnotationIntrospector() ), new AnnotationIntrospectorPair( guiceIntrospector, mapper.getDeserializationConfig().getAnnotationIntrospector() ) ); }
Source:
private boolean cacheReadRequest(ReadOptions options) { if (!runtime.getParameters().isCacheDisabled() && options.isClientCacheable()) { return true; } return false; }

Target:
private boolean cacheReadRequest(ReadOptions options) { if (runtime.getParameters().isCacheDisabled() && options.isClientCacheable()) { log.warn("read: Runtime cache is disabled, but read request is requesting to cache"); } return !runtime.getParameters().isCacheDisabled() && options.isClientCacheable(); }
Source:
public void downloadAllNovelInfo() { touchedForDownload = language + " Light Novels information"; executeDownloadTask(listItems); }

Target:
public void downloadAllNovelInfo() { if (language != null) { touchedForDownload = language + " Light Novels information"; executeDownloadTask(listItems); } }
Source:
protected boolean canStoreClassClassic(final SootClass child, final SootClass parent) { SootClass sc = child; final boolean parentIsInterface = parent.isInterface(); while (sc != null) { if (sc.getName().equals(parent.getName())) { return true; } if (parentIsInterface) { for (SootClass interf : sc.getInterfaces()) { if (canStoreClassClassic(interf, parent)) { return true; } } } sc = sc.getSuperclassUnsafe(); } return false; }

Target:
protected boolean canStoreClassClassic(final SootClass child, final SootClass parent) { SootClass sc = child; final boolean parentIsInterface = parent.isInterface(); while (sc != null) { if (sc == parent) { return true; } if (parentIsInterface) { for (SootClass interf : sc.getInterfaces()) { if (canStoreClassClassic(interf, parent)) { return true; } } } sc = sc.getSuperclassUnsafe(); } return false; }
Source:
private void logBrickStatusChange(GlusterVolumeEntity vol, GlusterStatus status, GlusterBrickEntity brick) { logUtil.logAuditMessage(vol.getClusterId(), vol, null, AuditLogType.GLUSTER_BRICK_STATUS_CHANGED, new HashMap<String, String>() { { put(GlusterConstants.BRICK_PATH, brick.getQualifiedName()); put(GlusterConstants.OPTION_OLD_VALUE, brick.getStatus().toString()); put(GlusterConstants.OPTION_NEW_VALUE, status.toString()); put("source", "gluster event"); } }); }

Target:
private void logBrickStatusChange(GlusterVolumeEntity vol, GlusterStatus status, GlusterBrickEntity brick) { Map<String, String> customValues = new HashMap<>(); customValues.put(GlusterConstants.BRICK_PATH, brick.getQualifiedName()); customValues.put(GlusterConstants.OPTION_OLD_VALUE, brick.getStatus().toString()); customValues.put(GlusterConstants.OPTION_NEW_VALUE, status.toString()); customValues.put(GlusterConstants.SOURCE, GlusterConstants.SOURCE_EVENT); logUtil.logAuditMessage(vol.getClusterId(), vol, null, AuditLogType.GLUSTER_BRICK_STATUS_CHANGED, customValues); }