auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static List<Class> findClasses(File directory, String packageName) throws ClassNotFoundException { List<Class> classes = new ArrayList<>(); if (!directory.exists()) { return classes; } File[] files = directory.listFiles(); for (File file : files) { if (file.isDirectory()) { assert !file.getName().contains("."); classes.addAll(findClasses(file, packageName + "." + file.getName())); } else if (file.getName().endsWith(".class")) { classes.add(Class.forName(packageName + "." + file.getName().substring(0, file.getName().length() - 6))); } } return classes; }

Target:
private static List<Class> findClasses(File directory, String packageName) throws ClassNotFoundException { List<Class> classes = new ArrayList<>(); if (!directory.exists()) { return classes; } File[] files = directory.listFiles(); for (File file : files) { if (file.getName().endsWith(".class")) { classes.add(Class.forName(packageName + "." + file.getName().substring(0, file.getName().length() - ".class".length()))); } } return classes; }
Source:
private void updatePartitioning(VoltTable vt) { List<Integer> ketSet = new ArrayList<Integer>(); while (vt.advanceRow()) { if (vt.getColumnCount() == 2) { Integer key = (int)(vt.getLong("PARTITION_KEY")); ketSet.add(key); } } m_partitionKeys.set(ImmutableSet.copyOf(ketSet)); }

Target:
private void updatePartitioning(VoltTable vt) { List<Integer> keySet = new ArrayList<Integer>(); while (vt.advanceRow()) { if (vt.getColumnCount() == 2) { Integer key = (int)(vt.getLong("PARTITION_KEY")); keySet.add(key); } } m_partitionKeys.set(ImmutableSet.copyOf(keySet)); }
Source:
public void catchThrowableOfType_should_succeed_and_return_actual_instance_with_correct_class() { final Exception expected = new RuntimeException("boom!!"); Exception actual = null; try { actual = catchThrowableOfType(raisingException(expected), Exception.class); } catch (AssertionError a) { Fail.fail("catchThrowableOfType should not have asserted", a); } assertThat(actual).isSameAs(expected); }

Target:
public void catchThrowableOfType_should_succeed_and_return_actual_instance_with_correct_class() { final Exception expected = new RuntimeException("boom!!"); Exception actual = null; try { actual = catchThrowableOfType(raisingException(expected), Exception.class); } catch (AssertionError a) { fail("catchThrowableOfType should not have asserted", a); } assertThat(actual).isSameAs(expected); }
Source:
public List<Attribute> getAttributes(String entryPath, boolean isDirectory) { if (rules.isEmpty()) return Collections.emptyList(); for (int i = rules.size() - 1; i > -1; i--) { AttributesRule rule = rules.get(i); if (rule.isMatch(entryPath, isDirectory)) { return rule.getAttributes(); } } return Collections.emptyList(); }

Target:
public List<Attribute> getAttributes(String entryPath, boolean isDirectory) { if (rules.isEmpty()) return Collections.emptyList(); for (int i = rules.size() - 1; i >= 0; i--) { AttributesRule rule = rules.get(i); if (rule.isMatch(entryPath, isDirectory)) return rule.getAttributes(); } return Collections.emptyList(); }
Source:
public TaskPlatform localTaskPlatform(LocalPlatformProperties localPlatformProperties) { List<Launcher> launchers = new ArrayList<>(); Map<String, LocalDeployerProperties> localDeployerPropertiesMap = localPlatformProperties.getAccounts(); for (Map.Entry<String, LocalDeployerProperties> entry : localDeployerPropertiesMap .entrySet()) { LocalDeployerProperties localDeployerProperties = entry.getValue(); validateLauncherMaximumConcurrentTasks(entry.getKey(),"Local", localDeployerProperties.getMaximumConcurrentTasks(), localPlatformProperties.getMaximumConcurrentTasks()); LocalTaskLauncher localTaskLauncher = new LocalTaskLauncher(localDeployerProperties); Launcher launcher = new Launcher(entry.getKey(), "local", localTaskLauncher); launcher.setDescription(prettyPrintLocalDeployerProperties(entry.getValue())); launchers.add(launcher); } return new TaskPlatform("Local", launchers); }

Target:
public TaskPlatform localTaskPlatform(LocalPlatformProperties localPlatformProperties) { List<Launcher> launchers = new ArrayList<>(); Map<String, LocalDeployerProperties> localDeployerPropertiesMap = localPlatformProperties.getAccounts(); for (Map.Entry<String, LocalDeployerProperties> entry : localDeployerPropertiesMap .entrySet()) { LocalDeployerProperties localDeployerProperties = entry.getValue(); LocalTaskLauncher localTaskLauncher = new LocalTaskLauncher(localDeployerProperties); Launcher launcher = new Launcher(entry.getKey(), "local", localTaskLauncher); launcher.setDescription(prettyPrintLocalDeployerProperties(entry.getValue())); launchers.add(launcher); } return new TaskPlatform("Local", launchers); }
Source:
public SagaConfigurer<T> listenerInvocationHandler( Function<Configuration, ListenerInvocationErrorHandler> listenerInvocationErrorHandlerBuilder) { assertNonNull(listenerInvocationErrorHandlerBuilder, "Listener invocation error handler builder is not allowed to be null"); this.listenerInvocationErrorHandlerBuilder = listenerInvocationErrorHandlerBuilder; return this; }

Target:
public SagaConfigurer<T> listenerInvocationHandler( Function<Configuration, ListenerInvocationErrorHandler> listenerInvocationErrorHandlerBuilder) { assertNonNull(listenerInvocationErrorHandlerBuilder, "ListenerInvocationErrorHandler builder is not allowed to be null"); this.listenerInvocationErrorHandlerBuilder = listenerInvocationErrorHandlerBuilder; return this; }
Source:
public void validate() throws JobConfigValidationException { super.validate(); try { final JobArguments arguments = this.getJobArguments(); final String ownerKey = arguments.getAsString(OWNER_KEY); final Boolean create = arguments.getAsBoolean(CREATE); final String data = arguments.getAsString(DATA); if (ownerKey == null || ownerKey.isEmpty()) { final String errmsg = "consumer has not been set, or the provided consumer lacks a UUID"; throw new JobConfigValidationException(errmsg); } if (create == null) { final String errmsg = "create flag has not been set!"; throw new JobConfigValidationException(errmsg); } if (data == null || data.isEmpty()) { final String errmsg = "hypervisor data has not been set!"; throw new JobConfigValidationException(errmsg); } } catch (ArgumentConversionException e) { final String errmsg = "One or more required arguments are of the wrong type"; throw new JobConfigValidationException(errmsg, e); } }

Target:
public void validate() throws JobConfigValidationException { super.validate(); try { final JobArguments arguments = this.getJobArguments(); final String ownerKey = arguments.getAsString(OWNER_KEY); final Boolean create = arguments.getAsBoolean(CREATE); final String data = arguments.getAsString(DATA); if (ownerKey == null || ownerKey.isEmpty()) { final String errmsg = "owner has not been set!"; throw new JobConfigValidationException(errmsg); } if (create == null) { final String errmsg = "create flag has not been set!"; throw new JobConfigValidationException(errmsg); } if (data == null || data.isEmpty()) { final String errmsg = "hypervisor data has not been set!"; throw new JobConfigValidationException(errmsg); } } catch (ArgumentConversionException e) { final String errmsg = "One or more required arguments are of the wrong type"; throw new JobConfigValidationException(errmsg, e); } }
Source:
public void testTimerRequiresRecoveryFlagSet() throws Exception { Properties properties= new Properties(); properties.setProperty("mary", "HR"); properties.setProperty("john", "HR"); UserGroupCallback userGroupCallback = new JBossUserGroupCallbackImpl(properties); environment = RuntimeEnvironmentBuilder.Factory.get() .newDefaultBuilder() .entityManagerFactory(emf) .addAsset(ResourceFactory.newClassPathResource("org/jbpm/test/functional/timer/HumanTaskWithBoundaryTimer.bpmn"), ResourceType.BPMN2) .schedulerService(globalScheduler) .userGroupCallback(userGroupCallback) .get(); manager = getManager(environment, true); RuntimeEngine runtime = manager.getRuntimeEngine(ProcessInstanceIdContext.get()); KieSession ksession = runtime.getKieSession(); Map<String, Object> params = new HashMap<String, Object>(); params.put("test", "john"); ProcessInstance processInstance = ksession.startProcess("PROCESS_1", params); Connection connection = null; Statement stmt = null; try { connection = ((DataSource)InitialContext.doLookup("jdbc/jbpm-ds")).getConnection(); stmt = connection.createStatement(); ResultSet resultSet = stmt.executeQuery("select REQUESTS_RECOVERY from QRTZ_JOB_DETAILS"); while(resultSet.next()) { boolean requestsRecovery = resultSet.getBoolean(1); assertEquals("Requests recovery must be set to true", true, requestsRecovery); } } catch (Exception e) { logger.error("Error during test.", e); } finally { if(stmt != null) { stmt.close(); } if(connection != null) { connection.close(); } } ksession.abortProcessInstance(processInstance.getId()); manager.disposeRuntimeEngine(runtime); }

Target:
public void testTimerRequiresRecoveryFlagSet() throws Exception { Properties properties= new Properties(); properties.setProperty("mary", "HR"); properties.setProperty("john", "HR"); UserGroupCallback userGroupCallback = new JBossUserGroupCallbackImpl(properties); environment = RuntimeEnvironmentBuilder.Factory.get() .newDefaultBuilder() .entityManagerFactory(emf) .addAsset(ResourceFactory.newClassPathResource("org/jbpm/test/functional/timer/HumanTaskWithBoundaryTimer.bpmn"), ResourceType.BPMN2) .schedulerService(globalScheduler) .userGroupCallback(userGroupCallback) .get(); manager = getManager(environment, true); RuntimeEngine runtime = manager.getRuntimeEngine(ProcessInstanceIdContext.get()); KieSession ksession = runtime.getKieSession(); Map<String, Object> params = new HashMap<String, Object>(); params.put("test", "john"); ProcessInstance processInstance = ksession.startProcess("PROCESS_1", params); Connection connection = null; Statement stmt = null; try { connection = ((DataSource)InitialContext.doLookup("jdbc/jbpm-ds")).getConnection(); stmt = connection.createStatement(); ResultSet resultSet = stmt.executeQuery("select REQUESTS_RECOVERY from QRTZ_JOB_DETAILS"); while(resultSet.next()) { boolean requestsRecovery = resultSet.getBoolean(1); assertEquals("Requests recovery must be set to true", true, requestsRecovery); } } finally { if(stmt != null) { stmt.close(); } if(connection != null) { connection.close(); } } ksession.abortProcessInstance(processInstance.getId()); manager.disposeRuntimeEngine(runtime); }
Source:
private static void toStringBuilder(Map<String, ?> map, StringBuilder builder) { if (map.isEmpty()) { builder.append("{}"); return; } builder.append("{"); Iterator<? extends Map.Entry<String, ?>> iterator = map.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry<String, ?> entry = iterator.next(); builder.append(String.format("%1$s=", entry.getKey())); toStringBuilder(entry.getValue(), builder); if (iterator.hasNext()) { builder.append(", "); } } builder.append("}"); }

Target:
private static void toStringBuilder(Map<String, ?> map, StringBuilder builder) { builder.append("{"); Iterator<? extends Map.Entry<String, ?>> iterator = map.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry<String, ?> entry = iterator.next(); builder.append(String.format("%1$s=", entry.getKey())); toStringBuilder(entry.getValue(), builder); if (iterator.hasNext()) { builder.append(", "); } } builder.append("}"); }
Source:
public static boolean isInitialAckDRId(long drId) { if (drId == -1) return true; int clusterId = getClusterIdFromDRId(drId); if (clusterId >= 0 && clusterId < MAX_CLUSTER_ID) { return !((drId >>> 63) == 1L) && (getSequenceNumberFromDRId(drId) == MAX_SEQUENCE_NUMBER); } return false; }

Target:
public static boolean isInitialAckDRId(long drId) { if (drId == -1) return true; int clusterId = getClusterIdFromDRId(drId); if (clusterId >= 0 && clusterId <= MAX_CLUSTER_ID) { return ((drId >>> 63) != 1L) && (getSequenceNumberFromDRId(drId) == MAX_SEQUENCE_NUMBER); } return false; }
Source:
public SearchResponse search(IssueQuery query, SearchOptions options) { SearchRequestBuilder requestBuilder = client.prepareSearch(INDEX_TYPE_ISSUE); configureSorting(query, requestBuilder); configurePagination(options, requestBuilder); configureRouting(query, options, requestBuilder); QueryBuilder esQuery = matchAllQuery(); BoolQueryBuilder esFilter = boolQuery(); Map<String, QueryBuilder> filters = createFilters(query); for (QueryBuilder filter : filters.values()) { if (filter != null) { esFilter.must(filter); } } if (esFilter.hasClauses()) { requestBuilder.setQuery(boolQuery().must(esQuery).filter(esFilter)); } else { requestBuilder.setQuery(esQuery); } configureStickyFacets(query, options, filters, esQuery, requestBuilder); requestBuilder.setFetchSource(false); System.out.println(requestBuilder.internalBuilder()); return requestBuilder.get(); }

Target:
public SearchResponse search(IssueQuery query, SearchOptions options) { SearchRequestBuilder requestBuilder = client.prepareSearch(INDEX_TYPE_ISSUE); configureSorting(query, requestBuilder); configurePagination(options, requestBuilder); configureRouting(query, options, requestBuilder); QueryBuilder esQuery = matchAllQuery(); BoolQueryBuilder esFilter = boolQuery(); Map<String, QueryBuilder> filters = createFilters(query); for (QueryBuilder filter : filters.values()) { if (filter != null) { esFilter.must(filter); } } if (esFilter.hasClauses()) { requestBuilder.setQuery(boolQuery().must(esQuery).filter(esFilter)); } else { requestBuilder.setQuery(esQuery); } configureStickyFacets(query, options, filters, esQuery, requestBuilder); requestBuilder.setFetchSource(false); return requestBuilder.get(); }
Source:
private String getTextValue(Element element, String tagName) { NodeList hostName = element.getElementsByTagName(tagName); Element hostNameElement = (Element) hostName.item(0); NodeList hostNameNode = hostNameElement.getChildNodes(); return hostNameNode.item(0).getNodeValue().trim(); }

Target:
private String getTextValue(Element element, String tagName) { NodeList nodes = element.getElementsByTagName(tagName); Element nodeElement = (Element) nodes.item(0); NodeList nodeList = nodeElement.getChildNodes(); return nodeList.item(0).getNodeValue().trim(); }
Source:
protected AbstractNexusMojo() { getLog().warn( "" ); getLog().warn( "DEPRECATION WARNING" ); getLog().warn( "===================" ); getLog().warn( "This whole plugin has been deprecated, and is replaced with set of new Maven Plugins." ); getLog().warn( "Please update your build, and stop using this plugin altogether,"); getLog().warn( "as this plugin is about to be dropped in near future." ); getLog().warn( "" ); }

Target:
protected AbstractNexusMojo() { getLog().warn( "" ); getLog().warn( "DEPRECATION WARNING" ); getLog().warn( "===================" ); getLog().warn( "This whole plugin has been deprecated in favor of a new set of Maven Plugins." ); getLog().warn( "Please update your build, and stop using this plugin altogether,"); getLog().warn( "as this plugin is about to be dropped in near future." ); getLog().warn( "" ); }
Source:
private void checkClassField(DetailAST objBlockToken) { for (DetailAST ast = objBlockToken.getFirstChild(); ast != null; ast = ast.getNextSibling()) { if (TokenTypes.VARIABLE_DEF != ast.getType()) { continue; } final DetailAST modifiersToken = ast.findFirstToken(TokenTypes.MODIFIERS); if (!modifiersToken.branchContains(TokenTypes.FINAL)) { log(modifiersToken, String.format("The variable field ''%s'' of @ServiceClient should be final. The class annotated with @ServiceClient supposed to be immutable.", ast.findFirstToken(TokenTypes.IDENT).getText())); } } }

Target:
private void checkClassField(DetailAST objBlockToken) { for (DetailAST ast = objBlockToken.getFirstChild(); ast != null; ast = ast.getNextSibling()) { if (TokenTypes.VARIABLE_DEF != ast.getType()) { continue; } final DetailAST modifiersToken = ast.findFirstToken(TokenTypes.MODIFIERS); if (!modifiersToken.branchContains(TokenTypes.FINAL)) { log(modifiersToken, String.format("The variable field ''%s'' of class ''%s'' should be final. Classes annotated with @ServiceClient are supposed to be immutable.", ast.findFirstToken(TokenTypes.IDENT).getText(), objBlockToken.getPreviousSibling().getText())); } } }
Source:
private void react_main_region_A() { if (check_main_region_A_tr0_tr0()) { effect_main_region_A_tr0(); } else { if (check_main_region_A_tr1_tr1()) { effect_main_region_A_tr1(); } else { if (check_main_region_A_tr2_tr2()) { effect_main_region_A_tr2(); } else { if (check_main_region_A_tr3_tr3()) { effect_main_region_A_tr3(); } else { } } } } }

Target:
private void react_main_region_A() { if (check_main_region_A_tr0_tr0()) { effect_main_region_A_tr0(); } else { if (check_main_region_A_tr1_tr1()) { effect_main_region_A_tr1(); } else { if (check_main_region_A_tr2_tr2()) { effect_main_region_A_tr2(); } else { if (check_main_region_A_tr3_tr3()) { effect_main_region_A_tr3(); } } } } }
Source:
public void checkUpdateCenter(ConnectionCheckJob job, String updateCenterUrl) throws IOException { if (updateCenterUrl.startsWith("http://") || updateCenterUrl.startsWith("https://")) { testConnection(new URL(updateCenterUrl + (updateCenterUrl.indexOf('?') == -1 ? "?uctest" : "&uctest"))); } else { testConnection(new URL(updateCenterUrl)); } }

Target:
public void checkUpdateCenter(ConnectionCheckJob job, String updateCenterUrl) throws IOException { testConnection(toUpdateCenterCheckUrl(updateCenterUrl)); }
Source:
public final synchronized ILogData nextUpTo(final long maxGlobal) { if (getCurrentContext().getGlobalPointer() > maxGlobal) { return null; } if (getCurrentContext().getGlobalPointer() >= getCurrentContext().maxGlobalAddress) { final T last = streamContexts.pollFirst(); log.trace("Completed context {}@{}, removing.", last.id, last.maxGlobalAddress); } ILogData entry = streamReadWithCheck(() -> getNextEntry(getCurrentContext(), maxGlobal), maxGlobal); if (entry != null) { updatePointer(entry); if (processEntryForContext(entry)) { return nextUpTo(maxGlobal); } } return entry; }

Target:
public final synchronized ILogData nextUpTo(final long maxGlobal) { if (getCurrentContext().getGlobalPointer() > maxGlobal) { return null; } if (getCurrentContext().getGlobalPointer() >= getCurrentContext().maxGlobalAddress) { final T last = streamContexts.pollFirst(); log.trace("Completed context {}@{}, removing.", last.id, last.maxGlobalAddress); } ILogData entry = getNextEntry(getCurrentContext(), maxGlobal); if (entry != null) { updatePointer(entry); if (processEntryForContext(entry)) { return nextUpTo(maxGlobal); } } return entry; }
Source:
public BoxCreateAuthRequest setRefreshExpiresAt(long expiresAt) { mBodyMap.put("box_refresh_token_expires_at", Long.toString(expiresAt)); return this; }

Target:
public BoxCreateAuthRequest setRefreshExpiresAt(long expiresAt) { mBodyMap.put(BoxConstants.KEY_BOX_REFRESH_TOKEN_EXPIRES_AT, Long.toString(expiresAt)); return this; }
Source:
public static DependencyQueueTaskDispatcher getInstance() { ExtensionList<DependencyQueueTaskDispatcher> dispatchers = Jenkins.getInstance().getExtensionList(DependencyQueueTaskDispatcher.class); if (dispatchers == null) { return null; } return dispatchers.get(0); }

Target:
public static DependencyQueueTaskDispatcher getInstance() { ExtensionList<DependencyQueueTaskDispatcher> dispatchers = Jenkins.getInstance().getExtensionList(DependencyQueueTaskDispatcher.class); if (dispatchers == null || dispatchers.isEmpty()) { return null; } return dispatchers.get(0); }
Source:
public static Flux<ByteBuffer> toFluxByteBuffer(InputStream inputStream, int chunkSize) { if (chunkSize <= 0) { throw new IllegalArgumentException("'chunkSize' must be greater than 0."); } if (inputStream == null) { return Flux.empty(); } return Flux.<ByteBuffer, InputStream>generate(() -> inputStream, (stream, sink) -> { byte[] buffer = new byte[chunkSize]; try { int offset = 0; while (offset < chunkSize) { int readCount = inputStream.read(buffer, offset, chunkSize - offset); if (readCount == -1) { if (offset > 0) { sink.next(ByteBuffer.wrap(buffer, 0, offset)); } sink.complete(); return stream; } offset += readCount; } sink.next(ByteBuffer.wrap(buffer)); } catch (IOException ex) { sink.error(ex); } return stream; }).filter(ByteBuffer::hasRemaining); }

Target:
public static Flux<ByteBuffer> toFluxByteBuffer(InputStream inputStream, int chunkSize) { if (chunkSize <= 0) { return Flux.error(new IllegalArgumentException("'chunkSize' must be greater than 0.")); } if (inputStream == null) { return Flux.empty(); } return Flux.<ByteBuffer, InputStream>generate(() -> inputStream, (stream, sink) -> { byte[] buffer = new byte[chunkSize]; try { int offset = 0; while (offset < chunkSize) { int readCount = inputStream.read(buffer, offset, chunkSize - offset); if (readCount == -1) { if (offset > 0) { sink.next(ByteBuffer.wrap(buffer, 0, offset)); } sink.complete(); return stream; } offset += readCount; } sink.next(ByteBuffer.wrap(buffer)); } catch (IOException ex) { sink.error(ex); } return stream; }).filter(ByteBuffer::hasRemaining); }
Source:
public boolean removeEdge(final V v1, final V v2) { final Map<V, I> adjEdges = getEdges(v1); if (adjEdges == null) { throw new NoSuchElementException("No src vertex " + v1); } if (adjEdges.remove(v2) != null) { final int inDegree = inDegrees.get(v2); inDegrees.put(v2, inDegree - 1); if (inDegree == 1) { rootVertices.add(v2); } return true; } else { LOG.log(Level.WARNING, "The edge from {0} to {1} does not exists", new Object[]{v1, v2}); return false; } }

Target:
public boolean removeEdge(final V v1, final V v2) { final Map<V, I> adjEdges = getEdges(v1); if (adjEdges == null) { throw new NoSuchElementException("No src vertex " + v1); } if (adjEdges.remove(v2) != null) { numEdges -= 1; final int inDegree = inDegrees.get(v2); inDegrees.put(v2, inDegree - 1); return true; } else { LOG.log(Level.WARNING, "The edge from {0} to {1} does not exists", new Object[]{v1, v2}); return false; } }
Source:
private static Map<Class<?>, DataType> classToDataType(Map<Class<?>, Class<?>> primitiveWrappers) { Map<Class<?>, DataType> dataTypesByJavaClass = new HashMap<Class<?>, DataType>(16); for (DataType dataType : DataType.allPrimitiveTypes()) { Class<?> javaClass = dataType.asJavaClass(); dataTypesByJavaClass.put(javaClass, dataType); Class<?> primitiveJavaClass = primitiveWrappers.get(javaClass); if (primitiveJavaClass != null) { dataTypesByJavaClass.put(primitiveJavaClass, dataType); } } dataTypesByJavaClass.put(String.class, DataType.text()); return dataTypesByJavaClass; }

Target:
private static Map<Class<?>, DataType> classToDataType(Map<Class<?>, Class<?>> primitiveWrappers) { Map<Class<?>, DataType> classToDataType = new HashMap<Class<?>, DataType>(16); for (DataType dataType : DataType.allPrimitiveTypes()) { Class<?> javaClass = dataType.asJavaClass(); classToDataType.put(javaClass, dataType); Class<?> primitiveJavaClass = primitiveWrappers.get(javaClass); if (primitiveJavaClass != null) { classToDataType.put(primitiveJavaClass, dataType); } } classToDataType.put(String.class, DataType.text()); return classToDataType; }
Source:
public SettingsPanel(SettingsPanelForm form, BriefcasePreferences appPreferences, Analytics analytics, FormCache formCache) { this.form = form; appPreferences.getBriefcaseDir().ifPresent(path -> form.setStorageLocation(path.getParent())); appPreferences.getPullInParallel().ifPresent(form::setPullInParallel); appPreferences.getRememberPasswords().ifPresent(form::setRememberPasswords); appPreferences.getSendUsageData().ifPresent(form::setSendUsageData); appPreferences.getHttpProxy().ifPresent(httpProxy -> { form.enableUseHttpProxy(); form.setHttpProxy(httpProxy); form.updateHttpProxyFields(); }); form.onStorageLocation(path -> { Path briefcaseDir = BriefcasePreferences.buildBriefcaseDir(path); UncheckedFiles.createBriefcaseDir(briefcaseDir); formCache.setLocation(briefcaseDir); formCache.update(); appPreferences.setStorageDir(path); }, () -> { formCache.unsetLocation(); formCache.update(); appPreferences.unsetStorageDir(); }); form.onPullInParallelChange(appPreferences::setPullInParallel); form.onRememberPasswordsChange(appPreferences::setRememberPasswords); form.onSendUsageDataChange(enabled -> { appPreferences.setSendUsage(enabled); analytics.enableTracking(enabled, false); }); form.onHttpProxy(appPreferences::setHttpProxy, appPreferences::unsetHttpProxy); form.onReloadCache(() -> { formCache.update(); JOptionPane.showMessageDialog(getContainer(), "The form cache has been successfully reloaded"); }); }

Target:
public SettingsPanel(SettingsPanelForm form, BriefcasePreferences appPreferences, Analytics analytics, FormCache formCache) { this.form = form; appPreferences.getBriefcaseDir().ifPresent(path -> form.setStorageLocation(path.getParent())); appPreferences.getPullInParallel().ifPresent(form::setPullInParallel); appPreferences.getRememberPasswords().ifPresent(form::setRememberPasswords); appPreferences.getSendUsageData().ifPresent(form::setSendUsageData); appPreferences.getHttpProxy().ifPresent(httpProxy -> { form.enableUseHttpProxy(); form.setHttpProxy(httpProxy); form.updateHttpProxyFields(); }); form.onStorageLocation(path -> { Path briefcaseDir = BriefcasePreferences.buildBriefcaseDir(path); UncheckedFiles.createBriefcaseDir(briefcaseDir); formCache.setLocation(briefcaseDir); formCache.update(); appPreferences.setStorageDir(path); }, () -> { formCache.unsetLocation(); formCache.update(); appPreferences.unsetStorageDir(); }); form.onPullInParallelChange(appPreferences::setPullInParallel); form.onRememberPasswordsChange(appPreferences::setRememberPasswords); form.onSendUsageDataChange(enabled -> { appPreferences.setSendUsage(enabled); analytics.enableTracking(enabled, false); }); form.onHttpProxy(appPreferences::setHttpProxy, appPreferences::unsetHttpProxy); form.onReloadCache(() -> { formCache.update(); JOptionPane.showMessageDialog(getContainer(), "Forms successfully reloaded from storage location."); }); }
Source:
public String exportTopology(Topology topology) throws Exception { Preconditions.checkNotNull(topology); TopologyReprBuilder topologyBuilder = new TopologyReprBuilder(); TopologyExportVisitor exportVisitor = new TopologyExportVisitor(topologyBuilder, this); topologyBuilder.setName(topology.getName()); topologyBuilder.setConfig(topology.getConfig()); TopologyDag topologyDag = topology.getTopologyDag(); if (topologyDag != null) { topologyDag.traverse(exportVisitor); } topologyBuilder.setMetadata(getTopologyEditorMetadata(topology.getId())); ObjectMapper mapper = new ObjectMapper(); return mapper.writeValueAsString(topologyBuilder); }

Target:
public String exportTopology(Topology topology) throws Exception { Preconditions.checkNotNull(topology); TopologyData topologyData = new TopologyData(); TopologyExportVisitor exportVisitor = new TopologyExportVisitor(topology.getId(), topologyData, this); topologyData.setName(topology.getName()); topologyData.setConfig(topology.getConfig()); TopologyDag topologyDag = topology.getTopologyDag(); if (topologyDag != null) { topologyDag.traverse(exportVisitor); } topologyData.setMetadata(getTopologyEditorMetadata(topology.getId())); ObjectMapper mapper = new ObjectMapper(); return mapper.writeValueAsString(topologyData); }
Source:
private String decryptData() { String result = ""; try { String key = "HubTurboHubTurbo"; Key aesKey = new SecretKeySpec(key.getBytes(), "AES"); Cipher cipher = Cipher.getInstance("AES"); cipher.init(Cipher.DECRYPT_MODE, aesKey); result = new String(cipher.doFinal(lastLoginEncrypted)); }catch(Exception e) { e.printStackTrace(); } return result; }

Target:
private String decryptData() { String result = ""; try { String key = "HubTurboHubTurbo"; Key aesKey = new SecretKeySpec(key.getBytes(), "AES"); Cipher cipher = Cipher.getInstance("AES"); cipher.init(Cipher.DECRYPT_MODE, aesKey); result = new String(cipher.doFinal(lastLoginEncrypted)); } catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException e) { logger.error("Cannot encrypt data " + e.getMessage(), e); } return result; }
Source:
public void schedule(ScheduledExecutorService exec) { log.info("Scheduling TaskLogAutoCleaner with config [%s].", config.toString()); ScheduledExecutors.scheduleWithFixedDelay( exec, Duration.millis(config.getInitialDelay()), Duration.millis(config.getDelay()), new Runnable() { @Override public void run() { try { taskLogKiller.killOlderThan(System.currentTimeMillis() - config.getDurationToRetain()); taskStorage.removeTasksBefore(DateTimes.nowUtc().minus(config.getDurationToRetain())); } catch (Exception ex) { log.error(ex, "Failed to clean-up the task logs"); } } } ); }

Target:
public void schedule(ScheduledExecutorService exec) { log.info("Scheduling TaskLogAutoCleaner with config [%s].", config.toString()); ScheduledExecutors.scheduleWithFixedDelay( exec, Duration.millis(config.getInitialDelay()), Duration.millis(config.getDelay()), new Runnable() { @Override public void run() { try { long timestamp = System.currentTimeMillis() - config.getDurationToRetain(); taskLogKiller.killOlderThan(timestamp); taskStorage.removeTasksOlderThan(timestamp); } catch (Exception ex) { log.error(ex, "Failed to clean-up the task logs"); } } } ); }
Source:
private WTab addTab(final WTab tab) { super.add(tab); return tab; }

Target:
protected WTab addTab(final WTab tab) { super.add(tab); return tab; }
Source:
public IndexConfig setBitmapIndexOptions(BitmapIndexOptions bitmapIndexOptions) { this.bitmapIndexOptions.setUniqueKey(bitmapIndexOptions.getUniqueKey()); this.bitmapIndexOptions.setUniqueKeyTransformation(bitmapIndexOptions.getUniqueKeyTransformation()); return this; }

Target:
public IndexConfig setBitmapIndexOptions(BitmapIndexOptions bitmapIndexOptions) { this.bitmapIndexOptions = bitmapIndexOptions == null ? null : new BitmapIndexOptions(bitmapIndexOptions); return this; }
Source:
public SWTBotMenu contextMenu(String text) { SWTBotTree swtBotTree = new SWTBotTree(tree); swtBotTree.waitForEnabled(); select(); notifyTree(SWT.MouseDown, createMouseEvent(0, 0, 3, 0, 1)); notifyTree(SWT.MouseUp, createMouseEvent(0, 0, 3, 0, 1)); return super.contextMenu(tree, text); }

Target:
public SWTBotMenu contextMenu(String text) { SWTBotTree swtBotTree = new SWTBotTree(tree); swtBotTree.waitForEnabled(); select(); notifyTree(SWT.MouseDown, createMouseEvent(0, 0, 3, 0, 1)); notifyTree(SWT.MouseUp, createMouseEvent(0, 0, 3, 0, 1)); return new SWTBotMenu(ContextMenuHelper.contextMenu(swtBotTree, widget, text)); }
Source:
static HttpData convertRequest(ServiceRequestContext ctx, AggregatedHttpMessage request) { ZipkinHttpCollector.metrics.incrementMessages(); String encoding = request.headers().get(HttpHeaderNames.CONTENT_ENCODING); HttpData content = request.content(); if (!content.isEmpty() && encoding != null && encoding.contains("gzip")) { content = GZIP_DECODER_FACTORY.newDecoder(ByteBufAllocator.DEFAULT).decode(content); if (content.isEmpty()) { ZipkinHttpCollector.maybeLog("Malformed gzip body", ctx, request); throw new IllegalArgumentException("Cannot gunzip spans"); } } if (content.isEmpty()) ZipkinHttpCollector.maybeLog("Empty POST body", ctx, request); if (content.length() == 2 && "[]".equals(content.toStringAscii())) { ZipkinHttpCollector.maybeLog("Empty JSON list POST body", ctx, request); ReferenceCountUtil.release(content); content = HttpData.EMPTY_DATA; } ZipkinHttpCollector.metrics.incrementBytes(content.length()); return content; }

Target:
static HttpData convertRequest(ServiceRequestContext ctx, AggregatedHttpMessage request) { ZipkinHttpCollector.metrics.incrementMessages(); String encoding = request.headers().get(HttpHeaderNames.CONTENT_ENCODING); HttpData content = request.content(); if (!content.isEmpty() && encoding != null && encoding.contains("gzip")) { content = GZIP_DECODER_FACTORY.newDecoder(ctx.alloc()).decode(content); if (content.isEmpty()) { ZipkinHttpCollector.maybeLog("Malformed gzip body", ctx, request); throw new IllegalArgumentException("Cannot gunzip spans"); } } if (content.isEmpty()) ZipkinHttpCollector.maybeLog("Empty POST body", ctx, request); if (content.length() == 2 && "[]".equals(content.toStringAscii())) { ZipkinHttpCollector.maybeLog("Empty JSON list POST body", ctx, request); ReferenceCountUtil.release(content); content = HttpData.EMPTY_DATA; } ZipkinHttpCollector.metrics.incrementBytes(content.length()); return content; }
Source:
private Collection<? extends Role> createRoles(final AccessToken accessToken) { Set<String roleNames = new HashSet<>(); AccessToken.Access access = accessToken.getResourceAccess(accessToken.getIssuedFor()); if(access!=null && access.getRoles()!=null){ roleNames.addAll(access.getRoles()); } AccessToken.Access realmAccess = accessToken.getRealmAccess(); if(realmAccess!=null && realmAccess.getRoles()!=null){ roleNames.addAll(realmAccess.getRoles()); } final List<Role> roles = new ArrayList<Role>(roleNames.size()); for (final String roleName : roleNames) { roles.add(new RoleImpl(roleName)); } return roles; }

Target:
private Collection<? extends Role> createRoles(final AccessToken accessToken) { Set<String> roleNames = new HashSet<String>(); AccessToken.Access access = accessToken.getResourceAccess(accessToken.getIssuedFor()); if(access != null && access.getRoles() != null){ roleNames.addAll(access.getRoles()); } AccessToken.Access realmAccess = accessToken.getRealmAccess(); if(realmAccess != null && realmAccess.getRoles() !=null ){ roleNames.addAll(realmAccess.getRoles()); } final List<Role> roles = new ArrayList<Role>(roleNames.size()); for (final String roleName : roleNames) { roles.add(new RoleImpl(roleName)); } return roles; }
Source:
public static <I,O> IfFunctionBuilderApplyingFirst<I> ifNotEquals(I test) { return ifPredicate(Predicates.not(Predicates.equalTo(test))); }

Target:
public static <I> IfFunctionBuilderApplyingFirst<I> ifNotEquals(I test) { return ifPredicate(Predicates.not(Predicates.equalTo(test))); }
Source:
public Node getNode(NodeId nodeId) { Node node = nodes.get(nodeId); if (node != null && node.type() == Node.Type.CLIENT && node.getState() == State.INACTIVE) { return null; } return node; }

Target:
public Node getNode(NodeId nodeId) { Node node = nodes.get(nodeId); return node != null ? node.type() == Node.Type.DATA || node.getState() == State.ACTIVE ? node : null : null; }
Source:
public void visitMethodInvocation(MethodInvocationTree syntaxNode) { if (syntaxNode.methodSelect().is(Tree.Kind.MEMBER_SELECT)) { MemberSelectExpressionTree memberSelect = (MemberSelectExpressionTree) syntaxNode.methodSelect(); final ExpressionTree expression = memberSelect.expression(); if (expression.is(Tree.Kind.IDENTIFIER) && expression.symbolType().isSubtypeOf("java.util.concurrent.locks.Lock")) { final String methodName = memberSelect.identifier().name(); IdentifierTree target = (IdentifierTree) expression; if (!isMemberSelectActingOnField(target) && TRY_LOCK_METHOD_NAME.equals(methodName)) { final SymbolicValue symbolicValue = programState.getValue(target.symbol()); constraintManager.setValueFactory(new TryLockSymbolicValueFactory(symbolicValue)); } } } }

Target:
public void visitMethodInvocation(MethodInvocationTree syntaxNode) { if (syntaxNode.methodSelect().is(Tree.Kind.MEMBER_SELECT)) { MemberSelectExpressionTree memberSelect = (MemberSelectExpressionTree) syntaxNode.methodSelect(); final ExpressionTree expression = memberSelect.expression(); if (expression.is(Tree.Kind.IDENTIFIER) && expression.symbolType().isSubtypeOf(LOCK)) { final String methodName = memberSelect.identifier().name(); IdentifierTree target = (IdentifierTree) expression; if (!isMemberSelectActingOnField(target) && TRY_LOCK_METHOD_NAME.equals(methodName)) { final SymbolicValue symbolicValue = programState.getValue(target.symbol()); constraintManager.setValueFactory(new TryLockSymbolicValueFactory(symbolicValue)); } } } }
Source:
private void initializeFromBundle(Context context, Bundle bundle) { if (mInitializedCalled == false) { List<MediationConfiguration> configs = new ArrayList<>(); configs.add(new MediationConfiguration(AdFormat.BANNER, bundle)); initialize(context, null, configs); } }

Target:
private void initializeFromBundle(Context context, Bundle bundle) { List<MediationConfiguration> configs = new ArrayList<>(); configs.add(new MediationConfiguration(null, bundle)); initialize(context, null, configs); }
Source:
public static boolean isPgpMimeEncrypted(Message message) { String[] contentHeaders = null; try { contentHeaders = message.getHeader("Content-Type"); } catch (MessagingException e) { } if (contentHeaders == null) { return false; } for (String contentHeader : contentHeaders) { if (contentHeader.equalsIgnoreCase(MULTIPART_ENCRYPTED)) { return true; } } return false; }

Target:
public static boolean isPgpMimeEncrypted(Message message) throws MessagingException { return contentHeaderContains(message, MULTIPART_ENCRYPTED); }
Source:
public void testSendSerialData802IOError() throws XBeeException, IOException { Mockito.when(xbeeDevice.getXBeeProtocol()).thenReturn(XBeeProtocol.RAW_802_15_4); Mockito.doThrow(new IOException()).when(xbeeDevice).sendXBeePacket(tx16Packet); Mockito.doThrow(new IOException()).when(xbeeDevice).sendXBeePacket(tx64Packet); try { xbeeDevice.sendSerialData(XBEE_16BIT_ADDRESS, SEND_DATA_BYTES); fail("Tx16 frame shouldn't have been sent successfully."); } catch (Exception e) { assertEquals(XBeeException.class, e.getClass()); } try { xbeeDevice.sendSerialData(XBEE_64BIT_ADDRESS, SEND_DATA_BYTES); fail("Tx64 frame shouldn't have been sent successfully."); } catch (Exception e) { assertEquals(XBeeException.class, e.getClass()); } try { xbeeDevice.sendSerialData(mockedDevice, SEND_DATA_BYTES); fail("Tx64 frame shouldn't have been sent successfully."); } catch (Exception e) { assertEquals(XBeeException.class, e.getClass()); } }

Target:
public void testSendSerialData802IOError() throws XBeeException, IOException { Mockito.when(xbeeDevice.getXBeeProtocol()).thenReturn(XBeeProtocol.RAW_802_15_4); Mockito.doThrow(new IOException()).when(xbeeDevice).sendXBeePacket(tx16Packet); Mockito.doThrow(new IOException()).when(xbeeDevice).sendXBeePacket(tx64Packet); try { xbeeDevice.sendSerialData(XBEE_16BIT_ADDRESS, SEND_DATA_BYTES); fail("Tx16 frame shouldn't have been sent successfully."); } catch (Exception e) { assertEquals(XBeeException.class, e.getClass()); assertEquals(IOException.class, e.getCause().getClass()); } try { xbeeDevice.sendSerialData(XBEE_64BIT_ADDRESS, SEND_DATA_BYTES); fail("Tx64 frame shouldn't have been sent successfully."); } catch (Exception e) { assertEquals(XBeeException.class, e.getClass()); assertEquals(IOException.class, e.getCause().getClass()); } try { xbeeDevice.sendSerialData(mockedDevice, SEND_DATA_BYTES); fail("Tx64 frame shouldn't have been sent successfully."); } catch (Exception e) { assertEquals(XBeeException.class, e.getClass()); assertEquals(IOException.class, e.getCause().getClass()); } }
Source:
protected void handleUserInput() { Thread thread = new Thread(new Runnable() { @Override public void run() { Context ctx = mCtx.getActivity().getApplicationContext(); ProjectDatabaseHelper db = ((TranslationRecorderApp)mCtx.getActivity().getApplication()).getDatabase(); uploadBinary(ctx, db, outputFile()); } }); thread.start(); }

Target:
protected void handleUserInput() { Thread thread = new Thread(new Runnable() { @Override public void run() { Context ctx = mCtx.getActivity().getApplicationContext(); uploadBinary(ctx, outputFile()); } }); thread.start(); }
Source:
private List<Map<String, Object>> setBaseVanityURLFields() { List fields = new ArrayList(); fields.add(setFieldElements("Order", "com.dotcms.contenttype.model.field.TextField","", "integer2", true, true, false, "order", 5, "", "", "", "", true, false, true)); fields.add(setFieldElements("Action", "com.dotcms.contenttype.model.field.SelectField","", "integer1", true, true, false, "action", 4, "200 - Forward|200\r\n301 - Permanent Redirect|301\r\n302 - Temporary Redirect|302\r\n401 - Auth Required|401\r\n403 - Auth Failed|403\r\n404 - Missing|404\r\n500 - Error|500", "", "", "", true, false, true)); fields.add(setFieldElements("Forward To", "com.dotcms.contenttype.model.field.CustomField","", "text4", true, true, true, "forwardTo", 3, "$velutil.mergeTemplate('/static/content/file_browser_field_render.vtl')", "", "", "", true, false, false)); fields.add(setFieldElements("Uri", "com.dotcms.contenttype.model.field.TextField","", "text3", true, true, true, "uri", 2, "", "", "", "", true, false, true)); fields.add(setFieldElements("Site","com.dotcms.contenttype.model.field.CustomField","","text2", true, true, true,"site",1,"$velutil.mergeTemplate('/static/content/site_selector_field_render.vtl')","","","",true,false,false)); fields.add(setFieldElements("Title", "com.dotcms.contenttype.model.field.TextField","", "text1", true, true, true, "title", 1, "", "", "", "", true, false, true)); return fields; }

Target:
private List<Map<String, Object>> setBaseVanityURLFields() { List fields = new ArrayList(); fields.add(setFieldElements("Title", TEXT_FIELD, "", "text1", true, true, true, "title", INT_1, "", "", "", "", true, false, true)); fields.add(setFieldElements("Site", CUSTOM_FIELD, "", "text2", true, false, true, "site", INT_2, "$velutil.mergeTemplate('/static/content/site_selector_field_render.vtl')", "", "", "", true, false, false)); fields.add( setFieldElements("Uri", TEXT_FIELD, "", "text3", true, true, true, "uri", INT_3, "", "", "", "", true, false, true)); fields.add(setFieldElements("Action", SELECT_FIELD, "", "integer1", true, true, false, "action", INT_4, "200 - Forward|200\r\n301 - Permanent Redirect|301\r\n302 - Temporary Redirect|302\r\n401 - Auth Required|401\r\n403 - Auth Failed|403\r\n404 - Missing|404\r\n500 - Error|500", "", "", "", true, false, true)); fields.add( setFieldElements("Forward To", CUSTOM_FIELD, "", "text4", true, true, true, "forwardTo", INT_5, "$velutil.mergeTemplate('/static/content/file_browser_field_render.vtl')", "", "", "", true, false, false)); fields.add(setFieldElements("Order", TEXT_FIELD, "", "integer2", true, true, false, "order", INT_6, "", "", "", "0", true, false, true)); return fields; }
Source:
public void goToMeasurements(MenuItem menuItem) { if(mAssignment != null && mAssignment.getRole() == Assignment.Role.BLOCKED) { AlertDialog alertDialog = new AlertDialog.Builder(this) .setTitle(getString(R.string.title_dialog_blocked)) .setMessage(getString(R.string.disallowed_measurements)) .setNeutralButton(getString(R.string.ok), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }) .create(); alertDialog.show(); } else { startActivity(new Intent(getApplicationContext(), MeasurementsActivity.class)); } }

Target:
public void goToMeasurements(MenuItem menuItem) { if(mAssignment != null && mAssignment.isBlocked()) { AlertDialog alertDialog = new AlertDialog.Builder(this) .setTitle(getString(R.string.title_dialog_blocked)) .setMessage(getString(R.string.disallowed_measurements)) .setNeutralButton(getString(R.string.ok), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }) .create(); alertDialog.show(); } else { startActivity(new Intent(getApplicationContext(), MeasurementsActivity.class)); } }
Source:
public void testGenerateAmazonS3GetBucketRequestPrototype() throws IOException, TemplateModelException { final TestFileUtilsImpl fileUtils = new TestFileUtilsImpl(); Map<String,Object> testMap = new HashMap<>(); final String responseType = StructHelper.getResponseTypeName("ListBucketResult"); final Request requestEntry = new Request( "GetBucketRequest", Classification.amazons3, HttpVerb.GET, "\"/\", bucket_name, NULL", null, null, RequestConverter.getParamList(responseType), true, false, responseType ); testMap.put("requestEntry", requestEntry); final CCodeGenerator codeGenerator = new CCodeGenerator(); codeGenerator.processTemplate(testMap, "header-templates/RequestPrototype.ftl", fileUtils.getOutputStream()); final ByteArrayOutputStream bstream = (ByteArrayOutputStream) fileUtils.getOutputStream(); final String output = new String(bstream.toByteArray()); final String expectedOutput = "ds3_error* get_bucket_request(const ds3_client* client, const ds3_request* request, const ds3_list_bucket_result_response** response);"; assertEquals(expectedOutput, output); }

Target:
public void testGenerateAmazonS3GetBucketRequestPrototype() throws IOException, TemplateModelException { final TestFileUtilsImpl fileUtils = new TestFileUtilsImpl(); final Map<String,Object> testMap = new HashMap<>(); final String responseType = StructHelper.getResponseTypeName("ListBucketResult"); final Request requestEntry = new Request( "GetBucketRequest", Classification.amazons3, HttpVerb.GET, "\"/\", bucket_name, NULL", null, null, RequestConverter.getParamList(responseType), true, false, responseType ); testMap.put("requestEntry", requestEntry); final CCodeGenerator codeGenerator = new CCodeGenerator(); codeGenerator.processTemplate(testMap, "header-templates/RequestPrototype.ftl", fileUtils.getOutputStream()); final ByteArrayOutputStream bstream = (ByteArrayOutputStream) fileUtils.getOutputStream(); final String output = new String(bstream.toByteArray()); final String expectedOutput = "ds3_error* get_bucket_request(const ds3_client* client, const ds3_request* request, const ds3_list_bucket_result_response** response);"; assertEquals(expectedOutput, output); }
Source:
private RyaDetails initializeRyaDetails( final String instanceName, final InstallConfiguration installConfig) throws AlreadyInitializedException, RyaDetailsRepositoryException { final RyaDetailsRepository detailsRepo = new MongoRyaInstanceDetailsRepository(adminClient, instanceName); if(installConfig.getFluoPcjAppName().isPresent()) { log.warn("Mongo does not have fluo support, use ignoring the configured fluo application name: " + installConfig.getFluoPcjAppName().get()); } final PCJIndexDetails.Builder pcjDetailsBuilder = PCJIndexDetails.builder() .setEnabled(installConfig.isPcjIndexEnabled()); final RyaDetails details = RyaDetails.builder() .setRyaInstanceName(instanceName).setRyaVersion(getVersion()) .setTemporalIndexDetails(new TemporalIndexDetails(installConfig.isTemporalIndexEnabled())) .setFreeTextDetails(new FreeTextIndexDetails(installConfig.isFreeTextIndexEnabled())) .setEntityCentricIndexDetails(new EntityCentricIndexDetails(installConfig.isEntityCentrixIndexEnabled())) .setPCJIndexDetails(pcjDetailsBuilder) .setProspectorDetails(new ProspectorDetails(Optional.<Date> absent())) .setJoinSelectivityDetails(new JoinSelectivityDetails(Optional.<Date> absent())) .build(); detailsRepo.initialize(details); return details; }

Target:
private RyaDetails initializeRyaDetails( final String instanceName, final InstallConfiguration installConfig) throws AlreadyInitializedException, RyaDetailsRepositoryException { final RyaDetailsRepository detailsRepo = new MongoRyaInstanceDetailsRepository(adminClient, instanceName); if(installConfig.getFluoPcjAppName().isPresent()) { log.warn("Mongo does not have fluo support, use ignoring the configured fluo application name: " + installConfig.getFluoPcjAppName().get()); } final PCJIndexDetails.Builder pcjDetailsBuilder = PCJIndexDetails.builder() .setEnabled(installConfig.isPcjIndexEnabled()); final RyaDetails details = RyaDetails.builder() .setRyaInstanceName(instanceName).setRyaVersion(getVersion()) .setTemporalIndexDetails(new TemporalIndexDetails(installConfig.isTemporalIndexEnabled())) .setFreeTextDetails(new FreeTextIndexDetails(installConfig.isFreeTextIndexEnabled())) .setEntityCentricIndexDetails(new EntityCentricIndexDetails(false)) .setPCJIndexDetails(pcjDetailsBuilder) .setProspectorDetails(new ProspectorDetails(Optional.<Date> absent())) .setJoinSelectivityDetails(new JoinSelectivityDetails(Optional.<Date> absent())) .build(); detailsRepo.initialize(details); return details; }
Source:
RunningJobs getRunningJobs() { if (runningJobs == null) { runningJobs = new RunningJobs(); } return runningJobs; }

Target:
synchronized RunningJobs getRunningJobs() { if (runningJobs == null) { runningJobs = new RunningJobs(); } return runningJobs; }
Source:
public BooleanColumnBuilder() { data = new BitSet(); numBits = 0; Schema schema = new Schema(Arrays.asList(Type.BOOLEAN_TYPE)); int batchSize = TupleUtils.getBatchSize(schema); capacity = batchSize; }

Target:
public BooleanColumnBuilder() { data = new BitSet(); numBits = 0; int batchSize = TupleUtils.getBatchSize(Type.BOOLEAN_TYPE); capacity = batchSize; }