Jump to content

Java 7 to java 8


Recommended Posts

5 minutes ago, maldito171 said:

hi, i have a question about (  ->  ) on java 8. this arrow is what code in java 7?
 

Sorry for bad en, and thanks for who can help me.

 

That is lamba expression. Write me down the code from java 8. 

Link to comment
Share on other sites

    

	
	public static void changeProcess(BanProssesInfo process)
	{
		BanProssesInfo prosess = conteins(process);
		
		if (prosess != null)
			_list.remove(prosess);
		else
			_list.add(process);
		
		updateData();
		
		L2World.getInstance().getPlayers().stream().filter(player -> player.isOnline() && !player.getClient().getInformation().isOfflineShop()).forEach(pl -> _list.forEach(pros -> pl.sendPacket(new BlockedProcessUpdate(pros))));
	}
	

Thanks man.
 

Sem título.png

Link to comment
Share on other sites

You can use lamba instead of a for loop, add it to the runnable call method, and so on.

getPlayers() seems wrong method name, it can be getAllPlayers() or so. Check your L2World for proper name.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...