auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void bind() { $(menuToggle).find("a").on("click", new Function() { @Override public boolean f(Event event) { Window.scrollTo(0,0); $(sidebar).toggleClass(appResources.style().active()); $(menuToggle).removeClass(appResources.style().active()); if($(sidebar).hasClass(appResources.style().active())){ $(menuToggle).toggleClass(appResources.style().active()); } return false; } }); $(sidebar).find("a").on("click", new Function() { @Override public void f() { Window.scrollTo(0,0); $(sidebar).removeClass(appResources.style().active()); $(menuToggle).removeClass(appResources.style().active()); } }); $(content).on("click", new Function() { @Override public void f() { $(sidebar).removeClass(appResources.style().active()); $(menuToggle).removeClass(appResources.style().active()); } }); }

Target:
public void bind() { $("a", menuToggle).click(new Function() { @Override public boolean f(Event event) { Window.scrollTo(0, 0); $(sidebar).toggleClass(appResources.style().active()); $(menuToggle).removeClass(appResources.style().active()); if($(sidebar).hasClass(appResources.style().active())){ $(menuToggle).toggleClass(appResources.style().active()); } return false; } }); $("a", sidebar).click(new Function() { @Override public void f() { Window.scrollTo(0, 0); $(sidebar).removeClass(appResources.style().active()); $(menuToggle).removeClass(appResources.style().active()); } }); $(content).click(new Function() { @Override public void f() { $(sidebar).removeClass(appResources.style().active()); $(menuToggle).removeClass(appResources.style().active()); } }); }
Source:
} catch (NullPointerException e) { throw new IllegalArgumentException("Unable to find stream with anme " + trigger.getKinesisStream()); }

Target:
} catch (NullPointerException e) { throw new IllegalArgumentException("Unable to find stream with name " + trigger.getKinesisStream()); }
Source:
private void loadJavaExtensions(Set<String> addedImports) { Map<String, Class> toUnload = Maps.newLinkedHashMap(); Map<String, Class> toLoad = Maps.newLinkedHashMap(); Set<String> notFound = Sets.newLinkedHashSet(); for (String qualifiedName : addedImports) { Class<?> found = null; try { Class<?> serviceClass = Class.forName(qualifiedName); if (JAVA_SERVICES_CLASSES_WHITE_LIST.contains(serviceClass)) { loaded(serviceClass.getName(), serviceClass); found = serviceClass; } } catch (ClassNotFoundException e) { } if (found == null) { found = classLoading.findClass(viewpointProjects, viewpointPlugins, qualifiedName); if (found != null) { this.couldNotBeLoaded.remove(qualifiedName); Class<?> alreadyHere = loadedClasses.get(qualifiedName); if (alreadyHere != null) { toUnload.put(qualifiedName, alreadyHere); } loadedClasses.put(qualifiedName, found); toLoad.put(qualifiedName, found); } else { notFound.add(qualifiedName); this.couldNotBeLoaded.add(qualifiedName); } } } for (Map.Entry<String, Class> classToUnload : toUnload.entrySet()) { unloaded(classToUnload.getKey(), classToUnload.getValue()); } for (Map.Entry<String, Class> classToLoad : toLoad.entrySet()) { loaded(classToLoad.getKey(), classToLoad.getValue()); } for (String qualifiedName : notFound) { notFound(qualifiedName); } }

Target:
private void loadJavaExtensions(Set<String> addedImports) { Map<String, Class> toUnload = Maps.newLinkedHashMap(); Map<String, Class> toLoad = Maps.newLinkedHashMap(); Set<String> notFound = Sets.newLinkedHashSet(); for (String qualifiedName : addedImports) { Class<?> found = classLoading.findClass(viewpointProjects, viewpointPlugins, qualifiedName); if (found == null) { found = classLoading.findClass(Collections.<String> emptySet(), JAVA_SERVICES_BUNDLES_WHITE_LIST, qualifiedName); } if (found != null) { this.couldNotBeLoaded.remove(qualifiedName); Class<?> alreadyHere = loadedClasses.get(qualifiedName); if (alreadyHere != null) { toUnload.put(qualifiedName, alreadyHere); } loadedClasses.put(qualifiedName, found); toLoad.put(qualifiedName, found); } else { notFound.add(qualifiedName); this.couldNotBeLoaded.add(qualifiedName); } } for (Map.Entry<String, Class> classToUnload : toUnload.entrySet()) { unloaded(classToUnload.getKey(), classToUnload.getValue()); } for (Map.Entry<String, Class> classToLoad : toLoad.entrySet()) { loaded(classToLoad.getKey(), classToLoad.getValue()); } for (String qualifiedName : notFound) { notFound(qualifiedName); } }
Source:
public boolean hasIncomingChanges() { for (AbstractTaskEditorPart part : subParts) { if (part.hasIncomingChanges()) { return true; } } return false; }

Target:
public boolean hasIncomingChanges() { if (super.hasIncomingChanges()) { return true; } for (AbstractTaskEditorPart part : subParts) { if (part.hasIncomingChanges()) { return true; } } return false; }
Source:
public Iterator<String> getAttributeNames() { final List<String> names; synchronized (attributes) { names = new ArrayList<>(attributes.size()); names.addAll(attributes.keySet()); } return names.iterator(); }

Target:
public Iterator<String> getAttributeNames() { return attributes.keySet().iterator(); }
Source:
public void tracing(ResultSet resultSet) { if (isTracingEnabled()) { Logger actualLogger = traceQueryForEntity ? entityLogger : dmlLogger; if(actualLogger.isTraceEnabled()) { for (ExecutionInfo executionInfo : resultSet.getAllExecutionInfo()) { StringBuilder builder = new StringBuilder(); builder.append(format("Query tracing at host %s with achieved consistency level %s \n", executionInfo.getQueriedHost(), executionInfo.getAchievedConsistencyLevel())); builder.append("****************************\n"); builder.append(format("%1$-80s | %2$-16s | %3$-24s | %4$-20s\n", "Description", "Source", "Source elapsed in micros", "Thread name")); try { final QueryTrace queryTrace = executionInfo.getQueryTrace(); if (queryTrace != null) { final List<QueryTrace.Event> events = new ArrayList<>(queryTrace.getEvents()); Collections.sort(events, EVENT_TRACE_COMPARATOR); for (QueryTrace.Event event : events) { builder.append(format("%1$-80s | %2$-16s | %3$-24s | %4$-20s\n", event.getDescription(), event.getSource(), event.getSourceElapsedMicros(), event.getThreadName())); } } } catch (TraceRetrievalException e) { builder.append(format(" ERROR: cannot retrieve trace for query %s because it may not be yet available\n", getQueryString())); } builder.append("****************************\n"); actualLogger.trace(builder.toString()); } } } }

Target:
public void tracing(ResultSet resultSet) { if (isTracingEnabled()) { Logger actualLogger = traceQueryForEntity ? entityLogger : dmlLogger; for (ExecutionInfo executionInfo : resultSet.getAllExecutionInfo()) { StringBuilder builder = new StringBuilder(); builder.append(format("Query tracing at host %s with achieved consistency level %s \n", executionInfo.getQueriedHost(), executionInfo.getAchievedConsistencyLevel())); builder.append("****************************\n"); builder.append(format("%1$-80s | %2$-16s | %3$-24s | %4$-20s\n", "Description", "Source", "Source elapsed in micros", "Thread name")); try { final QueryTrace queryTrace = executionInfo.getQueryTrace(); if (queryTrace != null) { final List<QueryTrace.Event> events = new ArrayList<>(queryTrace.getEvents()); Collections.sort(events, EVENT_TRACE_COMPARATOR); for (QueryTrace.Event event : events) { builder.append(format("%1$-80s | %2$-16s | %3$-24s | %4$-20s\n", event.getDescription(), event.getSource(), event.getSourceElapsedMicros(), event.getThreadName())); } } } catch (TraceRetrievalException e) { builder.append(format(" ERROR: cannot retrieve trace for query %s because it may not be yet available\n", getQueryString())); } builder.append("****************************\n"); actualLogger.trace(builder.toString()); } } }
Source:
private void processFileAction() throws IOException { fileAction = fileAction.toLowerCase(); try { switch (fileAction) { case "delete": fs.delete(file, true); break; case "move": Path tagetFileMovePath = new Path(targetFolder + file.getName()); fs.rename(file, tagetFileMovePath); break; case "archive": FileOutputStream archivedStream = new FileOutputStream(targetFolder + file.getName() + ".zip"); ZipOutputStream zipArchivedStream = new ZipOutputStream(archivedStream); FSDataInputStream fdDataInputStream = fs.open(file); zipArchivedStream.putNextEntry(new ZipEntry(file.getName())); int length; byte[] buffer = new byte[1024]; while ((length = fdDataInputStream.read(buffer)) > 0) { zipArchivedStream.write(buffer, 0, length); } zipArchivedStream.closeEntry(); fdDataInputStream.close(); zipArchivedStream.close(); fs.delete(file, true); break; default: break; } } catch (IOException ioe) { throw ioe; } }

Target:
private void processFileAction() throws IOException { switch (fileAction.toLowerCase()) { case "delete": fs.delete(file, true); break; case "move": Path targetFileMovePath = new Path(targetFolder, file.getName()); fs.rename(file, targetFileMovePath); break; case "archive": try (FSDataOutputStream archivedStream = fs.create(new Path(targetFolder, file.getName() + ".zip")); ZipOutputStream zipArchivedStream = new ZipOutputStream(archivedStream); FSDataInputStream fdDataInputStream = fs.open(file)) { zipArchivedStream.putNextEntry(new ZipEntry(file.getName())); int length; byte[] buffer = new byte[1024]; while ((length = fdDataInputStream.read(buffer)) > 0) { zipArchivedStream.write(buffer, 0, length); } zipArchivedStream.closeEntry(); } fs.delete(file, true); break; default: break; } }
Source:
public ASTNode visit(Constant constant, Void _) { Term rez; if (constant.getSort().equals(Sort.KLIST)) { rez = new KLabelConstant(constant.getValue()); } else { rez = Token.kAppOf(constant.getSort(), constant.getValue()); } rez.setLocation(constant.getLocation()); rez.setSource(constant.getSource()); rez.copyAttributesFrom(constant); return this.visitNode(rez); }

Target:
public ASTNode visit(Constant constant, Void _) { Term rez; if (constant.getSort().equals(Sort.KLABEL)) { rez = new KLabelConstant(constant.getValue()); } else { rez = Token.kAppOf(constant.getSort(), constant.getValue()); } rez.setLocation(constant.getLocation()); rez.setSource(constant.getSource()); rez.copyAttributesFrom(constant); return this.visitNode(rez); }
Source:
private void addEntryToJar(JarEntrySupplier entrySupplier, CustomJarOutputStream jar) throws IOException { CustomZipEntry entry = entrySupplier.getEntry(); String entryName = entry.getName(); if (JarFile.MANIFEST_NAME.equals(entryName)) { return; } if (removeEntryPredicate.test(entrySupplier.getEntry())) { return; } mkdirs(getParentDir(entryName), jar); if (!isDuplicateAllowed(entryName) && !alreadyAddedEntries.add(entryName)) { if (!entryName.endsWith("/")) { observer.onDuplicateEntry(String.valueOf(outputFile), entrySupplier); } return; } if (isService(entryName)) { try (InputStream entryInputStream = entrySupplier.getInputStreamSupplier().get()) { if (entryInputStream != null) { Set<String> existingServices = services.getOrDefault(entryName, new LinkedHashSet<>()); existingServices.add( CharStreams.toString(new InputStreamReader(entryInputStream, Charsets.UTF_8))); services.putIfAbsent(entryName, existingServices); } } return; } jar.putNextEntry(entry); try (InputStream entryInputStream = entrySupplier.getInputStreamSupplier().get()) { if (entryInputStream != null) { ByteStreams.copy(entryInputStream, jar); } } jar.closeEntry(); }

Target:
private void addEntryToJar(JarEntrySupplier entrySupplier, CustomJarOutputStream jar) throws IOException { CustomZipEntry entry = entrySupplier.getEntry(); String entryName = entry.getName(); if (JarFile.MANIFEST_NAME.equals(entryName)) { return; } if (removeEntryPredicate.test(entrySupplier.getEntry())) { return; } mkdirs(getParentDir(entryName), jar); if (!isDuplicateAllowed(entryName) && !alreadyAddedEntries.add(entryName)) { if (!entryName.endsWith("/")) { observer.onDuplicateEntry(String.valueOf(outputFile), entrySupplier); } return; } if (isService(entryName)) { try (InputStream entryInputStream = Preconditions.checkNotNull(entrySupplier.getInputStreamSupplier().get())) { Set<String> existingServices = services.computeIfAbsent(entryName, (m) -> new LinkedHashSet<>()); existingServices.add( CharStreams.toString(new InputStreamReader(entryInputStream, Charsets.UTF_8))); } return; } jar.putNextEntry(entry); try (InputStream entryInputStream = entrySupplier.getInputStreamSupplier().get()) { if (entryInputStream != null) { ByteStreams.copy(entryInputStream, jar); } } jar.closeEntry(); }
Source:
protected void migrateData(ReviewDb db, UpdateUI ui) throws SQLException { List<String> toCalc = new ArrayList<String>(1000); PreparedStatement selectStmt = ((JdbcSchema) db).getConnection().prepareStatement( "SELECT sort_key FROM changes WHERE sort_key_desc IS NULL" + " OR sort_key_desc='';"); selectStmt.setMaxRows(1000); PreparedStatement updateStmt = ((JdbcSchema) db).getConnection().prepareStatement( "UPDATE changes SET sort_key_desc = ? WHERE sort_key = ?;"); try { while (true) { ResultSet rs = selectStmt.executeQuery(); try { while (rs.next()) { toCalc.add(rs.getString(1)); } } finally { rs.close(); } if (toCalc.isEmpty()) break; for (String s : toCalc) { String sortKeyDesc = Long.toHexString(-1l - Long.parseLong(s, 16)); updateStmt.setString(1, sortKeyDesc); updateStmt.setString(2, s); updateStmt.addBatch(); } updateStmt.executeBatch(); toCalc.clear(); } } finally { updateStmt.close(); selectStmt.close(); } }

Target:
protected void migrateData(ReviewDb db, UpdateUI ui) throws SQLException { List<ToUpdate> changes = new ArrayList<ToUpdate>(MAX_SCAN_SIZE); PreparedStatement selectStmt = ((JdbcSchema) db).getConnection().prepareStatement( "SELECT change_id, sort_key FROM changes" + " WHERE sort_key_desc IS NULL OR sort_key_desc=''"); selectStmt.setMaxRows(MAX_SCAN_SIZE); PreparedStatement updateStmt = ((JdbcSchema) db).getConnection().prepareStatement( "UPDATE changes SET sort_key_desc = ? WHERE change_id = ?"); try { while (true) { ResultSet rs = selectStmt.executeQuery(); try { while (rs.next() && changes.size() < MAX_SCAN_SIZE) { changes.add(new ToUpdate(rs.getInt(1), rs.getString(2))); } } finally { rs.close(); } if (changes.isEmpty()) { break; } int batchSize = 0; for (ToUpdate u : changes) { String desc = Long.toHexString(-1l - Long.parseLong(u.sortKey, 16)); updateStmt.setString(1, desc); updateStmt.setInt(2, u.id); updateStmt.addBatch(); batchSize++; if (batchSize >= 200) { updateStmt.executeBatch(); batchSize = 0; } } if (batchSize > 0) { updateStmt.executeBatch(); } changes.clear(); } } finally { updateStmt.close(); selectStmt.close(); } }
Source:
private void testGetOnRecoveryNode(Map<BlobId, Integer> blobIdToSizeMap) throws IOException { BlockingChannel channel = ServerTestUtil.getBlockingChannelBasedOnPortType(recoveryNodePort, "localhost", null, null); channel.connect(); AtomicInteger correlationIdGenerator = new AtomicInteger(0); List<PartitionRequestInfo> partitionRequestInfoList = Collections.singletonList(new PartitionRequestInfo(partitionId, blobIds)); GetRequest getRequest = new GetRequest(correlationIdGenerator.incrementAndGet(), GetRequest.Replication_Client_Id_Prefix + recoveryNode.getHostname(), MessageFormatFlags.All, partitionRequestInfoList, new ReplicationConfig(new VerifiableProperties(recoveryProperties)).replicationIncludeAll ? GetOption.Include_All : GetOption.None); channel.send(getRequest); GetResponse getResponse = GetResponse.readFrom(new DataInputStream(channel.receive().getInputStream()), recoveryCluster.getClusterMap()); for (PartitionResponseInfo partitionResponseInfo : getResponse.getPartitionResponseInfoList()) { assertEquals("Error in getting the recovered blobs", ServerErrorCode.No_Error, partitionResponseInfo.getErrorCode()); for (MessageInfo messageInfo : partitionResponseInfo.getMessageInfoList()) { assertEquals(blobIdToSizeMap.get(messageInfo.getStoreKey()) + 270, messageInfo.getSize()); } } }

Target:
private void testGetOnRecoveryNode(Map<BlobId, Integer> blobIdToSizeMap) throws IOException { BlockingChannel channel = ServerTestUtil.getBlockingChannelBasedOnPortType(recoveryNodePort, "localhost", null, null); channel.connect(); AtomicInteger correlationIdGenerator = new AtomicInteger(0); List<PartitionRequestInfo> partitionRequestInfoList = Collections.singletonList(new PartitionRequestInfo(partitionId, blobIds)); GetRequest getRequest = new GetRequest(correlationIdGenerator.incrementAndGet(), GetRequest.Replication_Client_Id_Prefix + recoveryNode.getHostname(), MessageFormatFlags.All, partitionRequestInfoList, new ReplicationConfig(new VerifiableProperties(recoveryProperties)).replicationIncludeAll ? GetOption.Include_All : GetOption.None); channel.send(getRequest); GetResponse getResponse = GetResponse.readFrom(new DataInputStream(channel.receive().getInputStream()), recoveryCluster.getClusterMap()); for (PartitionResponseInfo partitionResponseInfo : getResponse.getPartitionResponseInfoList()) { assertEquals("Error in getting the recovered blobs", ServerErrorCode.No_Error, partitionResponseInfo.getErrorCode()); for (MessageInfo messageInfo : partitionResponseInfo.getMessageInfoList()) { assertEquals(blobIdToSizeMap.get((BlobId) messageInfo.getStoreKey()) + 270, messageInfo.getSize()); } } }
Source:
public byte[] getCacheKey() { byte[] fieldNameBytes = StringUtils.toUtf8WithNullToEmpty(fieldName); byte[] expressionBytes = StringUtils.toUtf8WithNullToEmpty(expression); return ByteBuffer.allocate(2 + fieldNameBytes.length + expressionBytes.length) .put(AggregatorUtil.DOUBLE_ANY_CACHE_TYPE_ID) .put(fieldNameBytes) .put(AggregatorUtil.STRING_SEPARATOR) .put(expressionBytes) .array(); }

Target:
public byte[] getCacheKey() { return new CacheKeyBuilder(AggregatorUtil.DOUBLE_ANY_CACHE_TYPE_ID) .appendString(fieldName) .appendString(expression) .build(); }
Source:
public void init(OrganizationalUnitsScreen presenter) { this.presenter = presenter; if (!presenter.canCreateOrganizationalUnit()) { createOrganizationalUnit.setHidden(true); } else { createOrganizationalUnit.setTextContent(ts.format(LibraryConstants.CreateOrganizationalUnit, translationUtils.getOrganizationalUnitAliasInSingular())); } title.setTextContent(translationUtils.getOrganizationalUnitAliasInPlural()); filterName.setAttribute("placeholder", ts.getTranslation(LibraryConstants.FilterByName)); cardByOrganizationalUnitIdentifier = new HashMap<>(); }

Target:
public void init(OrganizationalUnitsScreen presenter) { this.presenter = presenter; createOrganizationalUnit.setTextContent(ts.format(LibraryConstants.CreateOrganizationalUnit, translationUtils.getOrganizationalUnitAliasInSingular())); title.setTextContent(translationUtils.getOrganizationalUnitAliasInPlural()); filterName.setAttribute("placeholder", ts.getTranslation(LibraryConstants.FilterByName)); }
Source:
public void close() throws IOException { socket.close(); }

Target:
public void close() throws IOException { if (socket == null) return; socket.close(); }
Source:
private void send(final String destId, final AvroElasticMemoryMessage msg) { LOG.entering(ElasticMemoryMsgSenderImpl.class.getSimpleName(), "send", new Object[]{destId, msg}); final Connection conn = emNetworkSetup.getConnectionFactory() .newConnection(identifierFactory.getNewInstance(destId)); try { conn.open(); conn.write(msg); } catch (final NetworkException ex) { throw new RuntimeException("NetworkException", ex); } LOG.exiting(ElasticMemoryMsgSenderImpl.class.getSimpleName(), "send", new Object[] { destId, msg }); }

Target:
private void send(final String destId, final AvroElasticMemoryMessage msg) { LOG.entering(ElasticMemoryMsgSenderImpl.class.getSimpleName(), "send", new Object[]{destId, msg}); final Connection<AvroElasticMemoryMessage> conn = emNetworkSetup.getConnectionFactory() .newConnection(identifierFactory.getNewInstance(destId)); try { conn.open(); conn.write(msg); } catch (final NetworkException ex) { throw new RuntimeException("NetworkException", ex); } LOG.exiting(ElasticMemoryMsgSenderImpl.class.getSimpleName(), "send", new Object[] { destId, msg }); }
Source:
private void setupParams() throws ServerConnectorException { fileURI = fileProperties.get(Constants.TRANSPORT_FILE_FILE_URI); if (fileURI == null) { throw new ServerConnectorException(Constants.TRANSPORT_FILE_FILE_URI + " is a " + "mandatory parameter for " + Constants.PROTOCOL_NAME + " transport."); } if (fileURI.trim().equals("")) { throw new ServerConnectorException(Constants.TRANSPORT_FILE_FILE_URI + " parameter " + "cannot be empty for " + Constants.PROTOCOL_NAME + " transport."); } String timeOut = fileProperties.get(Constants.FILE_ACKNOWLEDGEMENT_TIME_OUT); if (timeOut != null) { try { timeOutInterval = Long.parseLong(timeOut); } catch (NumberFormatException e) { log.error("Provided " + Constants.FILE_ACKNOWLEDGEMENT_TIME_OUT + " is invalid. " + "Using the default callback timeout, " + timeOutInterval + " milliseconds", e); } } String strDeleteIfNotAck = fileProperties.get(Constants.FILE_DELETE_IF_NOT_ACKNOWLEDGED); if (strDeleteIfNotAck != null) { try { deleteIfNotAck = Boolean.parseBoolean(strDeleteIfNotAck); } catch (RuntimeException re) { log.warn(Constants.FILE_DELETE_IF_NOT_ACKNOWLEDGED + " parameter should be either " + "\"true\" or \"false\". Found: " + strDeleteIfNotAck + ". Assigning default value \"false\".", re); } } }

Target:
private void setupParams() throws ServerConnectorException { fileURI = fileProperties.get(Constants.TRANSPORT_FILE_FILE_URI); if (fileURI == null) { throw new ServerConnectorException(Constants.TRANSPORT_FILE_FILE_URI + " is a " + "mandatory parameter for " + Constants.PROTOCOL_NAME + " transport."); } if (fileURI.trim().equals("")) { throw new ServerConnectorException(Constants.TRANSPORT_FILE_FILE_URI + " parameter " + "cannot be empty for " + Constants.PROTOCOL_NAME + " transport."); } String timeOut = fileProperties.get(Constants.FILE_ACKNOWLEDGEMENT_TIME_OUT); if (timeOut != null) { try { timeOutInterval = Long.parseLong(timeOut); } catch (NumberFormatException e) { log.error("Provided " + Constants.FILE_ACKNOWLEDGEMENT_TIME_OUT + " is invalid. " + "Using the default callback timeout, " + timeOutInterval + " milliseconds", e); } } String strDeleteIfNotAck = fileProperties.get(Constants.FILE_DELETE_IF_NOT_ACKNOWLEDGED); if (strDeleteIfNotAck != null) { deleteIfNotAck = Boolean.parseBoolean(strDeleteIfNotAck); } }
Source:
public SparkRunner(String configurationFilePath, String jobFilePath, String resultFilePath) throws IOException { try { _hadoopConfigurationDirectory = HadoopUtils.getHadoopConfigurationDirectoryToUse(); _hadoopDefaultFS = FileSystem.newInstance(HadoopUtils.getHadoopConfiguration(_hadoopConfigurationDirectory)); } catch (IOException e) { throw new IllegalStateException("Could not create Hadoop filesystem", e); } _applicationDriver = new ApplicationDriver(_hadoopDefaultFS.getUri(), DATACLEANER_LIB_DIR); _configurationFile = findFile(configurationFilePath, true); _jobFile = findFile(jobFilePath, true); if(resultFilePath != null) { _resultFile = findFile(resultFilePath, false); } else { _resultFile = null; } }

Target:
public SparkRunner(String configurationFilePath, String jobFilePath, String resultFilePath) throws IOException { try { _hadoopConfigurationDirectory = HadoopUtils.getHadoopConfigurationDirectoryToUse(); _hadoopDefaultFS = HadoopUtils.getFileSystem(); } catch (IOException e) { throw new IllegalStateException("Could not create Hadoop filesystem", e); } _applicationDriver = new ApplicationDriver(_hadoopDefaultFS.getUri(), DATACLEANER_LIB_DIR); _configurationFile = findFile(configurationFilePath, true); _jobFile = findFile(jobFilePath, true); if(resultFilePath != null) { _resultFile = findFile(resultFilePath, false); } else { _resultFile = null; } }
Source:
public <T extends Event> EventQueue<T> lookup(String name, String scope, boolean autoCreate) { final boolean bAppScope = EventQueues.APPLICATION.equals(scope); final boolean bSessionScope = EventQueues.SESSION.equals(scope); if (bAppScope || bSessionScope) { if (bSessionScope && Sessions.getCurrent() == null) throw new IllegalStateException("Current session is not available"); return lookup0(name, bAppScope ? (Scope) WebApps.getCurrent() : Sessions.getCurrent(), autoCreate); } else if (EventQueues.DESKTOP.equals(scope)) { final Execution exec = Executions.getCurrent(); if (exec == null) throw new IllegalStateException("Not in an execution"); final Desktop desktop = exec.getDesktop(); Map<String, EventQueue<T>> eqs = cast((Map) desktop.getAttribute(ATTR_EVENT_QUEUES)); if (eqs == null) desktop.setAttribute(ATTR_EVENT_QUEUES, eqs = new HashMap<String, EventQueue<T>>(4)); EventQueue<T> eq = eqs.get(name); if (autoCreate && eq == null) eqs.put(name, eq = new DesktopEventQueue<T>()); if (log.isDebugEnabled()) { log.debug("Lookup event queue: name [{}], scope [{}], autoCreate [{}]", name, scope, autoCreate); } return eq; } else throw new UnsupportedOperationException("Unknown scope: " + scope); }

Target:
public <T extends Event> EventQueue<T> lookup(String name, String scope, boolean autoCreate) { final boolean bAppScope = EventQueues.APPLICATION.equals(scope); final boolean bSessionScope = EventQueues.SESSION.equals(scope); if (bSessionScope && Sessions.getCurrent() == null) { throw new IllegalStateException("Current session is not available"); } else if (bAppScope || bSessionScope) { return lookup0(name, bAppScope ? (Scope) WebApps.getCurrent() : Sessions.getCurrent(), autoCreate); } else if (EventQueues.DESKTOP.equals(scope)) { final Execution exec = Executions.getCurrent(); if (exec == null) throw new IllegalStateException("Not in an execution"); final Desktop desktop = exec.getDesktop(); Map<String, EventQueue<T>> eqs = cast((Map) desktop.getAttribute(ATTR_EVENT_QUEUES)); if (eqs == null) desktop.setAttribute(ATTR_EVENT_QUEUES, eqs = new HashMap<String, EventQueue<T>>(4)); EventQueue<T> eq = eqs.get(name); if (autoCreate && eq == null) eqs.put(name, eq = new DesktopEventQueue<T>()); if (log.isDebugEnabled()) { log.debug("Lookup event queue: name [{}], scope [{}], autoCreate [{}]", name, scope, autoCreate); } return eq; } else throw new UnsupportedOperationException("Unknown scope: " + scope); }
Source:
public Collection<? extends Action> getProjectActions() { return jacocoProjectAction != null ? Arrays.asList(jacocoProjectAction) : Collections.emptyList(); }

Target:
public Collection<? extends Action> getProjectActions() { return jacocoProjectAction != null ? Collections.singletonList(jacocoProjectAction) : Collections.emptyList(); }
Source:
public List<KiePMMLModel> getModelsFromPlugin(String factoryClassName, String packageName, InputStream inputStream, Object kbuilder) { logger.trace("getModels {}", inputStream, kbuilder); try { PMML commonPMMLModel = KiePMMLUtil.load(inputStream); Set<String> expectedClasses = commonPMMLModel.getModels() .stream() .map(model -> packageName + "." + getSanitizedClassName(model.getModelName())) .collect(Collectors.toSet()); List<KiePMMLModel> toReturn = getModelsFromPlugin(packageName, commonPMMLModel, kbuilder); Set<String> generatedClasses = new HashSet<>(); toReturn.forEach(kiePMMLModel -> { if (kiePMMLModel instanceof HasSourcesMap) { generatedClasses.addAll(((HasSourcesMap) kiePMMLModel).getSourcesMap().keySet()); } else { generatedClasses.add(kiePMMLModel.getClass().getName()); } }); if (!generatedClasses.containsAll(expectedClasses)) { expectedClasses.removeAll(generatedClasses); String missingClasses = String.join(", ", expectedClasses); throw new KiePMMLException("Expected generated class " + missingClasses + " not found"); } Map<String, String> factorySourceMap = getFactorySourceCode(factoryClassName, packageName, expectedClasses); KiePMMLFactoryModel kiePMMLFactoryModel = new KiePMMLFactoryModel(factoryClassName, packageName, factorySourceMap); toReturn.add(kiePMMLFactoryModel); return toReturn; } catch (KiePMMLInternalException e) { throw new KiePMMLException("KiePMMLInternalException", e); } catch (KiePMMLException e) { throw e; } catch (Exception e) { throw new ExternalException("ExternalException", e); } }

Target:
public List<KiePMMLModel> getModelsFromPlugin(String factoryClassName, String packageName, InputStream inputStream, Object kbuilder) { logger.trace("getModels {}", inputStream, kbuilder); try { PMML commonPMMLModel = KiePMMLUtil.load(inputStream); Set<String> expectedClasses = commonPMMLModel.getModels() .stream() .map(model -> packageName + "." + getSanitizedClassName(model.getModelName())) .collect(Collectors.toSet()); List<KiePMMLModel> toReturn = getModelsFromPlugin(packageName, commonPMMLModel, kbuilder); Set<String> generatedClasses = new HashSet<>(); toReturn.forEach(kiePMMLModel -> { if (kiePMMLModel instanceof HasSourcesMap) { generatedClasses.addAll(((HasSourcesMap) kiePMMLModel).getSourcesMap().keySet()); } else { throw new KiePMMLException(String.format("Expecting %s at this phase", HasSourcesMap.class.getCanonicalName())); } }); if (!generatedClasses.containsAll(expectedClasses)) { expectedClasses.removeAll(generatedClasses); String missingClasses = String.join(", ", expectedClasses); throw new KiePMMLException("Expected generated class " + missingClasses + " not found"); } Map<String, String> factorySourceMap = getFactorySourceCode(factoryClassName, packageName, expectedClasses); KiePMMLFactoryModel kiePMMLFactoryModel = new KiePMMLFactoryModel(factoryClassName, packageName, factorySourceMap); toReturn.add(kiePMMLFactoryModel); return toReturn; } catch (KiePMMLInternalException e) { throw new KiePMMLException("KiePMMLInternalException", e); } catch (KiePMMLException e) { throw e; } catch (Exception e) { throw new ExternalException("ExternalException", e); } }
Source:
static public String sendHttpDeleteRequest(String url) { String response = null; try { return HttpUtil.executeUrl("DELETE", url, 1000); } catch (IOException e) { logger.error("Fatal transport error: {}",e); } return response; }

Target:
static public String sendHttpDeleteRequest(String url) { String response = null; try { response = HttpUtil.executeUrl("DELETE", url, 1000); } catch (IOException e) { logger.error("Fatal transport error: {}", e); } return response; }
Source:
private String getActualNativeSRSCode(ResourceInfo resourceInfo) { try { if (resourceInfo instanceof FeatureTypeInfo) { FeatureTypeInfo ft = (FeatureTypeInfo) resourceInfo; return "EPSG:" + CRS.lookupEpsgCode( ft.getFeatureSource(null, null).getInfo().getCRS(), false); } else { CatalogBuilder cb = new CatalogBuilder(GeoServerApplication.get().getCatalog()); cb.setStore(resourceInfo.getStore()); ReferencedEnvelope bounds = cb.getNativeBounds(resourceInfo); return "EPSG:" + CRS.lookupEpsgCode(bounds.getCoordinateReferenceSystem(), false); } } catch (Exception e) { LOGGER.log( Level.SEVERE, "Error getting actual Native SRS code for resource " + resourceInfo.getNativeName(), e); } return ""; }

Target:
private String getActualNativeSRSCode(ResourceInfo resourceInfo) { try { CatalogBuilder cb = new CatalogBuilder(GeoServerApplication.get().getCatalog()); cb.setStore(resourceInfo.getStore()); return "EPSG:" + CRS.lookupEpsgCode(cb.getNativeCRS(resourceInfo), false); } catch (Exception e) { LOGGER.log( Level.SEVERE, "Error getting actual Native SRS code for resource " + resourceInfo.getNativeName(), e); } return ""; }
Source:
private void setLocation(@Nullable Place place) { if (mPostLocation == null) { mPostLocation = new PostLocation(); } if (place == null) { mLocationTextView.setText(R.string.post_settings_not_set); mPost.clearLocation(); mPostLocation = null; return; } mPostLocation.setLatitude(place.getLatLng().latitude); mPostLocation.setLongitude(place.getLatLng().longitude); mPost.setLocation(mPostLocation); mLocationTextView.setText(place.getAddress()); }

Target:
private void setLocation(@Nullable Place place) { if (place == null) { mPost.clearLocation(); mPostLocation = null; return; } if (mPostLocation == null) { mPostLocation = new PostLocation(); } mPostLocation.setLatitude(place.getLatLng().latitude); mPostLocation.setLongitude(place.getLatLng().longitude); mPost.setLocation(mPostLocation); mLocationTextView.setText(place.getAddress()); }
Source:
public void testStartingOfflineServeres() throws Exception { VoldemortServer server = getVoldemortServer(0); server.goOffline(); server.stop(); String baseDirPath = server.getVoldemortConfig().getVoldemortHome(); String parentDirPath = Paths.get(baseDirPath).getParent().toString(); List<StoreDefinition> storeDefs = server.getMetadataStore().getStoreDefList(); try { VoldemortConfig config = ServerTestUtils.createServerConfigWithDefs(useNio, 0, parentDirPath, cluster, storeDefs, new Properties()); VoldemortServer newServer = ServerTestUtils.startVoldemortServer(socketStoreFactory, config, cluster); fail("should have thrown an connection exception"); }catch (VoldemortException e){ assertEquals(UnreachableStoreException.class, e.getClass()); } }

Target:
public void testStartingOfflineServeres() throws Exception { VoldemortServer server = getVoldemortServer(0); server.goOffline(); server.stop(); verifyNewServer(server); }
Source:
private void peekEventsFromIncompleteTransactions(List<AsyncEvent> batch, Set<TransactionId> incompleteTransactionIdsInBatch, long lastKey) { if (!isGroupTransactionEvents()) { return; } if (areAllTransactionsCompleteInBatch(incompleteTransactionIdsInBatch)) { return; } for (TransactionId transactionId : incompleteTransactionIdsInBatch) { boolean presentLastEventInTransaction = false; final int maxRetries = 2; int retries = 0; long lastKeyForTransaction = lastKey; while (!presentLastEventInTransaction && ++retries <= maxRetries) { EventsAndLastKey eventsAndKey = peekEventsWithTransactionId(transactionId, lastKeyForTransaction); for (Object object : eventsAndKey.events) { GatewaySenderEventImpl event = (GatewaySenderEventImpl) object; batch.add(event); presentLastEventInTransaction = event.isLastEventInTransaction(); if (logger.isDebugEnabled()) { logger.debug( "Peeking extra event: {}, isLastEventInTransaction: {}, batch size: {}", event.getKey(), event.isLastEventInTransaction(), batch.size()); } } lastKeyForTransaction = eventsAndKey.lastKey; } if (retries >= maxRetries) { logger.warn("Not able to retrieve all events for transaction after retries", transactionId, retries); } } }

Target:
private void peekEventsFromIncompleteTransactions(List<AsyncEvent> batch, Set<TransactionId> incompleteTransactionIdsInBatch, long lastKey) { if (!mustGroupTransactionEvents()) { return; } if (areAllTransactionsCompleteInBatch(incompleteTransactionIdsInBatch)) { return; } for (TransactionId transactionId : incompleteTransactionIdsInBatch) { boolean areAllEventsForTransactionInBatch = false; int retries = 0; long lastKeyForTransaction = lastKey; while (!areAllEventsForTransactionInBatch && retries++ < GET_TRANSACTION_EVENTS_FROM_QUEUE_RETRIES) { EventsAndLastKey eventsAndKey = peekEventsWithTransactionId(transactionId, lastKeyForTransaction); for (Object object : eventsAndKey.events) { GatewaySenderEventImpl event = (GatewaySenderEventImpl) object; batch.add(event); areAllEventsForTransactionInBatch = event.isLastEventInTransaction(); if (logger.isDebugEnabled()) { logger.debug( "Peeking extra event: {}, isLastEventInTransaction: {}, batch size: {}", event.getKey(), event.isLastEventInTransaction(), batch.size()); } } lastKeyForTransaction = eventsAndKey.lastKey; } if (!areAllEventsForTransactionInBatch) { logger.warn("Not able to retrieve all events for transaction after tries", transactionId, retries); } } }
Source:
private void iterateThrough(Iterator<UIWidget> widgets) { modifyingList = true; while (widgets.hasNext()) { UIWidget next = widgets.next(); boolean setParent = false; if (next instanceof ScrollableArea) { parentToSet = (ScrollableArea) next; setParent = true; } else if (next instanceof UILayout || next instanceof WidgetWithOrder) { setParent = true; } if (next instanceof WidgetWithOrder) { TabbingManager.addToWidgetsList((WidgetWithOrder) next); TabbingManager.addToUsedNums(((WidgetWithOrder) next).order); if (setParent) { ((WidgetWithOrder) next).setParent(parentToSet); } } if (next.iterator().hasNext()) { iterateThrough(next.iterator()); } else if (next instanceof UIRadialRing) { Iterator<UIRadialSection> iter = ((UIRadialRing) next).getSections().iterator(); while (iter.hasNext()) { next = iter.next(); TabbingManager.addToWidgetsList((WidgetWithOrder) next); TabbingManager.addToUsedNums(((WidgetWithOrder) next).order); if (setParent) { ((WidgetWithOrder) next).setParent(parentToSet); } } } } modifyingList = false; }

Target:
private void iterateThrough(Iterator<UIWidget> widgets) { modifyingList = true; while (widgets.hasNext()) { UIWidget next = widgets.next(); boolean setParent = false; if (next instanceof ScrollableArea) { parentToSet = (ScrollableArea) next; } if (next instanceof WidgetWithOrder) { TabbingManager.addToWidgetsList((WidgetWithOrder) next); TabbingManager.addToUsedNums(((WidgetWithOrder) next).order); ((WidgetWithOrder) next).setParent(parentToSet); } if (next.iterator().hasNext()) { iterateThrough(next.iterator()); } else if (next instanceof UIRadialRing) { Iterator<UIRadialSection> iter = ((UIRadialRing) next).getSections().iterator(); while (iter.hasNext()) { next = iter.next(); TabbingManager.addToWidgetsList((WidgetWithOrder) next); TabbingManager.addToUsedNums(((WidgetWithOrder) next).order); if (setParent) { ((WidgetWithOrder) next).setParent(parentToSet); } } } } modifyingList = false; }
Source:
public void countUnicodePointsOnce() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(LineLengthCheck.class); checkConfig.addAttribute("max", "100"); System.setProperty("file.encoding", StandardCharsets.UTF_8.name()); final String[] expected = { "6: " + getCheckMessage(MSG_KEY, 100, 136), "7: " + getCheckMessage(MSG_KEY, 100, 136), }; verify(checkConfig, getPath("InputLineLengthUnicodeChars.java"), expected); }

Target:
public void countUnicodePointsOnce() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(LineLengthCheck.class); checkConfig.addAttribute("max", "100"); final DefaultConfiguration checkerConfig = createRootConfig(checkConfig); checkerConfig.addAttribute("charset", StandardCharsets.UTF_8.name()); final String[] expected = { "6: " + getCheckMessage(MSG_KEY, 100, 136), "7: " + getCheckMessage(MSG_KEY, 100, 136), }; verify(checkerConfig, getPath("InputLineLengthUnicodeChars.java"), expected); }
Source:
private void performGet(HttpClient client, HttpHost httpHost, String url, int expectedStatus) throws IOException { HttpGet getProject = new HttpGet(url); getProject.addHeader("Accept", ContentType.APPLICATION_JSON.getMimeType()); HttpResponse getProjectResponse = client.execute(httpHost, getProject); assertEquals(expectedStatus, getProjectResponse.getStatusLine().getStatusCode()); EntityUtils.consume(getProjectResponse.getEntity()); }

Target:
private void performGet(HttpClient client, HttpHost httpHost, String url, int expectedStatus) throws IOException { HttpGet getProject = new HttpGet(url); try { getProject.addHeader("Accept", ContentType.APPLICATION_JSON.getMimeType()); HttpResponse getProjectResponse = client.execute(httpHost, getProject); assertEquals(expectedStatus, getProjectResponse.getStatusLine().getStatusCode()); EntityUtils.consume(getProjectResponse.getEntity()); } finally { getProject.releaseConnection(); } }
Source:
public SolNullOptionalException() { super("Some object, which contained a null where by design it shouldn't have, caused a crash to the game. Please report this; there is some major design flaw within the game." ); }

Target:
public SolNullOptionalException() { super("Some object, which contained a null where by design it shouldn't have, caused the game to crash. Please report this, since this means there is some design flaw within the game." ); }
Source:
public String toString(FlowMatch wcmatch) { if (wcmatch.getEtherType() == ARP.ETHERTYPE) return "ArpOp=" + wcmatch.networkProto; else return toString() + "=" + getNetworkProtocolAsString(wcmatch.networkProto); }

Target:
public String toString(FlowMatch wcmatch) { return toString() + "=" + wcmatch.inputPortNumber; }
Source:
public void test(TestHarness th) { try { foo1(); } catch (Exception e) { th.check(foo1Reached); } try { foo2(); } catch (Exception e) { th.check(foo2Reached); } }

Target:
public void test(TestHarness th) { try { foo1(); th.fail(); } catch (Exception e) { th.check(foo1Reached); } try { foo2(); th.fail(); } catch (Exception e) { th.check(foo2Value, 20); } }
Source:
public PyQualifiedExpressionTree qualifiedExpression(AstNode astNode) { PyExpressionTree qualifier = expression(astNode.getFirstChild()); List<AstNode> names = astNode.getChildren(PythonGrammar.NAME); names.remove(names.size() - 1); PyNameTree name = name(astNode.getLastChild()); for (AstNode nameNode : names) { qualifier = new PyQualifiedExpressionTreeImpl(astNode, name(nameNode), qualifier); } return new PyQualifiedExpressionTreeImpl(astNode, name, qualifier); }

Target:
public PyQualifiedExpressionTree qualifiedExpression(AstNode astNode) { PyExpressionTree qualifier = expression(astNode.getFirstChild()); List<AstNode> names = astNode.getChildren(PythonGrammar.NAME); AstNode lastNameNode = astNode.getLastChild(); for (AstNode nameNode : names) { if (nameNode != lastNameNode) { qualifier = new PyQualifiedExpressionTreeImpl(astNode, name(nameNode), qualifier, nameNode.getPreviousSibling().getToken()); } } return new PyQualifiedExpressionTreeImpl(astNode, name(lastNameNode), qualifier, lastNameNode.getPreviousSibling().getToken()); }
Source:
public void addGatewayPublishedAPIDetails(String APIId, String APIName, String version, String tenantDomain) throws APIManagementException { try (Connection connection = GatewayArtifactsMgtDBUtil.getArtifactSynchronizerConnection(); PreparedStatement statement = connection.prepareStatement(SQLConstants.ADD_GW_PUBLISHED_API_DETAILS)) { statement.setString(1, APIId); statement.setString(2, APIName); statement.setString(3, version); statement.setString(4, tenantDomain); statement.executeUpdate(); } catch (SQLException e) { handleException("Failed to add API details for " + APIName, e); } }

Target:
public void addGatewayPublishedAPIDetails(String APIId, String APIName, String version, String tenantDomain) throws APIManagementException { try (Connection connection = GatewayArtifactsMgtDBUtil.getArtifactSynchronizerConnection()) { connection.setAutoCommit(false); try (PreparedStatement statement = connection .prepareStatement(SQLConstants.ADD_GW_PUBLISHED_API_DETAILS)) { statement.setString(1, APIId); statement.setString(2, APIName); statement.setString(3, version); statement.setString(4, tenantDomain); statement.executeUpdate(); } connection.commit(); } catch (SQLException e) { handleException("Failed to add API details for " + APIName, e); } }
Source:
public WebsocketSession( GatewayMessageCodec messageCodec, HttpServerRequest httpRequest, WebsocketInbound inbound, WebsocketOutbound outbound) { this.messageCodec = messageCodec; this.id = Integer.toHexString(System.identityHashCode(this)); HttpHeaders httpHeaders = httpRequest.requestHeaders(); this.contentType = Optional.ofNullable(httpHeaders.get(CONTENT_TYPE)).orElse(DEFAULT_CONTENT_TYPE); this.inbound = (WebsocketInbound) inbound.withConnection(connection -> connection.onDispose(this::clearSubscriptions)); this.outbound = outbound; DirectProcessor<ByteBuf> outboundProcessor = DirectProcessor.create(); outboundSink = outboundProcessor.sink(); this.outbound .options(SendOptions::flushOnEach) .sendObject(outboundProcessor.map(TextWebSocketFrame::new)) .then() .subscribe( null, th -> LOGGER.error("Exception on sending for session={}, cause: {}", id, th)); }

Target:
public WebsocketSession( GatewayMessageCodec messageCodec, HttpServerRequest httpRequest, WebsocketInbound inbound, WebsocketOutbound outbound) { this.messageCodec = messageCodec; this.id = Integer.toHexString(System.identityHashCode(this)); HttpHeaders httpHeaders = httpRequest.requestHeaders(); this.contentType = Optional.ofNullable(httpHeaders.get(CONTENT_TYPE)).orElse(DEFAULT_CONTENT_TYPE); this.inbound = (WebsocketInbound) inbound.withConnection(connection -> connection.onDispose(this::clearSubscriptions)); this.outbound = outbound; UnicastProcessor<ByteBuf> outboundProcessor = UnicastProcessor.create(); outboundSink = outboundProcessor.sink(); this.outbound .options(SendOptions::flushOnEach) .sendObject(outboundProcessor.onBackpressureBuffer().map(TextWebSocketFrame::new)) .then() .subscribe( null, th -> LOGGER.error("Exception on sending for session={}, cause: {}", id, th)); }
Source:
void onRowSelected(int selectedPosition, int selectedSubPosition) { ObjectAdapter adapter = getAdapter(); if (( mRowsFragment != null && mRowsFragment.getView() != null && mRowsFragment.getView().hasFocus() && !mPendingFocusOnVideo) && (adapter == null || adapter.size() == 0 || (getVerticalGridView().getSelectedPosition() == 0 && getVerticalGridView().getSelectedSubPosition() == 0))) { showTitle(true); } else { showTitle(false); } if (adapter != null && adapter.size() > selectedPosition) { final VerticalGridView gridView = getVerticalGridView(); final int count = gridView.getChildCount(); if (count > 0) { mStateMachine.fireEvent(EVT_DETAILS_ROW_LOADED); } for (int i = 0; i < count; i++) { ItemBridgeAdapter.ViewHolder bridgeViewHolder = (ItemBridgeAdapter.ViewHolder) gridView.getChildViewHolder(gridView.getChildAt(i)); RowPresenter rowPresenter = (RowPresenter) bridgeViewHolder.getPresenter(); onSetRowStatus(rowPresenter, rowPresenter.getRowViewHolder(bridgeViewHolder.getViewHolder()), bridgeViewHolder.getLocalAdapterPosition(), selectedPosition, selectedSubPosition); } } }

Target:
void onRowSelected(int selectedPosition, int selectedSubPosition) { ObjectAdapter adapter = getAdapter(); if (( mRowsFragment != null && mRowsFragment.getView() != null && mRowsFragment.getView().hasFocus() && !mPendingFocusOnVideo) && (adapter == null || adapter.size() == 0 || (getVerticalGridView().getSelectedPosition() == 0 && getVerticalGridView().getSelectedSubPosition() == 0))) { showTitle(true); } else { showTitle(false); } if (adapter != null && adapter.size() > selectedPosition) { final VerticalGridView gridView = getVerticalGridView(); final int count = gridView.getChildCount(); if (count > 0) { mStateMachine.fireEvent(EVT_DETAILS_ROW_LOADED); } for (int i = 0; i < count; i++) { ItemBridgeAdapter.ViewHolder bridgeViewHolder = (ItemBridgeAdapter.ViewHolder) gridView.getChildViewHolder(gridView.getChildAt(i)); RowPresenter rowPresenter = (RowPresenter) bridgeViewHolder.getPresenter(); onSetRowStatus(rowPresenter, rowPresenter.getRowViewHolder(bridgeViewHolder.getViewHolder()), bridgeViewHolder.getAdapterPositionInRecyclerView(), selectedPosition, selectedSubPosition); } } }
Source:
public void logBadEmailRecord() { LOG.error("logBadEmailRecord, payeeIdL '" + payeeId + "' payment group ID: '" + paymentGroupId + "' email address: '" + emailAddress + "' disbursement number: '" + disbursementNumber + "'"); }

Target:
public void logBadEmailRecord() { LOG.error("logBadEmailRecord, payeeId: '" + payeeId + "' payment group ID: '" + paymentGroupId + "' email address: '" + emailAddress + "' disbursement number: '" + disbursementNumber + "'"); }
Source:
private void closeOpenEditorsForProject(IProject project) { final List<IEditorReference> editorsToBeClosed = new ArrayList<>(); Map<IFile, IEditorReference> fileEditors = findAllEditorReferences(); try { List<IFile> projectfiles = findAllProjectFiles(project); for (IResource resource : projectfiles) { if (fileEditors.containsKey(resource)) { editorsToBeClosed.add(fileEditors.get(resource)); } } } catch (CoreException e) { e.printStackTrace(); } if (!editorsToBeClosed.isEmpty()) { PlatformUI.getWorkbench().getDisplay() .syncExec(new Runnable() { @Override public void run() { IEditorReference[] editorToBeClosed = new IEditorReference[editorsToBeClosed .size()]; editorToBeClosed = editorsToBeClosed .toArray(editorToBeClosed); activePage.closeEditors(editorToBeClosed, true); } }); } }

Target:
private void closeOpenEditorsForProject(IProject project) { final List<IEditorReference> editorsToBeClosed = new ArrayList<>(); Map<IFile, IEditorReference> fileEditors = findAllEditorReferences(); try { List<IFile> projectfiles = findAllProjectFiles(project); for (IResource resource : projectfiles) { if (fileEditors.containsKey(resource)) { editorsToBeClosed.add(fileEditors.get(resource)); } } } catch (CoreException e) { Activator.logError("Problems during auto-close of related editors", e); } if (!editorsToBeClosed.isEmpty()) { PlatformUI.getWorkbench().getDisplay() .syncExec(new Runnable() { @Override public void run() { IEditorReference[] editorToBeClosed = new IEditorReference[editorsToBeClosed .size()]; editorToBeClosed = editorsToBeClosed .toArray(editorToBeClosed); activePage.closeEditors(editorToBeClosed, true); } }); } }