auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testEqualsIgnoreValueOrder_exactlyEqual() { MultivaluedHashMap map = new MultivaluedHashMap(); MultivaluedHashMap equalMap = new MultivaluedHashMap(); map.put(1, Arrays.asList(new Integer[]{1, 2, 3})); equalMap.put(1, Arrays.asList(new Integer[]{1, 2, 3})); equalsIgnoreValueOrder_shouldReturnTrueForEqualMaps(map, equalMap); map.put(2, Arrays.asList(new Integer[]{4, 5, 6})); equalMap.put(2, Arrays.asList(new Integer[]{4, 5, 6})); equalsIgnoreValueOrder_shouldReturnTrueForEqualMaps(map, equalMap); map.put("c", Arrays.asList(new String[]{"x", "y", "z"})); equalMap.put("c", Arrays.asList(new String[]{"x", "y", "z"})); equalsIgnoreValueOrder_shouldReturnTrueForEqualMaps(map, equalMap); }

Target:
public void testEqualsIgnoreValueOrder_exactlyEqual() { MultivaluedHashMap<Integer, Integer> map = new MultivaluedHashMap<>(); MultivaluedHashMap<Integer, Integer> equalMap = new MultivaluedHashMap<>(); map.put(1, Arrays.asList(1, 2, 3)); equalMap.put(1, Arrays.asList(1, 2, 3)); equalsIgnoreValueOrder_shouldReturnTrueForEqualMaps(map, equalMap); map.put(2, Arrays.asList(4, 5, 6)); equalMap.put(2, Arrays.asList(4, 5, 6)); equalsIgnoreValueOrder_shouldReturnTrueForEqualMaps(map, equalMap); map.put(3, Arrays.asList(7, 8, 9)); equalMap.put(3, Arrays.asList(7, 8, 9)); equalsIgnoreValueOrder_shouldReturnTrueForEqualMaps(map, equalMap); }
Source:
private String genUnique() { long timePart = (System.currentTimeMillis() << 5) | (msCounter++ & 31); long ipPart = 0; try { for (byte addres : InetAddress.getLocalHost().getAddress()) ipPart = ((ipPart << 8) | (addres & 0xff)); } catch (UnknownHostException e) { } int port = 0; try { socket = new ServerSocket(0, 1, InetAddress.getByName("127.0.0.1")); port = socket.getLocalPort(); } catch (IOException e) { try { if (socket != null) socket.close(); } catch (IOException e1) { } port = new Random().nextInt() & 0xffff; } long aPart = (ipPart << 16) | (port & 0xffff); return Long.toHexString(timePart) + "_" + Long.toHexString(aPart); }

Target:
private String genUnique() { long timePart = (System.currentTimeMillis() << 5) | (msCounter++ & 31); long ipPart = 0; try { for (byte addressPart : InetAddress.getLocalHost().getAddress()) { ipPart = ((ipPart << 8) | (addressPart & 0xff)); } } catch (UnknownHostException e) { } int port = 0; try { socket = new ServerSocket(0, 1, InetAddress.getByName("127.0.0.1")); port = socket.getLocalPort(); } catch (IOException e) { try { if (socket != null) socket.close(); } catch (IOException e1) { } port = new Random().nextInt() & 0xffff; } long aPart = (ipPart << 16) | (port & 0xffff); return Long.toHexString(timePart) + "_" + Long.toHexString(aPart); }
Source:
public void run() { if (WatchDogGlobals.isActive) { long executionDate = System.currentTimeMillis(); long delta = executionDate - previousExecutionDate; boolean deltaIsWithinReasonableBoundaries = delta >= UPDATE_RATE && delta <= UPDATE_RATE * 1.16; if (!deltaIsWithinReasonableBoundaries) { WatchDogLogger.getInstance().logInfo( "System suspend detected!"); intervalManager.closeAllIntervals(new Date( previousExecutionDate + UPDATE_RATE)); intervalManager.generateAndSetSessionSeed(); WatchDogEventType.START_IDE.process(this); WatchDogEventType.editorSpecificImplementation.updatePerspectiveInterval(); } } startTimeCheckerOnce(); previousExecutionDate = System.currentTimeMillis(); }

Target:
public void run() { if (WatchDogGlobals.isActive) { long executionDate = System.currentTimeMillis(); long delta = executionDate - previousExecutionDate; boolean deltaIsWithinReasonableBoundaries = delta >= UPDATE_RATE && delta <= UPDATE_RATE * 1.16; if (!deltaIsWithinReasonableBoundaries) { WatchDogLogger.getInstance().logInfo( "System suspend detected!"); intervalManager.closeAllIntervals(new Date( previousExecutionDate + UPDATE_RATE)); intervalManager.generateAndSetSessionSeed(); WatchDogEventType.START_IDE.process(this); WatchDogEventType.editorSpecificImplementation.processPerspectiveInterval(); } } startTimeCheckerOnce(); previousExecutionDate = System.currentTimeMillis(); }
Source:
private boolean prepare() { try { if (log.isDebugEnabled()) { log.debug("Executing prepare: " + prepareSql); } jdbcTemplate.execute(prepareSql); } catch (DataAccessException e) { lastException = e; return false; } return true; }

Target:
private boolean prepare() { try { if (log.isDebugEnabled()) { log.debug("Executing prepare: " + prepareSql); } jdbcTemplate.execute(prepareSql); } catch (DataAccessException e) { log.error("Error during prepare sql", e); lastException = e; return false; } return true; }
Source:
public Set<K> keySet() { return new AbstractSet<K>() { @Override public Iterator<K> iterator() { purgeKeys(); final Iterator<WeakReference<K>> iterator = map.keySet().iterator(); final AtomicReference<K> ref = new AtomicReference<K>(); advance(iterator, ref); return new Iterator<K>() { @Override public boolean hasNext() { return ref.get() != null; } @Override public K next() { K k = ref.get(); advance(iterator, ref); return k; } @Override public void remove() { ConcurrentWeakIdentityHashMap.this.remove(ref.get()); advance(iterator, ref); } }; } private void advance(Iterator<WeakReference<K>> iterator, AtomicReference<K> ref) { while (iterator.hasNext()) { K next = iterator.next().get(); if (next != null) { ref.set(next); return; } } ref.set(null); } @Override public boolean contains(Object o) { return ConcurrentWeakIdentityHashMap.this.containsKey(o); } @Override public int size() { return map.size(); } }; }

Target:
public Set<K> keySet() { return new AbstractSet<K>() { @Override public Iterator<K> iterator() { purgeKeys(); return new WeakSafeIterator<K, WeakReference<K>>(map.keySet().iterator()) { @Override protected K extract(WeakReference<K> u) { return u.get(); } }; } @Override public boolean contains(Object o) { return ConcurrentWeakIdentityHashMap.this.containsKey(o); } @Override public int size() { return map.size(); } }; }
Source:
public void basicWithAnonymous() { given(this.authenticationManager.authenticate(any())).willReturn(Mono.just(new TestingAuthenticationToken("rob", "rob", "ROLE_USER", "ROLE_ADMIN"))); this.http.securityContextRepository(new WebSessionServerSecurityContextRepository()); this.http.httpBasic().and().anonymous(); this.http.authenticationManager(this.authenticationManager); ServerHttpSecurity.AuthorizeExchangeSpec authorize = this.http.authorizeExchange(); authorize.anyExchange().hasAuthority("ROLE_ADMIN"); WebTestClient client = buildClient(); EntityExchangeResult<String> result = client.get() .uri("/") .headers(headers -> headers.setBasicAuth("rob", "rob")) .exchange() .expectStatus().isOk() .expectHeader().valueMatches(HttpHeaders.CACHE_CONTROL, ".+") .expectBody(String.class).consumeWith(b -> assertThat(b.getResponseBody()).isEqualTo("ok")) .returnResult(); assertThat(result.getResponseCookies().getFirst("SESSION")).isNotNull(); }

Target:
public void basicWithAnonymous() { given(this.authenticationManager.authenticate(any())).willReturn(Mono.just(new TestingAuthenticationToken("rob", "rob", "ROLE_USER", "ROLE_ADMIN"))); this.http.httpBasic().and().anonymous(); this.http.authenticationManager(this.authenticationManager); ServerHttpSecurity.AuthorizeExchangeSpec authorize = this.http.authorizeExchange(); authorize.anyExchange().hasAuthority("ROLE_ADMIN"); WebTestClient client = buildClient(); EntityExchangeResult<String> result = client.get() .uri("/") .headers(headers -> headers.setBasicAuth("rob", "rob")) .exchange() .expectStatus().isOk() .expectHeader().valueMatches(HttpHeaders.CACHE_CONTROL, ".+") .expectBody(String.class).consumeWith(b -> assertThat(b.getResponseBody()).isEqualTo("ok")) .returnResult(); assertThat(result.getResponseCookies().getFirst("SESSION")).isNull(); }
Source:
private void show(final String graphUuid, final Element<? extends Definition<?>> element, final Command callback) { final String uuid = element.getUUID(); final Diagram<?, ?> diagram = formSessionHandler.getDiagram(); final Object definition = element.getContent().getDefinition(); final RenderMode renderMode = formSessionHandler.getSession() instanceof EditorSession ? RenderMode.EDIT_MODE : RenderMode.READ_ONLY_MODE; formsContainer.render(graphUuid, element.getUUID(), element.getContent().getDefinition(), diagram.getMetadata().getPath(), (fieldName, newValue) -> { try { formSessionHandler.executeUpdateProperty(element, fieldName, newValue); } catch (final Exception ex) { log(Level.SEVERE, "Something wrong happened refreshing the canvas for " + "field '" + fieldName + "': " + ex.getCause()); } finally { if (null != callback) { callback.execute(); } } }, renderMode); final String name = definitionUtils.getName(definition); propertiesOpenedEvent.fire(new FormPropertiesOpened(formSessionHandler.getSession(), uuid, name)); }

Target:
private void show(final String graphUuid, final Element<? extends Definition<?>> element, final Command callback) { final String uuid = element.getUUID(); final Diagram<?, ?> diagram = formSessionHandler.getDiagram(); if (Objects.isNull(diagram)) { return; } final Metadata metadata = diagram.getMetadata(); if (Objects.isNull(metadata)) { return; } final Path diagramPath = metadata.getPath(); final Definition content = element.getContent(); if (Objects.isNull(content)) { return; } final Object definition = content.getDefinition(); final RenderMode renderMode = formSessionHandler.getSession() instanceof EditorSession ? RenderMode.EDIT_MODE : RenderMode.READ_ONLY_MODE; formsContainer.render(graphUuid, uuid, definition, diagramPath, (fieldName, newValue) -> { try { formSessionHandler.executeUpdateProperty(element, fieldName, newValue); } catch (final Exception ex) { log(Level.SEVERE, "Something wrong happened refreshing the canvas for " + "field '" + fieldName + "': " + ex.getCause()); } finally { if (null != callback) { callback.execute(); } } }, renderMode); final String name = definitionUtils.getName(definition); propertiesOpenedEvent.fire(new FormPropertiesOpened(formSessionHandler.getSession(), uuid, name)); }
Source:
public void properties() throws Exception { assertThat(JavaScriptLegacyGrammar.CLASS_ELEMENT) .matches("property ;") .matches("1 ;") .matches("'prop_name' ;") .matches("[21 + 21] ;") .matches("property = 1 ;") .matches("property = foo() ;") .matches("static property ;") .matches("static property = 1 ;") .notMatches("property = 1") ; }

Target:
public void properties() throws Exception { assertThat(JavaScriptLegacyGrammar.CLASS_ELEMENT) .matches("property ;") .matches("1 ;") .matches("'prop_name' ;") .matches("[21 + 21] ;") .matches("property = 1 ;") .matches("property = foo() ;") .matches("property = notProperty = 0 ;") .matches("property = () => ;") .matches("static property ;") .matches("static property = 1 ;") .matches("property = 1") .notMatches("property =;") .notMatches("static;") ; }
Source:
public void transform(KeyValue<LongWritable, Text> input, Emitter<StructuredRecord> emitter) throws IOException { getOutputSchema(); StructuredRecord record = jsonTransform(input.getValue()); emitter.emit(record); }

Target:
public void transform(KeyValue<LongWritable, Text> input, Emitter<StructuredRecord> emitter) throws IOException { StructuredRecord record = convertToStructuredRecord(input.getValue()); emitter.emit(record); }
Source:
public void priorityWithDependencyAndFailures() { TestNG tng = create(SampleTest01.class, SampleTest02.class); tng.setParallel(XmlSuite.ParallelMode.CLASSES); tng.run(); List<String> sampleTest01Methods = Arrays.asList("test0010_createAction", "test0030_advancedSearch", "test0060_deleteAction"); Assert.assertEquals(TestListener.methods.get(SampleTest01.class), sampleTest01Methods); }

Target:
public void priorityWithDependencyAndFailures() { TestNG tng = create(SampleTest01.class, SampleTest02.class); tng.setParallel(XmlSuite.ParallelMode.CLASSES); InvokedMethodNameListener listener = new InvokedMethodNameListener(); tng.addListener((ITestNGListener) listener); tng.run(); List<String> sampleTest01Methods = Arrays.asList("test0010_createAction", "test0030_advancedSearch", "test0060_deleteAction"); Assert.assertEquals(listener.getMethodsForTestClass(SampleTest01.class), sampleTest01Methods); }
Source:
public Collection<RootOperatorImpl> getAll() { return this.operatorGraph.values(); }

Target:
public Collection<RootOperatorImpl> getAll() { return Collections.unmodifiableCollection(this.operatorGraph.values()); }
Source:
private static int getCodePointAtSafe(Slice utf8, int position) { byte firstByte = utf8.getByte(position); int length = lengthOfCodePointFromStartByteSafe(firstByte); if (length < 0) { return length; } if (position + length > utf8.length()) { return -(utf8.length() - position); } if (length == 1) { return firstByte; } byte secondByte = utf8.getByte(position + 1); if (!isContinuationByte(secondByte)) { return -1; } if (length == 2) { return ((firstByte & 0b0001_1111) << 6) | (secondByte & 0b0011_1111); } byte thirdByte = utf8.getByteUnchecked(position + 2); if (!isContinuationByte(thirdByte)) { return -2; } if (length == 3) { return ((firstByte & 0b0000_1111) << 12) | ((secondByte & 0b0011_1111) << 6) | (thirdByte & 0b0011_1111); } byte forthByte = utf8.getByteUnchecked(position + 3); if (!isContinuationByte(forthByte)) { return -3; } if (length == 4) { int codePoint = ((firstByte & 0b0000_0111) << 18) | ((secondByte & 0b0011_1111) << 12) | ((thirdByte & 0b0011_1111) << 6) | (forthByte & 0b0011_1111); if (codePoint < 0x11_0000) { return codePoint; } return -4; } byte fifthByte = utf8.getByteUnchecked(position + 4); if (!isContinuationByte(fifthByte)) { return -4; } if (length == 5) { return -5; } byte sixthByte = utf8.getByteUnchecked(position + 5); if (!isContinuationByte(sixthByte)) { return -5; } if (length == 6) { return -6; } return -1; }

Target:
private static int getCodePointAtSafe(Slice utf8, int position) { byte firstByte = utf8.getByte(position); int length = lengthOfCodePointFromStartByteSafe(firstByte); if (length < 0) { return length; } if (length == 1) { return firstByte; } if (position + 1 >= utf8.length()) { return -1; } byte secondByte = utf8.getByteUnchecked(position + 1); if (!isContinuationByte(secondByte)) { return -1; } if (length == 2) { return ((firstByte & 0b0001_1111) << 6) | (secondByte & 0b0011_1111); } if (position + 2 >= utf8.length()) { return -2; } byte thirdByte = utf8.getByteUnchecked(position + 2); if (!isContinuationByte(thirdByte)) { return -2; } if (length == 3) { int codePoint = ((firstByte & 0b0000_1111) << 12) | ((secondByte & 0b0011_1111) << 6) | (thirdByte & 0b0011_1111); if (MIN_SURROGATE <= codePoint && codePoint <= MAX_SURROGATE) { return -3; } return codePoint; } if (position + 3 >= utf8.length()) { return -3; } byte forthByte = utf8.getByteUnchecked(position + 3); if (!isContinuationByte(forthByte)) { return -3; } if (length == 4) { int codePoint = ((firstByte & 0b0000_0111) << 18) | ((secondByte & 0b0011_1111) << 12) | ((thirdByte & 0b0011_1111) << 6) | (forthByte & 0b0011_1111); if (codePoint < 0x11_0000) { return codePoint; } return -4; } if (position + 4 >= utf8.length()) { return -4; } byte fifthByte = utf8.getByteUnchecked(position + 4); if (!isContinuationByte(fifthByte)) { return -4; } if (length == 5) { return -5; } if (position + 5 >= utf8.length()) { return -5; } byte sixthByte = utf8.getByteUnchecked(position + 5); if (!isContinuationByte(sixthByte)) { return -5; } if (length == 6) { return -6; } return -1; }
Source:
protected RepositorySelection getRepositorySelection() { try { return (new RepositorySelection(new URIish(currentSearchResult.getGitRepositoryInfo().getCloneUri()), null)); } catch (URISyntaxException e) { Activator.error("URI can't be parsed", e); return null; } }

Target:
protected RepositorySelection getRepositorySelection() { try { return (new RepositorySelection(new URIish(currentSearchResult.getGitRepositoryInfo().getCloneUri()), null)); } catch (URISyntaxException e) { Activator.error(UIText.GitImportWizard_errorParsingURI, e); return null; } }
Source:
public static void runJSTestSuite() throws InterruptedException { int timeout = Build.SUPPORTED_ABIS[0].contains("armeabi") ? 180 : 60; JSTestCase.runJSTestSuite(JS_SUITE, data(), timeout); }

Target:
public static void runJSTestSuite() throws InterruptedException { JSTestCase.runJSTestSuite(JS_SUITE, data(), 180); }
Source:
public void initialize() { this.application.initializers(new ContextIdApplicationContextInitializer(this.toString())); ConfigurableEnvironment environment = new StandardEnvironment(); if (parent != null) { copyEnvironment(environment, parent.getEnvironment()); } for (PropertySource<?> source : propertySources) { environment.getPropertySources().addLast(source); } this.application.parent(parent); this.application.environment(environment); this.application.listeners(new ParentContextCloserApplicationListener() { @Override public void onApplicationEvent(ParentContextAvailableEvent event) { ConfigurableApplicationContext child = event.getApplicationContext(); if (child.getParent() instanceof ConfigurableApplicationContext) { ConfigurableApplicationContext parent = (ConfigurableApplicationContext) child .getParent(); parent.addApplicationListener(new ModuleContextCloserListener(child)); } } final class ModuleContextCloserListener extends ContextCloserListener implements Ordered { public ModuleContextCloserListener(ConfigurableApplicationContext moduleContext) { super(moduleContext); } @Override public int getOrder() { if (getType() == ModuleType.sink) { return HIGHEST_PRECEDENCE; } else if (getType() == ModuleType.processor) { return LOWEST_PRECEDENCE - 10; } else { return LOWEST_PRECEDENCE; } } } }); this.context = this.application.run(); if (logger.isInfoEnabled()) { logger.info("initialized module: " + this.toString()); } }

Target:
public void initialize() { this.application.initializers(new ContextIdApplicationContextInitializer(this.toString())); ConfigurableEnvironment environment = new StandardEnvironment(); if (parent != null) { copyEnvironment(environment, parent.getEnvironment()); } for (PropertySource<?> source : propertySources) { environment.getPropertySources().addLast(source); } this.application.parent(parent); this.application.environment(environment); this.application.listeners(new ParentContextCloserApplicationListener() { @Override public void onApplicationEvent(ParentContextAvailableEvent event) { ConfigurableApplicationContext child = event.getApplicationContext(); if (child.getParent() instanceof ConfigurableApplicationContext) { ConfigurableApplicationContext parent = (ConfigurableApplicationContext) child .getParent(); parent.addApplicationListener(new ModuleContextCloserListener(child)); } } final class ModuleContextCloserListener extends ContextCloserListener implements Ordered { public ModuleContextCloserListener(ConfigurableApplicationContext moduleContext) { super(moduleContext); } @Override public int getOrder() { ModuleType moduleType = getType(); if (moduleType == ModuleType.source || moduleType == ModuleType.job) { return HIGHEST_PRECEDENCE; } else if (getType() == ModuleType.processor) { return LOWEST_PRECEDENCE - 10; } else { return LOWEST_PRECEDENCE; } } } }); this.context = this.application.run(); if (logger.isInfoEnabled()) { logger.info("initialized module: " + this.toString()); } }
Source:
public static Hosts parse(String hostString, Integer explicitGlobalPort, Integer defaultPort) { List<String> hosts = new ArrayList<>(); List<Integer> ports = new ArrayList<>(); if ( hostString == null || hostString.trim().isEmpty() ) { return Hosts.NO_HOST; } String[] splits = hostString.split( "," ); for (String rawSplit : splits) { String split = rawSplit.trim(); Matcher matcher = HOST_AND_PORT_PATTERN.matcher( split ); String host = null; Integer port = null; if ( matcher.matches() ) { setCleanHost( matcher, hosts ); setPort( ports, matcher, explicitGlobalPort, splits, defaultPort ); } else { throw LOG.unableToParseHost( hostString ); } } return new Hosts(hosts, ports); }

Target:
public static Hosts parse(String hostString, Integer explicitGlobalPort, Integer defaultPort) { List<String> hosts = new ArrayList<>(); List<Integer> ports = new ArrayList<>(); if ( hostString == null || hostString.trim().isEmpty() ) { return Hosts.NO_HOST; } String[] splits = hostString.split( "," ); for (String rawSplit : splits) { String split = rawSplit.trim(); Matcher matcher = HOST_AND_PORT_PATTERN.matcher( split ); if ( matcher.matches() ) { setCleanHost( matcher, hosts ); setPort( ports, matcher, explicitGlobalPort, splits, defaultPort ); } else { throw LOG.unableToParseHost( hostString ); } } return new Hosts(hosts, ports); }
Source:
default String[] getFormatFieldTypes() { return Arrays.stream(getSchema().getFieldNames()) .filter(name -> !getPartitionKeys().contains(name)) .toArray(String[]::new); }

Target:
default DataType[] getFormatFieldTypes() { return Arrays.stream(getSchema().getFieldNames()) .filter(name -> !getPartitionKeys().contains(name)) .map(name -> getSchema().getFieldDataType(name).get()) .toArray(DataType[]::new); }
Source:
public void run() { while (listenerRunning) { try { Socket s = ss.accept(); BufferedInputStream is = new BufferedInputStream(s.getInputStream()); LearnerHandler lh = new LearnerHandler(s, is, this); lh.start(); } catch (Exception e) { if (listenerRunning) { LOG.debug("Ignoring accept exception (maybe shutting down)", e); } else { LOG.debug("Ignoring accept exception (maybe client closed)", e); } } } }

Target:
public void run() { while (listenerRunning) { try { Socket s = ss.accept(); s.setSoTimeout(self.tickTime * self.initLimit); BufferedInputStream is = new BufferedInputStream(s.getInputStream()); LearnerHandler lh = new LearnerHandler(s, is, this); lh.start(); } catch (Exception e) { if (listenerRunning) { LOG.debug("Ignoring accept exception (maybe shutting down)", e); } else { LOG.debug("Ignoring accept exception (maybe client closed)", e); } } } }
Source:
private Mono<Response<RecognizePiiEntitiesResultCollection>> getRecognizePiiEntitiesResponse( Iterable<TextDocumentInput> documents, RecognizePiiEntityOptions options, Context context) { return service.entitiesRecognitionPiiWithResponseAsync( new MultiLanguageBatchInput().setDocuments(toMultiLanguageInput(documents)), options == null ? null : options.getModelVersion(), options == null ? null : options.isIncludeStatistics(), options == null ? null : options.getDomainFilter() == null ? null : options.getDomainFilter().toString(), null, context.addData(AZ_TRACING_NAMESPACE_KEY, COGNITIVE_TRACING_NAMESPACE_VALUE)) .doOnSubscribe(ignoredValue -> logger.info( "Start recognizing Personally Identifiable Information entities for a batch of documents.")) .doOnSuccess(response -> logger.info( "Successfully recognized Personally Identifiable Information entities for a batch of documents.")) .doOnError(error -> logger.warning("Failed to recognize Personally Identifiable Information entities - {}", error)) .map(this::toRecognizePiiEntitiesResultCollectionResponse) .onErrorMap(throwable -> mapToHttpResponseExceptionIfExist(throwable)); }

Target:
private Mono<Response<RecognizePiiEntitiesResultCollection>> getRecognizePiiEntitiesResponse( Iterable<TextDocumentInput> documents, RecognizePiiEntityOptions options, Context context) { String modelVersion = null; Boolean includeStatistics = null; String domainFilter = null; if (options != null) { modelVersion = options.getModelVersion(); includeStatistics = options.isIncludeStatistics(); final PiiEntityDomainType domainType = options.getDomainFilter(); if (domainType != null) { domainFilter = domainType.toString(); } } return service.entitiesRecognitionPiiWithResponseAsync( new MultiLanguageBatchInput().setDocuments(toMultiLanguageInput(documents)), modelVersion, includeStatistics, domainFilter, StringIndexType.UTF16CODE_UNIT, context.addData(AZ_TRACING_NAMESPACE_KEY, COGNITIVE_TRACING_NAMESPACE_VALUE)) .doOnSubscribe(ignoredValue -> logger.info( "Start recognizing Personally Identifiable Information entities for a batch of documents.")) .doOnSuccess(response -> logger.info( "Successfully recognized Personally Identifiable Information entities for a batch of documents.")) .doOnError(error -> logger.warning("Failed to recognize Personally Identifiable Information entities - {}", error)) .map(this::toRecognizePiiEntitiesResultCollectionResponse) .onErrorMap(throwable -> mapToHttpResponseExceptionIfExist(throwable)); }
Source:
public PlanNode optimize(PlanNode plan, Session session, Map<Symbol, Type> types, SymbolAllocator symbolAllocator, PlanNodeIdAllocator idAllocator) { if (!SystemSessionProperties.isNewOptimizerEnabled(session) && !legacyRules.isEmpty()) { for (PlanOptimizer optimizer : legacyRules) { plan = optimizer.optimize(plan, session, symbolAllocator.getTypes(), symbolAllocator, idAllocator); } return plan; } Memo memo = new Memo(idAllocator, plan); Lookup lookup = Lookup.from(planNode -> Stream.of(memo.resolve(planNode))); Matcher matcher = new DefaultMatcher(); Duration timeout = SystemSessionProperties.getOptimizerTimeout(session); Context context = new Context(memo, lookup, idAllocator, symbolAllocator, System.nanoTime(), timeout.toMillis(), session); exploreGroup(memo.getRootGroup(), context, matcher); return memo.extract(); }

Target:
public PlanNode optimize(PlanNode plan, Session session, Map<Symbol, Type> types, SymbolAllocator symbolAllocator, PlanNodeIdAllocator idAllocator) { if (!SystemSessionProperties.isNewOptimizerEnabled(session) && !legacyRules.isEmpty()) { for (PlanOptimizer optimizer : legacyRules) { plan = optimizer.optimize(plan, session, symbolAllocator.getTypes(), symbolAllocator, idAllocator); } return plan; } Memo memo = new Memo(idAllocator, plan); Lookup lookup = Lookup.from(planNode -> Stream.of(memo.resolve(planNode))); Duration timeout = SystemSessionProperties.getOptimizerTimeout(session); Context context = new Context(memo, lookup, idAllocator, symbolAllocator, System.nanoTime(), timeout.toMillis(), session); exploreGroup(memo.getRootGroup(), context); return memo.extract(); }
Source:
protected List<FactMappingValidationError> validateDMN(Simulation simulation, KieContainer kieContainer) { List<FactMappingValidationError> errors = new ArrayList<>(); String dmnFilePath = simulation.getSimulationDescriptor().getDmnFilePath(); DMNModel dmnModel = getDMNModel(kieContainer, dmnFilePath); for (FactMapping factMapping : simulation.getSimulationDescriptor().getFactMappings()) { if (isToSkip(factMapping)) { continue; } String nodeName = factMapping.getFactIdentifier().getName(); DMNType rootDMNType; try { rootDMNType = dmnModel.getDecisionByName(nodeName) != null ? dmnModel.getDecisionByName(nodeName).getResultType() : dmnModel.getInputByName(nodeName).getType(); } catch (NullPointerException e) { errors.add(createNodeChangedError(factMapping, "node not found")); continue; } List<String> steps = expressionElementToString(factMapping); Type rootType = getRootType((BaseDMNTypeImpl) rootDMNType); if (!CONTEXT.equals(rootType) && steps.size() == 0 && rootDMNType.isComposite()) { errors.add(createNodeChangedError(factMapping, rootDMNType.getName())); continue; } try { DMNType fieldType = navigateDMNType(rootDMNType, steps); if (!isDMNFactMappingValid(factMapping.getClassName(), factMapping, fieldType)) { errors.add(createFieldChangedError(factMapping, fieldType.getName())); } } catch (IllegalStateException e) { errors.add(createGenericError(factMapping, e.getMessage())); } } return errors; }

Target:
protected List<FactMappingValidationError> validateDMN(Simulation simulation, KieContainer kieContainer) { return DMNScenarioValidation.INSTANCE.validate(simulation, kieContainer); }
Source:
private void put(byte[] cf, int cfLength, byte[] cq, int cqLength, byte[] cv, boolean hasts, long ts, boolean deleted, byte[] val, int valLength) { if (buffer == null) { throw new IllegalStateException("Can not add to mutation after serializing it"); } long length = cfLength + cqLength + valLength; long newSize = size.sizeInBytes + length; Preconditions.checkArgument(newSize < MAX_MUTATION_SIZE && newSize >= 0, "Maximum mutation size must be less than 2GB "); put(cf, cfLength); put(cq, cqLength); put(cv); put(hasts); if (hasts) { put(ts); } put(deleted); if (valLength < VALUE_SIZE_COPY_CUTOFF) { put(val, valLength); } else { if (values == null) { values = new ArrayList<>(); } byte copy[] = new byte[valLength]; System.arraycopy(val, 0, copy, 0, valLength); values.add(copy); put(-1 * values.size()); } size.addEntryWithSize(length); }

Target:
private void put(byte[] cf, int cfLength, byte[] cq, int cqLength, byte[] cv, boolean hasts, long ts, boolean deleted, byte[] val, int valLength) { if (buffer == null) { throw new IllegalStateException("Can not add to mutation after serializing it"); } long estimatedSizeAfterPut = estRowAndLargeValSize + buffer.size() + cfLength + cqLength + cv.length + (hasts ? 8 : 0) + valLength + 2 + 4 * SERIALIZATION_OVERHEAD; Preconditions.checkArgument(estimatedSizeAfterPut < MAX_MUTATION_SIZE && estimatedSizeAfterPut >= 0, "Maximum mutation size must be less than 2GB "); put(cf, cfLength); put(cq, cqLength); put(cv); put(hasts); if (hasts) { put(ts); } put(deleted); if (valLength < VALUE_SIZE_COPY_CUTOFF) { put(val, valLength); } else { if (values == null) { values = new ArrayList<>(); } byte copy[] = new byte[valLength]; System.arraycopy(val, 0, copy, 0, valLength); values.add(copy); put(-1 * values.size()); estRowAndLargeValSize += valLength + SERIALIZATION_OVERHEAD; } entries++; }
Source:
public FilePath performInstallation(ToolInstallation tool, Node node, TaskListener log) throws IOException, InterruptedException { FilePath expected = preferredLocation(tool, node); Installable inst = getInstallable(); if(inst==null) { log.getLogger().println("Invalid tool ID "+id); return expected; } if (inst instanceof NodeSpecific) inst = (Installable) ((NodeSpecific) inst).forNode(node, log); if(isUpToDate(expected,inst)) return expected; if(expected.installIfNecessaryFrom(new URL(inst.url), log, "Unpacking " + inst.url + " to " + expected + " on " + node.getDisplayName())) { expected.child(".timestamp").delete(); FilePath base = findPullUpDirectory(expected); if(base!=null && base!=expected) base.moveAllChildrenTo(expected); expected.child(".installedFrom").write(inst.url,"UTF-8"); expected.act(new ZipExtractionInstaller.ChmodRecAPlusX()); } return expected; }

Target:
public FilePath performInstallation(ToolInstallation tool, Node node, TaskListener log) throws IOException, InterruptedException { FilePath expected = preferredLocation(tool, node); Installable inst = getInstallable(); if(inst==null) { log.getLogger().println("Invalid tool ID "+id); return expected; } if (inst instanceof NodeSpecific) { inst = (Installable) ((NodeSpecific) inst).forNode(node, log); } if(isUpToDate(expected,inst)) return expected; if(expected.installIfNecessaryFrom(new URL(inst.url), log, "Unpacking " + inst.url + " to " + expected + " on " + node.getDisplayName())) { expected.child(".timestamp").delete(); FilePath base = findPullUpDirectory(expected); if(base!=null && base!=expected) base.moveAllChildrenTo(expected); expected.child(".installedFrom").write(inst.url,"UTF-8"); expected.act(new ZipExtractionInstaller.ChmodRecAPlusX()); } return expected; }
Source:
public void initReader() throws Exception { if (sourceReader != null) { return; } final MetricGroup metricGroup = getMetricGroup(); assert metricGroup != null; final int subtaskIndex = getRuntimeContext().getIndexOfThisSubtask(); final SourceReaderContext context = new SourceReaderContext() { @Override public MetricGroup metricGroup() { return metricGroup; } @Override public Configuration getConfiguration() { return configuration; } @Override public String getLocalHostName() { return localHostname; } @Override public int getIndexOfSubtask() { return subtaskIndex; } @Override public void sendSplitRequest() { operatorEventGateway.sendEventToCoordinator(new RequestSplitEvent(getLocalHostName())); } @Override public void sendSourceEventToCoordinator(SourceEvent event) { operatorEventGateway.sendEventToCoordinator(new SourceEventWrapper(event)); } @Override public UserCodeClassLoader getUserCodeClassLoader() { return (UserCodeClassLoader) getRuntimeContext().getUserCodeClassLoader(); } }; sourceReader = readerFactory.apply(context); }

Target:
public void initReader() throws Exception { if (sourceReader != null) { return; } final MetricGroup metricGroup = getMetricGroup(); assert metricGroup != null; final int subtaskIndex = getRuntimeContext().getIndexOfThisSubtask(); final SourceReaderContext context = new SourceReaderContext() { @Override public MetricGroup metricGroup() { return metricGroup; } @Override public Configuration getConfiguration() { return configuration; } @Override public String getLocalHostName() { return localHostname; } @Override public int getIndexOfSubtask() { return subtaskIndex; } @Override public void sendSplitRequest() { operatorEventGateway.sendEventToCoordinator(new RequestSplitEvent(getLocalHostName())); } @Override public void sendSourceEventToCoordinator(SourceEvent event) { operatorEventGateway.sendEventToCoordinator(new SourceEventWrapper(event)); } @Override public UserCodeClassLoader getUserCodeClassLoader() { return new UserCodeClassLoader() { @Override public ClassLoader asClassLoader() { return getRuntimeContext().getUserCodeClassLoader(); } @Override public void registerReleaseHookIfAbsent( String releaseHookName, Runnable releaseHook) { getRuntimeContext().registerUserCodeClassLoaderReleaseHookIfAbsent( releaseHookName, releaseHook); } }; } }; sourceReader = readerFactory.apply(context); }
Source:
private InlineParser getInlineParser() { if (this.inlineParserFactory == null) { return new InlineParserImpl(specialCharacters, delimiterCharacters, delimiterProcessors); } else { return this.inlineParserFactory.create(); } }

Target:
private InlineParser getInlineParser() { if (this.inlineParserFactory == null) { return new InlineParserImpl(delimiterProcessors); } else { CustomInlineParserContext inlineParserContext = new CustomInlineParserContext(delimiterProcessors); return this.inlineParserFactory.create(inlineParserContext); } }
Source:
public int start(int startingPosition, int probePosition, Page allProbeChannelsPage) { for (JoinFilterFunction searchFunction : searchFunctions) { startingPosition = findStartPositionForFunction(searchFunction, startingPosition, probePosition, allProbeChannelsPage); if (startingPosition == -1) { return -1; } } return startingPosition; }

Target:
public int start(int startingPosition, int probePosition, Page allProbeChannelsPage) { if (applyAllSearchFunctions(startingPosition, probePosition, allProbeChannelsPage)) { return startingPosition; } int[] links = sortedPositionLinks[startingPosition]; if (links == null) { return -1; } int currentStartOffset = 0; for (JoinFilterFunction searchFunction : searchFunctions) { currentStartOffset = findStartPositionForFunction(searchFunction, links, currentStartOffset, probePosition, allProbeChannelsPage); if (currentStartOffset == -1) { return -1; } } return links[currentStartOffset]; }
Source:
protected Object execute(final RebaseOperation rebase) throws ExecutionException { final Repository repository = rebase.getRepository(); final RebaseCommand.Operation operation = rebase.getOperation(); JobUtil.scheduleUserJob(rebase, jobname, JobFamilies.REBASE, new JobChangeAdapter() { @Override public void aboutToRun(IJobChangeEvent event) { if (operation == Operation.BEGIN && !repository.getRepositoryState().equals( RepositoryState.SAFE)) { throw new IllegalStateException( "Can't start rebase if repository state isn't SAFE"); } super.aboutToRun(event); } @Override public void done(IJobChangeEvent cevent) { IStatus result = cevent.getJob().getResult(); if (operation == Operation.BEGIN && result.getSeverity() == IStatus.ERROR) { if (!repository.getRepositoryState().equals( RepositoryState.SAFE)) { Throwable t = result.getException(); try { new RebaseOperation(repository, Operation.ABORT).execute(null); Activator.showError(t.getMessage(), t); } catch (CoreException e1) { IStatus mStatus = createMultiStatus(t, e1); CoreException mStatusException = new CoreException( mStatus); Activator.showError( mStatusException.getMessage(), mStatusException); } } } if (result.getSeverity() == IStatus.CANCEL) Display.getDefault().asyncExec(new Runnable() { public void run() { Shell shell = PlatformUI.getWorkbench() .getActiveWorkbenchWindow() .getShell(); MessageDialog .openInformation( shell, UIText.AbstractRebaseCommand_DialogTitle, dialogMessage); } }); else if (result.isOK()) RebaseResultDialog.show(rebase.getResult(), repository); } }); return null; }

Target:
protected void execute(final RebaseOperation rebase) throws ExecutionException { final Repository repository = rebase.getRepository(); if (repository == null) return; final RebaseCommand.Operation operation = rebase.getOperation(); JobUtil.scheduleUserJob(rebase, jobname, JobFamilies.REBASE, new JobChangeAdapter() { @Override public void aboutToRun(IJobChangeEvent event) { if (operation == Operation.BEGIN && !repository.getRepositoryState().equals( RepositoryState.SAFE)) { throw new IllegalStateException( "Can't start rebase if repository state isn't SAFE"); } super.aboutToRun(event); } @Override public void done(IJobChangeEvent cevent) { IStatus result = cevent.getJob().getResult(); if (operation == Operation.BEGIN && result.getSeverity() == IStatus.ERROR) { handleBeginError(repository, result); } else if (result.getSeverity() == IStatus.CANCEL) Display.getDefault().asyncExec(new Runnable() { public void run() { Shell shell = PlatformUI.getWorkbench() .getActiveWorkbenchWindow() .getShell(); MessageDialog .openInformation( shell, UIText.AbstractRebaseCommand_DialogTitle, dialogMessage); } }); else if (result.isOK()) RebaseResultDialog.show(rebase.getResult(), repository); } }); return; }
Source:
public void testFiresListener() { Store store = mock(Store.class); Ehcache ehcache = new Ehcache(CacheConfigurationBuilder.newCacheConfigurationBuilder().buildConfig(Object.class, Object.class), store); final StateChangeListener listener = mock(StateChangeListener.class); ehcache.registerListener(listener); ehcache.init(); verify(listener).stateTransition(Status.UNINITIALIZED, Status.AVAILABLE); reset(listener); ehcache.deregisterListener(listener); ehcache.close(); verify(listener, never()).stateTransition(Status.AVAILABLE, Status.UNINITIALIZED); }

Target:
public void testFiresListener() { Store store = mock(Store.class); Ehcache ehcache = new Ehcache(newCacheConfigurationBuilder().buildConfig(Object.class, Object.class), store); final StateChangeListener listener = mock(StateChangeListener.class); ehcache.registerListener(listener); ehcache.init(); verify(listener).stateTransition(Status.UNINITIALIZED, Status.AVAILABLE); reset(listener); ehcache.deregisterListener(listener); ehcache.close(); verify(listener, never()).stateTransition(Status.AVAILABLE, Status.UNINITIALIZED); }
Source:
public void actionPerformed(ActionEvent e) { final StatusNotification notification = new StatusNotification("Running Tests...", PROGRESS, FLOAT_MODE); notificationManager.notify(notification); final Project project = appContext.getRootProject(); Map<String, String> parameters = new HashMap<>(); parameters.put("updateClasspath", "true"); parameters.put("testngXML", project.getPath() + "/src/test/resources/testng.xml"); Promise<TestResult> testResultPromise = service.getTestResult(project.getPath(), "testng", parameters); testResultPromise.then(new Operation<TestResult>() { @Override public void apply(TestResult result) throws OperationException { notification.setStatus(SUCCESS); if (result.isSuccess()) { notification.setTitle("Test runner executed successfully"); notification.setContent("All tests are passed"); } else { notification.setTitle("Test runner executed successfully with test failures."); notification.setContent(result.getFailureCount() + " test(s) failed.\n"); } presenter.handleResponse(result); } }).catchError(new Operation<PromiseError>() { @Override public void apply(PromiseError exception) throws OperationException { final String errorMessage = (exception.getMessage() != null) ? exception.getMessage() : "Failed to run test cases"; notification.setContent(errorMessage); notification.setStatus(FAIL); } }); }

Target:
public void actionPerformed(ActionEvent e) { final StatusNotification notification = new StatusNotification("Running Tests...", PROGRESS, FLOAT_MODE); notificationManager.notify(notification); final Project project = appContext.getRootProject(); Map<String, String> parameters = new HashMap<>(); parameters.put("updateClasspath", "true"); parameters.put("testngXML", project.getPath() + "/" + MavenAttributes.DEFAULT_TEST_RESOURCES_FOLDER + "/testng.xml"); Promise<TestResult> testResultPromise = service.getTestResult(project.getPath(), "testng", parameters); testResultPromise.then(new Operation<TestResult>() { @Override public void apply(TestResult result) throws OperationException { notification.setStatus(SUCCESS); if (result.isSuccess()) { notification.setTitle("Test runner executed successfully"); notification.setContent("All tests are passed"); } else { notification.setTitle("Test runner executed successfully with test failures."); notification.setContent(result.getFailureCount() + " test(s) failed.\n"); } presenter.handleResponse(result); } }).catchError(new Operation<PromiseError>() { @Override public void apply(PromiseError exception) throws OperationException { final String errorMessage = (exception.getMessage() != null) ? exception.getMessage() : "Failed to run test cases"; notification.setContent(errorMessage); notification.setStatus(FAIL); } }); }
Source:
private ChangeInfo getChange(PushOneCommit.Result pr) throws IOException { return getChange(pr.getChangeId(), ListChangesOption.DETAILED_LABELS); }

Target:
private ChangeInfo getChange(PushOneCommit.Result pr) throws IOException { return getChange(pr.getChangeId(), DETAILED_LABELS); }
Source:
public void update(Container entity) { CuratorFramework client = zkConnection.getClient(); String path = Paths.build(Paths.CONTAINERS, entity.getName()); try { client.checkExists().forPath(path); client.setData().forPath(path, ZooKeeperUtils.mapToBytes(entity.getAttributes())); } catch (Exception e) { throw ZooKeeperUtils.wrapThrowable(e); } }

Target:
public void update(Container entity) { CuratorFramework client = zkConnection.getClient(); String path = Paths.build(Paths.CONTAINERS, entity.getName()); try { Stat stat = client.checkExists().forPath(path); if (stat == null) { throw new NoSuchContainerException("Could not find container with id " + entity.getName()); } client.setData().forPath(path, ZooKeeperUtils.mapToBytes(entity.getAttributes())); } catch (Exception e) { throw ZooKeeperUtils.wrapThrowable(e, e.getMessage()); } }
Source:
@Test public void testFilterClausesFactoredForPruning1() { String sql = "select " + "sum(\"store_sales\") filter (where \"store_state\" = 'CA'), " + "sum(\"store_sales\") filter (where \"store_state\" = 'WA') " + "from \"foodmart\""; String expectedQuery = "{'queryType':'timeseries','dataSource':'foodmart','descending':false," + "'granularity':'all','filter':{'type':'or','fields':[{'type':'selector','dimension':" + "'store_state','value':'CA'},{'type':'selector','dimension':'store_state'," + "'value':'WA'}]},'aggregations':[{'type':'filtered','filter':{'type':'selector'," + "'dimension':'store_state','value':'CA'},'aggregator':{'type':'doubleSum','name':" + "'EXPR$0','fieldName':'store_sales'}},{'type':'filtered','filter':{'type':'selector'," + "'dimension':'store_state','value':'WA'},'aggregator':{'type':'doubleSum','name':" + "'EXPR$1','fieldName':'store_sales'}}],'intervals':" + "['1900-01-09T00:00:00.000/2992-01-10T00:00:00.000']," + "'context':{'skipEmptyBuckets':true}}"; sql(sql).queryContains(druidChecker(expectedQuery)); }

Target:
@Test public void testFilterClausesFactoredForPruning1() { String sql = "select " + "sum(\"store_sales\") filter (where \"store_state\" = 'CA'), " + "sum(\"store_sales\") filter (where \"store_state\" = 'WA') " + "from \"foodmart\""; String expectedQuery = "{'queryType':'timeseries','dataSource':'foodmart','descending':false," + "'granularity':'all','filter':{'type':'or','fields':[{'type':'selector','dimension':" + "'store_state','value':'CA'},{'type':'selector','dimension':'store_state'," + "'value':'WA'}]},'aggregations':[{'type':'filtered','filter':{'type':'selector'," + "'dimension':'store_state','value':'CA'},'aggregator':{'type':'doubleSum','name':" + "'EXPR$0','fieldName':'store_sales'}},{'type':'filtered','filter':{'type':'selector'," + "'dimension':'store_state','value':'WA'},'aggregator':{'type':'doubleSum','name':" + "'EXPR$1','fieldName':'store_sales'}}],'intervals':" + "['1900-01-09T00:00:00.000/2992-01-10T00:00:00.000']," + "'context':{'skipEmptyBuckets':true}}"; sql(sql) .queryContains(druidChecker(expectedQuery)) .returnsUnordered("EXPR$0=159167.840144217; EXPR$1=263793.2202244997"); }
Source:
public Answer dettachVolume(final DettachCommand cmd) { final DiskTO disk = cmd.getDisk(); final VolumeObjectTO vol = (VolumeObjectTO)disk.getData(); final PrimaryDataStoreTO primaryStore = (PrimaryDataStoreTO)vol.getDataStore(); final String vmName = cmd.getVmName(); final String serial = resource.diskUuidToSerial(vol.getUuid()); try { final Connect conn = LibvirtConnection.getConnectionByVmName(vmName); final KVMPhysicalDisk phyDisk = storagePoolMgr.getPhysicalDisk(primaryStore.getPoolType(), primaryStore.getUuid(), vol.getPath()); attachOrDetachDisk(conn, false, vmName, phyDisk, disk.getDiskSeq().intValue(), serial, vol.getBytesReadRate(), vol.getBytesWriteRate(), vol.getIopsReadRate(), vol.getIopsWriteRate()); storagePoolMgr.disconnectPhysicalDisk(primaryStore.getPoolType(), primaryStore.getUuid(), vol.getPath()); return new DettachAnswer(disk); } catch (final LibvirtException e) { s_logger.debug("Failed to dettach volume: " + vol.getPath() + ", due to ", e); return new DettachAnswer(e.toString()); } catch (final InternalErrorException e) { s_logger.debug("Failed to dettach volume: " + vol.getPath() + ", due to ", e); return new DettachAnswer(e.toString()); } }

Target:
public Answer dettachVolume(final DettachCommand cmd) { final DiskTO disk = cmd.getDisk(); final VolumeObjectTO vol = (VolumeObjectTO)disk.getData(); final PrimaryDataStoreTO primaryStore = (PrimaryDataStoreTO)vol.getDataStore(); final String vmName = cmd.getVmName(); final String serial = resource.diskUuidToSerial(vol.getUuid()); try { final Connect conn = LibvirtConnection.getConnectionByVmName(vmName); final KVMPhysicalDisk phyDisk = storagePoolMgr.getPhysicalDisk(primaryStore.getPoolType(), primaryStore.getUuid(), vol.getPath()); attachOrDetachDisk(conn, false, vmName, phyDisk, disk.getDiskSeq().intValue(), serial, vol.getBytesReadRate(), vol.getBytesWriteRate(), vol.getIopsReadRate(), vol.getIopsWriteRate()); storagePoolMgr.disconnectPhysicalDisk(primaryStore.getPoolType(), primaryStore.getUuid(), vol.getPath()); return new DettachAnswer(disk); } catch (final LibvirtException e) { s_logger.debug("Failed to detach volume: " + vol.getPath() + ", due to ", e); return new DettachAnswer(e.toString()); } catch (final InternalErrorException e) { s_logger.debug("Failed to detach volume: " + vol.getPath() + ", due to ", e); return new DettachAnswer(e.toString()); } }
Source:
private boolean isResigned(File file) { if (file.getAbsolutePath().contains("resigned")) { String ext = file.getName(); return ext.endsWith(".apk"); } return false; }

Target:
private boolean isResigned(File file) { return (isApp(file) && file.getAbsolutePath().contains("resigned")); }
Source:
static void assertConfigurationEquals(ConfigurationSetting expected, Response<ConfigurationSetting> response, final int expectedStatusCode) { assertNotNull(response); assertEquals(expectedStatusCode, response.statusCode()); assertConfigurationEquals(expected, response.getValue()); }

Target:
static void assertConfigurationEquals(ConfigurationSetting expected, Response<ConfigurationSetting> response, final int expectedStatusCode) { assertNotNull(response); assertEquals(expectedStatusCode, response.getStatusCode()); assertConfigurationEquals(expected, response.getValue()); }
Source:
public int getCellType() { throw new UnsupportedOperationException("Not implememted yet."); }

Target:
public CellType getCellType() { return cellType; }