auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected Query doBuild(LuceneSearchPredicateContext context) { if ( queryBuilder != null ) { QueryBuilder effectiveQueryBuilder; if ( maxEditDistance != null ) { effectiveQueryBuilder = new FuzzyQueryBuilder( getAnalyzer(), maxEditDistance, prefixLength ); } else { queryBuilder.setAnalyzer( getAnalyzer() ); effectiveQueryBuilder = queryBuilder; } Query analyzed = effectiveQueryBuilder.createBooleanQuery( absoluteFieldPath, value ); if ( analyzed == null ) { analyzed = new MatchNoDocsQuery( "No tokens after analysis of the value to match" ); } return analyzed; } else { Term term = new Term( absoluteFieldPath, codec.normalize( absoluteFieldPath, value ) ); if ( maxEditDistance != null ) { return new FuzzyQuery( term, maxEditDistance, prefixLength ); } else { return new TermQuery( term ); } } }

Target:
protected Query doBuild(LuceneSearchPredicateContext context) { if ( analyzer != null ) { QueryBuilder effectiveQueryBuilder; if ( maxEditDistance != null ) { effectiveQueryBuilder = new FuzzyQueryBuilder( analyzer, maxEditDistance, prefixLength ); } else { effectiveQueryBuilder = new QueryBuilder( analyzer ); } Query analyzed = effectiveQueryBuilder.createBooleanQuery( absoluteFieldPath, value ); if ( analyzed == null ) { analyzed = new MatchNoDocsQuery( "No tokens after analysis of the value to match" ); } return analyzed; } else { Term term = new Term( absoluteFieldPath, codec.normalize( absoluteFieldPath, value ) ); if ( maxEditDistance != null ) { return new FuzzyQuery( term, maxEditDistance, prefixLength ); } else { return new TermQuery( term ); } } }
Source:
public void testCreateSymlinkOverrideExisting() throws IOException { FS fs = FS.DETECTED; File file = new File(trash, "x"); try { fs.createSymLink(file, "y"); } catch (IOException e) { if (fs.supportsSymlinks()) { fail("FS claims to support symlinks but attempt to create symlink failed"); } else { Assume.assumeTrue(false); } return; } assertTrue(fs.supportsSymlinks()); String target = fs.readSymLink(file); assertEquals("y", target); fs.createSymLink(file, "z"); target = fs.readSymLink(file); assertEquals("z", target); }

Target:
public void testCreateSymlinkOverrideExisting() throws IOException { FS fs = FS.DETECTED; Assume.assumeTrue(fs.supportsSymlinks()); File file = new File(trash, "x"); fs.createSymLink(file, "y"); assertTrue(fs.supportsSymlinks()); String target = fs.readSymLink(file); assertEquals("y", target); fs.createSymLink(file, "z"); target = fs.readSymLink(file); assertEquals("z", target); }
Source:
public void after() { UserFactory.logoutAllUsers(); }

Target:
public void after() { if (!looperThread.isRuleUsed() || looperThread.isTestComplete()) { UserFactory.logoutAllUsers(); } else { looperThread.runAfterTest(new Runnable() { @Override public void run() { UserFactory.logoutAllUsers(); } }); } }
Source:
public static void execute(String[] args, Configuration conf) { LOG.info("arguments : " + Arrays.toString(args)); try { CommandLine cmdline = new GnuParser().parse(getOptions(), args); if (cmdline.hasOption(ChaosServiceName.chaosagent.toString())) { String actionStr = cmdline.getOptionValue(ChaosServiceName.chaosagent.toString()); try { ExecutorAction action = ExecutorAction.valueOf(actionStr.toLowerCase()); if (action == ExecutorAction.start) { ChaosServiceStart(conf, ChaosServiceName.chaosagent); } else if (action == ExecutorAction.stop) { ChaosServiceStop(); } } catch (IllegalArgumentException e) { LOG.error("action passed:" + actionStr + " . Unexpected action. Please provide only start/stop."); throw new RuntimeException(e); } } else { LOG.error("Invalid Options"); } } catch (Exception e) { LOG.error("Error while starting ChaosService : " + e); } }

Target:
public static void execute(String[] args, Configuration conf) { LOG.info("arguments : " + Arrays.toString(args)); try { CommandLine cmdline = new GnuParser().parse(getOptions(), args); if (cmdline.hasOption(ChaosServiceName.CHAOSAGENT.toString().toLowerCase())) { String actionStr = cmdline.getOptionValue(ChaosServiceName.CHAOSAGENT.toString().toLowerCase()); try { ExecutorAction action = ExecutorAction.valueOf(actionStr.toUpperCase()); if (action == ExecutorAction.START) { ChaosServiceStart(conf, ChaosServiceName.CHAOSAGENT); } else if (action == ExecutorAction.STOP) { ChaosServiceStop(); } } catch (IllegalArgumentException e) { LOG.error("action passed: Unexpected action. Please provide only start/stop.", actionStr, e); throw new RuntimeException(e); } } else { LOG.error("Invalid Options"); } } catch (Exception e) { LOG.error("Error while starting ChaosService : ", e); } }
Source:
public Iterator<String> getNameLookupKeys(String name) { HashSet<String> keys = new HashSet<String>(); ArrayList<Token> tokens = HanziToPinyin.getInstance().get(name); final int tokenCount = tokens.size(); final StringBuilder keyPinyin = new StringBuilder(); final StringBuilder keyInitial = new StringBuilder(); final StringBuilder keyOrignal = new StringBuilder(); for (int i = tokenCount - 1; i >= 0; i--) { final Token token = tokens.get(i); if (Token.PINYIN == token.type) { keyPinyin.insert(0, token.target); if (i == tokenCount - 1) { keyInitial.insert(0, token.target); } else { keyInitial.insert(0, token.target.charAt(0)); } } else if (Token.LATIN == token.type) { if (keyPinyin.length() > 0) { keyPinyin.insert(0, ' '); } if (keyOrignal.length() > 0) { keyOrignal.insert(0, ' '); } keyPinyin.insert(0, token.source); if (i == tokenCount - 1) { keyInitial.insert(0, token.source); } else { keyInitial.insert(0, token.source.charAt(0)); } } keyOrignal.insert(0, token.source); keys.add(keyOrignal.toString()); keys.add(keyPinyin.toString()); keys.add(keyInitial.toString()); } return keys.iterator(); }

Target:
public Iterator<String> getNameLookupKeys(String name) { HashSet<String> keys = new HashSet<String>(); ArrayList<Token> tokens = HanziToPinyin.getInstance().get(name); final int tokenCount = tokens.size(); final StringBuilder keyPinyin = new StringBuilder(); final StringBuilder keyInitial = new StringBuilder(); final StringBuilder keyOrignal = new StringBuilder(); for (int i = tokenCount - 1; i >= 0; i--) { final Token token = tokens.get(i); String tokenString = null; if (Token.PINYIN == token.type) { tokenString = token.target; } else if (Token.LATIN == token.type) { if (keyPinyin.length() > 0) { keyPinyin.insert(0, ' '); } if (keyOrignal.length() > 0) { keyOrignal.insert(0, ' '); } tokenString = token.source; } if (tokenString != null) { keyPinyin.insert(0, tokenString); if (i == tokenCount - 1 && tokenCount > 1) { keyInitial.insert(0, tokenString); } else { keyInitial.insert(0, tokenString.charAt(0)); } } keyOrignal.insert(0, token.source); keys.add(keyOrignal.toString()); keys.add(keyPinyin.toString()); keys.add(keyInitial.toString()); } return keys.iterator(); }
Source:
public PaginationOptions pageNumber(int pageNumber) { checkState(pageNumber > 0, "pageSize must be > 0"); checkState(pageNumber <= 10000, "limit must be <= 50"); this.queryParameters.put(PAGE_NUMBER, Integer.toString(pageNumber)); return this; }

Target:
public PaginationOptions pageNumber(int pageNumber) { checkState(pageNumber > 0, "pageSize must be > 0"); checkState(pageNumber <= 50, "limit must be <= 50"); this.queryParameters.put(PAGE_NUMBER, Integer.toString(pageNumber)); return this; }
Source:
public void epsgTest() throws Exception { Envelope bounds = null; String[] testArray = {"EPSG:4326","EPSG:26910","EPSG:3857","EPSG:3412","EPSG:3411", "EPSG:3031"}; Envelope[] testEnvelopes = new Envelope[6]; testEnvelopes[0] = new Envelope(-180.0, 180.0, -90.0, 90.0); testEnvelopes[1] = new Envelope(212172.22206537757, 788787.632995196, 3378624.2031936757, 9083749.435906317); testEnvelopes[2] = new Envelope(-2.0037508342789244E7, 2.0037508342789244E7, -2.00489661040146E7, 2.0048966104014594E7); testEnvelopes[3] = new Envelope(-3323231.542684214, 3323231.542684214, -3323231.542684214, 3323231.542684214); testEnvelopes[4] = new Envelope(-2349879.5592850395, 2349879.5592850395, -2349879.5592850395, 2349879.5592850395); testEnvelopes[5] = new Envelope(-3333134.027630277, 3333134.027630277, -3333134.027630277, 3333134.027630277); for (int i = 0; i < testArray.length; i++) { try { bounds = new EPSGBoundsCalc().findCode(testArray[i]); } catch (Exception e) { e.printStackTrace(); } assertEquals(bounds, testEnvelopes[i]); } }

Target:
public void epsgTest() throws Exception { Envelope bounds = null; String[] testArray = {"EPSG:4326","EPSG:26910","EPSG:3857","EPSG:3412","EPSG:3411", "EPSG:3031"}; Envelope[] testEnvelopes = new Envelope[6]; testEnvelopes[0] = new Envelope(-180.0, 180.0, -90.0, 90.0); testEnvelopes[1] = new Envelope(212172.22206537757, 788787.632995196, 3378624.2031936757, 9083749.435906317); testEnvelopes[2] = new Envelope(-2.0037508342789244E7, 2.0037508342789244E7, -2.00489661040146E7, 2.0048966104014594E7); testEnvelopes[3] = new Envelope(-3323231.542684214, 3323231.542684214, -3323231.542684214, 3323231.542684214); testEnvelopes[4] = new Envelope(-2349879.5592850395, 2349879.5592850395, -2349879.5592850395, 2349879.5592850395); testEnvelopes[5] = new Envelope(-3333134.027630277, 3333134.027630277, -3333134.027630277, 3333134.027630277); for (int i = 0; i < testArray.length; i++) { bounds = new EPSGBoundsCalc().findCode(testArray[i]); assertEquals(bounds, testEnvelopes[i]); } }
Source:
public void checkAttributeValue(PerunSessionImpl perunSession, Resource resource, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongReferenceAttributeValueException, WrongAttributeAssignmentException { if(attribute.getValue() == null) { throw new WrongAttributeValueException(attribute, resource, "This attribute can't be empty"); } Facility facility = perunSession.getPerunBl().getResourcesManagerBl().getFacility(perunSession, resource); Attribute facilityAttr = null; try { facilityAttr = perunSession.getPerunBl().getAttributesManagerBl().getAttribute(perunSession, facility, AttributesManager.NS_FACILITY_ATTR_DEF + ":homeMountPoints"); } catch (AttributeNotExistsException ex) { throw new InternalErrorException(ex); } if(facilityAttr.getValue() == null) { throw new WrongReferenceAttributeValueException(attribute, facilityAttr, "Reference attribute has null value."); } if (!((List<String>) facilityAttr.getValue()).containsAll((List<String>) attribute.getValue())) { throw new WrongReferenceAttributeValueException(attribute, facilityAttr, resource, facility, "ReplicaSourcePath has to be the same as one of the F:D:homeMountPoints"); } }

Target:
public void checkAttributeValue(PerunSessionImpl perunSession, Resource resource, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongReferenceAttributeValueException, WrongAttributeAssignmentException { if(attribute.getValue() == null) { throw new WrongAttributeValueException(attribute, resource, "This attribute can't be empty"); } Facility facility = perunSession.getPerunBl().getResourcesManagerBl().getFacility(perunSession, resource); Attribute facilityAttr = null; try { facilityAttr = perunSession.getPerunBl().getAttributesManagerBl().getAttribute(perunSession, facility, AttributesManager.NS_FACILITY_ATTR_DEF + ":homeMountPoints"); } catch (AttributeNotExistsException ex) { throw new InternalErrorException(ex); } if(facilityAttr.getValue() == null) { throw new WrongReferenceAttributeValueException(attribute, facilityAttr, resource, facility, "Reference attribute has null value."); } if (!((List<String>) facilityAttr.getValue()).contains((String) attribute.getValue())) { throw new WrongReferenceAttributeValueException(attribute, facilityAttr, resource, facility, "ReplicaSourcePath has to be the same as one of the F:D:homeMountPoints"); } }
Source:
public void write(T entity, K partitionKey) throws IOException { DataStoreWriter<T> writer = null; Path path = null; if (partitionKey != null) { path = partitionStrategy.getPartitionResolver().resolvePath(partitionKey); writer = writers.get(path); } else if (fallbackWriter == null){ writer = createWriter(getConfiguration(), null, getCodec()); } if (writer == null) { writer = createWriter(getConfiguration(), path, getCodec()); writers.put(path, writer); } writer.write(entity); }

Target:
public void write(T entity, K partitionKey) throws IOException { DataStoreWriter<T> writer = null; Path path = null; if (partitionKey != null) { path = partitionStrategy.getPartitionResolver().resolvePath(partitionKey); writer = writers.get(path); } else if (fallbackWriter == null){ fallbackWriter = writer = createWriter(getConfiguration(), null, getCodec()); } if (writer == null) { writer = createWriter(getConfiguration(), path, getCodec()); writers.put(path, writer); } writer.write(entity); }
Source:
private void testSequenceNextval() throws SQLException { checkSequenceTypeWithMode("REGULAR", Types.BIGINT); checkSequenceTypeWithMode("Oracle", Types.DECIMAL); }

Target:
private void testSequenceNextval() throws SQLException { checkSequenceTypeWithMode("REGULAR", Types.BIGINT); checkSequenceTypeWithMode("Oracle", SysProperties.BIG_DECIMAL_IS_DECIMAL ? Types.DECIMAL : Types.NUMERIC); }
Source:
public Map<String,String> getAttributes(ExtSource extSource) { Map<String, String> attributes = new HashMap<>(); SqlRowSet srs = jdbc.queryForRowSet("select attr_name, attr_value from ext_sources_attributes where ext_sources_id = " + extSource.getId()); while (srs.next()) { attributes.put(srs.getString("attr_name"), srs.getString("attr_value")); } return attributes; }

Target:
public Map<String,String> getAttributes(ExtSource extSource) { return jdbc.query("select attr_name, attr_value from ext_sources_attributes where ext_sources_id = " + extSource.getId(), new AttributesExtractor()); }
Source:
public StreamEdge( StreamNode sourceVertex, StreamNode targetVertex, int typeNumber, List<String> selectedNames, StreamPartitioner<?> outputPartitioner, OutputTag outputTag) { this( sourceVertex, targetVertex, typeNumber, 0, selectedNames, outputPartitioner, outputTag, ShuffleMode.UNDEFINED); }

Target:
public StreamEdge( StreamNode sourceVertex, StreamNode targetVertex, int typeNumber, List<String> selectedNames, StreamPartitioner<?> outputPartitioner, OutputTag outputTag) { this( sourceVertex, targetVertex, typeNumber, ALWAYS_FLUSH_BUFFER_TIMEOUT, selectedNames, outputPartitioner, outputTag, ShuffleMode.UNDEFINED); }
Source:
public boolean startsWith(Bytes prefix) { for (int i = 0; i < prefix.length; i++) { if (this.byteAt(i) != prefix.byteAt(i)) return false; } return true; }

Target:
public boolean startsWith(Bytes prefix) { Objects.requireNonNull(prefix, "startWith(Bytes prefix) cannot have null parameter"); if (prefix.length > this.length) { return false; } else { int end = this.offset + prefix.length; for (int i = this.offset, j = prefix.offset; i < end; i++, j++) { if (this.data[i] != prefix.data[j]) { return false; } } } return true; }
Source:
public synchronized String toString(LocalTime localTime) { sbuf.setLength(0); if (localTime == LocalTime.MAX) { return "24:00:00"; } appendTime(sbuf, localTime); return sbuf.toString(); }

Target:
public synchronized String toString(LocalTime localTime) { sbuf.setLength(0); if (localTime.equals( LocalTime.MAX )) { return "24:00:00"; } appendTime(sbuf, localTime); return sbuf.toString(); }
Source:
protected LdapProviderType getLdapProviderType(CLIParser parser) throws ManageDomainsResult { try { return LdapProviderType.valueOf(parser.getArg(Arguments.type.name())); } catch (IllegalArgumentException i) { } catch (NullPointerException e) { } StringBuffer sb = new StringBuffer(); sb.append(parser.getArg(Arguments.type.name()) + ". Supported provider types are:\n"); for (LdapProviderType t : LdapProviderType.values()) { sb.append(" " + t.name() + "\n"); } throw new ManageDomainsResult(ManageDomainsResultEnum.INVALID_ARGUMENT_FOR_COMMAND, sb.toString()); }

Target:
protected LdapProviderType getLdapProviderType(CLIParser parser) throws ManageDomainsResult { try { return LdapProviderType.valueOfIgnoreCase(parser.getArg(Arguments.provider.name())); } catch (IllegalArgumentException i) { } catch (NullPointerException e) { } StringBuffer sb = new StringBuffer(); sb.append(parser.getArg(Arguments.provider.name()) + ". Supported provider types are:\n"); for (LdapProviderType t : LdapProviderType.values()) { sb.append(" " + t.name() + "\n"); } throw new ManageDomainsResult(ManageDomainsResultEnum.INVALID_ARGUMENT_FOR_COMMAND, sb.toString()); }
Source:
private String handleMatchingPatternAttribute(Pattern pattern, String attrValue) { String unescapedValue = StringEscapeUtils.unescapeHtml(attrValue); Matcher m = pattern.matcher(unescapedValue); StringBuffer sb = new StringBuffer(unescapedValue.length()); while (m.find()) { String url = m.group(1); for (String prefix : prefixes) { if (url.startsWith(prefix)) { url = prependHostName(url); if (BooleanUtils.isTrue(this.replaceHost)) { int index = attrValue.indexOf("://"); sb.setLength(0); sb.append(attrValue,0, index + 1); sb.append(url); } else { m.appendReplacement(sb, Matcher.quoteReplacement(url)); } break; } } } if (BooleanUtils.isFalse(this.replaceHost)) { m.appendTail(sb); } return sb.toString(); }

Target:
private String handleMatchingPatternAttribute(Pattern pattern, String attrValue) { String unescapedValue = StringEscapeUtils.unescapeHtml(attrValue); Matcher m = pattern.matcher(unescapedValue); StringBuffer sb = new StringBuffer(unescapedValue.length()); while (m.find()) { String url = m.group(1); for (String prefix : prefixes) { if (url.startsWith(prefix)) { url = prependHostName(url); if (this.replaceHost) { int index = attrValue.indexOf("://"); sb.setLength(0); sb.append(attrValue,0, index + 1); sb.append(url); } else { m.appendReplacement(sb, Matcher.quoteReplacement(url)); } break; } } } if (!this.replaceHost) { m.appendTail(sb); } return sb.toString(); }
Source:
public Observable<Configuration> load(String id) { return session.executeAndFetch(findConfiguration.bind(id)) .map(row -> { Map<String, String> map = new HashMap<>(); map.put(row.getString(0), row.getString(1)); return map; }) .reduce((m1, m2) -> { m2.putAll(m1); return m2; }) .map(map -> new Configuration(id, map)); }

Target:
public Observable<Configuration> load(String id) { return session.executeAndFetch(findConfiguration.bind(id)) .toMap(row -> row.getString(0), row -> row.getString(1)) .map(map -> new Configuration(id, map)); }
Source:
Cookie[] convertCookies(HttpEntity<?> httpEntity) { final List<Cookie> cookies = new LinkedList<>(); List<String> inboundCookies = httpEntity.getHeaders().get("Set-Cookie"); if (inboundCookies != null) { for (String cookieString : inboundCookies) { Cookie cookie = convertCookieString(cookieString); cookies.add(cookie); } } return cookies.toArray(new Cookie[0]); }

Target:
Cookie[] convertCookies(HttpEntity<?> httpEntity) { final List<Cookie> cookies = new LinkedList<>(); List<String> inboundCookies = httpEntity.getHeaders().get(HttpHeaders.SET_COOKIE); if (inboundCookies != null) { for (String cookieString : inboundCookies) { Cookie cookie = convertCookieString(cookieString); cookies.add(cookie); } } return cookies.toArray(new Cookie[0]); }
Source:
protected Endpoint createEndpoint(final String uri, final String remaining, final Map<String, Object> parameters) throws Exception { final YqlConfiguration configuration = new YqlConfiguration(); configuration.setQuery(remaining); configuration.setFormat((String) parameters.getOrDefault("format", "json")); configuration.setDiagnostics(Boolean.getBoolean((String) parameters.getOrDefault("diagnostics", "false"))); configuration.setCallback((String) parameters.getOrDefault("callback", "")); final Endpoint endpoint = new YqlEndpoint(uri, this, configuration); YqlConfigurationValidator.validateProperties(configuration); setProperties(configuration, parameters); return endpoint; }

Target:
protected Endpoint createEndpoint(final String uri, final String remaining, final Map<String, Object> parameters) throws Exception { final YqlConfiguration configuration = new YqlConfiguration(); configuration.setQuery(remaining); setProperties(configuration, parameters); YqlConfigurationValidator.validateProperties(configuration); final HttpClientConnectionManager connectionManager = createConnectionManager(); return new YqlEndpoint(uri, this, configuration, connectionManager); }
Source:
public static File createTemporaryIndexedFile(final String prefix, final String suffix) throws IOException { final File out = File.createTempFile(prefix, suffix); out.deleteOnExit(); String indexFileExtension = null; if (suffix.endsWith(FileExtensions.COMPRESSED_VCF)) { indexFileExtension = FileExtensions.TABIX_INDEX; } else if (suffix.endsWith(FileExtensions.VCF)) { indexFileExtension = FileExtensions.VCF_INDEX; } else if (suffix.endsWith(FileExtensions.BAM)) { indexFileExtension = FileExtensions.BAM_INDEX; } else if (suffix.endsWith(FileExtensions.CRAM)) { indexFileExtension = FileExtensions.CRAM_INDEX; } if (indexFileExtension != null) { final File indexOut = new File(out.getAbsolutePath() + indexFileExtension); indexOut.deleteOnExit(); } return out; }

Target:
public static File createTemporaryIndexedFile(final String prefix, final String suffix) throws IOException { final File out = File.createTempFile(prefix, suffix); out.deleteOnExit(); String indexFileExtension = null; if (suffix.endsWith(FileExtensions.COMPRESSED_VCF)) { indexFileExtension = FileExtensions.TABIX_INDEX; } else if (suffix.endsWith(FileExtensions.VCF)) { indexFileExtension = FileExtensions.VCF_INDEX; } else if (suffix.endsWith(FileExtensions.BAM)) { indexFileExtension = FileExtensions.BAM_BAI_INDEX; } else if (suffix.endsWith(FileExtensions.CRAM)) { indexFileExtension = FileExtensions.BAM_BAI_INDEX; } if (indexFileExtension != null) { final File indexOut = new File(out.getAbsolutePath() + indexFileExtension); indexOut.deleteOnExit(); } return out; }
Source:
public void testBasicAuthHeaderAddedToRequestWhenUserInfoPresentInUri() throws Exception { final URI mesosUri = URI.create("http://testuser:testpassword@localhost:12345/api/v1/scheduler"); final MesosSchedulerClient<Protos.Call, Protos.Event> client = MesosSchedulerClient.usingProtos(mesosUri, "testing"); final HttpClientRequest<ByteBuf> request = client.createPost.call(ACK) .toBlocking() .first(); final Map<String, String> headers = headersToMap(request.getHeaders()); assertThat(headers).containsKeys("Authorization"); final String authorization = headers.get("Authorization"); assertThat(authorization).isEqualTo("Basic dGVzdHVzZXI6dGVzdHBhc3N3b3Jk"); final String base64UserPass = authorization.substring("Begin ".length()); final String userPass = new String(Base64.getDecoder().decode(base64UserPass)); assertThat(userPass).isEqualTo("testuser:testpassword"); }

Target:
public void testBasicAuthHeaderAddedToRequestWhenUserInfoPresentInUri() throws Exception { final MesosSchedulerClient<Protos.Call, Protos.Event> client = MesosSchedulerClient.usingProtos( URI.create("http://testuser:testpassword@localhost:12345/api/v1/scheduler"), literal("testing", "latest") ); final HttpClientRequest<ByteBuf> request = client.createPost.call(ACK) .toBlocking() .first(); final Map<String, String> headers = headersToMap(request.getHeaders()); assertThat(headers).containsKeys("Authorization"); final String authorization = headers.get("Authorization"); assertThat(authorization).isEqualTo("Basic dGVzdHVzZXI6dGVzdHBhc3N3b3Jk"); final String base64UserPass = authorization.substring("Basic ".length()); final String userPass = new String(Base64.getDecoder().decode(base64UserPass)); assertThat(userPass).isEqualTo("testuser:testpassword"); }
Source:
public void blockedUserShouldBeAbleToChangeEmail() { final String newEmailAddress = "myAwesomeEmail@email.co.uk"; EditPreferencesPage editPrefPage = new EditPreferencesPage(driver).openEmailSection(); editPrefPage.changeEmail(newEmailAddress); PreferencesPageObject prefPage = editPrefPage.clickSaveButton(); prefPage.verifyNotificationMessage(); editPrefPage.openEmailSection(); Assertion.assertEquals(editPrefPage.getEmailAdress(), newEmailAddress); editPrefPage.changeEmail(Configuration.getCredentials().email); editPrefPage.clickSaveButton(); prefPage.verifyNotificationMessage(); editPrefPage.openEmailSection(); Assertion.assertEquals(editPrefPage.getEmailAdress(), Configuration.getCredentials().email); }

Target:
public void blockedUserShouldBeAbleToChangeEmail() { final String newEmailAddress = "myAwesomeEmail@email.co.uk"; final String oldEmailAddress = Configuration.getCredentials().email; EditPreferencesPage editPrefPage = new EditPreferencesPage(driver).openEmailSection(); editPrefPage.changeEmail(newEmailAddress); PreferencesPageObject prefPage = editPrefPage.clickSaveButton(); prefPage.verifyNotificationMessage(); editPrefPage.openEmailSection(); Assertion.assertEquals(editPrefPage.getEmailAdress(), newEmailAddress); editPrefPage.changeEmail(oldEmailAddress); editPrefPage.clickSaveButton(); prefPage.verifyNotificationMessage(); editPrefPage.openEmailSection(); Assertion.assertEquals(editPrefPage.getEmailAdress(), oldEmailAddress); }
Source:
boolean add(RevFlag flag) { if (sourceCommit.has(flag)) return false; else { sourceCommit.add(flag); return true; } }

Target:
boolean add(RevFlag flag) { if (sourceCommit.has(flag)) return false; sourceCommit.add(flag); return true; }
Source:
public void getUserContactsShouldReturnTheRequest() throws Exception { final AtomicReference<Request> bodyRef = new AtomicReference<>(); final CountDownLatch latch = new CountDownLatch(1); final RestAdapter adapter = new RestAdapter.Builder().setEndpoint(MOCK_URL).setClient(new Client() { @Override public Response execute(Request request) throws IOException { bodyRef.set(request); latch.countDown(); return null; } }).build(); final UserService userService = adapter.create(UserService.class); userService.getUserContacts(new RetrofitPromise<List<Contact>>()); latch.await(); Assert.assertEquals(bodyRef.get().getUrl(), String.format("%s/v0/me/contacts", MOCK_URL)); Assert.assertEquals(bodyRef.get().getMethod(), "GET"); }

Target:
public void getUserContactsShouldReturnTheRequest() throws Exception { final AtomicReference<Request> bodyRef = new AtomicReference<>(); final CountDownLatch latch = new CountDownLatch(1); final RestAdapter adapter = new RestAdapter.Builder().setEndpoint(MOCK_URL).setClient(new Client() { @Override public Response execute(Request request) throws IOException { bodyRef.set(request); latch.countDown(); return null; } }).build(); final UserService userService = adapter.create(UserService.class); userService.getUserContacts(new RetrofitPromise<List<Contact>>()); latch.await(); Assert.assertEquals(bodyRef.get().getMethod(), "GET"); Assert.assertEquals(bodyRef.get().getUrl(), String.format("%s/v0/me/contacts", MOCK_URL)); }
Source:
public void run() { while (true) { this.inputMenu(); String line; try { line = bis.readLine(); } catch (IOException e1) { e1.printStackTrace(); logger.info("Bye"); System.exit(0); return; } try { this.processCommand(line); } catch (Exception e) { e.printStackTrace(); System.exit(-1); } if (Thread.currentThread().isInterrupted()) { logger.info("Bye"); System.exit(0); } } }

Target:
public void run() { while (true) { this.inputMenu(); String line; try { line = bis.readLine(); } catch (IOException e1) { e1.printStackTrace(); System.err.println("Bye"); System.exit(0); return; } try { this.processCommand(line); } catch (Exception e) { e.printStackTrace(); System.exit(-1); } if (Thread.currentThread().isInterrupted()) { System.err.println("Bye"); System.exit(0); } } }
Source:
public void loginLogoutResumeSyncing() throws InterruptedException { String username = UUID.randomUUID().toString(); String password = "password"; SyncUser user = SyncUser.login(SyncCredentials.usernamePassword(username, password, true), Constants.AUTH_URL); SyncConfiguration config = new SyncConfiguration.Builder(user, Constants.USER_REALM) .schema(StringOnly.class) .build(); Realm realm = Realm.getInstance(config); realm.beginTransaction(); realm.createObject(StringOnly.class).setChars("Foo"); realm.commitTransaction(); SyncManager.getSession(config).uploadAllLocalChanges(); user.logout(); realm.close(); user = SyncUser.login(SyncCredentials.usernamePassword(username, password, false), Constants.AUTH_URL); SyncConfiguration config2 = new SyncConfiguration.Builder(user, Constants.USER_REALM) .schema(StringOnly.class) .build(); Realm realm2 = Realm.getInstance(config2); SyncManager.getSession(config2).downloadAllServerChanges(); realm2.refresh(); assertEquals(1, realm2.where(StringOnly.class).count()); }

Target:
public void loginLogoutResumeSyncing() throws InterruptedException { String username = UUID.randomUUID().toString(); String password = "password"; SyncUser user = SyncUser.login(SyncCredentials.usernamePassword(username, password, true), Constants.AUTH_URL); SyncConfiguration config = new SyncConfiguration.Builder(user, Constants.USER_REALM) .schema(StringOnly.class) .build(); Realm realm = Realm.getInstance(config); realm.beginTransaction(); realm.createObject(StringOnly.class).setChars("Foo"); realm.commitTransaction(); SyncManager.getSession(config).uploadAllLocalChanges(); user.logout(); realm.close(); assertTrue(Realm.deleteRealm(config)); user = SyncUser.login(SyncCredentials.usernamePassword(username, password, false), Constants.AUTH_URL); SyncConfiguration config2 = new SyncConfiguration.Builder(user, Constants.USER_REALM) .schema(StringOnly.class) .build(); Realm realm2 = Realm.getInstance(config2); SyncManager.getSession(config2).downloadAllServerChanges(); realm2.refresh(); assertEquals(1, realm2.where(StringOnly.class).count()); realm2.close(); }
Source:
public MigratableTableTranslation<DBOVerificationState, DBOVerificationState> getTranslator() { return new BasicMigratableTableTranslation<DBOVerificationState>() { @Override public DBOVerificationState createDatabaseObjectFromBackup(DBOVerificationState backup) { if (backup.getEtag() == null) { backup.setEtag(UUID.randomUUID().toString()); } return backup; } }; }

Target:
public MigratableTableTranslation<DBOVerificationState, DBOVerificationState> getTranslator() { return new BasicMigratableTableTranslation<>(); }
Source:
public void unknown_method() { Expression.Variable arg = UCFGBuilder.variableWithId("arg"); UCFG expectedUCFG = UCFGBuilder.createUCFGForMethod("A#method(Ljava/util/Set;)V").addMethodParam(arg) .addBasicBlock(newBasicBlock("0") .ret(constant("implicit return"), new LocationInFile(FILE_KEY, 9, 2, 9, 3))) .build(); assertCodeToUCfg("import java.util.Set;\n" + "import java.util.Collection;\n" + "import java.util.stream.Collectors;\n" + "public class A {\n" + " void method(Set<String> arg) { \n" + " arg.stream()\n" + " .flatMap(Collection::stream)\n" + " .collect(Collectors.toCollection(LinkedHashSet::new)); \n" + " }\n" + "}", expectedUCFG); }

Target:
public void unknown_method() { Expression.Variable arg = UCFGBuilder.variableWithId("arg"); UCFG expectedUCFG = UCFGBuilder.createUCFGForMethod("A#method(Ljava/util/Set;)V").addMethodParam(arg) .addBasicBlock(newBasicBlock("0") .ret(constant("implicit return"), new LocationInFile(FILE_KEY, 9, 2, 9, 3))) .build(); String source = "import java.util.Set;\n" + "import java.util.Collection;\n" + "import java.util.stream.Collectors;\n" + "public class A {\n" + " void method(Set<String> arg) { \n" + " arg.stream()\n" + " .flatMap(Collection::stream)\n" + " .collect(Collectors.toCollection(LinkedHashSet::new)); \n" + " }\n" + "}"; assertUnknownMethodCalled(source); assertCodeToUCfg(source, expectedUCFG); }
Source:
protected void fireLabelProviderChanged( final LabelProviderChangedEvent event) { Object[] theListeners = getListeners(); for (Object theListener : theListeners) { final ILabelProviderListener l = (ILabelProviderListener) theListener; SafeRunner.run(new SafeRunnable() { @Override public void run() { l.labelProviderChanged(event); } }); } }

Target:
protected void fireLabelProviderChanged( final LabelProviderChangedEvent event) { for (Object listener : getListeners()) { final ILabelProviderListener labelProviderListener = (ILabelProviderListener) listener; SafeRunner.run(new SafeRunnable() { @Override public void run() { labelProviderListener.labelProviderChanged(event); } }); } }
Source:
PropertyMapper(Class<?> baseClass, String propertyName, String alias, Field field, PropertyDescriptor property) { this.propertyName = propertyName; this.alias = alias; this.field = field; getter = ReflectionUtils.findGetter(property); setter = ReflectionUtils.findSetter(baseClass, property); annotations = ReflectionUtils.scanPropertyAnnotations(field, property); if (field != null) ReflectionUtils.tryMakeAccessible(field); if (getter != null) ReflectionUtils.tryMakeAccessible(getter); if (setter != null) ReflectionUtils.tryMakeAccessible(setter); if (!isTransient()) { checkState((field != null && field.isAccessible()) || (getter != null && getter.isAccessible()), "Property '%s' is not readable", propertyName); checkState((field != null && field.isAccessible()) || (setter != null && setter.isAccessible()), "Property '%s' is not writable", propertyName); } columnName = inferColumnName(); position = inferPosition(); javaType = inferJavaType(); customCodec = createCustomCodec(); }

Target:
PropertyMapper(Class<?> baseClass, String propertyName, String alias, Field field, PropertyDescriptor property) { this.propertyName = propertyName; this.alias = alias; this.field = field; getter = ReflectionUtils.findGetter(property); setter = ReflectionUtils.findSetter(baseClass, property); annotations = ReflectionUtils.scanPropertyAnnotations(field, property); if (field != null) ReflectionUtils.tryMakeAccessible(field); if (getter != null) ReflectionUtils.tryMakeAccessible(getter); if (setter != null) ReflectionUtils.tryMakeAccessible(setter); if (!isTransient()) { checkArgument((field != null && field.isAccessible()) || (getter != null && getter.isAccessible()), "Property '%s' is not readable", propertyName); checkArgument((field != null && field.isAccessible()) || (setter != null && setter.isAccessible()), "Property '%s' is not writable", propertyName); } columnName = inferColumnName(); position = inferPosition(); javaType = inferJavaType(); customCodec = createCustomCodec(); }
Source:
public FunctionManager(TypeManager typeManager, BlockEncodingSerde blockEncodingSerde, FeaturesConfig featuresConfig) { functionNamespaces = ImmutableMap.of(); this.typeManager = requireNonNull(typeManager, "typeManager is null"); this.blockEncodingSerde = requireNonNull(blockEncodingSerde, "blockEncodingSerde is null"); this.featuresConfig = requireNonNull(featuresConfig, "featuresConfig is null"); operatorNamespace = new StaticFunctionNamespace(typeManager, blockEncodingSerde, featuresConfig); }

Target:
public FunctionManager(TypeManager typeManager, BlockEncodingSerde blockEncodingSerde, FeaturesConfig featuresConfig) { FunctionRegistry functionRegistry = new FunctionRegistry(typeManager, blockEncodingSerde, featuresConfig, this); this.globalFunctionNamespace = new FunctionNamespace(functionRegistry); this.functionInvokerProvider = new FunctionInvokerProvider(functionRegistry); if (typeManager instanceof TypeRegistry) { ((TypeRegistry) typeManager).setFunctionManager(this); } }
Source:
public String toString() { if (namespaceURI.equals(QName.NULL_NS_URI)) { return localPart; } else { return prefix + ":" + localPart; } }

Target:
public String toString() { if (namespaceURI.equals(QName.NULL_NS_URI)) { return localPart; } else { return "{" + namespaceURI + "}" + localPart; } }
Source:
public void emitTuples() { try { String line = reader.readLine(); if (line == null) { reader.close(); initReader(); } else { this.output.emit(line); } Thread.sleep(500); } catch (IOException ex) { throw new RuntimeException(ex); } catch (InterruptedException e) { e.printStackTrace(); } }

Target:
public void emitTuples() { try { String line = reader.readLine(); if (line == null) { done = true; reader.close(); Thread.sleep(1000); } else { this.output.emit(line); } Thread.sleep(50); } catch (IOException ex) { throw new RuntimeException(ex); } catch (InterruptedException e) { } }
Source:
public void afterMethod() throws Exception { for (String db : _allDBs) { _gSetupTool.dropResourceFromCluster(CLUSTER_NAME, db); } _allDBs.clear(); Thread.sleep(100); ZkHelixClusterVerifier _clusterVerifier = new BestPossibleExternalViewVerifier.Builder(CLUSTER_NAME).setZkClient(_gZkClient) .setWaitTillVerify(TestHelper.DEFAULT_REBALANCE_PROCESSING_WAIT_TIME) .build(); Assert.assertTrue(_clusterVerifier.verifyByPolling()); }

Target:
public void afterMethod() throws Exception { for (String db : _allDBs) { _gSetupTool.dropResourceFromCluster(CLUSTER_NAME, db); } _allDBs.clear(); ZkHelixClusterVerifier _clusterVerifier = new BestPossibleExternalViewVerifier.Builder(CLUSTER_NAME).setZkClient(_gZkClient) .setWaitTillVerify(TestHelper.DEFAULT_REBALANCE_PROCESSING_WAIT_TIME) .build(); Assert.assertTrue(_clusterVerifier.verifyByPolling()); }
Source:
private static AttributeDefinition getAttributeDefinition(String name, ModelType modelType, ModelNode defaultValue) { if (NO_DEFAULT.equals(defaultValue.asString())) { return new SimpleAttributeDefinitionBuilder(name, modelType) .setRequired(false) .setAllowExpression(false) .build(); } else { return new SimpleAttributeDefinitionBuilder(name, modelType) .setRequired(false) .setAllowExpression(false) .setDefaultValue(defaultValue) .build(); } }

Target:
private static AttributeDefinition getAttributeDefinition(String name, ModelType modelType, ModelNode defaultValue) { if (NO_DEFAULT.equals(defaultValue.asString())) { return new SimpleAttributeDefinitionBuilder(name, modelType) .setRequired(false) .setAllowExpression(true) .build(); } else { return new SimpleAttributeDefinitionBuilder(name, modelType) .setRequired(false) .setAllowExpression(true) .setDefaultValue(defaultValue) .build(); } }
Source:
public void reset() { service = null; messageBusProxy = new MessageBusProxy(); requestDispatcherProxy = new RequestDispatcherProxy(); }

Target:
public void reset() { service = null; messageBusProxy.reset(); requestDispatcherProxy.reset(); }
Source:
public Page<BundleRest> findAll(Context context, Pageable pageable) { throw new RuntimeException("Method not allowed!"); }

Target:
public Page<BundleRest> findAll(Context context, Pageable pageable) { throw new RepositoryMethodNotImplementedException(BundleRest.NAME, "findAll"); }
Source:
public String toString() { return name + ":" + type + ":" + jsonPath + ":" + jsonType + ":" + isList; }

Target:
public String toString() { return toStringHelper(this) .add("name", name) .add("type", type) .add("jsonPath", jsonPath) .add("jsonType", jsonType) .add("isList", isList) .add("ordinalPosition", ordinalPosition) .toString(); }
Source:
public void match(BuiltinList builtinList, Term pattern) { if (!(pattern instanceof BuiltinList)) { this.fail(builtinList, pattern); } if (matchOnFunctionSymbol) { builtinList.toLabelRepresentation(termContext).accept( this, ((BuiltinList) pattern).toLabelRepresentation(termContext)); evaluateSubstitution(fSubstitution, termContext); return; } throw new UnsupportedOperationException( "list matching is only supported when one of the lists is a variable."); }

Target:
public void match(BuiltinList builtinList, Term pattern) { if (!(pattern instanceof BuiltinList)) { this.fail(builtinList, pattern); } if (matchOnFunctionSymbol) { builtinList.toK(termContext).accept(this, ((BuiltinList) pattern).toK(termContext)); evaluateSubstitution(fSubstitution, termContext); return; } throw new UnsupportedOperationException( "list matching is only supported when one of the lists is a variable."); }
Source:
public void logsMessage() throws IOException { final Collection<String> logs = new ArrayList<String>(1); new TkLogged( new TkText("test"), new Target() { @Override public void log(final String format, final Object... param) { logs.add( MessageFormatter.arrayFormat(format, param).getMessage() ); } }).act(); MatcherAssert.assertThat( logs, Matchers.everyItem(Matchers.containsString("act()")) ); }

Target:
public void logsMessage() throws IOException { final Target target = Mockito.mock(Target.class); new TkLogged(new TkText("test"), target).act(); Mockito.verify(target, Mockito.times(1)).log( Mockito.eq("[{}] #act() return in ms"), Mockito.isA(Take.class), Mockito.isA(Response.class), Mockito.anyLong() ); }
Source:
public void verifyDataAccount(DataAccount dataAccount, Date date) throws DataAccessException, ServiceException { if (dataAccount != null && dataAccount.source != null) { DataAccountCollector collector = DataAccountCollectorFactory.getCollectorForSource(dataAccount.source.a3Code); if (collector != null) { try { collector.collect(dataAccount, date); } catch (ServiceException e) { throw new ServiceException(e.getCode(), e.getMessage()); } } } }

Target:
public void verifyDataAccount(DataAccount dataAccount, Date date) throws ServiceException { if (dataAccount != null && dataAccount.source != null) { DataAccountCollector collector = DataAccountCollectorFactory.getCollectorForSource(dataAccount.source.a3Code); if (collector != null) { try { collector.collect(dataAccount, date); } catch (ServiceException e) { throw e; } } } }
Source:
public Variable getVariableInstance(){ if(v_inst == null){ v_inst = new Variable(getVariableIdentifierInstance(), getTypeExpression()); } return v_inst; }

Target:
public Variable getVariableInstance(){ return new Variable(getVariableIdentifierInstance(), getTypeExpression()); }
Source:
private boolean shouldMergePlugins(Map<String, String> attributes) { if (attributes.containsKey(MERGE_PLUGINS_ATTRIBUTE)) { return "true".equals(attributes.get(MERGE_PLUGINS_ATTRIBUTE)); } return "true".equals(defaultMergePlugins); }

Target:
private boolean shouldMergePlugins(Map<String, String> attributes) { String devfileMergePlugins = attributes.get(MERGE_PLUGINS_ATTRIBUTE); if (devfileMergePlugins != null) { return Boolean.parseBoolean(devfileMergePlugins); } return defaultMergePlugins; }
Source:
public void setParams(FormRecord record, String dataTitle, Long timestamp) throws SessionUnavailableException{ if(names.containsKey(record.getFormNamespace())) { Text name = names.get(record.getFormNamespace()); mPrimaryTextView.setText(name.evaluate()); mPrimaryTextView.setText(Localizer.processArguments(name.evaluate(), new String[] {""}).trim()); mPrimaryTextView.setText(MediaUtil.stripArguments(name.evaluate())); } else { formExists = false; mPrimaryTextView.setText(Localization.get("form.record.gone")); } if(dataTitle != null) { mLowerTextView.setText(dataTitle); } if(timestamp != 0) { mRightTextView.setText(DateUtils.formatSameDayTime(timestamp, start.getTime(), DateFormat.DEFAULT, DateFormat.DEFAULT)); } else { mRightTextView.setText("Never"); } if(record.getStatus() == FormRecord.STATUS_UNSENT) { mUpperRight.setText(Localization.get("form.record.unsent")); mUpperRight.setTextAppearance(getContext(), R.style.WarningTextStyle); mUpperRight.setCompoundDrawablesWithIntrinsicBounds(null, null, rightHandSync, null); } else { mUpperRight.setText(""); mUpperRight.setCompoundDrawables(null, null, null, null); } }

Target:
public void setParams(FormRecord record, String dataTitle, Long timestamp) throws SessionUnavailableException{ if(names.containsKey(record.getFormNamespace())) { Text name = names.get(record.getFormNamespace()); mPrimaryTextView.setText(name.evaluate()); } else { formExists = false; mPrimaryTextView.setText(Localization.get("form.record.gone")); } if(dataTitle != null) { mLowerTextView.setText(dataTitle); } if(timestamp != 0) { mRightTextView.setText(DateUtils.formatSameDayTime(timestamp, start.getTime(), DateFormat.DEFAULT, DateFormat.DEFAULT)); } else { mRightTextView.setText("Never"); } if(record.getStatus() == FormRecord.STATUS_UNSENT) { mUpperRight.setText(Localization.get("form.record.unsent")); mUpperRight.setTextAppearance(getContext(), R.style.WarningTextStyle); mUpperRight.setCompoundDrawablesWithIntrinsicBounds(null, null, rightHandSync, null); } else { mUpperRight.setText(""); mUpperRight.setCompoundDrawables(null, null, null, null); } }
Source:
public void deleteServiceTypes(Services services) { Log.e("bbj", services.getName()); RestApi restApi = RestServiceBuilder.createService(RestApi.class); Call<Services> call = restApi.deleteServiceTypes(services.getUuid(), true); call.enqueue(new Callback<Services>() { @Override public void onResponse(Call<Services> call, Response<Services> response) { if (response.isSuccessful()) { Log.e("succ","succ"); mManageServiceView.getServiceTypes(); } } @Override public void onFailure(Call<Services> call, Throwable t) { Log.e("jvk", "vkvkjkj"); } }); }

Target:
public void deleteServiceTypes(Services services) { RestApi restApi = RestServiceBuilder.createService(RestApi.class); Call<Services> call = restApi.deleteServiceTypes(services.getUuid(), true); call.enqueue(new Callback<Services>() { @Override public void onResponse(Call<Services> call, Response<Services> response) { if (response.isSuccessful()) { mManageServiceView.getServiceTypes(); } } @Override public void onFailure(Call<Services> call, Throwable t) { } }); }
Source:
public NativeLinkable.Linkage getPreferredLinkage(CxxPlatform cxxPlatform) { if (getBuildTarget().getFlavors().contains(SWIFT_LIBRARY_FLAVOR)) { return Linkage.STATIC; } else { return Linkage.ANY; } }

Target:
public NativeLinkable.Linkage getPreferredLinkage(CxxPlatform cxxPlatform) { if (getBuildTarget().getFlavors().contains(SWIFT_COMPANION_FLAVOR)) { return Linkage.STATIC; } else { return Linkage.ANY; } }
Source:
public LdapUser getUser(final String username, final String type, final String name) throws NoLdapUserMatchingQueryException { LdapContext context = null; try { context = _ldapContextFactory.createBindContext(); final String escapedUsername = LdapUtils.escapeLDAPSearchFilter(username); return _ldapUserManagerFactory.getInstance(_ldapConfiguration.getLdapProvider()).getUser(escapedUsername, type, name, context); } catch (NamingException | IOException e) { s_logger.debug("ldap Exception: ",e); throw new NoLdapUserMatchingQueryException("No Ldap User found for username: "+username + "name: " + name + "of type" + type); } finally { closeContext(context); } }

Target:
public LdapUser getUser(final String username, final String type, final String name) throws NoLdapUserMatchingQueryException { LdapContext context = null; try { context = _ldapContextFactory.createBindContext(); final String escapedUsername = LdapUtils.escapeLDAPSearchFilter(username); return _ldapUserManagerFactory.getInstance(_ldapConfiguration.getLdapProvider()).getUser(escapedUsername, type, name, context); } catch (NamingException | IOException e) { s_logger.debug("ldap Exception: ",e); throw new NoLdapUserMatchingQueryException("No Ldap User found for username: "+username + "name: " + name + "of type: " + type); } finally { closeContext(context); } }
Source:
public void close() { if (dispatcher != null) { dispatcher.unsubscribe(subject); conn.closeDispatcher(dispatcher); dispatcher = null; } super.close(); }

Target:
public void close() { if (dispatcher != null) { conn.closeDispatcher(dispatcher); dispatcher = null; } super.close(); }
Source:
public String toString() { return "JarInfo{" + "mJarFile=" + jarFile + ", mDependencies=" + dependencies + ", mResolvedCoordinates=" + resolvedCoordinates + '}'; }

Target:
public String toString() { return "JarInfo{" + "jarFile=" + jarFile + ", compiled=" + compiled + ", packaged=" + packaged + ", dependencies=" + dependencies + ", resolvedCoordinates=" + resolvedCoordinates + '}'; }
Source:
public void addSubmitRecords(ChangeAttribute ca, List<SubmitRecord> submitRecords) throws IllegalStateException { ca.submitRecords = new ArrayList<SubmitRecordAttribute>(); for (SubmitRecord submitRecord : submitRecords) { SubmitRecordAttribute sa = new SubmitRecordAttribute(); switch (submitRecord.status) { case OK: sa.status = "OK"; addSubmitRecordLabels(submitRecord, sa); break; case NOT_READY: sa.status = "NOT_READY"; addSubmitRecordLabels(submitRecord, sa); break; case RULE_ERROR: sa.status = "RULE_ERROR"; break; default: throw new IllegalStateException( "Unsupported SubmitRecord.status + (" + submitRecord.status + ")"); } ca.submitRecords.add(sa); } if (ca.submitRecords.isEmpty()) { ca.submitRecords = null; } }

Target:
public void addSubmitRecords(ChangeAttribute ca, List<SubmitRecord> submitRecords) { ca.submitRecords = new ArrayList<SubmitRecordAttribute>(); for (SubmitRecord submitRecord : submitRecords) { SubmitRecordAttribute sa = new SubmitRecordAttribute(); sa.status = submitRecord.status.name(); if (submitRecord.status != SubmitRecord.Status.RULE_ERROR) { addSubmitRecordLabels(submitRecord, sa); } ca.submitRecords.add(sa); } if (ca.submitRecords.isEmpty()) { ca.submitRecords = null; } }