auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
Set<InetSocketAddress> maybeFilterLocalHosts(Set<InetSocketAddress> hosts) { if (new Random().nextDouble() < config.localHostWeighting()) { Set<InetSocketAddress> localFilteredHosts = Sets.intersection(localHosts, hosts); if (!localFilteredHosts.isEmpty()) { localHostsSelected.inc(); return localFilteredHosts; } } randomHostsSelected.inc(); return hosts; }

Target:
Set<InetSocketAddress> maybeFilterLocalHosts(Set<InetSocketAddress> hosts) { if (random.nextDouble() < config.localHostWeighting()) { Set<InetSocketAddress> localFilteredHosts = Sets.intersection(localHosts, hosts); if (!localFilteredHosts.isEmpty()) { localHostsSelected.inc(); return localFilteredHosts; } } randomHostsSelected.inc(); return hosts; }
Source:
public Schema apply(Schema originalSchema) throws SchemaSyncError { Schema newSchema = originalSchema.copy(); Database database = findDatabase(newSchema, dbName, ifExists); if ( database == null && !ifExists ) { throw new SchemaSyncError("Can't drop missing database: " + dbName); } newSchema.getDatabases().remove(database); return newSchema; }

Target:
public Schema apply(Schema originalSchema) throws SchemaSyncError { Schema newSchema = originalSchema.copy(); Database database = newSchema.findDatabase(dbName); if ( database == null ) { if ( ifExists ) { return newSchema; } else { throw new SchemaSyncError("Can't drop missing database: " + dbName); } } newSchema.getDatabases().remove(database); return newSchema; }
Source:
public PagedFlux<SecretBase> listSecretVersions(String name) { return new PagedFlux<>(() -> listSecretVersionsFirstPage(name), continuationToken -> listSecretsNextPage(continuationToken)); }

Target:
public PagedFlux<SecretBase> listSecretVersions(String name) { return new PagedFlux<>(() -> listSecretVersionsFirstPage(name), continuationToken -> listSecretVersionsNextPage(continuationToken)); }
Source:
public void init(ComponentRegistry componentRegistry) { if (encodingClasses != null) { componentRegistry.wireDependencies(this); } if (encodingClasses != null) { componentRegistry.wireDependencies(this); } }

Target:
public void init(ComponentRegistry componentRegistry) { if (encodingClasses != null) { componentRegistry.wireDependencies(this); } }
Source:
public List<String> getAllTables(String dbname) throws MetaException, IOException { try { return getHive().getAllTables(dbname); } catch (TException e) { mHive = newHiveClient(); return getHive().getAllTables(dbname); } }

Target:
public List<String> getAllTables(String dbname) throws TException, MetaException, IOException { return retryCall("getAllTables", () -> getHive().getAllTables(dbname)); }
Source:
public void validate(GlobalConfiguration globalConfig) { Attribute<String> location = attributes.attribute(LOCATION); if (location.isNull() && !globalConfig.globalState().enabled()) { Log.CONFIG.storeLocationRequired(); } super.validate(globalConfig); }

Target:
public void validate(GlobalConfiguration globalConfig) { Attribute<String> location = attributes.attribute(LOCATION); if (location.isNull() && !globalConfig.globalState().enabled()) { throw Log.CONFIG.storeLocationRequired(); } super.validate(globalConfig); }
Source:
public void run() { try { listener = new ServerSocket(port); while (true) { socket = listener.accept(); outStr = new DataOutputStream(socket.getOutputStream()); while (socket.getInputStream() .read() != -1) { testRunSession = new TestRunSessionAndPort(launch, project); outStr.writeInt(testRunSession.getPort()); } } } catch (SocketException se) { logger.logInfo("Connection to tester terminated", se); } catch (IOException e) { logger.logError("Error communicating to the tester", e); } close(); }

Target:
public void run() { try { while (true) { socket = listener.accept(); outStr = new DataOutputStream(socket.getOutputStream()); while (socket.getInputStream() .read() != -1) { testRunSession = new TestRunSessionAndPort(launch, project); outStr.writeInt(testRunSession.getPort()); } } } catch (SocketException se) { logger.logInfo("Connection to tester terminated", se); } catch (IOException e) { logger.logError("Error communicating to the tester", e); } close(); }
Source:
protected List<Object> getModelChildren() { ArrayList<Object> elements = new ArrayList<>(); elements.add(new InstanceName(getModel())); elements.addAll(getModel().getInterface().getAllInterfaceElements()); return elements; }

Target:
protected List<Object> getModelChildren() { List<Object> elements = new ArrayList<>(); elements.add(new InstanceName(getModel())); elements.addAll(getModel().getInterface().getAllInterfaceElements()); return elements; }
Source:
public FormattingModel createModel(@NotNull PsiElement element, @NotNull CodeStyleSettings settings) { if (settings.getIndentOptions() != null) { settings.getIndentOptions().USE_TAB_CHARACTER = true; settings.getIndentOptions().SMART_TABS = false; } Block block = new GoFormattingBlock(element.getNode(), null, Indent.getNoneIndent(), null, settings, createSpacingBuilder(settings)); return FormattingModelProvider.createFormattingModelForPsiFile(element.getContainingFile(), block, settings); }

Target:
public FormattingModel createModel(@NotNull PsiElement element, @NotNull CodeStyleSettings settings) { Block block = new GoFormattingBlock(element.getNode(), null, Indent.getNoneIndent(), null, settings, createSpacingBuilder(settings)); return FormattingModelProvider.createFormattingModelForPsiFile(element.getContainingFile(), block, settings); }
Source:
public int openDocument(ParcelFileDescriptor source) throws RemoteException { synchronized (mLock) { while(mRenderer != null) { try { mLock.wait(); } catch (InterruptedException e) { } } try { throwIfOpened(); if (DEBUG) { Log.i(LOG_TAG, "openDocument()"); } mEditor = new PdfEditor(source); return mEditor.getPageCount(); } catch (IOException | IllegalStateException e) { IoUtils.closeQuietly(source); Log.e(LOG_TAG, "Cannot open file", e); throw new RemoteException(e.toString()); } } }

Target:
public int openDocument(ParcelFileDescriptor source) throws RemoteException { synchronized (mLock) { while (mRenderer != null) { try { mLock.wait(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } try { throwIfOpened(); if (DEBUG) { Log.i(LOG_TAG, "openDocument()"); } mEditor = new PdfEditor(source); return mEditor.getPageCount(); } catch (IOException | IllegalStateException e) { IoUtils.closeQuietly(source); Log.e(LOG_TAG, "Cannot open file", e); throw new RemoteException(e.toString()); } } }
Source:
public static MessageType getMessageType(String line) { for (MessageType msgType : MessageType.values()) { if (line.startsWith(msgType.getMessageIndicator())) { return msgType; } } return null; }

Target:
private static MessageType getMessageType(String line) { for (MessageType msgType : MessageType.values()) { if (line.startsWith(msgType.name() + SEPARATOR)) { return msgType; } } return null; }
Source:
public void testReconfigure() throws InterruptedException { RepositoryCache.register(db); assertTrue(RepositoryCache.isCached(db)); db.close(); assertTrue(RepositoryCache.isCached(db)); RepositoryCacheConfig config = new RepositoryCacheConfig(); config.setExpireAfter(1); config.setCleanupDelay(1); config.install(); int t = 1; for (int i = 0; i <= 10; i++) { Thread.sleep(t); if (!RepositoryCache.isCached(db)) { return; } t = t * 2; } fail("Repository should have been evicted from cache"); }

Target:
public void testReconfigure() throws InterruptedException { RepositoryCache.register(db); assertTrue(RepositoryCache.isCached(db)); db.close(); assertTrue(RepositoryCache.isCached(db)); RepositoryCacheConfig config = new RepositoryCacheConfig(); config.setExpireAfter(1); config.setCleanupDelay(1); config.install(); for (int i = 0; i <= 10; i++) { Thread.sleep(1 << i); if (!RepositoryCache.isCached(db)) { return; } } fail("Repository should have been evicted from cache"); }
Source:
public String deleteExtensionMetadata(final String extensionName) throws StoreAccessException{ ExtensionType extensionType = AbstractExtension.isExtensionTrusted(extensionName) ? ExtensionType.TRUSTED : ExtensionType.CUSTOM; if (extensionType.toString().equalsIgnoreCase(ExtensionType.TRUSTED.toString())){ throw new StoreAccessException(new Exception(extensionName + " is trusted cannot be deleted.")); } if (metaStore.checkIfExtensionExists(extensionName)) { metaStore.deleteExtensionMetadata(extensionName); return "Deleted entry for:" + extensionName; }else { return "Extension:" + extensionName + " is not registered with falcon."; } }

Target:
public String deleteExtensionMetadata(final String extensionName) throws ValidationException{ ExtensionType extensionType = AbstractExtension.isExtensionTrusted(extensionName) ? ExtensionType.TRUSTED : ExtensionType.CUSTOM; if (extensionType.equals(ExtensionType.TRUSTED)){ throw new ValidationException(extensionName + " is trusted cannot be deleted."); } if (metaStore.checkIfExtensionExists(extensionName)) { metaStore.deleteExtensionMetadata(extensionName); return "Deleted extension:" + extensionName; }else { return "Extension:" + extensionName + " is not registered with Falcon."; } }
Source:
public void visitNode(Tree tree) { if (!hasSemantic()) { return; } if (tree.is(SYNCHRONIZED_STATEMENT)) { SynchronizedStatementTree synchronizedTree = (SynchronizedStatementTree) tree; if (synchronizedTree.expression().is(METHOD_INVOCATION)) { MethodInvocationTree synchronizedExpr = (MethodInvocationTree) synchronizedTree.expression(); if (GET_CLASS_MATCHER.matches(synchronizedExpr) && !isEnclosingClassFinal(synchronizedExpr.methodSelect())) { reportIssue(synchronizedExpr, "Synchronize on the static class name instead."); } } } }

Target:
public void visitNode(Tree tree) { if (!hasSemantic()) { return; } SynchronizedStatementTree synchronizedTree = (SynchronizedStatementTree) tree; if (synchronizedTree.expression().is(METHOD_INVOCATION)) { MethodInvocationTree synchronizedExpr = (MethodInvocationTree) synchronizedTree.expression(); if (GET_CLASS_MATCHER.matches(synchronizedExpr) && !isEnclosingClassFinal(synchronizedExpr.methodSelect())) { reportIssue(synchronizedExpr, "Synchronize on the static class name instead."); } } }
Source:
private void assertIndexMatchesVals(IndexedFloats indexed, float[] vals) { Assert.assertEquals(vals.length, indexed.size()); int[] indices = new int[vals.length]; for (int i = 0; i < indexed.size(); ++i) { Assert.assertEquals(vals[i], indexed.get(i), DELTA); indices[i] = i; } IntArrays.shuffle(indices, new Random()); final int limit = Math.min(indexed.size(), 1000); for (int i = 0; i < limit; ++i) { int k = indices[i]; Assert.assertEquals(vals[k], indexed.get(k), DELTA); } }

Target:
private void assertIndexMatchesVals(IndexedFloats indexed, float[] vals) { Assert.assertEquals(vals.length, indexed.size()); int[] indices = new int[vals.length]; for (int i = 0; i < indexed.size(); ++i) { Assert.assertEquals(vals[i], indexed.get(i), DELTA); indices[i] = i; } IntArrays.shuffle(indices, ThreadLocalRandom.current()); final int limit = Math.min(indexed.size(), 1000); for (int i = 0; i < limit; ++i) { int k = indices[i]; Assert.assertEquals(vals[k], indexed.get(k), DELTA); } }
Source:
public void addParam(String key, String value) { if (parameters.containsKey(key)) { throw new IllegalArgumentException(); } if (hasParameterBefore) { builder.append("&"); } else { hasParameterBefore = true; } try { builder.append(key).append("=").append(URLEncoder.encode(value, "UTF-8")); } catch (UnsupportedEncodingException e) { throw rethrow(e); } parameters.put(key, value); }

Target:
public void addParam(String key, String value) { if (parameters.containsKey(key)) { throw new IllegalArgumentException("Parameter " + key + " is already added"); } if (hasParameterBefore) { builder.append("&"); } else { hasParameterBefore = true; } try { builder.append(key).append("=").append(URLEncoder.encode(value, "UTF-8")); } catch (UnsupportedEncodingException e) { throw rethrow(e); } parameters.put(key, value); }
Source:
public void resumeFormEntry() { saveResult = new MutableLiveData<>(null); }

Target:
public void resumeFormEntry() { saveResult.setValue(null); }
Source:
private SortedPositionLinks(PositionLinks positionLinks, int[][] sortedPositionLinks, List<JoinFilterFunction> searchFunctions) { this.positionLinks = requireNonNull(positionLinks, "positionLinks is null"); this.sortedPositionLinks = requireNonNull(sortedPositionLinks, "sortedPositionLinks is null"); this.sizeInBytes = INSTANCE_SIZE + positionLinks.getSizeInBytes() + sizeOfPositionLinks(sortedPositionLinks); checkState(!searchFunctions.isEmpty(), "Using sortedPositionLinks with no search functions"); this.searchFunctions = requireNonNull(searchFunctions, "searchFunctions is null"); }

Target:
private SortedPositionLinks(PositionLinks positionLinks, int[][] sortedPositionLinks, List<JoinFilterFunction> searchFunctions) { this.positionLinks = requireNonNull(positionLinks, "positionLinks is null"); this.sortedPositionLinks = requireNonNull(sortedPositionLinks, "sortedPositionLinks is null"); this.sizeInBytes = INSTANCE_SIZE + positionLinks.getSizeInBytes() + sizeOfPositionLinks(sortedPositionLinks); requireNonNull(searchFunctions, "searchFunctions is null"); checkState(!searchFunctions.isEmpty(), "Using sortedPositionLinks with no search functions"); this.searchFunctions = searchFunctions.stream().toArray(JoinFilterFunction[]::new); }
Source:
public void dropIndex(final String schemaName, String idxName, boolean ifExists) throws IgniteCheckedException{ String sql = H2Utils.indexDropSql(schemaName, idxName, ifExists); GridH2Table tbl = dataTableForIndex(schemaName, idxName); tbl.setRemoveIndexOnDestroy(true); connMgr.executeStatement(schemaName, sql); }

Target:
public void dropIndex(final String schemaName, String idxName, boolean ifExists) throws IgniteCheckedException{ String sql = H2Utils.indexDropSql(schemaName, idxName, ifExists); GridH2Table tbl = dataTableForIndex(schemaName, idxName); assert tbl != null; tbl.setRemoveIndexOnDestroy(true); connMgr.executeStatement(schemaName, sql); }
Source:
public Repo<Master> call(long tid, Master master) throws Exception { VolumeChooserEnvironment chooserEnv = new VolumeChooserEnvironment(tableInfo.tableId); String baseDir = master.getFileSystem().choose(chooserEnv, ServerConstants.getBaseUris()) + Constants.HDFS_TABLES_DIR + Path.SEPARATOR + tableInfo.tableId; tableInfo.dir = baseDir + Constants.DEFAULT_TABLET_LOCATION; if (tableInfo.initialSplitSize > 0) { createTableDirectoriesInfo(master, baseDir); } return new CreateDir(tableInfo); }

Target:
public Repo<Master> call(long tid, Master master) throws Exception { VolumeChooserEnvironment chooserEnv = new VolumeChooserEnvironment(tableInfo.tableId); String baseDir = master.getFileSystem().choose(chooserEnv, ServerConstants.getBaseUris()) + Constants.HDFS_TABLES_DIR + Path.SEPARATOR + tableInfo.tableId; tableInfo.defaultTabletDir = baseDir + Constants.DEFAULT_TABLET_LOCATION; if (tableInfo.initialSplitSize > 0) { createTableDirectoriesInfo(master, baseDir); } return new CreateDir(tableInfo); }
Source:
public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Player opponent = game.getPlayer(this.getTargetPointer().getFirst(game, source)); if (opponent != null) { int xValue = opponent.getHand().size() - controller.getHand().size(); if (xValue > 0) { opponent.loseLife(xValue, game, false); } return true; } return false; }

Target:
public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Player opponent = game.getPlayer(this.getTargetPointer().getFirst(game, source)); if (controller != null && opponent != null) { int xValue = opponent.getHand().size() - controller.getHand().size(); if (xValue > 0) { opponent.loseLife(xValue, game, false); } return true; } return false; }
Source:
public static double[] rgbToHSL(RGB rgb) { double r = rgb.red / 255.D; double g = rgb.green / 255.D; double b = rgb.blue / 255.D; double max = Math.max(Math.max(r, g), b); double min = Math.min(Math.min(r, g), b); double[] hsl = new double[] { 0, 0, (max + min) / 2 }; if (max != min) { double delta = max - min; if (hsl[2] <= 0.5) { hsl[1] = (delta / (max + min)); } else { hsl[1] = (delta / (2.0 - (max + min))); } if (r == max) { hsl[0] = (g - b) / delta; } else if (g == max) { hsl[0] = 2.0 + ((b - r) / delta); } else if (b == max) { hsl[0] = 4.0 + ((r - g) / delta); } hsl[0] *= 60.0; if (hsl[0] < 0.0) { hsl[0] += 360.0; } } return hsl; }

Target:
public static double[] rgbToHSL(RGB rgb) { double r = rgb.red / MAX_RGB_VALUE; double g = rgb.green / MAX_RGB_VALUE; double b = rgb.blue / MAX_RGB_VALUE; double max = Math.max(Math.max(r, g), b); double min = Math.min(Math.min(r, g), b); double[] hsl = new double[] { 0, 0, (max + min) / 2 }; if (max != min) { double delta = max - min; if (hsl[2] <= 0.5) { hsl[1] = (delta / (max + min)); } else { hsl[1] = (delta / (2.0 - (max + min))); } if (r == max) { hsl[0] = (g - b) / delta; } else if (g == max) { hsl[0] = 2.0 + ((b - r) / delta); } else if (b == max) { hsl[0] = 4.0 + ((r - g) / delta); } hsl[0] *= 60.0; if (hsl[0] < 0.0) { hsl[0] += 360.0; } } return hsl; }
Source:
public static String appendIfNotEmpty(final String str, final String suffix) { return isEmpty(str) ? EMPTY : str + defaultString(suffix); }

Target:
public static String appendIfNotEmpty(final String str, final String suffix) { if (isEmpty(suffix) || isEmpty(str)) { return str; } return str + suffix; }
Source:
protected PatternBasedElementProcessor newProcessor() { return new PatternBasedElementProcessor() { @Override public void emit() { Attributes attributes = new Attributes(); SpanType span = SpanType.SPAN; String cssClass = group(1); if (cssClass != null && !cssClass.isEmpty()) { attributes.setCssClass(cssClass); } else { span = SpanType.HIGHLIGHT; } getBuilder().beginSpan(span, attributes); getBuilder().characters(group(2)); getBuilder().endSpan(); } }; }

Target:
protected PatternBasedElementProcessor newProcessor() { return new PatternBasedElementProcessor() { @Override public void emit() { Attributes attributes = new Attributes(); SpanType span = SpanType.SPAN; String cssClass = group(1); if (cssClass != null && !cssClass.isEmpty()) { attributes.setCssClass(cssClass); } else { span = SpanType.MARK; } getBuilder().beginSpan(span, attributes); getBuilder().characters(group(2)); getBuilder().endSpan(); } }; }
Source:
private boolean isAffectedBy(IResourceDelta delta) { if (delta.getKind() != IResourceDelta.CHANGED) return true; int flags = delta.getFlags(); if (flags != 0 && flags != IResourceDelta.MARKERS) return true; IResourceDelta[] children = delta.getAffectedChildren(); for (IResourceDelta child : children) { if (isAffectedBy(child)) return true; } return false; }

Target:
private boolean isAffectedBy(IResourceDelta delta) { boolean[] result = new boolean[] { false }; try { delta.accept(d -> { if (result[0]) { return false; } if (d.getKind() != IResourceDelta.CHANGED) { result[0] = true; return false; } int flags = d.getFlags(); if (flags != 0 && flags != IResourceDelta.MARKERS) { result[0] = true; return false; } return true; }); } catch (CoreException e) { } return result[0]; }
Source:
public String any() { String[] relationships = new String[] {"direct", "extended", "in_law", "spouse", "parent", "sibling"}; int idx = faker.random().nextInt(relationships.length); String methodName = relationships[idx]; try { Method m = Relationships.class.getMethod(methodName); Relationships relInstance = new Relationships(faker); return (String)m.invoke(relInstance); } catch (NoSuchMethodException e) { e.printStackTrace(); } catch (SecurityException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } return null; }

Target:
public String any() { Method currentMethod = Relationships.class.getClass().getEnclosingMethod(); try { Method[] methods = Relationships.class.getDeclaredMethods(); methods = ArrayUtils.removeElement(methods, currentMethod); int indx = faker.random().nextInt(methods.length); Method runMethod = methods[indx]; Relationships relationships = new Relationships(faker); return (String)runMethod.invoke(relationships); } catch (SecurityException e) { throw new RuntimeException("SecurityException: " + e.getMessage()); } catch (IllegalArgumentException e) { throw new RuntimeException("IllegalArgumentException: " + e.getMessage()); } catch (IllegalAccessException e) { throw new RuntimeException("IllegalAccessException: " + e.getMessage()); } catch (InvocationTargetException e) { throw new RuntimeException("InvocationTargetException: " + e.getMessage()); } }
Source:
public boolean isVerbose() { Logger log = Logger.getLogger("com.google.devtools.j2objc"); return log != null && log.getLevel() != null && log.getLevel().equals(Level.FINEST); }

Target:
public boolean isVerbose() { Logger log = Logger.getLogger("com.google.devtools.j2objc"); return log != null && Level.FINEST.equals(log.getLevel()); }
Source:
public String decodeMessage(KM200Device device, byte[] encoded) { String retString = null; byte[] decodedB64 = null; try { decodedB64 = Base64.getMimeDecoder().decode(encoded); } catch (IllegalArgumentException e) { logger.error("Message is not in valid Base64 scheme:" + e.getMessage()); e.printStackTrace(); } try { if ((decodedB64.length & 0xF) != 0) { retString = new String(decodedB64, device.getCharSet()); return retString; } final Cipher cipher = Cipher.getInstance("AES/ECB/NoPadding"); cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(device.getCryptKeyPriv(), "AES")); final byte[] decryptedData = cipher.doFinal(decodedB64); byte[] decryptedDataWOZP = removeZeroPadding(decryptedData); retString = new String(decryptedDataWOZP, device.getCharSet()); return retString; } catch (BadPaddingException | IllegalBlockSizeException | UnsupportedEncodingException | NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException e) { logger.error("Exception on encoding:" + e.getMessage()); return null; } catch (final GeneralSecurityException e) { throw new IllegalStateException("Algorithms or unlimited crypto files not available", e); } }

Target:
public String decodeMessage(KM200Device device, byte[] encoded) { String retString = null; byte[] decodedB64 = null; try { decodedB64 = Base64.getMimeDecoder().decode(encoded); } catch (IllegalArgumentException e) { logger.error("Message is not in valid Base64 scheme: {}", e); e.printStackTrace(); } try { if ((decodedB64.length & 0xF) != 0) { retString = new String(decodedB64, device.getCharSet()); return retString; } final Cipher cipher = Cipher.getInstance("AES/ECB/NoPadding"); cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(device.getCryptKeyPriv(), "AES")); final byte[] decryptedData = cipher.doFinal(decodedB64); byte[] decryptedDataWOZP = removeZeroPadding(decryptedData); retString = new String(decryptedDataWOZP, device.getCharSet()); return retString; } catch (BadPaddingException | IllegalBlockSizeException | UnsupportedEncodingException | NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException e) { logger.error("Exception on encoding: {}", e); return null; } catch (final GeneralSecurityException e) { throw new IllegalStateException("Algorithms or unlimited crypto files not available", e); } }
Source:
public static long localTime(ConnectorSession session) { return UTC_CHRONOLOGY.millisOfDay().get(session.getStartTime()); }

Target:
public static long localTime(ConnectorSession session) { if (session.isLegacyTimestamp()) { return UTC_CHRONOLOGY.millisOfDay().get(session.getStartTime()); } ISOChronology localChronology = getChronology(session.getTimeZoneKey()); return localChronology.millisOfDay().get(session.getStartTime()); }
Source:
private void recreateUserVmSeach(NetworkVO network) { if (network != null) { SearchBuilder<NicVO> nicSearch = _nicDao.createSearchBuilder(); nicSearch.and("networkId", nicSearch.entity().getNetworkId(), SearchCriteria.Op.EQ); nicSearch.and("removed", nicSearch.entity().getRemoved(), SearchCriteria.Op.NULL); if (!network.getGuestType().equals(Network.GuestType.L2)) { nicSearch.and().op("ip4Address", nicSearch.entity().getIPv4Address(), SearchCriteria.Op.NNULL); nicSearch.or("ip6Address", nicSearch.entity().getIPv6Address(), SearchCriteria.Op.NNULL); nicSearch.cp(); } UserVmSearch = createSearchBuilder(); UserVmSearch.and("states", UserVmSearch.entity().getState(), SearchCriteria.Op.IN); UserVmSearch.join("nicSearch", nicSearch, UserVmSearch.entity().getId(), nicSearch.entity().getInstanceId(), JoinBuilder.JoinType.INNER); UserVmSearch.done(); } }

Target:
private void recreateUserVmSeach(NetworkVO network) { if (network != null) { SearchBuilder<NicVO> nicSearch = _nicDao.createSearchBuilder(); nicSearch.and("networkId", nicSearch.entity().getNetworkId(), SearchCriteria.Op.EQ); nicSearch.and("removed", nicSearch.entity().getRemoved(), SearchCriteria.Op.NULL); if (!Network.GuestType.L2.equals(network.getGuestType())) { nicSearch.and().op("ip4Address", nicSearch.entity().getIPv4Address(), SearchCriteria.Op.NNULL); nicSearch.or("ip6Address", nicSearch.entity().getIPv6Address(), SearchCriteria.Op.NNULL); nicSearch.cp(); } UserVmSearch = createSearchBuilder(); UserVmSearch.and("states", UserVmSearch.entity().getState(), SearchCriteria.Op.IN); UserVmSearch.join("nicSearch", nicSearch, UserVmSearch.entity().getId(), nicSearch.entity().getInstanceId(), JoinBuilder.JoinType.INNER); UserVmSearch.done(); } }
Source:
public void edit(final IscsiStorageModel object) { driver.edit(object); initLists(object); object.getPropertyChangedEvent().addListener((ev, sender, args) -> { String propName = args.propertyName; if (propName.equals("IsValid")) { onIsValidPropertyChange(object); } else if (propName.equals("IsGroupedByTarget")) { updateListByGrouping(object); } }); iscsiTargetToLunView.edit(object); iscsiLunToTargetView.edit(object); targetsToLunTab.addClickHandler(event -> { iscsiLunToTargetView.disableItemsUpdate(); object.setIsGroupedByTarget(true); }); lunToTargetsTab.addClickHandler(event -> { iscsiTargetToLunView.disableItemsUpdate(); object.setIsGroupedByTarget(false); }); dialogTabPanel.switchTab(object.getIsGroupedByTarget() ? targetsToLunTab : lunToTargetsTab); updateListByGrouping(object); if (!object.getContainer().isNewStorage()) { switch (object.getContainer().getStorage().getStatus()) { case Maintenance: mainLabel.setText(constants.storageIscsiRemoveLUNsLabel()); subLabel.setText(constants.storageIscsiAvailableActionsOnMaintenanceLabel()); break; case Active: mainLabel.setText(constants.storageIscsiActionsLabel()); subLabel.setText(constants.storageIscsiAvailableActionsForActiveDomainsLabel()); break; } } if (object.getContainer().isNewStorage()) { dialogTabPanel.setBarStyle(multiSelection ? style.barShort() : style.barNewDisk()); } else { dialogTabPanel.setBarStyle(style.barLong()); } }

Target:
public void edit(final IscsiStorageModel object) { driver.edit(object); initLists(object); object.getPropertyChangedEvent().addListener((ev, sender, args) -> { String propName = args.propertyName; if (propName.equals("IsValid")) { onIsValidPropertyChange(object); } else if (propName.equals("IsGroupedByTarget")) { updateListByGrouping(object); } }); iscsiTargetToLunView.edit(object); iscsiLunToTargetView.edit(object); targetsToLunTab.addClickHandler(event -> { iscsiLunToTargetView.disableItemsUpdate(); object.setIsGroupedByTarget(true); }); lunToTargetsTab.addClickHandler(event -> { iscsiTargetToLunView.disableItemsUpdate(); object.setIsGroupedByTarget(false); }); dialogTabPanel.switchTab(object.getIsGroupedByTarget() ? targetsToLunTab : lunToTargetsTab); updateListByGrouping(object); if (!object.getContainer().isNewStorage()) { switch (object.getContainer().getStorage().getStatus()) { case Maintenance: mainLabel.setText(constants.storageIscsiRemoveLUNsLabel()); subLabel.setText(constants.storageIscsiAvailableActionsOnMaintenanceLabel()); break; case Active: mainLabel.setText(constants.storageIscsiActionsLabel()); subLabel.setText(constants.storageIscsiAvailableActionsForActiveDomainsLabel()); break; } } if (object.getContainer().isNewStorage()) { dialogTabPanel.setBarStyle(multiSelection ? style.barNewDomain() : style.barNewDisk()); } else { dialogTabPanel.setBarStyle(style.barEditDomain()); } }
Source:
public void checkAttributeValue(PerunSessionImpl perunSession, Facility facility, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongReferenceAttributeValueException, WrongAttributeAssignmentException { if(attribute.getValue() == null) return; String attrValue = (String) attribute.getValue(); Pattern pattern = Pattern.compile("^[01234567]?[01234567]{3}$"); Matcher match = pattern.matcher(attrValue); if(!match.matches()) throw new WrongAttributeValueException(attribute, facility, "Bad format of attribute, (expected something like '750' or '0700')."); }

Target:
public void checkAttributeValue(PerunSessionImpl perunSession, Facility facility, Attribute attribute) throws InternalErrorException, WrongAttributeValueException, WrongReferenceAttributeValueException, WrongAttributeAssignmentException { if(attribute.getValue() == null) return; String attrValue = (String) attribute.getValue(); Matcher match = pattern.matcher(attrValue); if(!match.matches()) throw new WrongAttributeValueException(attribute, facility, "Bad format of attribute, (expected something like '750' or '0700')."); }
Source:
public void testFindActivator() throws Exception { Builder bmaker = new Builder(); try { bmaker.setProperty("Bundle-Activator", "test.activator.Activator"); bmaker.setProperty("build", "xyz"); bmaker.setProperty("Private-Package", "test.*"); bmaker.setProperty("-bundleannotations", "!test.annotationheaders.attrs.std.activator.TypeInVersionedPackage"); bmaker.setProperty("-dsannotations", "!*"); bmaker.setProperty("-metatypeannotations", "!*"); bmaker.setClasspath(new File[] { new File("bin_test") }); bmaker.setProperty("-fixupmessages.export", "The annotation aQute.bnd.annotation.Export applied to package test.versionpolicy.api is deprecated and will be removed in a future release. The org.osgi.annotation.bundle.Export should be used instead"); bmaker.setProperty("-fixupmessages.directive", "Unknown directive foobar: in Export-Package, allowed directives are uses:,mandatory:,include:,exclude:,-import:, and 'x-*'"); Jar jar = bmaker.build(); assertTrue(bmaker.check()); report("testFindActivator", bmaker, jar); assertEquals(0, bmaker.getErrors() .size()); assertEquals(0, bmaker.getWarnings() .size()); } finally { bmaker.close(); } }

Target:
public void testFindActivator() throws Exception { Builder bmaker = new Builder(); try { bmaker.setProperty("Bundle-Activator", "test.activator.Activator"); bmaker.setProperty("build", "xyz"); bmaker.setProperty("Private-Package", "test.*"); bmaker.setProperty("-bundleannotations", "!test.annotationheaders.attrs.std.activator.TypeInVersionedPackage,*"); bmaker.setProperty("-dsannotations", "!*"); bmaker.setProperty("-metatypeannotations", "!*"); bmaker.setClasspath(new File[] { new File("bin_test") }); bmaker.setProperty("-fixupmessages.export", "The annotation aQute.bnd.annotation.Export applied to package test.versionpolicy.api is deprecated and will be removed in a future release. The org.osgi.annotation.bundle.Export should be used instead"); bmaker.setProperty("-fixupmessages.directive", "Unknown directive foobar: in Export-Package, allowed directives are uses:,mandatory:,include:,exclude:,-import:, and 'x-*'"); Jar jar = bmaker.build(); assertTrue(bmaker.check()); report("testFindActivator", bmaker, jar); assertEquals(0, bmaker.getErrors() .size()); assertEquals(0, bmaker.getWarnings() .size()); } finally { bmaker.close(); } }
Source:
public List<DispoItem> call() throws Exception { List<DispoItem> fromThread = new LinkedList<DispoItem>(); for (File file : sublist) { InputStream inputStream = null; try { inputStream = new FileInputStream(file); String sanitizedFileName = file.getName().replaceAll("\\..*", ""); DispoItemData itemToBuild = new DispoItemData(); if (sanitizedFileName.contains("sample")) { System.out.println(""); } if (exisitingItems.containsKey(sanitizedFileName)) { if (sanitizedFileName.contains("sample")) { System.out.println(""); } DispoItem oldItem = exisitingItems.get(sanitizedFileName); Date lastUpdate = oldItem.getLastUpdate(); boolean wasSameFile = DiscrepancyParser.buildItemFromFile(itemToBuild, sanitizedFileName, inputStream, false, lastUpdate); if (!wasSameFile) { itemToBuild.setGuid(oldItem.getGuid()); itemToBuild.setAnnotationsList(new JSONArray()); if (itemToBuild.getDiscrepanciesList().length() > 0) { DispoItemDataCopier.copyOldItemData(oldItem, itemToBuild); } dataFactory.setStatus(itemToBuild); fromThread.add(itemToBuild); } } else { DiscrepancyParser.buildItemFromFile(itemToBuild, sanitizedFileName, inputStream, true, new Date()); dataFactory.initDispoItem(itemToBuild); fromThread.add(itemToBuild); } } finally { Lib.close(inputStream); } } return fromThread; }

Target:
public List<DispoItem> call() throws Exception { List<DispoItem> fromThread = new LinkedList<DispoItem>(); for (File file : sublist) { InputStream inputStream = null; try { inputStream = new FileInputStream(file); String sanitizedFileName = file.getName().replaceAll("\\..*", ""); DispoItemData itemToBuild = new DispoItemData(); if (exisitingItems.containsKey(sanitizedFileName)) { DispoItem oldItem = exisitingItems.get(sanitizedFileName); Date lastUpdate = oldItem.getLastUpdate(); boolean wasSameFile = DiscrepancyParser.buildItemFromFile(itemToBuild, sanitizedFileName, inputStream, false, lastUpdate); if (!wasSameFile) { itemToBuild.setGuid(oldItem.getGuid()); itemToBuild.setAnnotationsList(new JSONArray()); if (itemToBuild.getDiscrepanciesList().length() > 0) { DispoItemDataCopier.copyOldItemData(oldItem, itemToBuild); } dataFactory.setStatus(itemToBuild); fromThread.add(itemToBuild); } } else { DiscrepancyParser.buildItemFromFile(itemToBuild, sanitizedFileName, inputStream, true, new Date()); dataFactory.initDispoItem(itemToBuild); fromThread.add(itemToBuild); } } finally { Lib.close(inputStream); } } return fromThread; }
Source:
int get(final int numAlleles, final int ploidy) { if(numAlleles <= 0 || ploidy <= 0){ throw new IllegalArgumentException("numAlleles and ploidy must both exceed 0"); } if(numAlleles < staticCache.length && ploidy < staticCache[numAlleles].length){ return staticCache[numAlleles][ploidy]; } else{ final Integer cachedValue = dynamicCache.get(new CacheKey(numAlleles, ploidy)); if(cachedValue == null){ final int newValue = GenotypeLikelihoods.calcNumLikelihoods(numAlleles, ploidy); put(numAlleles, ploidy, newValue); return newValue; } else{ return cachedValue; } } }

Target:
synchronized int get(final int numAlleles, final int ploidy) { if(numAlleles <= 0 || ploidy <= 0){ throw new IllegalArgumentException("numAlleles and ploidy must both exceed 0, but they are numAlleles: " + numAlleles + ", ploidy: " + ploidy); } if(numAlleles < staticCache.length && ploidy < staticCache[numAlleles].length){ return staticCache[numAlleles-1][ploidy-1]; } else{ final Integer cachedValue = dynamicCache.get(new CacheKey(numAlleles, ploidy)); if(cachedValue == null){ final int newValue = GenotypeLikelihoods.calcNumLikelihoods(numAlleles, ploidy); put(numAlleles, ploidy, newValue); return newValue; } else{ return cachedValue; } } }
Source:
public static void validateOptions(Options options) { try { GcsPath valid = GcsPath.fromUri(options.getTempPath()); Preconditions.checkArgument(!Strings.isNullOrEmpty(valid.getBucket()), "Bucket must be specified"); } catch (Exception x) { Preconditions.checkState(false, "temp path must be a valid Google Cloud Storage URL (starting with gs://)"); } }

Target:
public static void validateOptions(Options options) { try { GcsPath valid = GcsPath.fromUri(options.getTempPath()); Preconditions.checkArgument(!Strings.isNullOrEmpty(valid.getBucket()), "Bucket must be specified"); } catch (IllegalArgumentException x) { Preconditions.checkState(false, "the specified temp path is invalid: " + x.getMessage()); } }
Source:
public boolean onOptionsItemSelected(final MenuItem item) { switch (item.getItemId()) { case android.R.id.home: finish(); return true; case R.id.send_coins_options_help: HelpDialogFragment.page(getFragmentManager(), R.string.help_pop); return true; } return super.onOptionsItemSelected(item); }

Target:
public boolean onOptionsItemSelected(final MenuItem item) { switch (item.getItemId()) { case android.R.id.home: finish(); return true; case R.id.pop_options_help: HelpDialogFragment.page(getFragmentManager(), R.string.help_pop); return true; } return super.onOptionsItemSelected(item); }
Source:
CachedFileInfo loadFileInfo(long ledgerId, byte[] masterKey) throws IOException { lock.readLock().lock(); try { CachedFileInfo fi = fileInfos.get(ledgerId); if (fi != null) { fi.retain(); return fi; } } finally { lock.readLock().unlock(); } lock.writeLock().lock(); try { File backingFile = fileLoader.load(ledgerId, masterKey != null); CachedFileInfo fi = new CachedFileInfo(ledgerId, backingFile, masterKey); fileInfos.put(ledgerId, fi); fi.retain(); return fi; } finally { lock.writeLock().unlock(); } }

Target:
CachedFileInfo loadFileInfo(long ledgerId, byte[] masterKey) throws IOException { lock.readLock().lock(); try { CachedFileInfo fi = fileInfos.get(ledgerId); if (fi != null) { assert(fi.tryRetain()); return fi; } } finally { lock.readLock().unlock(); } lock.writeLock().lock(); try { File backingFile = fileLoader.load(ledgerId, masterKey != null); CachedFileInfo fi = new CachedFileInfo(ledgerId, backingFile, masterKey); fileInfos.put(ledgerId, fi); assert(fi.tryRetain()); return fi; } finally { lock.writeLock().unlock(); } }
Source:
public void noEvents() { Single.just("1") .delay(1, TimeUnit.MILLISECONDS, testScheduler) .compose(new UntilCorrespondingEventSingleTransformer<String, String>(lifecycle, CORRESPONDING_EVENTS)) .subscribe(testSubscriber); testScheduler.advanceTimeBy(1, TimeUnit.MILLISECONDS); testSubscriber.assertValue("1"); testSubscriber.assertCompleted(); }

Target:
public void noEvents() { Single.just("1") .delay(1, TimeUnit.MILLISECONDS, testScheduler) .compose(new UntilCorrespondingEventSingleTransformer<String, String>(lifecycle, CORRESPONDING_EVENTS)) .subscribe(testSubscriber); testSubscriber.assertNoValues(); testScheduler.advanceTimeBy(1, TimeUnit.MILLISECONDS); testSubscriber.assertValue("1"); testSubscriber.assertCompleted(); }
Source:
public synchronized void put(final Protos.TaskID key, final Protos.TaskState value) { LOGGER.debug("put(key : {}, value : {})", key.getValue(), value); taskStates.put(key, value); }

Target:
public void put(final Protos.TaskID key, final Protos.TaskState value) { LOGGER.debug("put(key : {}, value : {})", key.getValue(), value); taskStates.put(key, value); }
Source:
public void logChange(final String storeName, final Bytes key, final byte[] value, final long timestamp) { throwUnsupportedOperationExceptionIfStandby("logChange"); collector.send( storeToChangelogTopic.get(storeName), key, value, null, taskId().partition, timestamp, KEY_SERIALIZER, VALUE_SERIALIZER); }

Target:
public void logChange(final String storeName, final Bytes key, final byte[] value, final long timestamp) { throwUnsupportedOperationExceptionIfStandby("logChange"); collector.send( storeToChangelogTopic.get(storeName), key, value, null, taskId().partition, timestamp, BYTES_KEY_SERIALIZER, BYTEARRAY_VALUE_SERIALIZER); }
Source:
protected TimedBufferObserver createTimedBufferObserver() { return new LocalBufferObserver() { @Override public void flushBuffer(ByteBuf byteBuf, boolean requestedSync, List<IOCallback> callbacks) { final int bytes = byteBuf.readableBytes(); if (bytes == 0) { DelegateCallback.done(callbacks); } else { if (byteBuf.nioBufferCount() == 1 && byteBuf.isDirect()) { final ByteBuffer buffer = byteBuf.internalNioBuffer(byteBuf.readerIndex(), bytes); final IOCallback callback = new DelegateCallback(callbacks); try { internalWrite(buffer, requestedSync, callback, false); } catch (Exception e) { callback.onError(ActiveMQExceptionType.GENERIC_EXCEPTION.getCode(), e.getMessage()); } } else { super.flushBuffer(byteBuf, requestedSync, callbacks); } } } }; }

Target:
protected TimedBufferObserver createTimedBufferObserver() { return new SyncLocalBufferObserver(); }
Source:
public CLIWrapper(boolean connect, String cliAddress, InputStream consoleInput) throws CliInitializationException { this(connect, cliAddress, consoleInput, CONNECTION_TIMEOUT); }

Target:
public CLIWrapper(boolean connect, String cliAddress, InputStream consoleInput) throws CliInitializationException { this(connect, cliAddress, consoleInput, -1); }
Source:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append("Swaps used: "); sb.append(FormatUtil.formatBytes(getSwapUsed())); sb.append("/"); sb.append(FormatUtil.formatBytes(getSwapTotal())); return sb.toString(); }

Target:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append("Used: "); sb.append(FormatUtil.formatBytes(getSwapUsed())); sb.append("/"); sb.append(FormatUtil.formatBytes(getSwapTotal())); return sb.toString(); }
Source:
String generateCalendar(String title, List<Absence> absences) { final Calendar calendar = new Calendar(); calendar.getProperties().add(VERSION_2_0); calendar.getProperties().add(new ProdId("- calendar.getProperties().add(GREGORIAN); calendar.getProperties().add(new XProperty("X-WR-CALNAME", title)); calendar.getProperties().add(new XProperty("X-MICROSOFT-CALSCALE", GREGORIAN.getValue())); RefreshInterval refreshInterval = new RefreshInterval(); refreshInterval.setValue(Duration.ofHours(1).toString()); calendar.getProperties().add(refreshInterval); final List<VEvent> absencesVEvents = absences.stream().map(this::toVEvent).collect(toList()); calendar.getComponents().addAll(absencesVEvents); final StringWriter calenderWriter = new StringWriter(); final CalendarOutputter calendarOutputter = new CalendarOutputter(); try { calendarOutputter.output(calendar, calenderWriter); } catch (ValidationException | IOException e) { throw new CalendarException("iCal calender could not be generated", e); } return calenderWriter.toString(); }

Target:
String generateCalendar(String title, List<Absence> absences) { final Calendar calendar = new Calendar(); calendar.getProperties().add(VERSION_2_0); calendar.getProperties().add(new ProdId("- calendar.getProperties().add(GREGORIAN); calendar.getProperties().add(new XProperty("X-WR-CALNAME", title)); calendar.getProperties().add(new XProperty("X-MICROSOFT-CALSCALE", GREGORIAN.getValue())); calendar.getProperties().add(new RefreshInterval(new ParameterList(), calendarProperties.getRefreshInterval())); final List<VEvent> absencesVEvents = absences.stream().map(this::toVEvent).collect(toList()); calendar.getComponents().addAll(absencesVEvents); final StringWriter calenderWriter = new StringWriter(); final CalendarOutputter calendarOutputter = new CalendarOutputter(); try { calendarOutputter.output(calendar, calenderWriter); } catch (ValidationException | IOException e) { throw new CalendarException("iCal calender could not be generated", e); } return calenderWriter.toString(); }
Source:
public void testSASTokenProviderInitializeException() throws Exception { final AzureBlobFileSystem fs = this.getFileSystem(); final AzureBlobFileSystem testFs = new AzureBlobFileSystem(); MockSASTokenProvider.setThrowExceptionAtInit(true); intercept(TokenAccessProviderException.class, ()-> { testFs.initialize(fs.getUri(), this.getConfiguration().getRawConfiguration()); }); MockSASTokenProvider.setThrowExceptionAtInit(false); }

Target:
public void testSASTokenProviderInitializeException() throws Exception { final AzureBlobFileSystem fs = this.getFileSystem(); final AzureBlobFileSystem testFs = new AzureBlobFileSystem(); Configuration testConfig = this.getConfiguration().getRawConfiguration(); testConfig.set(ConfigurationKeys.FS_AZURE_SAS_TOKEN_PROVIDER_TYPE, TEST_ERR_AUTHZ_CLASS); testConfig.set(MOCK_SASTOKENPROVIDER_FAIL_INIT, "true"); intercept(TokenAccessProviderException.class, ()-> { testFs.initialize(fs.getUri(), this.getConfiguration().getRawConfiguration()); }); }
Source:
public Response processReview(@Context HttpServletRequest request, @PathParam("deliveryId") Long deliveryId, @FormParam("grade") String grade, @FormParam("commentary") String commentary, @FormParam("state") Delivery.State state) throws UnauthorizedException, ApiError { if(!(currentUser.isAdmin() || currentUser.isAssisting(group.getCourse()))) { throw new UnauthorizedException(); } Double gradeValue = grade.isEmpty() ? null : Double.valueOf(grade); Delivery delivery = deliveries.find(group, deliveryId); Delivery.Review review = new Delivery.Review(); review.setState(state); review.setGrade(gradeValue); review.setCommentary(commentary); try { deliveriesBackend.review(delivery, review); } catch (Exception e){ throw new ApiError("error.could-not-review", e); } return redirect(request.getRequestURI()); }

Target:
public Response processReview(@Context HttpServletRequest request, @PathParam("deliveryId") Long deliveryId, @FormParam("grade") String grade, @FormParam("commentary") String commentary, @FormParam("state") Delivery.State state) throws UnauthorizedException, ApiError { if(!(currentUser.isAdmin() || currentUser.isAssisting(group.getCourse()))) { throw new UnauthorizedException(); } Double gradeValue = grade.isEmpty() ? null : Double.valueOf(grade); Delivery delivery = deliveries.find(group, deliveryId); Delivery.Review review = new Delivery.Review(); review.setState(state); review.setGrade(gradeValue); review.setCommentary(commentary); try { deliveriesBackend.review(delivery, review); reviewMailer.sendReviewMail(delivery); } catch (Exception e){ throw new ApiError("error.could-not-review", e); } return redirect(request.getRequestURI()); }
Source:
@Override public boolean startListener(int port, String name, InboundProcessorParams inboundParameters) { try { messageConsumer.consumeMessage(); } catch (IOException | InterruptedException e) { log.error("An error occurred while connecting to NATS server or consuming messages. " + e); messageConsumer.closeConnection(); return true; } catch (SynapseException e) { log.error("Error while retrieving or injecting NATS message. " + e.getMessage(), e); return true; } catch (Exception e) { log.error("Error while retrieving or injecting NATS message. " + e.getMessage(), e); messageConsumer.closeConnection(); return true; } return true; }

Target:
@Override public boolean startListener(int port, String name, InboundProcessorParams inboundParameters) { try { messageConsumer.initializeConsumer(); } catch (IOException | InterruptedException e) { messageConsumer.closeConnection(); throw new SynapseException("An error occurred while connecting to NATS server or consuming messages. ", e); } catch (Exception e) { messageConsumer.closeConnection(); throw new SynapseException("Error while retrieving or injecting NATS message. ", e); } return true; }
Source:
public int hashCode() { int result; final long temp; temp = Double.doubleToLongBits(output); result = (int) (temp ^ (temp >>> 32)); result = 31 * result + feature.hashCode(); return result; }

Target:
public int hashCode() { int result; final long temp = Double.doubleToLongBits(output); result = (int) (temp ^ (temp >>> 32)); result = 31 * result + feature.hashCode(); return result; }
Source:
public <T> boolean isBean(Class<T> clazz) { m_lock.readLock().lock(); try { if (m_beanHierarchies.containsKey(clazz)) { return !m_beanHierarchies.get(clazz).getBeans().isEmpty(); } return false; } finally { m_lock.readLock().unlock(); } }

Target:
public <T> boolean isBean(Class<T> clazz) { m_lock.readLock().lock(); try { BeanHierarchy h = m_beanHierarchies.get(clazz); return h != null && !h.getBeans().isEmpty(); } finally { m_lock.readLock().unlock(); } }