auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public RequestHeader(Struct struct, short headerVersion) { this.data = new RequestHeaderData(struct, headerVersion); this.headerVersion = headerVersion; }

Target:
public RequestHeader(Struct struct, short headerVersion) { this(new RequestHeaderData(struct, headerVersion), headerVersion); }
Source:
public void testHetSensDistributions() throws Exception { final double tolerance = 0.02; final double expectedResult = .9617; final int max = 500; final double depthDistribution = new double[max+1]; final double qualityDistribution = new double[50]; final Scanner scanDepth = new Scanner(depth); int i = 0; while (scanDepth.hasNextDouble()) { depthDistribution[i] = scanDepth.nextDouble(); i++; } final Scanner scanBaseQ = new Scanner(baseQ); int j = 0; while (scanBaseQ.hasNextDouble()) { qualityDistribution[j] = scanBaseQ.nextDouble(); j++; } final int sampleSize = 1000; final double logOddsThreshold = 3.0; final double result = TheoreticalSensitivity.hetSNPSensitivity(depthDistribution, qualityDistribution, sampleSize, logOddsThreshold); Assert.assertEquals(result, expectedResult, tolerance); }

Target:
public void testHetSensDistributions() throws Exception { final double tolerance = 0.02; final double expectedResult = .9617; final int maxDepth = 500; final double depthDistribution = new double[maxDepth+1]; final double qualityDistribution = new double[50]; final Scanner scanDepth = new Scanner(DEPTH); for (int i = 0; scanDepth.hasNextDouble(); i++) { depthDistribution[i] = scanDepth.nextDouble(); } final Scanner scanBaseQ = new Scanner(BASEQ); for (int j = 0; scanBaseQ.hasNextDouble(); j++) { qualityDistribution[j] = scanBaseQ.nextDouble(); } final int sampleSize = 1000; final double logOddsThreshold = 3.0; final double result = TheoreticalSensitivity.hetSNPSensitivity(depthDistribution, qualityDistribution, sampleSize, logOddsThreshold); Assert.assertEquals(result, expectedResult, tolerance); }
Source:
private void addTypeParameters(CompilationUnitRewrite imRewrite, List<TypeParameter> list, ITypeBinding parent, ImportRewriteContext context) { ITypeBinding enclosing= parent.getDeclaringClass(); if (enclosing != null) addTypeParameters(imRewrite, list, enclosing, context); ITypeBinding[] typeParameters= parent.getTypeParameters(); for (ITypeBinding typeParameter : typeParameters) { TypeParameter ntp= imRewrite.getAST().newTypeParameter(); ntp.setName(imRewrite.getAST().newSimpleName(typeParameter.getName())); ITypeBinding[] bounds = typeParameter.getTypeBounds(); for (ITypeBinding bound : bounds) { if (!"java.lang.Object".equals(bound.getQualifiedName())) { ntp.typeBounds().add(imRewrite.getImportRewrite().addImport(bound, imRewrite.getAST(), context, TypeLocation.TYPE_BOUND)); } } list.add(ntp); } }

Target:
private void addTypeParameters(CompilationUnitRewrite imRewrite, List<TypeParameter> list, ITypeBinding parent, ImportRewriteContext context) { ITypeBinding enclosing= parent.getDeclaringClass(); if (enclosing != null) addTypeParameters(imRewrite, list, enclosing, context); for (ITypeBinding typeParameter : parent.getTypeParameters()) { TypeParameter ntp= imRewrite.getAST().newTypeParameter(); ntp.setName(imRewrite.getAST().newSimpleName(typeParameter.getName())); for (ITypeBinding bound : typeParameter.getTypeBounds()) { if (!"java.lang.Object".equals(bound.getQualifiedName())) { ntp.typeBounds().add(imRewrite.getImportRewrite().addImport(bound, imRewrite.getAST(), context, TypeLocation.TYPE_BOUND)); } } list.add(ntp); } }
Source:
public void testStatsCalculatorUsesLayout() { assertPlan("SELECT orderstatus FROM orders WHERE orderstatus = 'P'", anyTree( node(TableScanNode.class) .withStats(PlanNodeStatsEstimate.builder() .setOutputRowCount(new Estimate(363.0)) .setOutputSizeInBytes(unknownValue()) .build()))); assertPlan("SELECT orderstatus FROM orders WHERE orderkey = 42", anyTree( node(TableScanNode.class) .withStats(PlanNodeStatsEstimate.builder() .setOutputRowCount(new Estimate(15000.0)) .setOutputSizeInBytes(unknownValue()) .build()))); }

Target:
public void testStatsCalculatorUsesLayout() { assertPlan("SELECT orderstatus FROM orders WHERE orderstatus = 'P'", anyTree( node(TableScanNode.class) .withStats(PlanNodeStatsEstimate.builder() .setOutputRowCount(363.0) .build()))); assertPlan("SELECT orderstatus FROM orders WHERE orderkey = 42", anyTree( node(TableScanNode.class) .withStats(PlanNodeStatsEstimate.builder() .setOutputRowCount(15000.0) .build()))); }
Source:
public RibbonLoadBalancedRetryPolicy(String serviceId, RibbonLoadBalancerContext context, ServiceInstanceChooser loadBalanceChooser, IClientConfig clientConfig) { this.serviceId = serviceId; this.lbContext = context; this.loadBalanceChooser = loadBalanceChooser; String retryableStatusCodesProp = clientConfig.getPropertyAsString(RETRYABLE_STATUS_CODES, ""); String[] retryableStatusCodesArray = retryableStatusCodesProp.split(","); for(String code : retryableStatusCodesArray) { if(!StringUtils.isEmpty(code)) { try { retryableStatusCodes.add(Integer.valueOf(code.trim())); } catch (NumberFormatException e) { log.warn("Can't add status code: " + code, e); } } } }

Target:
public RibbonLoadBalancedRetryPolicy(String serviceId, RibbonLoadBalancerContext context, ServiceInstanceChooser loadBalanceChooser, IClientConfig clientConfig) { this.serviceId = serviceId; this.lbContext = context; this.loadBalanceChooser = loadBalanceChooser; String retryableStatusCodesProp = clientConfig.getPropertyAsString(RETRYABLE_STATUS_CODES, ""); String[] retryableStatusCodesArray = retryableStatusCodesProp.split(","); for(String code : retryableStatusCodesArray) { if(!StringUtils.isEmpty(code)) { try { retryableStatusCodes.add(Integer.valueOf(code.trim())); } catch (NumberFormatException e) { log.warn("We cant add the status code because the code [ " + code + " ] could not be converted to an integer. ", e); } } } }
Source:
private void writeToFile(String fileName, String fileContent) { try { File file = new File(fileName); if (!file.exists()) { file.createNewFile(); } try (FileWriter fw = new FileWriter(file.getAbsoluteFile()); BufferedWriter bw = new BufferedWriter(fw)) { bw.write(fileContent); } } catch (IOException e) { e.printStackTrace(); } }

Target:
private void writeToFile(String fileName, String fileContent) { try { File file = new File(fileName); if (!file.exists()) { file.createNewFile(); } try (BufferedWriter bw = new BufferedWriter(new FileWriter(file.getAbsoluteFile()))) { bw.write(fileContent); } } catch (IOException e) { e.printStackTrace(); } }
Source:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if (isAuthenticated() && ((HttpServletRequest) request).getRequestURI().equals("/loginUser")) { String encodedRedirectURL = ((HttpServletResponse) response).encodeRedirectURL( ((HttpServletRequest) request).getContextPath() + "/userMainPage"); ((HttpServletResponse) response).setStatus(HttpStatus.SC_TEMPORARY_REDIRECT); ((HttpServletResponse) response).setHeader("Location", encodedRedirectURL); } chain.doFilter(request, response); }

Target:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest servletRequest = (HttpServletRequest) request; HttpServletResponse servletResponse = (HttpServletResponse) response; if (isAuthenticated() && "/loginUser".equals(servletRequest.getRequestURI())) { String encodedRedirectURL = ((HttpServletResponse) response).encodeRedirectURL( servletRequest.getContextPath() + "/userMainPage"); servletResponse.setStatus(HttpStatus.SC_TEMPORARY_REDIRECT); servletResponse.setHeader("Location", encodedRedirectURL); } chain.doFilter(servletRequest, servletResponse); }
Source:
public WiringPage() { init(); }

Target:
public WiringPage() { initializeDomainChooseForm(); initializeGlobalNameField(); initializeInstanceIdField(); initializeGlobals(); initializeEndpoints(); initializeWiringForm(); initializeFeedbackPanel(); }
Source:
protected void setId(String id) { this.id = id; }

Target:
public void setId(String id) { this.id = id; }
Source:
public void initialize(Config newConfig) { super.initialize(newConfig); this.config = newConfig; this.connectionString = Context.stateManagerConnectionString(newConfig); this.isSchedulerService = Context.schedulerService(newConfig); this.tunnelProcesses = new ArrayList<>(); NetworkUtils.TunnelConfig tunnelConfig = NetworkUtils.TunnelConfig.build(config, NetworkUtils.HeronSystem.STATE_MANAGER); if (tunnelConfig.isTunnelNeeded()) { for (int setupCount = 0;; ++setupCount) { Pair<String, List<Process>> tunneledResults = setupZkTunnel(tunnelConfig); String newConnectionString = tunneledResults.first; if (newConnectionString.isEmpty()) { if (setupCount < TUNNEL_SETUP_RETRY) { continue; } else { throw new IllegalArgumentException("Failed to connect to tunnel host '" + tunnelConfig.getTunnelHost() + "'"); } } connectionString = newConnectionString; tunnelProcesses.addAll(tunneledResults.second); } } client = getCuratorClient(); LOG.info("Starting Curator client connecting to: " + connectionString); client.start(); try { if (!client.blockUntilConnected(ZkContext.connectionTimeoutMs(newConfig), TimeUnit.MILLISECONDS)) { throw new RuntimeException("Failed to initialize CuratorClient"); } } catch (InterruptedException e) { throw new RuntimeException("Failed to initialize CuratorClient", e); } if (ZkContext.isInitializeTree(newConfig)) { initTree(); } }

Target:
public void initialize(Config newConfig) { super.initialize(newConfig); this.config = newConfig; this.connectionString = Context.stateManagerConnectionString(newConfig); this.isSchedulerService = Context.schedulerService(newConfig); this.tunnelProcesses = new ArrayList<>(); NetworkUtils.TunnelConfig tunnelConfig = NetworkUtils.TunnelConfig.build(config, NetworkUtils.HeronSystem.STATE_MANAGER); if (tunnelConfig.isTunnelNeeded()) { for (int setupCount = 0;; ++setupCount) { Pair<String, List<Process>> tunneledResults = setupZkTunnel(tunnelConfig); String newConnectionString = tunneledResults.first; if (!newConnectionString.isEmpty()) { connectionString = newConnectionString; tunnelProcesses.addAll(tunneledResults.second); break; } else { if (setupCount < TUNNEL_SETUP_RETRY) { try { TimeUnit.SECONDS.sleep(TUNNEL_SETUP_RETRY_SLEEP_SEC); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); } } else { throw new IllegalArgumentException("Failed to connect to tunnel host '" + tunnelConfig.getTunnelHost() + "'"); } } } } client = getCuratorClient(); LOG.info("Starting Curator client connecting to: " + connectionString); client.start(); try { if (!client.blockUntilConnected(ZkContext.connectionTimeoutMs(newConfig), TimeUnit.MILLISECONDS)) { throw new RuntimeException("Failed to initialize CuratorClient"); } } catch (InterruptedException e) { throw new RuntimeException("Failed to initialize CuratorClient", e); } if (ZkContext.isInitializeTree(newConfig)) { initTree(); } }
Source:
public void testChangeNotify(TestHarness th) throws IOException { DataEncoder dataEncoder = new DataEncoder("Conv-BEB"); dataEncoder.putStart(14, "event"); dataEncoder.put(13, "name", "Query"); dataEncoder.putStart(15, "subscriptions"); dataEncoder.put(10, "battery", "Disable"); dataEncoder.put(10, "wifi_status", "Enable"); dataEncoder.put(10, "network_status", "Enable"); dataEncoder.putEnd(15, "subscriptions"); dataEncoder.putEnd(14, "event"); byte[] sendData = dataEncoder.getData(); client.send(sendData, 0, sendData.length); sendFakeOnlineEvent(); LocalMessageProtocolMessage msg = client.newMessage(null); client.receive(msg); byte[] clientData = msg.getData(); DataDecoder dataDecoder = new DataDecoder("Conv-BEB", clientData, 0, clientData.length); dataDecoder.getStart(14); th.check(dataDecoder.getString(13), "ChangeNotify"); dataDecoder.getString(10); dataDecoder.getStart(15); th.check(dataDecoder.getName(), "network_status"); dataDecoder.getStart(14); th.check(dataDecoder.getString(10), "Home"); dataDecoder.getEnd(14); dataDecoder.getEnd(15); msg = client.newMessage(null); client.receive(msg); clientData = msg.getData(); dataDecoder = new DataDecoder("Conv-BEB", clientData, 0, clientData.length); dataDecoder.getStart(14); th.check(dataDecoder.getString(13), "ChangeNotify"); dataDecoder.getString(10); dataDecoder.getStart(15); th.check(dataDecoder.getName(), "wifi_status"); dataDecoder.getStart(14); th.check(dataDecoder.getBoolean(), true); dataDecoder.getEnd(14); dataDecoder.getEnd(15); }

Target:
public void testChangeNotify(TestHarness th) throws IOException { DataEncoder dataEncoder = new DataEncoder("Conv-BEB"); dataEncoder.putStart(14, "event"); dataEncoder.put(13, "name", "Query"); dataEncoder.putStart(15, "subscriptions"); dataEncoder.put(10, "battery", "Disable"); dataEncoder.put(10, "wifi_status", "Enable"); dataEncoder.put(10, "network_status", "Enable"); dataEncoder.putEnd(15, "subscriptions"); dataEncoder.putEnd(14, "event"); byte[] sendData = dataEncoder.getData(); client.send(sendData, 0, sendData.length); sendFakeOnlineEvent(); testNotify(th, true); sendFakeOfflineEvent(); testNotify(th, false); }
Source:
protected boolean canDoAction() { if (!super.canDoAction()) { return false; } if (getMissingServerHooks().isEmpty()) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_NO_CONFLICT_SERVERS); return false; } for (GlusterServerHook serverHook: getMissingServerHooks()) { VDS vds = getVdsDAO().get(serverHook.getServerId()); if (vds == null || vds.getStatus() != VDSStatus.Up) { setVdsName(vds != null ? vds.getName() : "No Server"); addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_SERVER_STATUS_NOT_UP); return false; } } return true; }

Target:
protected boolean canDoAction() { if (!super.canDoAction()) { return false; } if (getMissingServerHooks().isEmpty()) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_NO_CONFLICT_SERVERS); return false; } for (GlusterServerHook serverHook: getMissingServerHooks()) { VDS vds = getVdsDAO().get(serverHook.getServerId()); if (vds == null || vds.getStatus() != VDSStatus.Up) { setVdsName(vds != null ? vds.getName() : "NO SERVER"); addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_SERVER_STATUS_NOT_UP); return false; } } return true; }
Source:
public Object instantiateItem(ViewGroup container, int position) { this.container=container; LayoutInflater inflater = LayoutInflater.from(container.getContext()); ViewGroup layout = (ViewGroup) inflater.inflate(PAGE_LAYOUTS[position], container, false); if ( BuildConfig.FLAVOR == "beta"){ TextView textView = (TextView) layout.findViewById(R.id.welcomeYesButton); if ( textView.getVisibility() != View.VISIBLE){ textView.setVisibility(View.VISIBLE); } ViewHolder holder = new ViewHolder(layout); layout.setTag(holder); if (position == PAGE_FINAL){ TextView moreInfo = layout.findViewById(R.id.welcomeInfo); moreInfo.setText(Html.fromHtml(WelcomeActivity.moreInformation)); ViewHolder holder1 = new ViewHolder(layout); layout.setTag(holder1); } } else { if (position == PAGE_FINAL) { ViewHolder holder = new ViewHolder(layout); layout.setTag(holder); } } container.addView(layout); return layout; }

Target:
public Object instantiateItem(ViewGroup container, int position) { this.container=container; LayoutInflater inflater = LayoutInflater.from(container.getContext()); ViewGroup layout = (ViewGroup) inflater.inflate(PAGE_LAYOUTS[position], container, false); if (BuildConfig.FLAVOR == "beta") { TextView textView = layout.findViewById(R.id.welcomeYesButton); if (textView.getVisibility() != View.VISIBLE) { textView.setVisibility(View.VISIBLE); } ViewHolder holder = new ViewHolder(layout); layout.setTag(holder); if (position == PAGE_FINAL){ TextView moreInfo = layout.findViewById(R.id.welcomeInfo); moreInfo.setText(Html.fromHtml(WelcomeActivity.moreInformation)); ViewHolder holder1 = new ViewHolder(layout); layout.setTag(holder1); } } else { if (position == PAGE_FINAL) { ViewHolder holder = new ViewHolder(layout); layout.setTag(holder); } } container.addView(layout); return layout; }
Source:
public void testPlatformAuthHandlerAvailable() throws Exception { if (!TestUtils.isCompatibilityAuthInstalled()) { return; } URL url = new URL("http://mylyn"); Platform.addAuthorizationInfo(url, "", "", Collections.EMPTY_MAP); assertNotNull("Tests require org.eclipse.core.runtime.compatibility.auth", Platform.getAuthorizationInfo(url, "", "")); }

Target:
public void testPlatformAuthHandlerAvailable() throws Exception { if (!TestUtils.isCompatibilityAuthInstalled()) { System.err.println("Skipping TaskRepositoryCredentialsTest.testPlatformAuthHandlerAvailable()"); return; } URL url = new URL("http://mylyn"); Platform.addAuthorizationInfo(url, "", "", Collections.EMPTY_MAP); assertNotNull("Tests require org.eclipse.core.runtime.compatibility.auth", Platform.getAuthorizationInfo(url, "", "")); }
Source:
public void timestampFiltersAreAdapted() { TimestampRangeFilter filter = new TimestampRangeFilter(10L, 20L); Filters.Filter expectedFilter = filterAdapter.adapt(emptyScanContext, filter); Assert.assertEquals(10000L, expectedFilter.toProto().getTimestampRangeFilter().getStartTimestampMicros()); Assert.assertEquals(20000L, expectedFilter.toProto().getTimestampRangeFilter().getEndTimestampMicros()); }

Target:
public void timestampFiltersAreAdapted() { TimestampRangeFilter filter = new TimestampRangeFilter(10L, 20L); Filters.Filter expectedFilter = filterAdapter.adapt(emptyScanContext, filter); TimestampRange expectedTimestampFilter = expectedFilter.toProto().getTimestampRangeFilter(); Assert.assertEquals(10000L, expectedTimestampFilter.getStartTimestampMicros()); Assert.assertEquals(20000L, expectedTimestampFilter.getEndTimestampMicros()); }
Source:
public int[] getDefaultTokens() { return new int[] { TokenTypes.LITERAL_TRY, TokenTypes.LITERAL_CATCH, TokenTypes.LITERAL_FINALLY, TokenTypes.LITERAL_IF, TokenTypes.LITERAL_ELSE, TokenTypes.LAMBDA, }; }

Target:
public int[] getDefaultTokens() { return new int[] { TokenTypes.LITERAL_TRY, TokenTypes.LITERAL_CATCH, TokenTypes.LITERAL_FINALLY, TokenTypes.LITERAL_IF, TokenTypes.LITERAL_ELSE, }; }
Source:
public boolean accept(File file) { if (file.lastModified() / ONE_SECOND + this.age <= System.currentTimeMillis()) { return true; } else if (this.discardCallback != null) { this.discardCallback.accept(file); } return false; }

Target:
public boolean accept(File file) { if (fileIsAged(file, System.currentTimeMillis() / ONE_SECOND)) { return true; } else if (this.discardCallback != null) { this.discardCallback.accept(file); } return false; }
Source:
public boolean setSubtreeChecked(Object element, boolean state) { IPreCheckStateListener preCheckStateListener = fPreCheckStateListener; if (preCheckStateListener != null && preCheckStateListener.setSubtreeChecked(element, state)) { setChecked(element, false); return false; } checkSubtree(element, state); return fCheckboxTreeViewer.setSubtreeChecked(element, state); }

Target:
public boolean setSubtreeChecked(Object element, boolean state) { checkSubtree(element, state); return fCheckboxTreeViewer.setSubtreeChecked(element, state); }
Source:
public void activate() { if (baseStation != null) { logger.info("Smarthomatic Binding activated. BaseStation=" + baseStation.toString()); } Bundle bundle = SmarthomaticActivator.getContext().getBundle(); URL fileURL = bundle.getEntry("xml/packet_layout.xml"); Packet packet = null; try { InputStream inputStream = fileURL.openConnection().getInputStream(); JAXBContext jaxbContext = JAXBContext.newInstance(Packet.class); Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); packet = (Packet) jaxbUnmarshaller.unmarshal(inputStream); } catch (IOException e1) { e1.printStackTrace(); } catch (JAXBException e) { e.printStackTrace(); } this.packet = packet; }

Target:
public void activate() { if (baseStation != null) { logger.info("Smarthomatic Binding activated. BaseStation= {}", baseStation.toString()); } Bundle bundle = SmarthomaticActivator.getContext().getBundle(); URL fileURL = bundle.getEntry("packet_layout.xml"); Packet packet = null; try { InputStream inputStream = fileURL.openConnection().getInputStream(); JAXBContext jaxbContext = JAXBContext.newInstance(Packet.class); Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); packet = (Packet) jaxbUnmarshaller.unmarshal(inputStream); } catch (IOException e1) { e1.printStackTrace(); } catch (JAXBException e) { e.printStackTrace(); } this.packet = packet; }
Source:
public HttpServerResponse setStreamPriority(StreamPriority streamPriority) { if(!streamPriority.equals(stream.getStreamPriority())) { stream.setStreamPriority(streamPriority); if(headWritten) { stream.writePriorityFrame(); } } return this; }

Target:
public HttpServerResponse setStreamPriority(StreamPriority streamPriority) { if(!streamPriority.equals(stream.priority())) { stream.priority(streamPriority); if(headWritten) { stream.writePriorityFrame(); } } return this; }
Source:
private boolean createJenkinsHook(GHRepository repo, URL url) { try { if (getDescriptor().isUseWebHooks()) { Collection<GHEvent> events = new ArrayList(); events.add(GHEvent.PULL_REQUEST); repo.createWebHook(new URL(url.toExternalForm()), events); } else { repo.createHook("jenkins", Collections.singletonMap("jenkins_hook_url", url.toExternalForm()), null, true); } return true; } catch (IOException e) { throw new GHException("Failed to update jenkins hooks", e); } }

Target:
private boolean createJenkinsHook(GHRepository repo, URL url) { try { if (getDescriptor().isUseWebHooks()) { repo.createWebHook(new URL(url.toExternalForm())); } else { repo.createHook("jenkins", Collections.singletonMap("jenkins_hook_url", url.toExternalForm()), null, true); } return true; } catch (IOException e) { throw new GHException("Failed to update jenkins hooks", e); } }
Source:
public byte[] getCacheKey() { byte[] fieldNameBytes = StringUtils.toUtf8WithNullToEmpty(fieldName); byte[] fieldExpressionBytes = StringUtils.toUtf8WithNullToEmpty(fieldExpression); return ByteBuffer.allocate(1 + fieldNameBytes.length + fieldExpressionBytes.length) .put(CACHE_TYPE_ID).put(fieldNameBytes).put(fieldExpressionBytes).array(); }

Target:
public byte[] getCacheKey() { byte[] fieldNameBytes = StringUtils.toUtf8WithNullToEmpty(fieldName); byte[] expressionBytes = StringUtils.toUtf8WithNullToEmpty(expression); return ByteBuffer.allocate(2 + fieldNameBytes.length + expressionBytes.length) .put(CACHE_TYPE_ID) .put(fieldNameBytes) .put(AggregatorUtil.STRING_SEPARATOR) .put(expressionBytes) .array(); }
Source:
private void redraw() { renderFixtures(); kiePage.refresh(view, versionRecordManager.getCurrentPath(), scenario); importsWidget.setContent(dmo, scenario.getImports(), isReadOnly); }

Target:
private void redraw() { renderFixtures(); settingsPage.refresh(view, versionRecordManager.getCurrentPath(), scenario); importsWidget.setContent(dmo, scenario.getImports(), isReadOnly); }
Source:
private static JsonNode loadModulesYamlFile(String path) { try (InputStream is = new FileInputStream(path)) { return yamlObjectMapper.readTree(is); } catch (IOException e) { log.error("Failed to load a module's yaml property file at: {}", path); throw new InternalErrorException("Failed to load a module's yaml property file.", e); } }

Target:
private static JsonNode loadModulesYamlFile(String path) { try { YAMLMapper mapper = new YAMLMapper(); return mapper.readTree(new File(path)); } catch (IOException e) { log.error("Failed to load a module's yaml property file at: {}", path); throw new ModulePropertyNotFoundException("Failed to load a module's yaml property file.", e); } }
Source:
protected boolean validateParameters() { if (getVdsGroup() == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_INVALID_CLUSTER_FOR_AFFINITY_GROUP); } if (getParameters().getAffinityGroup().getVmIds() != null) { VmStatic vmStatic = null; Set<Guid> vmSet = new HashSet<Guid>(); for (Guid vmId : getParameters().getAffinityGroup().getVmIds()) { vmStatic = getVmStaticDAO().get(vmId); if (vmStatic == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_INVALID_VM_FOR_AFFINITY_GROUP); } if (!vmStatic.getVdsGroupId().equals(getVdsGroupId())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_IN_AFFINITY_GROUP_CLUSTER); } if (vmSet.contains(vmStatic.getId())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DUPLICTE_VM_IN_AFFINITY_GROUP); } else { vmSet.add(vmStatic.getId()); } } } return true; }

Target:
protected boolean validateParameters() { if (getVdsGroup() == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_INVALID_CLUSTER_FOR_AFFINITY_GROUP); } if (getParameters().getAffinityGroup().getEntityIds() != null) { VmStatic vmStatic = null; Set<Guid> vmSet = new HashSet<Guid>(); for (Guid vmId : getParameters().getAffinityGroup().getEntityIds()) { vmStatic = getVmStaticDAO().get(vmId); if (vmStatic == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_INVALID_VM_FOR_AFFINITY_GROUP); } if (!vmStatic.getVdsGroupId().equals(getVdsGroupId())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_IN_AFFINITY_GROUP_CLUSTER); } if (vmSet.contains(vmStatic.getId())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DUPLICTE_VM_IN_AFFINITY_GROUP); } else { vmSet.add(vmStatic.getId()); } } } return true; }
Source:
public boolean doPreSetUserClaimValues(String userName, Map<String, String> claims, String profileName, UserStoreManager userStoreManager) throws UserStoreException { if(!IdentityValidationUtil.isValid(profileName,new String[]{"ALPHANUMERICS_ONLY","DIGITS_ONLY"},new String[]{ "WHITESPACE_EXISTS","URI_RESERVED_EXISTS","HTML_META_EXISTS","XML_META_EXISTS","REGEX_META_EXISTS", "URL"})){ throw new UserStoreException("profile name contains invalid characters!"); } return true; }

Target:
public boolean doPreSetUserClaimValues(String userName, Map<String, String> claims, String profileName, UserStoreManager userStoreManager) throws UserStoreException { if (!IdentityValidationUtil.isValid(profileName, new String[]{ALPHANUMERICS_ONLY, DIGITS_ONLY}, new String[]{ WHITESPACE_EXISTS, URI_RESERVED_EXISTS, HTML_META_EXISTS, XML_META_EXISTS, REGEX_META_EXISTS, URL})) { throw new UserStoreException("profile name contains invalid characters!"); } return true; }
Source:
private long getTime(final Operator operator) { final WorkerQueryPartition workerQueryPartition = (WorkerQueryPartition) operator.getQueryPartition(); final long workerStartTimeMillis = workerQueryPartition.getBeginMilliseconds(); final long threadStartTimeMillis = operator.getSubTreeTask().getBeginMilliseconds(); Preconditions.checkState(workerStartTimeMillis > 0, "Query initiualization time has not been recorded."); Preconditions.checkState(threadStartTimeMillis > 0, "Thread time has not been recorded."); final long startupTimeMillis = threadStartTimeMillis - workerStartTimeMillis; Preconditions.checkState(startupTimeMillis >= 0, "Thread that works on fragment cannot run (%s) before query is initialized (%s).", workerStartTimeMillis, threadStartTimeMillis); final long threadStartNanos = operator.getSubTreeTask().getBeginNanoseconds(); final long activeTimeNanos = System.nanoTime() - threadStartNanos; return TimeUnit.MILLISECONDS.toNanos(startupTimeMillis) + activeTimeNanos; }

Target:
private long getTime(final Operator operator) { final WorkerQueryPartition workerQueryPartition = (WorkerQueryPartition) operator.getQueryPartition(); final long workerStartTimeMillis = workerQueryPartition.getBeginMilliseconds(); final long threadStartTimeMillis = operator.getSubTreeTask().getBeginMilliseconds(); Preconditions.checkState(workerStartTimeMillis > 0, "Query initialization time has not been recorded."); Preconditions.checkState(threadStartTimeMillis > 0, "Thread time has not been recorded."); final long startupTimeMillis = threadStartTimeMillis - workerStartTimeMillis; Preconditions.checkState(startupTimeMillis >= 0, "Thread that works on fragment cannot run (%s) before query is initialized (%s).", workerStartTimeMillis, threadStartTimeMillis); final long threadStartNanos = operator.getSubTreeTask().getBeginNanoseconds(); final long activeTimeNanos = System.nanoTime() - threadStartNanos; return TimeUnit.MILLISECONDS.toNanos(startupTimeMillis) + activeTimeNanos; }
Source:
void pushFormAndAttachments(FormStatus form, List<Path> attachments, RunnerStatus runnerStatus, PushToAggregateTracker tracker, int part, int parts) { if (runnerStatus.isCancelled()) { tracker.trackCancellation("Push form"); return; } tracker.trackStartSendingFormAndAttachments(part, parts); Response<InputStream> response = http.execute(server.getPushFormRequest(form.getFormFile(briefcaseDir), attachments)); for (InputStream stream : server.getFileStreams()) { closeInputStream(stream); } server.getFileStreams().clear(); if (response.isSuccess()) tracker.trackEndSendingFormAndAttachments(part, parts); else tracker.trackErrorSendingFormAndAttachments(part, parts, response); }

Target:
void pushFormAndAttachments(FormStatus form, List<Path> attachments, RunnerStatus runnerStatus, PushToAggregateTracker tracker, int part, int parts) { if (runnerStatus.isCancelled()) { tracker.trackCancellation("Push form"); return; } tracker.trackStartSendingFormAndAttachments(part, parts); Response response = http.execute(server.getPushFormRequest(form.getFormFile(briefcaseDir), attachments)); if (response.isSuccess()) tracker.trackEndSendingFormAndAttachments(part, parts); else tracker.trackErrorSendingFormAndAttachments(part, parts, response); }
Source:
private Map<Pair<Integer, Integer>, ProjectVersion> loadExistingProjectsAsCache() { final Map<Pair<Integer, Integer>, ProjectVersion> allProjects = new ConcurrentHashMap<>(); logger.info("loading project dir metadata into memory"); for (final Path project : this.loadExistingProjects()) { if (Files.isDirectory(project)) { try { final String fileName = project.getFileName().toString(); final int projectId = Integer.parseInt(fileName.split("\\.")[0]); final int versionNum = Integer.parseInt(fileName.split("\\.")[1]); final ProjectVersion version = new ProjectVersion(projectId, versionNum, project.toFile()); final Path projectDirSizeFile = Paths .get(version.getInstalledDir().toString(), FlowPreparer.PROJECT_DIR_SIZE_FILE_NAME); if (Files.exists(projectDirSizeFile)) { version.setDirSizeInBytes(FileIOUtils.readNumberFromFile(projectDirSizeFile)); } else { FlowPreparer.updateDirSize(version.getInstalledDir(), version); } allProjects.put(new Pair<>(projectId, versionNum), version); } catch (final Exception e) { logger.error("error while loading project dir metadata", e); } } logger.info("finish loading project dir metadata into memory"); } return allProjects; }

Target:
private Map<Pair<Integer, Integer>, ProjectVersion> loadExistingProjectsAsCache() { final Map<Pair<Integer, Integer>, ProjectVersion> allProjects = new ConcurrentHashMap<>(); logger.info("loading project dir metadata into memory"); for (final Path project : this.loadExistingProjects()) { if (Files.isDirectory(project)) { try { final String fileName = project.getFileName().toString(); final int projectId = Integer.parseInt(fileName.split("\\.")[0]); final int versionNum = Integer.parseInt(fileName.split("\\.")[1]); final ProjectVersion projVersion = new ProjectVersion(projectId, versionNum, project.toFile()); final Path projectDirSizeFile = Paths .get(projVersion.getInstalledDir().toString(), FlowPreparer.PROJECT_DIR_SIZE_FILE_NAME); if (!Files.exists(projectDirSizeFile)) { FlowPreparer.updateDirSize(projVersion.getInstalledDir(), projVersion); } projVersion.setDirSizeInBytes(FileIOUtils.readNumberFromFile(projectDirSizeFile)); allProjects.put(new Pair<>(projectId, versionNum), projVersion); } catch (final Exception e) { logger.error("error while loading project dir metadata", e); } } logger.info("finish loading project dir metadata into memory"); } return allProjects; }
Source:
public void run_gradle_scirpt() { install("gradle-1.5", "1.5"); FreeStyleJob job = jenkins.jobs.create(); job.copyResource(resource("/gradle_plugin/script.gradle"), "build.gradle"); GradleStep step = job.addBuildStep(GradleStep.class); step.useVersion("gradle-1.5"); step.tasks.set("hello"); step.switches.set("--quiet"); job.save(); job.startBuild().shouldSucceed() .shouldContainsConsoleOutput("Hello world!") .shouldContainsConsoleOutput("gradle[\\w\\\\/\"]* --quiet") ; }

Target:
public void run_gradle_scirpt() { install("gradle-1.5", "1.5"); FreeStyleJob job = jenkins.jobs.create(); job.copyResource(resource("/gradle_plugin/script.gradle"), "build.gradle"); GradleStep step = job.addBuildStep(GradleStep.class); step.useVersion("gradle-1.5"); step.tasks.set("hello"); step.switches.set("--quiet"); job.save(); job.startBuild().shouldSucceed() .shouldContainsConsoleOutput("Hello world!") .shouldContainsConsoleOutput("gradle.* --quiet") ; }
Source:
public AsyncFuture<Void> mutateRow(final ByteString rowKey, final Mutations mutations) { return async.call(() -> { mutations.getMutations().forEach(mutation -> { switch (mutation.getMutationCase()) { case SET_CELL: final Mutation.SetCell setCell = mutation.getSetCell(); final ColumnFamily columnFamily = table.getColumnFamily(setCell.getFamilyName()).get(); if (columnFamily == null) { throw new IllegalArgumentException( "no such column family: " + setCell.getFamilyName()); } RowStorage rowStorage; synchronized (lock) { final Pair<ByteString, ColumnFamily> key = Pair.of(rowKey, columnFamily); rowStorage = rows.get(key); if (rowStorage == null) { rowStorage = new RowStorage(columnFamily); rows.put(key, rowStorage); } } rowStorage.runSetCell(setCell); break; default: throw new IllegalArgumentException( "Unsupported mutation: " + mutation.getMutationCase()); } }); return null; }); }

Target:
public AsyncFuture<Void> mutateRow(final ByteString rowKey, final Mutations mutations) { return async.call(() -> { mutations.getMutations().forEach(mutation -> { switch (mutation.getMutationCase()) { case SET_CELL: final Mutation.SetCell setCell = mutation.getSetCell(); final ColumnFamily columnFamily = table .getColumnFamily(setCell.getFamilyName()) .orElseThrow(() -> new IllegalArgumentException( "no such column family: " + setCell.getFamilyName())); final RowStorage rowStorage; synchronized (lock) { final Pair<ByteString, ColumnFamily> key = Pair.of(rowKey, columnFamily); rowStorage = rows.computeIfAbsent(key, k -> new RowStorage(columnFamily)); } rowStorage.runSetCell(setCell); break; default: throw new IllegalArgumentException( "Unsupported mutation: " + mutation.getMutationCase()); } }); return null; }); }
Source:
public String getInlineComments(int lines) { StringBuilder cmts = new StringBuilder(); final Repository repo = getRepository(); try { PatchList patchList = null; if (repo != null) { try { patchList = getPatchList(); } catch (PatchListNotAvailableException e) { patchList = null; } } Patch.Key currentFileKey = null; PatchFile currentFileData = null; for (final PatchLineComment c : inlineComments) { final Patch.Key pk = c.getKey().getParentKey(); if (!pk.equals(currentFileKey)) { if (Patch.COMMIT_MSG.equals(pk.get())) { cmts.append("Commit Message\n"); } else { cmts.append(makeChangeLink(pk)); cmts.append("\n"); cmts.append("File "); cmts.append(pk.getFileName()); cmts.append(":\n\n"); } currentFileKey = pk; if (patchList != null) { try { currentFileData = new PatchFile(repo, patchList, pk.get()); } catch (IOException e) { log.warn(String.format( "Cannot load %s from %s in %s", pk.getFileName(), patchList.getNewId().name(), projectState.getProject().getName()), e); currentFileData = null; } } } if (currentFileData != null) { appendComment(cmts, lines, currentFileData, c); } cmts.append("\n\n"); } } finally { if (repo != null) { repo.close(); } } return cmts.toString(); }

Target:
public String getInlineComments(int lines) { StringBuilder cmts = new StringBuilder(); final Repository repo = getRepository(); try { PatchList patchList = null; if (repo != null) { try { patchList = getPatchList(); } catch (PatchListNotAvailableException e) { patchList = null; } } Patch.Key currentFileKey = null; PatchFile currentFileData = null; for (final PatchLineComment c : inlineComments) { final Patch.Key pk = c.getKey().getParentKey(); if (!pk.equals(currentFileKey)) { String link = makeLink(pk); if (link != null) { cmts.append(link).append('\n'); } if (Patch.COMMIT_MSG.equals(pk.get())) { cmts.append("Commit Message:\n\n"); } else { cmts.append("File ").append(pk.get()).append(":\n\n"); } currentFileKey = pk; if (patchList != null) { try { currentFileData = new PatchFile(repo, patchList, pk.get()); } catch (IOException e) { log.warn(String.format( "Cannot load %s from %s in %s", pk.getFileName(), patchList.getNewId().name(), projectState.getProject().getName()), e); currentFileData = null; } } } if (currentFileData != null) { appendComment(cmts, lines, currentFileData, c); } cmts.append("\n\n"); } } finally { if (repo != null) { repo.close(); } } return cmts.toString(); }
Source:
public boolean eIsSet(int featureID) { switch (featureID) { case Csw20Package.QUERY_TYPE__ELEMENT_SET_NAME: return elementSetName != null; case Csw20Package.QUERY_TYPE__ELEMENT_NAME: return elementName != null && !elementName.isEmpty(); case Csw20Package.QUERY_TYPE__CONSTRAINT: return constraint != null; case Csw20Package.QUERY_TYPE__SORT_BY: return SORT_BY_EDEFAULT == null ? sortBy != null : !Arrays.equals(SORT_BY_EDEFAULT, sortBy); case Csw20Package.QUERY_TYPE__TYPE_NAMES: return typeNames != null; } return super.eIsSet(featureID); }

Target:
public boolean eIsSet(int featureID) { switch (featureID) { case Csw20Package.QUERY_TYPE__ELEMENT_SET_NAME: return elementSetName != null; case Csw20Package.QUERY_TYPE__ELEMENT_NAME: return elementName != null && !elementName.isEmpty(); case Csw20Package.QUERY_TYPE__CONSTRAINT: return constraint != null; case Csw20Package.QUERY_TYPE__SORT_BY: return SORT_BY_EDEFAULT == null ? sortBy != null : !SORT_BY_EDEFAULT.equals(sortBy); case Csw20Package.QUERY_TYPE__TYPE_NAMES: return typeNames != null; } return super.eIsSet(featureID); }
Source:
public Collection<ReceiveCommand> getCommands() { synchronized (lock) { return commands; } }

Target:
public Collection<ReceiveCommand> getCommands() { return commands; }
Source:
public void toDuplicateCounterString(StringBuilder sb) { sb.append("Unexpected Heartbeat"); }

Target:
public void toDuplicateCounterString(StringBuilder sb) { sb.append("Unexpected Coalesced Heartbeat"); }
Source:
public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + (Boolean.TRUE.equals(usingScsiReservation) ? 1231 : 1237); result = prime * result + ((lun == null) ? 0 : lun.hashCode()); return result; }

Target:
public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((usingScsiReservation == null) ? 0 : usingScsiReservation.hashCode()); result = prime * result + ((lun == null) ? 0 : lun.hashCode()); return result; }
Source:
Builder(MongoDBTracing mongoDBTracing) { this(mongoDBTracing.tracing); maxAbbreviatedCommandLength(mongoDBTracing.maxAbbreviatedCommandLength); clearCommandsWithCollectionName(); addAllCommandsWithCollectionName(mongoDBTracing.commandsWithCollectionName); }

Target:
Builder(MongoDBTracing mongoDBTracing) { tracing = mongoDBTracing.tracing; }
Source:
public Mono<ServiceBusReceiverAsyncClient> acceptSession(String sessionId) { if (sessionId == null) { return monoError(logger, new NullPointerException("'sessionId' cannot be null")); } if (CoreUtils.isNullOrEmpty(sessionId)) { return monoError(logger, new IllegalArgumentException("'sessionId' cannot be empty")); } final ReceiverOptions newReceiverOptions = new ReceiverOptions(receiverOptions.getReceiveMode(), receiverOptions.getPrefetchCount(), receiverOptions.getMaxLockRenewDuration(), receiverOptions.isEnableAutoComplete(), sessionId, null); final ServiceBusSessionManager sessionSpecificManager = new ServiceBusSessionManager(entityPath, entityType, connectionProcessor, tracerProvider, messageSerializer, newReceiverOptions); if (CoreUtils.isNullOrEmpty(sessionId)) { return sessionSpecificManager.getActiveLink().map(receiveLink -> new ServiceBusReceiverAsyncClient( fullyQualifiedNamespace, entityPath, entityType, newReceiverOptions, connectionProcessor, ServiceBusConstants.OPERATION_TIMEOUT, tracerProvider, messageSerializer, () -> { }, sessionSpecificManager)); } else { ServiceBusReceiverAsyncClient sessionSpecificAsyncClient = new ServiceBusReceiverAsyncClient(fullyQualifiedNamespace, entityPath, entityType, newReceiverOptions, connectionProcessor, ServiceBusConstants.OPERATION_TIMEOUT, tracerProvider, messageSerializer, () -> { }); return sessionSpecificAsyncClient.getOrCreateConsumerAsync().map(consumer -> new ServiceBusReceiverAsyncClient(fullyQualifiedNamespace, entityPath, entityType, newReceiverOptions, connectionProcessor, ServiceBusConstants.OPERATION_TIMEOUT, tracerProvider, messageSerializer, () -> { }, consumer)); } }

Target:
public Mono<ServiceBusReceiverAsyncClient> acceptSession(String sessionId) { if (sessionId == null) { return monoError(logger, new NullPointerException("'sessionId' cannot be null")); } if (CoreUtils.isNullOrEmpty(sessionId)) { return monoError(logger, new IllegalArgumentException("'sessionId' cannot be empty")); } final ReceiverOptions newReceiverOptions = new ReceiverOptions(receiverOptions.getReceiveMode(), receiverOptions.getPrefetchCount(), receiverOptions.getMaxLockRenewDuration(), receiverOptions.isEnableAutoComplete(), sessionId, null); ServiceBusReceiverAsyncClient sessionSpecificAsyncClient = new ServiceBusReceiverAsyncClient( fullyQualifiedNamespace, entityPath, entityType, newReceiverOptions, connectionProcessor, ServiceBusConstants.OPERATION_TIMEOUT, tracerProvider, messageSerializer, () -> { }); return sessionSpecificAsyncClient.createConsumerWithReceiveLink() .thenReturn(sessionSpecificAsyncClient); }
Source:
public static User fromLdapUser(InetOrgPerson details) { final UserImpl user = new UserImpl(); final List<String> roles = new ArrayList<String>(); for (final GrantedAuthority ga : details.getAuthorities()) { roles.add(removePrefix(ga.toString(), LimsSecurityUtils.rolePrefix)); } user.setRoles(roles.toArray(new String[0])); user.setActive(details.isAccountNonExpired()); user.setAdmin(roles.contains(new GrantedAuthorityImpl("ROLE_ADMIN"))); user.setExternal(roles.contains(new GrantedAuthorityImpl("ROLE_EXTERNAL"))); user.setInternal(roles.contains(new GrantedAuthorityImpl("ROLE_INTERNAL"))); user.setLoginName(details.getUsername().toLowerCase()); if (details.getPassword() == null) { log.debug("This directory has been configured correctly and has properly returned a null password. Setting fake password " + "to satisfy the requirements of the MISO User object."); user.setPassword("fake_password_2905058jf8j84t1gkxi96841mvck48s9575"); } else { user.setPassword(details.getPassword()); } user.setFullName(details.getDisplayName()); user.setEmail(details.getMail()); return user; }

Target:
public static User fromLdapUser(InetOrgPerson details) { final UserImpl user = new UserImpl(); final List<String> roles = new ArrayList<String>(); for (final GrantedAuthority ga : details.getAuthorities()) { roles.add(removePrefix(ga.toString(), LimsSecurityUtils.rolePrefix)); } user.setRoles(roles.toArray(new String[0])); user.setActive(details.isAccountNonExpired()); user.setAdmin(roles.contains(MisoAuthority.ROLE_ADMIN.name())); user.setExternal(roles.contains(MisoAuthority.ROLE_EXTERNAL.name())); user.setInternal(roles.contains(MisoAuthority.ROLE_INTERNAL.name())); user.setLoginName(details.getUsername().toLowerCase()); user.setPassword(details.getPassword()); user.setFullName(details.getDisplayName()); user.setEmail(details.getMail()); return user; }
Source:
private void writeAudits(final List<AccountGroupMember> toBeRemoved) throws OrmException { final Account.Id me = ((IdentifiedUser) self.get()).getAccountId(); for (final AccountGroupMember m : toBeRemoved) { AccountGroupMemberAudit audit = null; for (AccountGroupMemberAudit a : db.accountGroupMembersAudit() .byGroupAccount(m.getAccountGroupId(), m.getAccountId())) { if (a.isActive()) { audit = a; break; } } if (audit != null) { audit.removed(me); db.accountGroupMembersAudit().update(Collections.singleton(audit)); } else { audit = new AccountGroupMemberAudit(m, me); audit.removedLegacy(); db.accountGroupMembersAudit().insert(Collections.singleton(audit)); } } }

Target:
private void writeAudits(final List<AccountGroupMember> toBeRemoved) throws OrmException { final Account.Id me = ((IdentifiedUser) self.get()).getAccountId(); final List<AccountGroupMemberAudit> auditUpdates = Lists.newLinkedList(); final List<AccountGroupMemberAudit> auditInserts = Lists.newLinkedList(); for (final AccountGroupMember m : toBeRemoved) { AccountGroupMemberAudit audit = null; for (AccountGroupMemberAudit a : db.accountGroupMembersAudit() .byGroupAccount(m.getAccountGroupId(), m.getAccountId())) { if (a.isActive()) { audit = a; break; } } if (audit != null) { audit.removed(me); auditUpdates.add(audit); } else { audit = new AccountGroupMemberAudit(m, me); audit.removedLegacy(); auditInserts.add(audit); } } db.accountGroupMembersAudit().update(auditUpdates); db.accountGroupMembersAudit().insert(auditInserts); }
Source:
public boolean canSwitchToBroker() throws DeveloperAuthenticationException { String packageName = mContext.getPackageName(); return !AuthenticationSettings.INSTANCE.getSkipBroker() && verifyManifestPermissions() && checkAccount(mAcctManager, "", "") && !packageName.equalsIgnoreCase(AuthenticationSettings.INSTANCE .getBrokerPackageName()) && !packageName .equalsIgnoreCase(AuthenticationConstants.Broker.AZURE_AUTHENTICATOR_APP_PACKAGE_NAME) && verifyAuthenticator(mAcctManager); }

Target:
public boolean canSwitchToBroker() throws UsageAuthenticationException { String packageName = mContext.getPackageName(); return AuthenticationSettings.INSTANCE.getUseBroker() && checkAccount(mAcctManager, "", "") && !packageName.equalsIgnoreCase(AuthenticationSettings.INSTANCE .getBrokerPackageName()) && !packageName .equalsIgnoreCase(AuthenticationConstants.Broker.AZURE_AUTHENTICATOR_APP_PACKAGE_NAME) && verifyAuthenticator(mAcctManager) && verifyManifestPermissions(); }
Source:
public void stop() { pool.shutdownNow(); regionNormalizerTracker.stop(); }

Target:
public void stop() { synchronized (startStopLock) { if (!started) { throw new IllegalStateException("calling `stop` without first calling `start`."); } if (stopped) { return; } pool.shutdownNow(); regionNormalizerTracker.stop(); stopped = true; } }
Source:
public void setStartTime(Long startTime) { this.startTime = Instant.ofEpochMilli(startTime).atZone(ZoneId.systemDefault()).toLocalDateTime(); }

Target:
public void setStartTime(Long startTime) { if (startTime != null) { this.startTime = Instant.ofEpochMilli(startTime).atZone(ZoneId.systemDefault()).toLocalDateTime(); } else { this.startTime = null; } }
Source:
public static @Nullable ITmfEventAspect<?> create(Iterable<ITmfEventAspect<?>> aspects, Class<?> aspectClass) { int size = Iterables.size(aspects); if (size == 0) { return null; } if (size == 1) { return Iterables.get(aspects, 0); } Set<String> names = new HashSet<>(); for (ITmfEventAspect<?> aspect : aspects) { if (aspect.getClass().isAssignableFrom(aspectClass)) { names.add(aspect.getName()); } else { throw new IllegalArgumentException("Aspects must belong to the same class as the \"aspectClass\" parameter."); } } if (names.size() != 1) { StringJoiner sj = new StringJoiner(", "); names.forEach(sj::add); LOGGER.log(Level.WARNING, () -> "Aspects do not have the same name: " + sj.toString()); } return new MultiAspect<>(Iterables.get(names, 0), aspects); }

Target:
public static @Nullable ITmfEventAspect<?> create(Iterable<ITmfEventAspect<?>> aspects, Class<?> aspectClass) { int size = Iterables.size(aspects); if (size == 0 || size == 1) { return Iterables.getFirst(aspects, null); } Set<String> names = new HashSet<>(); for (ITmfEventAspect<?> aspect : aspects) { if (aspect.getClass().isAssignableFrom(aspectClass)) { names.add(aspect.getName()); } else { throw new IllegalArgumentException("Aspects must belong to the same class as the \"aspectClass\" parameter."); } } if (names.size() != 1) { StringJoiner sj = new StringJoiner(", "); names.forEach(sj::add); LOGGER.log(Level.WARNING, () -> "Aspects do not have the same name: " + sj.toString()); } return new MultiAspect<>(Iterables.get(names, 0), aspects); }