auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
static ClientConfigFactory findDefaultConfigFactory() { return StreamSupport.stream(ServiceLoader.load(ClientConfigFactory.class).spliterator(), false) .sorted(Comparator .comparingInt(ClientConfigFactory::getPriority) .thenComparing(Comparator.comparing(f -> f.getClass().getCanonicalName()))) .findFirst() .orElseGet(() -> { throw new IllegalStateException("Expecting on implementation of ClientConfigFactory discoverable via the ServiceLoader"); }); }

Target:
static ClientConfigFactory findDefaultConfigFactory() { return StreamSupport.stream(ServiceLoader.load(ClientConfigFactory.class).spliterator(), false) .sorted(Comparator .comparingInt(ClientConfigFactory::getPriority) .thenComparing(Comparator.comparing(f -> f.getClass().getCanonicalName()))) .findFirst() .orElseGet(() -> { throw new IllegalStateException("Expecting at least one implementation of ClientConfigFactory discoverable via the ServiceLoader"); }); }
Source:
public Response listContainers(@Context HttpHeaders headers, @QueryParam("groupId") String groupId, @QueryParam("artifactId") String artifactId, @QueryParam("version") String version, @QueryParam("status") String status) { ReleaseIdFilter releaseIdFilter = new ReleaseIdFilter.Builder() .groupId(groupId) .artifactId(artifactId) .version(version) .build(); KieContainerStatusFilter statusFilter; if (status == null) { statusFilter = KieContainerStatusFilter.ACCEPT_ALL; } else { statusFilter = KieContainerStatusFilter.parseFromString(status); } KieContainerResourceFilter containerFilter = new KieContainerResourceFilter(releaseIdFilter, statusFilter); return createCorrectVariant(server.listContainers(containerFilter), headers); }

Target:
public Response listContainers(@Context HttpHeaders headers, @QueryParam("groupId") String groupId, @QueryParam("artifactId") String artifactId, @QueryParam("version") String version, @QueryParam("status") String status) { ReleaseIdFilter releaseIdFilter = new ReleaseIdFilter.Builder() .groupId(groupId) .artifactId(artifactId) .version(version) .build(); KieContainerStatusFilter statusFilter = KieContainerStatusFilter.parseFromNullableString(status); KieContainerResourceFilter containerFilter = new KieContainerResourceFilter(releaseIdFilter, statusFilter); return createCorrectVariant(server.listContainers(containerFilter), headers); }
Source:
private void doGetAttachmentForDisplay(ResourceRequest request, ResourceResponse response) throws IOException, PortletException { final String attachmentId = request.getParameter(PortalConstants.ATTACHMENT_ID); final User user = UserCacheHolder.getUserFromRequest(request); final TSerializer serializer = new TSerializer(new TSimpleJSONProtocol.Factory()); Attachment attachment = attachmentPortletUtils.getAttachmentForDisplay(user, attachmentId); if(attachment==null) { response.setProperty(ResourceResponse.HTTP_STATUS_CODE, "500"); } else { try { writeJSON(request, response, serializer.toString(attachment)); } catch (TException exception) { LOGGER.error("Cannot serialize attachment", exception); response.setProperty(ResourceResponse.HTTP_STATUS_CODE, "500"); } } }

Target:
private void doGetAttachmentForDisplay(ResourceRequest request, ResourceResponse response) throws IOException, PortletException { final String attachmentId = request.getParameter(PortalConstants.ATTACHMENT_ID); final User user = UserCacheHolder.getUserFromRequest(request); Attachment attachment = attachmentPortletUtils.getAttachmentForDisplay(user, attachmentId); if (attachment == null) { response.setProperty(ResourceResponse.HTTP_STATUS_CODE, "500"); } else { writeJSON(request, response, OBJECT_MAPPER.writeValueAsString(attachment)); } }
Source:
private String retrieveSubjectTokenFromCredentialFile() throws IOException { IdentityPoolCredentialSource identityPoolCredentialSource = (IdentityPoolCredentialSource) credentialSource; String credentialFilePath = identityPoolCredentialSource.credentialLocation; if (!Files.exists(Paths.get(credentialFilePath), LinkOption.NOFOLLOW_LINKS)) { throw new IOException("Invalid credential location. The file does not exist."); } try { return new String(Files.readAllBytes(Paths.get(credentialFilePath))); } catch (IOException e) { throw new IOException( "Error when attempting to read the subject token from the credential file.", e); } }

Target:
private String retrieveSubjectTokenFromCredentialFile() throws IOException { IdentityPoolCredentialSource identityPoolCredentialSource = (IdentityPoolCredentialSource) credentialSource; String credentialFilePath = identityPoolCredentialSource.credentialLocation; if (!Files.exists(Paths.get(credentialFilePath), LinkOption.NOFOLLOW_LINKS)) { throw new IOException( String.format( "Invalid credential location. The file at %s does not exist.", credentialFilePath)); } try { return new String(Files.readAllBytes(Paths.get(credentialFilePath))); } catch (IOException e) { throw new IOException( "Error when attempting to read the subject token from the credential file.", e); } }
Source:
protected long getContentLength(HttpServletRequest request) { if(useServlet31){ return request.getContentLengthLong(); } String contentLengthHeader = request.getHeader(HttpHeaders.CONTENT_LENGTH); if (contentLengthHeader != null) { return Long.parseLong(contentLengthHeader); } return request.getContentLength(); }

Target:
protected long getContentLength(HttpServletRequest request) { if(useServlet31){ return request.getContentLengthLong(); } String contentLengthHeader = request.getHeader(HttpHeaders.CONTENT_LENGTH); if (contentLengthHeader != null) { try { return Long.parseLong(contentLengthHeader); } catch (NumberFormatException e){} } return request.getContentLength(); }
Source:
private synchronized Collection<Lease> getExpiredCandidateLeases() { final long now = Time.monotonicNow(); return leases.values().stream() .filter(lease -> lease.expiredHardLimit(now)) .collect(Collectors.toCollection(HashSet::new)); }

Target:
private synchronized Collection<Lease> getExpiredCandidateLeases() { final long now = Time.monotonicNow(); Collection<Lease> expired = new HashSet<>(); for (Lease lease : leases.values()) { if (lease.expiredHardLimit(now)) { expired.add(lease); } } return expired; }
Source:
public BookKeeper.DigestType getDigestType() { if (digestType.equals(LedgerMetadataFormat.DigestType.HMAC)) { return BookKeeper.DigestType.MAC; } else { return BookKeeper.DigestType.CRC32; } }

Target:
BookKeeper.DigestType getDigestType() { if (digestType.equals(LedgerMetadataFormat.DigestType.HMAC)) { return BookKeeper.DigestType.MAC; } else { return BookKeeper.DigestType.CRC32; } }
Source:
public <T> Set<T> getStores(Class<T> storeClass) { long stamp = acquireReadLock(); try { return stores.keySet().stream() .map(this::unwrapStore) .map(this::unwrapOldSPI) .filter(store -> storeClass.isInstance(store)) .map(store -> (T) store) .collect(Collectors.toCollection(HashSet::new)); } finally { releaseReadLock(stamp); } }

Target:
public <T> Set<T> getStores(Class<T> storeClass) { long stamp = acquireReadLock(); try { return stores.stream() .map(StoreStatus::store) .map(this::unwrapStore) .map(this::unwrapOldSPI) .filter(storeClass::isInstance) .map(storeClass::cast) .collect(Collectors.toCollection(HashSet::new)); } finally { releaseReadLock(stamp); } }
Source:
public static String formatPhoneNumber(String phoneValue) { if (phoneValue == null || "".equals(phoneValue)) { phoneValue = ""; } if(phoneValue.isEmpty() || phoneValue.matches(FORMATTED_PHONENUMBER_MASK)){ return phoneValue; } String formattedNumber="("+phoneValue.substring(0,3)+") "+phoneValue.substring(3,6)+"-"+phoneValue.substring(6,phoneValue.length()); return formattedNumber; }

Target:
public static String formatPhoneNumber(String phoneValue) { if (phoneValue == null) { phoneValue = ""; } if(phoneValue.isEmpty() || phoneValue.matches(FORMATTED_PHONENUMBER_MASK)){ return phoneValue; } String formattedNumber; if(phoneValue.length()==11) formattedNumber="("+phoneValue.substring(0,3)+") "+phoneValue.substring(3,7)+"-"+phoneValue.substring(6,phoneValue.length()); else formattedNumber="("+phoneValue.substring(0,3)+") "+phoneValue.substring(3,6)+"-"+phoneValue.substring(6,phoneValue.length()); return formattedNumber; }
Source:
public boolean execute() { if (navList != view) { return false; } boolean attachedNow = panel.isAttached(); if (!attached && attachedNow) { attached = true; } else if (attached && !attachedNow) { return false; } start = System.currentTimeMillis(); if (computeConnected()) { return true; } int select = 0; while (row < changes.length()) { ChangeAndCommit info = changes.get(row); String commit = info.commit().commit(); rows.add(new RowSafeHtml( info, connected != null && !connected.contains(commit))); if (revision.equals(commit)) { select = row; } if (longRunning(++row)) { return true; } } navList.rows = rows; navList.movePointerTo(select); return false; }

Target:
public boolean execute() { if (navList != view || !panel.isAttached()) { return false; } start = System.currentTimeMillis(); if (connected != null && computeConnected()) { return true; } int select = 0; while (row < changes.length()) { ChangeAndCommit info = changes.get(row); String commit = info.commit().commit(); rows.add(new RowSafeHtml( info, connected != null && !connected.contains(commit))); if (revision.equals(commit)) { select = row; } if (longRunning(++row)) { return true; } } navList.rows = rows; navList.movePointerTo(select, true); return false; }
Source:
public void updated(Dictionary<String, ?> config) throws ConfigurationException { logger.trace("Binding configuration updated"); if (config == null) return; this.refreshInterval = getLongValue(config, "refresh", 10000); this.userCode = (String) config.get("user_code"); int timeout = getIntValue(config, "timeout", 5000); String host = (String) config.get("host"); if (StringUtils.isNotBlank(host)) { this.satelModule = new Ethm1Module(host, getIntValue(config, "port", 7094), timeout, (String) config.get("encryption_key")); } else { this.satelModule = new IntRSModule((String) config.get("port"), timeout); } this.satelModule.addEventListener(this); this.satelModule.open(); setProperlyConfigured(true); logger.trace("Binding properly configured"); }

Target:
public void updated(Dictionary<String, ?> config) throws ConfigurationException { logger.trace("Binding configuration updated"); if (config == null) { return; } this.refreshInterval = getLongValue(config, "refresh", 10000); this.userCode = getStringValue(config, "user_code", null); int timeout = getIntValue(config, "timeout", 5000); String host = getStringValue(config, "host", null); if (StringUtils.isNotBlank(host)) { this.satelModule = new Ethm1Module(host, getIntValue(config, "port", 7094), timeout, (String) config.get("encryption_key")); } else { this.satelModule = new IntRSModule((String) config.get("port"), timeout); } this.satelModule.addEventListener(this); this.satelModule.open(); setProperlyConfigured(true); logger.trace("Binding properly configured"); }
Source:
private static boolean sendTweet(final String tweetTxt, final File fileToAttach) { final String abbreviatedTweetTxt = StringUtils.abbreviate(tweetTxt, CHARACTER_LIMIT); try { final StatusUpdate status = new StatusUpdate(abbreviatedTweetTxt); if (fileToAttach != null && fileToAttach.isFile()) { status.setMedia(fileToAttach); } final Status updatedStatus = client.updateStatus(status); logger.debug("Successfully sent Tweet '{}'", updatedStatus.getText()); return true; } catch (TwitterException e) { logger.error("Failed to send Tweet '" + abbreviatedTweetTxt + "' because of: " + e.getLocalizedMessage()); return false; } }

Target:
private static boolean sendTweet(final String tweetTxt, final File fileToAttach) { String abbreviatedTweetTxt = StringUtils.abbreviate(tweetTxt, CHARACTER_LIMIT); try { StatusUpdate status = new StatusUpdate(abbreviatedTweetTxt); if (fileToAttach != null && fileToAttach.isFile()) { status.setMedia(fileToAttach); } Status updatedStatus = client.updateStatus(status); logger.debug("Successfully sent Tweet '{}'", updatedStatus.getText()); return true; } catch (TwitterException e) { logger.warn("Failed to send Tweet '{}' because of : {}", abbreviatedTweetTxt, e.getLocalizedMessage()); return false; } }
Source:
public void notFoundDecodesToEmpty() throws Exception { Response response = Response.builder() .status(404) .reason("NOT FOUND") .headers(Collections.<String, Collection<String>>emptyMap()) .body((byte[]) null) .build(); assertThat((byte[]) new JAXBDecoder(new JAXBContextFactory.Builder().build()) .decode(response, byte[].class)).isEmpty(); }

Target:
public void notFoundDecodesToEmpty() throws Exception { Response response = Response.builder() .status(404) .reason("NOT FOUND") .headers(Collections.<String, Collection<String>>emptyMap()) .build(); assertThat((byte[]) new JAXBDecoder(new JAXBContextFactory.Builder().build()) .decode(response, byte[].class)).isEmpty(); }
Source:
public void shouldCreateGithubLinkActionForJobWithGithubProjectProperty() throws IOException { WorkflowJob p = j.jenkins.createProject(WorkflowJob.class, "p"); p.addProperty(new GithubProjectProperty("<LINK_0>")); Collection<? extends Action> actions = factory.createFor(p); assertThat(actions.size(), is(equalTo(1))); GithubLinkAction action = (GithubLinkAction) actions.iterator().next(); assertThat(action.getUrlName(), is(equalTo("<LINK_0>"))); }

Target:
public void shouldCreateGithubLinkActionForJobWithGithubProjectProperty() throws IOException { final WorkflowJob job = createExampleJob(); final GithubProjectProperty property = createExampleProperty(); job.addProperty(property); final Collection<? extends Action> actions = factory.createFor(job); assertThat("factored actions list", actions.size(), is(1)); final Action action = actions.iterator().next(); assertThat("instance check", action, is(instanceOf(GithubLinkAction.class))); assertThat("url of action", action.getUrlName(), is(property.getProjectUrlStr())); }
Source:
protected int getContextId() { return contextId; }

Target:
protected int getContextId() { return contextIds.isEmpty() ? -1 : contextIds.get(contextIds.size() - 1); }
Source:
public double accumulate() { return result.doubleValue(); }

Target:
public double accumulate() { return result.setScale(Vectors.ROUND_FACTOR, RoundingMode.CEILING).doubleValue(); }
Source:
private void removeGerritTriggerInJobs() { for (Job job : getConfiguredJobs()) { if (!(job instanceof AbstractProject)) { logger.info("Unable to remove Gerrit Trigger ffrom job [" + job.getName() + "]. " + " This feature is only supported for AbstractProject types e.g. Freestyle Jobs."); return; } AbstractProject project = (AbstractProject)job; GerritTrigger trigger = (GerritTrigger)project.getTrigger(GerritTrigger.class); trigger.stop(); try { project.removeTrigger(trigger.getDescriptor()); } catch (IOException e) { logger.error("Error removing Gerrit trigger from job [" + job.getName() + "]. Please check job config"); } trigger = null; try { job.save(); } catch (IOException e) { logger.error("Error saving configuration of job [" + job.getName() + "] while trying to remove Gerrit server [" + name + "]. Please check job config."); } } }

Target:
private void removeGerritTriggerInJobs() { for (Job job : getConfiguredJobs()) { if (!(job instanceof AbstractProject)) { logger.warn("Unable to remove Gerrit Trigger ffrom job [" + job.getName() + "]. " + " This feature is only supported for AbstractProject types e.g. Freestyle Jobs."); return; } AbstractProject project = (AbstractProject)job; GerritTrigger trigger = (GerritTrigger)project.getTrigger(GerritTrigger.class); trigger.stop(); try { project.removeTrigger(trigger.getDescriptor()); } catch (IOException e) { logger.error("Error removing Gerrit trigger from job [" + job.getName() + "]. Please check job config"); } trigger = null; try { job.save(); } catch (IOException e) { logger.error("Error saving configuration of job [" + job.getName() + "] while trying to remove Gerrit server [" + name + "]. Please check job config."); } } }
Source:
public DFUWorkunitsActionResponse deleteDropZoneFiles(String dropzoneName, List<String> fileNames, String netAddress, String path, String os) throws RemoteException, EspSoapFault { EspStringArray espStringArray = new EspStringArray(); fileNames.forEach(fileName -> espStringArray.addItem(fileName)); DeleteDropZoneFilesRequest request = new DeleteDropZoneFilesRequest(); request.setDropZoneName(dropzoneName); request.setNames(espStringArray); request.setNetAddress(netAddress); request.setPath(path); request.setOS(os); DFUWorkunitsActionResponse response = ((FileSprayStub)stub).deleteDropZoneFiles(request); return response; }

Target:
public DFUWorkunitsActionResponse deleteDropZoneFiles(String dropzoneName, List<String> fileNames, String netAddress, String path, String os) throws Exception { verifyStub(); EspStringArray espStringArray = new EspStringArray(); fileNames.forEach(fileName -> espStringArray.addItem(fileName)); DeleteDropZoneFilesRequest request = new DeleteDropZoneFilesRequest(); request.setDropZoneName(dropzoneName); request.setNames(espStringArray); request.setNetAddress(netAddress); request.setPath(path); request.setOS(os); DFUWorkunitsActionResponse response = ((FileSprayStub)stub).deleteDropZoneFiles(request); return response; }
Source:
public static void registerSaxonExtensionFunctions( CamelContext camelContext, Class<?> factoryClass, TransformerFactory factory, List<Object> saxonExtensionFunctions) throws Exception { if (saxonExtensionFunctions != null && !saxonExtensionFunctions.isEmpty()) { Method method = factoryClass.getMethod("getConfiguration"); if (method != null) { Object configuration = method.invoke(factory, null); if (configuration != null) { Class<?> extensionClass = camelContext.getClassResolver().resolveMandatoryClass( SAXON_EXTENDED_FUNCTION_DEFINITION_CLASS_NAME, XsltComponent.class.getClassLoader() ); method = configuration.getClass().getMethod("registerExtensionFunction", extensionClass); if (method != null) { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); for (Object extensionFunction : saxonExtensionFunctions) { if (extensionClass.isInstance(extensionFunction)) { LOG.debug("Sazon.registerExtensionFunction {}", extensionFunction); method.invoke(configuration, extensionFunction); } } } else { LOG.warn("Unable to get reference to method registerExtensionFunction on {}", configuration.getClass().getName()); } } else { LOG.warn("Unable to get Saxon configuration ({}) on {}", SAXON_CONFIGURATION_CLASS_NAME, factory.getClass().getName()); } } else { LOG.warn("Unable to get reference to method getConfiguration on {}", factoryClass.getName()); } } }

Target:
public static void registerSaxonExtensionFunctions( CamelContext camelContext, Class<?> factoryClass, TransformerFactory factory, List<Object> saxonExtensionFunctions) throws Exception { if (saxonExtensionFunctions != null && !saxonExtensionFunctions.isEmpty()) { Method method = factoryClass.getMethod("getConfiguration"); if (method != null) { Object configuration = method.invoke(factory, null); if (configuration != null) { Class<?> extensionClass = camelContext.getClassResolver().resolveMandatoryClass( SAXON_EXTENDED_FUNCTION_DEFINITION_CLASS_NAME, XsltComponent.class.getClassLoader() ); method = configuration.getClass().getMethod("registerExtensionFunction", extensionClass); if (method != null) { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); for (Object extensionFunction : saxonExtensionFunctions) { if (extensionClass.isInstance(extensionFunction)) { LOG.debug("Saxon.registerExtensionFunction {}", extensionFunction); method.invoke(configuration, extensionFunction); } } } else { LOG.warn("Unable to get reference to method registerExtensionFunction on {}", configuration.getClass().getName()); } } else { LOG.warn("Unable to get Saxon configuration ({}) on {}", SAXON_CONFIGURATION_CLASS_NAME, factory.getClass().getName()); } } else { LOG.warn("Unable to get reference to method getConfiguration on {}", factoryClass.getName()); } } }
Source:
private static void verifySearchResults(FeedbackResponseCommentSearchResultBundle actual, FeedbackResponseCommentAttributes... expected) { assertEquals(expected.length, actual.numberOfResults); assertEquals(expected.length, actual.comments.size()); int i = 0; for (String key : actual.comments.keySet()) { for (FeedbackResponseCommentAttributes comment : actual.comments.get(key)) { assertEquals(expected[i].commentText, comment.commentText); i++; } } }

Target:
private static void verifySearchResults(FeedbackResponseCommentSearchResultBundle actual, FeedbackResponseCommentAttributes... expected) { assertEquals(expected.length, actual.numberOfResults); assertEquals(expected.length, actual.comments.size()); FeedbackResponseCommentAttributes.sortFeedbackResponseCommentsByCreationTime(Arrays.asList(expected)); FeedbackResponseCommentAttributes[] sortedComments = Arrays.asList(expected) .toArray(new FeedbackResponseCommentAttributes[2]); int i = 0; for (String key : actual.comments.keySet()) { for (FeedbackResponseCommentAttributes comment : actual.comments.get(key)) { assertEquals(sortedComments[i].commentText, comment.commentText); i++; } } }
Source:
private ColumnDefinition(Optional<NodeLocation> location, Identifier name, String type, List<Property> properties, Optional<String> comment, boolean nullable, Optional<Literal> defaultValue) { super(location); this.name = requireNonNull(name, "name is null"); this.type = requireNonNull(type, "type is null"); this.properties = requireNonNull(properties, "properties is null"); this.comment = requireNonNull(comment, "comment is null"); this.nullable = nullable; this.defaultValue = defaultValue; }

Target:
private ColumnDefinition(Optional<NodeLocation> location, Identifier name, String type, List<Property> properties, Optional<String> comment, boolean nullable, Optional<Literal> defaultValue) { super(location); this.name = requireNonNull(name, "name is null"); this.type = requireNonNull(type, "type is null"); this.properties = requireNonNull(properties, "properties is null"); this.comment = requireNonNull(comment, "comment is null"); this.nullable = nullable; this.defaultValue = requireNonNull(defaultValue, "Default value is null"); }
Source:
public final Collection<Session> listSessions() throws SubscriptionNotInitializedException, NakadiRuntimeException, ServiceTemporarilyUnavailableException { getLog().info("fetching sessions information"); final List<String> zkSessions; try { zkSessions = getCurator().getChildren().forPath(getSubscriptionPath("/sessions")); } catch (final KeeperException.NoNodeException e) { throw new SubscriptionNotInitializedException(getSubscriptionId()); } catch (Exception ex) { throw new NakadiRuntimeException(ex); } Map result = new HashMap(); for (int i = 0; i < 3; i++) { result = loadDataAsync(zkSessions, key -> getSubscriptionPath("/sessions/" + key), this::deserializeSession); if (result.size() == zkSessions.size()) return result.values(); } if (result.size() != zkSessions.size()) { final Map incompleteResult = result; throw new ServiceTemporarilyUnavailableException("Failed to get all keys " + zkSessions.stream() .filter(v -> !incompleteResult.containsKey(v)) .map(String::valueOf) .collect(Collectors.joining(", ")) + " from ZK", null); } return result.values(); }

Target:
public final Collection<Session> listSessions() throws SubscriptionNotInitializedException, NakadiRuntimeException, ServiceTemporarilyUnavailableException { getLog().info("fetching sessions information"); for (int i = 0; i < 5; i++) { try { final List<String> sessions = getCurator().getChildren().forPath(getSubscriptionPath("/sessions")); final Map <String,Session> result = loadDataAsync(sessions, key -> getSubscriptionPath("/sessions/" + key), this::deserializeSession); if (result.size() == sessions.size()) { return result.values(); } } catch (final KeeperException.NoNodeException e) { throw new SubscriptionNotInitializedException(getSubscriptionId()); } catch (Exception ex) { throw new NakadiRuntimeException(ex); } } throw new ServiceTemporarilyUnavailableException("Failed to get all keys from ZK", null); }
Source:
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { TFM_Util.adminAction(sender.getName(), "Cleaning all tags.", false); for (final Player player : server.getOnlinePlayers()) { final String playerName = player.getName(); final TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player); final String Tag = playerdata.getTag(); if (Tag != null && !Tag.isEmpty() && !Tag.equalsIgnoreCase(playerName)) { final Matcher matcher = REGEX.matcher(Tag); if (matcher.find()) { final String newTag = matcher.replaceAll(""); playerMsg(ChatColor.RESET + playerName + ": \"" + Tag + ChatColor.RESET + "\" -> \"" + newTag + ChatColor.RESET + "\"."); TFM_PlayerData.getPlayerData(player).setTag(newTag); } } } return true; }

Target:
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { TFM_Util.adminAction(sender.getName(), "Cleaning all tags.", false); for (final Player player : server.getOnlinePlayers()) { final String playerName = player.getName(); final TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player); final String Tag = playerdata.getTag(); if (Tag != null && !Tag.isEmpty() && !Tag.equalsIgnoreCase(playerName)) { final Matcher matcher = REGEX.matcher(Tag); if (matcher.find()) { final String cleanTag = matcher.replaceAll(""); playerMsg(ChatColor.RESET + playerName + ": \"" + Tag + ChatColor.RESET + "\" -> \"" + cleanTag + ChatColor.RESET + "\"."); TFM_PlayerData.getPlayerData(player).setTag(cleanTag); } } } return true; }
Source:
public IFile findFileName(String partialLoc) { if (partialLoc.equals(cachedFileName) && cachedWorkingDirectory != null && org.eclipse.core.filesystem.URIUtil.equals(getWorkingDirectoryURI(), cachedWorkingDirectory)) return cachedFile; IPath path = new Path(partialLoc.replace('\\', IPath.SEPARATOR)); IFile file = findFileInWorkspace(path); if (file==null) { path = path.setDevice(null); IFile[] files = null; if (fProject != null) { IProject[] prjs = new IProject[] { fProject }; files = ResourceLookup.findFilesByName(path, prjs, false); if (files.length == 0) files = ResourceLookup.findFilesByName(path, prjs, true); } if (files == null || files.length == 0) { IProject[] prjs = ResourcesPlugin.getWorkspace().getRoot().getProjects(); files = ResourceLookup.findFilesByName(path, prjs, false); if (files.length == 0) files = ResourceLookup.findFilesByName(path, prjs, true); } if (files.length == 1) file = files[0]; } if (file==null && isCygwin && path.isAbsolute()) { file = findCygwinFile(partialLoc); } cachedFileName = partialLoc; cachedWorkingDirectory = getWorkingDirectoryURI(); cachedFile = file; return file; }

Target:
public IFile findFileName(String partialLoc) { if (partialLoc.equals(cachedFileName) && cachedWorkingDirectory != null && org.eclipse.core.filesystem.URIUtil.equals(getWorkingDirectoryURI(), cachedWorkingDirectory)) { return cachedFile; } IPath path = new Path(partialLoc.replace('\\', IPath.SEPARATOR)); IFile file = findFileInWorkspace(path); if (file==null) { path = path.setDevice(null); IFile[] files = null; if (fProject != null) { IProject[] prjs = new IProject[] { fProject }; files = ResourceLookup.findFilesByName(path, prjs, false); if (files.length == 0) { files = ResourceLookup.findFilesByName(path, prjs, true); } } if (files == null || files.length == 0) { IProject[] prjs = ResourcesPlugin.getWorkspace().getRoot().getProjects(); files = ResourceLookup.findFilesByName(path, prjs, false); if (files.length == 0) { files = ResourceLookup.findFilesByName(path, prjs, true); } } if (files.length == 1) { file = files[0]; } } if (file==null && isCygwin && path.isAbsolute()) { file = findCygwinFile(partialLoc); } cachedFileName = partialLoc; cachedWorkingDirectory = getWorkingDirectoryURI(); cachedFile = file; return file; }
Source:
public void test_get_revision_task() throws Exception { CouchDB sourceDB = mock(CouchDB.class); String docId = "asdjfsdflkjsd"; String revId = "10-asdfsafsadf"; List<String> expected = Arrays.asList("1-a", "2-b", "3-a"); DocumentRevs.Revisions revs = new DocumentRevs.Revisions(); revs.setIds(expected); List<DocumentRevs> documentRevs = new ArrayList<DocumentRevs>(); DocumentRevs dr = new DocumentRevs(); dr.setRevisions(revs); documentRevs.add(dr); ArrayList<String> revIds = new ArrayList<String>(); revIds.add(revId); ArrayList<String> attsSince = new ArrayList<String>(); when(sourceDB.getRevisions(docId, revIds, attsSince)).thenReturn(documentRevs); GetRevisionTask task = new GetRevisionTask(sourceDB, docId, revIds, attsSince); DocumentRevsList actualDocumentRevs = task.call(); verify(sourceDB).getRevisions(docId, revIds, attsSince); Assert.assertEquals(expected, actualDocumentRevs.get(0).getRevisions().getIds()); }

Target:
public void test_get_revision_task() throws Exception { CouchDB sourceDB = mock(CouchDB.class); String docId = "asdjfsdflkjsd"; String revId = "10-asdfsafsadf"; List<String> expected = Arrays.asList("1-a", "2-b", "3-a"); DocumentRevs.Revisions revs = new DocumentRevs.Revisions(); revs.setIds(expected); List<DocumentRevs> documentRevs = new ArrayList<DocumentRevs>(); DocumentRevs dr = new DocumentRevs(); dr.setRevisions(revs); documentRevs.add(dr); ArrayList<String> revIds = new ArrayList<String>(); revIds.add(revId); ArrayList<String> attsSince = new ArrayList<String>(); when(sourceDB.getRevisions(docId, revIds, attsSince, pullAttachmentsInline)).thenReturn(documentRevs); GetRevisionTask task = new GetRevisionTask(sourceDB, docId, revIds, attsSince, pullAttachmentsInline); DocumentRevsList actualDocumentRevs = task.call(); verify(sourceDB).getRevisions(docId, revIds, attsSince, pullAttachmentsInline); Assert.assertEquals(expected, actualDocumentRevs.get(0).getRevisions().getIds()); }
Source:
private void recomputeSize() { Rectangle bounds = getShell().getBounds(); Point size = composite.computeSize(SWT.DEFAULT, SWT.DEFAULT); scrolledComposite.setMinSize(size); setSize(size.x, Math.min(getShell().getMonitor().getClientArea().height, size.y)); setLocation(new Point(bounds.x, bounds.y)); if (scrolledComposite.getVerticalBar().isVisible() && commentEditor != null) { Point commentEditorSize = commentEditor.getSize(); commentEditor.setSize(commentEditorSize.x - scrolledComposite.getVerticalBar().getSize().x, commentEditorSize.y); } if (commentEditor != null) { scrolledComposite.setOrigin(0, Integer.MAX_VALUE); } }

Target:
private void recomputeSize() { Rectangle bounds = getShell().getBounds(); Point size = composite.computeSize(SWT.DEFAULT, SWT.DEFAULT); scrolledComposite.setMinSize(size); int height = constrain(size.y, MIN_HEIGHT, getShell().getMonitor().getClientArea().height); getShell().setSize(size.x, height); scrolledComposite.setSize(size.x, height); setLocation(new Point(bounds.x, bounds.y)); if (scrolledComposite.getVerticalBar().isVisible() && commentEditor != null) { Point commentEditorSize = commentEditor.getSize(); commentEditor.setSize(commentEditorSize.x - scrolledComposite.getVerticalBar().getSize().x, commentEditorSize.y); } if (commentEditor != null) { scrolledComposite.setOrigin(0, Integer.MAX_VALUE); } }
Source:
public void testBatchBulkGets() throws Exception { List<Get> gets = new ArrayList<>(10); List<Row> responses = new ArrayList<>(9); gets.add(new Get(Bytes.toBytes("key0"))); for (int i=1; i<10; i++){ byte[] row_key = randomBytes(8); gets.add(new Get(Bytes.toBytes("key"+i))); responses.add(Row.newBuilder().setKey(BigtableZeroCopyByteStringUtil.wrap(row_key)).build()); } when(mockFuture.get()).thenReturn(responses); BatchExecutor underTest = createExecutor(new BigtableOptions.Builder().setUseBulkApi(true).build()); final List<? extends org.apache.hadoop.hbase.client.Row> actions = gets; final BatchExecutor executor = underTest; Result[] results = executor.batch(actions); verify(mockAsyncExecutor, times(1)).readRowsAsync(any(ReadRowsRequest.class)); Assert.assertTrue(matchesRow(Result.EMPTY_RESULT).matches(results[0])); }

Target:
public void testBatchBulkGets() throws Exception { List<Get> gets = new ArrayList<>(10); List<Row> responses = new ArrayList<>(9); gets.add(new Get(Bytes.toBytes("key0"))); for (int i = 1; i < 10; i++) { byte[] row_key = randomBytes(8); gets.add(new Get(row_key)); ByteString key = BigtableZeroCopyByteStringUtil.wrap(row_key); ByteString cellValue = ByteString.copyFrom(randomBytes(8)); com.google.bigtable.v1.Cell cell = Cell.newBuilder() .setTimestampMicros(System.nanoTime() / 1000) .setValue(cellValue) .build(); Family family = Family.newBuilder() .setName("family") .addColumns(Column.newBuilder().addCells(cell)) .build(); responses.add(Row.newBuilder().setKey(key).addFamilies(family).build()); } when(mockFuture.get()).thenReturn(responses); BatchExecutor underTest = createExecutor(new BigtableOptions.Builder().setUseBulkApi(true).build()); Result[] results = underTest.batch(gets); verify(mockAsyncExecutor, times(1)).readRowsAsync(any(ReadRowsRequest.class)); Assert.assertTrue(matchesRow(Result.EMPTY_RESULT).matches(results[0])); for (int i = 1; i < results.length; i++) { Result response = Adapters.ROW_ADAPTER.adaptResponse(responses.get(i - 1)); Assert.assertTrue(Bytes.equals(response.getRow(), results[i].getRow())); } }
Source:
public void run(ActionContext context) throws Exception { Path path = new Path(config.path); FileSystem fileSystem = path.getFileSystem(new Configuration()); FileStatus[] listFiles; if (config.fileRegex != null) { PathFilter filter = new PathFilter() { private final Pattern pattern = Pattern.compile(config.fileRegex); @Override public boolean accept(Path path) { return pattern.matcher(path.getName()).matches(); } }; listFiles = fileSystem.listStatus(path, filter); } else { listFiles = fileSystem.listStatus(path); } for (FileStatus file: listFiles) { path = file.getPath(); if (!fileSystem.delete(path, true)) { if (!config.continueOnError) { throw new IOException(String.format("Removal of %s was unsuccessful.", path.toString())); } LOG.error("Removal of was unsuccessful.", path.toString()); } } }

Target:
public void run(ActionContext context) throws Exception { Path path = new Path(config.path); FileSystem fileSystem = path.getFileSystem(new Configuration()); FileStatus[] listFiles; if (config.fileRegex != null) { PathFilter filter = new PathFilter() { private final Pattern pattern = Pattern.compile(config.fileRegex); @Override public boolean accept(Path path) { return pattern.matcher(path.getName()).matches(); } }; listFiles = fileSystem.listStatus(path, filter); } else { listFiles = fileSystem.listStatus(path); } for (FileStatus file: listFiles) { Path currPath = file.getPath(); removePath(fileSystem, currPath); } if (fileSystem.isDirectory(path) && config.fileRegex == null) { removePath(fileSystem, path); } }
Source:
protected URI getExpectedDestinationUri(final KeycloakSession session) { KeycloakUriInfo info = session.getContext().getUri(); URI baseUri = info.getBaseUri(); return info.getAbsolutePathBuilder().scheme(baseUri.getScheme()).host(baseUri.getHost()).port(baseUri.getPort()).build(); }

Target:
protected URI getExpectedDestinationUri(final KeycloakSession session) { final String realmName = session.getContext().getRealm().getName(); final URI baseUri = session.getContext().getUri().getBaseUri(); return Urls.samlRequestEndpoint(baseUri, realmName); }
Source:
public WrapLayoutRow(List<Component> components, List<Component> oppositeAligned, int height, int width) { this.components = components; this.oppositeAligned = oppositeAligned; this.height = height; this.width = width; }

Target:
WrapLayoutRow(List<Component> components, List<Component> oppositeAligned, int height, int width) { this.components = components; this.oppositeAligned = oppositeAligned; this.height = height; this.width = width; }
Source:
public IRateSource createRateSource(String sourceLogin) { if (sourceLogin != null && !sourceLogin.trim().isEmpty()) { StringTokenizer st = new StringTokenizer(sourceLogin,":"); String rsType = st.nextToken(); if ("monetaryunitfix".equalsIgnoreCase(rsType)) { BigDecimal rate = BigDecimal.ZERO; if (st.hasMoreTokens()) { try { rate = new BigDecimal(st.nextToken()); } catch (Throwable e) { } } String preferedFiatCurrency = FiatCurrency.USD.getCode(); if (st.hasMoreTokens()) { preferedFiatCurrency = st.nextToken().toUpperCase(); } return new FixPriceRateSource(rate,preferedFiatCurrency); } else if ("coinmarketcap".equalsIgnoreCase(rsType)) { String preferredFiatCurrency = FiatCurrency.USD.getCode(); String apiKey = null; if (st.hasMoreTokens()) { preferredFiatCurrency = st.nextToken().toUpperCase(); } if (st.hasMoreTokens()) { apiKey = st.nextToken(); } return new CoinmarketcapRateSource(apiKey, preferredFiatCurrency); } } return null; }

Target:
public IRateSource createRateSource(String sourceLogin) { if (sourceLogin != null && !sourceLogin.trim().isEmpty()) { StringTokenizer st = new StringTokenizer(sourceLogin,":"); String rsType = st.nextToken(); if ("coinmarketcap".equalsIgnoreCase(rsType)) { String preferredFiatCurrency = FiatCurrency.USD.getCode(); String apiKey = null; if (st.hasMoreTokens()) { preferredFiatCurrency = st.nextToken().toUpperCase(); } if (st.hasMoreTokens()) { apiKey = st.nextToken(); } return new CoinmarketcapRateSource(apiKey, preferredFiatCurrency); } else if ("coingecko".equalsIgnoreCase(rsType)) { String preferredFiatCurrency = st.hasMoreTokens() ? st.nextToken().toUpperCase() : FiatCurrency.USD.getCode(); return new CoinGeckoRateSource(preferredFiatCurrency); } else if ("coinpaprika".equalsIgnoreCase(rsType)) { String preferredFiatCurrency = st.hasMoreTokens() ? st.nextToken().toUpperCase() : FiatCurrency.USD.getCode(); return new CoinPaprikaRateSource(preferredFiatCurrency); } } return null; }
Source:
public RemoveUnregisteredEntityParameters() { this.setEntityId(Guid.Empty); this.setStorageDomainId(Guid.Empty); this.setStoragePoolId(Guid.Empty); }

Target:
public RemoveUnregisteredEntityParameters() { this(Guid.Empty, Guid.Empty, Guid.Empty); }
Source:
protected void onScrolled(int oldScrollY, int scrollY) { int opacity = fadeEnabled && scrollY < (pageFragment.getHeaderView().getHeight() - toolbarHeight) ? 0 : FULL_OPACITY; toolbarBackground.setAlpha(opacity); updateChildIconTint(toolbar, opacity); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { pageFragment.requireActivity().getWindow() .setStatusBarColor(calculateStatusBarTintForOpacity(opacity)); } }

Target:
protected void onScrolled(int oldScrollY, int scrollY) { int opacity = fadeEnabled && scrollY < (DimenUtil.leadImageHeightForDevice() - toolbarHeight) ? 0 : FULL_OPACITY; toolbarBackground.setAlpha(opacity); updateChildIconTint(toolbar, opacity); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { pageFragment.requireActivity().getWindow() .setStatusBarColor(calculateStatusBarTintForOpacity(opacity)); } }
Source:
private static IndexDefinition tryParseBitmap(String definition, boolean ordered) { String[] parts = ARROW_PATTERN.split(definition); if (parts.length == 1) { return null; } if (parts.length != 2) { throw new IllegalArgumentException("Invalid bitmap index definition: " + definition); } parts[0] = canonicalizeAttribute(parts[0]); parts[1] = canonicalizeAttribute(parts[1]); if (parts[0].isEmpty() || parts[1].isEmpty() || parts[0].equals(parts[1])) { throw new IllegalArgumentException("Invalid bitmap index definition: " + definition); } if (parts[0].contains(",") || parts[1].contains(",")) { throw new IllegalArgumentException("Composite bitmap indexes are not supported: " + definition); } return new IndexDefinition(parts[0] + " -> " + parts[1], ordered, parts[1], parts[0]); }

Target:
private static IndexDefinition tryParseBitmap(String definition, boolean ordered) { if (definition == null || !definition.toUpperCase().startsWith(BITMAP_PREFIX)) { return null; } if (!definition.endsWith(BITMAP_POSTFIX)) { throw makeInvalidBitmapIndexDefinitionException(definition); } String innerText = definition.substring(BITMAP_PREFIX.length(), definition.length() - 1); String[] parts = COMMA_PATTERN.split(innerText, -1); if (parts.length == 0 || parts.length > 3) { throw makeInvalidBitmapIndexDefinitionException(definition); } String attribute = canonicalizeAttribute(parts[0]); String uniqueKey = parts.length >= 2 ? canonicalizeAttribute(parts[1]) : KEY_ATTRIBUTE_NAME.value(); UniqueKeyTransform uniqueKeyTransform = parts.length == 3 ? UniqueKeyTransform.parse(parts[2]) : UniqueKeyTransform.OBJECT; if (attribute.isEmpty() || uniqueKey.isEmpty() || attribute.equals(uniqueKey)) { throw makeInvalidBitmapIndexDefinitionException(definition); } String canonicalName = BITMAP_PREFIX + attribute + ", " + uniqueKey + ", " + uniqueKeyTransform + BITMAP_POSTFIX; return new IndexDefinition(canonicalName, ordered, uniqueKey, uniqueKeyTransform, attribute); }
Source:
public void assertSameContentAs(AssertionInfo info, File actual, File expected) { verifyIsFile(expected); assertIsFile(info, actual); BinaryDiffResult binaryDiffResult = null; try { binaryDiffResult = binaryDiff.diff(actual, java.nio.file.Files.readAllBytes(expected.toPath())); if (binaryDiffResult.hasNoDiff()) return; List<Delta<String>> diffs = diff.diff(actual, expected); if (diffs.isEmpty()) return; throw failures.failure(info, shouldHaveSameContent(actual, expected, diffs)); } catch (MalformedInputException e) { throw failures.failure(info, shouldHaveBinaryContent(actual, binaryDiffResult)); } catch (IOException e) { String msg = String.format("Unable to compare contents of files:<%s> and:<%s>", actual, expected); throw new RuntimeIOException(msg, e); } }

Target:
public void assertSameContentAs(AssertionInfo info, File actual, File expected) { verifyIsFile(expected); assertIsFile(info, actual); BinaryDiffResult binaryDiffResult = null; try { binaryDiffResult = binaryDiff.diff(actual, readAllBytes(expected.toPath())); if (binaryDiffResult.hasNoDiff()) return; List<Delta<String>> diffs = diff.diff(actual, expected); if (diffs.isEmpty()) return; throw failures.failure(info, shouldHaveSameContent(actual, expected, diffs)); } catch (MalformedInputException e) { throw failures.failure(info, shouldHaveBinaryContent(actual, binaryDiffResult)); } catch (IOException e) { String msg = String.format("Unable to compare contents of files:<%s> and:<%s>", actual, expected); throw new RuntimeIOException(msg, e); } }
Source:
public void prepare(Object configurationObject) { synchronized (this) { try { if (this.objectMapper == null) this.objectMapper = new ObjectMapper(); if (this.amazonS3Client == null) { AWSCredentials credentials = new BasicAWSCredentials(s3WriterConfiguration.getKey(), s3WriterConfiguration.getSecretKey()); ClientConfiguration clientConfig = new ClientConfiguration(); clientConfig.setProtocol(Protocol.valueOf(s3WriterConfiguration.getProtocol().toString())); S3ClientOptions clientOptions = new S3ClientOptions(); clientOptions.setPathStyleAccess(false); this.amazonS3Client = new AmazonS3Client(credentials, clientConfig); if (!Strings.isNullOrEmpty(s3WriterConfiguration.getRegion())) this.amazonS3Client.setRegion(Region.getRegion(Regions.fromName(s3WriterConfiguration.getRegion()))); this.amazonS3Client.setS3ClientOptions(clientOptions); } } catch (Exception e) { LOGGER.error("Exception while preparing the S3 client: {}", e); } Preconditions.checkArgument(this.amazonS3Client != null); } }

Target:
public void prepare(Object configurationObject) { synchronized (this) { try { if (this.objectMapper == null) this.objectMapper = new StreamsJacksonMapper(); if (this.amazonS3Client == null) { AWSCredentials credentials = new BasicAWSCredentials(s3WriterConfiguration.getKey(), s3WriterConfiguration.getSecretKey()); ClientConfiguration clientConfig = new ClientConfiguration(); clientConfig.setProtocol(Protocol.valueOf(s3WriterConfiguration.getProtocol().toString())); S3ClientOptions clientOptions = new S3ClientOptions(); clientOptions.setPathStyleAccess(false); this.amazonS3Client = new AmazonS3Client(credentials, clientConfig); if (!Strings.isNullOrEmpty(s3WriterConfiguration.getRegion())) this.amazonS3Client.setRegion(Region.getRegion(Regions.fromName(s3WriterConfiguration.getRegion()))); this.amazonS3Client.setS3ClientOptions(clientOptions); } } catch (Exception e) { LOGGER.error("Exception while preparing the S3 client: {}", e); } Preconditions.checkArgument(this.amazonS3Client != null); } }
Source:
protected void afterResourceSaved(ResourceManager mgr, CommandContext context, File resourceFile, SaveReceipt receipt) { String payload = receipt.getPayload(); if (payload != null) { if (payload.contains("cache-size") && context.getAdminManager() != null) { if (logger.isDebugEnabled()) { logger.info("Group payload contains cache-size parameter, so waiting for ML to restart"); } context.getAdminManager().waitForRestart(); } Fragment xml = new Fragment(payload); String groupName = xml.getElementValue("/m:group-properties/m:group-name"); String adminServerPayload = format(ADMIN_SERVER_UPDATE_JSON_TEMPLATE, ADMIN_SERVER_NAME, groupName); ServerManager serverMgr = new ServerManager(context.getManageClient(), groupName); serverMgr.save(adminServerPayload); } }

Target:
protected void afterResourceSaved(ResourceManager mgr, CommandContext context, File resourceFile, SaveReceipt receipt) { String payload = receipt.getPayload(); if (payload != null) { if (payload.contains("cache-size") && context.getAdminManager() != null) { if (logger.isDebugEnabled()) { logger.info("Group payload contains cache-size parameter, so waiting for ML to restart"); } context.getAdminManager().waitForRestart(); } String groupName = new PayloadParser().getPayloadFieldValue(payload, "group-name", true); ServerManager serverMgr = new ServerManager(context.getManageClient(), groupName); serverMgr.save(adminServerTemplate.getJson()); } }
Source:
protected void internalSetVariable(final String name, final Object content) { if (!JVMCompiledHelper.isSaveName(name)) throw new RuntimeException("\"" + name + "\" is not a valid Scala variable name"); }

Target:
protected void internalSetVariable(final String name, final Object content) { }
Source:
private String[] getTopologyDef(ClusterConfig clusterConfig) { String[] topologyDef; String topologyDefInConfig = clusterConfig.getTopology(); if (topologyDefInConfig == null) { throw new HelixException(String.format("The topology of cluster %s is empty!", clusterConfig.getClusterName())); } topologyDef = Arrays.asList(topologyDefInConfig.trim().split(DELIMITER)).stream() .filter(str -> !str.isEmpty()).collect(Collectors.toList()).toArray(new String[0]); if (topologyDef.length == 0) { throw new HelixException(String.format("The topology of cluster %s is not correctly defined", clusterConfig.getClusterName())); } return topologyDef; }

Target:
private String[] getTopologyDef(ClusterConfig clusterConfig) { String[] topologyDef; String topologyDefInConfig = clusterConfig.getTopology(); if (topologyDefInConfig == null || !topologyDefInConfig.trim().startsWith(DELIMITER)) { throw new HelixException(String.format("The topology of cluster %s is invalid!", clusterConfig.getClusterName())); } topologyDef = Arrays.asList(topologyDefInConfig.split(DELIMITER)).stream().map(str -> str.trim()) .filter(str -> !str.isEmpty()).collect(Collectors.toList()).toArray(new String[0]); if (topologyDef.length == 0) { throw new HelixException(String.format("The topology of cluster %s is not correctly defined", clusterConfig.getClusterName())); } return topologyDef; }
Source:
public boolean isSideInvisible(BlockState state, BlockState adjacentBlockState, Direction side) { final Material mat = adjacentBlockState.getMaterial(); if (mat == Material.GLASS || mat == Materials.GLASS) { if (adjacentBlockState.getRenderType() == state.getRenderType()) { return true; } } return super.isSideInvisible(state, adjacentBlockState, side); }

Target:
public boolean isSideInvisible(BlockState state, BlockState adjacentBlockState, Direction side) { final Material mat = adjacentBlockState.getMaterial(); if (mat == Material.GLASS || mat == AEMaterials.GLASS) { if (adjacentBlockState.getRenderType() == state.getRenderType()) { return true; } } return super.isSideInvisible(state, adjacentBlockState, side); }