auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected MongoQuery<? extends MongoBizEntity> getQuery(Tenant<?> tenant) { return mango.select(getEntityClass()).eq(TenantAware.TENANT, tenant); }

Target:
protected MongoQuery<? extends MongoTenantAware> getQuery(Tenant<?> tenant) { return mango.select(getEntityClass()).eq(TenantAware.TENANT, tenant); }
Source:
private static <T> SpanSubscriptionProvider<T> scopePassingSpanSubscription( BeanFactory beanFactory, Scannable scannable, CoreSubscriber<? super T> sub) { return new SpanSubscriptionProvider<T>( beanFactory, sub, sub.currentContext(), null) { @Override SpanSubscription newCoreSubscriber(Tracing tracing) { return new ScopePassingSpanSubscriber<T>( sub, sub != null ? sub.currentContext() : Context.empty(), tracing); } }; }

Target:
private static <T> SpanSubscriptionProvider<T> scopePassingSpanSubscription( BeanFactory beanFactory, Scannable scannable, CoreSubscriber<? super T> sub) { return new SpanSubscriptionProvider<T>( beanFactory, sub, sub.currentContext(), scannable) { @Override SpanSubscription newCoreSubscriber(Tracing tracing) { return new ScopePassingSpanSubscriber<T>( sub, sub != null ? sub.currentContext() : Context.empty(), tracing); } }; }
Source:
void recalculateRegularity(LocalDate firstAppearance, LocalDate lastAppearance) { final int kAppeared = 1; final int kNotAppeared = 0; Set<LocalDate> remainingAdditions = new HashSet<>(); Set<LocalDate> remainingExclusions = new HashSet<>(); @SuppressWarnings("unchecked") HashSet<LocalDate>[][] subsets = new HashSet[DateTimeConstants.SUNDAY][kAppeared + 1]; for (int dayOfWeek = DateTimeConstants.MONDAY; dayOfWeek <= DateTimeConstants.SUNDAY; dayOfWeek++) { subsets[dayOfWeek - 1][kNotAppeared] = new HashSet<>(); subsets[dayOfWeek - 1][kAppeared] = new HashSet<>(); } for (LocalDate day = firstAppearance; !day.isAfter(lastAppearance); day = day.plusDays(1)) { subsets[day.getDayOfWeek() - 1][isMatch(day) ? kAppeared : kNotAppeared].add(day); } for (int dayOfWeek = DateTimeConstants.MONDAY; dayOfWeek <= DateTimeConstants.SUNDAY; dayOfWeek++) { if (subsets[dayOfWeek - 1][kAppeared].size() > subsets[dayOfWeek - 1][kNotAppeared].size()) { daysOfWeek.add(dayOfWeek); remainingExclusions.addAll(subsets[dayOfWeek - 1][kNotAppeared]); } else { daysOfWeek.remove(dayOfWeek); remainingAdditions.addAll(subsets[dayOfWeek - 1][kAppeared]); } } additions = remainingAdditions; exclusions = remainingExclusions; }

Target:
void recalculateRegularity(LocalDate firstAppearance, LocalDate lastAppearance) { final int appeared = 1; final int notAppeared = 0; Set<LocalDate> remainingAdditions = new HashSet<>(); Set<LocalDate> remainingExclusions = new HashSet<>(); @SuppressWarnings("unchecked") HashSet<LocalDate>[][] subsets = new HashSet[DateTimeConstants.SUNDAY][appeared + 1]; for (int dayOfWeek = DateTimeConstants.MONDAY; dayOfWeek <= DateTimeConstants.SUNDAY; dayOfWeek++) { subsets[dayOfWeek - 1][notAppeared] = new HashSet<>(); subsets[dayOfWeek - 1][appeared] = new HashSet<>(); } for (LocalDate day = firstAppearance; !day.isAfter(lastAppearance); day = day.plusDays(1)) { subsets[day.getDayOfWeek() - 1][isMatch(day) ? appeared : notAppeared].add(day); } for (int dayOfWeek = DateTimeConstants.MONDAY; dayOfWeek <= DateTimeConstants.SUNDAY; dayOfWeek++) { if (subsets[dayOfWeek - 1][appeared].size() > subsets[dayOfWeek - 1][notAppeared].size()) { daysOfWeek.add(dayOfWeek); remainingExclusions.addAll(subsets[dayOfWeek - 1][notAppeared]); } else { daysOfWeek.remove(dayOfWeek); remainingAdditions.addAll(subsets[dayOfWeek - 1][appeared]); } } additions = remainingAdditions; exclusions = remainingExclusions; }
Source:
public CompletionStage<RestResponse> exec(String taskName, Map<String, ?> parameters) { Objects.nonNull(taskName); Objects.nonNull(parameters); Request.Builder builder = new Request.Builder(); StringBuilder sb = new StringBuilder(baseURL).append('/').append(taskName); sb.append("?action=exec"); for (Map.Entry<String, ?> parameter : parameters.entrySet()) { sb.append("&param."); sb.append(parameter.getKey()); sb.append('='); sb.append(sanitize(parameter.getValue().toString())); } builder.url(sb.toString()); return client.execute(builder); }

Target:
public CompletionStage<RestResponse> exec(String taskName, Map<String, ?> parameters) { Objects.requireNonNull(taskName); Objects.requireNonNull(parameters); Request.Builder builder = new Request.Builder(); StringBuilder sb = new StringBuilder(baseURL).append('/').append(taskName); sb.append("?action=exec"); for (Map.Entry<String, ?> parameter : parameters.entrySet()) { sb.append("&param."); sb.append(parameter.getKey()); sb.append('='); sb.append(sanitize(parameter.getValue().toString())); } builder.url(sb.toString()); return client.execute(builder); }
Source:
public void getActiveConditions_shouldGetActiveConditions() { executeDataSet(CONDITION_XML); int patientId = 2; expectedException = ExpectedException.none(); List<Condition> activeConditions = conditionService.getActiveConditions(patientService.getPatient(patientId)); Condition firstActiveCondition = activeConditions.get(0); Condition secondActiveCondition = activeConditions.get(1); String firstUUID = "2cc6880e-2c46-11e4-9138-a6c5e4d20fb7"; String secondUUID = "2cc6880e-2c46-15e4-9038-a6c5e4d22fb7"; Assert.assertFalse(activeConditions.isEmpty()); Assert.assertTrue(activeConditions.size() == 2); Assert.assertEquals(firstUUID,firstActiveCondition.getUuid()); Assert.assertEquals(secondUUID, secondActiveCondition.getUuid()); }

Target:
public void getActiveConditions_shouldGetActiveConditions() { List<Condition> activeConditions = conditionService.getActiveConditions(patientService.getPatient(2)); Assert.assertTrue(activeConditions.size() == 2); Assert.assertEquals("2cc6880e-2c46-11e4-9138-a6c5e4d20fb7",activeConditions.get(0).getUuid()); Assert.assertEquals("2cc6880e-2c46-15e4-9038-a6c5e4d22fb7", activeConditions.get(1).getUuid()); }
Source:
public Neo4jTemplate neo4jTemplate() throws Exception { return new Neo4jTemplate(mappingInfrastructure().getObject(), getTypeSafetyPolicy()); }

Target:
public Neo4jTemplate neo4jTemplate() throws Exception { return new Neo4jTemplate(mappingInfrastructure().getObject()); }
Source:
public void query_explain_multipleIndexes_invalidIndexName() { StubMappingScope scope = indexManager.createScope( otherIndexManager ); ElasticsearchSearchQuery<DocumentReference> query = scope.query().extension( ElasticsearchExtension.get() ) .where( f -> f.id().matching( FIRST_ID ) ) .toQuery(); Assertions.assertThatThrownBy( () -> query.explain( "NotAMappedName", FIRST_ID ) ) .isInstanceOf( SearchException.class ) .hasMessageContaining( "type name 'NotAMappedName' is not among the mapped type targeted by this query: [", INDEX_NAME, OTHER_INDEX_NAME ); }

Target:
public void query_explain_multipleIndexes_invalidIndexName() { StubMappingScope scope = indexManager.createScope( otherIndexManager ); ElasticsearchSearchQuery<DocumentReference> query = scope.query().extension( ElasticsearchExtension.get() ) .where( f -> f.id().matching( FIRST_ID ) ) .toQuery(); Assertions.assertThatThrownBy( () -> query.explain( "NotAMappedName", FIRST_ID ) ) .isInstanceOf( SearchException.class ) .hasMessageContaining( "type name 'NotAMappedName' is not among the mapped type targeted by this query: [" + TYPE_NAME + ", " + OTHER_TYPE_NAME + "]" ); }
Source:
public static ExecutorConfiguration defaultConfiguration() { return new ExecutorConfiguration(null, null, null); }

Target:
public static ExecutorConfiguration defaultConfiguration() { return new ExecutorConfiguration(Optional.absent(), Optional.absent(), Optional.absent()); }
Source:
public void testTransferImage() { droplet = api.getDropletApi().create("imagetransferdroplet", defaultImage.getId(), defaultSize.getId(), defaultRegion.getId()); assertTrue(droplet.getId() > 0, "Created droplet id should be > 0"); assertTrue(droplet.getEventId() > 0, "Droplet creation event id should be > 0"); waitForEvent(droplet.getEventId()); int powerOffEvent = api.getDropletApi().powerOff(droplet.getId()); waitForEvent(powerOffEvent); int snapshotEvent = api.getDropletApi().snapshot(droplet.getId(), "imagetransfersnapshot"); waitForEvent(snapshotEvent); snapshot = find(api.getImageApi().list(), byName("imagetransfersnapshot")); Region newRegion = regions.get(1); int transferEvent = api.getImageApi().transfer(snapshot.getId(), newRegion.getId()); assertTrue(transferEvent > 0, "Event id should be > 0"); waitForEvent(transferEvent); }

Target:
public void testTransferImage() { droplet = api.getDropletApi().create("imagetransferdroplet", defaultImage.getId(), defaultSize.getId(), defaultRegion.getId()); assertTrue(droplet.getId() > 0, "Created droplet id should be > 0"); assertTrue(droplet.getEventId() > 0, "Droplet creation event id should be > 0"); waitForEvent(droplet.getEventId()); int powerOffEvent = api.getDropletApi().powerOff(droplet.getId()); waitForEvent(powerOffEvent); int snapshotEvent = api.getDropletApi().snapshot(droplet.getId(), "imagetransfersnapshot"); waitForEvent(snapshotEvent); snapshot = find(api.getImageApi().list(), byName("imagetransfersnapshot")); Region newRegion = regions.get(1); int transferEvent = api.getImageApi().transfer(snapshot.getId(), newRegion.getId()); assertTrue(transferEvent > 0, "Transfer event id should be > 0"); waitForEvent(transferEvent); }
Source:
private BooleanSupplier shouldRateLimit(String client) { return Suppliers.compose(f -> f.shouldRateLimit(client), lockControlConfigSupplier::get)::get; }

Target:
private BooleanSupplier shouldRateLimit(String client) { return () -> lockControlConfigSupplier.get().shouldRateLimit(client); }
Source:
public Date getStartTime() { return this.startTime; }

Target:
public Date getStartTime() { return new Date(this.startTime.getTime()); }
Source:
public void printAgreementMatrix() { int[][] matrix = new int[this.numLabels][this.numLabels]; for (int i = 0; i < this.numItems; i++) { matrix[this.annotation[i][0]][this.annotation[i][1]]++; } for (int i = 0; i < numLabels; i++) { for (int j = 0; j < numLabels; j++) { logger.info(matrix[i][j] + "\t"); } logger.info(""); } }

Target:
public void printAgreementMatrix() { int[][] matrix = new int[this.numLabels][this.numLabels]; for (int i = 0; i < this.numItems; i++) { matrix[this.annotation[i][0]][this.annotation[i][1]]++; } for (int i = 0; i < numLabels; i++) { for (int j = 0; j < numLabels; j++) { System.out.print(matrix[i][j] + "\t"); } System.out.println(); } }
Source:
public static boolean isReachable(String host, int port) { Socket socket = null; boolean reachable; try { if (ProxyConfiguration.hasSocks()) { Proxy socksProxy = new Proxy(Proxy.Type.SOCKS,new InetSocketAddress(ProxyConfiguration.socks().getAddress(), ProxyConfiguration.socks().getPort())); socket = new Socket(socksProxy); } else if (ProxyConfiguration.hasProxyConfig()) { Proxy httpProxy = new Proxy(Proxy.Type.HTTP,new InetSocketAddress(ProxyConfiguration.proxyAddress().getAddress(),ProxyConfiguration.proxyAddress().getPort())); socket = new Socket(httpProxy); } else { socket = new Socket(); } socket.connect(new InetSocketAddress(host, port), 2000); reachable = true; } catch (IOException e) { reachable = false; } finally { if (socket != null) { try { socket.close(); } catch (IOException e) { } } } return reachable; }

Target:
public static boolean isReachable(String host, int port) { Socket socket = null; boolean reachable; try { if (ProxyConfiguration.hasSocksProxyConfig()) { Proxy socksProxy = new Proxy(Proxy.Type.SOCKS,new InetSocketAddress(ProxyConfiguration.socks().getAddress(), ProxyConfiguration.socks().getPort())); socket = new Socket(socksProxy); } else if (ProxyConfiguration.hasHttpProxyConfig()) { Proxy httpProxy = new Proxy(Proxy.Type.HTTP,new InetSocketAddress(ProxyConfiguration.proxyAddress().getAddress(),ProxyConfiguration.proxyAddress().getPort())); socket = new Socket(httpProxy); } else { socket = new Socket(); } socket.connect(new InetSocketAddress(host, port), 2000); reachable = true; } catch (IOException e) { reachable = false; } finally { if (socket != null) { try { socket.close(); } catch (IOException e) { } } } return reachable; }
Source:
public List<TextHit> query(Node property, String qs, String graphURI, String lang, int limit, String highlight) { try (IndexReader indexReader = DirectoryReader.open(directory)) { return query$(indexReader, property, qs, graphURI, lang, limit, highlight) ; } catch (ParseException ex) { throw new TextIndexParseException(qs, ex.getMessage()) ; } catch (Exception ex) { ex.printStackTrace(); throw new TextIndexException("query", ex) ; } }

Target:
public List<TextHit> query(Node property, String qs, String graphURI, String lang, int limit, String highlight) { try (IndexReader indexReader = DirectoryReader.open(directory)) { return query$(indexReader, property, qs, graphURI, lang, limit, highlight) ; } catch (ParseException ex) { throw new TextIndexParseException(qs, ex.getMessage()) ; } catch (Exception ex) { throw new TextIndexException("query", ex) ; } }
Source:
public @NonNull List<@NonNull String> getMarkerCategories() { ITmfTrace activeTrace = TmfTraceManager.getInstance().getActiveTrace(); if (activeTrace == null) { return Collections.emptyList(); } UUID uuid = activeTrace.getUUID(); Collection<String> collection = fCategories.computeIfAbsent(uuid, t -> { ContextDataSource dataProvider = DataProviderManager.getInstance().getDataProvider(activeTrace, ContextDataSource.ID, ContextDataSource.class); if (dataProvider == null) { return Collections.emptyList(); } TmfModelResponse<@NonNull List<@NonNull TimeGraphEntryModel>> tree = dataProvider.fetchTree(new TimeQueryFilter(Collections.emptyList()), new NullProgressMonitor()); List<@NonNull TimeGraphEntryModel> model = tree.getModel(); if (model == null) { return Collections.emptyList(); } Set<String> data = new HashSet<>(); for (TmfTreeDataModel elem : model) { data.add(elem.getName()); } List<String> dataList = Lists.newArrayList(data); dataList.sort(null); return dataList; }); List<String> retVal = new ArrayList<>(collection); retVal.sort(null); return retVal; }

Target:
public @NonNull List<@NonNull String> getMarkerCategories() { ITmfTrace activeTrace = TmfTraceManager.getInstance().getActiveTrace(); if (activeTrace == null) { return Collections.emptyList(); } ContextDataProvider dataProvider = DataProviderManager.getInstance().getDataProvider(activeTrace, ContextDataProvider.ID, ContextDataProvider.class); if (dataProvider == null) { return Collections.emptyList(); } TmfModelResponse<@NonNull List<@NonNull TimeGraphEntryModel>> tree = dataProvider.fetchTree(new TimeQueryFilter(Collections.emptyList()), new NullProgressMonitor()); List<@NonNull TimeGraphEntryModel> model = tree.getModel(); if (model == null) { return Collections.emptyList(); } Set<String> data = new HashSet<>(); for (TmfTreeDataModel elem : model) { data.add(elem.getName()); } List<String> dataList = Lists.newArrayList(data); dataList.sort(null); return dataList; }
Source:
private void rebuildTokenCache(boolean initial) throws IOException { localTokenCache.clear(); List<String> zkTokens; try { zkTokens = zookeeper.getChildren(TOKEN_PATH, false); } catch (KeeperException | InterruptedException e) { throw new IOException("Tokens cannot be fetched from path " + TOKEN_PATH, e); } byte[] data; for (String tokenPath : zkTokens) { try { data = zkClient.getData().forPath( ZK_DTSM_TOKENS_ROOT + "/" + tokenPath); } catch (KeeperException.NoNodeException e) { LOG.debug("No node in path [" + tokenPath + "]"); continue; } catch (Exception ex) { throw new IOException(ex); } processTokenAddOrUpdate(data); AbstractDelegationTokenIdentifier ident = createIdentifier(); DataInputStream din = new DataInputStream(new ByteArrayInputStream(data)); ident.readFields(din); localTokenCache.add(ident); } if (!initial) { for (AbstractDelegationTokenIdentifier ident : currentTokens.keySet()) { if (!localTokenCache.contains(ident)) { currentTokens.remove(ident); } } } }

Target:
private void rebuildTokenCache(boolean initial) throws IOException { localTokenCache.clear(); List<String> zkTokens; try { zkTokens = zookeeper.getChildren(TOKEN_PATH, false); } catch (KeeperException | InterruptedException e) { throw new IOException("Tokens cannot be fetched from path " + TOKEN_PATH, e); } byte[] data; for (String tokenPath : zkTokens) { try { data = zkClient.getData().forPath( ZK_DTSM_TOKENS_ROOT + "/" + tokenPath); } catch (KeeperException.NoNodeException e) { LOG.debug("No node in path [" + tokenPath + "]"); continue; } catch (Exception ex) { throw new IOException(ex); } AbstractDelegationTokenIdentifier ident = processTokenAddOrUpdate(data); localTokenCache.add(ident); } if (!initial) { for (AbstractDelegationTokenIdentifier ident : currentTokens.keySet()) { if (!localTokenCache.contains(ident)) { currentTokens.remove(ident); } } } }
Source:
public List<DocumentModel> getComments(DocumentModel docModel) { return CoreInstance.doPrivileged(docModel.getRepositoryName(), session -> { Map<String, Object> ctxMap = Collections.<String, Object> singletonMap( ResourceAdapter.CORE_SESSION_CONTEXT_KEY, session); RelationManager relationManager = Framework.getService(RelationManager.class); Graph graph = relationManager.getGraph(config.graphName, session); Resource docResource = relationManager.getResource(config.documentNamespace, docModel, ctxMap); if (docResource == null) { throw new NuxeoException("Could not adapt document model to relation resource ; " + "check the service relation adapters configuration"); } List<Statement> statementList = graph.getStatements(null, null, docResource); if (graph instanceof JenaGraph) { Resource oldDocResource = new QNameResourceImpl(config.documentNamespace, docModel.getId()); statementList.addAll(graph.getStatements(null, null, oldDocResource)); } List<DocumentModel> commentList = new ArrayList<DocumentModel>(); for (Statement stmt : statementList) { QNameResourceImpl subject = (QNameResourceImpl) stmt.getSubject(); DocumentModel commentDocModel = (DocumentModel) relationManager.getResourceRepresentation( config.commentNamespace, subject, ctxMap); if (commentDocModel == null) { log.warn("Could not adapt comment relation subject to a document " + "model; check the service relation adapters configur ation"); continue; } commentDocModel.detach(true); commentList.add(commentDocModel); } CommentSorter sorter = new CommentSorter(true); Collections.sort(commentList, sorter); return commentList; }); }

Target:
public List<DocumentModel> getComments(DocumentModel docModel) { return doPrivileged(docModel, session -> { Map<String, Object> ctxMap = Collections.singletonMap(ResourceAdapter.CORE_SESSION_CONTEXT_KEY, session); RelationManager relationManager = Framework.getService(RelationManager.class); Graph graph = relationManager.getGraph(config.graphName, session); Resource docResource = relationManager.getResource(config.documentNamespace, docModel, ctxMap); if (docResource == null) { throw new NuxeoException("Could not adapt document model to relation resource ; " + "check the service relation adapters configuration"); } List<Statement> statementList = graph.getStatements(null, null, docResource); if (graph instanceof JenaGraph) { Resource oldDocResource = new QNameResourceImpl(config.documentNamespace, docModel.getId()); statementList.addAll(graph.getStatements(null, null, oldDocResource)); } List<DocumentModel> commentList = new ArrayList<DocumentModel>(); for (Statement stmt : statementList) { QNameResourceImpl subject = (QNameResourceImpl) stmt.getSubject(); DocumentModel commentDocModel = (DocumentModel) relationManager.getResourceRepresentation( config.commentNamespace, subject, ctxMap); if (commentDocModel == null) { log.warn("Could not adapt comment relation subject to a document " + "model; check the service relation adapters configur ation"); continue; } commentDocModel.detach(true); commentList.add(commentDocModel); } CommentSorter sorter = new CommentSorter(true); Collections.sort(commentList, sorter); return commentList; }); }
Source:
public ProgramEnrollment updateProgramEnrollment(String configName, ProgramEnrollment programEnrollment) { ProgramEnrollment updatedProgramEnrollment = null; validateProgramEnrollmentToUpdate(programEnrollment); try { Config config = configService.getConfigByName(configName); if (programEnrollment.getAttributes() != null && !programEnrollment.getAttributes().isEmpty()) { updatedProgramEnrollment = programEnrollmentResource.updateBahmniProgramEnrollment(config, programEnrollment); } else { updatedProgramEnrollment = programEnrollmentResource.updateProgramEnrollment(config, programEnrollment); } return updatedProgramEnrollment; } catch (HttpClientErrorException e) { throw new OpenMRSException("Could not update program enrollment with uuid: " + programEnrollment.getUuid(), e); } }

Target:
public ProgramEnrollment updateProgramEnrollment(String configName, ProgramEnrollment programEnrollment) { ProgramEnrollment updatedProgramEnrollment = null; validateProgramEnrollmentToUpdate(programEnrollment); try { Config config = configService.getConfigByName(configName); if (CollectionUtils.isNotEmpty(programEnrollment.getAttributes())) { updatedProgramEnrollment = programEnrollmentResource.updateBahmniProgramEnrollment(config, programEnrollment); } else { updatedProgramEnrollment = programEnrollmentResource.updateProgramEnrollment(config, programEnrollment); } return updatedProgramEnrollment; } catch (HttpClientErrorException e) { throw new OpenMRSException("Could not update program enrollment with uuid: " + programEnrollment.getUuid(), e); } }
Source:
public void sendMessagesToPushNetwork(final MessageHolderWithTokens msg) { final Variant variant = msg.getVariant(); final UnifiedPushMessage unifiedPushMessage = msg.getUnifiedPushMessage(); final Collection<String> deviceTokens = msg.getDeviceTokens(); logger.info(String.format("Received UnifiedPushMessage from JMS queue, will now trigger the Push Notification delivery for the %s variant (%s)", variant.getType().getTypeName(), variant.getVariantID())); senders.select(new SenderTypeLiteral(variant.getType())).get() .sendPushMessage(variant, deviceTokens, unifiedPushMessage, msg.getPushMessageInformation().getId(), new SenderServiceCallback( variant, deviceTokens.size(), msg.getPushMessageInformation() ) ); }

Target:
public void sendMessagesToPushNetwork(final MessageHolderWithTokens msg) { final Variant variant = msg.getVariant(); final UnifiedPushMessage unifiedPushMessage = msg.getUnifiedPushMessage(); final Collection<String> deviceTokens = msg.getDeviceTokens(); logger.info("UnifiedPushMessage was successfully received. Push Notification delivery for the variant ({}) will now be triggered.", variant.getType().getTypeName(), variant.getVariantID()); senders.select(new SenderTypeLiteral(variant.getType())).get() .sendPushMessage(variant, deviceTokens, unifiedPushMessage, msg.getPushMessageInformation().getId(), new SenderServiceCallback( variant, deviceTokens.size(), msg.getPushMessageInformation() ) ); }
Source:
public static void Init() { mUpdateVmsStatic = new ObjectIdentityChecker(VmHandler.class, Arrays.asList(new String[] { "VM", "VmStatic", "VmDynamic" }), VMStatus.class); mUpdateVmsStatic.AddPermittedFields(new String[] { "vm_name", "description", "domain", "os", "osType", "creation_date", "num_of_monitors", "allowConsoleReconnect", "usb_policy", "is_auto_suspend", "auto_startup", "dedicated_vm_for_vds", "default_display_type", "priority", "default_boot_sequence", "initrd_url", "kernel_url", "kernel_params", "migrationSupport", "minAllocatedMem", "quotaId", "quotaName", "quotaEnforcementType", "cpuPinning", "vmPayload", "balloonEnabled"}); mUpdateVmsStatic.AddFields( Arrays.asList(new Enum<?>[] { VMStatus.Down }), Arrays.asList(new String[] { "vds_group_id", "time_zone", "is_stateless", "nice_level", "mem_size_mb", "num_of_sockets", "cpu_per_socket", "iso_path", "userDefinedProperties", "predefinedProperties", "customProperties" })); mUpdateVmsStatic.AddIgnoredFields(Arrays.asList(new String[] { "images", "interfaces"})); }

Target:
public static void Init() { mUpdateVmsStatic = new ObjectIdentityChecker(VmHandler.class, Arrays.asList(new String[] { "VM", "VmStatic", "VmDynamic" }), VMStatus.class); mUpdateVmsStatic.AddPermittedFields(new String[] { "vm_name", "description", "domain", "os", "osType", "creation_date", "num_of_monitors", "allowConsoleReconnect", "usb_policy", "is_auto_suspend", "auto_startup", "dedicated_vm_for_vds", "default_display_type", "priority", "default_boot_sequence", "initrd_url", "kernel_url", "kernel_params", "migrationSupport", "minAllocatedMem", "quotaId", "quotaName", "quotaEnforcementType", "cpuPinning", "vmPayload", "balloonEnabled", "images", "interfaces" }); mUpdateVmsStatic.AddFields( Arrays.asList(new Enum<?>[] { VMStatus.Down }), Arrays.asList(new String[] { "vds_group_id", "time_zone", "is_stateless", "nice_level", "mem_size_mb", "num_of_sockets", "cpu_per_socket", "iso_path", "userDefinedProperties", "predefinedProperties", "customProperties" })); }
Source:
public boolean test_sentence (String sent, String sf) { re.do_penn_tagging = false; re.setMaxParses(1); Sentence sntc = re.processSentence(sent); ParsedSentence parse = sntc.getParses().get(0); String rs = SimpleView.printBinaryRelations(parse); String urs = SimpleView.printUnaryRelations(parse); ArrayList<String> exp = split(sf); ArrayList<String> brgot = split(rs); ArrayList<String> urgot = split(urs); int sizeOfGotRelations= brgot.size(); for (int i=0; i< exp.size(); i++) { if(!brgot.contains((String)exp.get(i))) { if(!urgot.contains(exp.get(i))) { System.err.println("Error: content miscompare:\n" + "\tExpected = " + exp + "\n" + "\tGot Binary Relations = " + brgot + "\n" + "\tGot Uinary Relations = " + urgot + "\n" + "\tSentence = " + sent); subfail ++; fail ++; sentfail.add(sent); return false; } sizeOfGotRelations++; } } if (exp.size() < sizeOfGotRelations) { System.err.println("Error: size miscompare:\n" + "\tExpected = " + exp + "\n" + "\tGot Binary Relations = " + brgot + "\n" + "\tGot Uinary Relations = " + urgot + "\n" + "\tSentence = " + sent); subfail ++; fail ++; sentfail.add(sent); return false; } subpass ++; pass ++; return true; }

Target:
public boolean test_sentence (String sent, String sf) { re.do_penn_tagging = false; re.setMaxParses(1); Sentence sntc = re.processSentence(sent); ParsedSentence parse = sntc.getParses().get(0); String rs = SimpleView.printBinaryRelations(parse); String urs = SimpleView.printUnaryRelations(parse); ArrayList<String> exp = split(sf); ArrayList<String> brgot = split(rs); ArrayList<String> urgot = split(urs); int sizeOfGotRelations= brgot.size(); for (int i=0; i< exp.size(); i++) { if(!brgot.contains((String)exp.get(i))) { if(!urgot.contains(exp.get(i))) { System.err.println("Error: content miscompare:\n" + "\tExpected = " + exp + "\n" + "\tGot Binary Relations = " + brgot + "\n" + "\tGot Unary Relations = " + urgot + "\n" + "\tSentence = " + sent); subfail ++; fail ++; sentfail.add(sent); return false; } sizeOfGotRelations++; } } if (exp.size() < sizeOfGotRelations) { System.err.println("Error: size miscompare:\n" + "\tExpected = " + exp + "\n" + "\tGot Binary Relations = " + brgot + "\n" + "\tGot Unary Relations = " + urgot + "\n" + "\tSentence = " + sent); subfail ++; fail ++; sentfail.add(sent); return false; } subpass ++; pass ++; return true; }
Source:
private int runDeleteQuestionDialog(List<String> resNames) { StringBuilder message = new StringBuilder(MessageFormat.format("Delete the following resources from device \"{0}\":", device.getName())); for (String name : resNames) { message.append("\n\t"); message.append(name); } MessageDialog dialog = new MessageDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Fully clean device", null, message.toString(), MessageDialog.QUESTION, new String[] { "Delete", "Cancle" }, 0); return dialog.open(); }

Target:
private int runDeleteQuestionDialog(List<String> resNames) { StringBuilder message = new StringBuilder(MessageFormat.format("Delete the following resources from device \"{0}\":", device.getName())); for (String name : resNames) { message.append("\n\t"); message.append(name); } MessageDialog dialog = new MessageDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Fully clean device", null, message.toString(), MessageDialog.QUESTION, new String[] { "Delete", SWT.getMessage("SWT_Cancel") }, 0); return dialog.open(); }
Source:
private void flagBadConfig(String message) { logger.warn(message); properlyConfigured = false; updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, message); }

Target:
private void flagBadConfig(String message) { properlyConfigured = false; updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, message); }
Source:
private Runnable makeFlyWeightTaskBuildable(final BuildableItem p){ if (p.task instanceof FlyweightTask) { Jenkins h = Jenkins.getInstance(); Map<Node, Integer> hashSource = new HashMap<Node, Integer>(h.getNodes().size()); hashSource.put(h, Math.max(h.getNumExecutors() * 100, 1)); for (Node n : h.getNodes()) { hashSource.put(n, n.getNumExecutors() * 100); } ConsistentHash<Node> hash = new ConsistentHash<Node>(NODE_HASH); hash.addAll(hashSource); for (Node n : hash.list(p.task.getFullDisplayName())) { final Computer c = n.toComputer(); if (n.canTake(p) != null) continue; if (c == null || c.isOffline()) continue; return new Runnable() { @Override public void run() { c.startFlyWeightTask(new WorkUnitContext(p).createWorkUnit(p.task)); makePending(p); } }; } } return null; }

Target:
private Runnable makeFlyWeightTaskBuildable(final BuildableItem p){ if (p.task instanceof FlyweightTask) { Jenkins h = Jenkins.getInstance(); Map<Node, Integer> hashSource = new HashMap<Node, Integer>(h.getNodes().size()); hashSource.put(h, Math.max(h.getNumExecutors() * 100, 1)); for (Node n : h.getNodes()) { hashSource.put(n, n.getNumExecutors() * 100); } ConsistentHash<Node> hash = new ConsistentHash<Node>(NODE_HASH); hash.addAll(hashSource); Label lbl = p.getAssignedLabel(); for (Node n : hash.list(p.task.getFullDisplayName())) { final Computer c = n.toComputer(); if (c == null || c.isOffline()) { continue; } if (lbl!=null && !lbl.contains(n)) { continue; } if (n.canTake(p) != null) { continue; } return new Runnable() { @Override public void run() { c.startFlyWeightTask(new WorkUnitContext(p).createWorkUnit(p.task)); makePending(p); } }; } } return null; }
Source:
@Test public void checkAbilityToStartServiceUsingCapabilities() throws Exception { File appDir = new File("src/test/java/io/appium/java_client"); File app = new File(appDir, "ApiDemos-debug.apk"); File pageFactoryDir = new File("src/test/java/io/appium/java_client/pagefactory_tests"); File chrome = new File(pageFactoryDir, "chromedriver.exe"); DesiredCapabilities caps = new DesiredCapabilities(); caps.setCapability(PLATFORM_NAME, "Android"); caps.setCapability(FULL_RESET, true); caps.setCapability(NEW_COMMAND_TIMEOUT, 60); caps.setCapability(APP_PACKAGE, "io.appium.android.apis"); caps.setCapability(APP_ACTIVITY, ".view.WebView1"); caps.setCapability(APP, app.getAbsolutePath()); caps.setCapability(CHROMEDRIVER_EXECUTABLE, chrome.getAbsolutePath()); service = new AppiumServiceBuilder().withCapabilities(caps).build(); service.start(); assertTrue(service.isRunning()); }

Target:
@Test public void checkAbilityToStartServiceUsingCapabilities() throws Exception { File app = ROOT_TEST_PATH.resolve("ApiDemos-debug.apk").toFile(); File chrome = ROOT_TEST_PATH.resolve("pagefactory_tests").resolve("chromedriver.exe").toFile(); DesiredCapabilities caps = new DesiredCapabilities(); caps.setCapability(PLATFORM_NAME, "Android"); caps.setCapability(FULL_RESET, true); caps.setCapability(NEW_COMMAND_TIMEOUT, 60); caps.setCapability(APP_PACKAGE, "io.appium.android.apis"); caps.setCapability(APP_ACTIVITY, ".view.WebView1"); caps.setCapability(APP, app.getAbsolutePath()); caps.setCapability(CHROMEDRIVER_EXECUTABLE, chrome.getAbsolutePath()); service = new AppiumServiceBuilder().withCapabilities(caps).build(); service.start(); assertTrue(service.isRunning()); }
Source:
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { log.debug("Entered OAuthTokenInfo QueryString: {}, Parameters : {}", request.getQueryString(), SSOUtils.getRequestParameters(request)); boolean isValidateRequest = false; try { String[] clientIdAndSecret = SSOUtils.getClientIdClientSecret(request); String token = SSOUtils.getRequestParameter(request, SSOConstants.HTTP_PARAM_TOKEN); String scope = SSOUtils.getRequestParameter(request, SSOConstants.HTTP_PARAM_SCOPE, ""); isValidateRequest = SSOUtils.scopeAsList(scope).contains("ovirt-ext=token-info:validate"); SSOUtils.validateClientAcceptHeader(request); SSOUtils.validateClientRequest(request, clientIdAndSecret[0], clientIdAndSecret[1], null, null); SSOUtils.validateRequestScope(request, token, scope); log.debug("Sending json response"); SSOSession ssoSession = SSOUtils.getSsoSession(request, clientIdAndSecret[0], token, true); ssoSession.getAssociatedClientIds().add(clientIdAndSecret[0]); String password = null; if (SSOUtils.scopeAsList(scope).contains("ovirt-ext=token:password-access")) { password = ssoSession.getPassword(); } SSOUtils.sendJsonData(response, isValidateRequest ? Collections.<String, Object>emptyMap() : buildResponse(SSOUtils.getSsoContext(request), ssoSession, password)); } catch(OAuthException ex) { SSOUtils.sendJsonDataWithMessage(response, ex, isValidateRequest); } catch(Exception ex) { SSOUtils.sendJsonDataWithMessage(response, SSOConstants.ERR_CODE_SERVER_ERROR, ex); } }

Target:
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { log.debug("Entered OAuthTokenInfo QueryString: {}, Parameters : {}", request.getQueryString(), SSOUtils.getRequestParameters(request)); boolean isValidateRequest = false; try { String[] clientIdAndSecret = SSOUtils.getClientIdClientSecret(request); String token = SSOUtils.getRequestParameter(request, SSOConstants.HTTP_PARAM_TOKEN); String scope = SSOUtils.getRequestParameter(request, SSOConstants.HTTP_PARAM_SCOPE, ""); isValidateRequest = SSOUtils.scopeAsList(scope).contains("ovirt-ext=token-info:validate"); SSOUtils.validateClientAcceptHeader(request); SSOUtils.validateClientRequest(request, clientIdAndSecret[0], clientIdAndSecret[1], null, null); SSOUtils.validateRequestScope(request, token, scope); log.debug("Sending json response"); SSOSession ssoSession = SSOUtils.getSsoSession(request, clientIdAndSecret[0], token, true); ssoSession.getAssociatedClientIds().add(clientIdAndSecret[0]); String password = null; if (SSOUtils.scopeAsList(scope).contains("ovirt-ext=token:password-access")) { password = ssoSession.getPassword(); } SSOUtils.sendJsonData(response, isValidateRequest ? Collections.<String, Object>emptyMap() : buildResponse(ssoSession, password)); } catch(OAuthException ex) { SSOUtils.sendJsonDataWithMessage(response, ex, isValidateRequest); } catch(Exception ex) { SSOUtils.sendJsonDataWithMessage(response, SSOConstants.ERR_CODE_SERVER_ERROR, ex); } }
Source:
public GeoJSONBuilder value(Object value) { if (value instanceof java.util.Date || value instanceof Calendar) { value = Converters.convert(value, String.class); } if (value instanceof Double) { value = roundToNumberOfDecimalPlaces((Double)value); } super.value(value); return this; }

Target:
public GeoJSONBuilder value(Object value) { if (value instanceof java.util.Date || value instanceof Calendar) { value = Converters.convert(value, String.class); } super.value(value); return this; }
Source:
public void setEnvironmentFlags(Map<String, String> flags) { try { metadata.update(metadata.new Updater() { @Override public void updateCopy(HostMetadata currentCopy) { currentCopy.set_environment_flags(flags); } }); } catch (InterruptedException e) { throw new RuntimeException(e); } catch (KeeperException e) { throw new RuntimeException(e); } }

Target:
public void setEnvironmentFlags(Map<String, String> flags) { try { metadata.update(metadata.new Updater() { @Override public void updateCopy(HostMetadata currentCopy) { currentCopy.set_environment_flags(flags); } }); } catch (InterruptedException | KeeperException e) { throw new RuntimeException(e); } }
Source:
public void run() { int input = 0; Scanner sc = new Scanner(System.in); System.out.println("Welcome to our application!"); while (input != 4) { System.out.println("Option 1: Construct playlist! Enter foldername"); System.out.println("Option 2: About"); System.out.println("Option 3: Play music!"); System.out.println("Option 4: Close"); input = sc.nextInt(); switch (input) { case 1 : try { this.setFileName(sc.nextLine()); FolderLoader folderLoader = new FolderLoader(this.getFileName()); this.result = new Playlist(folderLoader.load()); } catch (Exception e) { System.out.println(e.getMessage()); } break; case 2 : System.out.println(this.aboutDevs()); break; case 3 : System.out.println("Let's play some music!"); break; default : break; } } sc.close(); }

Target:
public void run() { Scanner sc = new Scanner(System.in); System.out.println("Welcome to our application!"); while (true) { System.out.println("Construct playlist! Enter foldername"); try { String fileName = sc.next(); FolderLoader folderLoader = new FolderLoader(fileName); Playlist result = new Playlist(folderLoader.load()); System.out.println("\\TODO!"); } catch (Exception e) { System.out.println(e.getMessage()); } sc.close(); } }
Source:
public boolean validatePMAgentPort() { String portStr = null; Integer port = getParameters().getAgent().getPort(); if (port == null) { if (getParameters().getAgent().getOptionsMap().containsKey(PORT)) { portStr = getParameters().getAgent().getOptionsMap().get(PORT); if (StringUtils.isNumeric(portStr)) { port = Integer.parseInt(portStr); } else { return false; } } else { return true; } } portStr = portStr == null ? getParameters().getAgent().getPort().toString() : portStr; return portStr.equals("") || ValidationUtils.validatePort(port); }

Target:
protected boolean validatePMAgentPort() { Integer port = getParameters().getAgent().getPort(); if (port == null) { String portStr; if (getParameters().getAgent().getOptionsMap().containsKey(PORT)) { portStr = getParameters().getAgent().getOptionsMap().get(PORT); if (StringUtils.isNumeric(portStr)) { port = Integer.valueOf(portStr); } else { return false; } } else { return true; } } return port == null || ValidationUtils.validatePort(port); }
Source:
public RepositoryVersion(@NonNull String version) { orgVersion = version; Matcher versionMatcher = VERSION_PATTERN.matcher(version); if (versionMatcher.matches()) { major = parseInt(versionMatcher.group(2)); if (versionMatcher.group(5) != null) { minor = parseInt(versionMatcher.group(5)); } else { minor = null; } if (versionMatcher.group(7) != null) { micro = parseInt(versionMatcher.group(7)); } else { micro = null; } if (versionMatcher.group(8) != null) { qualifier = (versionMatcher.group(8)); } else { qualifier = null; } } else { qualifier = version; } }

Target:
public RepositoryVersion(@NonNull String version) { orgVersion = version; Matcher versionMatcher = VERSION_PATTERN.matcher(version); if (versionMatcher.matches()) { major = parseInt(versionMatcher.group(2)); if (versionMatcher.group(4) != null) { minor = parseInt(versionMatcher.group(4)); } else { minor = null; } if (versionMatcher.group(6) != null) { micro = parseInt(versionMatcher.group(6)); } else { micro = null; } if (versionMatcher.group(7) != null) { qualifier = (versionMatcher.group(7)); } else { qualifier = null; } } else { major = null; minor = null; micro = null; qualifier = version; } normalizedVersion = buildNormalizedVersion(); }
Source:
public void testGetAlertsPersistentStoreError() throws Exception { when(persistentStore.get(eq("alerts"), any())).thenThrow(new PersistenceException("error")); List<Map<String, Object>> alertList = adminAlert.getAlerts(); assertThat(alertList.size(), equalTo(1)); }

Target:
public void testGetAlertsPersistentStoreError() throws Exception { when(persistentStore.get(eq("alerts"), any())).thenThrow(new PersistenceException("error")); List<Map<String, Object>> alertList = adminAlert.getAlerts(); assertThat(alertList.size(), equalTo(1)); assertThat( alertList.get(0).get(Alert.SYSTEM_NOTICE_SOURCE_KEY), equalTo("unable_to_retrieve_alerts")); }
Source:
private void discontinueExistingOrdersIfRequired(Order order) { if (!Order.Action.DISCONTINUE.equals(order.getAction())) return; Order previousOrder = order.getPreviousOrder(); if (previousOrder != null) { if (!previousOrder.getConcept().equals(order.getConcept())) { throw new APIException("Concept of previous order and this order should be the same"); } if (previousOrder.getDateStopped() == null) { discontinueOrder(previousOrder, order.getStartDate()); } return; } List<? extends Order> orders = getActiveOrders(order.getPatient(), order.getClass(), order.getCareSetting(), false); for (Order activeOrder : orders) { if (activeOrder.getConcept().equals(order.getConcept())) { order.setPreviousOrder(activeOrder); discontinueOrder(activeOrder, order.getStartDate()); return; } } throw new APIException("We could not find an active order with the concept " + order.getConcept() + " to discontinue. "); }

Target:
private void discontinueExistingOrdersIfRequired(Order order) { if (!Order.Action.DISCONTINUE.equals(order.getAction())) return; Order previousOrder = order.getPreviousOrder(); if (previousOrder != null) { if (!previousOrder.getConcept().equals(order.getConcept())) { throw new APIException("Concept of previous order and this order should be the same"); } if (previousOrder.getDateStopped() == null) { discontinue(previousOrder, order.getStartDate()); } return; } List<? extends Order> orders = getActiveOrders(order.getPatient(), order.getClass(), order.getCareSetting(), false); for (Order activeOrder : orders) { if (activeOrder.getConcept().equals(order.getConcept())) { order.setPreviousOrder(activeOrder); discontinue(activeOrder, order.getStartDate()); return; } } throw new APIException("Could not find an active order with the concept " + order.getConcept() + " to discontinue. "); }
Source:
private void addSampleDataButtons(IToolBarManager toolBarManager) { loadDataButton = new Action() { @Override public void run() { super.run(); loadSampleData(); } }; final String loadDataImagePath = "icons/loadData.png"; loadDataButton.setImageDescriptor(ImageDescriptor.createFromURL(Activator.getDefault() .getBundle() .getResource(loadDataImagePath))); loadDataButton.setText("Import Sample Data"); loadDataButton.setEnabled(true); exportDataButton = new Action() { @Override public void run() { super.run(); exportSampleData(); } }; final String exportDataImagePath = "icons/exportData.png"; exportDataButton.setImageDescriptor(ImageDescriptor.createFromURL(Activator.getDefault() .getBundle() .getResource(exportDataImagePath))); exportDataButton.setText("Export Sample Data"); exportDataButton.setEnabled(true); cleanDataButton = new Action() { @Override public void run() { super.run(); sampleData = null; preView.cleanSampleData(); render(); } }; final String cleanDataImagePath = "icons/cleanData.png"; cleanDataButton.setImageDescriptor(ImageDescriptor.createFromURL(Activator.getDefault() .getBundle() .getResource(cleanDataImagePath))); cleanDataButton.setText("Clear Sample Data"); cleanDataButton.setEnabled(true); toolBarManager.add(cleanDataButton); toolBarManager.add(loadDataButton); toolBarManager.add(exportDataButton); }

Target:
private void addSampleDataButtons(IToolBarManager toolBarManager) { loadDataButton = new Action() { @Override public void run() { super.run(); loadSampleData(); } }; final String loadDataImagePath = "icons/loadData.png"; loadDataButton.setImageDescriptor(ImageDescriptor.createFromURL(Activator.getDefault() .getBundle() .getResource(loadDataImagePath))); loadDataButton.setText(Messages.PreviewView_ImportSampleDataButton); loadDataButton.setEnabled(true); exportDataButton = new Action() { @Override public void run() { super.run(); exportSampleData(); } }; final String exportDataImagePath = "icons/exportData.png"; exportDataButton.setImageDescriptor(ImageDescriptor.createFromURL(Activator.getDefault() .getBundle() .getResource(exportDataImagePath))); exportDataButton.setText(Messages.PreviewView_ExportSampleDataButton); exportDataButton.setEnabled(true); cleanDataButton = new Action() { @Override public void run() { super.run(); sampleData = null; preView.cleanSampleData(); render(); } }; final String cleanDataImagePath = "icons/cleanData.png"; cleanDataButton.setImageDescriptor(ImageDescriptor.createFromURL(Activator.getDefault() .getBundle() .getResource(cleanDataImagePath))); cleanDataButton.setText(Messages.PreviewView_ClearSampleDataButton); cleanDataButton.setEnabled(true); toolBarManager.add(cleanDataButton); toolBarManager.add(loadDataButton); toolBarManager.add(exportDataButton); }
Source:
public void toUpper() { assertThat( value.apply( "HELLO" ).toUpper(), equalTo( value.apply( "HELLO" ) ) ); assertThat( value.apply( "Hello" ).toUpper(), equalTo( value.apply( "HELLO" ) ) ); assertThat( value.apply( "hello" ).toUpper(), equalTo( value.apply( "HELLO" ) ) ); }

Target:
public void toUpper() { assertThat( value.apply( "HELLO" ).toUpper(), equalTo( value.apply( "HELLO" ) ) ); assertThat( value.apply( "Hello" ).toUpper(), equalTo( value.apply( "HELLO" ) ) ); assertThat( value.apply( "hello" ).toUpper(), equalTo( value.apply( "HELLO" ) ) ); assertThat( value.apply( "" ).toUpper(), equalTo( value.apply( "" ) ) ); }
Source:
public void connect_timeout_override_changes_how_long_it_takes_for_a_connection_to_timeout() { Client client = createStandardClient(); assertThatGetConnectonTimeoutForTarget( client.target(URI_THAT_CANNOT_BE_CONNECTED_TO) ).isLessThan(DEFAULT_CONNECT_TIMEOUT + 300); assertThatGetConnectonTimeoutForTarget( client.target(URI_THAT_CANNOT_BE_CONNECTED_TO) .property(ClientProperties.CONNECT_TIMEOUT, DEFAULT_CONNECT_TIMEOUT + 400) ).isGreaterThan(DEFAULT_CONNECT_TIMEOUT + 400); }

Target:
public void connect_timeout_override_changes_how_long_it_takes_for_a_connection_to_timeout() { assertThatGetConnectonTimeoutForTarget( client.target(URI_THAT_TIMESOUT_ON_CONNECTION_ATTEMPT) ).isLessThan(DEFAULT_CONNECT_TIMEOUT_IN_MILLIS + ERROR_MARGIN_IN_MILLIS); assertThatGetConnectonTimeoutForTarget( client.target(URI_THAT_TIMESOUT_ON_CONNECTION_ATTEMPT) .property(ClientProperties.CONNECT_TIMEOUT, DEFAULT_CONNECT_TIMEOUT_IN_MILLIS + INCREASE_IN_MILLIS + ERROR_MARGIN_IN_MILLIS) ).isGreaterThan(DEFAULT_CONNECT_TIMEOUT_IN_MILLIS + INCREASE_IN_MILLIS + ERROR_MARGIN_IN_MILLIS); }
Source:
private static boolean isObject(Type type) { return type.isSubtypeOf("java.lang.Object"); }

Target:
private static boolean isObject(Type type) { return !type.isPrimitive() && !type.isUnknown(); }