auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static DynamicClassLoader getClassLoader(final PName tenantId, final String jarPath) { DynamicClassLoader cl = tenantIdSpecificCls.get(tenantId); String parent = null; if (cl != null) return cl; if(jarPath != null && !jarPath.isEmpty()) { cl = pathSpecificCls.get(jarPath); if (cl != null) return cl; Path path = new Path(jarPath); if(jarPath.endsWith(".jar")) { parent = path.getParent().toString(); } else { parent = path.toString(); } } if (jarPath == null || jarPath.isEmpty() || config.get(DYNAMIC_JARS_DIR_KEY) != null && (parent != null && parent.equals(config.get(DYNAMIC_JARS_DIR_KEY)))) { Lock lock = locker.acquireLock(tenantId.getString()); try { cl = tenantIdSpecificCls.get(tenantId); if (cl == null) { cl = new DynamicClassLoader(config, UDFExpression.class.getClassLoader()); } DynamicClassLoader prev = tenantIdSpecificCls.putIfAbsent(tenantId, cl); if (prev != null) { cl = prev; } return cl; } finally { lock.unlock(); } } else { Lock lock = pathLocker.acquireLock(jarPath); try { cl = pathSpecificCls.get(jarPath); if (cl == null) { Configuration conf = HBaseConfiguration.create(config); conf.set(DYNAMIC_JARS_DIR_KEY, parent); cl = new DynamicClassLoader(conf, UDFExpression.class.getClassLoader()); } DynamicClassLoader prev = pathSpecificCls.putIfAbsent(jarPath, cl); if (prev != null) { cl = prev; } return cl; } finally { lock.unlock(); } } }

Target:
public static DynamicClassLoader getClassLoader(final PName tenantId, final String jarPath) { DynamicClassLoader cl = tenantIdSpecificCls.get(tenantId); String parent = null; if (cl != null) return cl; if(jarPath != null && !jarPath.isEmpty()) { cl = pathSpecificCls.get(jarPath); if (cl != null) return cl; Path path = new Path(jarPath); if(jarPath.endsWith(".jar")) { parent = path.getParent().toString(); } else { parent = path.toString(); } } if (jarPath == null || jarPath.isEmpty() || config.get(DYNAMIC_JARS_DIR_KEY) != null && (parent != null && parent.equals(config.get(DYNAMIC_JARS_DIR_KEY)))) { cl = tenantIdSpecificCls.get(tenantId); if (cl == null) { cl = new DynamicClassLoader(config, UDFExpression.class.getClassLoader()); } DynamicClassLoader prev = tenantIdSpecificCls.putIfAbsent(tenantId, cl); if (prev != null) { cl = prev; } return cl; } else { cl = pathSpecificCls.get(jarPath); if (cl == null) { Configuration conf = HBaseConfiguration.create(config); conf.set(DYNAMIC_JARS_DIR_KEY, parent); cl = new DynamicClassLoader(conf, UDFExpression.class.getClassLoader()); } DynamicClassLoader prev = pathSpecificCls.putIfAbsent(jarPath, cl); if (prev != null) { cl = prev; } return cl; } }
Source:
public void testDynamicImport() throws Exception { File testData = getTestData("dymamicImport", "testData/dynamicImport"); IInstallableUnit iu = BundlesAction.createBundleIU(BundlesAction.createBundleDescription(testData), null, new PublisherInfo()); Collection<IRequirement> requirements = iu.getRequirements(); for (IRequirement req : requirements) System.out.println("------> " + req); verifyRequirement(requirements, TESTDYN_REQ_EE_FILTER, 0, 1, true); assertEquals(1, requirements.size()); }

Target:
public void testDynamicImport() throws Exception { File testData = getTestData("dymamicImport", "testData/dynamicImport"); IInstallableUnit iu = BundlesAction.createBundleIU(BundlesAction.createBundleDescription(testData), null, new PublisherInfo()); Collection<IRequirement> requirements = iu.getRequirements(); verifyRequirement(requirements, TESTDYN_REQ_EE_FILTER, 0, 1, true); assertEquals(1, requirements.size()); }
Source:
public String getRecommendationPosition() { return "" + JavaRenameRecommend.result.recommendStartPosition + "," + JavaRenameRecommend.result.recommendOriginalName.length(); }

Target:
public String getRecommendationPosition() { return "" + JavaRenameRecommend.result.getRecommendStartPosition() + "," + JavaRenameRecommend.result.getRecommendOriginalName().length(); }
Source:
private String readStringUntil(char end) throws IOException { StringBuilder sb = new StringBuilder(); int ch; while ((ch = inputStream.read()) != -1) { if (ch == end) { return sb.toString(); } else { sb.append((char) ch); } } throw new IOException("readStringUntil(): end of stream reached. Read: " + sb.toString() + " while waiting for '"+end+"'"); }

Target:
private String readStringUntil(char end) throws IOException { StringBuilder sb = new StringBuilder(); int ch; while ((ch = inputStream.read()) != -1) { if (ch == end) { return sb.toString(); } else { sb.append((char) ch); } } throw new IOException("readStringUntil(): end of stream reached. " + "Read: \"" + sb.toString() + "\" while waiting for " + formatChar(end)); }
Source:
public RevCommit call() throws GitAPIException { checkCallable(); RevWalk revWalk = null; try { revWalk = new RevWalk(repo); Ref headRef = repo.getRef(Constants.HEAD); if (headRef == null) throw new NoHeadException( JGitText.get().commitOnRepoWithoutHEADCurrentlyNotSupported); RevCommit headCommit = revWalk.lookupCommit(headRef.getObjectId()); for (Ref src : commits) { ObjectId srcObjectId = src.getPeeledObjectId(); if (srcObjectId == null) srcObjectId = src.getObjectId(); RevCommit srcCommit = revWalk.parseCommit(srcObjectId); if (srcCommit.getParentCount() != 1) { throw new InvalidCherryPickCommit( JGitText.get().canOnlyCherryPickCommitsWithOneParent); } RevCommit srcParent = revWalk.parseCommit(srcCommit .getParent(0)); ResolveMerger merger = (ResolveMerger) MergeStrategy.RESOLVE .newMerger(repo); merger.setWorkingTreeIt(new FileTreeIterator(repo)); merger.setBase(srcParent.getTree()); if (merger.merge(headCommit, srcCommit)) { DirCacheCheckout dco = new DirCacheCheckout(repo, headCommit.getTree(), repo.lockDirCache(), merger.getResultTreeId()); dco.setFailOnConflict(true); dco.checkout(); RevCommit newHead = new Git(getRepository()).commit() .setMessage(srcCommit.getFullMessage()) .setAuthor(srcCommit.getAuthorIdent()).call(); return newHead; } else { return null; } } } catch (IOException e) { throw new JGitInternalException( MessageFormat.format( JGitText.get().exceptionCaughtDuringExecutionOfCherryPickCommand, e), e); } finally { if (revWalk != null) revWalk.release(); } return null; }

Target:
public RevCommit call() throws GitAPIException { RevCommit newHead = null; checkCallable(); RevWalk revWalk = new RevWalk(repo); try { Ref headRef = repo.getRef(Constants.HEAD); if (headRef == null) throw new NoHeadException( JGitText.get().commitOnRepoWithoutHEADCurrentlyNotSupported); RevCommit headCommit = revWalk.lookupCommit(headRef.getObjectId()); for (Ref src : commits) { ObjectId srcObjectId = src.getPeeledObjectId(); if (srcObjectId == null) srcObjectId = src.getObjectId(); RevCommit srcCommit = revWalk.parseCommit(srcObjectId); if (srcCommit.getParentCount() != 1) { throw new InvalidCherryPickCommit( JGitText.get().canOnlyCherryPickCommitsWithOneParent); } RevCommit srcParent = revWalk.parseCommit(srcCommit .getParent(0)); ResolveMerger merger = (ResolveMerger) MergeStrategy.RESOLVE .newMerger(repo); merger.setWorkingTreeIterator(new FileTreeIterator(repo)); merger.setBase(srcParent.getTree()); if (merger.merge(headCommit, srcCommit)) { DirCacheCheckout dco = new DirCacheCheckout(repo, headCommit.getTree(), repo.lockDirCache(), merger.getResultTreeId()); dco.setFailOnConflict(true); dco.checkout(); newHead = new Git(getRepository()).commit() .setMessage(srcCommit.getFullMessage()) .setAuthor(srcCommit.getAuthorIdent()).call(); cherryPickedRefs.add(src); } else { return null; } } } catch (IOException e) { throw new JGitInternalException( MessageFormat.format( JGitText.get().exceptionCaughtDuringExecutionOfCherryPickCommand, e), e); } finally { revWalk.release(); } return newHead; }
Source:
protected static void writeProperties(JsonGenerator jg, DocumentModel doc, String schema, ServletRequest request) throws IOException { Collection<Property> properties = doc.getPropertyObjects(schema); if (properties.isEmpty()) { return; } SchemaManager schemaManager = Framework.getService(SchemaManager.class); String prefix = schemaManager.getSchema(schema).getNamespace().prefix; if (prefix == null || prefix.length() == 0) { prefix = schema; } JSONPropertyWriter writer = JSONPropertyWriter.create().writeNull(false).writeEmpty(false).prefix(prefix); if (request != null) { DownloadService downloadService = Framework.getService(DownloadService.class); String blobUrlPrefix = VirtualHostHelper.getBaseURL(request) + downloadService.getDownloadUrl(doc, null, null) + "/"; writer.filesBaseUrl(blobUrlPrefix); } for (Property p : properties) { try { writer.writeProperty(jg, p); } catch (ClassCastException e) { var nuxeoException = new NuxeoException(e); nuxeoException.addInfo( String.format("writing JSON property failed on document: %s for property: %s", doc, p)); throw nuxeoException; } } }

Target:
protected static void writeProperties(JsonGenerator jg, DocumentModel doc, String schema, ServletRequest request) throws IOException { Collection<Property> properties = doc.getPropertyObjects(schema); if (properties.isEmpty()) { return; } SchemaManager schemaManager = Framework.getService(SchemaManager.class); String prefix = schemaManager.getSchema(schema).getNamespace().prefix; if (prefix == null || prefix.length() == 0) { prefix = schema; } JSONPropertyWriter writer = JSONPropertyWriter.create().writeNull(false).writeEmpty(false).prefix(prefix); if (request != null) { DownloadService downloadService = Framework.getService(DownloadService.class); String blobUrlPrefix = VirtualHostHelper.getBaseURL(request) + downloadService.getDownloadUrl(doc, null, null) + "/"; writer.filesBaseUrl(blobUrlPrefix); } for (Property p : properties) { try { writer.writeProperty(jg, p); } catch (ClassCastException e) { throw new NuxeoException( String.format("writing JSON property failed on document: %s for property: %s", doc, p), e); } } }
Source:
public void updateDNS() { synchronized (sync) { if (shutdown) { return; } long ttl = TimeUnit.SECONDS.convert(period, periodUnit); try { List<ResolveResult> resolveResults = resolver.resolve(); List<HostAndPort> hosts = Lists.newArrayListWithCapacity(resolveResults.size()); for (ResolveResult resolveResult : resolveResults) { hosts.add(HostAndPort.fromParts(resolveResult.getHost(), resolveResult.getPort())); ttl = Math.min(ttl, resolveResult.getTtl()); } List<HostAndPort> newAddresses = Ordering.from(HostAndPortComparator.INSTANCE).sortedCopy(hosts); if (!newAddresses.equals(addresses)) { addresses = newAddresses; log.info("Connecting to " + newAddresses); List<AddressAndClient> addressAndClients = getAddressesAndClients(newAddresses); setPendingClient(addressAndClients); } } finally { long delay = clamp(MIN_DNS_WAIT_TIME, MAX_DNS_WAIT_TIME, ttl); refreshJob = this.executor.schedule(this::updateDNS, delay, TimeUnit.SECONDS); } } }

Target:
public void updateDNS() { synchronized (sync) { if (shutdown) { return; } long ttl = this.ttl; try { List<ResolveResult> resolveResults = resolver.resolve(); if (resolveResults.isEmpty()) { return; } List<HostAndPort> hosts = Lists.newArrayListWithCapacity(resolveResults.size()); for (ResolveResult resolveResult : resolveResults) { hosts.add(HostAndPort.fromParts(resolveResult.getHost(), resolveResult.getPort())); ttl = Math.min(ttl, resolveResult.getTtl()); } final ImmutableSet<HostAndPort> newAddresses = resolveResults .stream() .map(result -> HostAndPort.fromParts(result.getHost(), result.getPort())) .collect(ImmutableSet.toImmutableSet()); final long resolvedTtl = resolveResults.stream().mapToLong(ResolveResult::getTtl).min().orElse(Long.MAX_VALUE); ttl = Math.min(ttl, resolvedTtl); final Set<HostAndPort> currentAddresses = clients.keySet(); if (!newAddresses.equals(currentAddresses)) { final ImmutableSet<HostAndPort> toRemove = Sets.difference(currentAddresses, newAddresses).immutableCopy(); final Sets.SetView<HostAndPort> toAdd = Sets.difference(newAddresses, currentAddresses); if (!toAdd.isEmpty()) { log.info("Connecting to " + toAdd); } if (!toRemove.isEmpty()) { log.info("Scheduling disconnect from " + toRemove); } for (final HostAndPort host : toAdd) { final RawMemcacheClient newClient = connector.connect(host); newClient.registerForConnectionChanges(listener); clients.put(host, newClient); } final ImmutableList.Builder<RawMemcacheClient> removedClients = ImmutableList.builder(); for (final HostAndPort host : toRemove) { final RawMemcacheClient removed = clients.remove(host); removed.unregisterForConnectionChanges(listener); removedClients.add(removed); } setPendingClient(removedClients); } } finally { long delay = clamp(MIN_DNS_WAIT_TIME, MAX_DNS_WAIT_TIME, ttl); refreshJob = this.executor.schedule(this::updateDNS, delay, TimeUnit.SECONDS); } } }
Source:
public Map<String, String> getLabelsMap() { if(label == null) { return ImmutableMap.of("jenkins/" + DEFAULT_LABEL, "true"); } ImmutableMap.Builder<String, String> builder = ImmutableMap.builder(); getLabelSet().stream().map(Objects::toString).sorted().forEach((atom) -> { builder.put("jenkins/" + sanitizeLabel(atom), "true"); }); return builder.build(); }

Target:
public Map<String, String> getLabelsMap() { if (label == null) { return ImmutableMap.of( "jenkins/label", DEFAULT_LABEL, "jenkins/label-digest", "0" ); } else { return ImmutableMap.of( "jenkins/label", sanitizeLabel(label), "jenkins/label-digest", LABEL_DIGEST_FUNCTION.hashString(label).toString() ); } }
Source:
private void notifyLeaderChanges( Outcome outcome ) { LeaderInfo leaderInfo = new LeaderInfo( outcome.getLeader(), outcome.getTerm() ); boolean isStepDown = outcome.isSteppingDown(); if ( isStepDown ) { leaderInfo.stepDown(); } for ( LeaderListener listener : leaderListeners ) { if ( isStepDown ) { listener.onLeaderStepDown( leaderInfo ); } listener.onLeaderSwitch( leaderInfo ); } }

Target:
private void notifyLeaderChanges( Outcome outcome ) { LeaderInfo leaderInfo = new LeaderInfo( outcome.getLeader(), outcome.getTerm(), outcome.isSteppingDown() ); for ( LeaderListener listener : leaderListeners ) { if ( outcome.isSteppingDown() ) { listener.onLeaderStepDown( leaderInfo ); } listener.onLeaderSwitch( leaderInfo ); } }
Source:
public void provision(OpenShiftEnvironment osEnv, RuntimeIdentity identity) throws InfrastructureException { if (!supportArbitraryUser(osEnv.getAttributes())) { return; } Set<String> recipeMachineNames = osEnv .getMachines() .entrySet() .stream() .filter(e -> e.getValue().getAttributes() != null) .filter( e -> RECIPE_CONTAINER_SOURCE.equals( e.getValue().getAttributes().get(CONTAINER_SOURCE_ATTRIBUTE))) .map(Entry::getKey) .collect(Collectors.toSet()); for (PodData podData : osEnv.getPodsData().values()) { for (Container container : podData.getSpec().getContainers()) { String machineName = Names.machineName(podData, container); if (recipeMachineNames.contains(machineName)) { rewriteContainerCommand(container); } } } }

Target:
public void provision(OpenShiftEnvironment osEnv, RuntimeIdentity identity) throws InfrastructureException { if (!supportArbitraryUser(osEnv.getAttributes())) { return; } Set<String> recipeMachineNames = osEnv .getMachines() .entrySet() .stream() .filter( e -> RECIPE_CONTAINER_SOURCE.equals( e.getValue().getAttributes().get(CONTAINER_SOURCE_ATTRIBUTE))) .map(Entry::getKey) .collect(Collectors.toSet()); for (PodData podData : osEnv.getPodsData().values()) { for (Container container : podData.getSpec().getContainers()) { String machineName = Names.machineName(podData, container); if (recipeMachineNames.contains(machineName)) { rewriteContainerCommand(container); } } } }
Source:
public List<SecurityTeam> getSecurityTeams(PerunSession sess) throws PrivilegeException, InternalErrorException { Utils.checkPerunSession(sess); if (!AuthzResolver.authorizedInternal(sess, "getSecurityTeams_policy")) { throw new PrivilegeException("getSecurityTeams"); } else { List<SecurityTeam> securityTeams = getSecurityTeamsManagerBl().getAllSecurityTeams(sess); securityTeams.removeIf(st -> { try { return !AuthzResolver.authorizedInternal(sess, "filter-getSecurityTeams_policy", Collections.singletonList(st)); } catch (InternalErrorException e) { return true; } }); return securityTeams; } }

Target:
public List<SecurityTeam> getSecurityTeams(PerunSession sess) throws PrivilegeException, InternalErrorException { Utils.checkPerunSession(sess); if (!AuthzResolver.authorizedInternal(sess, "getSecurityTeams_policy")) { throw new PrivilegeException("getSecurityTeams"); } else { List<SecurityTeam> securityTeams = getSecurityTeamsManagerBl().getAllSecurityTeams(sess); securityTeams.removeIf(st -> !AuthzResolver.authorizedInternal(sess, "filter-getSecurityTeams_policy", Collections.singletonList(st))); return securityTeams; } }
Source:
private void processSingleResult(String resultPath, Matcher m) { DispoItemData item = datIdToItem.get(generateDatId(m.group(1), m.group(2))); String location = m.group(3); String text = ""; Discrepancy matchingDiscrepancy = matchDiscrepancy(location, item.getDiscrepanciesList()); if (matchingDiscrepancy != null) { text = matchingDiscrepancy.getText(); Map<String, Discrepancy> discrepancies = item.getDiscrepanciesList(); discrepancies.remove(matchingDiscrepancy.getId()); item.setDiscrepanciesList(discrepancies); addAnnotationForForCoveredLine(item, location, Test_Unit_Resolution, resultPath, text); } else { System.out.println(); } }

Target:
private void processSingleResult(String resultPath, Matcher m) { DispoItemData item = datIdToItem.get(generateDatId(m.group(1), m.group(2))); if(item != null) { String location = m.group(3); String text = ""; Discrepancy matchingDiscrepancy = matchDiscrepancy(location, item.getDiscrepanciesList()); if (matchingDiscrepancy != null) { text = matchingDiscrepancy.getText(); Map<String, Discrepancy> discrepancies = item.getDiscrepanciesList(); discrepancies.remove(matchingDiscrepancy.getId()); item.setDiscrepanciesList(discrepancies); addAnnotationForForCoveredLine(item, location, Test_Unit_Resolution, text, resultPath); } } }
Source:
public void afterPropertiesSet() throws Exception { this.channelFactory = beanFactory.getBean(ChannelFactory.class); Assert.notNull(this.channelFactory, "ChannelFactory must not be null."); }

Target:
public void afterPropertiesSet() throws Exception { ReflectionUtils.doWithMethods(type, new ReflectionUtils.MethodCallback() { @Override public void doWith(Method method) throws IllegalArgumentException { try { Input input = AnnotationUtils.findAnnotation(method, Input.class); if (input != null) { String name = BindingBeanDefinitionRegistryUtils.getChannelName(input, method); MessageChannel sharedChannel = locateSharedChannel(name); if (sharedChannel == null) { inputs.put(name, new ChannelHolder( channelFactory.createChannel(name, method.getReturnType()), true)); } else { configureSharedMessageChannel(name, method.getReturnType(), sharedChannel); } } } catch (Exception e) { throw new RuntimeException(e); } } }); ReflectionUtils.doWithMethods(type, new ReflectionUtils.MethodCallback() { @Override public void doWith(Method method) throws IllegalArgumentException { try { Output output = AnnotationUtils.findAnnotation(method, Output.class); if (output != null) { String name = BindingBeanDefinitionRegistryUtils.getChannelName(output, method); Class<?> messageChannelType = method.getReturnType(); MessageChannel sharedChannel = locateSharedChannel(name); if (sharedChannel == null) { outputs.put(name, new ChannelHolder( channelFactory.createChannel(name, method.getReturnType()), true)); } else { configureSharedMessageChannel(name, method.getReturnType(), sharedChannel); } } } catch (Exception e) { throw new RuntimeException(e); } } }); }
Source:
static Map<Long, ConfigGroup> collectConfigGroupsWithoutServiceName() { Map<Long, ConfigGroup> configGroupMap = new HashMap<>(); Clusters clusters = injector.getInstance(Clusters.class); Map<String, Cluster> clusterMap = clusters.getClusters(); if (MapUtils.isEmpty(clusterMap)) return configGroupMap; for (Cluster cluster : clusterMap.values()) { Map<Long, ConfigGroup> configGroups = cluster.getConfigGroups(); if (MapUtils.isEmpty(configGroups)) continue; for (ConfigGroup configGroup : configGroups.values()) { if (StringUtils.isEmpty(configGroup.getServiceName())) { configGroupMap.put(configGroup.getId(), configGroup); } } } return configGroupMap; }

Target:
static Map<Long, ConfigGroup> collectConfigGroupsWithoutServiceName() { Map<Long, ConfigGroup> configGroupMap = new HashMap<>(); Clusters clusters = injector.getInstance(Clusters.class); Map<String, Cluster> clusterMap = clusters.getClusters(); if (MapUtils.isEmpty(clusterMap)) return configGroupMap; for (Cluster cluster : clusterMap.values()) { Map<Long, ConfigGroup> configGroups = cluster.getConfigGroups(); if (MapUtils.isEmpty(configGroups)) { continue; } for (ConfigGroup configGroup : configGroups.values()) { if (StringUtils.isEmpty(configGroup.getServiceName())) { configGroupMap.put(configGroup.getId(), configGroup); } } } return configGroupMap; }
Source:
public void test(@ArquillianResource URL url) throws Exception { HttpResponse response; HttpGet httpget = new HttpGet(url.toString() + "ejb-security"); String headerValue = java.util.Base64.getEncoder().encodeToString("user:password".getBytes()); Assert.assertNotNull(headerValue); httpget.addHeader("Authorization", "Basic " + headerValue); String text; try (CloseableHttpClient httpclient = HttpClients.createDefault()){ response = httpclient.execute(httpget); text = Utils.getContent(response); Assert.assertFalse(text.contains("java.lang.NullPointerException")); } catch (IOException e) { throw new RuntimeException("Servlet response IO exception", e); } }

Target:
public void test(@ArquillianResource URL url) throws Exception { CredentialsProvider credentialsProvider = new BasicCredentialsProvider(); credentialsProvider.setCredentials(new AuthScope(url.getHost(), url.getPort()), new UsernamePasswordCredentials(USER, PASSWORD)); try (CloseableHttpClient httpclient = HttpClients.custom() .setDefaultCredentialsProvider(credentialsProvider) .build()) { HttpGet httpget = new HttpGet(url.toExternalForm() + "SecuredEJBServlet/"); HttpResponse response = httpclient.execute(httpget); assertNotNull("Response is 'null', we expected non-null response!", response); String text = Utils.getContent(response); assertEquals(200, response.getStatusLine().getStatusCode()); assertTrue("User principal different from what we expected!", text.contains("Principal: " + USER)); assertTrue("Remote user different from what we expected!", text.contains("Remote User: " + USER)); assertTrue("Authentication type different from what we expected!", text.contains("Authentication Type: BASIC")); } }
Source:
private static <T> T createProxyForZeroNodes(Class<T> type) { return Reflection.newProxy(type, (unused1, unused2, unused3) -> { throw new ServiceNotAvailableException("The " + type.getSimpleName() + " is currently unavailable," + " because we don't know how to talk to it (we think there are zero nodes)."); }); }

Target:
private static <T> T createProxyForZeroNodes(Class<T> type) { return Reflection.newProxy(type, (unused1, unused2, unused3) -> { throw new ServiceNotAvailableException("The " + type.getSimpleName() + " is currently unavailable," + " because configuration contains zero servers."); }); }
Source:
public void receiveToNeighbor(Iterator<PathMergeMessage> msgIterator) { VertexValueWritable value = getVertexValue(); if (verbose) LOG.fine("Iteration " + getSuperstep() + "\r\n" + "before update from dead vertex: " + value); while (msgIterator.hasNext()) { PathMergeMessage incomingMsg = msgIterator.next(); EDGETYPE deleteToMe = EDGETYPE.fromByte(incomingMsg.getFlag()); EDGETYPE aliveToMe = EDGETYPE.fromByte((short) (incomingMsg.getFlag() >> 9)); VKmer deletedKmer = incomingMsg.getSourceVertexId(); if (value.getEdges(deleteToMe).contains(deletedKmer)) { value.getEdges(deleteToMe).remove(deletedKmer); if (!value.getEdges(aliveToMe).contains(incomingMsg.getInternalKmer())) value.getEdges(aliveToMe).append(incomingMsg.getInternalKmer()); } voteToHalt(); } if (verbose) LOG.fine("after update from dead vertex: " + value); }

Target:
public void receiveToNeighbor(Iterator<PathMergeMessage> msgIterator) { VertexValueWritable value = getVertexValue(); if (verbose) LOG.fine("Iteration " + getSuperstep() + "\r\n" + "before update from dead vertex: " + value); while (msgIterator.hasNext()) { PathMergeMessage incomingMsg = msgIterator.next(); EDGETYPE deleteToMe = EDGETYPE.fromByte(incomingMsg.getFlag()); EDGETYPE aliveToMe = EDGETYPE.fromByte((short) (incomingMsg.getFlag() >> 9)); VKmer deletedKmer = incomingMsg.getSourceVertexId(); if (value.getEdges(deleteToMe).contains(deletedKmer)) { value.getEdges(deleteToMe).remove(deletedKmer); if (!value.getEdges(aliveToMe).contains(incomingMsg.getInternalKmer())) value.getEdges(aliveToMe).append(incomingMsg.getInternalKmer()); } else { throw new IllegalStateException("Couldn't find the requested edge to delete! I am " + value.toString() + "; incomingMsg was " + incomingMsg.toString()); } voteToHalt(); } if (verbose) LOG.fine("after update from dead vertex: " + value); }
Source:
public void doCommentAddedHook(final Change change, final Account account, final String comment, final Map<String, Short> approvals) { if (commentAddedHook != null && commentAddedHook.exists()) { final List<String> args = new ArrayList<String>(); args.add(commentAddedHook.getAbsolutePath()); args.add(change.getId().toString()); args.add(change.getProject().get()); args.add(change.getDest().getShortName()); args.add(account.getFullName()); args.add(comment); for (Map.Entry<String, Short> approval : approvals.entrySet()) { args.add("--" + approval.getKey()); args.add(Short.toString(approval.getValue())); } runHook(getRepo(change), args); } }

Target:
public void doCommentAddedHook(final Change change, final Account account, final String comment, final Map<String, Short> approvals) { final List<String> args = new ArrayList<String>(); args.add(commentAddedHook.getAbsolutePath()); args.add("--change"); args.add(change.getKey().get()); args.add("--project"); args.add(change.getProject().get()); args.add("--branch"); args.add(change.getDest().getShortName()); args.add("--author"); args.add(getDisplayName(account)); args.add("--comment"); args.add(comment == null ? "" : comment); for (Map.Entry<String, Short> approval : approvals.entrySet()) { args.add("--" + approval.getKey()); args.add(Short.toString(approval.getValue())); } runHook(getRepo(change), args); }
Source:
private Transaction getRunningTx() { try { Transaction transaction = tm.getTransaction(); if (transaction == null && config.invocationBatching().enabled()) { transaction = batchContainer.getBatchTransaction(); } return transaction; } catch (SystemException e) { throw new CacheException(e); } }

Target:
private Transaction getRunningTx() { try { Transaction transaction = null; if (batchingEnabled) { transaction = batchContainer.getBatchTransaction(); } if (transaction == null) { transaction = tm.getTransaction(); } return transaction; } catch (SystemException e) { throw new CacheException(e); } }
Source:
public AuditLogType getAuditLogTypeValue() { switch (getActionState()) { case EXECUTE: if (hasImages) { return getSucceeded() ? AuditLogType.USER_REMOVE_VM : AuditLogType.USER_FAILED_REMOVE_VM; } else { return getSucceeded() ? AuditLogType.USER_REMOVE_VM_FINISHED : AuditLogType.USER_FAILED_REMOVE_VM; } case END_FAILURE: case END_SUCCESS: default: return imagesLeftInVm ? AuditLogType.USER_FAILED_REMOVE_VM : AuditLogType.USER_REMOVE_VM_FINISHED; } }

Target:
public AuditLogType getAuditLogTypeValue() { switch (getActionState()) { case EXECUTE: if (hasImages) { return getSucceeded() ? AuditLogType.USER_REMOVE_VM : AuditLogType.USER_FAILED_REMOVE_VM; } else { return getSucceeded() ? AuditLogType.USER_REMOVE_VM_FINISHED : AuditLogType.USER_FAILED_REMOVE_VM; } case END_FAILURE: case END_SUCCESS: default: return DisksLeftInVm.isEmpty() ? AuditLogType.USER_REMOVE_VM_FINISHED : AuditLogType.USER_REMOVE_VM_FINISHED_WITH_ILLEGAL_DISKS; } }
Source:
void setSchemaVersion(int version) { try (Connection connection = dataSource.getConnection()) { try (Statement statement = connection.createStatement()) { String updateVersionSql = "UPDATE \"Version\" SET \"id\"=" + version; statement.execute(updateVersionSql); } } catch (SQLException e) { throw new RuntimeException(e); } }

Target:
void setSchemaVersion(int version) { try (Connection connection = dataSource.getConnection()) { try (Statement statement = connection.createStatement()) { String updateVersionSql = "UPDATE \"Version\" SET \"id\"=" + version; statement.execute(updateVersionSql); } } catch (SQLException e) { throw new UncheckedSqlException(e); } }
Source:
public void testOutPrefixWithZeros() throws IOException { final String tmpDir = IOUtil.getDefaultTmpDir().getAbsolutePath(); final String[] args = new String[]{ "INPUT=" + PAIRED_FILE, "SPLIT_TO_N_READS=5", "OUTPUT=" + tmpDir, "OUT_PREFIX=Sample01" }; runPicardCommandLine(args); final File out1 = new File(tmpDir, "Sample01_0001.bam"); out1.deleteOnExit(); VALIDATE_SAM_TESTER.assertSamValid(out1); }

Target:
public void testOutPrefixWithZeros() throws IOException { final File tmpDir = Files.createTempDirectory(TMP_DIR_NAME).toFile(); final String[] args = { "INPUT=" + PAIRED_FILE, "SPLIT_TO_N_READS=5", "OUTPUT=" + tmpDir, "OUT_PREFIX=Sample01" }; runPicardCommandLine(args); final File out1 = new File(tmpDir, "Sample01_0001.bam"); out1.deleteOnExit(); VALIDATE_SAM_TESTER.assertSamValid(out1); final File out2 = new File(tmpDir, "Sample01_0002.bam"); out2.deleteOnExit(); VALIDATE_SAM_TESTER.assertSamValid(out2); }
Source:
public RocksStateKeysAndNamespaceIterator( @Nonnull RocksIteratorWrapper iterator, @Nonnull String state, @Nonnull TypeSerializer<K> keySerializer, @Nonnull TypeSerializer<N> namespaceSerializer, int keyGroupPrefixBytes, boolean ambiguousKeyPossible) { this.iterator = iterator; this.state = state; this.keySerializer = keySerializer; this.namespaceSerializer = namespaceSerializer; this.keyGroupPrefixBytes = keyGroupPrefixBytes; this.nextKey = null; this.ambiguousKeyPossible = ambiguousKeyPossible; this.byteArrayDataInputView = new DataInputDeserializer(); }

Target:
public RocksStateKeysAndNamespaceIterator( @Nonnull RocksIteratorWrapper iterator, @Nonnull String state, @Nonnull TypeSerializer<K> keySerializer, @Nonnull TypeSerializer<N> namespaceSerializer, int keyGroupPrefixBytes, boolean ambiguousKeyPossible) { super(iterator, state, keySerializer, keyGroupPrefixBytes, ambiguousKeyPossible); this.namespaceSerializer = namespaceSerializer; this.nextKey = null; }
Source:
String getProviderNameReplacement() { return String.format(PROVIDER_NAME_REPLACEMENT, provider.getName()); }

Target:
private String getProviderNameReplacement() { return ReplacementUtils.getVariableAssignmentString(EngineMessage.NETWORK_ATTACHMENT_NOT_EXISTS, provider.getName()); }
Source:
public void addListener(String key, String group, ConfigurationListener listener) { NacosConfigListener nacosConfigListener = watchListenerMap.computeIfAbsent(generateKey(key, group), k -> createTargetListener(key, group)); String keyInNacos = rootPath + PROPERTIES_CHAR_SEPERATOR + key; nacosConfigListener.addListener(listener); try { configService.addListener(keyInNacos, null, nacosConfigListener); } catch (NacosException e) { logger.error(e.getMessage()); } }

Target:
public void addListener(String key, String group, ConfigurationListener listener) { String[] keyAndGroup = getKeyAndGroup(key); if (keyAndGroup[1] != null) { group = keyAndGroup[1]; } String finalGroup = group; NacosConfigListener nacosConfigListener = watchListenerMap.computeIfAbsent(generateKey(key, group), k -> createTargetListener(key, finalGroup)); String keyInNacos = rootPath + PROPERTIES_CHAR_SEPERATOR + key; nacosConfigListener.addListener(listener); try { configService.addListener(keyInNacos, group, nacosConfigListener); System.out.println("1"); } catch (NacosException e) { logger.error(e.getMessage()); } }
Source:
public MachineImpl create(final RecipeMachineCreationMetadata machineCreationMetadata) throws MachineException, NotFoundException { final InstanceProvider instanceProvider = machineInstanceProviders.getProvider(machineCreationMetadata.getType()); final String recipeType = machineCreationMetadata.getRecipeDescriptor().getType(); final Recipe recipe = RecipeImpl.fromDescriptor(machineCreationMetadata.getRecipeDescriptor()); if (instanceProvider.getRecipeTypes().contains(recipeType)) { return createMachine(machineCreationMetadata.getType(), recipe, machineCreationMetadata.getWorkspaceId(), machineCreationMetadata.isBindWorkspace(), machineCreationMetadata.getDisplayName(), machineCreationMetadata.getOutputChannel(), machineCreationMetadata.getMemorySize(), new InstanceCreator() { @Override public Instance createInstance(String machineId, int machineMemSizeMB, String creator, String workspaceId, boolean isBindWorkspace, String displayName, LineConsumer machineLogger) throws MachineException { return instanceProvider.createInstance(recipe, machineId, creator, workspaceId, isBindWorkspace, displayName, machineMemSizeMB, machineLogger); } }); } else { throw new UnsupportedRecipeException(String.format("Recipe of type '%s' is not supported", recipeType)); } }

Target:
public MachineImpl create(final RecipeMachineCreationMetadata machineCreationMetadata) throws MachineException, NotFoundException { final MachineRecipe machineRecipe = machineCreationMetadata.getRecipe(); final InstanceProvider instanceProvider = machineInstanceProviders.getProvider(machineCreationMetadata.getType()); final String recipeType = machineRecipe.getType(); if (instanceProvider.getRecipeTypes().contains(recipeType)) { return createMachine(machineCreationMetadata.getType(), machineRecipe, machineCreationMetadata.getWorkspaceId(), machineCreationMetadata.isBindWorkspace(), machineCreationMetadata.getDisplayName(), machineCreationMetadata.getOutputChannel(), machineCreationMetadata.getMemorySize(), new InstanceCreator() { @Override public Instance createInstance(String machineId, int machineMemSizeMB, String creator, String workspaceId, boolean isBindWorkspace, String displayName, LineConsumer machineLogger) throws MachineException { return instanceProvider.createInstance(machineRecipe, machineId, creator, workspaceId, isBindWorkspace, displayName, machineMemSizeMB, machineLogger); } }); } else { throw new UnsupportedRecipeException(String.format("Recipe of type '%s' is not supported", recipeType)); } }
Source:
public void startAnimating() { if (isAnimating_) return; isAnimating_ = true; animate(); Scheduler.get().scheduleFixedPeriod(() -> { return animate(); }, FRAME_RATE_MS); }

Target:
public void startAnimating() { if (isAnimating_ || requestStopAnimating_) return; isAnimating_ = true; animate(); Scheduler.get().scheduleFixedPeriod(() -> { return animate(); }, FRAME_RATE_MS); }
Source:
public void execute() throws MojoExecutionException, MojoFailureException { if (!generateP2Metadata) { return; } try { if (getUpdateSiteLocation().isDirectory()) { generateMetadata(); } else { getLog().debug(getUpdateSiteLocation().getAbsolutePath() + " does not exist or is not a directory"); } } catch (MojoFailureException e) { throw e; } catch (Exception e) { throw new MojoExecutionException("Cannot generate P2 metadata", e); } }

Target:
public void execute() throws MojoExecutionException, MojoFailureException { if (!generateP2Metadata) { return; } try { if (getUpdateSiteLocation().isDirectory()) { generateMetadata(); } else { logUpdateSiteLocationNotFound(); } } catch (MojoFailureException e) { throw e; } catch (Exception e) { throw new MojoExecutionException("Cannot generate P2 metadata", e); } }
Source:
public void runApplication(StreamApplication streamApplication, String appName, Config overriddenConfigs) { Map<String, String> configs = new HashMap<>(); configs.put("job.factory.class", "org.apache.samza.job.local.ThreadJobFactory"); configs.put("job.name", appName); configs.put("app.class", streamApplication.getClass().getCanonicalName()); configs.put("serializers.registry.json.class", "org.apache.samza.serializers.JsonSerdeFactory"); configs.put("serializers.registry.string.class", "org.apache.samza.serializers.StringSerdeFactory"); configs.put("systems.kafka.samza.factory", "org.apache.samza.system.kafka.KafkaSystemFactory"); configs.put("systems.kafka.consumer.zookeeper.connect", zkConnect()); configs.put("systems.kafka.producer.bootstrap.servers", bootstrapUrl()); configs.put("systems.kafka.samza.key.serde", "string"); configs.put("systems.kafka.samza.msg.serde", "string"); configs.put("systems.kafka.samza.offset.default", "oldest"); configs.put("job.coordinator.system", "kafka"); configs.put("job.default.system", "kafka"); configs.put("job.coordinator.replication.factor", "1"); configs.put("task.window.ms", "1000"); configs.put("task.shutdown.ms", "100"); if (overriddenConfigs != null) { configs.putAll(overriddenConfigs); } app = streamApplication; runner = ApplicationRunner.fromConfig(new MapConfig(configs)); runner.run(streamApplication); }

Target:
public void runApplication(StreamApplication streamApplication, String appName, Config overriddenConfigs) { Map<String, String> configs = new HashMap<>(); configs.put("job.factory.class", "org.apache.samza.job.local.ThreadJobFactory"); configs.put("job.name", appName); configs.put("app.class", streamApplication.getClass().getCanonicalName()); configs.put("serializers.registry.json.class", "org.apache.samza.serializers.JsonSerdeFactory"); configs.put("serializers.registry.string.class", "org.apache.samza.serializers.StringSerdeFactory"); configs.put("systems.kafka.samza.factory", "org.apache.samza.system.kafka.KafkaSystemFactory"); configs.put("systems.kafka.consumer.zookeeper.connect", zkConnect()); configs.put("systems.kafka.producer.bootstrap.servers", bootstrapUrl()); configs.put("systems.kafka.samza.key.serde", "string"); configs.put("systems.kafka.samza.msg.serde", "string"); configs.put("systems.kafka.samza.offset.default", "oldest"); configs.put("job.coordinator.system", "kafka"); configs.put("job.default.system", "kafka"); configs.put("job.coordinator.replication.factor", "1"); configs.put("task.window.ms", "1000"); configs.put("task.shutdown.ms", "1"); if (overriddenConfigs != null) { configs.putAll(overriddenConfigs); } app = streamApplication; runner = ApplicationRunner.fromConfig(new MapConfig(configs)); runner.run(streamApplication); }
Source:
static PageStore create(AlluxioConfiguration conf) throws IOException { PageStoreOptions options; PageStoreType storeType = conf.getEnum( PropertyKey.USER_CLIENT_CACHE_STORE_TYPE, PageStoreType.class); switch (storeType) { case LOCAL: options = new LocalPageStoreOptions(); break; case ROCKS: options = new RocksPageStoreOptions(); break; default: throw new IllegalArgumentException(String.format("Unrecognized store type %s", storeType.name())); } String rootDir = conf.get(PropertyKey.USER_CLIENT_CACHE_DIR); initialize(rootDir, storeType); Path storePath = Paths.get(conf.get(PropertyKey.USER_CLIENT_CACHE_DIR), storeType.name()); options.setRootDir(storePath.toString()); options.setPageSize(conf.getBytes(PropertyKey.USER_CLIENT_CACHE_PAGE_SIZE)); options.setCacheSize(conf.getBytes(PropertyKey.USER_CLIENT_CACHE_SIZE)); options.setAlluxioVersion(conf.get(PropertyKey.VERSION)); return create(options); }

Target:
static PageStore create(AlluxioConfiguration conf) throws IOException { PageStoreOptions options; PageStoreType storeType = conf.getEnum( PropertyKey.USER_CLIENT_CACHE_STORE_TYPE, PageStoreType.class); switch (storeType) { case LOCAL: options = new LocalPageStoreOptions(); break; case ROCKS: options = new RocksPageStoreOptions(); break; default: throw new IllegalArgumentException(String.format("Unrecognized store type %s", storeType.name())); } String rootDir = conf.get(PropertyKey.USER_CLIENT_CACHE_DIR); initialize(rootDir, storeType); Path storePath = getStorePath(storeType, rootDir); options.setRootDir(storePath.toString()); options.setPageSize(conf.getBytes(PropertyKey.USER_CLIENT_CACHE_PAGE_SIZE)); options.setCacheSize(conf.getBytes(PropertyKey.USER_CLIENT_CACHE_SIZE)); options.setAlluxioVersion(conf.get(PropertyKey.VERSION)); return create(options); }
Source:
public void testShouldGiveNoErrorMessage() { Source source = new Source(); source.getSourceElements().add( new SourceElement( 1, "jim" ) ); source.getSourceElements().add( new SourceElement( 2, "alice" ) ); Target target = new Target(); TargetElement bob = new TargetElement( 1, "bob" ); target.addTargetElement( bob ); TargetElement louise = new TargetElement( 3, "louise" ); target.addTargetElement( louise ); Issue1719Mapper.INSTANCE.map( source, target ); assertThat( target.getTargetElements() ).hasSize( 3 ); assertThat( target.getTargetElements() ).containsOnly( new TargetElement( 1, "bob" ), new TargetElement( 2, "alice" ), new TargetElement( 3, "louise" ) ).usingFieldByFieldElementComparator(); }

Target:
public void testShouldGiveNoErrorMessage() { Source source = new Source(); source.getSourceElements().add( new SourceElement( 1, "jim" ) ); source.getSourceElements().add( new SourceElement( 2, "alice" ) ); Target target = new Target(); TargetElement bob = new TargetElement( 1, "bob" ); target.addTargetElement( bob ); TargetElement louise = new TargetElement( 3, "louise" ); target.addTargetElement( louise ); Issue1719Mapper.INSTANCE.map( source, target ); assertThat( target.getTargetElements() ).hasSize( 3 ); assertThat( target.getTargetElements() ) .extracting( TargetElement::getId, TargetElement::getName ) .containsOnly( tuple( 1, "bob" ), tuple( 2, "alice" ), tuple( 3, "louise" ) ); }
Source:
private boolean processResult(boolean result) { if (result == false) { if (allFilters) { int nthArray = filterContainer[filterIdx]; for (int i = filterIdx + 1; i < numFilters; i++) { if (filterContainer[i] != nthArray) { break; } failNext++; } } else { int nthArray = filterContainer[filterOrder[filterIdx]]; for (int i = filterIdx + 1; i < numFilters; i++) { if (filterContainer[filterOrder[i]] != nthArray) { break; } failNext++; } } } return result; }

Target:
private boolean processResult(boolean result) { if (result == false) { if (scanAllPositions) { int inputNumber = inputNumbers[filterIndex]; for (int i = filterIndex + 1; i < numSelectedPositions; i++) { if (inputNumbers[i] != inputNumber) { break; } numNextPositionsToFail++; } } else { int inputNumber = inputNumbers[selectedPositionIndexes[filterIndex]]; for (int i = filterIndex + 1; i < numSelectedPositions; i++) { if (inputNumbers[selectedPositionIndexes[i]] != inputNumber) { break; } numNextPositionsToFail++; } } } return result; }
Source:
protected void doExecute(WordsObject object, WordsEnvironment environment) throws WordsProgramException { if (messageExpression != null) { ASTValue value; try { value = messageExpression.eval(environment).tryCoerceTo(ASTValue.ValueType.STRING); } catch (WordsRuntimeException e) { throw new WordsProgramException(messageExpression, e); } if (value.type != ASTValue.ValueType.STRING) { throw new WordsProgramException(messageExpression, new WordsInvalidTypeException(value.type.toString(), ASTValue.ValueType.STRING.toString())); } messageValue = value.stringValue; messageExpression = null; } object.setMessage(messageValue); }

Target:
protected void doExecute(WordsObject object, WordsEnvironment environment) throws WordsProgramException { assert message != null : "Say message is null"; ASTValue value; try { value = message.eval(environment).tryCoerceTo(ASTValue.ValueType.STRING); } catch (WordsRuntimeException e) { throw new WordsProgramException(message, e); } if (value.type != ASTValue.ValueType.STRING) { throw new WordsProgramException(message, new WordsInvalidTypeException(ASTValue.ValueType.STRING.toString(), value.type.toString())); } object.setMessage(value.stringValue); }
Source:
public Field getField(ColumnIdent path, Operation operation) throws UnsupportedOperationException { if (operation != Operation.READ) { throw new UnsupportedOperationException( "getField on MultiSourceSelect is only supported for READ operations"); } Field field = fields.get(path); if (field == null && !path.isTopLevel()) { for (AnalyzedRelation value : sources.values()) { try { Field childField = value.getField(path, operation); if (childField != null) { return new Field(this, path, childField); } } catch (ColumnUnknownException ignored) { } } return Relations.resolveSubscriptOnAliasedField(path, fields, p -> getField(p, operation)); } return field; }

Target:
public Field getField(ColumnIdent path, Operation operation) throws UnsupportedOperationException { if (operation != Operation.READ) { throw new UnsupportedOperationException( "getField on MultiSourceSelect is only supported for READ operations"); } Field field = fields.get(path); if (field == null && !path.isTopLevel()) { for (AnalyzedRelation value : sources.values()) { Field childField = null; try { childField = value.getField(path, operation); } catch (ColumnUnknownException ignored) { } if (childField != null) { if (field != null) { throw new AmbiguousColumnException(path, field); } field = new Field(this, path, childField); } } if (field == null) { return Relations.resolveSubscriptOnAliasedField(path, fields, operation); } } return field; }
Source:
public void startUse(GlowPlayer player, ItemStack item) { findArrow: for (ItemStack itemStack : player.getInventory().getContents()) { switch (itemStack.getType()) { case ARROW: if (currentArrow == null) { currentArrow = itemStack; } break; case SPECTRAL_ARROW: case TIPPED_ARROW: currentArrow = itemStack; break findArrow; default: } } if (currentArrow != null) { player.setUsageItem(item); player.setUsageTime(TICKS_TO_FULLY_CHARGE); } }

Target:
public void startUse(GlowPlayer player, ItemStack item) { if (player.getGameMode() == GameMode.CREATIVE || findArrow(player).isPresent()) { player.setUsageItem(item); player.setUsageTime(TICKS_TO_FULLY_CHARGE); } }
Source:
protected void testExecute() throws Exception { ______TS("Invalid intend, should fail"); String[] invalidIntendParams = generateParameters(firstSessionInCourse1, 1, Intent.FULL_DETAIL, "", "", ""); verifyHttpParameterFailure(invalidIntendParams); testDifferentRecipientTypes(); testModeratedAndPreviewPersonToGetRecipients(); }

Target:
protected void testExecute() throws Exception { }
Source:
public void logout() { mLogoutUseCase.execute(new LogoutUseCase.Callback() { @Override public void onLogoutSuccess() { showLogin(); } @Override public void onLogoutError(String message) { Log.d(TAG, message); } }); }

Target:
public void logout() { AlarmPushReceiver.cancelPushAlarm(mBaseActivity); mLogoutUseCase.execute(new LogoutUseCase.Callback() { @Override public void onLogoutSuccess() { showLogin(); } @Override public void onLogoutError(String message) { Log.d(TAG, message); } }); }
Source:
public static JaxrsMetamodel get(final IProject project) throws CoreException { if (project == null || !project.isOpen()) { return null; } return get(JavaCore.create(project), false); }

Target:
public static JaxrsMetamodel get(final IProject project) throws CoreException { if (project == null) { return null; } if (!project.isOpen()) { Logger.debug("*** Returning a null Metamodel because the given project is closed (or not opened yet) ***"); return null; } return get(JavaCore.create(project), false); }
Source:
public void syncEntitiesForUser(User user) { List<Token> githubByUserId = tokenDAO.findGithubByUserId(user.getId()); if (githubByUserId.isEmpty()) { String msg = "The user does not have a GitHub token, please create one"; LOG.info(msg); throw new CustomWebApplicationException(msg, HttpStatus.SC_BAD_REQUEST); } else { syncEntities(user, githubByUserId.get(0)); } }

Target:
protected void syncEntitiesForUser(User user) { List<Token> githubByUserId = tokenDAO.findGithubByUserId(user.getId()); if (githubByUserId.isEmpty()) { String msg = "The user does not have a GitHub token, please create one"; LOG.info(msg); throw new CustomWebApplicationException(msg, HttpStatus.SC_BAD_REQUEST); } else { syncEntities(user, githubByUserId.get(0)); } }