auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Sequence<T> run(final Query<T> query, Map<String, Object> responseContext) { if (QueryContexts.isBySegment(query, false)) { final Sequence<T> baseSequence = base.run(query, responseContext); final List<T> results = Sequences.toList(baseSequence, Lists.<T>newArrayList()); return Sequences.simple( Arrays.asList( (T) new Result<BySegmentResultValueClass<T>>( timestamp, new BySegmentResultValueClass<T>( results, segmentIdentifier, query.getIntervals().get(0) ) ) ) ); } return base.run(query, responseContext); }

Target:
public Sequence<T> run(final Query<T> query, Map<String, Object> responseContext) { if (QueryContexts.isBySegment(query)) { final Sequence<T> baseSequence = base.run(query, responseContext); final List<T> results = Sequences.toList(baseSequence, Lists.<T>newArrayList()); return Sequences.simple( Arrays.asList( (T) new Result<BySegmentResultValueClass<T>>( timestamp, new BySegmentResultValueClass<T>( results, segmentIdentifier, query.getIntervals().get(0) ) ) ) ); } return base.run(query, responseContext); }
Source:
public Set<String> getAll() throws SshKeyStoreException { Map<String, String> keys; try { keys = getSshKeys(); } catch (ApiException | IOException | JsonParseException e) { throw new SshKeyStoreException("Failed to get keys", e); } if (keys == null) { throw new SshKeyStoreException("Impossible get keys"); } final Set<String> privateKeys = new HashSet<>(); privateKeys.addAll(keys.keySet() .stream() .filter(str -> str.startsWith(PRIVATE_KEY_ATTRIBUTE_PREFIX)) .map(str -> str.substring(PRIVATE_KEY_ATTRIBUTE_PREFIX.length())) .collect(Collectors.toList())); return privateKeys; }

Target:
public Set<String> getAll() throws SshKeyStoreException { try { Map<String, String> keys = getSshKeys(); return keys.keySet() .stream() .filter(str -> str.startsWith(PRIVATE_KEY_ATTRIBUTE_PREFIX)) .map(str -> str.substring(PRIVATE_KEY_ATTRIBUTE_PREFIX.length())) .collect(Collectors.toSet()); } catch (ApiException | IOException | JsonParseException e) { throw new SshKeyStoreException("Failed to get keys ", e); } }
Source:
protected Map<Object, InternalCacheEntry> retrieveFromRemoteSources(Set<?> requestedKeys, InvocationContext ctx, Set<Flag> flags) throws Throwable { GlobalTransaction gtx = ctx.isInTxScope() ? ((TxInvocationContext)ctx).getGlobalTransaction() : null; CacheTopology cacheTopology = stateTransferManager.getCacheTopology(); ConsistentHash ch = cacheTopology.getReadConsistentHash(); Map<Address, List<Object>> ownerKeys = new HashMap<>(); for (Object key : requestedKeys) { Address owner = ch.locatePrimaryOwner(key); List<Object> requestedKeysFromNode = ownerKeys.get(owner); if (requestedKeysFromNode == null) { ownerKeys.put(owner, requestedKeysFromNode = new ArrayList<>()); } requestedKeysFromNode.add(key); } Map<Address, ReplicableCommand> commands = new HashMap<>(); for (Map.Entry<Address, List<Object>> entry : ownerKeys.entrySet()) { List<Object> keys = entry.getValue(); ClusteredGetAllCommand getMany = cf.buildClusteredGetAllCommand(keys, flags, gtx); commands.put(entry.getKey(), getMany); if (trace) { log.tracef("Sending %s to %s", getMany, entry.getKey()); } } RpcOptionsBuilder rpcOptionsBuilder = rpcManager.getRpcOptionsBuilder( ResponseMode.SYNCHRONOUS_IGNORE_LEAVERS, DeliverOrder.NONE); RpcOptions options = rpcOptionsBuilder.build(); Map<Address, Response> responses = rpcManager.invokeRemotely(commands, options); Map<Object, InternalCacheEntry> entries = new HashMap<>(); for (Map.Entry<Address, Response> entry : responses.entrySet()) { updateWithValues(((ClusteredGetAllCommand) commands.get(entry.getKey())).getKeys(), entry.getValue(), entries); } return entries; }

Target:
protected Map<Object, InternalCacheEntry> retrieveFromRemoteSources(Set<?> requestedKeys, InvocationContext ctx, Set<Flag> flags) throws Throwable { GlobalTransaction gtx = ctx.isInTxScope() ? ((TxInvocationContext)ctx).getGlobalTransaction() : null; CacheTopology cacheTopology = stateTransferManager.getCacheTopology(); ConsistentHash ch = cacheTopology.getReadConsistentHash(); Map<Address, List<Object>> ownerKeys = new HashMap<>(); for (Object key : requestedKeys) { Address owner = ch.locatePrimaryOwner(key); List<Object> requestedKeysFromNode = ownerKeys.get(owner); if (requestedKeysFromNode == null) { ownerKeys.put(owner, requestedKeysFromNode = new ArrayList<>()); } requestedKeysFromNode.add(key); } Map<Address, ReplicableCommand> commands = new HashMap<>(); for (Map.Entry<Address, List<Object>> entry : ownerKeys.entrySet()) { List<Object> keys = entry.getValue(); ClusteredGetAllCommand getMany = cf.buildClusteredGetAllCommand(keys, flags, gtx); commands.put(entry.getKey(), getMany); } RpcOptionsBuilder rpcOptionsBuilder = rpcManager.getRpcOptionsBuilder( ResponseMode.SYNCHRONOUS_IGNORE_LEAVERS, DeliverOrder.NONE); RpcOptions options = rpcOptionsBuilder.build(); Map<Address, Response> responses = rpcManager.invokeRemotely(commands, options); Map<Object, InternalCacheEntry> entries = new HashMap<>(); for (Map.Entry<Address, Response> entry : responses.entrySet()) { updateWithValues(((ClusteredGetAllCommand) commands.get(entry.getKey())).getKeys(), entry.getValue(), entries); } return entries; }
Source:
public String toString() { return "Configurator observer method [Bean class = " + getBeanClass().toString() + ", type = " + getObservedType() + ", qualifiers =" + Formats.formatAnnotations(getObservedQualifiers()) + ", priority =" + getPriority() + ", async =" + isAsync() + ", reception =" + getReception() + ", transaction phase =" + getTransactionPhase() + "]"; }

Target:
public String toString() { return "Configurator observer method [Bean class = " + getBeanClass() + ", type = " + getObservedType() + ", qualifiers =" + Formats.formatAnnotations(getObservedQualifiers()) + ", priority =" + getPriority() + ", async =" + isAsync() + ", reception =" + getReception() + ", transaction phase =" + getTransactionPhase() + "]"; }
Source:
public void setLatitude(double latitude) { this.mLatitude = latitude; }

Target:
public void setLatitude(double latitude) { mLatitude = latitude; }
Source:
public double approximate(int currentNode) { Dijkstra dijkstra = new Dijkstra(graph, weighting, traversalMode); Path path = reverse ? dijkstra.calcPath(to, currentNode) : dijkstra.calcPath(currentNode, to); if (path.isFound()) return path.getWeight(); else return Double.POSITIVE_INFINITY; }

Target:
public double approximate(int currentNode) { Dijkstra dijkstra = new Dijkstra(graph, weighting, traversalMode); Path path = reverse ? dijkstra.calcPath(to, currentNode) : dijkstra.calcPath(currentNode, to); return path.isFound() ? path.getWeight() : Double.POSITIVE_INFINITY; }
Source:
public OnmsMonitoredServiceDetail(OnmsMonitoredService service) { m_nodeLabel = service.getIpInterface().getNode().getLabel(); m_ipAddress = service.getIpAddress(); m_serviceName = service.getServiceName(); m_isMonitored = "A".equals(service.getStatus()); m_isDown = service.isDown(); m_statusCode = service.getStatus(); m_status = service.getStatusLong(); m_id = service.getXmlId(); m_ipInterfaceId = service.getIpInterface().getId(); }

Target:
public OnmsMonitoredServiceDetail(OnmsMonitoredService service) { m_nodeLabel = service.getIpInterface().getNode().getLabel(); m_ipAddress = service.getIpAddress(); m_serviceName = service.getServiceName(); m_isMonitored = "A".equals(service.getStatus()); m_isDown = service.isDown(); m_statusCode = service.getStatus(); m_status = service.getStatusLong(); m_id = service.getXmlId(); m_ipInterfaceId = service.getIpInterfaceId(); }
Source:
public void theoryLeavesHaveIstream(String path) throws Exception { Resource res = getResource(path); assumeThat(res, is(resource())); InputStream result = res.in(); try { assertThat(result, notNullValue()); } finally { result.close(); } }

Target:
public void theoryLeavesHaveIstream(String path) throws Exception { Resource res = getResource(path); assumeThat(res, is(resource())); try (InputStream result = res.in()) { assertThat(result, notNullValue()); } }
Source:
public void testSingleDynamicFormCheckboxForm() throws Exception { if (!endToEndTestEnabled()) { return; } try { createNewNote(); setTextOfParagraph(1, "%spark val options = Seq((\"han\",\"Han\"), (\"leia\",\"Leia\"), " + "(\"luke\",\"Luke\")); println(\"Greetings \"+z.checkbox(\"skywalkers\",options).mkString(\" and \"))"); runParagraph(1); waitForParagraph(1, "FINISHED"); collector.checkThat("Output text should display all of the options included in check boxes", driver.findElement(By.xpath(getParagraphXPath(1) + " CoreMatchers.containsString("Greetings han and leia and luke")); WebElement firstCheckbox = driver.findElement(By.xpath(getParagraphXPath(1) + " firstCheckbox.click(); collector.checkThat("After unchecking one of the boxes, output should not display any change", driver.findElement(By.xpath(getParagraphXPath(1) + " CoreMatchers.containsString("Greetings han and leia and luke")); runParagraph(1); waitForParagraph(1, "FINISHED"); collector.checkThat("Only after paragraph run we should see the new output without the box we unchecked", driver.findElement(By.xpath(getParagraphXPath(1) + " CoreMatchers.containsString("Greetings leia and luke")); deleteTestNotebook(driver); } catch (Exception e) { handleException("Exception in ParagraphActionsIT while testSingleDynamicFormTextInput ", e); } }

Target:
public void testSingleDynamicFormCheckboxForm() throws Exception { if (!endToEndTestEnabled()) { return; } try { createNewNote(); setTextOfParagraph(1, "%spark val options = Seq((\"han\",\"Han\"), (\"leia\",\"Leia\"), " + "(\"luke\",\"Luke\")); println(\"Greetings \"+z.checkbox(\"skywalkers\",options).mkString(\" and \"))"); runParagraph(1); waitForParagraph(1, "FINISHED"); collector.checkThat("Output text should display all of the options included in check boxes", driver.findElement(By.xpath(getParagraphXPath(1) + " CoreMatchers.containsString("Greetings han and leia and luke")); WebElement firstCheckbox = driver.findElement(By.xpath("(" + getParagraphXPath(1) + " firstCheckbox.click(); collector.checkThat("After unchecking one of the boxes, we can see the newly updated output without the option we unchecked", driver.findElement(By.xpath(getParagraphXPath(1) + " CoreMatchers.containsString("Greetings leia and luke")); driver.findElement(By.xpath(getParagraphXPath(1) + " clickAndWait(By.xpath(getParagraphXPath(1) + " WebElement secondCheckbox = driver.findElement(By.xpath("(" + getParagraphXPath(1) + " secondCheckbox.click(); collector.checkThat("After 'Run on selection change' checkbox is unchecked, the paragraph should not run if check box state is modified", driver.findElement(By.xpath(getParagraphXPath(1) + " CoreMatchers.containsString("Greetings leia and luke")); runParagraph(1); waitForParagraph(1, "FINISHED"); deleteTestNotebook(driver); } catch (Exception e) { handleException("Exception in ParagraphActionsIT while testSingleDynamicFormCheckboxForm ", e); } }
Source:
private boolean suspendNoteAvailable() { if (mCurrentCard == null || getControlBlocked() != ControlBlock.NONE) { return false; } return getCol().getDb().queryScalar("select 1 from cards where nid = ? and id != ? and queue != " + Consts.QUEUE_TYPE_SUSPENDED + " limit 1", new Object[] {mCurrentCard.getNid(), mCurrentCard.getId()}) == 1; }

Target:
private boolean suspendNoteAvailable() { if (mCurrentCard == null || isControlBlocked()) { return false; } return getCol().getDb().queryScalar("select 1 from cards where nid = ? and id != ? and queue != " + Consts.QUEUE_TYPE_SUSPENDED + " limit 1", new Object[] {mCurrentCard.getNid(), mCurrentCard.getId()}) == 1; }
Source:
public Set<AgentIdentity> filterApprovedAgents(Set<AgentIdentity> agents) { if (agents.size() == 0) { return agents; } Set<String> ips = new HashSet<>(); for (AgentInfo each : cachedLocalAgentService.getLocalAgents()) { if (each.isApproved()) { ips.add(each.getIp() + each.getName()); } } Set<AgentIdentity> approvedAgent = new HashSet<>(); for (AgentIdentity each : agents) { if (ips.contains(((AgentControllerIdentityImplementation) each).getIp() + each.getName())) { approvedAgent.add(each); } } return approvedAgent; }

Target:
public Set<AgentIdentity> filterApprovedAgents(Set<AgentIdentity> agents) { if (agents.size() == 0) { return agents; } Set<String> ips = cachedLocalAgentService.getLocalAgents() .stream() .filter(AgentInfo::isApproved) .map(agentInfo -> agentInfo.getIp() + agentInfo.getName()) .collect(toSet()); return agents.stream() .map(AgentManager::convert) .filter(identity -> ips.contains(identity.getIp() + identity.getName())) .collect(toSet()); }
Source:
private CommandEntity getParentCommandEntity(Guid cmdId, VdcActionType actionType, VdcActionParametersBase parameters) { CommandEntity cmdEntity = Guid.isNullOrEmpty(cmdId) ? null : coco.getCommandEntity(cmdId); if (cmdEntity == null) { cmdEntity = new CommandEntity(); cmdEntity.setId(cmdId); cmdEntity.setCommandType(actionType); cmdEntity.setCommandParameters(parameters); if (!Guid.isNullOrEmpty(cmdId)) { cmdEntity.setCommandStatus(CommandStatus.ACTIVE); coco.persistCommand(cmdEntity); } } return cmdEntity; }

Target:
private CommandEntity getParentCommandEntity(Guid cmdId, VdcActionType actionType, VdcActionParametersBase parameters) { CommandEntity cmdEntity = Guid.isNullOrEmpty(cmdId) ? null : coco.getCommandEntity(cmdId); if (cmdEntity == null) { cmdEntity = coco.createCommandEntity(cmdId, actionType, parameters); if (!Guid.isNullOrEmpty(cmdId)) { cmdEntity.setCommandStatus(CommandStatus.ACTIVE); coco.persistCommand(cmdEntity); } } return cmdEntity; }
Source:
public void onServiceConnected(ComponentName name, IBinder service) { if (DEBUG) { Log.d(TAG, "onServiceConnected " + name + " " + this); } if (!mToken.getPackageName().equals(name.getPackageName())) { Log.wtf(TAG, "Expected connection to " + mToken.getPackageName() + " but " + name + " was connected"); return; } connectToSession(IMediaSession2.Stub.asInterface(service)); }

Target:
public void onServiceConnected(ComponentName name, IBinder service) { if (DEBUG) { Log.d(TAG, "onServiceConnected " + name + " " + this); } if (!mToken.getPackageName().equals(name.getPackageName())) { Log.wtf(TAG, "Expected connection to " + mToken.getPackageName() + " but is" + " connected to " + name); return; } connectToSession(IMediaSession2.Stub.asInterface(service)); }
Source:
private void visitNonLeafNode(Context context, ExecutionBlock current) { if (!plan.isTerminal(current)) { if (current.hasJoin()) { List<ExecutionBlock> childs = plan.getChilds(current); Map<ExecutionBlockId, ExecutionBlockId> unionScanMap = current.getUnionScanMap(); LogicalNode found = PlannerUtil.findTopNode(current.getPlan(), NodeType.JOIN); if (found == null) { throw new TajoInternalError("ExecutionBlock " + current.getId() + " doesn't have any join operator, " + "but the master plan indicates that it has."); } JoinType joinType = ((JoinNode)found).getJoinType(); for (ExecutionBlock child : childs) { if (!child.isPreservedRow()) { updateBroadcastableRelForChildEb(context, child, joinType); updateInputBasedOnChildEb(child, current); } } if (current.hasBroadcastRelation()) { for (ExecutionBlock child : childs) { addUnionNodeIfNecessary(unionScanMap, plan, child, current); mergeTwoPhaseJoinIfPossible(plan, child, current); } checkTotalSizeOfBroadcastableRelations(context, current); long outputVolume = estimateOutputVolume(current); context.estimatedEbOutputSize.put(current.getId(), outputVolume); } } else { List<ScanNode> relations = new ArrayList<>(); relations.addAll(current.getBroadcastRelations()); for (ScanNode eachRelation : relations) { current.removeBroadcastRelation(eachRelation); } } } }

Target:
private void visitNonLeafNode(Context context, ExecutionBlock current) { if (!plan.isTerminal(current)) { if (current.hasJoin()) { List<ExecutionBlock> childs = plan.getChilds(current); Map<ExecutionBlockId, ExecutionBlockId> unionScanMap = current.getUnionScanMap(); LogicalNode found = PlannerUtil.findTopNode(current.getPlan(), NodeType.JOIN); if (found == null) { throw new TajoInternalError("ExecutionBlock " + current.getId() + " doesn't have any join operator, " + "but the master plan indicates that it has."); } JoinType joinType = ((JoinNode)found).getJoinType(); for (ExecutionBlock child : childs) { if (!child.isPreservedRow()) { updateBroadcastableRelForChildEb(context, child, joinType); updateInputBasedOnChildEb(child, current); } } if (current.hasBroadcastRelation()) { for (ExecutionBlock child : childs) { addUnionNodeIfNecessary(unionScanMap, plan, child, current); mergeTwoPhaseJoinIfPossible(plan, child, current); } checkTotalSizeOfBroadcastableRelations(context, current); long outputVolume = estimateOutputVolume(current); context.estimatedEbOutputSize.put(current.getId(), outputVolume); } } else { List<ScanNode> relations = new ArrayList<>(current.getBroadcastRelations()); for (ScanNode eachRelation : relations) { current.removeBroadcastRelation(eachRelation); } } } }
Source:
public CityInformation(City city, String state, Set<Restaurant> restaurants, Set<Attraction> attractions) { this.city = city; this.state = state; this.restaurants = restaurants; this.attractions = attractions; }

Target:
private CityInformation(City city, String state, Set<Restaurant> restaurants, Set<Attraction> attractions) { this.city = city; this.state = state; this.restaurants = restaurants; this.attractions = attractions; }
Source:
public void canAccessCurrencyCustomAttributes() throws Exception { final CurrencySearchModel<ProductProjection, DirectionlessMultiValueSearchSortModel<ProductProjection>> path = attributeModel().ofMoney("originalPrice").currency(); assertThat(path.faceted().byAllTerms().expression()).isEqualTo("variants.attributes.originalPrice.currencyCode"); assertThat(path.filtered().by(currency("EUR"))).extracting(expr -> expr.expression()).containsExactly("variants.attributes.originalPrice.currencyCode:\"EUR\""); assertThat(path.sorted().byDescWithMin().expression()).isEqualTo("variants.attributes.originalPrice.currencyCode desc.min"); }

Target:
public void canAccessCurrencyCustomAttributes() throws Exception { final String attrName = "originalPrice"; assertThat(FACET_ATTR.ofMoney(attrName).currency().allTerms().expression()).isEqualTo("variants.attributes.originalPrice.currencyCode"); assertThat(FILTER_ATTR.ofMoney(attrName).currency().by(currency("EUR"))).extracting(expression()).containsExactly("variants.attributes.originalPrice.currencyCode:\"EUR\""); assertThat(SORT_ATTR.ofMoney(attrName).currency().byDescWithMin().expression()).isEqualTo("variants.attributes.originalPrice.currencyCode desc.min"); }
Source:
public ConnectionHandler(Socket s, ConnectionHandlerFailureCallback parentTerminator) { this.s = s; synchronized(getClass()) { id = iotaGen++; } setName("TCP agent connection handler #"+id+" with "+s.getRemoteSocketAddress()); setUncaughtExceptionHandler((t, e) -> { LOGGER.log(Level.SEVERE, "Uncaught exception in TcpSlaveAgentListener ConnectionHandler " + t, e); try { parentTerminator.run(e); s.close(); } catch (IOException e1) { LOGGER.log(Level.WARNING, "Could not close socket after unexpected thread death", e1); } }); }

Target:
public ConnectionHandler(Socket s, ConnectionHandlerFailureCallback parentTerminator) { this.s = s; synchronized(getClass()) { id = iotaGen++; } setName("TCP agent connection handler #"+id+" with "+s.getRemoteSocketAddress()); setUncaughtExceptionHandler((t, e) -> { LOGGER.log(Level.SEVERE, "Uncaught exception in TcpSlaveAgentListener ConnectionHandler " + t, e); try { s.close(); parentTerminator.run(e); } catch (IOException e1) { LOGGER.log(Level.WARNING, "Could not close socket after unexpected thread death", e1); } }); }
Source:
public void checkCommandMetadata() throws Exception { try (CommandController controller = uiTestHarness.createCommandController(CDINewInterceptorCommand.class, project.getRoot())) { controller.initialize(); assertTrue(controller.getCommand() instanceof CDINewInterceptorCommand); UICommandMetadata metadata = controller.getMetadata(); assertEquals("CDI: New Interceptor", metadata.getName()); assertEquals("Java EE", metadata.getCategory().getName()); assertEquals("CDI", metadata.getCategory().getSubCategory().getName()); assertEquals(4, controller.getInputs().size()); assertFalse("Project is created, shouldn't have targetLocation", controller.hasInput("targetLocation")); assertTrue(controller.hasInput("named")); assertTrue(controller.hasInput("targetPackage")); assertTrue(controller.hasInput("overwrite")); assertTrue(controller.hasInput("interceptorBinding")); assertTrue(controller.getValueFor("targetPackage").toString().endsWith("beans")); } }

Target:
public void checkCommandMetadata() throws Exception { try (CommandController controller = uiTestHarness.createCommandController(CDINewInterceptorCommand.class, project.getRoot())) { controller.initialize(); assertTrue(controller.getCommand() instanceof CDINewInterceptorCommand); UICommandMetadata metadata = controller.getMetadata(); assertEquals("CDI: New Interceptor", metadata.getName()); assertEquals("Java EE", metadata.getCategory().getName()); assertEquals("CDI", metadata.getCategory().getSubCategory().getName()); assertEquals(4, controller.getInputs().size()); assertFalse("Project is created, shouldn't have targetLocation", controller.hasInput("targetLocation")); assertTrue(controller.hasInput("named")); assertTrue(controller.hasInput("targetPackage")); assertTrue(controller.hasInput("overwrite")); assertTrue(controller.hasInput("interceptorBinding")); assertTrue(controller.getValueFor("targetPackage").toString().endsWith(DEFAULT_CDI_PACKAGE)); } }
Source:
public void setUp(){ apduHeader = new byte { (byte) 0x0C, 0x20, (byte) 0x80, 0x00}; commandData = new byte { 0x01, (byte) 0xFF }; }

Target:
public void setUp(){ apduHeader = new byte { (byte) 0x0C, 0x20, (byte) 0x80, 0x00}; lc = new byte {0x01}; commandData = new byte {(byte) 0xFF}; }
Source:
public void testFullConfig() throws Exception { InputStream stream = TesseractOCRConfigTest.class.getResourceAsStream( "/test-properties/TesseractOCRConfig-full.properties"); TesseractOCRConfig config = new TesseractOCRConfig(stream); assertEquals("Invalid overridden tesseractPath value", "/opt/tesseract" + File.separator, config.getTesseractPath()); assertEquals("Invalid overridden tesseractPath value", "/usr/local/share" + File.separator, config.getTessdataPath()); assertEquals("Invalid overridden language value", "fra+deu", config.getLanguage()); assertEquals("Invalid overridden pageSegMode value", "2", config.getPageSegMode()); assertEquals("Invalid overridden minFileSizeToOcr value", 1, config.getMinFileSizeToOcr()); assertEquals("Invalid overridden maxFileSizeToOcr value", 2000000, config.getMaxFileSizeToOcr()); assertEquals("Invalid overridden timeout value", 240, config.getTimeout()); assertEquals("Invalid overridden ImageMagickPath value", "/usr/local/bin/", config.getImageMagickPath()); assertEquals("Invalid overridden density value", 200 , config.getDensity()); assertEquals("Invalid overridden depth value", 8 , config.getDepth()); assertEquals("Invalid overridden filter value", "box" , config.getFilter()); assertEquals("Invalid overridden resize value", 300 , config.getResize()); }

Target:
public void testFullConfig() throws Exception { InputStream stream = TesseractOCRConfigTest.class.getResourceAsStream( "/test-properties/TesseractOCRConfig-full.properties"); TesseractOCRConfig config = new TesseractOCRConfig(stream); if(SystemUtils.IS_OS_UNIX) { assertEquals("Invalid overridden tesseractPath value", "/opt/tesseract" + File.separator, config.getTesseractPath()); assertEquals("Invalid overridden tesseractPath value", "/usr/local/share" + File.separator, config.getTessdataPath()); assertEquals("Invalid overridden ImageMagickPath value", "/usr/local/bin/", config.getImageMagickPath()); } assertEquals("Invalid overridden language value", "fra+deu", config.getLanguage()); assertEquals("Invalid overridden pageSegMode value", "2", config.getPageSegMode()); assertEquals("Invalid overridden minFileSizeToOcr value", 1, config.getMinFileSizeToOcr()); assertEquals("Invalid overridden maxFileSizeToOcr value", 2000000, config.getMaxFileSizeToOcr()); assertEquals("Invalid overridden timeout value", 240, config.getTimeout()); assertEquals("Invalid overridden density value", 200 , config.getDensity()); assertEquals("Invalid overridden depth value", 8 , config.getDepth()); assertEquals("Invalid overridden filter value", "box" , config.getFilter()); assertEquals("Invalid overridden resize value", 300 , config.getResize()); }
Source:
public int hashCode() { return Objects.hash(this.version, this.globalLsn, this.localLsnByRegion); }

Target:
public int hashCode() { return super.hashCode(); }
Source:
private void activateContextService() { if (!fActiveContexts.isEmpty()) { deactivateContextService(); } fActiveContexts.add(fContextService.activateContext(CONTEXT)); }

Target:
private void activateContextService() { if (fActiveContexts.isEmpty()) { fActiveContexts.add(fContextService.activateContext(CONTEXT)); } }
Source:
public void bringToFront() { if (PlatformSpecific.isOnMac()) { try { scriptEngine.eval("tell application \"System Events\" to repeat with p in (every application process whose name contains \"Chrome\" and name does not contain \"Helper\")\nif (title of window of p as string) contains \"" + driver.getTitle() + "\" then tell process p to perform action \"AXRaise\" of window 1 of p\nend repeat"); } catch (ScriptException e) { logger.info("Bring browser window to front script exception! " + e.getLocalizedMessage()); } catch (Exception e) { logger.info("Bring browser window to front exception! " + e.getLocalizedMessage()); } } }

Target:
public void bringToFront() { if (PlatformSpecific.isOnMac()) { try { if (scriptEngine == null) { ScriptEngineManager scriptEngineManager = new ScriptEngineManager(); scriptEngine = scriptEngineManager.getEngineByName("AppleScriptEngine"); } scriptEngine.eval("tell application \"System Events\" to repeat with p in (every application process whose name contains \"Chrome\" and name does not contain \"Helper\")\nif (title of window of p as string) contains \"" + driver.getTitle() + "\" then tell process p to perform action \"AXRaise\" of window 1 of p\nend repeat"); } catch (ScriptException e) { logger.info("Bring browser window to front script exception! " + e.getLocalizedMessage()); } catch (Exception e) { logger.info("Bring browser window to front exception! " + e.getLocalizedMessage()); } } }
Source:
public void checkAttributeSemantics(PerunSessionImpl perunSession, Facility facility, Attribute attribute) throws InternalErrorException, WrongReferenceAttributeValueException { String pbsServer = attribute.valueAsString(); if (pbsServer == null) throw new WrongReferenceAttributeValueException(attribute, "PbsServer cannot be null."); List<Facility> allFacilities = perunSession.getPerunBl().getFacilitiesManagerBl().getFacilities(perunSession); boolean success = false; for(Facility f: allFacilities) { if(f.getName().equals(pbsServer)) { success = true; break; } } if(!success) throw new WrongReferenceAttributeValueException(attribute, null, facility, null, "No core attribute " + pbsServer + " exist for facility object in perun."); }

Target:
public void checkAttributeSemantics(PerunSessionImpl perunSession, Facility facility, Attribute attribute) throws InternalErrorException, WrongReferenceAttributeValueException { String pbsServer = attribute.valueAsString(); if (pbsServer == null) throw new WrongReferenceAttributeValueException(attribute, "PbsServer cannot be null."); List<Facility> allFacilities = perunSession.getPerunBl().getFacilitiesManagerBl().getFacilities(perunSession); boolean success = false; for(Facility f: allFacilities) { if(f.getName().equals(pbsServer)) { success = true; break; } } try { Attribute name = new Attribute(perunSession.getPerunBl().getAttributesManagerBl().getAttributeDefinition(perunSession, AttributesManager.NS_FACILITY_ATTR_CORE + ":name")); name.setValue(pbsServer); if(!success) throw new WrongReferenceAttributeValueException(attribute, name, facility, null, "There is no facility with attribute name same as the pbsServer attribute."); } catch (AttributeNotExistsException e) { throw new ConsistencyErrorException(e); } }
Source:
private String getClassName() { String className; int resourceId; String carrierConfig; switch (mTransportType) { case AccessNetworkConstants.TRANSPORT_TYPE_WWAN: resourceId = com.android.internal.R.string.config_wwan_network_service_class; carrierConfig = CarrierConfigManager .KEY_CARRIER_NETWORK_SERVICE_WWAN_CLASS_OVERRIDE_STRING; break; case AccessNetworkConstants.TRANSPORT_TYPE_WLAN: resourceId = com.android.internal.R.string.config_wlan_network_service_class; carrierConfig = CarrierConfigManager .KEY_CARRIER_NETWORK_SERVICE_WLAN_CLASS_OVERRIDE_STRING; break; default: throw new IllegalStateException("Transport type not WWAN or WLAN. type=" + mTransportType); } className = mPhone.getContext().getResources().getString(resourceId); PersistableBundle b = mCarrierConfigManager.getConfigForSubId(mPhone.getSubId()); if (b != null && !TextUtils.isEmpty(b.getString(carrierConfig))) { className = b.getString(carrierConfig, className); } if (b != null && !TextUtils.isEmpty(b.getString(carrierConfig))) { className = b.getString(carrierConfig, className); } List<ResolveInfo> resolveInfo = mPhone.getContext().getPackageManager().queryIntentServices( new Intent(NetworkService.SERVICE_INTERFACE), PackageManager.MATCH_SYSTEM_ONLY); if (resolveInfo != null) { for (ResolveInfo info : resolveInfo) { if (info.serviceInfo == null) continue; if ((info.serviceInfo.name).contains(className)) { className = info.serviceInfo.name; break; } } } return className; }

Target:
private String getClassName() { String className; int resourceId; String carrierConfig; switch (mTransportType) { case AccessNetworkConstants.TRANSPORT_TYPE_WWAN: resourceId = com.android.internal.R.string.config_wwan_network_service_class; carrierConfig = CarrierConfigManager .KEY_CARRIER_NETWORK_SERVICE_WWAN_CLASS_OVERRIDE_STRING; break; case AccessNetworkConstants.TRANSPORT_TYPE_WLAN: resourceId = com.android.internal.R.string.config_wlan_network_service_class; carrierConfig = CarrierConfigManager .KEY_CARRIER_NETWORK_SERVICE_WLAN_CLASS_OVERRIDE_STRING; break; default: throw new IllegalStateException("Transport type not WWAN or WLAN. type=" + mTransportType); } className = mPhone.getContext().getResources().getString(resourceId); PersistableBundle b = mCarrierConfigManager.getConfigForSubId(mPhone.getSubId()); if (b != null && !TextUtils.isEmpty(b.getString(carrierConfig))) { className = b.getString(carrierConfig, className); } return className; }
Source:
public void start(Stage stage) { try { setUp(stage); try { LibraryLoader libraryLoader = new LibraryLoader("library.xml"); library = libraryLoader.load(); if (library.size() < 1) { empty = true; } } catch (IOException | NullPointerException e) { library = new Library(); empty = true; log.info("No library found"); } scene.getWindow().setOnHidden(new EventHandler<WindowEvent>() { @Override public void handle(WindowEvent arg0) { if (library != null) { XmlExport exporter = new XmlExport("library.xml", library); exporter.export(); } System.exit(0); } }); if (empty) { log.trace("opening folderchooser"); String directory = ""; DirectoryChooser directoryChooser = new DirectoryChooser(); File selectedDirectory = directoryChooser.showDialog(null); if (selectedDirectory == null) { log.warn("No directory selected."); System.exit(-1); } else { directory = selectedDirectory.getAbsolutePath(); } FolderLoader folderLoader = new FolderLoader(directory); String playlistname = FileName.getName(directory); Playlist playlist = folderLoader.load(); PlaylistSorter sorter = new MaximumFlowPlaylistSorter(); Playlist mixablePlaylist = sorter.sort(playlist); controller.setEverything(mixablePlaylist, playlistname, scene); } else { controller.setLibrary(library, scene); } } catch (Exception e) { log.fatal(e.getMessage(), e); e.printStackTrace(); System.exit(-1); } }

Target:
public void start(Stage stage) { try { setUp(stage); try { LibraryLoader libraryLoader = new LibraryLoader("library.xml"); library = libraryLoader.load(); if (library.size() < 1) { empty = true; } } catch (IOException | NullPointerException e) { library = new Library(); empty = true; log.info("No library found"); } scene.getWindow().setOnHidden(new EventHandler<WindowEvent>() { @Override public void handle(WindowEvent arg0) { if (library != null) { XmlExport exporter = new XmlExport("library.xml", library); exporter.export(); } System.exit(0); } }); if (empty) { log.trace("opening folderchooser"); String directory = ""; DirectoryChooser directoryChooser = new DirectoryChooser(); File selectedDirectory = directoryChooser.showDialog(null); if (selectedDirectory == null) { log.warn("No directory selected."); System.exit(-1); } else { directory = selectedDirectory.getAbsolutePath(); } FolderLoader folderLoader = new FolderLoader(directory); String playlistname = FileName.getName(directory); Playlist playlist = folderLoader.load(); PlaylistSorter sorter = new MaximumFlowPlaylistSorter(); Playlist mixablePlaylist = sorter.sort(playlist); controller.setEverything(mixablePlaylist, playlistname, scene); } else { controller.setLibrary(library, scene); } } catch (Exception e) { log.fatal(e.getMessage(), e); System.exit(-1); } }
Source:
@Override public Boolean call() throws RuntimeException { try { ClassLoader loader = getClass().getClassLoader(); Object jnr = PosixAPI.jnr(); Method waitpidMethod = jnr.getClass().getDeclaredMethod("waitpid", int.class, int[].class, int.class); Class WaitFlags = loader.loadClass("jnr.constants.platform.WaitFlags"); Method intValue = WaitFlags.getDeclaredMethod("intValue"); Integer WNOHANG = (Integer) intValue.invoke(Enum.valueOf(WaitFlags, "WNOHANG")); int[] code = new int[1]; waitpidMethod.setAccessible(true); Integer ret = (Integer) waitpidMethod.invoke(jnr, pid, code, WNOHANG); return ret != -1; } catch (InvocationTargetException x) { LOGGER.log(Level.FINE, "jnr doesn't have waitpid support", x); } catch (IllegalAccessException x) { LOGGER.log(Level.FINE, "jnr doesn't have waitpid support", x); } catch (ClassNotFoundException x) { LOGGER.log(Level.FINE, "jnr doesn't have waitpid support", x); } catch (NoSuchMethodException x) { LOGGER.log(Level.FINE, "jnr doesn't have waitpid support", x); } LibC libc = LibC.INSTANCE; if (libc.getpgid(0) == -1) { throw new IllegalStateException("getpgid does not seem to work on this platform"); } return libc.getpgid(pid) != -1; }

Target:
@Override public Boolean call() throws IllegalStateException { final String fallback_msg = "jnr doesn't have waitpid support; "+ "falling back to the JNA LibC implementation"; try { ClassLoader loader = getClass().getClassLoader(); Object jnr = PosixAPI.jnr(); Method waitpidMethod = jnr.getClass().getDeclaredMethod("waitpid", int.class, int[].class, int.class); Class WaitFlags = loader.loadClass("jnr.constants.platform.WaitFlags"); Method intValue = WaitFlags.getDeclaredMethod("intValue"); Integer WNOHANG = (Integer) intValue.invoke(Enum.valueOf(WaitFlags, "WNOHANG")); int[] code = new int[1]; waitpidMethod.setAccessible(true); Integer ret = (Integer) waitpidMethod.invoke(jnr, pid, code, WNOHANG); return ret != -1; } catch (InvocationTargetException x) { LOGGER.log(Level.WARNING, fallback_msg, x); } catch (IllegalAccessException x) { LOGGER.log(Level.WARNING, fallback_msg, x); } catch (ClassNotFoundException x) { LOGGER.log(Level.WARNING, fallback_msg, x); } catch (NoSuchMethodException x) { LOGGER.log(Level.WARNING, fallback_msg, x); } catch (SecurityException x) { LOGGER.log(Level.WARNING, fallback_msg, x); } LibC libc = LibC.INSTANCE; if (libc.getpgid(0) == -1) { throw new IllegalStateException("getpgid does not seem to work on this platform"); } return libc.getpgid(pid) != -1; }
Source:
public JpaPagingItemReader<DayActivity> dayActivityReader() { try { String jpqlQuery = "SELECT d FROM DayActivity d WHERE d.startDate <= :yesterday AND d.aggregatesComputed = false"; JpaPagingItemReader<DayActivity> reader = new JpaPagingItemReader<>(); reader.setQueryString(jpqlQuery); reader.setParameterValues( Collections.singletonMap("yesterday", ZonedDateTime.now(DEFAULT_TIME_ZONE).minusDays(1).toLocalDate())); reader.setEntityManagerFactory(entityManager.getEntityManagerFactory()); reader.setPageSize(DAY_ACTIVITY_CHUNK_SIZE); reader.afterPropertiesSet(); reader.setSaveState(true); return reader; } catch (Exception e) { throw YonaException.unexpected(e); } }

Target:
public JpaPagingItemReader<DayActivity> dayActivityReader() { try { String jpqlQuery = "SELECT d FROM DayActivity d WHERE d.startDate <= :yesterday AND d.aggregatesComputed = false"; JpaPagingItemReader<DayActivity> reader = new JpaPagingItemReader<>(); reader.setQueryString(jpqlQuery); reader.setParameterValues(Collections.singletonMap("yesterday", TimeUtil.getStartOfDay(DEFAULT_TIME_ZONE, ZonedDateTime.now(DEFAULT_TIME_ZONE).minusDays(1)).toLocalDate())); reader.setEntityManagerFactory(entityManager.getEntityManagerFactory()); reader.setPageSize(DAY_ACTIVITY_CHUNK_SIZE); reader.afterPropertiesSet(); reader.setSaveState(true); return reader; } catch (Exception e) { throw YonaException.unexpected(e); } }
Source:
public void testDefaultVaryHeader() { final Response clientResponse = ClientBuilder.newClient().target("http://localhost:" + RULE.getLocalPort() +"/test") .request() .header(ACCEPT_ENCODING, "gzip") .get(); System.out.println("RESPONSE=" + clientResponse); System.out.println("HEADERS=" + clientResponse.getHeaders()); assertThat(clientResponse.getHeaders().get(VARY)).isEqualTo(asList((Object)ACCEPT_ENCODING)); assertThat(clientResponse.getHeaders().get(CONTENT_ENCODING)).isEqualTo(asList((Object) "gzip")); }

Target:
public void testDefaultVaryHeader() { final Response clientResponse = ClientBuilder.newClient().target("http://localhost:" + RULE.getLocalPort() +"/test") .request() .header(ACCEPT_ENCODING, "gzip") .get(); assertThat(clientResponse.getHeaders().get(VARY)).isEqualTo(asList((Object)ACCEPT_ENCODING)); assertThat(clientResponse.getHeaders().get(CONTENT_ENCODING)).isEqualTo(asList((Object) "gzip")); }
Source:
public static BlobStoreControlAdminRequest readFrom(DataInputStream stream, AdminRequest adminRequest) throws IOException { short versionId = stream.readShort(); short numReplicasCaughtUpPerPartition; BlobStoreControlRequestType controlRequestType; switch (versionId) { case VERSION_V1: numReplicasCaughtUpPerPartition = stream.readShort(); controlRequestType = stream.readByte() == 1 ? BlobStoreControlRequestType.StartStore : BlobStoreControlRequestType.StopStore; break; case VERSION_V2: numReplicasCaughtUpPerPartition = stream.readShort(); controlRequestType = BlobStoreControlRequestType.values()[stream.readByte()]; break; default: throw new IllegalStateException("Unrecognized version for BlobStoreControlAdminRequest: " + versionId); } return new BlobStoreControlAdminRequest(numReplicasCaughtUpPerPartition, controlRequestType, adminRequest); }

Target:
public static BlobStoreControlAdminRequest readFrom(DataInputStream stream, AdminRequest adminRequest) throws IOException { Short versionId = stream.readShort(); if (!versionId.equals(VERSION_V1)) { throw new IllegalStateException("Unrecognized version for BlobStoreControlAdminRequest: " + versionId); } short numReplicasCaughtUpPerPartition = stream.readShort(); BlobStoreControlAction controlRequestType = BlobStoreControlAction.values()[stream.readByte()]; return new BlobStoreControlAdminRequest(numReplicasCaughtUpPerPartition, controlRequestType, adminRequest); }
Source:
public List<CriticalComponent> getCriticalComponents() { List<CriticalComponent> componentList = new ArrayList<CriticalComponent>(); for (CriticalComponentImpl cci : this.criticalServiceList) { componentList.add(cci.getCriticalComponent()); } return componentList; }

Target:
public List<CriticalComponent> getCriticalComponents() { List<CriticalComponent> componentList = new ArrayList<>(); for (CriticalComponentImpl cci : this.criticalComponentList) { componentList.add(cci.getCriticalComponent()); } return Collections.unmodifiableList(componentList); }
Source:
private InitialContext getInitialContext(InitialContextLookupType lookupType, String nodeHostName) { final Hashtable<String, String> jndiProperties = new Hashtable<>(); jndiProperties.put(Context.URL_PKG_PREFIXES, "org.jboss.ejb.client.naming"); jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY, "org.wildfly.naming.client.WildFlyInitialContextFactory"); if(nodeHostName.contains(":") && !nodeHostName.contains("[")) { nodeHostName = "[" + nodeHostName + "]"; } String lookupProviderUrl = "<see wildfly-config.xml>"; switch(lookupType) { case HTTP: lookupProviderUrl = String.format("http://%s:%s/wildfly-services", nodeHostName, node0Port); jndiProperties.put(Context.PROVIDER_URL, lookupProviderUrl); jndiProperties.put(Context.SECURITY_PRINCIPAL, "user1"); jndiProperties.put(Context.SECURITY_CREDENTIALS, "password1"); break; case REMOTE_HTTP: lookupProviderUrl = String.format("remote+http://%s:%s", nodeHostName, node0Port); jndiProperties.put(Context.PROVIDER_URL, lookupProviderUrl); break; case WILDFLY_CONFIG: default: log.debugf("Not using value '%s' of nodeHostName parameter, " + "wildfly-config.xml defines the URL on its own", nodeHostName); } try { return new InitialContext(jndiProperties); } catch (NamingException ne) { throw new IllegalStateException(String.format( "Cannot create InitialContext with url provider '%s'", lookupProviderUrl), ne); } }

Target:
private InitialContext getInitialContext(InitialContextLookupType lookupType, String nodeHostName) { final Hashtable<String, String> jndiProperties = new Hashtable<>(); jndiProperties.put(Context.INITIAL_CONTEXT_FACTORY, "org.wildfly.naming.client.WildFlyInitialContextFactory"); if(nodeHostName.contains(":") && !nodeHostName.contains("[")) { nodeHostName = "[" + nodeHostName + "]"; } String lookupProviderUrl = "<see wildfly-config.xml>"; switch(lookupType) { case HTTP: lookupProviderUrl = String.format("http://%s:%s/wildfly-services", nodeHostName, node0Port); jndiProperties.put(Context.PROVIDER_URL, lookupProviderUrl); jndiProperties.put(Context.SECURITY_PRINCIPAL, "user1"); jndiProperties.put(Context.SECURITY_CREDENTIALS, "password1"); break; case REMOTE_HTTP: lookupProviderUrl = String.format("remote+http://%s:%s", nodeHostName, node0Port); jndiProperties.put(Context.PROVIDER_URL, lookupProviderUrl); break; case WILDFLY_CONFIG: default: log.debugf("Not using value '%s' of nodeHostName parameter, " + "wildfly-config.xml defines the URL on its own", nodeHostName); } try { return new InitialContext(jndiProperties); } catch (NamingException ne) { throw new IllegalStateException(String.format( "Cannot create InitialContext with url provider '%s'", lookupProviderUrl), ne); } }
Source:
private void initListeners() { loginValidatorWatcher = new LoginValidatorWatcher(mUrl, mUsername, mPassword, mDropdownLocation, mLoginButton); mUrl.setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override public void onFocusChange(View view, boolean b) { if (StringUtils.notEmpty(mUrl.getText().toString()) && !view.isFocused() && loginValidatorWatcher.isUrlChanged() || (loginValidatorWatcher.isUrlChanged() && loginValidatorWatcher.isLocationErrorOccurred())) { ((LoginFragment) getActivity() .getSupportFragmentManager() .findFragmentById(R.id.loginContentFrame)) .setUrl(mUrl.getText().toString()); loginValidatorWatcher.setUrlChanged(false); } } }); mLoginSyncSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) { SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(OpenMRS.getInstance()).edit(); editor.putBoolean("sync", isChecked); editor.commit(); } }); mLoginButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mPresenter.login(mUsername.getText().toString(), mPassword.getText().toString(), mUrl.getText().toString(), initialUrl); } }); mForgotPass.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { forgotPassword(); } }); }

Target:
private void initListeners() { mLoginSyncButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(OpenMRS.getInstance()); boolean syncState = prefs.getBoolean("sync", true); SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(OpenMRS.getInstance()).edit(); editor.putBoolean("sync", !syncState); editor.commit(); setSyncButtonState(!syncState); } }); loginValidatorWatcher = new LoginValidatorWatcher(mUrl, mUsername, mPassword, mDropdownLocation, mLoginButton); mUrl.setOnFocusChangeListener(new View.OnFocusChangeListener() { @Override public void onFocusChange(View view, boolean b) { if (StringUtils.notEmpty(mUrl.getText().toString()) && !view.isFocused() && loginValidatorWatcher.isUrlChanged() || (loginValidatorWatcher.isUrlChanged() && loginValidatorWatcher.isLocationErrorOccurred())) { ((LoginFragment) getActivity() .getSupportFragmentManager() .findFragmentById(R.id.loginContentFrame)) .setUrl(mUrl.getText().toString()); loginValidatorWatcher.setUrlChanged(false); } } }); mLoginButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mPresenter.login(mUsername.getText().toString(), mPassword.getText().toString(), mUrl.getText().toString(), initialUrl); } }); mForgotPass.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { forgotPassword(); } }); }
Source:
private static void sendZipUsingMap(ZipOutputStream zos, VirtualFile dir, Map<String, VirtualFile> nameToVirtualFiles) throws IOException { for (Map.Entry<String, VirtualFile> entry : nameToVirtualFiles.entrySet()) { String n = entry.getKey(); String relativePath; relativePath = dir.getName() + '/' + n; VirtualFile f = entry.getValue(); sendOneZipEntry(zos, f, relativePath); } }

Target:
private static void sendZipUsingMap(ZipOutputStream zos, VirtualFile dir, Map<String, VirtualFile> nameToVirtualFiles) throws IOException { for (Map.Entry<String, VirtualFile> entry : nameToVirtualFiles.entrySet()) { String n = entry.getKey(); String relativePath = dir.getName() + '/' + n; VirtualFile f = entry.getValue(); sendOneZipEntry(zos, f, relativePath); } }
Source:
public void parse(InputStream in) throws IOException { BufferedReader br = asReader(in); String txt; while ((txt = br.readLine()) != null) { txt = txt.trim(); if (txt.length() > 0 && !txt.startsWith("#")) { int patternEnd = txt.indexOf(' '); if(txt.length() > patternEnd) rules.add(new AttributesRule(txt.substring(0, patternEnd), txt.substring(patternEnd + 1).trim())); } } }

Target:
public void parse(InputStream in) throws IOException { BufferedReader br = asReader(in); String txt; while ((txt = br.readLine()) != null) { txt = txt.trim(); if (txt.length() > 0 && !txt.startsWith("#")) { int patternEnd = txt.indexOf(' '); if (patternEnd > -1) rules.add(new AttributesRule(txt.substring(0, patternEnd), txt.substring(patternEnd + 1).trim())); } } }
Source:
protected void onDestroy() { super.onDestroy(); if (getHierarchyTask != null) { getHierarchyTask.cancel(true); getHierarchyTask = null; } isDestroyed = true; }

Target:
protected void onDestroy() { super.onDestroy(); if (getHierarchyTask != null) { getHierarchyTask.cancel(true); getHierarchyTask = null; } }