auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Pagination<Payment> searchPayments(final String searchKey, final Long offset, final Long limit, final String pluginName, final boolean withPluginInfo, final boolean withAttempts, final Iterable<PluginProperty> properties, final TenantContext context) throws PaymentApiException { return paymentProcessor.searchPayments(searchKey, offset, limit, pluginName, withPluginInfo, properties, context, internalCallContextFactory.createInternalTenantContext(context)); }

Target:
public Pagination<Payment> searchPayments(final String searchKey, final Long offset, final Long limit, final String pluginName, final boolean withPluginInfo, final boolean withAttempts, final Iterable<PluginProperty> properties, final TenantContext context) throws PaymentApiException { return paymentProcessor.searchPayments(searchKey, offset, limit, pluginName, withPluginInfo, withAttempts, properties, context, internalCallContextFactory.createInternalTenantContext(context)); }
Source:
public void connect() throws Exception { if (channel.getClusterName() != null && !clusterName.equals(channel.getClusterName())) { throw new ConnectionFailedException("Already joined cluster: " + channel.getClusterName()); } channel.setReceiver(this); channel.connect(clusterName); Address localAddress = channel.getAddress(); String localName = localAddress.toString(); SimpleMember<Address> localMember = new SimpleMember<>(localName, localAddress, LOCAL_MEMBER, null); members.put(localAddress, new VersionedMember(localMember, membershipVersion.getAndIncrement())); updateConsistentHash(ch -> ch.with(localMember, loadFactor, commandFilter)); if (!executorProvided) { executorService = Executors.newCachedThreadPool(new AxonThreadFactory("JGroupsConnector")); } }

Target:
public void connect() throws Exception { if (channel.getClusterName() != null && !clusterName.equals(channel.getClusterName())) { throw new ConnectionFailedException("Already joined cluster: " + channel.getClusterName()); } channel.setReceiver(this); channel.connect(clusterName); Address localAddress = channel.getAddress(); String localName = localAddress.toString(); SimpleMember<Address> localMember = new SimpleMember<>(localName, localAddress, LOCAL_MEMBER, null); members.put(localAddress, new VersionedMember(localMember, membershipVersion.getAndIncrement())); updateConsistentHash(ch -> ch.with(localMember, loadFactor, commandFilter)); if (!executorProvided) { executorService = Executors.newCachedThreadPool(new AxonThreadFactory("JGroupsConnector - " + localName)); } }
Source:
public int compareTo(Property property) { return this.getTitle().toLowerCase().compareTo(property.getTitle().toLowerCase()); }

Target:
public int compareTo(Property property) { int title = this.getTitle().toLowerCase().compareTo(property.getTitle().toLowerCase()); int value = this.getValue().toLowerCase().compareTo(property.getValue().toLowerCase()); if (title == 0 && value == 0) { return 0; } else if (value == 0) { return title; } else { return value; } }
Source:
private static CString getHMAC(String algorithm, Target t, Construct[] args) { try { SecretKeySpec signingKey = new SecretKeySpec(args[0].val().getBytes(), algorithm); Mac mac = Mac.getInstance(algorithm); mac.init(signingKey); byte[] hmac = mac.doFinal(args[1].val().getBytes()); String hash = StringUtils.toHex(hmac).toLowerCase(); return new CString(hash, t); } catch (NoSuchAlgorithmException ex) { throw new ConfigRuntimeException("An error occured while trying to hash your data", ExceptionType.PluginInternalException, t, ex); } catch (InvalidKeyException ex) { throw new ConfigRuntimeException("An error occured while trying to hash your data", ExceptionType.PluginInternalException, t, ex); } }

Target:
private static CString getHMAC(String algorithm, Target t, Construct[] args) { try { SecretKeySpec signingKey = new SecretKeySpec(args[0].val().getBytes(), algorithm); Mac mac = Mac.getInstance(algorithm); mac.init(signingKey); byte[] hmac = mac.doFinal(args[1].val().getBytes()); String hash = StringUtils.toHex(hmac).toLowerCase(); return new CString(hash, t); } catch (NoSuchAlgorithmException | InvalidKeyException ex) { throw new ConfigRuntimeException("An error occured while trying to hash your data", ExceptionType.PluginInternalException, t, ex); } }
Source:
public void load() throws IOException { super.load(); if (servers == null) { servers = new ArrayList<GerritServer>(); if (config != null) { GerritServer defaultServer = new GerritServer(DEFAULT_SERVER_NAME); defaultServer.setConfig(config); servers.add(defaultServer); } } }

Target:
public void load() throws IOException { super.load(); if (servers == null) { servers = new LinkedList<GerritServer>(); if (config != null) { GerritServer defaultServer = new GerritServer(DEFAULT_SERVER_NAME); defaultServer.setConfig(config); servers.add(defaultServer); } setServers(servers); save(); } }
Source:
public void startup() { for (int i = 0; i < _ports.size(); i++) { Integer port = _ports.get(i); File logDir = FileUtils.constructRandomDirectoryInTempDir("kafka-local-" + port); Properties properties = new Properties(); properties.putAll(_baseProperties); properties.setProperty("zookeeper.connect", _zkConnection); properties.setProperty("broker.id", String.valueOf(i + 1)); properties.setProperty("host.name", "localhost"); properties.setProperty("port", Integer.toString(port)); properties.setProperty("log.dir", logDir.getAbsolutePath()); properties.setProperty("log.flush.interval.messages", String.valueOf(1)); properties.setProperty("log.cleaner.enable", Boolean.FALSE.toString()); properties.setProperty("offsets.topic.num.partitions", "1"); properties.setProperty("auto.create.topics.enable", "false"); KafkaServer broker = startBroker(properties); _brokerList.add(broker); _logDirs.add(logDir); } }

Target:
public void startup() { for (int i = 0; i < _ports.size(); i++) { Integer port = _ports.get(i); File logDir = FileUtils.constructRandomDirectoryInTempDir("kafka-local-" + port); Properties properties = new Properties(); properties.putAll(_baseProperties); properties.setProperty("zookeeper.connect", _zkConnection); properties.setProperty("broker.id", String.valueOf(i + 1)); properties.setProperty("host.name", "localhost"); properties.setProperty("port", Integer.toString(port)); properties.setProperty("log.dir", logDir.getAbsolutePath()); properties.setProperty("log.flush.interval.messages", String.valueOf(1)); properties.setProperty("log.cleaner.enable", Boolean.FALSE.toString()); properties.setProperty("offsets.topic.num.partitions", "1"); KafkaServer broker = startBroker(properties); _brokerList.add(broker); _logDirs.add(logDir); } }
Source:
public void renewMessageLock(ServiceBusReceivedMessage message, Duration maxLockRenewalDuration, Consumer<Throwable> onError) { final String lockToken = message != null ? message.getLockToken() : "null"; final Consumer<Throwable> throwableConsumer = onError != null ? onError : error -> logger.warning("Exception occurred while renewing lock token '{}'.", lockToken, error); asyncClient.renewMessageLock(message, maxLockRenewalDuration).subscribe( v -> logger.verbose("Completed renewing lock token: '{}'", lockToken), throwableConsumer); }

Target:
public void renewMessageLock(ServiceBusReceivedMessage message, Duration maxLockRenewalDuration, Consumer<Throwable> onError) { final String lockToken = message != null ? message.getLockToken() : "null"; final Consumer<Throwable> throwableConsumer = onError != null ? onError : error -> logger.warning("Exception occurred while renewing lock token '{}'.", lockToken, error); asyncClient.renewMessageLock(message, maxLockRenewalDuration).subscribe( v -> logger.verbose("Completed renewing lock token: '{}'", lockToken), throwableConsumer, () -> logger.verbose("Auto message lock renewal operation completed: {}", lockToken)); }
Source:
public VisualEditorSaveChangesDialog clickReturnToSaveFormButton() { waitForElementClickableByElement(returnToSaveFormButton); returnToSaveFormButton.click(); PageObjectLogging .log("clickReturnToSaveFormButton", "Return To Save Form button clicked", true); return new VisualEditorSaveChangesDialog(driver); }

Target:
public VisualEditorSaveChangesDialog clickReturnToSaveFormButton() { waitForElementClickableByElement(returnToSaveFormButton); returnToSaveFormButton.click(); return new VisualEditorSaveChangesDialog(driver); }
Source:
private Node findExpandableInTree(Node node) { if (canExpand(node)) { return node; } ; List<Node> children = tree.getNodeStorage().getChildren(node); for (Node child : children) { Node descendant = findExpandableInTree(child); if (descendant != null) { return descendant; } } return null; }

Target:
private Node findExpandableInTree(Node node) { if (canExpand(node)) { return node; } List<Node> children = tree.getNodeStorage().getChildren(node); for (Node child : children) { Node descendant = findExpandableInTree(child); if (descendant != null) { return descendant; } } return null; }
Source:
public void setSecurityEnabled(final boolean enabled, boolean createAdminUser) { m_securityEnabled = enabled; if (createAdminUser) { addUsers(new UserInfo[] {new UserInfo("defaultadmin", "admin", new String[] {CatalogUtil.ADMIN.toUpperCase()})}); } }

Target:
public void setSecurityEnabled(final boolean enabled, boolean createAdminUser) { m_securityEnabled = enabled; if (createAdminUser) { addUsers(new UserInfo[] {new UserInfo("defaultadmin", "admin", new String[] {"ADMINISTRATOR"})}); } }
Source:
private void createSubs() throws IOException { Set<Key<?>> visitedKeys = Sets.newHashSet(); while(! foundSubs.isEmpty()) { Iterator<Subgraph> iterator = foundSubs.iterator(); Subgraph sub = iterator.next(); iterator.remove(); if (!visitedKeys.contains(sub.key)) { graphModule(sub.name , sub.injector, rootKeySetCreator.getRootKeys(sub.injector), 1); visitedKeys.add(sub.key); } } }

Target:
private void createSubs() throws IOException { Set<Key<?>> visitedKeys = Sets.newHashSet(); while (!foundSubgraphs.isEmpty()) { Iterator<Subgraph> iterator = foundSubgraphs.iterator(); Subgraph sub = iterator.next(); iterator.remove(); if (!visitedKeys.contains(sub.getKey())) { graphModule(sub.getName(), sub.getInjector(), rootKeySetCreator.getRootKeys( sub.getInjector())); visitedKeys.add(sub.getKey()); } } }
Source:
public static PreUploadHook newChain(List<? extends PreUploadHook> hooks) { PreUploadHook[] newHooks = new PreUploadHook[hooks.size()]; int i = 0; for (PreUploadHook hook : hooks) { if (hook != PreUploadHook.NULL) newHooks[i++] = hook; } if (i == 0) return PreUploadHook.NULL; else if (i == 1) return newHooks[0]; else return new PreUploadHookChain(newHooks); }

Target:
public static PreUploadHook newChain(List<? extends PreUploadHook> hooks) { PreUploadHook[] newHooks = new PreUploadHook[hooks.size()]; int i = 0; for (PreUploadHook hook : hooks) if (hook != PreUploadHook.NULL) newHooks[i++] = hook; if (i == 0) return PreUploadHook.NULL; else if (i == 1) return newHooks[0]; else return new PreUploadHookChain(newHooks, i); }
Source:
private void redirectFromFullSiteToOasis() { MercuryFooterComponentObject footer = new MercuryFooterComponentObject(driver); ArticleNavigationComponentObject navigation = new ArticleNavigationComponentObject(driver); SkinHelper helper = new SkinHelper(driver); new ArticlePageObject(driver).openWikiPage(url); footer.clickFullSiteLink(); navigation.clickRandomArticle(); Assertion.assertTrue(helper.isSkin(Skin.OASIS)); }

Target:
private void redirectFromFullSiteToOasis() { ArticleNavigationComponentObject navigation = new ArticleNavigationComponentObject(driver); SkinHelper helper = new SkinHelper(driver); new ArticlePageObject(driver).openWikiPage(url); new MercuryFooterComponentObject(driver).clickFullSiteLink(); navigation.clickRandomArticle(); Assertion.assertTrue(helper.isSkin(Skin.OASIS)); }
Source:
@Test public void listPackagesFromJarTest() throws IOException, JarToBundleConverterException { List<Object> actual = new ArrayList<>(); BundleGeneratorUtils.listPackages(TestConstants.SAMPLE_JAR_FILE).forEach(actual::add); List<Object> expected = new ArrayList<>(); expectedPackageList().forEach(expected::add); assert TestUtils.isMatching(expected, actual); }

Target:
public void listPackagesFromJarTest() throws IOException, JarToBundleConverterException { List<Object> actual = new ArrayList<>(); BundleGeneratorUtils.listPackages(TestConstants.SAMPLE_JAR_FILE).forEach(actual::add); List<Object> expected = new ArrayList<>(); expectedPackageList().forEach(expected::add); assert TestUtils.isMatching(expected, actual); }
Source:
public void receiveHeader(PacketLineIn pckIn) throws IOException { try { String version = versionPattern.matcher(pckIn.readStringRaw()) .group(1); if (version.equals("0.1")) { pusher = pusherPattern.matcher(pckIn.readStringRaw()).group(1); pushee = pusheePattern.matcher(pckIn.readStringRaw()).group(1); receivedNonce = noncePattern.matcher(pckIn.readStringRaw()) .group(1); } else { throw new IOException(MessageFormat.format( JGitText.get().errorInvalidPushCert, "version not supported")); } } catch (EOFException eof) { throw new IOException(MessageFormat.format( JGitText.get().errorInvalidPushCert, "broken push certificate Header")); } nonceStatus = checkNonce(); }

Target:
public void receiveHeader(PacketLineIn pckIn) throws IOException { try { String s = pckIn.readStringRaw(); if (!s.startsWith(VERSION)) throw new IOException(MessageFormat.format( JGitText.get().errorInvalidPushCert, "expected push certificate version")); String version = s.substring(VERSION.length()); if (!version.equals("0.1\n")) { throw new IOException(MessageFormat.format( JGitText.get().errorInvalidPushCert, "version not supported")); } pusher = parseNextLine(pckIn, PUSHER, "expected pusher"); pushee = parseNextLine(pckIn, PUSHEE, "expected pushee"); receivedNonce = parseNextLine(pckIn, NONCE, "expected nonce"); parseNextLine(pckIn, "\n", "expected new line"); } catch (EOFException eof) { throw new IOException(MessageFormat.format( JGitText.get().errorInvalidPushCert, "broken push certificate Header")); } nonceStatus = nonceGenerator.verify(receivedNonce, sentNonce, seed, db, nonceSlopLimit); }
Source:
public void ImageStorage_001_deleteImage() { WikiBasePageObject base = new WikiBasePageObject(driver); base.logInCookie(credentials.userNameStaff, credentials.passwordStaff, wikiURL); SpecialNewFilesPageObject newFiles = base.openSpecialNewFiles(wikiURL); Boolean noRedirect = true; FilePagePageObject file = newFiles.openImage(PageContent.FILE_DELETE_AND_RESTORE, noRedirect); imageURL = file.getImageUrl(); imageThumbnailURL = file.getImageThumbnailUrl(); newFiles.verifyURLStatus(200, imageURL); newFiles.verifyURLStatus(200, imageThumbnailURL); DeletePageObject delete = newFiles.deletePage(); base = delete.submitDeletion(); base.verifyNotificationMessage(); base.verifyURLStatus(404, imageURL); base.verifyURLStatus(404, imageThumbnailURL); SpecialRestorePageObject restore = delete.undeleteByFlashMessage(); restore.giveReason(PageContent.CAPTION); restore.restorePage(); restore.verifyNotificationMessage(); newFiles.verifyURLStatus(200, imageURL); newFiles.verifyURLStatus(200, imageThumbnailURL); }

Target:
public void ImageStorage_001_deleteImage() { WikiBasePageObject base = new WikiBasePageObject(driver); base.logInCookie(credentials.userNameStaff, credentials.passwordStaff, wikiURL); SpecialNewFilesPageObject newFiles = base.openSpecialNewFiles(wikiURL); FilePagePageObject file = newFiles.openImage(PageContent.FILE_DELETE_AND_RESTORE, true); imageURL = file.getImageUrl(); imageThumbnailURL = file.getImageThumbnailUrl(); newFiles.verifyURLStatus(200, imageURL); newFiles.verifyURLStatus(200, imageThumbnailURL); DeletePageObject delete = newFiles.deletePage(); base = delete.submitDeletion(); base.verifyNotificationMessage(); base.verifyURLStatus(404, imageURL); base.verifyURLStatus(404, imageThumbnailURL); SpecialRestorePageObject restore = delete.undeleteByFlashMessage(); restore.giveReason(PageContent.CAPTION); restore.restorePage(); restore.verifyNotificationMessage(); newFiles.verifyURLStatus(200, imageURL); newFiles.verifyURLStatus(200, imageThumbnailURL); }
Source:
public long getSize() { return size; }

Target:
public long getSize() { return this.size; }
Source:
protected ICommand getBeforeMoveCommand(final MoveRequest request) { ICommand gmfCommand = super.getBeforeMoveCommand(request); if (request.getTargetContainer().eIsProxy()) { return UnexecutableCommand.INSTANCE; } return gmfCommand; }

Target:
protected ICommand getBeforeMoveCommand(final MoveRequest request) { return request.getTargetContainer().eIsProxy() ? UnexecutableCommand.INSTANCE : null; }
Source:
private void requestNodeSourcesForBucket(String bucketName) { String nodeSourcesListUrl = new CatalogUrlBuilder().getCatalogUrl() + "/buckets/" + bucketName + "/resources?kind=nodesource"; RequestBuilder nodeSourcesRequest = new RequestBuilder(RequestBuilder.GET, nodeSourcesListUrl); nodeSourcesRequest.setHeader(SESSION_ID_PARAMETER_NAME, LoginModel.getInstance().getSessionId()); nodeSourcesRequest.setCallback(getNodeSourcesRequestCallback(bucketName)); try { nodeSourcesRequest.send(); } catch (RequestException e) { logErrorMessage(e); } }

Target:
private void requestNodeSourcesForBucket(String bucketName) { String nodeSourcesListUrl = this.catalogUrl + "/buckets/" + bucketName + "/resources?kind=nodesource"; sendRequestToCatalog(nodeSourcesListUrl, getNodeSourcesRequestCallback(bucketName)); }
Source:
public void test() throws Exception { WorkspaceModifyOperation operation = new TraceImportOperation(fSourcePath, fDestFolder); PlatformUI.getWorkbench().getProgressService().run(true, true, operation); WaitUtils.waitUntil(folder -> folder.getTraces().size() == 11, fDestFolder, () -> String.format("expected: 9 but was: %d", fDestFolder.getTraces().size())); validateImport(fSourcePath, fDestFolder, true); }

Target:
public void test() throws Exception { WorkspaceModifyOperation operation = new TraceImportOperation(fSourcePath, fDestFolder); PlatformUI.getWorkbench().getProgressService().run(true, true, operation); WaitUtils.waitUntil(folder -> folder.getTraces().size() == EXPECTED_TRACE_COUNT, fDestFolder, () -> String.format("expected: %d but was: %d", EXPECTED_TRACE_COUNT, fDestFolder.getTraces().size())); validateImport(fSourcePath, fDestFolder, true); }
Source:
@Test public void testSelectDistinctWikiNoTables() { final String sql = "select distinct \"countryName\"\n" + "from \"wikiticker\"\n" + "where \"page\" = 'Jeremy Corbyn'"; final String explain = "PLAN=" + "EnumerableInterpreter\n" + " DruidQuery(table=[[wiki, wikiticker]], " + "intervals=[[1900-01-01T00:00:00.000/3000-01-01T00:00:00.000]], " + "filter=[=($17, 'Jeremy Corbyn')], groups=[{7}], aggs=[[]])\n"; final String druidQuery = "{'queryType':'groupBy'," + "'dataSource':'wikiticker','granularity':'all'," + "'dimensions':[{\"type\":\"default\",\"dimension\":\"countryName\"}],'limitSpec':{'type':'default'}," + "'filter':{'type':'selector','dimension':'page','value':'Jeremy Corbyn'}," + "'aggregations':[{'type':'longSum','name':'dummy_agg','fieldName':'dummy_agg'}]," + "'intervals':['1900-01-01T00:00:00.000/3000-01-01T00:00:00.000']}"; sql(sql, WIKI_AUTO2) .returnsUnordered("countryName=United Kingdom", "countryName=null") .explainContains(explain) .queryContains(druidChecker(druidQuery)); sql("select count(*) as c from \"foodmart\"", WIKI_AUTO2) .returnsUnordered("C=86829"); }

Target:
@Test public void testSelectDistinctWikiNoTables() { final String sql = "select distinct \"countryName\"\n" + "from \"wikiticker\"\n" + "where \"page\" = 'Jeremy Corbyn'"; final String explain = "PLAN=" + "EnumerableInterpreter\n" + " DruidQuery(table=[[wiki, wikiticker]], " + "intervals=[[1900-01-01T00:00:00.000/3000-01-01T00:00:00.000]], " + "filter=[=($17, 'Jeremy Corbyn')], groups=[{7}], aggs=[[]])\n"; final String druidQuery = "{'queryType':'groupBy'," + "'dataSource':'wikiticker','granularity':'all'," + "'dimensions':[{'type':'default','dimension':'countryName'}],'limitSpec':{'type':'default'}," + "'filter':{'type':'selector','dimension':'page','value':'Jeremy Corbyn'}," + "'aggregations':[{'type':'longSum','name':'dummy_agg','fieldName':'dummy_agg'}]," + "'intervals':['1900-01-01T00:00:00.000/3000-01-01T00:00:00.000']}"; sql(sql, WIKI_AUTO2) .returnsUnordered("countryName=United Kingdom", "countryName=null") .explainContains(explain) .queryContains(druidChecker(druidQuery)); sql("select count(*) as c from \"foodmart\"", WIKI_AUTO2) .returnsUnordered("C=86829"); }
Source:
protected EntitySpec<?> getMemberSpec() { @SuppressWarnings("unchecked") EntitySpec<ElasticSearchNode> spec = (EntitySpec<ElasticSearchNode>)getConfig(MEMBER_SPEC, EntitySpec.create(ElasticSearchNode.class)); spec.configure(ElasticSearchNode.CLUSTER_NAME, getConfig(ElasticSearchClusterImpl.CLUSTER_NAME)) .configure(ElasticSearchNode.NODE_NAME, "elasticsearch-" + nextMemberId.incrementAndGet()); return spec; }

Target:
protected EntitySpec<?> getMemberSpec() { EntitySpec<?> spec = EntitySpec.create(getConfig(MEMBER_SPEC, EntitySpec.create(ElasticSearchNode.class))); spec.configure(ElasticSearchNode.CLUSTER_NAME, getConfig(ElasticSearchClusterImpl.CLUSTER_NAME)) .configure(ElasticSearchNode.NODE_NAME, "elasticsearch-" + nextMemberId.incrementAndGet()); return spec; }
Source:
public int compare(FSAppAttempt app1, FSAppAttempt app2) { return Resources.fitsIn(app1.getStarvation(), app2.getStarvation()) ? -1 : 1; }

Target:
public int compare(FSAppAttempt app1, FSAppAttempt app2) { int ret = 1; if (Resources.fitsIn(app1.getStarvation(), app2.getStarvation())) { ret = -1; } return ret; }
Source:
private boolean isHttpsWebsite(String siteUrl) throws IOException { URL url = new URL("https://" + siteUrl); HttpsURLConnection httpsCon = (HttpsURLConnection)url.openConnection(); int responseCode = 0; if (httpsCon == null) return (false); try { responseCode = httpsCon.getResponseCode(); } catch (SSLException e) { e.printStackTrace(); return (false); } httpsCon.disconnect(); if (responseCode == 200) return (true); return (false); }

Target:
private boolean isHttpsWebsite(String siteUrl) throws IOException { URL url = new URL("https://" + siteUrl); HttpsURLConnection httpsCon = (HttpsURLConnection)url.openConnection(); int responseCode = 0; if (httpsCon == null) return (false); try { responseCode = httpsCon.getResponseCode(); } catch (SSLException e) { Log.e("URLHelper", "SSLException", e.getCause()); return (false); } catch (UnknownHostException e1) { Log.e("URLHelper", "UnknownHostException", e1.getCause()); return (false); } httpsCon.disconnect(); if (responseCode == 200) return (true); return (false); }
Source:
public boolean handle(HttpServletRequest request, HttpServletResponse response, Account account) { System.out.println("----> PostRegisterHandler"); return true; }

Target:
public boolean handle(HttpServletRequest request, HttpServletResponse response, Account account) { log.debug("----> PostRegisterHandler"); return true; }
Source:
public void shouldReturnEmptyForEmptyCursor() { TransmissionMapper mapper = new TransmissionMapper(null); given(mockCursor.getCount()).willReturn(0); given(mockCursor.moveToFirst()).willReturn(false); doNothing().when(mockCursor).close(); List<Transmission> transmissions = mapper.transform(mockCursor); assertTrue(transmissions.isEmpty()); }

Target:
public void shouldReturnEmptyForEmptyCursor() { TransmissionMapper mapper = new TransmissionMapper(mockS3Mapper); given(mockCursor.getCount()).willReturn(0); given(mockCursor.moveToFirst()).willReturn(false); doNothing().when(mockCursor).close(); List<Transmission> transmissions = mapper.transform(mockCursor); assertTrue(transmissions.isEmpty()); }
Source:
private GenericArray copyColumnarArray(ColumnarArray from) { Object arr; boolean isPrimitiveArray = true; switch (eleType.getTypeRoot()) { case BOOLEAN: arr = from.toBooleanArray(); break; case TINYINT: arr = from.toByteArray(); break; case SMALLINT: arr = from.toShortArray(); break; case INTEGER: case DATE: case TIME_WITHOUT_TIME_ZONE: arr = from.toIntArray(); break; case BIGINT: arr = from.toLongArray(); break; case FLOAT: arr = from.toFloatArray(); break; case DOUBLE: arr = from.toDoubleArray(); break; default: Object[] newArray = new Object[from.numElements()]; for (int i = 0; i < newArray.length; i++) { if (!from.isNullAt(i)) { newArray[i] = eleSer.copy(TypeGetterSetters.get(from, i, eleType)); } else { newArray[i] = null; } } arr = newArray; isPrimitiveArray = false; } return new GenericArray(arr, from.numElements(), isPrimitiveArray); }

Target:
private GenericArray copyColumnarArray(ColumnarArray from) { Object arr = null; boolean isPrimitiveArray = true; if (!eleType.isNullable()) { switch (eleType.getTypeRoot()) { case BOOLEAN: arr = from.toBooleanArray(); break; case TINYINT: arr = from.toByteArray(); break; case SMALLINT: arr = from.toShortArray(); break; case INTEGER: case DATE: case TIME_WITHOUT_TIME_ZONE: arr = from.toIntArray(); break; case BIGINT: arr = from.toLongArray(); break; case FLOAT: arr = from.toFloatArray(); break; case DOUBLE: arr = from.toDoubleArray(); break; } } if (arr == null) { Object[] newArray = new Object[from.numElements()]; for (int i = 0; i < newArray.length; i++) { if (!from.isNullAt(i)) { newArray[i] = eleSer.copy(TypeGetterSetters.get(from, i, eleType)); } else { newArray[i] = null; } } arr = newArray; isPrimitiveArray = false; } return new GenericArray(arr, from.numElements(), isPrimitiveArray); }
Source:
private void testFileRead() throws Exception { Connection conn = getConnection("functions"); Statement stat = conn.createStatement(); String fileName = getBaseDir() + "/test.txt"; Properties prop = System.getProperties(); OutputStream out = FileUtils.newOutputStream(fileName, false); prop.store(out, ""); out.close(); ResultSet rs = stat.executeQuery("SELECT LENGTH(FILE_READ('" + fileName + "')) LEN"); rs.next(); assertEquals(FileUtils.size(fileName), rs.getInt(1)); rs = stat.executeQuery("SELECT FILE_READ('" + fileName + "') PROP"); rs.next(); Properties p2 = new Properties(); p2.load(rs.getBinaryStream(1)); assertEquals(prop.size(), p2.size()); rs = stat.executeQuery("SELECT FILE_READ('" + fileName + "', NULL) PROP"); rs.next(); String ps = rs.getString(1); InputStreamReader r = new InputStreamReader(FileUtils.newInputStream(fileName)); String ps2 = IOUtils.readStringAndClose(r, -1); assertEquals(ps, ps2); FileUtils.delete(fileName); fileName = "/" + this.getClass().getName().replaceAll("\\.", "/") + ".class"; rs = stat.executeQuery("SELECT LENGTH(FILE_READ('classpath:" + fileName + "')) LEN"); rs.next(); int fileSize = rs.getInt(1); assertTrue(fileSize > 0); rs = stat.executeQuery("SELECT LENGTH(FILE_READ('<LINK_0>')) LEN"); rs.next(); int webResourceSize = rs.getInt(1); assertTrue(webResourceSize > 0); conn.close(); conn.close(); }

Target:
private void testFileRead() throws Exception { Connection conn = getConnection("functions"); Statement stat = conn.createStatement(); String fileName = getBaseDir() + "/test.txt"; Properties prop = System.getProperties(); OutputStream out = FileUtils.newOutputStream(fileName, false); prop.store(out, ""); out.close(); ResultSet rs = stat.executeQuery("SELECT LENGTH(FILE_READ('" + fileName + "')) LEN"); rs.next(); assertEquals(FileUtils.size(fileName), rs.getInt(1)); rs = stat.executeQuery("SELECT FILE_READ('" + fileName + "') PROP"); rs.next(); Properties p2 = new Properties(); p2.load(rs.getBinaryStream(1)); assertEquals(prop.size(), p2.size()); rs = stat.executeQuery("SELECT FILE_READ('" + fileName + "', NULL) PROP"); rs.next(); String ps = rs.getString(1); InputStreamReader r = new InputStreamReader(FileUtils.newInputStream(fileName)); String ps2 = IOUtils.readStringAndClose(r, -1); assertEquals(ps, ps2); FileUtils.delete(fileName); fileName = "/" + this.getClass().getName().replaceAll("\\.", "/") + ".class"; rs = stat.executeQuery("SELECT LENGTH(FILE_READ('classpath:" + fileName + "')) LEN"); rs.next(); int fileSize = rs.getInt(1); assertTrue(fileSize > 0); rs = stat.executeQuery("SELECT LENGTH(FILE_READ('<LINK_0>')) LEN"); rs.next(); int webResourceSize = rs.getInt(1); assertTrue(webResourceSize > 0); conn.close(); }
Source:
public Result visit(TableFunctionScan e) { final List<SqlNode> inputSqlNodes = new ArrayList<>(); for (int i = 0; i < e.getInputs().size(); i++) { Result child = visitChild(i, e.getInput(i)); inputSqlNodes.add(child.asStatement()); } final Context context = tableFunctionScanContext(inputSqlNodes); SqlNode callNode = context.toSql(null, e.getCall()); SqlNode tableCall = new SqlBasicCall( SqlStdOperatorTable.COLLECTION_TABLE, new SqlNode[]{callNode}, SqlParserPos.ZERO); SqlNode select = new SqlSelect( SqlParserPos.ZERO, null, null, tableCall, null, null, null, null, null, null, null); Result x = new Result(select, ImmutableList.of(Clause.SELECT), null, e.getRowType(), null); return x; }

Target:
public Result visit(TableFunctionScan e) { final List<SqlNode> inputSqlNodes = new ArrayList<>(); final int inputSize = e.getInputs().size(); for (int i = 0; i < inputSize; i++) { Result child = visitChild(i, e.getInput(i)); inputSqlNodes.add(child.asStatement()); } final Context context = tableFunctionScanContext(inputSqlNodes); SqlNode callNode = context.toSql(null, e.getCall()); SqlNode tableCall = new SqlBasicCall( SqlStdOperatorTable.COLLECTION_TABLE, new SqlNode[]{callNode}, SqlParserPos.ZERO); SqlNode select = new SqlSelect( SqlParserPos.ZERO, null, null, tableCall, null, null, null, null, null, null, null, SqlNodeList.EMPTY); Result x = new Result(select, ImmutableList.of(Clause.SELECT), null, e.getRowType(), null); return x; }
Source:
protected static IProject getProject(TemplateContext context) { IProject project = Platform.getAdapterManager().getAdapter(context, IProject.class); if (project != null) { return project; } if (NO_ADAPTABLE_SUPPORT && Activator.hasJavaPlugin()) { boolean hasPublicMethod = context.getClass().getSimpleName() .equals("CodeTemplateContext"); Method method; try { if (hasPublicMethod) { method = context.getClass().getMethod("getJavaProject"); } else { method = context.getClass().getSuperclass() .getDeclaredMethod("getJavaProject"); method.setAccessible(true); } Object result = method.invoke(context); if (result instanceof IJavaProject) { IJavaProject javaProject = (IJavaProject) result; return javaProject.getProject(); } } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { return null; } } return null; }

Target:
protected static IProject getProject(TemplateContext context) { IProject project = Platform.getAdapterManager().getAdapter(context, IProject.class); if (project != null) { return project; } if (NO_ADAPTABLE_SUPPORT && Activator.hasJavaPlugin()) { boolean hasPublicMethod = context.getClass().getSimpleName() .equals("CodeTemplateContext"); try { Method method; if (hasPublicMethod) { method = context.getClass().getMethod("getJavaProject"); } else { method = context.getClass().getSuperclass() .getDeclaredMethod("getJavaProject"); method.setAccessible(true); } Object result = method.invoke(context); if (result instanceof IJavaProject) { IJavaProject javaProject = (IJavaProject) result; return javaProject.getProject(); } } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { return null; } } return null; }
Source:
protected void doStoreUsers() { try { usersFileManager.store(new UsersDto(new HashSet<>(userMap.values()))); } catch (IOException e) { throw new UndeclaredThrowableException(e); } }

Target:
private void doStoreUsers() { try { usersFileManager.store(new UsersDto(new HashSet<>(userMap.values()))); } catch (IOException e) { throw new UndeclaredThrowableException(e); } }
Source:
private String cleanDisplayedErrorMessage(String errorMessage) { String regex = "^[^:]*:(.*)"; Pattern pattern = Pattern.compile(regex); Matcher matcher = pattern.matcher(errorMessage); if (errorMessage.matches(regex) && matcher.find()) { if (errorMessage.matches(regex)) { errorMessage = matcher.group(1); } } return (errorMessage); }

Target:
private String cleanDisplayedErrorMessage(String errorMessage) { Matcher matcher = PATTERN.matcher(errorMessage); if (matcher.find()) { errorMessage = matcher.group(1); } return (errorMessage); }
Source:
private String getRandomFakeSecretQuestion() { Random randomGenerator = new Random(); List<String> questions = new ArrayList<String>(); questions.add("What is your best friend's last name?"); questions.add("What is your grandfather's home town?"); questions.add("What is your mother's maiden name?"); questions.add("What is your favorite band?"); questions.add("What is your first pet's name?"); questions.add("What is your brother's middle name?"); questions.add("What city were you born?"); int randIndex = randomGenerator.nextInt(questions.size()); return questions.get(randIndex); }

Target:
private String getRandomFakeSecretQuestion() { Random randomGenerator = new Random(); List<String> questions = new ArrayList<String>(); questions.add("What is your best friend's last name?"); questions.add("What is your grandfather's home town?"); questions.add("What is your mother's maiden name?"); questions.add("What is your favorite band?"); questions.add("What is your first pet's name?"); questions.add("What is your brother's middle name?"); questions.add("What city were you born in?"); return questions.get(map.get(username)); }
Source:
public void run() { if (!TestController.isTestMode()) { pool.execute(() -> runUpdate()); } }

Target:
public void run() { pool.execute(() -> runUpdate()); }
Source:
public void testUpdateDataset() { DataSet preexistingDataset = new DataSet(); when(datasetService.getDatasetByName("test")).thenReturn(preexistingDataset); when(datasetService.updateDataset(any(), any(), any())).thenReturn(preexistingDataset); when(authUser.getGoogleUser()).thenReturn(googleUser); when(googleUser.getEmail()).thenReturn("email@email.com"); when(userService.findUserByEmail(any())).thenReturn(dacUser); when(dacUser.getDacUserId()).thenReturn(1); when(uriInfo.getRequestUriBuilder()).thenReturn(uriBuilder); when(uriBuilder.replacePath(anyString())).thenReturn(uriBuilder); initResource(); Response response = resource.updateDataset(authUser, uriInfo, "{\"properties\":[{\"propertyName\":\"Dataset Name\",\"propertyValue\":\"test\"}]}", 1); assertEquals(200, response.getStatus()); }

Target:
public void testUpdateDataset() { DataSet preexistingDataset = new DataSet(); DataSetDTO json = new DataSetDTO(); List<DataSetPropertyDTO> jsonProperties = new ArrayList<>(); jsonProperties.add(new DataSetPropertyDTO("Dataset Name", "test")); json.setProperties(jsonProperties); when(datasetService.findDatasetById(anyInt())).thenReturn(preexistingDataset); when(datasetService.updateDataset(any(), any(), any())).thenReturn(Optional.of(preexistingDataset)); when(authUser.getGoogleUser()).thenReturn(googleUser); when(googleUser.getEmail()).thenReturn("email@email.com"); when(userService.findUserByEmail(any())).thenReturn(dacUser); when(dacUser.getDacUserId()).thenReturn(1); when(uriInfo.getRequestUriBuilder()).thenReturn(uriBuilder); when(uriBuilder.replacePath(anyString())).thenReturn(uriBuilder); initResource(); Response response = resource.updateDataset(authUser, uriInfo, 1, new Gson().toJson(json)); assertEquals(200, response.getStatus()); }
Source:
public BindingSet next() { final MapBindingSet bs = new MapBindingSet(); for(final Binding binding : newResult) { bs.addBinding(binding); } final BindingSet joinResult = joinedResults.next(); for(final Binding binding : joinResult) { bs.addBinding(binding); } String visibility = ""; if(newResult instanceof VisibilityBindingSet && joinResult instanceof VisibilityBindingSet) { final Joiner join = Joiner.on(")&("); final String leftVisi = ((VisibilityBindingSet)newResult).getVisibility(); final String rightVisi = ((VisibilityBindingSet)joinResult).getVisibility(); if(leftVisi.isEmpty() || rightVisi.isEmpty()) { visibility = (leftVisi + rightVisi).trim(); } else { visibility = "(" + join.join(leftVisi, rightVisi) + ")"; } return new VisibilityBindingSet(bs, visibility); } else if(newResult instanceof VisibilityBindingSet) { visibility = ((VisibilityBindingSet) newResult).getVisibility(); return new VisibilityBindingSet(bs, visibility); } else if(joinResult instanceof VisibilityBindingSet) { visibility = ((VisibilityBindingSet) joinResult).getVisibility(); return new VisibilityBindingSet(bs, visibility); } else { return new VisibilityBindingSet(bs); } }

Target:
public VisibilityBindingSet next() { final MapBindingSet bs = new MapBindingSet(); for(final Binding binding : newResult) { bs.addBinding(binding); } final VisibilityBindingSet joinResult = joinedResults.next(); for(final Binding binding : joinResult) { bs.addBinding(binding); } String visibility = ""; final Joiner join = Joiner.on(")&("); final String leftVisi = newResult.getVisibility(); final String rightVisi = joinResult.getVisibility(); if(leftVisi.isEmpty() || rightVisi.isEmpty()) { visibility = (leftVisi + rightVisi).trim(); } else { visibility = "(" + join.join(leftVisi, rightVisi) + ")"; } return new VisibilityBindingSet(bs, visibility); }
Source:
public Command buildDeleteTreeElement(final DTreeElement element) { Command cmd = UnexecutableCommand.INSTANCE; if (element instanceof DTreeItem) { if (!getPermissionAuthority().canEditInstance(element)) { cmd = new InvalidPermissionCommand(domain, element); } else { if (!getPermissionAuthority().canEditInstance(element.eContainer())) { cmd = new InvalidPermissionCommand(domain, element.eContainer()); } else { final SiriusCommand result = new SiriusCommand(domain); TreeItemDeletionTool deleteTool = getDeleteTool(element); if (deleteTool != null) { addDeleteTreeElementFromTool(result, element, deleteTool); addRefreshTask(TreeHelper.getTree(element), result, deleteTool); cmd = new NoNullResourceCommand(result, element); } else { final Set<EObject> allSemanticElements = new HashSet<EObject>(); addSemanticElementsToDestroy(element, allSemanticElements); EObjectQuery eObjectQuery = new EObjectQuery(element); DRepresentation dRepresentation = eObjectQuery.getRepresentation().get(); final Set<DSemanticDecorator> tableElements = commandTaskHelper.getDElementToClearFromSemanticElements(dRepresentation, allSemanticElements); for (final DSemanticDecorator decorator : tableElements) { result.getTasks().add(new DeleteTreeElementTask(decorator, modelAccessor)); } final Iterator<EObject> it = allSemanticElements.iterator(); while (it.hasNext()) { final EObject eObj = it.next(); result.getTasks().add(new DeleteTreeElementTask(eObj, modelAccessor)); } addRefreshTask(TreeHelper.getTree(element), result, deleteTool); cmd = new NoNullResourceCommand(result, element); } } } } return cmd; }

Target:
public Command buildDeleteTreeElement(final DTreeElement element) { Command cmd = UnexecutableCommand.INSTANCE; if (element instanceof DTreeItem) { if (!getPermissionAuthority().canEditInstance(element)) { cmd = new InvalidPermissionCommand(domain, element); } else { if (!getPermissionAuthority().canEditInstance(element.eContainer())) { cmd = new InvalidPermissionCommand(domain, element.eContainer()); } else { final SiriusCommand result = new SiriusCommand(domain); TreeItemDeletionTool deleteTool = getDeleteTool(element); DTree parentTree = TreeHelper.getTree(element); if (deleteTool != null) { addDeleteTreeElementFromTool(result, element, deleteTool); addRefreshTask(parentTree, result, deleteTool); cmd = new NoNullResourceCommand(result, element); } else { final Set<EObject> allSemanticElements = new HashSet<EObject>(); addSemanticElementsToDestroy(element, allSemanticElements); if (parentTree != null) { final Set<DSemanticDecorator> tableElements = commandTaskHelper.getDElementToClearFromSemanticElements(parentTree, allSemanticElements); for (final DSemanticDecorator decorator : tableElements) { result.getTasks().add(new DeleteTreeElementTask(decorator, modelAccessor)); } } final Iterator<EObject> it = allSemanticElements.iterator(); while (it.hasNext()) { final EObject eObj = it.next(); result.getTasks().add(new DeleteTreeElementTask(eObj, modelAccessor)); } addRefreshTask(parentTree, result, deleteTool); cmd = new NoNullResourceCommand(result, element); } } } } return cmd; }
Source:
private void initRevisionActions(ChangeInfo info, RevisionInfo revInfo, boolean hasUser) { NativeMap<ActionInfo> actions = revInfo.has_actions() ? revInfo.actions() : NativeMap.<ActionInfo> create(); actions.copyKeysIntoChildren("id"); canSubmit = false; if (hasUser) { canSubmit = actions.containsKey("submit"); if (canSubmit) { submit.setTitle(actions.get("submit").title()); } a2b(actions, "cherrypick", cherrypick); a2b(actions, "/", deleteDraftPatchSet); a2b(actions, "publish", publish); a2b(actions, "rebase", rebase); for (String id : filterNonCore(actions)) { add(new ActionButton(info, revInfo, actions.get(id))); } } }

Target:
private void initRevisionActions(ChangeInfo info, RevisionInfo revInfo, boolean hasUser) { NativeMap<ActionInfo> actions = revInfo.has_actions() ? revInfo.actions() : NativeMap.<ActionInfo> create(); actions.copyKeysIntoChildren("id"); canSubmit = false; if (hasUser) { canSubmit = actions.containsKey("submit"); if (canSubmit) { submit.setTitle(actions.get("submit").title()); } a2b(actions, "/", deleteRevision); a2b(actions, "cherrypick", cherrypick); a2b(actions, "publish", publish); a2b(actions, "rebase", rebase); for (String id : filterNonCore(actions)) { add(new ActionButton(info, revInfo, actions.get(id))); } } }
Source:
public static String getHexColorCode(String metricId, String sessionId) { String monitoringName = null; MonitoringId monitoringId = splitMonitoringMetricId(metricId); if (monitoringId != null) monitoringName = monitoringId.getMonitoringName(); String colorId = monitoringName + sessionId; if (!sessions.contains(colorId)) sessions.add(colorId); return colorsHexCodes.get(sessions.indexOf(colorId) % colorsHexCodes.size()); }

Target:
public static String getHexColorCode(String metricId, String sessionId) { String colorId; MonitoringId monitoringId = splitMonitoringMetricId(metricId); if (monitoringId != null) { colorId = monitoringId.getMonitoringName() + sessionId; } else { colorId = metricId + sessionId; } int index = Math.abs(counter.getAndIncrement() % colorsHexCodes.size()); Integer result = sessionsMap.putIfAbsent(colorId, index); if (result == null) { return colorsHexCodes.get(index); } else { return colorsHexCodes.get(result); } }
Source:
public synchronized static PlatformAddress on(int value, long size) { if(value == 0) { return PlatformAddress.NULL; } int idx = value >> 5; int probe = 0; do { PlatformAddress cachedObj = cache[(idx + probe) & (CACHESIZE - 1)]; if (cachedObj == null) { return cache[(idx + probe) & (CACHESIZE - 1)] = new PlatformAddress(value, size); } if (cachedObj.osaddr == value && cachedObj.size == size) { return cachedObj; } } while (probe++ < MAXPROBES); replIdx %= MAXPROBES + 1; return cache[(idx + replIdx++) & (CACHESIZE - 1)] = new PlatformAddress(value, size); }

Target:
public synchronized static PlatformAddress on(int value, long size) { if (value == 0) { return PlatformAddress.NULL; } int idx = value >> 5; for (int probe = 0; probe < MAX_PROBES; probe++) { PlatformAddress cachedObj = cache[(idx + probe) & CACHE_MASK]; if (cachedObj == null) { return cache[(idx + probe) & CACHE_MASK] = new PlatformAddress(value, size); } if (cachedObj.osaddr == value && cachedObj.size == size) { return cachedObj; } } replacementIndex = (replacementIndex + 1) % MAX_PROBES; return cache[(idx + replacementIndex) & CACHE_MASK] = new PlatformAddress(value, size); }
Source:
public String toString() { StringBuilder virtioSerialBuilder = new StringBuilder(); virtioSerialBuilder.append("<channel type='" + type.toString() + "'>\n"); if (path == null) { virtioSerialBuilder.append("<source mode='bind'/>\n"); } else { virtioSerialBuilder.append("<source mode='bind' path='" + path + "'/>\n"); } virtioSerialBuilder.append("<address type='virtio-serial'/>\n"); if (state == null) { virtioSerialBuilder.append("<target type='virtio' name='" + name + "'/>\n"); } else { virtioSerialBuilder.append("<target type='virtio' name='" + name + "' state='" + state.toString() + "'/>\n"); } virtioSerialBuilder.append("</channel>\n"); return virtioSerialBuilder.toString(); }

Target:
public String toString() { return this.type; }
Source:
public static boolean isSame(FeatureStructure a, FeatureStructure b) { return !(a == null || b == null) && a.getCAS() == b.getCAS() && getAddr(a) == getAddr(b); }

Target:
public static boolean isSame(FeatureStructure a, FeatureStructure b) { if (a == null || b == null) { return false; } if (a.getCAS() != b.getCAS()) { return false; } return getAddr(a) == getAddr(b); }
Source:
protected String getConfigRoot() { return ClientConfigSections.HAZELCAST_CLIENT.name.toLowerCase(); }

Target:
protected String getConfigRoot() { return ClientConfigSections.HAZELCAST_CLIENT.name; }
Source:
public void initialize(final ServerCoreComponents coreComponents) throws ModuleInitializationException { Assert.requireNonNull(coreComponents, "coreComponents"); final ServletContext servletContext = coreComponents.getServletContext(); Assert.requireNonNull(servletContext, "servletContext"); HttpSessionMutexHolder mutexHolder = new HttpSessionMutexHolder(); servletContext.addListener(mutexHolder); }

Target:
public void initialize(final ServerCoreComponents coreComponents) throws ModuleInitializationException { Assert.requireNonNull(coreComponents, "coreComponents"); final ServletContext servletContext = coreComponents.getServletContext(); Assert.requireNonNull(servletContext, "servletContext"); final HttpSessionMutexHolder mutexHolder = new HttpSessionMutexHolder(); servletContext.addListener(mutexHolder); }
Source:
protected DepthwiseConvolution2D(Builder builder) { super(builder); this.hasBias = builder.hasBias; this.depthMultiplier = builder.depthMultiplier; this.convolutionMode = builder.convolutionMode; this.dilation = builder.dilation; if (builder.kernelSize.length != 2) throw new IllegalArgumentException("Kernel size of should be rows x columns (a 2d array)"); this.kernelSize = builder.kernelSize; if (builder.stride.length != 2) throw new IllegalArgumentException("Stride should include stride for rows and columns (a 2d array)"); this.stride = builder.stride; if (builder.padding.length != 2) throw new IllegalArgumentException("Padding should include padding for rows and columns (a 2d array)"); this.padding = builder.padding; this.cudnnAlgoMode = builder.cudnnAlgoMode; this.cudnnFwdAlgo = builder.cudnnFwdAlgo; this.cudnnBwdFilterAlgo = builder.cudnnBwdFilterAlgo; this.cudnnBwdDataAlgo = builder.cudnnBwdDataAlgo; this.nOut = this.nIn * this.depthMultiplier; initializeConstraints(builder); }

Target:
protected DepthwiseConvolution2D(Builder builder) { super(builder); this.depthMultiplier = builder.depthMultiplier; this.nOut = this.nIn * this.depthMultiplier; initializeConstraints(builder); }
Source:
public void addMember(SubfieldPath.PathElement member, Filter filter) { filters.put(member, filter); if (filter instanceof StructFilter) { StructFilter childFilter = (StructFilter) filter; childFilter.ordinal = filters.size(); } }

Target:
public void addMember(SubfieldPath.PathElement member, Filter filter) { verify(filters.get(member) == null, "Adding duplicate member filter" + member.toString()); filters.put(member, filter); if (filter instanceof StructFilter) { StructFilter childFilter = (StructFilter) filter; childFilter.ordinal = filters.size(); } }
Source:
public ParameterMetadataImpl buildParameterMetadata(String nativeQuery) { ParamLocationRecognizer recognizer = new ParamLocationRecognizer( 0 ); parseQueryParameters( nativeQuery, recognizer ); final Map<Integer, OrdinalParameterDescriptor> ordinalDescriptors = recognizer.getOrdinalParameterDescriptionMap(); final Map<String, NamedParameterDescriptor> namedDescriptors = recognizer.getNamedParameterDescriptionMap(); return new ParameterMetadataImpl( ordinalDescriptors, namedDescriptors ); }

Target:
public ParameterMetadataImpl buildParameterMetadata(String nativeQuery) { ParamLocationRecognizer recognizer = new ParamLocationRecognizer( 0 ); parseQueryParameters( nativeQuery, recognizer ); recognizer.complete(); final Map<Integer, OrdinalParameterDescriptor> ordinalDescriptors = recognizer.getOrdinalParameterDescriptionMap(); final Map<String, NamedParameterDescriptor> namedDescriptors = recognizer.getNamedParameterDescriptionMap(); return new ParameterMetadataImpl( ordinalDescriptors, namedDescriptors ); }