auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private FeedbackResponseCommentRow buildFeedbackResponseCommentAddForm(FeedbackQuestionAttributes question, FeedbackResponseAttributes response, Map<FeedbackParticipantType, Boolean> responseVisibilityMap, String giverName, String recipientName) { FeedbackResponseCommentAttributes frca = new FeedbackResponseCommentAttributes(question.courseId, question.feedbackSessionName, question.getFeedbackQuestionId(), response.getId()); FeedbackParticipantType[] relevantTypes = { FeedbackParticipantType.GIVER, FeedbackParticipantType.RECEIVER, FeedbackParticipantType.OWN_TEAM_MEMBERS, FeedbackParticipantType.RECEIVER_TEAM_MEMBERS, FeedbackParticipantType.STUDENTS, FeedbackParticipantType.INSTRUCTORS }; frca.showCommentTo = new ArrayList<>(); frca.showGiverNameTo = new ArrayList<>(); for (FeedbackParticipantType type : relevantTypes) { if (isResponseCommentVisibleTo(question, type)) { frca.showCommentTo.add(type); } if (isResponseCommentGiverNameVisibleTo(question, type)) { frca.showGiverNameTo.add(type); } } return new FeedbackResponseCommentRow(frca, giverName, recipientName, getResponseCommentVisibilityString(question), getResponseCommentGiverNameVisibilityString(question), responseVisibilityMap, bundle.feedbackSession.getTimeZone()); }

Target:
private FeedbackResponseCommentRow buildFeedbackResponseCommentAddForm(FeedbackQuestionAttributes question, FeedbackResponseAttributes response, Map<FeedbackParticipantType, Boolean> responseVisibilityMap, String giverName, String recipientName) { FeedbackResponseCommentAttributes frca = new FeedbackResponseCommentAttributes(question.courseId, question.feedbackSessionName, question.getFeedbackQuestionId(), response.getId()); FeedbackParticipantType[] relevantTypes = { FeedbackParticipantType.GIVER, FeedbackParticipantType.RECEIVER, FeedbackParticipantType.OWN_TEAM_MEMBERS, FeedbackParticipantType.RECEIVER_TEAM_MEMBERS, FeedbackParticipantType.STUDENTS, FeedbackParticipantType.INSTRUCTORS }; frca.showCommentTo = new ArrayList<>(); frca.showGiverNameTo = new ArrayList<>(); for (FeedbackParticipantType type : relevantTypes) { if (isResponseCommentVisibleTo(question, type)) { frca.showCommentTo.add(type); } if (isResponseCommentGiverNameVisibleTo(question, type)) { frca.showGiverNameTo.add(type); } } return new FeedbackResponseCommentRow(frca, giverName, recipientName, getResponseCommentVisibilityString(question), getResponseCommentGiverNameVisibilityString(question), responseVisibilityMap, bundle.getTimeZone()); }
Source:
public void removeDeploymentGroup(final String name) throws DeploymentGroupDoesNotExistException { log.info("removing deployment-group: name={}", name); final ZooKeeperClient client = provider.get("removeDeploymentGroup"); try { client.ensurePath(Paths.configDeploymentGroups()); if (client.exists(Paths.statusDeploymentGroupHosts(name)) != null) { client.delete(Paths.statusDeploymentGroupHosts(name)); } if (client.exists(Paths.statusDeploymentGroup(name)) != null) { client.delete(Paths.statusDeploymentGroup(name)); } client.delete(Paths.configDeploymentGroup(name)); } catch (final NoNodeException e) { throw new DeploymentGroupDoesNotExistException(name); } catch (final KeeperException e) { throw new HeliosRuntimeException("removing deployment-group " + name + " failed", e); } }

Target:
public void removeDeploymentGroup(final String name) throws DeploymentGroupDoesNotExistException { log.info("removing deployment-group: name={}", name); final ZooKeeperClient client = provider.get("removeDeploymentGroup"); try { client.ensurePath(Paths.configDeploymentGroups()); client.ensurePath(Paths.statusDeploymentGroups()); client.transaction( delete(Paths.configDeploymentGroup(name)), delete(Paths.statusDeploymentGroupHosts(name)), delete(Paths.statusDeploymentGroup(name)) ); } catch (final NoNodeException e) { throw new DeploymentGroupDoesNotExistException(name); } catch (final KeeperException e) { throw new HeliosRuntimeException("removing deployment-group " + name + " failed", e); } }
Source:
public void onEvict( long filePageId, Page page ) { MuninnPage removed = file.evictPage( filePageId ); assert removed == page : "Removed unexpected page when cleaning up translation table for filePageId " + filePageId + ". " + "Evicted " + page + " but removed " + removed + " from the translation table."; file.setHighestEvictedTransactionId( removed.resetLastModifiedTxId() ); }

Target:
public void onEvict( long filePageId, Page page ) { MuninnPage removed = file.evictPage( filePageId ); assert removed == page : "Removed unexpected page when cleaning up translation table for filePageId " + filePageId + ". " + "Evicted " + page + " but removed " + removed + " from the translation table."; }
Source:
protected void executeVDSCommand() { if (_vdsManager != null) { try { _vdsManager.getLockObj().lock(); executeVdsIdCommand(); } finally { _vdsManager.getLockObj().unlock(); } } else { executeVdsIdCommand(); } }

Target:
protected void executeVDSCommand() { if (_vdsManager != null) { synchronized (_vdsManager.getLockObj()) { executeVdsIdCommand(); } } else { executeVdsIdCommand(); } }
Source:
protected WebSocketClientHandshaker(URI uri, WebSocketVersion version, String subprotocol, HttpHeaders customHeaders, int maxFramePayloadLength) { this(uri, version, subprotocol, customHeaders, maxFramePayloadLength,-1); }

Target:
protected WebSocketClientHandshaker(URI uri, WebSocketVersion version, String subprotocol, HttpHeaders customHeaders, int maxFramePayloadLength) { this(uri, version, subprotocol, customHeaders, maxFramePayloadLength, DEFAULT_FORCE_CLOSE_TIMEOUT_MILLIS); }
Source:
public void requestPasswordReset_shouldCreateUserActivationKeyGivenUsername() throws Exception { User u = new User(); u.setPerson(new Person()); u.addName(new PersonName("Benjamin", "A", "Wolfe")); u.setUsername("bwolfe"); u.getPerson().setGender("M"); User createdUser = userService.createUser(u, "Openmr5xy"); assertNull(dao.getLoginCredential(createdUser).getActivationKey()); assertEquals(createdUser, userService.setUserActivationKey(createdUser)); handle(newPostRequest(RESET_PASSWORD_URI, "{\"usernameOrEmail\":\"" + "bwolfe" + "\"}")); assertNotNull(dao.getLoginCredential(createdUser).getActivationKey()); }

Target:
public void requestPasswordReset_shouldCreateUserActivationKeyGivenUsername() throws Exception { User user = userService.getUserByUuid("c98a1558-e131-11de-babe-001e378eb67e"); assertNull(dao.getLoginCredential(user).getActivationKey()); handle(newPostRequest(RESET_PASSWORD_URI, "{\"usernameOrEmail\":\"" + user.getUsername() + "\"}")); assertNotNull(dao.getLoginCredential(user).getActivationKey()); }
Source:
protected IWorkbenchPage getPartPage(ExecutionEvent event) { IWorkbenchPart part = (IWorkbenchPart) ((IEvaluationContext) event .getApplicationContext()).getRoot().getVariable("activePart"); return part.getSite().getPage(); }

Target:
protected IWorkbenchPage getPartPage(ExecutionEvent event) throws ExecutionException { return HandlerUtil.getActivePartChecked(event).getSite().getPage(); }
Source:
void flush() throws IOException { out.flush(); }

Target:
void flush() throws IOException { super.flush(); out.flush(); }
Source:
public LocalRecipeDaoImpl(LocalStorageFactory storageFactory) throws IOException { Map<Class<?>, Object> adapters = new HashMap<>(); adapters.put(Permissions.class, new PermissionsDeserializer()); adapters.put(Group.class, new GroupDeserializer()); this.recipeStorage = storageFactory.create("recipes.json", adapters); this.recipes = new HashMap<>(); lock = new ReentrantReadWriteLock(); }

Target:
public LocalRecipeDaoImpl(LocalStorageFactory storageFactory) throws IOException { Map<Class<?>, Object> adapters = ImmutableMap.of(Permissions.class, new PermissionsSerializer(), Group.class, new GroupSerializer()); this.recipeStorage = storageFactory.create("recipes.json", adapters); this.recipes = new HashMap<>(); lock = new ReentrantReadWriteLock(); }
Source:
private static URI stripDefaultPort(URI uri) { if ((uri.getPort() == 80 && "http".equalsIgnoreCase(uri.getScheme())) || (uri.getPort() == 443 && "https".equalsIgnoreCase(uri.getScheme()))) { try { uri = new URI(uri.getScheme(), uri.getUserInfo(), uri.getHost(), -1, uri.getPath(), uri.getQuery(), uri.getFragment()); } catch (URISyntaxException e) { throw new WebApplicationException(e); } } return uri; }

Target:
private static URI stripDefaultPort(URI uri) { if ((uri.getPort() == HTTP_PORT && HTTP_SCHEME.equalsIgnoreCase(uri.getScheme())) || (uri.getPort() == HTTPS_PORT && HTTPS_SCHEME.equalsIgnoreCase(uri.getScheme()))) { try { uri = new URI(uri.getScheme(), uri.getUserInfo(), uri.getHost(), -1, uri.getPath(), uri.getQuery(), uri.getFragment()); } catch (URISyntaxException e) { throw new WebApplicationException(e); } } return uri; }
Source:
public CompletableFuture<Long> readLastAddConfirmedAsync() { return CompletableFuture.completedFuture((long) (entries.size() - 1)); }

Target:
public CompletableFuture<Long> readLastAddConfirmedAsync() { return CompletableFuture.completedFuture(getLastAddConfirmed()); }
Source:
public T transformParallel(T root, TraverserVisitor<T> traverserVisitor, Map<Class<?>, Object> rootVars) { assertNotNull(root); TraverserVisitor<T> nodeTraverserVisitor = new TraverserVisitor<T>() { @Override public TraversalControl enter(TraverserContext<T> context) { NodeZipper<T> nodeZipper = new NodeZipper<>(context.thisNode(), context.getBreadcrumbs(), nodeAdapter); context.setVar(NodeZipper.class, nodeZipper); context.setVar(NodeAdapter.class, nodeAdapter); return traverserVisitor.enter(context); } @Override public TraversalControl leave(TraverserContext<T> context) { return Assert.assertShouldNeverHappen("not supposed to be called for parallel traversing"); } }; Queue<NodeZipper<T>> zippers = new ConcurrentLinkedQueue<>(); ParallelTraverser<T> traverser = ParallelTraverser.parallelTraverserWithNamedChildren(nodeAdapter::getNamedChildren, zippers); traverser.rootVars(rootVars); traverser.traverse(root, nodeTraverserVisitor); NodeMultiZipper<T> multiZipper = NodeMultiZipper.newNodeMultiZipperTrusted(root, new ArrayList<>(zippers), nodeAdapter); return multiZipper.toRootNode(); }

Target:
public T transformParallel(T root, TraverserVisitor<T> traverserVisitor, Map<Class<?>, Object> rootVars) { return transformParallel(root, traverserVisitor, rootVars, ForkJoinPool.commonPool()); }
Source:
public void startContainer(String containerId) throws DockerAccessException { try { String url = urlBuilder.startContainer(containerId); log.verbose(Logger.LogVerboseCategory.API,"POSTing %s", url); delegate.post(url, HTTP_NO_CONTENT, HTTP_OK); } catch (IOException e) { throw new DockerAccessException(e, "Unable to start container id [%s]", containerId); } }

Target:
public void startContainer(String containerId) throws DockerAccessException { try { String url = urlBuilder.startContainer(containerId); log.verbose(Logger.LogVerboseCategory.API,"POST %s", url); delegate.post(url, HTTP_NO_CONTENT, HTTP_OK); } catch (IOException e) { throw new DockerAccessException(e, "Unable to start container id [%s]", containerId); } }
Source:
public boolean uploadBlob(BlobId blobId, long blobSize, InputStream blobInputStream) throws Exception { Objects.requireNonNull(blobId, "BlobId cannot be null"); Objects.requireNonNull(blobInputStream, "Input stream cannot be null"); BlobRequestOptions options = null; OperationContext opContext = null; try { CloudBlobContainer azureContainer = getContainer(blobId, true); CloudBlockBlob azureBlob = azureContainer.getBlockBlobReference(blobId.getID()); if (azureBlob.exists()) { LOGGER.debug("Skipping upload of blob as it already exists in Azure container {}.", blobId, azureContainer.getName()); return false; } azureBlob.upload(blobInputStream, blobSize, null, options, opContext); LOGGER.debug("Uploaded blob to Azure container {}.", blobId, azureContainer.getName()); return true; } catch (Exception e) { LOGGER.error("Failed to upload blob: " + blobId); throw e; } }

Target:
public boolean uploadBlob(BlobId blobId, long blobSize, InputStream blobInputStream) throws CloudStorageException { Objects.requireNonNull(blobId, "BlobId cannot be null"); Objects.requireNonNull(blobInputStream, "Input stream cannot be null"); BlobRequestOptions options = null; OperationContext opContext = null; try { CloudBlobContainer azureContainer = getContainer(blobId, true); CloudBlockBlob azureBlob = azureContainer.getBlockBlobReference(blobId.getID()); if (azureBlob.exists()) { LOGGER.debug("Skipping upload of blob as it already exists in Azure container {}.", blobId, azureContainer.getName()); return false; } azureBlob.upload(blobInputStream, blobSize, null, options, opContext); LOGGER.debug("Uploaded blob to Azure container {}.", blobId, azureContainer.getName()); return true; } catch (URISyntaxException | StorageException | IOException e) { throw new CloudStorageException("Failed to upload blob: " + blobId, e); } }
Source:
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { if (isErrorControllerRelated(request)) { if (log.isDebugEnabled()) { log.debug("Skipping creation of a span for error controller processing"); } return true; } String spanName = spanName(handler); Span span = getTracer().createSpan(SpanNameUtil.toLowerHyphen(spanName)); if (log.isDebugEnabled()) { log.debug("Created new span " + span + " with name [" + spanName + "]"); } addClassMethodTag(handler, span); addClassNameTag(handler, span); setSpanInAttribute(request, span); return true; }

Target:
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { if (isErrorControllerRelated(request)) { log.debug("Skipping creation of a span for error controller processing"); return true; } if (isSpanContinued(request)) { log.debug("Skipping creation of a span since the span is continued"); return true; } String spanName = spanName(handler); Span span = getTracer().createSpan(spanName); if (log.isDebugEnabled()) { log.debug("Created new span " + span + " with name [" + spanName + "]"); } addClassMethodTag(handler, span); addClassNameTag(handler, span); setSpanInAttribute(request, span); return true; }
Source:
public int updateWaitingRequest(long ts, Request request, Long initialSector) { Pair<Request, Integer> reqQuark = fWaitingQueue.get(initialSector); if (reqQuark == null) { return addWaitingRequest(ts, request); } else if (!initialSector.equals(request.getSector())) { fWaitingQueue.remove(initialSector); fWaitingQueue.put(request.getSector(), reqQuark); } int slotQuark = reqQuark.getSecond(); try { int currentRequestQuark = fSs.getQuarkRelativeAndAdd(slotQuark, Attributes.CURRENT_REQUEST); fSs.modifyAttribute(ts, request.getSector(), currentRequestQuark); int requestSizeQuark = fSs.getQuarkRelativeAndAdd(slotQuark, Attributes.REQUEST_SIZE); fSs.modifyAttribute(ts, request.getNrSector(), requestSizeQuark); int mergedInQuark = fSs.getQuarkRelativeAndAdd(slotQuark, Attributes.MERGED_IN); fSs.modifyAttribute(ts, TmfStateValue.nullValue().unboxValue(), mergedInQuark); } catch (StateValueTypeException e) { Activator.getDefault().logError("Error inserting request", e); } updateQueuesLength(ts); return slotQuark; }

Target:
public int updateWaitingRequest(long ts, Request request, Long initialSector) { Pair<Request, Integer> reqQuark = fWaitingQueue.get(initialSector); if (reqQuark == null) { return addWaitingRequest(ts, request); } else if (!initialSector.equals(request.getSector())) { fWaitingQueue.remove(initialSector); fWaitingQueue.put(request.getSector(), reqQuark); } int slotQuark = reqQuark.getSecond(); try { int currentRequestQuark = fSs.getQuarkRelativeAndAdd(slotQuark, Attributes.CURRENT_REQUEST); fSs.modifyAttribute(ts, request.getSector(), currentRequestQuark); int requestSizeQuark = fSs.getQuarkRelativeAndAdd(slotQuark, Attributes.REQUEST_SIZE); fSs.modifyAttribute(ts, request.getNrSector(), requestSizeQuark); int mergedInQuark = fSs.getQuarkRelativeAndAdd(slotQuark, Attributes.MERGED_IN); fSs.modifyAttribute(ts, (Object) null, mergedInQuark); } catch (StateValueTypeException e) { Activator.getDefault().logError("Error inserting request", e); } updateQueuesLength(ts); return slotQuark; }
Source:
public Python(String n) { super(n); subscribe(Runtime.getInstance().getName(), "registered"); log.info("created python {}", getName()); log.info("creating module directory pythonModules"); new File("pythonModules").mkdir(); ServiceData sd = ServiceData.getLocalInstance(); Platform p = Platform.getLocalInstance(); List<ServiceType> sdt = sd.getAvailableServiceTypes(); for (int i = 0; i < sdt.size(); ++i) { ServiceType st = sdt.get(i); String url = String.format("%s/%s.py", st.getSimpleName(), st.getSimpleName()); exampleUrls.put(st.getSimpleName(), url); } localPythonFiles = getFileListing(); createPythonInterpreter(); attachPythonConsole(); }

Target:
public Python(String n) { super(n); subscribe(Runtime.getInstance().getName(), "registered"); log.info("created python {}", getName()); log.info("creating module directory pythonModules"); new File("pythonModules").mkdir(); ServiceData sd = ServiceData.getLocalInstance(); Platform p = Platform.getLocalInstance(); List<ServiceType> sdt = sd.getAvailableServiceTypes(); for (int i = 0; i < sdt.size(); ++i) { ServiceType st = sdt.get(i); String file = String.format("%s/%s.py", st.getSimpleName(), st.getSimpleName()); exampleFiles.put(st.getSimpleName(), file); } localPythonFiles = getFileListing(); createPythonInterpreter(); attachPythonConsole(); }
Source:
public byte[] serialize(Object object) { ObjectOutputStream oos = null; ByteArrayOutputStream baos = null; try { try { baos = new ByteArrayOutputStream(); oos = new ObjectOutputStream(baos); oos.writeObject(object); return baos.toByteArray(); } finally { if (oos != null) { oos.close(); } } } catch (Exception e) { throw new CacheException(e); } }

Target:
public byte[] serialize(Object object) { ObjectOutputStream oos = null; ByteArrayOutputStream baos = null; try { baos = new ByteArrayOutputStream(); oos = new ObjectOutputStream(baos); oos.writeObject(object); return baos.toByteArray(); } catch (Exception e) { throw new CacheException(e); } finally { if (oos != null) { try { oos.close(); } catch (IOException e) { } } } }
Source:
protected FormRenderingSettings getKieServerFormDisplayProcess(String serverTemplateId, String domainId, String processId, boolean isDynamic) { try { Map<String, Object> valuesMap = new HashMap<String, Object>(); valuesMap.put(RestURI.CONTAINER_ID, domainId); valuesMap.put(RestURI.PROCESS_ID, processId); valuesMap.put(RestURI.CASE_DEF_ID, processId); String url = "jbpm/forms?containerId=" + domainId + "&serverTemplateId=" + serverTemplateId; if (isDynamic) { url += "&caseDefId=" + processId; } else { url += "&processId=" + processId; } return new KieServerFormRenderingSettings(url); } catch (KieServicesException e) { logger.debug("Unable to find process form in remote server due to {}", e.getMessage()); } catch (Exception e) { logger.debug("Unable to render process form due to {}", e.getMessage()); } return null; }

Target:
protected FormRenderingSettings getKieServerFormDisplayProcess(String serverTemplateId, String domainId, String processId, boolean isDynamic) { try { String url = "jbpm/forms?containerId=" + domainId + "&serverTemplateId=" + serverTemplateId; if (isDynamic) { url += "&caseDefId=" + processId; } else { url += "&processId=" + processId; } return new KieServerFormRenderingSettings(url); } catch (KieServicesException e) { logger.debug("Unable to find process form in remote server due to {}", e.getMessage()); } catch (Exception e) { logger.debug("Unable to render process form due to {}", e.getMessage()); } return null; }
Source:
private void sendRelationshipErrorMessage( final String relationName, final User user ) { SystemMessageEventUtil systemMessageEventUtil = SystemMessageEventUtil.getInstance(); try { systemMessageEventUtil.pushMessage( new SystemMessageBuilder() .setMessage(LanguageUtil.format( user.getLocale(), "contenttypes.field.properties.relationship.required.error", relationName) ) .setSeverity(MessageSeverity.INFO) .setType(MessageType.SIMPLE_MESSAGE) .create(), list(user.getUserId()) ); } catch (LanguageException e) { throw new DotRuntimeException(e); } }

Target:
private void sendRelationshipErrorMessage( final String relationName, final User user ) { final SystemMessageEventUtil systemMessageEventUtil = SystemMessageEventUtil.getInstance(); try { systemMessageEventUtil.pushMessage( new SystemMessageBuilder() .setMessage(LanguageUtil.format( user.getLocale(), "contenttypes.field.properties.relationship.required.error", relationName) ) .setSeverity(MessageSeverity.INFO) .setType(MessageType.SIMPLE_MESSAGE) .create(), list(user.getUserId()) ); } catch (LanguageException e) { throw new DotRuntimeException(e); } }
Source:
public static boolean isLoggedIn() { if (currentUserSession == null) { LiferayLogger.e("You need to be logged to view the content!"); return false; } return true; }

Target:
public static boolean isLoggedIn() { return currentUserSession != null; }
Source:
public static String getCssValueFromTheme(Display display, String value) { BundleContext context = FrameworkUtil.getBundle(E4ThemeColor.class).getBundleContext(); try { Object reference = MethodUtils.invokeMethod(context, "getServiceReference", "org.eclipse.e4.ui.css.swt.theme.IThemeManager"); if (reference != null) { Object iThemeManager = MethodUtils.invokeMethod(context, "getService", reference); if (iThemeManager != null) { final Object themeEngine = MethodUtils.invokeMethod(iThemeManager, "getEngineForDisplay", display); if (themeEngine != null) { Shell shell = display.getActiveShell(); if (shell == null) { for (Shell input : display.getShells()) { Object shellStyle = MethodUtils.invokeMethod(themeEngine, "getStyle", input); if (shellStyle instanceof CSSStyleDeclaration) { shell = input; break; } } } if (shell != null) { Object shellStyle = MethodUtils.invokeMethod(themeEngine, "getStyle", shell); if (shellStyle instanceof CSSStyleDeclaration) { CSSValue cssValue = ((CSSStyleDeclaration) shellStyle).getPropertyCSSValue(value); if (cssValue != null) { return cssValue.getCssText(); } } } } } } } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) { logOnce(e); return null; } return null; }

Target:
public static String getCssValueFromTheme(Display display, String value) { BundleContext context = FrameworkUtil.getBundle(E4ThemeColor.class).getBundleContext(); try { Object reference = MethodUtils.invokeMethod(context, "getServiceReference", "org.eclipse.e4.ui.css.swt.theme.IThemeManager"); if (reference != null) { Object iThemeManager = MethodUtils.invokeMethod(context, "getService", reference); if (iThemeManager != null) { Object themeEngine = MethodUtils.invokeMethod(iThemeManager, "getEngineForDisplay", display); if (themeEngine != null) { Shell shell = display.getActiveShell(); CSSStyleDeclaration shellStyle = null; if (shell != null) { shellStyle = getStyleDeclaration(themeEngine, shell); } else { for (Shell input : display.getShells()) { shellStyle = getStyleDeclaration(themeEngine, input); if (shellStyle != null) { break; } } } if (shellStyle != null) { CSSValue cssValue = shellStyle.getPropertyCSSValue(value); if (cssValue != null) { return cssValue.getCssText(); } } } } } } catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) { logOnce(e); return null; } return null; }
Source:
private FlinkUserCodeClassLoader ensureInner() { if (inner == null) { throw new IllegalStateException("Trying to access closed classloader. Please check if you store " + "classloaders directly or indirectly in static fields. If the stacktrace suggests that the leak " + "occurs in a third party library and cannot be fixed immediately, you can disable this check " + "with the configuration 'classloader.check_leaked_classloader'."); } return inner; }

Target:
private FlinkUserCodeClassLoader ensureInner() { if (inner == null) { throw new IllegalStateException("Trying to access closed classloader. Please check if you store " + "classloaders directly or indirectly in static fields. If the stacktrace suggests that the leak " + "occurs in a third party library and cannot be fixed immediately, you can disable this check " + "with the configuration '" + CoreOptions.CHECK_LEAKED_CLASSLOADER.key() + "'."); } return inner; }
Source:
public boolean isProtected(ProtectionType type) { int armorCount = 0; boolean first = true; NamespacedKey setId = null; for (HashedArmorpiece armor : armor) { Optional<SlimefunArmorPiece> armorPiece = armor.getItem(); if (!armorPiece.isPresent()) return false; if (armorPiece.get() instanceof CustomProtection) { CustomProtection protectedArmor = (CustomProtection) armorPiece.get(); if (first) { if (protectedArmor.isFullSetRequired()) setId = armorPiece.get().getSetId(); first = false; } for (ProtectionType protectionType : protectedArmor.getProtectionTypes()) { if (protectionType == type) { if (setId == null) { return true; } else if (setId.equals(armorPiece.get().getSetId())) { armorCount++; } } } } } return armorCount == 4; }

Target:
public boolean isProtected(ProtectionType type) { int armorCount = 0; NamespacedKey setId = null; for (HashedArmorpiece armor : armor) { Optional<SlimefunArmorPiece> armorPiece = armor.getItem(); if (!armorPiece.isPresent()) return false; if (armorPiece.get() instanceof CustomProtection) { CustomProtection protectedArmor = (CustomProtection) armorPiece.get(); if (setId == null && protectedArmor.isFullSetRequired()) { setId = protectedArmor.getSetId(); } for (ProtectionType protectionType : protectedArmor.getProtectionTypes()) { if (protectionType == type) { if (setId == null) { return true; } else if (setId.equals(protectedArmor.getSetId())) { armorCount++; } } } } } return armorCount == 4; }
Source:
public void updateParticipant(String identifier, ChatRoomMember chatRoomMember) { if(this.participants.containsKey(identifier)) { this.participants.get(identifier).setChatMember(chatRoomMember); } else { logger.warn("Asked to set chatroom member of participant with " + "identifier " + identifier + "while it wasn't added before"); } }

Target:
public void updateParticipant(String identifier, ChatRoomMember chatRoomMember) { maybeAddParticipant(identifier); Participant participant = getParticipant(identifier); if (participant != null) { participant.setChatMember(chatRoomMember); } else { logger.warn("Asked to set chatroom member of participant with "+ "identifier "+ identifier+ "while it wasn't added before"); } }
Source:
public static boolean isEncrypted(String blobIdString) { if (blobIdString == null) { return false; } DataInputStream stream = new DataInputStream(new ByteBufferInputStream(ByteBuffer.wrap(Base64.decodeBase64(blobIdString)))); boolean isEncrypted = false; try { short version = stream.readShort(); if (version >= BLOB_ID_V3) { isEncrypted = (stream.readByte() & IS_ENCRYPTED_MASK) != 0; } } catch (IOException e) { isEncrypted = false; } finally { return isEncrypted; } }

Target:
public static boolean isEncrypted(String blobIdString) throws IOException { DataInputStream stream = new DataInputStream(new ByteBufferInputStream(ByteBuffer.wrap(Base64.decodeBase64(blobIdString)))); return (stream.readShort() >= BLOB_ID_V3) && ((stream.readByte() & IS_ENCRYPTED_MASK) != 0); }
Source:
protected String createFuzzerName(HttpMessage message) { String uri = message.getRequestHeader().getURI().toString(); if (uri.length() > 30) { uri = uri.substring(0, 14) + ".." + uri.substring(uri.length() - 15, uri.length()); } return Constant.messages.getString("fuzz.httpfuzzer.fuzzerNamePrefix", uri); }

Target:
private String createFuzzerName(HttpMessage message) { String uri = message.getRequestHeader().getURI().toString(); if (uri.length() > 30) { uri = uri.substring(0, 14) + ".." + uri.substring(uri.length() - 15, uri.length()); } return Constant.messages.getString("fuzz.httpfuzzer.fuzzerNamePrefix", uri); }
Source:
private void updateWithResources(List<IProject> newValue) { Map<IProject, ProjectWrapper> updated = new HashMap<>(); boolean changed = false; synchronized (projects) { HashMap<IProject, ProjectWrapper> oldWrappers = new HashMap<>(projects); projects.clear(); for (IProject r : newValue) { ProjectWrapper existingWrapper = oldWrappers.remove(r); if (existingWrapper == null) { ProjectWrapper newWrapper = new ProjectWrapper(this, r); resourceCache.add(r); WatchManager.getInstance().startWatch(newWrapper.getWrapped(), newWrapper.getParent().getWrapped(), ResourceKind.PROJECT); projects.put(r, newWrapper); changed = true; } else { projects.put(r, existingWrapper); updated.put(r, existingWrapper); } } if (!oldWrappers.isEmpty()) { changed = true; } } updated.keySet().forEach(r -> { ProjectWrapper wrapper = updated.get(r); wrapper.updateWith(r); }); if (changed) { fireChanged(); } }

Target:
private void updateWithResources(List<IProject> newValue) { Map<IProject, ProjectWrapper> updated = new HashMap<>(); boolean changed = false; synchronized (projects) { HashMap<String, ProjectWrapper> oldWrappers = new HashMap<>(projects); projects.clear(); for (IProject r : newValue) { ProjectWrapper existingWrapper = oldWrappers.remove(r.getName()); if (existingWrapper == null) { ProjectWrapper newWrapper = new ProjectWrapper(this, r); resourceCache.add(r); WatchManager.getInstance().startWatch(newWrapper.getWrapped(), newWrapper.getParent().getWrapped(), ResourceKind.PROJECT); projects.put(r.getName(), newWrapper); changed = true; } else { projects.put(r.getName(), existingWrapper); updated.put(r, existingWrapper); } } if (!oldWrappers.isEmpty()) { changed = true; } } updated.keySet().forEach(r -> { ProjectWrapper wrapper = updated.get(r); wrapper.updateWith(r); }); if (changed) { fireChanged(); } }
Source:
public DirCache call() throws NoFilepatternException { Git git = new Git(getRepository()); File srcFile = new File(getRepository().getWorkTree(), source); File dstFile = new File(getRepository().getWorkTree(), destination); srcFile.renameTo(dstFile); git.add().addFilepattern(destination).call(); return git.rm().addFilepattern(source).call(); }

Target:
public DirCache call() throws GitAPIException { if (source == null || destination == null) throw new NoFilepatternException( JGitText.get().sourceDestinationMustBeProvided); try { Git git = new Git(getRepository()); File srcFile = new File(getRepository().getWorkTree(), source); if (!isTracked(srcFile)) { throw new MoveException( JGitText.get().sourceIsNotUnderVersionControl); } File dstFile = new File(getRepository().getWorkTree(), destination); srcFile.renameTo(dstFile); git.add().addFilepattern(destination).call(); return git.rm().addFilepattern(source).call(); } catch (IOException e) { throw new JGitInternalException( MessageFormat.format( JGitText.get().exceptionCaughtDuringExecutionOfMvCommand, e), e); } }
Source:
public void testAttachmentAtBoot() { if (volumeApi.isPresent()) { String server_id = null; try { CreateServerOptions createServerOptions = CreateServerOptions.Builder.blockDeviceMapping( Collections.singletonList(new BlockDeviceMapping().deviceName("/dev/vdf").volumeId(testVolume.getId()))); final String serverId = server_id = createServerInZone(zone, createServerOptions).getId(); Set<? extends VolumeAttachment> attachments = volumeAttachmentApi.get().listAttachmentsOnServer(serverId).toSet(); assertNotNull(attachments); assertEquals(volumeApi.get().get(testVolume.getId()).getStatus(), Volume.Status.IN_USE); final int before = attachments.size(); boolean foundIt = false; for (VolumeAttachment att : attachments) { VolumeAttachment details = volumeAttachmentApi.get() .getAttachmentForVolumeOnServer(att.getVolumeId(), serverId); assertNotNull(details); assertNotNull(details.getId()); assertNotNull(details.getServerId()); assertNotNull(details.getVolumeId()); if (Objects.equal(details.getVolumeId(), testVolume.getId())) { foundIt = true; assertEquals(details.getDevice(), "/dev/vdf"); assertEquals(details.getServerId(), serverId); } } assertTrue(foundIt, "Failed to find the attachment we set in listAttachments() response"); volumeAttachmentApi.get().detachVolumeFromServer(testVolume.getId(), serverId); assertTrue(retry(new Predicate<VolumeAttachmentApi>() { public boolean apply(VolumeAttachmentApi volumeAttachmentApi) { return volumeAttachmentApi.listAttachmentsOnServer(serverId).size() == before - 1; } }, 60 * 1000L).apply(volumeAttachmentApi.get())); } finally { if (server_id != null) api.getServerApiForZone(zone).delete(server_id); } } }

Target:
public void testAttachmentAtBoot() { if (volumeApi.isPresent()) { String server_id = null; BlockDeviceMapping blockDeviceMapping = BlockDeviceMapping.createOptions(testVolume.getId(), "/dev/vdf").build(); try { CreateServerOptions createServerOptions = CreateServerOptions.Builder.blockDeviceMapping(ImmutableSet.of(blockDeviceMapping)); final String serverId = server_id = createServerInRegion(region, createServerOptions).getId(); Set<? extends VolumeAttachment> attachments = volumeAttachmentApi.get() .listAttachmentsOnServer(serverId).toSet(); VolumeAttachment attachment = Iterables.getOnlyElement(attachments); VolumeAttachment details = volumeAttachmentApi.get() .getAttachmentForVolumeOnServer(attachment.getVolumeId(), serverId); assertNotNull(details.getId()); assertEquals(details.getVolumeId(), testVolume.getId()); assertEquals(details.getDevice(), "/dev/vdf"); assertEquals(details.getServerId(), serverId); assertEquals(volumeApi.get().get(testVolume.getId()).getStatus(), Volume.Status.IN_USE); assertTrue(volumeAttachmentApi.get().detachVolumeFromServer(testVolume.getId(), serverId), "Could not detach volume " + testVolume.getId() + " from server " + serverId); assertEquals(volumeAttachmentApi.get().listAttachmentsOnServer(serverId).size(), 0, "Number of volumes on server " + serverId + " was not zero."); } finally { if (server_id != null) { api.getServerApi(region).delete(server_id); } } } }
Source:
public List<Relationship> getLeftRelations(Context context, Entity entity) { List<Relationship> fullList = this.getAllRelations(context, entity); List<Relationship> listToReturn = new LinkedList<>(); for (Relationship relationship : fullList) { if (relationship.getLeftItem() == entity.getItem()) { listToReturn.add(relationship); } } return listToReturn; }

Target:
public List<Relationship> getLeftRelations(Context context, Entity entity) { List<Relationship> fullList = entity.getRelationships(); List<Relationship> listToReturn = new LinkedList<>(); for (Relationship relationship : fullList) { if (relationship.getLeftItem().getID() == entity.getItem().getID()) { listToReturn.add(relationship); } } return listToReturn; }
Source:
public boolean hasCompatibleMimeType(List<String> mimeTypes, String mimeType) { String mt = parseMimeType(mimeType); Set<String> expectedMimeTypes = new HashSet<>(); expectedMimeTypes.add(ANY_MIME_TYPE); if (mimeType != null) { expectedMimeTypes.add(mt); expectedMimeTypes.add(computeMimeTypeWithWildcardSubType(mt)); } return mimeTypes.stream().anyMatch(expectedMimeTypes::contains); }

Target:
public boolean hasCompatibleMimeType(List<String> mimeTypes, String mimeType) { String mt = parseMimeType(mimeType); Set<String> expectedMimeTypes = new HashSet<>(); expectedMimeTypes.add(ANY_MIME_TYPE); if (mt != null) { expectedMimeTypes.add(mt); expectedMimeTypes.add(computeMimeTypeWithWildcardSubType(mt)); } return mimeTypes.stream().anyMatch(expectedMimeTypes::contains); }
Source:
public Boolean isLocal() { Boolean isLocal = this.pluginConfig.getSimple(Property.LOCAL).getBooleanValue(); if (isLocal == null) { return Boolean.FALSE; } return isLocal; }

Target:
public Boolean isLocal() { return Boolean.valueOf(this.pluginConfig.getSimpleValue(Property.LOCAL, "false")); }
Source:
private List<Grant> testPushInternal(boolean disableAcl, String ownerId, String ownerDisplayName) throws Exception { ServerSideEncryptingAmazonS3 s3Client = EasyMock.createMock(ServerSideEncryptingAmazonS3.class); EasyMock.expect(s3Client.putObject(EasyMock.anyObject())) .andReturn(new PutObjectResult()) .once(); AccessControlList aclExpected = new AccessControlList(); aclExpected.setOwner(new Owner("test_owner", "test_owner")); EasyMock.expect(s3Client.getBucketAcl("test_bucket")) .andReturn(aclExpected) .once(); EasyMock.expect(s3Client.putObject(EasyMock.anyObject(PutObjectRequest.class))) .andReturn(new PutObjectResult()) .once(); EasyMock.replay(s3Client); S3TaskLogsConfig config = new S3TaskLogsConfig(); config.setDisableAcl(disableAcl); config.setS3Bucket("test_bucket"); S3TaskLogs s3TaskLogs = new S3TaskLogs(s3Client, config); String taskId = "index_test-datasource_2019-06-18T13:30:28.887Z"; File logFile = tempFolder.newFile("test_log_file"); s3TaskLogs.pushTaskLog(taskId, logFile); List<Grant> grantsAsList = aclExpected.getGrantsAsList(); return grantsAsList; }

Target:
private List<Grant> testPushInternal(boolean disableAcl, String ownerId, String ownerDisplayName) throws Exception { ServerSideEncryptingAmazonS3 s3Client = EasyMock.createMock(ServerSideEncryptingAmazonS3.class); EasyMock.expect(s3Client.putObject(EasyMock.anyObject())) .andReturn(new PutObjectResult()) .once(); AccessControlList aclExpected = new AccessControlList(); aclExpected.setOwner(new Owner(ownerId, ownerDisplayName)); EasyMock.expect(s3Client.getBucketAcl("test_bucket")) .andReturn(aclExpected) .once(); EasyMock.expect(s3Client.putObject(EasyMock.anyObject(PutObjectRequest.class))) .andReturn(new PutObjectResult()) .once(); EasyMock.replay(s3Client); S3TaskLogsConfig config = new S3TaskLogsConfig(); config.setDisableAcl(disableAcl); config.setS3Bucket("test_bucket"); S3TaskLogs s3TaskLogs = new S3TaskLogs(s3Client, config); String taskId = "index_test-datasource_2019-06-18T13:30:28.887Z"; File logFile = tempFolder.newFile("test_log_file"); s3TaskLogs.pushTaskLog(taskId, logFile); List<Grant> grantsAsList = aclExpected.getGrantsAsList(); return grantsAsList; }
Source:
private Shell getShell(FileModificationValidationContext context) { if (context.getShell() != null) return (Shell)context.getShell(); IWorkbench workbench = getWorkbench(); if (workbench != null) { IWorkbenchWindow window = workbench.getActiveWorkbenchWindow(); if (window != null) { return window.getShell(); } } return null; }

Target:
private Shell getShell(FileModificationValidationContext context) { if (context.getShell() != null) return (Shell)context.getShell(); IWorkbench workbench = PlatformUI.getWorkbench(); IWorkbenchWindow window = workbench.getActiveWorkbenchWindow(); if (window != null) { return window.getShell(); } return null; }
Source:
boolean addReplicaInfoIfAbsent(RemoteReplicaInfo remoteReplicaInfo) { lock.lock(); boolean isAdded = false; try { List<RemoteReplicaInfo> foundSameReplica = remoteReplicas.stream() .filter(info -> info.getReplicaId() == remoteReplicaInfo.getReplicaId()) .collect(Collectors.toList()); if (foundSameReplica.isEmpty()) { remoteReplicas.add(remoteReplicaInfo); isAdded = true; } } finally { lock.unlock(); } return isAdded; }

Target:
boolean addReplicaInfoIfAbsent(RemoteReplicaInfo remoteReplicaInfo) { rwLock.writeLock().lock(); boolean isAdded = false; try { List<RemoteReplicaInfo> foundSameReplica = remoteReplicas.stream() .filter(info -> info.getReplicaId() == remoteReplicaInfo.getReplicaId()) .collect(Collectors.toList()); if (foundSameReplica.isEmpty()) { remoteReplicas.add(remoteReplicaInfo); isAdded = true; } } finally { rwLock.writeLock().unlock(); } return isAdded; }
Source:
public void testGetSingleInvalidTable() throws Exception { queryStore.get(UUID.randomUUID().toString(), UUID.randomUUID().toString()); }

Target:
public void testGetSingleInvalidTable() throws Exception { try { queryStore.get(UUID.randomUUID().toString(), UUID.randomUUID().toString()); } catch (QueryStoreException e) { assertEquals(QueryStoreException.ErrorCode.NO_SUCH_TABLE, e.getErrorCode()); throw e; } }
Source:
public List<Class> getSupportedTypes() { return new ArrayList<>(Arrays.asList(BigDecimal.class)); }

Target:
public List<Class> getSupportedTypes() { return Collections.singletonList(BigDecimal.class); }
Source:
private static ZoneOffset idToZoneOffset(ZoneId zoneId) { String id = zoneId.getValue(); java.time.ZoneId javaZoneId = java.time.ZoneId.of(id); int offsetInSeconds = ZonedDateTime.now(javaZoneId) .getOffset() .getTotalSeconds(); ZoneOffset offset = ZoneOffset .newBuilder() .setAmountSeconds(offsetInSeconds) .build(); return offset; }

Target:
private static ZoneOffset idToZoneOffset(ZoneId zoneId) { java.time.ZoneId javaZoneId = java.time.ZoneId.of(zoneId.getValue()); int offsetInSeconds = ZonedDateTime.now(javaZoneId) .getOffset() .getTotalSeconds(); ZoneOffset offset = ZoneOffset .newBuilder() .setAmountSeconds(offsetInSeconds) .build(); return offset; }
Source:
public boolean removeQueues(Queue... queues) { Assert.notNull(queues, "'queues' cannot be null"); Assert.noNullElements(queues, "'queues' cannot contain null elements"); return removeQueueNames(Arrays.stream(queues) .map(q -> q.getName()) .collect(Collectors.toList()) .toArray(new String[0])); }

Target:
public boolean removeQueues(Queue... queues) { Assert.notNull(queues, "'queues' cannot be null"); Assert.noNullElements(queues, "'queues' cannot contain null elements"); return removeQueueNames(Arrays.stream(queues) .map(q -> q.getActualName()) .toArray(String[]::new)); }
Source:
public boolean hasAggregateOrGroupby() { return hasAggregateExpression() || isGrouped(); }

Target:
public boolean hasAggregateOrGroupby() { return m_hasAggregateExpression || isGrouped(); }
Source:
public void testEBPointToPointWithReply() { EventBus eb = Vertx.vertx().eventBus(); MessageConsumer<String> mc = eb.consumer("news.uk.sport"); mc.handler(message -> { System.out.println("I have received a message: " + message.body()); message.reply("Thanks for the message"); }); mc.completionHandler(res -> { if (res.succeeded()) { System.out.println("The handler registration has reached all nodes"); eb.send("news.uk.sport", "Yay! Someone kicked a ball", new Handler<AsyncResult<Message<String>>>() { @Override public void handle(AsyncResult<Message<String>> message) { System.out.println("Received reply: " + message.result().body()); } }); } else { System.out.println("Registration failed!"); } }); mc.unregister(); checkBTxnFragments(); }

Target:
public void testEBPointToPointWithReply() throws InterruptedException { EventBus eb = Vertx.vertx().eventBus(); CountDownLatch latch = new CountDownLatch(1); MessageConsumer<String> mc = eb.consumer("news.uk.sport"); mc.handler(message -> { System.out.println("I have received a message: " + message.body()); message.reply("Thanks for the message"); }); mc.completionHandler(res -> { if (res.succeeded()) { System.out.println("The handler registration has reached all nodes"); eb.send("news.uk.sport", "Yay! Someone kicked a ball", new Handler<AsyncResult<Message<String>>>() { @Override public void handle(AsyncResult<Message<String>> message) { System.out.println("Received reply: " + message.result().body()); latch.countDown(); } }); } else { System.out.println("Registration failed!"); } }); latch.await(2, TimeUnit.SECONDS); mc.unregister(); checkBTxnFragments(); }
Source:
public void threadStressTest() { Realm realm = Realm.getInstance(realmConfig); populateTestRealm(realm); for (int i = 0; i < MAX_THREADS; i++) { CRUDAction action = CRUDAction.fromValue(random.nextInt(4)); ThreadWrapper thread = null; switch(action) { case CREATE: thread = createObjects(random.nextInt(MAX_CREATE), random.nextBoolean()); break; case READ: thread = readObjects(random.nextBoolean()); break; case UPDATE: thread = updateObjects(random.nextBoolean(), random.nextBoolean()); break; case DELETE: thread = deleteObjects(random.nextBoolean(), random.nextBoolean()); break; } threads.add(thread); thread.start(); } for (ThreadWrapper thread : threads) { thread.join(); } realm.close(); }

Target:
public void threadStressTest() throws ExecutionException, InterruptedException { Realm realm = Realm.getInstance(realmConfig); populateTestRealm(realm); for (int i = 0; i < MAX_THREADS; i++) { CRUDAction action = CRUDAction.values()[random.nextInt(4)]; Runnable task = null; switch(action) { case CREATE: task = createObjects(random.nextInt(MAX_CREATE), random.nextBoolean()); break; case READ: task = readObjects(random.nextBoolean()); break; case UPDATE: task = updateObjects(random.nextBoolean(), random.nextBoolean()); break; case DELETE: task = deleteObjects(random.nextBoolean(), random.nextBoolean()); break; } threads.add(executor.submit(task)); } for (Future task : threads) { assertNull(task.get()); } realm.close(); }
Source:
public void addMany(MetaParam... metaParams) { if (metas.length == 0) { if (metaParams.getClass().getComponentType() == MetaParam.class) { metas = metaParams; } else { metas = Arrays.copyOf(metaParams, metaParams.length, MetaParam[].class); } length = (int) Stream.of(metas).filter(Objects::nonNull).count(); } else { List<MetaParam<?>> notFound = new ArrayList<>(metaParams.length); for (MetaParam newMeta : metaParams) { int hole = -1; boolean found = false; for (int i = 0; i < metas.length; i++) { MetaParam<?> m = metas[i]; if (m == null) { hole = i; } else if (m.getClass().isAssignableFrom(newMeta.getClass())) { metas[i] = newMeta; found = true; break; } } if (!found) { ++length; if (hole < 0) { notFound.add(newMeta); } else { metas[hole] = newMeta; } } } if (!notFound.isEmpty()) { MetaParam<?>[] newMetas = Arrays.copyOf(metas, metas.length + notFound.size()); int i = metas.length; for (MetaParam<?> meta : notFound) { newMetas[i++] = meta; } } } assert checkLength(); }

Target:
public void addMany(MetaParam... metaParams) { if (metas.length == 0) { if (metaParams.getClass().getComponentType() == MetaParam.class) { metas = metaParams; } else { metas = Arrays.copyOf(metaParams, metaParams.length, MetaParam[].class); } length = (int) Stream.of(metas).filter(Objects::nonNull).count(); } else { List<MetaParam<?>> notFound = new ArrayList<>(metaParams.length); for (MetaParam newMeta : metaParams) { updateExisting(newMeta, notFound); } if (!notFound.isEmpty()) { MetaParam<?>[] newMetas = Arrays.copyOf(metas, metas.length + notFound.size()); int i = metas.length; for (MetaParam<?> meta : notFound) { newMetas[i++] = meta; } metas = newMetas; } } assert checkLength(); }
Source:
protected Builder makeUserRequestBuilder(UserInfo info) { Builder builder = new Request.Builder(); if (info != null) { if (this.constructorToken != null) { builder.addHeader("x-cnstrc-token", this.constructorToken); } if (info.getForwardedFor() != null) { builder.addHeader("x-forwarded-for", info.getForwardedFor()); } } return builder; }

Target:
protected Builder makeUserRequestBuilder(UserInfo info) { Builder builder = new Request.Builder(); if (this.constructorToken != null) { builder.addHeader("x-cnstrc-token", this.constructorToken); } if (info != null && info.getForwardedFor() != null) { builder.addHeader("x-forwarded-for", info.getForwardedFor()); } return builder; }
Source:
public static Properties defaultProperties() { Properties properties = new Properties(); properties.setProperty(TEMPLATE, "osFamily=UBUNTU,loginUser=jclouds"); return properties; }

Target:
public static Properties defaultProperties() { Properties properties = AzureManagementApiMetadata.defaultProperties(); properties.setProperty(TEMPLATE, "osFamily=UBUNTU,loginUser=jclouds"); properties.setProperty(OPERATION_TIMEOUT, "" + 60 * 1000); properties.setProperty(OPERATION_POLL_INITIAL_PERIOD, "" + 5); properties.setProperty(OPERATION_POLL_MAX_PERIOD, "" + 15); properties.setProperty(AzureComputeProperties.TCP_RULE_FORMAT, "tcp_%s-%s"); return properties; }